Browse Source

Merge pull request #2 from ErikZalm/Marlin_v1

Sync up to Marlin
filipmu 10 years ago
parent
commit
b014fd1ad2

+ 14
- 3
Marlin/Configuration.h View File

12
 // example_configurations/delta directory.
12
 // example_configurations/delta directory.
13
 //
13
 //
14
 
14
 
15
+//===========================================================================
16
+//============================= SCARA Printer ===============================
17
+//===========================================================================
18
+// For a Delta printer replace the configuration files with the files in the
19
+// example_configurations/SCARA directory.
20
+//
21
+
15
 // User-specified version info of this build to display in [Pronterface, etc] terminal window during
22
 // User-specified version info of this build to display in [Pronterface, etc] terminal window during
16
 // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
23
 // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
17
 // build by the user have been successfully uploaded into firmware.
24
 // build by the user have been successfully uploaded into firmware.
24
 #define SERIAL_PORT 0
31
 #define SERIAL_PORT 0
25
 
32
 
26
 // This determines the communication speed of the printer
33
 // This determines the communication speed of the printer
27
-// This determines the communication speed of the printer
28
 #define BAUDRATE 250000
34
 #define BAUDRATE 250000
29
 
35
 
30
 // This enables the serial port associated to the Bluetooth interface
36
 // This enables the serial port associated to the Bluetooth interface
42
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
48
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
43
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
49
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
44
 // 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
50
 // 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
51
+// 36 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Fan)
45
 // 4  = Duemilanove w/ ATMega328P pin assignment
52
 // 4  = Duemilanove w/ ATMega328P pin assignment
46
 // 5  = Gen6
53
 // 5  = Gen6
47
 // 51 = Gen6 deluxe
54
 // 51 = Gen6 deluxe
72
 // 301= Rambo
79
 // 301= Rambo
73
 // 21 = Elefu Ra Board (v3)
80
 // 21 = Elefu Ra Board (v3)
74
 // 88 = 5DPrint D8 Driver Board
81
 // 88 = 5DPrint D8 Driver Board
82
+// 999 = Leapfrog
75
 
83
 
76
 #ifndef MOTHERBOARD
84
 #ifndef MOTHERBOARD
77
 #define MOTHERBOARD 7
85
 #define MOTHERBOARD 7
119
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
127
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
120
 // 11 is 100k beta 3950 1% thermistor (4.7k pullup)
128
 // 11 is 100k beta 3950 1% thermistor (4.7k pullup)
121
 // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
129
 // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
130
+// 13 is 100k Hisens 3950  1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" 
122
 // 20 is the PT100 circuit found in the Ultimainboard V2.x
131
 // 20 is the PT100 circuit found in the Ultimainboard V2.x
123
 // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
132
 // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
124
 //
133
 //
132
 // 1010 is Pt1000 with 1k pullup (non standard)
141
 // 1010 is Pt1000 with 1k pullup (non standard)
133
 // 147 is Pt100 with 4k7 pullup
142
 // 147 is Pt100 with 4k7 pullup
134
 // 110 is Pt100 with 1k pullup (non standard)
143
 // 110 is Pt100 with 1k pullup (non standard)
135
-// 70 is 500C thermistor for Pico hot end
136
 
144
 
137
 #define TEMP_SENSOR_0 -1
145
 #define TEMP_SENSOR_0 -1
138
 #define TEMP_SENSOR_1 -1
146
 #define TEMP_SENSOR_1 -1
185
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
193
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
186
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
194
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
187
   #define K1 0.95 //smoothing factor within the PID
195
   #define K1 0.95 //smoothing factor within the PID
188
-  #define PID_dT ((OVERSAMPLENR * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
196
+  #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
189
 
197
 
190
 // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
198
 // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
191
 // Ultimaker
199
 // Ultimaker
376
 //============================= Bed Auto Leveling ===========================
384
 //============================= Bed Auto Leveling ===========================
377
 
385
 
378
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
386
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
387
+#define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
379
 
388
 
380
 #ifdef ENABLE_AUTO_BED_LEVELING
389
 #ifdef ENABLE_AUTO_BED_LEVELING
381
 
390
 
436
   #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
445
   #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
437
   #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
446
   #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
438
 
447
 
448
+  //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
449
+  //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
439
 
450
 
440
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
451
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
441
   //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
452
   //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.

+ 35
- 11
Marlin/ConfigurationStore.cpp View File

37
 // the default values are used whenever there is a change to the data, to prevent
37
 // the default values are used whenever there is a change to the data, to prevent
38
 // wrong data being written to the variables.
38
 // wrong data being written to the variables.
39
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
39
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
40
-#ifdef DELTA
41
-#define EEPROM_VERSION "V11"
42
-#else
40
+
43
 #define EEPROM_VERSION "V10"
41
 #define EEPROM_VERSION "V10"
42
+#ifdef DELTA
43
+	#undef EEPROM_VERSION
44
+	#define EEPROM_VERSION "V11"
45
+#endif
46
+#ifdef SCARA
47
+	#undef EEPROM_VERSION
48
+	#define EEPROM_VERSION "V12"
44
 #endif
49
 #endif
45
 
50
 
46
 #ifdef EEPROM_SETTINGS
51
 #ifdef EEPROM_SETTINGS
49
   char ver[4]= "000";
54
   char ver[4]= "000";
50
   int i=EEPROM_OFFSET;
55
   int i=EEPROM_OFFSET;
51
   EEPROM_WRITE_VAR(i,ver); // invalidate data first 
56
   EEPROM_WRITE_VAR(i,ver); // invalidate data first 
52
-  EEPROM_WRITE_VAR(i,axis_steps_per_unit);  
57
+  EEPROM_WRITE_VAR(i,axis_steps_per_unit);
53
   EEPROM_WRITE_VAR(i,max_feedrate);  
58
   EEPROM_WRITE_VAR(i,max_feedrate);  
54
   EEPROM_WRITE_VAR(i,max_acceleration_units_per_sq_second);
59
   EEPROM_WRITE_VAR(i,max_acceleration_units_per_sq_second);
55
   EEPROM_WRITE_VAR(i,acceleration);
60
   EEPROM_WRITE_VAR(i,acceleration);
60
   EEPROM_WRITE_VAR(i,max_xy_jerk);
65
   EEPROM_WRITE_VAR(i,max_xy_jerk);
61
   EEPROM_WRITE_VAR(i,max_z_jerk);
66
   EEPROM_WRITE_VAR(i,max_z_jerk);
62
   EEPROM_WRITE_VAR(i,max_e_jerk);
67
   EEPROM_WRITE_VAR(i,max_e_jerk);
63
-  EEPROM_WRITE_VAR(i,add_homeing);
68
+  EEPROM_WRITE_VAR(i,add_homing);
64
   #ifdef DELTA
69
   #ifdef DELTA
65
   EEPROM_WRITE_VAR(i,endstop_adj);
70
   EEPROM_WRITE_VAR(i,endstop_adj);
66
   EEPROM_WRITE_VAR(i,delta_radius);
71
   EEPROM_WRITE_VAR(i,delta_radius);
93
     int lcd_contrast = 32;
98
     int lcd_contrast = 32;
94
   #endif
99
   #endif
95
   EEPROM_WRITE_VAR(i,lcd_contrast);
100
   EEPROM_WRITE_VAR(i,lcd_contrast);
101
+  #ifdef SCARA
102
+  EEPROM_WRITE_VAR(i,axis_scaling);        // Add scaling for SCARA
103
+  #endif
96
   char ver2[4]=EEPROM_VERSION;
104
   char ver2[4]=EEPROM_VERSION;
97
   i=EEPROM_OFFSET;
105
   i=EEPROM_OFFSET;
98
   EEPROM_WRITE_VAR(i,ver2); // validate data
106
   EEPROM_WRITE_VAR(i,ver2); // validate data
115
     SERIAL_ECHOLN("");
123
     SERIAL_ECHOLN("");
116
       
124
       
117
     SERIAL_ECHO_START;
125
     SERIAL_ECHO_START;
126
+#ifdef SCARA
127
+SERIAL_ECHOLNPGM("Scaling factors:");
128
+    SERIAL_ECHO_START;
129
+    SERIAL_ECHOPAIR("  M365 X",axis_scaling[0]);
130
+    SERIAL_ECHOPAIR(" Y",axis_scaling[1]);
131
+    SERIAL_ECHOPAIR(" Z",axis_scaling[2]);
132
+    SERIAL_ECHOLN("");
133
+      
134
+    SERIAL_ECHO_START;
135
+#endif
118
     SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
136
     SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
119
     SERIAL_ECHO_START;
137
     SERIAL_ECHO_START;
120
     SERIAL_ECHOPAIR("  M203 X",max_feedrate[0]);
138
     SERIAL_ECHOPAIR("  M203 X",max_feedrate[0]);
152
     SERIAL_ECHO_START;
170
     SERIAL_ECHO_START;
153
     SERIAL_ECHOLNPGM("Home offset (mm):");
171
     SERIAL_ECHOLNPGM("Home offset (mm):");
154
     SERIAL_ECHO_START;
172
     SERIAL_ECHO_START;
155
-    SERIAL_ECHOPAIR("  M206 X",add_homeing[0] );
156
-    SERIAL_ECHOPAIR(" Y" ,add_homeing[1] );
157
-    SERIAL_ECHOPAIR(" Z" ,add_homeing[2] );
173
+    SERIAL_ECHOPAIR("  M206 X",add_homing[0] );
174
+    SERIAL_ECHOPAIR(" Y" ,add_homing[1] );
175
+    SERIAL_ECHOPAIR(" Z" ,add_homing[2] );
158
     SERIAL_ECHOLN("");
176
     SERIAL_ECHOLN("");
159
 #ifdef DELTA
177
 #ifdef DELTA
160
     SERIAL_ECHO_START;
178
     SERIAL_ECHO_START;
196
     if (strncmp(ver,stored_ver,3) == 0)
214
     if (strncmp(ver,stored_ver,3) == 0)
197
     {
215
     {
198
         // version number match
216
         // version number match
199
-        EEPROM_READ_VAR(i,axis_steps_per_unit);  
217
+        EEPROM_READ_VAR(i,axis_steps_per_unit);
200
         EEPROM_READ_VAR(i,max_feedrate);  
218
         EEPROM_READ_VAR(i,max_feedrate);  
201
         EEPROM_READ_VAR(i,max_acceleration_units_per_sq_second);
219
         EEPROM_READ_VAR(i,max_acceleration_units_per_sq_second);
202
         
220
         
211
         EEPROM_READ_VAR(i,max_xy_jerk);
229
         EEPROM_READ_VAR(i,max_xy_jerk);
212
         EEPROM_READ_VAR(i,max_z_jerk);
230
         EEPROM_READ_VAR(i,max_z_jerk);
213
         EEPROM_READ_VAR(i,max_e_jerk);
231
         EEPROM_READ_VAR(i,max_e_jerk);
214
-        EEPROM_READ_VAR(i,add_homeing);
232
+        EEPROM_READ_VAR(i,add_homing);
215
         #ifdef DELTA
233
         #ifdef DELTA
216
 		EEPROM_READ_VAR(i,endstop_adj);
234
 		EEPROM_READ_VAR(i,endstop_adj);
217
 		EEPROM_READ_VAR(i,delta_radius);
235
 		EEPROM_READ_VAR(i,delta_radius);
240
         int lcd_contrast;
258
         int lcd_contrast;
241
         #endif
259
         #endif
242
         EEPROM_READ_VAR(i,lcd_contrast);
260
         EEPROM_READ_VAR(i,lcd_contrast);
261
+		#ifdef SCARA
262
+		EEPROM_READ_VAR(i,axis_scaling);
263
+		#endif
243
 
264
 
244
 		// Call updatePID (similar to when we have processed M301)
265
 		// Call updatePID (similar to when we have processed M301)
245
 		updatePID();
266
 		updatePID();
266
         axis_steps_per_unit[i]=tmp1[i];  
287
         axis_steps_per_unit[i]=tmp1[i];  
267
         max_feedrate[i]=tmp2[i];  
288
         max_feedrate[i]=tmp2[i];  
268
         max_acceleration_units_per_sq_second[i]=tmp3[i];
289
         max_acceleration_units_per_sq_second[i]=tmp3[i];
290
+		#ifdef SCARA
291
+		axis_scaling[i]=1;
292
+		#endif
269
     }
293
     }
270
     
294
     
271
     // steps per sq second need to be updated to agree with the units per sq second
295
     // steps per sq second need to be updated to agree with the units per sq second
279
     max_xy_jerk=DEFAULT_XYJERK;
303
     max_xy_jerk=DEFAULT_XYJERK;
280
     max_z_jerk=DEFAULT_ZJERK;
304
     max_z_jerk=DEFAULT_ZJERK;
281
     max_e_jerk=DEFAULT_EJERK;
305
     max_e_jerk=DEFAULT_EJERK;
282
-    add_homeing[0] = add_homeing[1] = add_homeing[2] = 0;
306
+    add_homing[0] = add_homing[1] = add_homing[2] = 0;
283
 #ifdef DELTA
307
 #ifdef DELTA
284
 	endstop_adj[0] = endstop_adj[1] = endstop_adj[2] = 0;
308
 	endstop_adj[0] = endstop_adj[1] = endstop_adj[2] = 0;
285
 	delta_radius= DELTA_RADIUS;
309
 	delta_radius= DELTA_RADIUS;

+ 8
- 1
Marlin/Marlin.h View File

178
 void calculate_delta(float cartesian[3]);
178
 void calculate_delta(float cartesian[3]);
179
 extern float delta[3];
179
 extern float delta[3];
180
 #endif
180
 #endif
181
+#ifdef SCARA
182
+void calculate_delta(float cartesian[3]);
183
+void calculate_SCARA_forward_Transform(float f_scara[3]);
184
+#endif
181
 void prepare_move();
185
 void prepare_move();
182
 void kill();
186
 void kill();
183
 void Stop();
187
 void Stop();
207
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
211
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
208
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
212
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
209
 extern float current_position[NUM_AXIS] ;
213
 extern float current_position[NUM_AXIS] ;
210
-extern float add_homeing[3];
214
+extern float add_homing[3];
211
 #ifdef DELTA
215
 #ifdef DELTA
212
 extern float endstop_adj[3];
216
 extern float endstop_adj[3];
213
 extern float delta_radius;
217
 extern float delta_radius;
215
 extern float delta_segments_per_second;
219
 extern float delta_segments_per_second;
216
 void recalc_delta_settings(float radius, float diagonal_rod);
220
 void recalc_delta_settings(float radius, float diagonal_rod);
217
 #endif
221
 #endif
222
+#ifdef SCARA
223
+extern float axis_scaling[3];  // Build size scaling
224
+#endif
218
 extern float min_pos[3];
225
 extern float min_pos[3];
219
 extern float max_pos[3];
226
 extern float max_pos[3];
220
 extern bool axis_known_position[3];
227
 extern bool axis_known_position[3];

+ 1
- 1
Marlin/MarlinSerial.cpp View File

73
   bool useU2X = true;
73
   bool useU2X = true;
74
 
74
 
75
 #if F_CPU == 16000000UL && SERIAL_PORT == 0
75
 #if F_CPU == 16000000UL && SERIAL_PORT == 0
76
-  // hard coded exception for compatibility with the bootloader shipped
76
+  // hard-coded exception for compatibility with the bootloader shipped
77
   // with the Duemilanove and previous boards and the firmware on the 8U2
77
   // with the Duemilanove and previous boards and the firmware on the 8U2
78
   // on the Uno and Mega 2560.
78
   // on the Uno and Mega 2560.
79
   if (baud == 57600) {
79
   if (baud == 57600) {

+ 717
- 28
Marlin/Marlin_main.cpp
File diff suppressed because it is too large
View File


+ 802
- 0
Marlin/example_configurations/SCARA/Configuration.h View File

1
+#ifndef CONFIGURATION_H
2
+#define CONFIGURATION_H
3
+
4
+// This configuration file contains the basic settings.
5
+// Advanced settings can be found in Configuration_adv.h
6
+// BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
7
+
8
+//===========================================================================
9
+//========================= SCARA Settings ==================================
10
+//===========================================================================
11
+// SCARA-mode for Marlin has been developed by QHARLEY in ZA in 2012/2013. Implemented
12
+// and slightly reworked by JCERNY in 06/2014 with the goal to bring it into Master-Branch
13
+// QHARLEYS Autobedlevelling has not been ported, because Marlin has now Bed-levelling
14
+// You might need Z-Min endstop on SCARA-Printer to use this feature. Actually untested!
15
+// Uncomment to use Morgan scara mode
16
+#define SCARA  
17
+#define scara_segments_per_second 200 //careful, two much will decrease performance...
18
+// Length of inner support arm
19
+#define Linkage_1 150 //mm      Preprocessor cannot handle decimal point...
20
+// Length of outer support arm     Measure arm lengths precisely and enter 
21
+#define Linkage_2 150 //mm    
22
+
23
+// SCARA tower offset (position of Tower relative to bed zero position) 
24
+// This needs to be reasonably accurate as it defines the printbed position in the SCARA space.
25
+#define SCARA_offset_x 100 //mm   
26
+#define SCARA_offset_y -56 //mm
27
+#define SCARA_RAD2DEG 57.2957795  // to convert RAD to degrees
28
+
29
+#define THETA_HOMING_OFFSET 0	//calculatated from Calibration Guide and command M360 / M114 see picture in http://reprap.harleystudio.co.za/?page_id=1073
30
+#define PSI_HOMING_OFFSET 0  // calculatated from Calibration Guide and command M364 / M114 see picture in http://reprap.harleystudio.co.za/?page_id=1073
31
+
32
+//some helper variables to make kinematics faster
33
+#define L1_2 sq(Linkage_1) // do not change
34
+#define L2_2 sq(Linkage_2) // do not change
35
+
36
+//===========================================================================
37
+//========================= SCARA Settings end ==================================
38
+//===========================================================================
39
+
40
+// User-specified version info of this build to display in [Pronterface, etc] terminal window during
41
+// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
42
+// build by the user have been successfully uploaded into firmware.
43
+#define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
44
+#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
45
+
46
+// SERIAL_PORT selects which serial port should be used for communication with the host.
47
+// This allows the connection of wireless adapters (for instance) to non-default port pins.
48
+// Serial port 0 is still used by the Arduino bootloader regardless of this setting.
49
+#define SERIAL_PORT 0
50
+
51
+// This determines the communication speed of the printer
52
+// This determines the communication speed of the printer
53
+#define BAUDRATE 250000
54
+
55
+// This enables the serial port associated to the Bluetooth interface
56
+//#define BTENABLED              // Enable BT interface on AT90USB devices
57
+
58
+
59
+//// The following define selects which electronics board you have. Please choose the one that matches your setup
60
+// 10 = Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
61
+// 11 = Gen7 v1.1, v1.2 = 11
62
+// 12 = Gen7 v1.3
63
+// 13 = Gen7 v1.4
64
+// 131 = OpenHardware.co.za custom Gen7 electronics
65
+// 2  = Cheaptronic v1.0
66
+// 20 = Sethi 3D_1
67
+// 3  = MEGA/RAMPS up to 1.2 = 3
68
+// 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
69
+// 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
70
+// 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
71
+// 4  = Duemilanove w/ ATMega328P pin assignment
72
+// 5  = Gen6
73
+// 51 = Gen6 deluxe
74
+// 6  = Sanguinololu < 1.2
75
+// 62 = Sanguinololu 1.2 and above
76
+// 63 = Melzi
77
+// 64 = STB V1.1
78
+// 65 = Azteeg X1
79
+// 66 = Melzi with ATmega1284 (MaKr3d version)
80
+// 67 = Azteeg X3
81
+// 68 = Azteeg X3 Pro
82
+// 7  = Ultimaker
83
+// 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
84
+// 72 = Ultimainboard 2.x (Uses TEMP_SENSOR 20)
85
+// 77 = 3Drag Controller
86
+// 8  = Teensylu
87
+// 80 = Rumba
88
+// 81 = Printrboard (AT90USB1286)
89
+// 82 = Brainwave (AT90USB646)
90
+// 83 = SAV Mk-I (AT90USB1286)
91
+// 84 = Teensy++2.0 (AT90USB1286) // CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84  make
92
+// 9  = Gen3+
93
+// 70 = Megatronics
94
+// 701= Megatronics v2.0
95
+// 702= Minitronics v1.0
96
+// 90 = Alpha OMCA board
97
+// 91 = Final OMCA board
98
+// 301= Rambo
99
+// 21 = Elefu Ra Board (v3)
100
+// 88 = 5DPrint D8 Driver Board
101
+
102
+#ifndef MOTHERBOARD
103
+#define MOTHERBOARD 33
104
+#endif
105
+
106
+// Define this to set a custom name for your generic Mendel,
107
+// #define CUSTOM_MENDEL_NAME "This Mendel"
108
+
109
+// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
110
+// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
111
+// #define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
112
+
113
+// This defines the number of extruders
114
+#define EXTRUDERS 1
115
+
116
+//// The following define selects which power supply you have. Please choose the one that matches your setup
117
+// 1 = ATX
118
+// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
119
+
120
+#define POWER_SUPPLY 1
121
+
122
+// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
123
+// #define PS_DEFAULT_OFF
124
+
125
+//===========================================================================
126
+//=============================Thermal Settings  ============================
127
+//===========================================================================
128
+//
129
+//--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
130
+//
131
+//// Temperature sensor settings:
132
+// -2 is thermocouple with MAX6675 (only for sensor 0)
133
+// -1 is thermocouple with AD595
134
+// 0 is not used
135
+// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
136
+// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
137
+// 3 is Mendel-parts thermistor (4.7k pullup)
138
+// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
139
+// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
140
+// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
141
+// 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
142
+// 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup)
143
+// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
144
+// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
145
+// 10 is 100k RS thermistor 198-961 (4.7k pullup)
146
+// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
147
+// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
148
+// 20 is the PT100 circuit found in the Ultimainboard V2.x
149
+// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
150
+//
151
+//    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
152
+//                          (but gives greater accuracy and more stable PID)
153
+// 51 is 100k thermistor - EPCOS (1k pullup)
154
+// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
155
+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
156
+//
157
+// 1047 is Pt1000 with 4k7 pullup
158
+// 1010 is Pt1000 with 1k pullup (non standard)
159
+// 147 is Pt100 with 4k7 pullup
160
+// 110 is Pt100 with 1k pullup (non standard)
161
+
162
+#define TEMP_SENSOR_0 1
163
+#define TEMP_SENSOR_1 0
164
+#define TEMP_SENSOR_2 0
165
+#define TEMP_SENSOR_BED 1
166
+
167
+// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
168
+//#define TEMP_SENSOR_1_AS_REDUNDANT
169
+#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
170
+
171
+// Actual temperature must be close to target for this long before M109 returns success
172
+#define TEMP_RESIDENCY_TIME 3  // (seconds)
173
+#define TEMP_HYSTERESIS 2       // (degC) range of +/- temperatures considered "close" to the target one
174
+#define TEMP_WINDOW     1       // (degC) Window around target to start the residency timer x degC early.
175
+
176
+// The minimal temperature defines the temperature below which the heater will not be enabled It is used
177
+// to check that the wiring to the thermistor is not broken.
178
+// Otherwise this would lead to the heater being powered on all the time.
179
+#define HEATER_0_MINTEMP 5
180
+#define HEATER_1_MINTEMP 5
181
+#define HEATER_2_MINTEMP 5
182
+#define BED_MINTEMP 5
183
+
184
+// When temperature exceeds max temp, your heater will be switched off.
185
+// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
186
+// You should use MINTEMP for thermistor short/failure protection.
187
+#define HEATER_0_MAXTEMP 275
188
+#define HEATER_1_MAXTEMP 275
189
+#define HEATER_2_MAXTEMP 275
190
+#define BED_MAXTEMP 150
191
+
192
+// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
193
+// average current. The value should be an integer and the heat bed will be turned on for 1 interval of
194
+// HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
195
+//#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
196
+
197
+// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
198
+#define EXTRUDER_WATTS (2*2/5.9) //  P=I^2/R
199
+#define BED_WATTS (5.45*5.45/2.2)      // P=I^2/R
200
+
201
+// PID settings:
202
+// Comment the following line to disable PID and enable bang-bang.
203
+#define PIDTEMP
204
+#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
205
+#define PID_MAX 255 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
206
+#ifdef PIDTEMP
207
+  //#define PID_DEBUG // Sends debug data to the serial port.
208
+  //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
209
+  #define PID_FUNCTIONAL_RANGE 20 // If the temperature difference between the target temperature and the actual temperature
210
+                                  // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
211
+  #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
212
+  #define K1 0.95 //smoothing factor within the PID
213
+  #define PID_dT ((OVERSAMPLENR * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
214
+
215
+// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
216
+// Ultimaker
217
+  //  #define  DEFAULT_Kp 22.2
218
+  //  #define  DEFAULT_Ki 1.08
219
+   // #define  DEFAULT_Kd 114
220
+  
221
+ // Jhead MK5: From Autotune  
222
+  //  #define  DEFAULT_Kp 20.92
223
+   // #define  DEFAULT_Ki 1.51
224
+  //  #define  DEFAULT_Kd 72.34
225
+    
226
+ //Merlin Hotend: From Autotune  
227
+    #define  DEFAULT_Kp 24.5
228
+    #define  DEFAULT_Ki 1.72
229
+    #define  DEFAULT_Kd 87.73
230
+
231
+// MakerGear
232
+//    #define  DEFAULT_Kp 7.0
233
+//    #define  DEFAULT_Ki 0.1
234
+//    #define  DEFAULT_Kd 12
235
+
236
+// Mendel Parts V9 on 12V
237
+  //  #define  DEFAULT_Kp 63.0
238
+   // #define  DEFAULT_Ki 2.25
239
+   // #define  DEFAULT_Kd 440
240
+#endif // PIDTEMP
241
+
242
+// Bed Temperature Control
243
+// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
244
+//
245
+// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder.
246
+// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz,
247
+// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
248
+// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
249
+// If your configuration is significantly different than this and you don't understand the issues involved, you probably
250
+// shouldn't use bed PID until someone else verifies your hardware works.
251
+// If this is enabled, find your own PID constants below.
252
+#define PIDTEMPBED
253
+//
254
+#define BED_LIMIT_SWITCHING
255
+
256
+// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
257
+// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
258
+// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
259
+// so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
260
+#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
261
+
262
+#ifdef PIDTEMPBED
263
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
264
+//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
265
+  //  #define  DEFAULT_bedKp 10.00
266
+  //  #define  DEFAULT_bedKi .023
267
+  //  #define  DEFAULT_bedKd 305.4
268
+
269
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
270
+//from pidautotune
271
+//    #define  DEFAULT_bedKp 97.1
272
+//    #define  DEFAULT_bedKi 1.41
273
+//    #define  DEFAULT_bedKd 1675.16
274
+
275
+//12v Heatbed Mk3 12V in parallel
276
+//from pidautotune
277
+    #define  DEFAULT_bedKp 630.14
278
+    #define  DEFAULT_bedKi 121.71
279
+    #define  DEFAULT_bedKd 815.64
280
+    
281
+// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
282
+#endif // PIDTEMPBED
283
+
284
+
285
+
286
+//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
287
+//can be software-disabled for whatever purposes by
288
+//#define PREVENT_DANGEROUS_EXTRUDE
289
+//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
290
+#define PREVENT_LENGTHY_EXTRUDE
291
+
292
+#define EXTRUDE_MINTEMP 150
293
+#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
294
+
295
+/*================== Thermal Runaway Protection ==============================
296
+This is a feature to protect your printer from burn up in flames if it has
297
+a thermistor coming off place (this happened to a friend of mine recently and
298
+motivated me writing this feature).
299
+
300
+The issue: If a thermistor come off, it will read a lower temperature than actual.
301
+The system will turn the heater on forever, burning up the filament and anything
302
+else around.
303
+
304
+After the temperature reaches the target for the first time, this feature will 
305
+start measuring for how long the current temperature stays below the target 
306
+minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
307
+
308
+If it stays longer than _PERIOD, it means the thermistor temperature
309
+cannot catch up with the target, so something *may be* wrong. Then, to be on the
310
+safe side, the system will he halt.
311
+
312
+Bear in mind the count down will just start AFTER the first time the 
313
+thermistor temperature is over the target, so you will have no problem if
314
+your extruder heater takes 2 minutes to hit the target on heating.
315
+
316
+*/
317
+// If you want to enable this feature for all your extruder heaters,
318
+// uncomment the 2 defines below:
319
+
320
+// Parameters for all extruder heaters
321
+//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
322
+//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
323
+
324
+// If you want to enable this feature for your bed heater,
325
+// uncomment the 2 defines below:
326
+
327
+// Parameters for the bed heater
328
+//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
329
+//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
330
+//===========================================================================
331
+
332
+//===========================================================================
333
+//=============================Mechanical Settings===========================
334
+//===========================================================================
335
+
336
+// Uncomment the following line to enable CoreXY kinematics
337
+// #define COREXY
338
+
339
+// coarse Endstop Settings
340
+//#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
341
+
342
+#ifndef ENDSTOPPULLUPS
343
+  // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
344
+  // #define ENDSTOPPULLUP_XMAX
345
+  // #define ENDSTOPPULLUP_YMAX
346
+   #define ENDSTOPPULLUP_ZMAX  // open pin, inverted
347
+   #define ENDSTOPPULLUP_XMIN  // open pin, inverted
348
+   #define ENDSTOPPULLUP_YMIN  // open pin, inverted
349
+  // #define ENDSTOPPULLUP_ZMIN
350
+#endif
351
+
352
+#ifdef ENDSTOPPULLUPS
353
+  #define ENDSTOPPULLUP_XMAX
354
+  #define ENDSTOPPULLUP_YMAX
355
+  #define ENDSTOPPULLUP_ZMAX
356
+  #define ENDSTOPPULLUP_XMIN
357
+  #define ENDSTOPPULLUP_YMIN
358
+  #define ENDSTOPPULLUP_ZMIN
359
+#endif
360
+
361
+// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
362
+const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
363
+const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
364
+const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
365
+const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
366
+const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
367
+const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
368
+//#define DISABLE_MAX_ENDSTOPS
369
+//#define DISABLE_MIN_ENDSTOPS
370
+
371
+// Disable max endstops for compatibility with endstop checking routine
372
+#if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS)
373
+  #define DISABLE_MAX_ENDSTOPS
374
+#endif
375
+
376
+// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
377
+#define X_ENABLE_ON 0
378
+#define Y_ENABLE_ON 0
379
+#define Z_ENABLE_ON 0
380
+#define E_ENABLE_ON 0 // For all extruders
381
+
382
+// Disables axis when it's not being used.
383
+#define DISABLE_X false
384
+#define DISABLE_Y false
385
+#define DISABLE_Z false
386
+#define DISABLE_E false // For all extruders
387
+#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled
388
+
389
+#define INVERT_X_DIR false    // for Mendel set to false, for Orca set to true
390
+#define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
391
+#define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true
392
+#define INVERT_E0_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
393
+#define INVERT_E1_DIR false    // for direct drive extruder v9 set to true, for geared extruder set to false
394
+#define INVERT_E2_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
395
+
396
+// ENDSTOP SETTINGS:
397
+// Sets direction of endstop	s when homing; 1=MAX, -1=MIN
398
+#define X_HOME_DIR 1
399
+#define Y_HOME_DIR 1
400
+#define Z_HOME_DIR -1
401
+
402
+#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
403
+#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
404
+
405
+// Travel limits after homing
406
+#define X_MAX_POS 200
407
+#define X_MIN_POS 0
408
+#define Y_MAX_POS 200
409
+#define Y_MIN_POS 0
410
+#define Z_MAX_POS 225
411
+#define Z_MIN_POS MANUAL_Z_HOME_POS
412
+
413
+#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
414
+#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
415
+#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
416
+//============================= Bed Auto Leveling ===========================
417
+
418
+//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
419
+
420
+#ifdef ENABLE_AUTO_BED_LEVELING
421
+
422
+// There are 2 different ways to pick the X and Y locations to probe:
423
+
424
+//  - "grid" mode
425
+//    Probe every point in a rectangular grid
426
+//    You must specify the rectangle, and the density of sample points
427
+//    This mode is preferred because there are more measurements.
428
+//    It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive
429
+
430
+//  - "3-point" mode
431
+//    Probe 3 arbitrary points on the bed (that aren't colinear)
432
+//    You must specify the X & Y coordinates of all 3 points
433
+
434
+  #define AUTO_BED_LEVELING_GRID
435
+  // with AUTO_BED_LEVELING_GRID, the bed is sampled in a
436
+  // AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid
437
+  // and least squares solution is calculated
438
+  // Note: this feature occupies 10'206 byte
439
+  #ifdef AUTO_BED_LEVELING_GRID
440
+
441
+    // set the rectangle in which to probe
442
+    #define LEFT_PROBE_BED_POSITION 15
443
+    #define RIGHT_PROBE_BED_POSITION 170
444
+    #define BACK_PROBE_BED_POSITION 180
445
+    #define FRONT_PROBE_BED_POSITION 20
446
+
447
+     // set the number of grid points per dimension
448
+     // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
449
+    #define AUTO_BED_LEVELING_GRID_POINTS 2
450
+
451
+
452
+  #else  // not AUTO_BED_LEVELING_GRID
453
+    // with no grid, just probe 3 arbitrary points.  A simple cross-product
454
+    // is used to esimate the plane of the print bed
455
+
456
+      #define ABL_PROBE_PT_1_X 15
457
+      #define ABL_PROBE_PT_1_Y 180
458
+      #define ABL_PROBE_PT_2_X 15
459
+      #define ABL_PROBE_PT_2_Y 20
460
+      #define ABL_PROBE_PT_3_X 170
461
+      #define ABL_PROBE_PT_3_Y 20
462
+
463
+  #endif // AUTO_BED_LEVELING_GRID
464
+
465
+
466
+  // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
467
+  #define X_PROBE_OFFSET_FROM_EXTRUDER -25
468
+  #define Y_PROBE_OFFSET_FROM_EXTRUDER -29
469
+  #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
470
+
471
+  //#define Z_RAISE_BEFORE_HOMING 4       // (in mm) Raise Z before homing (G28) for Probe Clearance.
472
+                                        // Be sure you have this distance over your Z_MAX_POS in case
473
+
474
+  #define XY_TRAVEL_SPEED 8000         // X and Y axis travel speed between probes, in mm/min
475
+
476
+  #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
477
+  #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
478
+
479
+
480
+  //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
481
+  //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
482
+  // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.
483
+
484
+//  #define PROBE_SERVO_DEACTIVATION_DELAY 300
485
+
486
+
487
+//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
488
+//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
489
+
490
+ // #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
491
+                          // When defined, it will:
492
+                          // - Allow Z homing only after X and Y homing AND stepper drivers still enabled
493
+                          // - If stepper drivers timeout, it will need X and Y homing again before Z homing
494
+                          // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
495
+                          // - Block Z homing only when the probe is outside bed area.
496
+
497
+  #ifdef Z_SAFE_HOMING
498
+
499
+    #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2)    // X point for Z homing when homing all axis (G28)
500
+    #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2)    // Y point for Z homing when homing all axis (G28)
501
+
502
+  #endif
503
+
504
+#endif // ENABLE_AUTO_BED_LEVELING
505
+
506
+
507
+// The position of the homing switches
508
+#define MANUAL_HOME_POSITIONS  // If defined, MANUAL_*_HOME_POS below will be used
509
+//#define BED_CENTER_AT_0_0  // If defined, the center of the bed is at (X=0, Y=0)
510
+
511
+//Manual homing switch locations:
512
+// For deltabots this means top and center of the Cartesian print volume.
513
+// For SCARA: Offset between HomingPosition and Bed X=0 / Y=0
514
+#define MANUAL_X_HOME_POS -22.
515
+#define MANUAL_Y_HOME_POS -52.
516
+#define MANUAL_Z_HOME_POS 0.1  // Distance between nozzle and print surface after homing.
517
+
518
+
519
+//// MOVEMENT SETTINGS
520
+#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
521
+#define HOMING_FEEDRATE {40*60, 40*60, 10*60, 0}  // set the homing speeds (mm/min)
522
+
523
+// default settings
524
+
525
+#define DEFAULT_AXIS_STEPS_PER_UNIT   {103.69,106.65,200/1.25,1000}  // default steps per unit for SCARA
526
+#define DEFAULT_MAX_FEEDRATE          {300, 300, 30, 25}    // (mm/sec)
527
+#define DEFAULT_MAX_ACCELERATION      {300,300,20,1000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
528
+
529
+#define DEFAULT_ACCELERATION          400    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
530
+#define DEFAULT_RETRACT_ACCELERATION  2000  // X, Y, Z and E max acceleration in mm/s^2 for retracts
531
+
532
+// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
533
+// The offset has to be X=0, Y=0 for extruder 0 hotend (default extruder).
534
+// For the other hotends it is their distance from the extruder 0 hotend.
535
+// #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
536
+// #define EXTRUDER_OFFSET_Y {0.0, 5.00}  // (in mm) for each extruder, offset of the hotend on the Y axis
537
+
538
+// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
539
+#define DEFAULT_XYJERK                5    // (mm/sec)
540
+#define DEFAULT_ZJERK                 0.4    // (mm/sec)
541
+#define DEFAULT_EJERK                 3    // (mm/sec)
542
+
543
+//===========================================================================
544
+//=============================Additional Features===========================
545
+//===========================================================================
546
+
547
+// Custom M code points
548
+//#define CUSTOM_M_CODES
549
+#ifdef CUSTOM_M_CODES
550
+  #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
551
+  #define Z_PROBE_OFFSET_RANGE_MIN -15
552
+  #define Z_PROBE_OFFSET_RANGE_MAX -5
553
+#endif
554
+
555
+
556
+// EEPROM
557
+// The microcontroller can store settings in the EEPROM, e.g. max velocity...
558
+// M500 - stores parameters in EEPROM
559
+// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
560
+// M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
561
+//define this to enable EEPROM support
562
+//#define EEPROM_SETTINGS
563
+//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
564
+// please keep turned on if you can.
565
+#define EEPROM_CHITCHAT
566
+
567
+// Preheat Constants
568
+#define PLA_PREHEAT_HOTEND_TEMP 180
569
+#define PLA_PREHEAT_HPB_TEMP 70
570
+#define PLA_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
571
+
572
+#define ABS_PREHEAT_HOTEND_TEMP 240
573
+#define ABS_PREHEAT_HPB_TEMP 100
574
+#define ABS_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
575
+
576
+//LCD and SD support
577
+//#define ULTRA_LCD  //general LCD support, also 16x2
578
+//#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
579
+//#define SDSUPPORT // Enable SD Card Support in Hardware Console
580
+//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
581
+//#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
582
+//#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
583
+//#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
584
+//#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
585
+//#define ULTIPANEL  //the UltiPanel as on Thingiverse
586
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
587
+//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
588
+
589
+// The MaKr3d Makr-Panel with graphic controller and SD support
590
+// http://reprap.org/wiki/MaKr3d_MaKrPanel
591
+//#define MAKRPANEL
592
+
593
+// The RepRapDiscount Smart Controller (white PCB)
594
+// http://reprap.org/wiki/RepRapDiscount_Smart_Controller
595
+//#define REPRAP_DISCOUNT_SMART_CONTROLLER
596
+
597
+// The GADGETS3D G3D LCD/SD Controller (blue PCB)
598
+// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
599
+//#define G3D_PANEL
600
+
601
+// The RepRapDiscount FULL GRAPHIC Smart Controller (quadratic white PCB)
602
+// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
603
+//
604
+// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
605
+//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
606
+
607
+// The RepRapWorld REPRAPWORLD_KEYPAD v1.1
608
+// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
609
+//#define REPRAPWORLD_KEYPAD
610
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // how much should be moved when a key is pressed, eg 10.0 means 10mm per click
611
+
612
+// The Elefu RA Board Control Panel
613
+// http://www.elefu.com/index.php?route=product/product&product_id=53
614
+// REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARUDINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
615
+//#define RA_CONTROL_PANEL
616
+
617
+//automatic expansion
618
+#if defined (MAKRPANEL)
619
+ #define DOGLCD
620
+ #define SDSUPPORT
621
+ #define ULTIPANEL
622
+ #define NEWPANEL
623
+ #define DEFAULT_LCD_CONTRAST 17
624
+#endif
625
+
626
+#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
627
+ #define DOGLCD
628
+ #define U8GLIB_ST7920
629
+ #define REPRAP_DISCOUNT_SMART_CONTROLLER
630
+#endif
631
+
632
+#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
633
+ #define ULTIPANEL
634
+ #define NEWPANEL
635
+#endif
636
+
637
+#if defined(REPRAPWORLD_KEYPAD)
638
+  #define NEWPANEL
639
+  #define ULTIPANEL
640
+#endif
641
+#if defined(RA_CONTROL_PANEL)
642
+ #define ULTIPANEL
643
+ #define NEWPANEL
644
+ #define LCD_I2C_TYPE_PCA8574
645
+ #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
646
+#endif
647
+
648
+//I2C PANELS
649
+
650
+//#define LCD_I2C_SAINSMART_YWROBOT
651
+#ifdef LCD_I2C_SAINSMART_YWROBOT
652
+  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
653
+  // Make sure it is placed in the Arduino libraries directory.
654
+  #define LCD_I2C_TYPE_PCF8575
655
+  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
656
+  #define NEWPANEL
657
+  #define ULTIPANEL
658
+#endif
659
+
660
+// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
661
+//#define LCD_I2C_PANELOLU2
662
+#ifdef LCD_I2C_PANELOLU2
663
+  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
664
+  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
665
+  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
666
+  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
667
+  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
668
+  #define LCD_I2C_TYPE_MCP23017
669
+  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
670
+  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
671
+  #define NEWPANEL
672
+  #define ULTIPANEL
673
+
674
+  #ifndef ENCODER_PULSES_PER_STEP
675
+	#define ENCODER_PULSES_PER_STEP 4
676
+  #endif
677
+
678
+  #ifndef ENCODER_STEPS_PER_MENU_ITEM
679
+	#define ENCODER_STEPS_PER_MENU_ITEM 1
680
+  #endif
681
+
682
+
683
+  #ifdef LCD_USE_I2C_BUZZER
684
+	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
685
+	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
686
+  #endif
687
+
688
+#endif
689
+
690
+// Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
691
+//#define LCD_I2C_VIKI
692
+#ifdef LCD_I2C_VIKI
693
+  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
694
+  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
695
+  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
696
+  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
697
+  #define LCD_I2C_TYPE_MCP23017
698
+  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
699
+  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
700
+  #define NEWPANEL
701
+  #define ULTIPANEL
702
+#endif
703
+
704
+// Shift register panels
705
+// ---------------------
706
+// 2 wire Non-latching LCD SR from:
707
+// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
708
+//#define SR_LCD
709
+#ifdef SR_LCD
710
+   #define SR_LCD_2W_NL    // Non latching 2 wire shift register
711
+   //#define NEWPANEL
712
+#endif
713
+
714
+
715
+#ifdef ULTIPANEL
716
+//  #define NEWPANEL  //enable this if you have a click-encoder panel
717
+  #define SDSUPPORT
718
+  #define ULTRA_LCD
719
+  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
720
+    #define LCD_WIDTH 20
721
+    #define LCD_HEIGHT 5
722
+  #else
723
+    #define LCD_WIDTH 20
724
+    #define LCD_HEIGHT 4
725
+  #endif
726
+#else //no panel but just LCD
727
+  #ifdef ULTRA_LCD
728
+  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
729
+    #define LCD_WIDTH 20
730
+    #define LCD_HEIGHT 5
731
+  #else
732
+    #define LCD_WIDTH 16
733
+    #define LCD_HEIGHT 2
734
+  #endif
735
+  #endif
736
+#endif
737
+
738
+// default LCD contrast for dogm-like LCD displays
739
+#ifdef DOGLCD
740
+# ifndef DEFAULT_LCD_CONTRAST
741
+#  define DEFAULT_LCD_CONTRAST 32
742
+# endif
743
+#endif
744
+
745
+// Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
746
+//#define FAST_PWM_FAN
747
+
748
+// Temperature status LEDs that display the hotend and bet temperature.
749
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
750
+// Otherwise the RED led is on. There is 1C hysteresis.
751
+//#define TEMP_STAT_LEDS
752
+
753
+// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
754
+// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
755
+// is too low, you should also increment SOFT_PWM_SCALE.
756
+//#define FAN_SOFT_PWM
757
+
758
+// Incrementing this by 1 will double the software PWM frequency,
759
+// affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
760
+// However, control resolution will be halved for each increment;
761
+// at zero value, there are 128 effective control positions.
762
+#define SOFT_PWM_SCALE 0
763
+
764
+// M240  Triggers a camera by emulating a Canon RC-1 Remote
765
+// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
766
+// #define PHOTOGRAPH_PIN     23
767
+
768
+// SF send wrong arc g-codes when using Arc Point as fillet procedure
769
+//#define SF_ARC_FIX
770
+
771
+// Support for the BariCUDA Paste Extruder.
772
+//#define BARICUDA
773
+
774
+//define BlinkM/CyzRgb Support
775
+//#define BLINKM
776
+
777
+/*********************************************************************\
778
+* R/C SERVO support
779
+* Sponsored by TrinityLabs, Reworked by codexmas
780
+**********************************************************************/
781
+
782
+// Number of servos
783
+//
784
+// If you select a configuration below, this will receive a default value and does not need to be set manually
785
+// set it manually if you have more servos than extruders and wish to manually control some
786
+// leaving it undefined or defining as 0 will disable the servo subsystem
787
+// If unsure, leave commented / disabled
788
+//
789
+//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
790
+
791
+// Servo Endstops
792
+//
793
+// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
794
+// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
795
+//
796
+//#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
797
+//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
798
+
799
+#include "Configuration_adv.h"
800
+#include "thermistortables.h"
801
+
802
+#endif //__CONFIGURATION_H

+ 507
- 0
Marlin/example_configurations/SCARA/Configuration_adv.h View File

1
+#ifndef CONFIGURATION_ADV_H
2
+#define CONFIGURATION_ADV_H
3
+
4
+//===========================================================================
5
+//=============================Thermal Settings  ============================
6
+//===========================================================================
7
+
8
+#ifdef BED_LIMIT_SWITCHING
9
+  #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
10
+#endif
11
+#define BED_CHECK_INTERVAL 3000 //ms between checks in bang-bang control
12
+
13
+//// Heating sanity check:
14
+// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
15
+// If the temperature has not increased at the end of that period, the target temperature is set to zero.
16
+// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
17
+//  differ by at least 2x WATCH_TEMP_INCREASE
18
+//#define WATCH_TEMP_PERIOD 40000 //40 seconds
19
+//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
20
+
21
+#ifdef PIDTEMP
22
+  // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
23
+  // if Kc is chosen well, the additional required power due to increased melting should be compensated.
24
+  #define PID_ADD_EXTRUSION_RATE
25
+  #ifdef PID_ADD_EXTRUSION_RATE
26
+    #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
27
+  #endif
28
+#endif
29
+
30
+
31
+//automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode.
32
+//The maximum buffered steps/sec of the extruder motor are called "se".
33
+//You enter the autotemp mode by a M109 S<mintemp> B<maxtemp> F<factor>
34
+// the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp
35
+// you exit the value by any M109 without F*
36
+// Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
37
+// on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
38
+#define AUTOTEMP
39
+#ifdef AUTOTEMP
40
+  #define AUTOTEMP_OLDWEIGHT 0.98
41
+#endif
42
+
43
+//Show Temperature ADC value
44
+//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
45
+//#define SHOW_TEMP_ADC_VALUES
46
+
47
+//  extruder run-out prevention.
48
+//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
49
+//#define EXTRUDER_RUNOUT_PREVENT
50
+#define EXTRUDER_RUNOUT_MINTEMP 180
51
+#define EXTRUDER_RUNOUT_SECONDS 30.
52
+#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
53
+#define EXTRUDER_RUNOUT_SPEED 180.  //extrusion speed
54
+#define EXTRUDER_RUNOUT_EXTRUDE 100
55
+
56
+//These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements.
57
+//The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET"
58
+#define TEMP_SENSOR_AD595_OFFSET 0.0
59
+#define TEMP_SENSOR_AD595_GAIN   1.0
60
+
61
+//This is for controlling a fan to cool down the stepper drivers
62
+//it will turn on when any driver is enabled
63
+//and turn off after the set amount of seconds from last driver being disabled again
64
+#define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable)
65
+#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run
66
+#define CONTROLLERFAN_SPEED 255  // == full speed
67
+
68
+// When first starting the main fan, run it at full speed for the
69
+// given number of milliseconds.  This gets the fan spinning reliably
70
+// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
71
+//#define FAN_KICKSTART_TIME 100
72
+
73
+// Extruder cooling fans
74
+// Configure fan pin outputs to automatically turn on/off when the associated
75
+// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
76
+// Multiple extruders can be assigned to the same pin in which case
77
+// the fan will turn on when any selected extruder is above the threshold.
78
+#define EXTRUDER_0_AUTO_FAN_PIN   -1
79
+#define EXTRUDER_1_AUTO_FAN_PIN   -1
80
+#define EXTRUDER_2_AUTO_FAN_PIN   -1
81
+#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
82
+#define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
83
+
84
+
85
+//===========================================================================
86
+//=============================Mechanical Settings===========================
87
+//===========================================================================
88
+
89
+#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
90
+
91
+
92
+//// AUTOSET LOCATIONS OF LIMIT SWITCHES
93
+//// Added by ZetaPhoenix 09-15-2012
94
+#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
95
+  #define X_HOME_POS MANUAL_X_HOME_POS
96
+  #define Y_HOME_POS MANUAL_Y_HOME_POS
97
+  #define Z_HOME_POS MANUAL_Z_HOME_POS
98
+#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
99
+  //X axis
100
+  #if X_HOME_DIR == -1
101
+    #ifdef BED_CENTER_AT_0_0
102
+      #define X_HOME_POS X_MAX_LENGTH * -0.5
103
+    #else
104
+      #define X_HOME_POS X_MIN_POS
105
+    #endif //BED_CENTER_AT_0_0
106
+  #else
107
+    #ifdef BED_CENTER_AT_0_0
108
+      #define X_HOME_POS X_MAX_LENGTH * 0.5
109
+    #else
110
+      #define X_HOME_POS X_MAX_POS
111
+    #endif //BED_CENTER_AT_0_0
112
+  #endif //X_HOME_DIR == -1
113
+
114
+  //Y axis
115
+  #if Y_HOME_DIR == -1
116
+    #ifdef BED_CENTER_AT_0_0
117
+      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
118
+    #else
119
+      #define Y_HOME_POS Y_MIN_POS
120
+    #endif //BED_CENTER_AT_0_0
121
+  #else
122
+    #ifdef BED_CENTER_AT_0_0
123
+      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
124
+    #else
125
+      #define Y_HOME_POS Y_MAX_POS
126
+    #endif //BED_CENTER_AT_0_0
127
+  #endif //Y_HOME_DIR == -1
128
+
129
+  // Z axis
130
+  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
131
+    #define Z_HOME_POS Z_MIN_POS
132
+  #else
133
+    #define Z_HOME_POS Z_MAX_POS
134
+  #endif //Z_HOME_DIR == -1
135
+#endif //End auto min/max positions
136
+//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
137
+
138
+
139
+//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
140
+
141
+// A single Z stepper driver is usually used to drive 2 stepper motors.
142
+// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
143
+// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
144
+// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
145
+// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
146
+//#define Z_DUAL_STEPPER_DRIVERS
147
+
148
+#ifdef Z_DUAL_STEPPER_DRIVERS
149
+  #undef EXTRUDERS
150
+  #define EXTRUDERS 1
151
+#endif
152
+
153
+// Same again but for Y Axis.
154
+//#define Y_DUAL_STEPPER_DRIVERS
155
+
156
+// Define if the two Y drives need to rotate in opposite directions
157
+#define INVERT_Y2_VS_Y_DIR true
158
+
159
+#ifdef Y_DUAL_STEPPER_DRIVERS
160
+  #undef EXTRUDERS
161
+  #define EXTRUDERS 1
162
+#endif
163
+
164
+#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
165
+  #error "You cannot have dual drivers for both Y and Z"
166
+#endif
167
+
168
+// Enable this for dual x-carriage printers.
169
+// A dual x-carriage design has the advantage that the inactive extruder can be parked which
170
+// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
171
+// allowing faster printing speeds.
172
+//#define DUAL_X_CARRIAGE
173
+#ifdef DUAL_X_CARRIAGE
174
+// Configuration for second X-carriage
175
+// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
176
+// the second x-carriage always homes to the maximum endstop.
177
+#define X2_MIN_POS 80     // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
178
+#define X2_MAX_POS 353    // set maximum to the distance between toolheads when both heads are homed
179
+#define X2_HOME_DIR 1     // the second X-carriage always homes to the maximum endstop position
180
+#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
181
+    // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
182
+    // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
183
+    // without modifying the firmware (through the "M218 T1 X???" command).
184
+    // Remember: you should set the second extruder x-offset to 0 in your slicer.
185
+
186
+// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h)
187
+#define X2_ENABLE_PIN 29
188
+#define X2_STEP_PIN 25
189
+#define X2_DIR_PIN 23
190
+
191
+// There are a few selectable movement modes for dual x-carriages using M605 S<mode>
192
+//    Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results
193
+//                           as long as it supports dual x-carriages. (M605 S0)
194
+//    Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
195
+//                           that additional slicer support is not required. (M605 S1)
196
+//    Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all
197
+//                           actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
198
+//                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
199
+
200
+// This is the default power-up mode which can be later using M605.
201
+#define DEFAULT_DUAL_X_CARRIAGE_MODE 0
202
+
203
+// As the x-carriages are independent we can now account for any relative Z offset
204
+#define EXTRUDER1_Z_OFFSET 0.0           // z offset relative to extruder 0
205
+
206
+// Default settings in "Auto-park Mode"
207
+#define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder
208
+#define TOOLCHANGE_UNPARK_ZLIFT 1        // the distance to raise Z axis when unparking an extruder
209
+
210
+// Default x offset in duplication mode (typically set to half print bed width)
211
+#define DEFAULT_DUPLICATION_X_OFFSET 100
212
+
213
+#endif //DUAL_X_CARRIAGE
214
+
215
+//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
216
+#define X_HOME_RETRACT_MM 3
217
+#define Y_HOME_RETRACT_MM 3
218
+#define Z_HOME_RETRACT_MM 3
219
+//#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
220
+#ifdef SCARA
221
+	#define QUICK_HOME //SCARA needs Quickhome
222
+#endif
223
+
224
+#define AXIS_RELATIVE_MODES {false, false, false, false}
225
+
226
+#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
227
+
228
+//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
229
+#define INVERT_X_STEP_PIN false
230
+#define INVERT_Y_STEP_PIN false
231
+#define INVERT_Z_STEP_PIN false
232
+#define INVERT_E_STEP_PIN false
233
+
234
+//default stepper release if idle
235
+#define DEFAULT_STEPPER_DEACTIVE_TIME 240
236
+
237
+#define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
238
+#define DEFAULT_MINTRAVELFEEDRATE     0.0
239
+
240
+// Feedrates for manual moves along X, Y, Z, E from panel
241
+#ifdef ULTIPANEL
242
+#define MANUAL_FEEDRATE {50*60, 50*60, 10*60, 60}  // set the speeds for manual moves (mm/min)
243
+#endif
244
+
245
+//Comment to disable setting feedrate multiplier via encoder
246
+#ifdef ULTIPANEL
247
+    #define ULTIPANEL_FEEDMULTIPLY
248
+#endif
249
+
250
+// minimum time in microseconds that a movement needs to take if the buffer is emptied.
251
+#define DEFAULT_MINSEGMENTTIME        20000
252
+
253
+// If defined the movements slow down when the look ahead buffer is only half full
254
+//#define SLOWDOWN
255
+#ifdef SCARA
256
+ #undef SLOWDOWN
257
+#endif
258
+// Frequency limit
259
+// See nophead's blog for more info
260
+// Not working O
261
+//#define XY_FREQUENCY_LIMIT  15
262
+
263
+// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
264
+// of the buffer and all stops. This should not be much greater than zero and should only be changed
265
+// if unwanted behavior is observed on a user's machine when running at very slow speeds.
266
+#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
267
+
268
+// MS1 MS2 Stepper Driver Microstepping mode table
269
+#define MICROSTEP1 LOW,LOW
270
+#define MICROSTEP2 HIGH,LOW
271
+#define MICROSTEP4 LOW,HIGH
272
+#define MICROSTEP8 HIGH,HIGH
273
+#define MICROSTEP16 HIGH,HIGH
274
+
275
+// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
276
+#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
277
+
278
+// Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
279
+#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
280
+
281
+// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
282
+//#define DIGIPOT_I2C
283
+// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
284
+#define DIGIPOT_I2C_NUM_CHANNELS 8
285
+// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
286
+#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}
287
+
288
+//===========================================================================
289
+//=============================Additional Features===========================
290
+//===========================================================================
291
+
292
+//#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
293
+#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
294
+
295
+#define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
296
+#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
297
+
298
+#define SDCARD_RATHERRECENTFIRST  //reverse file order of sd card menu display. Its sorted practically after the file system block order.
299
+// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
300
+// using:
301
+//#define MENU_ADDAUTOSTART
302
+
303
+// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
304
+//#define USE_WATCHDOG
305
+
306
+#ifdef USE_WATCHDOG
307
+// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
308
+// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
309
+//  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
310
+//#define WATCHDOG_RESET_MANUAL
311
+#endif
312
+
313
+// Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled.
314
+//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
315
+
316
+// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
317
+// it can e.g. be used to change z-positions in the print startup phase in real-time
318
+// does not respect endstops!
319
+//#define BABYSTEPPING
320
+#ifdef BABYSTEPPING
321
+  #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
322
+  #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
323
+  #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
324
+
325
+  #ifdef COREXY
326
+    #error BABYSTEPPING not implemented for COREXY yet.
327
+  #endif
328
+
329
+  #ifdef DELTA
330
+    #ifdef BABYSTEP_XY
331
+      #error BABYSTEPPING only implemented for Z axis on deltabots.
332
+    #endif
333
+  #endif
334
+  
335
+  #ifdef SCARA
336
+    #error BABYSTEPPING not implemented for SCARA yet.
337
+  #endif
338
+  
339
+#endif
340
+
341
+// extruder advance constant (s2/mm3)
342
+//
343
+// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTUDER_ADVANCE_K * cubic mm per second ^ 2
344
+//
345
+// Hooke's law says:		force = k * distance
346
+// Bernoulli's principle says:	v ^ 2 / 2 + g . h + pressure / density = constant
347
+// so: v ^ 2 is proportional to number of steps we advance the extruder
348
+#define ADVANCE
349
+
350
+#ifdef ADVANCE
351
+  #define EXTRUDER_ADVANCE_K .0
352
+
353
+  #define D_FILAMENT 1.75
354
+  #define STEPS_MM_E 1000
355
+  #define EXTRUTION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
356
+  #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUTION_AREA)
357
+
358
+#endif // ADVANCE
359
+
360
+// Arc interpretation settings:
361
+#define MM_PER_ARC_SEGMENT 1
362
+#define N_ARC_CORRECTION 25
363
+
364
+const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
365
+
366
+// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
367
+// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
368
+// in the pins.h file.  When using a push button pulling the pin to ground this will need inverted.  This setting should
369
+// be commented out otherwise
370
+#define SDCARDDETECTINVERTED
371
+
372
+#ifdef ULTIPANEL
373
+ #undef SDCARDDETECTINVERTED
374
+#endif
375
+
376
+// Power Signal Control Definitions
377
+// By default use ATX definition
378
+#ifndef POWER_SUPPLY
379
+  #define POWER_SUPPLY 1
380
+#endif
381
+// 1 = ATX
382
+#if (POWER_SUPPLY == 1)
383
+  #define PS_ON_AWAKE  LOW
384
+  #define PS_ON_ASLEEP HIGH
385
+#endif
386
+// 2 = X-Box 360 203W
387
+#if (POWER_SUPPLY == 2)
388
+  #define PS_ON_AWAKE  HIGH
389
+  #define PS_ON_ASLEEP LOW
390
+#endif
391
+
392
+// Control heater 0 and heater 1 in parallel.
393
+//#define HEATERS_PARALLEL
394
+
395
+//===========================================================================
396
+//=============================Buffers           ============================
397
+//===========================================================================
398
+
399
+// The number of linear motions that can be in the plan at any give time.
400
+// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
401
+#if defined SDSUPPORT
402
+  #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
403
+#else
404
+  #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
405
+#endif
406
+
407
+
408
+//The ASCII buffer for receiving from the serial:
409
+#define MAX_CMD_SIZE 96
410
+#define BUFSIZE 4
411
+
412
+
413
+// Firmware based and LCD controlled retract
414
+// M207 and M208 can be used to define parameters for the retraction.
415
+// The retraction can be called by the slicer using G10 and G11
416
+// until then, intended retractions can be detected by moves that only extrude and the direction.
417
+// the moves are than replaced by the firmware controlled ones.
418
+
419
+// #define FWRETRACT  //ONLY PARTIALLY TESTED
420
+#ifdef FWRETRACT
421
+  #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
422
+  #define RETRACT_LENGTH 3               //default retract length (positive mm)
423
+  #define RETRACT_FEEDRATE 35            //default feedrate for retracting (mm/s)
424
+  #define RETRACT_ZLIFT 0                //default retract Z-lift
425
+  #define RETRACT_RECOVER_LENGTH 0       //default additional recover length (mm, added to retract length when recovering)
426
+  #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
427
+#endif
428
+
429
+//adds support for experimental filament exchange support M600; requires display
430
+#ifdef ULTIPANEL
431
+  #define FILAMENTCHANGEENABLE
432
+  #ifdef FILAMENTCHANGEENABLE
433
+    #define FILAMENTCHANGE_XPOS 3
434
+    #define FILAMENTCHANGE_YPOS 3
435
+    #define FILAMENTCHANGE_ZADD 10
436
+    #define FILAMENTCHANGE_FIRSTRETRACT -2
437
+    #define FILAMENTCHANGE_FINALRETRACT -100
438
+  #endif
439
+#endif
440
+
441
+#ifdef FILAMENTCHANGEENABLE
442
+  #ifdef EXTRUDER_RUNOUT_PREVENT
443
+    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
444
+  #endif
445
+#endif
446
+
447
+//===========================================================================
448
+//=============================  Define Defines  ============================
449
+//===========================================================================
450
+#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
451
+  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
452
+#endif
453
+
454
+#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
455
+  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
456
+#endif
457
+
458
+#if TEMP_SENSOR_0 > 0
459
+  #define THERMISTORHEATER_0 TEMP_SENSOR_0
460
+  #define HEATER_0_USES_THERMISTOR
461
+#endif
462
+#if TEMP_SENSOR_1 > 0
463
+  #define THERMISTORHEATER_1 TEMP_SENSOR_1
464
+  #define HEATER_1_USES_THERMISTOR
465
+#endif
466
+#if TEMP_SENSOR_2 > 0
467
+  #define THERMISTORHEATER_2 TEMP_SENSOR_2
468
+  #define HEATER_2_USES_THERMISTOR
469
+#endif
470
+#if TEMP_SENSOR_BED > 0
471
+  #define THERMISTORBED TEMP_SENSOR_BED
472
+  #define BED_USES_THERMISTOR
473
+#endif
474
+#if TEMP_SENSOR_0 == -1
475
+  #define HEATER_0_USES_AD595
476
+#endif
477
+#if TEMP_SENSOR_1 == -1
478
+  #define HEATER_1_USES_AD595
479
+#endif
480
+#if TEMP_SENSOR_2 == -1
481
+  #define HEATER_2_USES_AD595
482
+#endif
483
+#if TEMP_SENSOR_BED == -1
484
+  #define BED_USES_AD595
485
+#endif
486
+#if TEMP_SENSOR_0 == -2
487
+  #define HEATER_0_USES_MAX6675
488
+#endif
489
+#if TEMP_SENSOR_0 == 0
490
+  #undef HEATER_0_MINTEMP
491
+  #undef HEATER_0_MAXTEMP
492
+#endif
493
+#if TEMP_SENSOR_1 == 0
494
+  #undef HEATER_1_MINTEMP
495
+  #undef HEATER_1_MAXTEMP
496
+#endif
497
+#if TEMP_SENSOR_2 == 0
498
+  #undef HEATER_2_MINTEMP
499
+  #undef HEATER_2_MAXTEMP
500
+#endif
501
+#if TEMP_SENSOR_BED == 0
502
+  #undef BED_MINTEMP
503
+  #undef BED_MAXTEMP
504
+#endif
505
+
506
+
507
+#endif //__CONFIGURATION_ADV_H

+ 183
- 29
Marlin/example_configurations/delta/Configuration.h View File

8
 //===========================================================================
8
 //===========================================================================
9
 //============================= DELTA Printer ===============================
9
 //============================= DELTA Printer ===============================
10
 //===========================================================================
10
 //===========================================================================
11
-// For a Delta printer rplace the configuration files wilth the files in the
11
+// For a Delta printer replace the configuration files with the files in the
12
 // example_configurations/delta directory.
12
 // example_configurations/delta directory.
13
 //
13
 //
14
 
14
 
41
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
41
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
42
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
42
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
43
 // 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
43
 // 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
44
+// 36 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Fan)
44
 // 4  = Duemilanove w/ ATMega328P pin assignment
45
 // 4  = Duemilanove w/ ATMega328P pin assignment
45
 // 5  = Gen6
46
 // 5  = Gen6
46
 // 51 = Gen6 deluxe
47
 // 51 = Gen6 deluxe
54
 // 68 = Azteeg X3 Pro
55
 // 68 = Azteeg X3 Pro
55
 // 7  = Ultimaker
56
 // 7  = Ultimaker
56
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
57
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
58
+// 72 = Ultimainboard 2.x (Uses TEMP_SENSOR 20)
57
 // 77 = 3Drag Controller
59
 // 77 = 3Drag Controller
58
 // 8  = Teensylu
60
 // 8  = Teensylu
59
 // 80 = Rumba
61
 // 80 = Rumba
60
 // 81 = Printrboard (AT90USB1286)
62
 // 81 = Printrboard (AT90USB1286)
61
 // 82 = Brainwave (AT90USB646)
63
 // 82 = Brainwave (AT90USB646)
62
 // 83 = SAV Mk-I (AT90USB1286)
64
 // 83 = SAV Mk-I (AT90USB1286)
65
+// 84 = Teensy++2.0 (AT90USB1286) // CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84  make
63
 // 9  = Gen3+
66
 // 9  = Gen3+
64
 // 70 = Megatronics
67
 // 70 = Megatronics
65
 // 701= Megatronics v2.0
68
 // 701= Megatronics v2.0
66
 // 702= Minitronics v1.0
69
 // 702= Minitronics v1.0
67
 // 90 = Alpha OMCA board
70
 // 90 = Alpha OMCA board
68
 // 91 = Final OMCA board
71
 // 91 = Final OMCA board
69
-// 301 = Rambo
72
+// 301= Rambo
70
 // 21 = Elefu Ra Board (v3)
73
 // 21 = Elefu Ra Board (v3)
74
+// 88 = 5DPrint D8 Driver Board
75
+// 999 = Leapfrog
71
 
76
 
72
 #ifndef MOTHERBOARD
77
 #ifndef MOTHERBOARD
73
 #define MOTHERBOARD 33
78
 #define MOTHERBOARD 33
89
 
94
 
90
 #define POWER_SUPPLY 1
95
 #define POWER_SUPPLY 1
91
 
96
 
92
-// Define this to have the electronics keep the powersupply off on startup. If you don't know what this is leave it.
97
+// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
93
 // #define PS_DEFAULT_OFF
98
 // #define PS_DEFAULT_OFF
94
 
99
 
95
 //===========================================================================
100
 //===========================================================================
103
 // and processor overload (too many expensive sqrt calls).
108
 // and processor overload (too many expensive sqrt calls).
104
 #define DELTA_SEGMENTS_PER_SECOND 200
109
 #define DELTA_SEGMENTS_PER_SECOND 200
105
 
110
 
106
-// NOTE NB all values for DELTA_* values MOUST be floating point, so always have a decimal point in them
111
+// NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them
107
 
112
 
108
 // Center-to-center distance of the holes in the diagonal push rods.
113
 // Center-to-center distance of the holes in the diagonal push rods.
109
 #define DELTA_DIAGONAL_ROD 250.0 // mm
114
 #define DELTA_DIAGONAL_ROD 250.0 // mm
132
 // 0 is not used
137
 // 0 is not used
133
 // 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
138
 // 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
134
 // 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
139
 // 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
135
-// 3 is mendel-parts thermistor (4.7k pullup)
140
+// 3 is Mendel-parts thermistor (4.7k pullup)
136
 // 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
141
 // 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
137
 // 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
142
 // 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
138
 // 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
143
 // 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
141
 // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
146
 // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
142
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
147
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
143
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
148
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
144
-// 60 is 100k Maker's Tool Works Kapton Bed Thermister
149
+// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
150
+// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
151
+// 13 is 100k Hisens 3950  1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" 
152
+// 20 is the PT100 circuit found in the Ultimainboard V2.x
153
+// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
145
 //
154
 //
146
 //    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
155
 //    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
147
 //                          (but gives greater accuracy and more stable PID)
156
 //                          (but gives greater accuracy and more stable PID)
148
 // 51 is 100k thermistor - EPCOS (1k pullup)
157
 // 51 is 100k thermistor - EPCOS (1k pullup)
149
 // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
158
 // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
150
 // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
159
 // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
160
+//
161
+// 1047 is Pt1000 with 4k7 pullup
162
+// 1010 is Pt1000 with 1k pullup (non standard)
163
+// 147 is Pt100 with 4k7 pullup
164
+// 110 is Pt100 with 1k pullup (non standard)
151
 
165
 
152
 #define TEMP_SENSOR_0 -1
166
 #define TEMP_SENSOR_0 -1
153
 #define TEMP_SENSOR_1 -1
167
 #define TEMP_SENSOR_1 -1
184
 // HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
198
 // HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
185
 //#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
199
 //#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
186
 
200
 
201
+// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
202
+//#define EXTRUDER_WATTS (12.0*12.0/6.7) //  P=I^2/R
203
+//#define BED_WATTS (12.0*12.0/1.1)      // P=I^2/R
204
+
187
 // PID settings:
205
 // PID settings:
188
 // Comment the following line to disable PID and enable bang-bang.
206
 // Comment the following line to disable PID and enable bang-bang.
189
 #define PIDTEMP
207
 #define PIDTEMP
196
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
214
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
197
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
215
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
198
   #define K1 0.95 //smoothing factor within the PID
216
   #define K1 0.95 //smoothing factor within the PID
199
-  #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
217
+  #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
200
 
218
 
201
-// If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it
219
+// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
202
 // Ultimaker
220
 // Ultimaker
203
     #define  DEFAULT_Kp 22.2
221
     #define  DEFAULT_Kp 22.2
204
     #define  DEFAULT_Ki 1.08
222
     #define  DEFAULT_Ki 1.08
205
     #define  DEFAULT_Kd 114
223
     #define  DEFAULT_Kd 114
206
 
224
 
207
-// Makergear
225
+// MakerGear
208
 //    #define  DEFAULT_Kp 7.0
226
 //    #define  DEFAULT_Kp 7.0
209
 //    #define  DEFAULT_Ki 0.1
227
 //    #define  DEFAULT_Ki 0.1
210
 //    #define  DEFAULT_Kd 12
228
 //    #define  DEFAULT_Kd 12
262
 #define EXTRUDE_MINTEMP 170
280
 #define EXTRUDE_MINTEMP 170
263
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
281
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
264
 
282
 
283
+/*================== Thermal Runaway Protection ==============================
284
+This is a feature to protect your printer from burn up in flames if it has
285
+a thermistor coming off place (this happened to a friend of mine recently and
286
+motivated me writing this feature).
287
+
288
+The issue: If a thermistor come off, it will read a lower temperature than actual.
289
+The system will turn the heater on forever, burning up the filament and anything
290
+else around.
291
+
292
+After the temperature reaches the target for the first time, this feature will 
293
+start measuring for how long the current temperature stays below the target 
294
+minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
295
+
296
+If it stays longer than _PERIOD, it means the thermistor temperature
297
+cannot catch up with the target, so something *may be* wrong. Then, to be on the
298
+safe side, the system will he halt.
299
+
300
+Bear in mind the count down will just start AFTER the first time the 
301
+thermistor temperature is over the target, so you will have no problem if
302
+your extruder heater takes 2 minutes to hit the target on heating.
303
+
304
+*/
305
+// If you want to enable this feature for all your extruder heaters,
306
+// uncomment the 2 defines below:
307
+
308
+// Parameters for all extruder heaters
309
+//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
310
+//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
311
+
312
+// If you want to enable this feature for your bed heater,
313
+// uncomment the 2 defines below:
314
+
315
+// Parameters for the bed heater
316
+//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
317
+//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
318
+//===========================================================================
319
+
320
+
265
 //===========================================================================
321
 //===========================================================================
266
 //=============================Mechanical Settings===========================
322
 //=============================Mechanical Settings===========================
267
 //===========================================================================
323
 //===========================================================================
273
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
329
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
274
 
330
 
275
 #ifndef ENDSTOPPULLUPS
331
 #ifndef ENDSTOPPULLUPS
276
-  // fine Enstop settings: Individual Pullups. will be ignored if ENDSTOPPULLUPS is defined
332
+  // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
277
   // #define ENDSTOPPULLUP_XMAX
333
   // #define ENDSTOPPULLUP_XMAX
278
   // #define ENDSTOPPULLUP_YMAX
334
   // #define ENDSTOPPULLUP_YMAX
279
   // #define ENDSTOPPULLUP_ZMAX
335
   // #define ENDSTOPPULLUP_ZMAX
317
 #define DISABLE_Y false
373
 #define DISABLE_Y false
318
 #define DISABLE_Z false
374
 #define DISABLE_Z false
319
 #define DISABLE_E false // For all extruders
375
 #define DISABLE_E false // For all extruders
376
+#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled
320
 
377
 
321
 #define INVERT_X_DIR false // DELTA does not invert
378
 #define INVERT_X_DIR false // DELTA does not invert
322
 #define INVERT_Y_DIR false
379
 #define INVERT_Y_DIR false
350
 //============================= Bed Auto Leveling ===========================
407
 //============================= Bed Auto Leveling ===========================
351
 
408
 
352
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
409
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
410
+#define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
353
 
411
 
354
 #ifdef ENABLE_AUTO_BED_LEVELING
412
 #ifdef ENABLE_AUTO_BED_LEVELING
355
 
413
 
356
-  // these are the positions on the bed to do the probing
357
-  #define LEFT_PROBE_BED_POSITION 15
358
-  #define RIGHT_PROBE_BED_POSITION 170
359
-  #define BACK_PROBE_BED_POSITION 180
360
-  #define FRONT_PROBE_BED_POSITION 20
414
+// There are 2 different ways to pick the X and Y locations to probe:
415
+
416
+//  - "grid" mode
417
+//    Probe every point in a rectangular grid
418
+//    You must specify the rectangle, and the density of sample points
419
+//    This mode is preferred because there are more measurements.
420
+//    It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive
421
+
422
+//  - "3-point" mode
423
+//    Probe 3 arbitrary points on the bed (that aren't colinear)
424
+//    You must specify the X & Y coordinates of all 3 points
425
+
426
+  #define AUTO_BED_LEVELING_GRID
427
+  // with AUTO_BED_LEVELING_GRID, the bed is sampled in a
428
+  // AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid
429
+  // and least squares solution is calculated
430
+  // Note: this feature occupies 10'206 byte
431
+  #ifdef AUTO_BED_LEVELING_GRID
432
+
433
+    // set the rectangle in which to probe
434
+    #define LEFT_PROBE_BED_POSITION 15
435
+    #define RIGHT_PROBE_BED_POSITION 170
436
+    #define BACK_PROBE_BED_POSITION 180
437
+    #define FRONT_PROBE_BED_POSITION 20
438
+
439
+     // set the number of grid points per dimension
440
+     // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
441
+    #define AUTO_BED_LEVELING_GRID_POINTS 2
442
+
443
+
444
+  #else  // not AUTO_BED_LEVELING_GRID
445
+    // with no grid, just probe 3 arbitrary points.  A simple cross-product
446
+    // is used to esimate the plane of the print bed
447
+
448
+      #define ABL_PROBE_PT_1_X 15
449
+      #define ABL_PROBE_PT_1_Y 180
450
+      #define ABL_PROBE_PT_2_X 15
451
+      #define ABL_PROBE_PT_2_Y 20
452
+      #define ABL_PROBE_PT_3_X 170
453
+      #define ABL_PROBE_PT_3_Y 20
454
+
455
+  #endif // AUTO_BED_LEVELING_GRID
361
 
456
 
362
-  // these are the offsets to the prob relative to the extruder tip (Hotend - Probe)
457
+
458
+  // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
363
   #define X_PROBE_OFFSET_FROM_EXTRUDER -25
459
   #define X_PROBE_OFFSET_FROM_EXTRUDER -25
364
   #define Y_PROBE_OFFSET_FROM_EXTRUDER -29
460
   #define Y_PROBE_OFFSET_FROM_EXTRUDER -29
365
   #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
461
   #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
372
   #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
468
   #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
373
   #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
469
   #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
374
 
470
 
471
+  //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
472
+  //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
375
 
473
 
376
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
474
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
377
   //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
475
   //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
380
 //  #define PROBE_SERVO_DEACTIVATION_DELAY 300
478
 //  #define PROBE_SERVO_DEACTIVATION_DELAY 300
381
 
479
 
382
 
480
 
383
-//If you have enabled the Bed Auto Levelling and are using the same Z Probe for Z Homing,
481
+//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
384
 //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
482
 //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
385
 
483
 
386
   #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
484
   #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
397
 
495
 
398
   #endif
496
   #endif
399
 
497
 
400
-#endif
498
+#endif // ENABLE_AUTO_BED_LEVELING
401
 
499
 
402
 
500
 
403
 // The position of the homing switches
501
 // The position of the homing switches
407
 //Manual homing switch locations:
505
 //Manual homing switch locations:
408
 
506
 
409
 #define MANUAL_HOME_POSITIONS  // MANUAL_*_HOME_POS below will be used
507
 #define MANUAL_HOME_POSITIONS  // MANUAL_*_HOME_POS below will be used
410
-// For deltabots this means top and center of the cartesian print volume.
508
+// For deltabots this means top and center of the Cartesian print volume.
411
 #define MANUAL_X_HOME_POS 0
509
 #define MANUAL_X_HOME_POS 0
412
 #define MANUAL_Y_HOME_POS 0
510
 #define MANUAL_Y_HOME_POS 0
413
 #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
511
 #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
442
 //=============================Additional Features===========================
540
 //=============================Additional Features===========================
443
 //===========================================================================
541
 //===========================================================================
444
 
542
 
543
+// Custom M code points
544
+#define CUSTOM_M_CODES
545
+#ifdef CUSTOM_M_CODES
546
+  #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
547
+  #define Z_PROBE_OFFSET_RANGE_MIN -15
548
+  #define Z_PROBE_OFFSET_RANGE_MAX -5
549
+#endif
550
+
551
+
445
 // EEPROM
552
 // EEPROM
446
-// the microcontroller can store settings in the EEPROM, e.g. max velocity...
447
-// M500 - stores paramters in EEPROM
553
+// The microcontroller can store settings in the EEPROM, e.g. max velocity...
554
+// M500 - stores parameters in EEPROM
448
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
555
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
449
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
556
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
450
-//define this to enable eeprom support
557
+//define this to enable EEPROM support
451
 //#define EEPROM_SETTINGS
558
 //#define EEPROM_SETTINGS
452
 //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
559
 //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
453
 // please keep turned on if you can.
560
 // please keep turned on if you can.
463
 #define ABS_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
570
 #define ABS_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
464
 
571
 
465
 //LCD and SD support
572
 //LCD and SD support
466
-//#define ULTRA_LCD  //general lcd support, also 16x2
573
+//#define ULTRA_LCD  //general LCD support, also 16x2
467
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
574
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
468
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
575
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
469
 //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
576
 //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
577
+//#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
470
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
578
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
471
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
579
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
472
-//#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
473
-//#define ULTIPANEL  //the ultipanel as on thingiverse
580
+//#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
581
+//#define ULTIPANEL  //the UltiPanel as on Thingiverse
582
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
583
+//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
474
 
584
 
475
 // The MaKr3d Makr-Panel with graphic controller and SD support
585
 // The MaKr3d Makr-Panel with graphic controller and SD support
476
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
586
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
556
   #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
666
   #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
557
   #define NEWPANEL
667
   #define NEWPANEL
558
   #define ULTIPANEL
668
   #define ULTIPANEL
669
+
670
+  #ifndef ENCODER_PULSES_PER_STEP
671
+	#define ENCODER_PULSES_PER_STEP 4
672
+  #endif
673
+
674
+  #ifndef ENCODER_STEPS_PER_MENU_ITEM
675
+	#define ENCODER_STEPS_PER_MENU_ITEM 1
676
+  #endif
677
+
678
+
679
+  #ifdef LCD_USE_I2C_BUZZER
680
+	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
681
+	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
682
+  #endif
683
+
559
 #endif
684
 #endif
560
 
685
 
561
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
686
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
578
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
703
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
579
 //#define SR_LCD
704
 //#define SR_LCD
580
 #ifdef SR_LCD
705
 #ifdef SR_LCD
581
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
706
+   #define SR_LCD_2W_NL    // Non latching 2 wire shift register
582
    //#define NEWPANEL
707
    //#define NEWPANEL
583
 #endif
708
 #endif
584
 
709
 
594
     #define LCD_WIDTH 20
719
     #define LCD_WIDTH 20
595
     #define LCD_HEIGHT 4
720
     #define LCD_HEIGHT 4
596
   #endif
721
   #endif
597
-#else //no panel but just lcd
722
+#else //no panel but just LCD
598
   #ifdef ULTRA_LCD
723
   #ifdef ULTRA_LCD
599
   #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
724
   #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
600
     #define LCD_WIDTH 20
725
     #define LCD_WIDTH 20
616
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
741
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
617
 //#define FAST_PWM_FAN
742
 //#define FAST_PWM_FAN
618
 
743
 
619
-// Temperature status leds that display the hotend and bet temperature.
620
-// If alle hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
744
+// Temperature status LEDs that display the hotend and bet temperature.
745
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
621
 // Otherwise the RED led is on. There is 1C hysteresis.
746
 // Otherwise the RED led is on. There is 1C hysteresis.
622
 //#define TEMP_STAT_LEDS
747
 //#define TEMP_STAT_LEDS
623
 
748
 
667
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
792
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
668
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
793
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
669
 
794
 
795
+/**********************************************************************\
796
+ * Support for a filament diameter sensor
797
+ * Also allows adjustment of diameter at print time (vs  at slicing)
798
+ * Single extruder only at this point (extruder 0)
799
+ * 
800
+ * Motherboards
801
+ * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector 
802
+ * 81 - Printrboard - Uses Analog input 2 on the Aux 2 connector
803
+ * 301 - Rambo  - uses Analog input 3
804
+ * Note may require analog pins to be defined for different motherboards
805
+ **********************************************************************/
806
+#define FILAMENT_SENSOR
807
+#define FILAMENT_SENSOR_EXTRUDER_NUM	0  //The number of the extruder that has the filament sensor (0,1,2)
808
+#define MEASUREMENT_DELAY_CM			14  //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
809
+
810
+#define DEFAULT_NOMINAL_FILAMENT_DIA  3.0  //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software.  Used for sensor reading validation
811
+#define MEASURED_UPPER_LIMIT          3.30  //upper limit factor used for sensor reading validation in mm
812
+#define MEASURED_LOWER_LIMIT          1.90  //lower limit factor for sensor reading validation in mm
813
+#define MAX_MEASUREMENT_DELAY			20  //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM  and lower number saves RAM)
814
+
815
+//defines used in the code
816
+#define DEFAULT_MEASURED_FILAMENT_DIA  DEFAULT_NOMINAL_FILAMENT_DIA  //set measured to nominal initially 
817
+
818
+
819
+
820
+
821
+
822
+
823
+
670
 #include "Configuration_adv.h"
824
 #include "Configuration_adv.h"
671
 #include "thermistortables.h"
825
 #include "thermistortables.h"
672
 
826
 

+ 13
- 2
Marlin/example_configurations/delta/Configuration_adv.h View File

281
 //=============================Additional Features===========================
281
 //=============================Additional Features===========================
282
 //===========================================================================
282
 //===========================================================================
283
 
283
 
284
+//#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
285
+#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
286
+
284
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
287
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
285
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
288
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
286
 
289
 
401
 // the moves are than replaced by the firmware controlled ones.
404
 // the moves are than replaced by the firmware controlled ones.
402
 
405
 
403
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
406
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
404
-#define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt
405
-
407
+#ifdef FWRETRACT
408
+  #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
409
+  #define RETRACT_LENGTH 3               //default retract length (positive mm)
410
+  #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
411
+  #define RETRACT_FEEDRATE 45            //default feedrate for retracting (mm/s)
412
+  #define RETRACT_ZLIFT 0                //default retract Z-lift
413
+  #define RETRACT_RECOVER_LENGTH 0       //default additional recover length (mm, added to retract length when recovering)
414
+  #define RETRACT_RECOVER_LENGTH_SWAP 0  //default additional swap recover length (mm, added to retract length when recovering from extruder change)
415
+  #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
416
+#endif
406
 
417
 
407
 //adds support for experimental filament exchange support M600; requires display
418
 //adds support for experimental filament exchange support M600; requires display
408
 #ifdef ULTIPANEL
419
 #ifdef ULTIPANEL

+ 89
- 989
Marlin/language.h
File diff suppressed because it is too large
View File


+ 8
- 0
Marlin/motion_control.cpp View File

44
   if (angular_travel < 0) { angular_travel += 2*M_PI; }
44
   if (angular_travel < 0) { angular_travel += 2*M_PI; }
45
   if (isclockwise) { angular_travel -= 2*M_PI; }
45
   if (isclockwise) { angular_travel -= 2*M_PI; }
46
   
46
   
47
+  //20141002:full circle for G03 did not work, e.g. G03 X80 Y80 I20 J0 F2000 is giving an Angle of zero so head is not moving
48
+  //to compensate when start pos = target pos && angle is zero -> angle = 2Pi
49
+  if (position[axis_0] == target[axis_0] && position[axis_1] == target[axis_1] && angular_travel == 0)
50
+  {
51
+	  angular_travel += 2*M_PI;
52
+  }
53
+  //end fix G03
54
+  
47
   float millimeters_of_travel = hypot(angular_travel*radius, fabs(linear_travel));
55
   float millimeters_of_travel = hypot(angular_travel*radius, fabs(linear_travel));
48
   if (millimeters_of_travel < 0.001) { return; }
56
   if (millimeters_of_travel < 0.001) { return; }
49
   uint16_t segments = floor(millimeters_of_travel/MM_PER_ARC_SEGMENT);
57
   uint16_t segments = floor(millimeters_of_travel/MM_PER_ARC_SEGMENT);

+ 79
- 9
Marlin/pins.h View File

95
 #endif /* 88 */
95
 #endif /* 88 */
96
 
96
 
97
 /****************************************************************************************
97
 /****************************************************************************************
98
+* Leapfrog Driver board
99
+* 
100
+****************************************************************************************/
101
+#if MOTHERBOARD == 999  // Leapfrog board
102
+#define KNOWN_BOARD 1
103
+
104
+#ifndef __AVR_ATmega1280__
105
+ #ifndef __AVR_ATmega2560__
106
+ #error Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
107
+ #endif
108
+#endif
109
+
110
+#define X_STEP_PIN         28
111
+#define X_DIR_PIN          63
112
+#define X_ENABLE_PIN       29
113
+#define X_MIN_PIN          47
114
+#define X_MAX_PIN          -1   //2 //Max endstops default to disabled "-1", set to commented value to enable.
115
+
116
+#define Y_STEP_PIN         14 // A6
117
+#define Y_DIR_PIN          15 // A0
118
+#define Y_ENABLE_PIN       39
119
+#define Y_MIN_PIN          48
120
+#define Y_MAX_PIN          -1   //15
121
+
122
+#define Z_STEP_PIN         31 // A2
123
+#define Z_DIR_PIN          32 // A6
124
+#define Z_ENABLE_PIN       30 // A1
125
+#define Z_MIN_PIN          49
126
+#define Z_MAX_PIN          -1
127
+
128
+#define E0_STEP_PIN         34  //34
129
+#define E0_DIR_PIN          35 //35
130
+#define E0_ENABLE_PIN       33 //33
131
+
132
+#define E1_STEP_PIN         37 //37
133
+#define E1_DIR_PIN          40 //40
134
+#define E1_ENABLE_PIN       36 //36
135
+
136
+#define Y2_STEP_PIN         37
137
+#define Y2_DIR_PIN          40
138
+#define Y2_ENABLE_PIN       36
139
+
140
+#define Z2_STEP_PIN         37
141
+#define Z2_DIR_PIN          40
142
+#define Z2_ENABLE_PIN       36
143
+
144
+#define SDPOWER            -1
145
+#define SDSS               11
146
+#define SDCARDDETECT       -1 // 10 optional also used as mode pin
147
+#define LED_PIN            13
148
+#define FAN_PIN            7
149
+#define PS_ON_PIN          -1
150
+#define KILL_PIN           -1
151
+#define SOL1_PIN   16
152
+#define SOL2_PIN    17
153
+
154
+#define HEATER_0_PIN       9
155
+#define HEATER_1_PIN       8 // 12
156
+#define HEATER_2_PIN       11 //-1 // 13
157
+#define TEMP_0_PIN         13 //D27   // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
158
+#define TEMP_1_PIN         15 // 1
159
+#define TEMP_2_PIN         -1 // 2
160
+#define HEATER_BED_PIN     10 // 14/15
161
+#define TEMP_BED_PIN       14 // 1,2 or I2C
162
+/*  Unused (1) (2) (3) 4 5 6 7 8 9 10 11 12 13 (14) (15) (16) 17 (18) (19) (20) (21) (22) (23) 24 (25) (26) (27) 28 (29) (30) (31)  */
163
+
164
+
165
+#endif
166
+
167
+/****************************************************************************************
98
 *
168
 *
99
 *
169
 *
100
 ****************************************************************************************/
170
 ****************************************************************************************/
461
 * Arduino Mega pin assignment
531
 * Arduino Mega pin assignment
462
 *
532
 *
463
 ****************************************************************************************/
533
 ****************************************************************************************/
464
-#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77 || MOTHERBOARD == 67 || MOTHERBOARD == 68
534
+#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 36 || MOTHERBOARD == 77 || MOTHERBOARD == 67 || MOTHERBOARD == 68
465
 #define KNOWN_BOARD 1
535
 #define KNOWN_BOARD 1
466
 
536
 
467
 //////////////////FIX THIS//////////////
537
 //////////////////FIX THIS//////////////
477
 // #define RAMPS_V_1_0
547
 // #define RAMPS_V_1_0
478
 
548
 
479
 
549
 
480
-#if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77 || MOTHERBOARD == 67 || MOTHERBOARD == 68
550
+#if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 36 ||  MOTHERBOARD == 77 || MOTHERBOARD == 67 || MOTHERBOARD == 68
481
 
551
 
482
   #define LARGE_FLASH true
552
   #define LARGE_FLASH true
483
 
553
 
592
     #define FAN_PIN            4 // IO pin. Buffer needed
662
     #define FAN_PIN            4 // IO pin. Buffer needed
593
   #endif
663
   #endif
594
 
664
 
595
-  #if MOTHERBOARD == 77
665
+  #if MOTHERBOARD == 77 || MOTHERBOARD == 36
596
     #define FAN_PIN            8
666
     #define FAN_PIN            8
597
   #endif
667
   #endif
598
 
668
 
648
     #define TEMP_2_PIN         -1   // ANALOG NUMBERING
718
     #define TEMP_2_PIN         -1   // ANALOG NUMBERING
649
   #endif
719
   #endif
650
 
720
 
651
-  #if MOTHERBOARD == 35
721
+  #if MOTHERBOARD == 35 || MOTHERBOARD == 36
652
     #define HEATER_BED_PIN     -1    // NO BED
722
     #define HEATER_BED_PIN     -1    // NO BED
653
   #else
723
   #else
654
     #if MOTHERBOARD == 77
724
     #if MOTHERBOARD == 77
832
 
902
 
833
 #ifndef SDSUPPORT
903
 #ifndef SDSUPPORT
834
 // these pins are defined in the SD library if building with SD support
904
 // these pins are defined in the SD library if building with SD support
835
-  #define MAX_SCK_PIN          52
836
-  #define MAX_MISO_PIN         50
837
-  #define MAX_MOSI_PIN         51
905
+  #define SCK_PIN          52
906
+  #define MISO_PIN         50
907
+  #define MOSI_PIN         51
838
   #define MAX6675_SS       53
908
   #define MAX6675_SS       53
839
 #else
909
 #else
840
   #define MAX6675_SS       49
910
   #define MAX6675_SS       49
2020
 #define Z_DIR_PIN          28
2090
 #define Z_DIR_PIN          28
2021
 #define Z_STOP_PIN         30
2091
 #define Z_STOP_PIN         30
2022
 
2092
 
2023
-#define E0_STEP_PIN         17
2024
-#define E0_DIR_PIN          21
2093
+#define E0_STEP_PIN        17
2094
+#define E0_DIR_PIN         21
2025
 
2095
 
2026
 #define LED_PIN            -1
2096
 #define LED_PIN            -1
2027
 
2097
 

+ 28
- 3
Marlin/planner.cpp View File

96
 bool autotemp_enabled=false;
96
 bool autotemp_enabled=false;
97
 #endif
97
 #endif
98
 
98
 
99
+unsigned char g_uc_extruder_last_move[3] = {0,0,0};
100
+
99
 //===========================================================================
101
 //===========================================================================
100
 //=================semi-private variables, used in inline  functions    =====
102
 //=================semi-private variables, used in inline  functions    =====
101
 //===========================================================================
103
 //===========================================================================
666
   {
668
   {
667
     if (DISABLE_INACTIVE_EXTRUDER) //enable only selected extruder
669
     if (DISABLE_INACTIVE_EXTRUDER) //enable only selected extruder
668
     {
670
     {
671
+
672
+      if(g_uc_extruder_last_move[0] > 0) g_uc_extruder_last_move[0]--;
673
+      if(g_uc_extruder_last_move[1] > 0) g_uc_extruder_last_move[1]--;
674
+      if(g_uc_extruder_last_move[2] > 0) g_uc_extruder_last_move[2]--;
675
+      
669
       switch(extruder)
676
       switch(extruder)
670
       {
677
       {
671
-        case 0: enable_e0(); disable_e1(); disable_e2(); break;
672
-        case 1: disable_e0(); enable_e1(); disable_e2(); break;
673
-        case 2: disable_e0(); disable_e1(); enable_e2(); break;
678
+        case 0: 
679
+          enable_e0(); 
680
+          g_uc_extruder_last_move[0] = BLOCK_BUFFER_SIZE*2;
681
+          
682
+          if(g_uc_extruder_last_move[1] == 0) disable_e1(); 
683
+          if(g_uc_extruder_last_move[2] == 0) disable_e2(); 
684
+        break;
685
+        case 1:
686
+          enable_e1(); 
687
+          g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE*2;
688
+          
689
+          if(g_uc_extruder_last_move[0] == 0) disable_e0(); 
690
+          if(g_uc_extruder_last_move[2] == 0) disable_e2(); 
691
+        break;
692
+        case 2:
693
+          enable_e2(); 
694
+          g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE*2;
695
+          
696
+          if(g_uc_extruder_last_move[0] == 0) disable_e0(); 
697
+          if(g_uc_extruder_last_move[1] == 0) disable_e1(); 
698
+        break;        
674
       }
699
       }
675
     }
700
     }
676
     else //enable all
701
     else //enable all

+ 1
- 1
Marlin/stepper.cpp View File

1241
   pinMode(Y_MS1_PIN,OUTPUT);
1241
   pinMode(Y_MS1_PIN,OUTPUT);
1242
   pinMode(Y_MS2_PIN,OUTPUT);
1242
   pinMode(Y_MS2_PIN,OUTPUT);
1243
   pinMode(Z_MS1_PIN,OUTPUT);
1243
   pinMode(Z_MS1_PIN,OUTPUT);
1244
-  pinMode(Z_MS2_PIN,OUTPUT);  
1244
+  pinMode(Z_MS2_PIN,OUTPUT);
1245
   pinMode(E0_MS1_PIN,OUTPUT);
1245
   pinMode(E0_MS1_PIN,OUTPUT);
1246
   pinMode(E0_MS2_PIN,OUTPUT);
1246
   pinMode(E0_MS2_PIN,OUTPUT);
1247
   for(int i=0;i<=4;i++) microstep_mode(i,microstep_modes[i]);
1247
   for(int i=0;i<=4;i++) microstep_mode(i,microstep_modes[i]);

+ 16
- 9
Marlin/temperature.cpp View File

34
 #include "temperature.h"
34
 #include "temperature.h"
35
 #include "watchdog.h"
35
 #include "watchdog.h"
36
 
36
 
37
+#include "Sd2PinMap.h"
38
+
39
+
37
 //===========================================================================
40
 //===========================================================================
38
 //=============================public variables============================
41
 //=============================public variables============================
39
 //===========================================================================
42
 //===========================================================================
809
 
812
 
810
   #ifdef HEATER_0_USES_MAX6675
813
   #ifdef HEATER_0_USES_MAX6675
811
     #ifndef SDSUPPORT
814
     #ifndef SDSUPPORT
812
-      SET_OUTPUT(MAX_SCK_PIN);
813
-      WRITE(MAX_SCK_PIN,0);
815
+      SET_OUTPUT(SCK_PIN);
816
+      WRITE(SCK_PIN,0);
814
     
817
     
815
-      SET_OUTPUT(MAX_MOSI_PIN);
816
-      WRITE(MAX_MOSI_PIN,1);
818
+      SET_OUTPUT(MOSI_PIN);
819
+      WRITE(MOSI_PIN,1);
817
     
820
     
818
-      SET_INPUT(MAX_MISO_PIN);
819
-      WRITE(MAX_MISO_PIN,1);
821
+      SET_INPUT(MISO_PIN);
822
+      WRITE(MISO_PIN,1);
820
     #endif
823
     #endif
824
+    /* Using pinMode and digitalWrite, as that was the only way I could get it to compile */
821
     
825
     
822
-    SET_OUTPUT(MAX6675_SS);
823
-    WRITE(MAX6675_SS,1);
826
+    //Have to toggle SD card CS pin to low first, to enable firmware to talk with SD card
827
+	pinMode(SS_PIN, OUTPUT);
828
+	digitalWrite(SS_PIN,0);  
829
+	pinMode(MAX6675_SS, OUTPUT);
830
+	digitalWrite(MAX6675_SS,1);
824
   #endif
831
   #endif
825
 
832
 
826
   // Set analog inputs
833
   // Set analog inputs
1117
 
1124
 
1118
 #ifdef HEATER_0_USES_MAX6675
1125
 #ifdef HEATER_0_USES_MAX6675
1119
 #define MAX6675_HEAT_INTERVAL 250
1126
 #define MAX6675_HEAT_INTERVAL 250
1120
-long max6675_previous_millis = -HEAT_INTERVAL;
1127
+long max6675_previous_millis = MAX6675_HEAT_INTERVAL;
1121
 int max6675_temp = 2000;
1128
 int max6675_temp = 2000;
1122
 
1129
 
1123
 int read_max6675()
1130
 int read_max6675()

+ 69
- 75
Marlin/thermistortables.h View File

621
 };
621
 };
622
 #endif
622
 #endif
623
 
623
 
624
+#if (THERMISTORHEATER_0 == 13) || (THERMISTORHEATER_1 == 13) || (THERMISTORHEATER_2 == 13) || (THERMISTORBED == 13)
625
+// Hisens thermistor B25/50 =3950 +/-1%
626
+
627
+const short temptable_13[][2] PROGMEM = {
628
+ {	22.5*OVERSAMPLENR,	300	},
629
+{	24.125*OVERSAMPLENR,	295	},
630
+{	25.875*OVERSAMPLENR,	290	},
631
+{	27.8125*OVERSAMPLENR,	285	},
632
+{	29.9375*OVERSAMPLENR,	280	},
633
+{	32.25*OVERSAMPLENR,	275	},
634
+{	34.8125*OVERSAMPLENR,	270	},
635
+{	37.625*OVERSAMPLENR,	265	},
636
+{	40.6875*OVERSAMPLENR,	260	},
637
+{	44.0625*OVERSAMPLENR,	255	},
638
+{	47.75*OVERSAMPLENR,	250	},
639
+{	51.8125*OVERSAMPLENR,	245	},
640
+{	56.3125*OVERSAMPLENR,	240	},
641
+{	61.25*OVERSAMPLENR,	235	},
642
+{	66.75*OVERSAMPLENR,	230	},
643
+{	72.8125*OVERSAMPLENR,	225	},
644
+{	79.5*OVERSAMPLENR,	220	},
645
+{	87*OVERSAMPLENR,	215	},
646
+{	95.3125*OVERSAMPLENR,	210	},
647
+{	104.1875*OVERSAMPLENR,	205	},
648
+{	112.75*OVERSAMPLENR,	200	},
649
+{	123.125*OVERSAMPLENR,	195	},
650
+{	135.75*OVERSAMPLENR,	190	},
651
+{	148.3125*OVERSAMPLENR,	185	},
652
+{	163.8125*OVERSAMPLENR,	180	},
653
+{	179*OVERSAMPLENR,	175	},
654
+{	211.125*OVERSAMPLENR,	170	},
655
+{	216.125*OVERSAMPLENR,	165	},
656
+{	236.5625*OVERSAMPLENR,	160	},
657
+{	258.5*OVERSAMPLENR,	155	},
658
+{	279.875*OVERSAMPLENR,	150	},
659
+{	305.375*OVERSAMPLENR,	145	},
660
+{	333.25*OVERSAMPLENR,	140	},
661
+{	362.5625*OVERSAMPLENR,	135	},
662
+{	393.6875*OVERSAMPLENR,	130	},
663
+{	425*OVERSAMPLENR,	125	},
664
+{	460.625*OVERSAMPLENR,	120	},
665
+{	495.1875*OVERSAMPLENR,	115	},
666
+{	530.875*OVERSAMPLENR,	110	},
667
+{	567.25*OVERSAMPLENR,	105	},
668
+{	601.625*OVERSAMPLENR,	100	},
669
+{	637.875*OVERSAMPLENR,	95	},
670
+{	674.5625*OVERSAMPLENR,	90	},
671
+{	710*OVERSAMPLENR,	85	},
672
+{	744.125*OVERSAMPLENR,	80	},
673
+{	775.9375*OVERSAMPLENR,	75	},
674
+{	806.875*OVERSAMPLENR,	70	},
675
+{	835.1875*OVERSAMPLENR,	65	},
676
+{	861.125*OVERSAMPLENR,	60	},
677
+{	884.375*OVERSAMPLENR,	55	},
678
+{	904.5625*OVERSAMPLENR,	50	},
679
+{	923.8125*OVERSAMPLENR,	45	},
680
+{	940.375*OVERSAMPLENR,	40	},
681
+{	954.625*OVERSAMPLENR,	35	},
682
+{	966.875*OVERSAMPLENR,	30	},
683
+{	977.0625*OVERSAMPLENR,	25	},
684
+{	986*OVERSAMPLENR,	20	},
685
+{	993.375*OVERSAMPLENR,	15	},
686
+{	999.5*OVERSAMPLENR,	10	},
687
+{	1004.5*OVERSAMPLENR,	5	},
688
+{	1008.5*OVERSAMPLENR,	0	}
689
+
690
+ };
691
+#endif
692
+
624
 #if (THERMISTORHEATER_0 == 20) || (THERMISTORHEATER_1 == 20) || (THERMISTORHEATER_2 == 20) || (THERMISTORBED == 20) // PT100 with INA826 amp on Ultimaker v2.0 electronics
693
 #if (THERMISTORHEATER_0 == 20) || (THERMISTORHEATER_1 == 20) || (THERMISTORHEATER_2 == 20) || (THERMISTORBED == 20) // PT100 with INA826 amp on Ultimaker v2.0 electronics
625
 /* The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature.
694
 /* The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature.
626
 This does not match the normal thermistor behaviour so we need to set the following defines */
695
 This does not match the normal thermistor behaviour so we need to set the following defines */
1021
   PtLine(300,1000,4700)
1090
   PtLine(300,1000,4700)
1022
 };
1091
 };
1023
 #endif
1092
 #endif
1024
-#if (THERMISTORHEATER_0 == 70) || (THERMISTORHEATER_1 == 70) || (THERMISTORHEATER_2 == 70) || (THERMISTORBED == 70) // 500C thermistor for Pico hot end
1025
-const short temptable_70[][2] PROGMEM = {
1026
-  {  110.774119598719*OVERSAMPLENR ,  350 },
1027
-  {  118.214386957249*OVERSAMPLENR ,  345 },
1028
-  {  126.211418543166*OVERSAMPLENR ,  340 },
1029
-  {  134.789559066223*OVERSAMPLENR ,  335 },
1030
-  {  144.004513869701*OVERSAMPLENR ,  330 },
1031
-  {  153.884483790827*OVERSAMPLENR ,  325 },
1032
-  {  164.484880793637*OVERSAMPLENR ,  320 },
1033
-  {  175.848885102724*OVERSAMPLENR ,  315 },
1034
-  {  188.006799079015*OVERSAMPLENR ,  310 },
1035
-  {  201.008072969044*OVERSAMPLENR ,  305 },
1036
-  {  214.83716032276*OVERSAMPLENR ,  300 },
1037
-  {  229.784739779664*OVERSAMPLENR ,  295 },
1038
-  {  245.499466045473*OVERSAMPLENR ,  290 },
1039
-  {  262.2766342096*OVERSAMPLENR ,  285 },
1040
-  {  280.073883176433*OVERSAMPLENR ,  280 },
1041
-  {  298.952693467726*OVERSAMPLENR ,  275 },
1042
-  {  318.808251051674*OVERSAMPLENR ,  270 },
1043
-  {  337.490932563222*OVERSAMPLENR ,  265 },
1044
-  {  361.683649122745*OVERSAMPLENR ,  260 },
1045
-  {  384.717024083981*OVERSAMPLENR ,  255 },
1046
-  {  408.659301759076*OVERSAMPLENR ,  250 },
1047
-  {  433.471659455884*OVERSAMPLENR ,  245 },
1048
-  {  459.199039926034*OVERSAMPLENR ,  240 },
1049
-  {  485.566500982316*OVERSAMPLENR ,  235 },
1050
-  {  512.538918631075*OVERSAMPLENR ,  230 },
1051
-  {  539.980999544838*OVERSAMPLENR ,  225 },
1052
-  {  567.783095549935*OVERSAMPLENR ,  220 },
1053
-  {  595.698041673552*OVERSAMPLENR ,  215 },
1054
-  {  623.633922319597*OVERSAMPLENR ,  210 },
1055
-  {  651.356162750829*OVERSAMPLENR ,  205 },
1056
-  {  678.700901620956*OVERSAMPLENR ,  200 },
1057
-  {  705.528145361264*OVERSAMPLENR ,  195 },
1058
-  {  731.61267976339*OVERSAMPLENR ,  190 },
1059
-  {  756.786212184365*OVERSAMPLENR ,  185 },
1060
-  {  780.950223357761*OVERSAMPLENR ,  180 },
1061
-  {  804.012961595082*OVERSAMPLENR ,  175 },
1062
-  {  825.904975939166*OVERSAMPLENR ,  170 },
1063
-  {  846.403941639008*OVERSAMPLENR ,  165 },
1064
-  {  865.52326974895*OVERSAMPLENR ,  160 },
1065
-  {  883.246145367727*OVERSAMPLENR ,  155 },
1066
-  {  899.5821946515*OVERSAMPLENR ,  150 },
1067
-  {  914.544289228582*OVERSAMPLENR ,  145 },
1068
-  {  928.145628221761*OVERSAMPLENR ,  140 },
1069
-  {  940.422208546562*OVERSAMPLENR ,  135 },
1070
-  {  951.456922916497*OVERSAMPLENR ,  130 },
1071
-  {  961.303500633788*OVERSAMPLENR ,  125 },
1072
-  {  970.044756889055*OVERSAMPLENR ,  120 },
1073
-  {  977.761456230051*OVERSAMPLENR ,  115 },
1074
-  {  984.540978083453*OVERSAMPLENR ,  110 },
1075
-  {  990.440780765757*OVERSAMPLENR ,  105 },
1076
-  {  995.589621465301*OVERSAMPLENR ,  100 },
1077
-  {  1000.02514280144*OVERSAMPLENR ,  95 },
1078
-  {  1003.84429789876*OVERSAMPLENR ,  90 },
1079
-  {  1007.10199009318*OVERSAMPLENR ,  85 },
1080
-  {  1009.87151698323*OVERSAMPLENR ,  80 },
1081
-  {  1012.21633594237*OVERSAMPLENR ,  75 },
1082
-  {  1014.18959892949*OVERSAMPLENR ,  70 },
1083
-  {  1015.84079162998*OVERSAMPLENR ,  65 },
1084
-  {  1017.21555915335*OVERSAMPLENR ,  60 },
1085
-  {  1018.35284662863*OVERSAMPLENR ,  55 },
1086
-  {  1019.28926921888*OVERSAMPLENR ,  50 },
1087
-  {  1020.05398015669*OVERSAMPLENR ,  45 },
1088
-  {  1020.67737496272*OVERSAMPLENR ,  40 },
1089
-  {  1021.1802909627*OVERSAMPLENR ,  35 },
1090
-  {  1021.58459281248*OVERSAMPLENR ,  30 },
1091
-  {  1021.90701441192*OVERSAMPLENR ,  25 },
1092
-  {  1022.16215103698*OVERSAMPLENR ,  20 },
1093
-  {  1022.36275529549*OVERSAMPLENR ,  15 },
1094
-  {  1022.51930392497*OVERSAMPLENR ,  10 },
1095
-  {  1022.64051573734*OVERSAMPLENR ,  5 },
1096
-  {  1022.73355805611*OVERSAMPLENR ,  0 }
1097
-};
1098
-#endif
1099
 
1093
 
1100
 #define _TT_NAME(_N) temptable_ ## _N
1094
 #define _TT_NAME(_N) temptable_ ## _N
1101
 #define TT_NAME(_N) _TT_NAME(_N)
1095
 #define TT_NAME(_N) _TT_NAME(_N)

+ 55
- 20
Marlin/ultralcd.cpp View File

19
 int absPreheatHPBTemp;
19
 int absPreheatHPBTemp;
20
 int absPreheatFanSpeed;
20
 int absPreheatFanSpeed;
21
 
21
 
22
+
22
 #ifdef ULTIPANEL
23
 #ifdef ULTIPANEL
23
 static float manual_feedrate[] = MANUAL_FEEDRATE;
24
 static float manual_feedrate[] = MANUAL_FEEDRATE;
24
 #endif // ULTIPANEL
25
 #endif // ULTIPANEL
255
         enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
256
         enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
256
     }
257
     }
257
     autotempShutdown();
258
     autotempShutdown();
258
-    
259
-    cancel_heatup = true;
259
+
260
+	cancel_heatup = true;
260
 }
261
 }
261
 
262
 
262
 /* Menu implementation */
263
 /* Menu implementation */
306
 }
307
 }
307
 #endif
308
 #endif
308
 
309
 
310
+void lcd_set_home_offsets()
311
+{
312
+    for(int8_t i=0; i < NUM_AXIS; i++) {
313
+      if (i != E_AXIS) {
314
+        add_homing[i] -= current_position[i];
315
+        current_position[i] = 0.0;
316
+      }
317
+    }
318
+    plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]);
319
+
320
+    // Audio feedback
321
+    enquecommand_P(PSTR("M300 S659 P200"));
322
+    enquecommand_P(PSTR("M300 S698 P200"));
323
+    lcd_return_to_status();
324
+}
325
+
326
+
309
 #ifdef BABYSTEPPING
327
 #ifdef BABYSTEPPING
310
 static void lcd_babystep_x()
328
 static void lcd_babystep_x()
311
 {
329
 {
373
     START_MENU();
391
     START_MENU();
374
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
392
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
375
     MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999);
393
     MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999);
394
+#if TEMP_SENSOR_0 != 0
376
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
395
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
396
+#endif
377
 #if TEMP_SENSOR_1 != 0
397
 #if TEMP_SENSOR_1 != 0
378
     MENU_ITEM_EDIT(int3, MSG_NOZZLE1, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
398
     MENU_ITEM_EDIT(int3, MSG_NOZZLE1, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
379
 #endif
399
 #endif
565
 #endif
585
 #endif
566
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
586
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
567
     MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
587
     MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
588
+    MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
568
     //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
589
     //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
569
 #if TEMP_SENSOR_0 != 0
590
 #if TEMP_SENSOR_0 != 0
570
   #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0
591
   #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0
779
 
800
 
780
     START_MENU();
801
     START_MENU();
781
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
802
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
803
+#if TEMP_SENSOR_0 != 0
782
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
804
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
805
+#endif
783
 #if TEMP_SENSOR_1 != 0
806
 #if TEMP_SENSOR_1 != 0
784
     MENU_ITEM_EDIT(int3, MSG_NOZZLE1, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
807
     MENU_ITEM_EDIT(int3, MSG_NOZZLE1, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
785
 #endif
808
 #endif
790
     MENU_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
813
     MENU_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
791
 #endif
814
 #endif
792
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
815
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
793
-#ifdef AUTOTEMP
816
+#if defined AUTOTEMP && (TEMP_SENSOR_0 != 0)
794
     MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled);
817
     MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled);
795
     MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15);
818
     MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15);
796
     MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15);
819
     MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15);
815
     START_MENU();
838
     START_MENU();
816
     MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
839
     MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
817
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &plaPreheatFanSpeed, 0, 255);
840
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &plaPreheatFanSpeed, 0, 255);
841
+#if TEMP_SENSOR_0 != 0
818
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &plaPreheatHotendTemp, 0, HEATER_0_MAXTEMP - 15);
842
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &plaPreheatHotendTemp, 0, HEATER_0_MAXTEMP - 15);
843
+#endif
819
 #if TEMP_SENSOR_BED != 0
844
 #if TEMP_SENSOR_BED != 0
820
     MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, 0, BED_MAXTEMP - 15);
845
     MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, 0, BED_MAXTEMP - 15);
821
 #endif
846
 #endif
830
     START_MENU();
855
     START_MENU();
831
     MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
856
     MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
832
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &absPreheatFanSpeed, 0, 255);
857
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &absPreheatFanSpeed, 0, 255);
858
+#if TEMP_SENSOR_0 != 0
833
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &absPreheatHotendTemp, 0, HEATER_0_MAXTEMP - 15);
859
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &absPreheatHotendTemp, 0, HEATER_0_MAXTEMP - 15);
860
+#endif
834
 #if TEMP_SENSOR_BED != 0
861
 #if TEMP_SENSOR_BED != 0
835
     MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, 0, BED_MAXTEMP - 15);
862
     MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, 0, BED_MAXTEMP - 15);
836
 #endif
863
 #endif
869
 #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
896
 #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
870
     MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit);
897
     MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit);
871
 #endif
898
 #endif
899
+#ifdef SCARA
900
+    MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS],0.5,2);
901
+    MENU_ITEM_EDIT(float74, MSG_YSCALE, &axis_scaling[Y_AXIS],0.5,2);
902
+#endif
872
     END_MENU();
903
     END_MENU();
873
 }
904
 }
874
 
905
 
904
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
935
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
905
     MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled);
936
     MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled);
906
     MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &retract_length, 0, 100);
937
     MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &retract_length, 0, 100);
907
-    #if EXTRUDERS > 1
938
+	#if EXTRUDERS > 1
908
       MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_SWAP, &retract_length_swap, 0, 100);
939
       MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_SWAP, &retract_length_swap, 0, 100);
909
     #endif
940
     #endif
910
     MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &retract_feedrate, 1, 999);
941
     MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &retract_feedrate, 1, 999);
911
     MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_ZLIFT, &retract_zlift, 0, 999);
942
     MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_ZLIFT, &retract_zlift, 0, 999);
912
     MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER, &retract_recover_length, 0, 100);
943
     MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER, &retract_recover_length, 0, 100);
913
-    #if EXTRUDERS > 1
944
+	#if EXTRUDERS > 1
914
       MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100);
945
       MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100);
915
     #endif
946
     #endif
916
     MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999);
947
     MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999);
1133
     lcd_implementation_init();
1164
     lcd_implementation_init();
1134
 
1165
 
1135
 #ifdef NEWPANEL
1166
 #ifdef NEWPANEL
1136
-    SET_INPUT(BTN_EN1);
1137
-    SET_INPUT(BTN_EN2);
1167
+    pinMode(BTN_EN1,INPUT);
1168
+    pinMode(BTN_EN2,INPUT);
1138
     WRITE(BTN_EN1,HIGH);
1169
     WRITE(BTN_EN1,HIGH);
1139
     WRITE(BTN_EN2,HIGH);
1170
     WRITE(BTN_EN2,HIGH);
1140
   #if BTN_ENC > 0
1171
   #if BTN_ENC > 0
1141
-    SET_INPUT(BTN_ENC);
1172
+    pinMode(BTN_ENC,INPUT);
1142
     WRITE(BTN_ENC,HIGH);
1173
     WRITE(BTN_ENC,HIGH);
1143
   #endif
1174
   #endif
1144
   #ifdef REPRAPWORLD_KEYPAD
1175
   #ifdef REPRAPWORLD_KEYPAD
1145
-    SET_OUTPUT(SHIFT_CLK);
1146
-    SET_OUTPUT(SHIFT_LD);
1147
-    SET_INPUT(SHIFT_OUT);
1176
+    pinMode(SHIFT_CLK,OUTPUT);
1177
+    pinMode(SHIFT_LD,OUTPUT);
1178
+    pinMode(SHIFT_OUT,INPUT);
1148
     WRITE(SHIFT_OUT,HIGH);
1179
     WRITE(SHIFT_OUT,HIGH);
1149
     WRITE(SHIFT_LD,HIGH);
1180
     WRITE(SHIFT_LD,HIGH);
1150
   #endif
1181
   #endif
1151
 #else  // Not NEWPANEL
1182
 #else  // Not NEWPANEL
1152
   #ifdef SR_LCD_2W_NL // Non latching 2 wire shift register
1183
   #ifdef SR_LCD_2W_NL // Non latching 2 wire shift register
1153
-     SET_OUTPUT(SR_DATA_PIN);
1154
-     SET_OUTPUT(SR_CLK_PIN);
1184
+     pinMode (SR_DATA_PIN, OUTPUT);
1185
+     pinMode (SR_CLK_PIN, OUTPUT);
1155
   #elif defined(SHIFT_CLK) 
1186
   #elif defined(SHIFT_CLK) 
1156
-     SET_OUTPUT(SHIFT_CLK);
1157
-     SET_OUTPUT(SHIFT_LD);
1158
-     SET_OUTPUT(SHIFT_EN);
1159
-     SET_INPUT(SHIFT_OUT);
1187
+     pinMode(SHIFT_CLK,OUTPUT);
1188
+     pinMode(SHIFT_LD,OUTPUT);
1189
+     pinMode(SHIFT_EN,OUTPUT);
1190
+     pinMode(SHIFT_OUT,INPUT);
1160
      WRITE(SHIFT_OUT,HIGH);
1191
      WRITE(SHIFT_OUT,HIGH);
1161
      WRITE(SHIFT_LD,HIGH);
1192
      WRITE(SHIFT_LD,HIGH);
1162
      WRITE(SHIFT_EN,LOW);
1193
      WRITE(SHIFT_EN,LOW);
1168
 #endif//!NEWPANEL
1199
 #endif//!NEWPANEL
1169
 
1200
 
1170
 #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0)
1201
 #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0)
1171
-    SET_INPUT(SDCARDDETECT);
1202
+    pinMode(SDCARDDETECT,INPUT);
1172
     WRITE(SDCARDDETECT, HIGH);
1203
     WRITE(SDCARDDETECT, HIGH);
1173
     lcd_oldcardstatus = IS_SD_INSERTED;
1204
     lcd_oldcardstatus = IS_SD_INSERTED;
1174
 #endif//(SDCARDDETECT > 0)
1205
 #endif//(SDCARDDETECT > 0)
1496
   return conv;
1527
   return conv;
1497
 }
1528
 }
1498
 
1529
 
1499
-char *itostr3(const int &xx)
1530
+char *itostr3(const int &x)
1500
 {
1531
 {
1501
-  if (xx >= 100)
1532
+  int xx = x;
1533
+  if (xx < 0) {
1534
+     conv[0]='-';
1535
+     xx = -xx;
1536
+  } else if (xx >= 100)
1502
     conv[0]=(xx/100)%10+'0';
1537
     conv[0]=(xx/100)%10+'0';
1503
   else
1538
   else
1504
     conv[0]=' ';
1539
     conv[0]=' ';

+ 1
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

467
 # endif//LCD_WIDTH > 19
467
 # endif//LCD_WIDTH > 19
468
     lcd.setCursor(LCD_WIDTH - 8, 1);
468
     lcd.setCursor(LCD_WIDTH - 8, 1);
469
     lcd.print('Z');
469
     lcd.print('Z');
470
-    lcd.print(ftostr32(current_position[Z_AXIS]));
470
+    lcd.print(ftostr32(current_position[Z_AXIS] + 0.00001));
471
 #endif//LCD_HEIGHT > 2
471
 #endif//LCD_HEIGHT > 2
472
 
472
 
473
 #if LCD_HEIGHT > 3
473
 #if LCD_HEIGHT > 3

+ 1
- 1
Marlin/vector_3.cpp View File

121
 {
121
 {
122
     vector_3 z_row = target.get_normal();
122
     vector_3 z_row = target.get_normal();
123
     vector_3 x_row = vector_3(1, 0, -target.x/target.z).get_normal();
123
     vector_3 x_row = vector_3(1, 0, -target.x/target.z).get_normal();
124
-    vector_3 y_row = vector_3(0, 1, -target.y/target.z).get_normal();
124
+    vector_3 y_row = vector_3::cross(z_row, x_row).get_normal();
125
 
125
 
126
    // x_row.debug("x_row");
126
    // x_row.debug("x_row");
127
    // y_row.debug("y_row");
127
    // y_row.debug("y_row");

+ 80
- 30
README.md View File

1
 ==========================
1
 ==========================
2
 Marlin 3D Printer Firmware
2
 Marlin 3D Printer Firmware
3
 ==========================
3
 ==========================
4
-[![Coverity Scan Build Status](https://scan.coverity.com/projects/2224/badge.svg)](https://scan.coverity.com/projects/2224)
5
-
4
+[![Coverity Scan Build Status](https://scan.coverity.com/projects/2224/badge.svg)](https://scan.coverity.com/projects/2224)
5
+
6
 Marlin has a GPL license because I believe in open development.
6
 Marlin has a GPL license because I believe in open development.
7
 Please do not use this code in products (3D printers, CNC etc) that are closed source or are crippled by a patent.
7
 Please do not use this code in products (3D printers, CNC etc) that are closed source or are crippled by a patent.
8
 
8
 
47
 *   PID tuning
47
 *   PID tuning
48
 *   CoreXY kinematics (www.corexy.com/theory.html)
48
 *   CoreXY kinematics (www.corexy.com/theory.html)
49
 *   Delta kinematics
49
 *   Delta kinematics
50
+*   SCARA kinematics
50
 *   Dual X-carriage support for multiple extruder systems
51
 *   Dual X-carriage support for multiple extruder systems
51
 *   Configurable serial port to support connection of wireless adaptors.
52
 *   Configurable serial port to support connection of wireless adaptors.
52
 *   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
53
 *   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
159
 *  G28 - Home all Axis
160
 *  G28 - Home all Axis
160
 *  G29 - Detailed Z-Probe, probes the bed at 3 points.  You must de at the home position for this to work correctly.
161
 *  G29 - Detailed Z-Probe, probes the bed at 3 points.  You must de at the home position for this to work correctly.
161
 *  G30 - Single Z Probe, probes bed at current XY location.
162
 *  G30 - Single Z Probe, probes bed at current XY location.
163
+*  G31 - Dock Z Probe sled (if enabled)
164
+*  G32 - Undock Z Probe sled (if enabled)
162
 *  G90 - Use Absolute Coordinates
165
 *  G90 - Use Absolute Coordinates
163
 *  G91 - Use Relative Coordinates
166
 *  G91 - Use Relative Coordinates
164
 *  G92 - Set current position to cordinates given
167
 *  G92 - Set current position to cordinates given
207
 *  M140 - Set bed target temp
210
 *  M140 - Set bed target temp
208
 *  M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
211
 *  M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
209
 *         Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
212
 *         Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
210
-*  M200 D<millimeters>- set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).
213
+*  M200 D<millimeters>- set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).
211
 *  M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
214
 *  M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
212
 *  M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
215
 *  M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
213
 *  M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
216
 *  M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
214
 *  M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2  also sets minimum segment time in ms (B20000) to prevent buffer underruns and M20 minimum feedrate
217
 *  M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2  also sets minimum segment time in ms (B20000) to prevent buffer underruns and M20 minimum feedrate
215
 *  M205 -  advanced settings:  minimum travel speed S=while printing T=travel only,  B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk
218
 *  M205 -  advanced settings:  minimum travel speed S=while printing T=travel only,  B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk
216
 *  M206 - set additional homeing offset
219
 *  M206 - set additional homeing offset
217
-*  M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting
218
-*  M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
220
+*  M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting
221
+*  M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
219
 *  M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
222
 *  M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
220
 *  M218 - set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>
223
 *  M218 - set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>
221
 *  M220 S<factor in percent>- set speed factor override percentage
224
 *  M220 S<factor in percent>- set speed factor override percentage
230
 *  M400 - Finish all moves
233
 *  M400 - Finish all moves
231
 *  M401 - Lower z-probe if present
234
 *  M401 - Lower z-probe if present
232
 *  M402 - Raise z-probe if present
235
 *  M402 - Raise z-probe if present
236
+*  M404 - N<dia in mm> Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters
237
+*  M405 - Turn on Filament Sensor extrusion control.  Optional D<delay in cm> to set delay in centimeters between sensor and extruder
238
+*  M406 - Turn off Filament Sensor extrusion control
239
+*  M407 - Displays measured filament diameter
233
 *  M500 - stores paramters in EEPROM
240
 *  M500 - stores paramters in EEPROM
234
 *  M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
241
 *  M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
235
 *  M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
242
 *  M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
272
 ===============================================
279
 ===============================================
273
 Instructions for configuring Bed Auto Leveling
280
 Instructions for configuring Bed Auto Leveling
274
 ===============================================
281
 ===============================================
282
+There are two options for this feature. You may choose to use a servo mounted on the X carriage or you may use a sled that mounts on the X axis and can be docked when not in use.
283
+See the section for each option below for specifics about installation and configuration. Also included are instructions that apply to both options.
284
+
285
+Note for RAMPS users:
286
+---------------------
287
+
288
+By default, RAMPS have no power on servo bus (if you happen to have a multimeter, check the voltage on servo power pins).
289
+In order to get the servo working, you need to supply 5V to 5V pin.. You can do it using your power supply (if it has a 5V output) or jumping the "Vcc" from Arduino to the 5V RAMPS rail.
290
+These 2 pins are located just between the Reset Button and the yellow fuses... There are marks in the board showing 5V and VCC.. just connect them..
291
+If jumping the arduino Vcc do RAMPS 5V rail, take care to not use a power hungry servo, otherwise you will cause a blackout in the arduino board ;-)
292
+
293
+Instructions for Both Options
294
+-----------------------------
295
+
275
 Uncomment the "ENABLE_AUTO_BED_LEVELING" define (commented by default)
296
 Uncomment the "ENABLE_AUTO_BED_LEVELING" define (commented by default)
276
 
297
 
298
+The following options define the probing positions. These are good starting values.
299
+I recommend to keep a better clearance from borders in the first run and then make the probes as close as possible to borders:
300
+
301
+* \#define LEFT_PROBE_BED_POSITION 30
302
+* \#define RIGHT_PROBE_BED_POSITION 140
303
+* \#define BACK_PROBE_BED_POSITION 140
304
+* \#define FRONT_PROBE_BED_POSITION 30
305
+
306
+A few more options:
307
+
308
+* \#define XY_TRAVEL_SPEED 6000
309
+
310
+X and Y axis travel speed between probes, in mm/min.
311
+Bear in mind that really fast moves may render step skipping. 6000 mm/min (100mm/s) is a good value.
312
+
313
+* \#define Z_RAISE_BEFORE_PROBING 10
314
+* \#define Z_RAISE_BETWEEN_PROBINGS 10
315
+
316
+The Z axis is lifted when traveling to the first probe point by Z_RAISE_BEFORE_PROBING value
317
+and then lifted when traveling from first to second and second to third point by Z_RAISE_BETWEEN_PROBINGS.
318
+All values are in mm as usual.
319
+
320
+Servo Option Notes
321
+------------------
277
 You will probably need a swivel Z-MIN endstop in the extruder. A rc servo do a great job.
322
 You will probably need a swivel Z-MIN endstop in the extruder. A rc servo do a great job.
278
 Check the system working here: http://www.youtube.com/watch?v=3IKMeOYz-1Q (Enable English subtitles)
323
 Check the system working here: http://www.youtube.com/watch?v=3IKMeOYz-1Q (Enable English subtitles)
279
 Teasing ;-) video: http://www.youtube.com/watch?v=x8eqSQNAyro
324
 Teasing ;-) video: http://www.youtube.com/watch?v=x8eqSQNAyro
286
 
331
 
287
 * \#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 165,60} // X,Y,Z Axis Extend and Retract angles
332
 * \#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 165,60} // X,Y,Z Axis Extend and Retract angles
288
 
333
 
289
-
290
 The first define tells firmware how many servos you have.
334
 The first define tells firmware how many servos you have.
291
 The second tells what axis this servo will be attached to. In the example above, we have a servo in Z axis.
335
 The second tells what axis this servo will be attached to. In the example above, we have a servo in Z axis.
292
 The third one tells the angle in 2 situations: Probing (165º) and resting (60º). Check this with command M280 P0 S{angle} (example: M280 P0 S60 moves the servo to 60º)
336
 The third one tells the angle in 2 situations: Probing (165º) and resting (60º). Check this with command M280 P0 S{angle} (example: M280 P0 S60 moves the servo to 60º)
293
 
337
 
294
-For RAMPS users:
295
-----------------
296
-
297
-By default, RAMPS have no power on servo bus (if you happen to have a multimeter, check the voltage on servo power pins).
298
-In order to get the servo working, you need to supply 5V to 5V pin.. You can do it using your power supply (if it has a 5V output) or jumping the "Vcc" from Arduino to the 5V RAMPS rail.
299
-These 2 pins are located just between the Reset Button and the yellow fuses... There are marks in the board showing 5V and VCC.. just connect them..
300
-If jumping the arduino Vcc do RAMPS 5V rail, take care to not use a power hungry servo, otherwise you will cause a blackout in the arduino board ;-)
301
-
302
-
303
 Next you need to define the Z endstop (probe) offset from hotend.
338
 Next you need to define the Z endstop (probe) offset from hotend.
304
 My preferred method:
339
 My preferred method:
305
 
340
 
317
 * \#define Z_PROBE_OFFSET_FROM_EXTRUDER -5.1
352
 * \#define Z_PROBE_OFFSET_FROM_EXTRUDER -5.1
318
 
353
 
319
 
354
 
320
-The following options define the probing positions. These are good starting values.
321
-I recommend to keep a better clearance from borders in the first run and then make the probes as close as possible to borders:
355
+Sled Option Notes
356
+-----------------
357
+The sled option uses an electromagnet to attach and detach to/from the X carriage. See http://www.thingiverse.com/thing:396692 for more details on how to print and install this feature. It uses the same connections as the servo option.
322
 
358
 
323
-* \#define LEFT_PROBE_BED_POSITION 30
324
-* \#define RIGHT_PROBE_BED_POSITION 140
325
-* \#define BACK_PROBE_BED_POSITION 140
326
-* \#define FRONT_PROBE_BED_POSITION 30
359
+To use the sled option, you must define two additional things in Configuration.h:
327
 
360
 
328
-A few more options:
361
+* \#define Z_PROBE_SLED
362
+* \#define SLED_DOCKING_OFFSET 5
329
 
363
 
330
-* \#define XY_TRAVEL_SPEED 6000
364
+Uncomment the Z_PROBE_SLED to define to enable the sled (commented out by default).
331
 
365
 
332
-X and Y axis travel speed between probes, in mm/min.
333
-Bear in mind that really fast moves may render step skipping. 6000 mm/min (100mm/s) is a good value.
366
+Uncomment the SLED_DOCKING_OFFSET to set the extra distance the X axis must travel to dock the sled. This value can be found by moving the X axis to its maximum position then measure the distance to the right X end and subtract the width of the sled (23mm if you printed the sled from Thingiverse).
334
 
367
 
335
-* \#define Z_RAISE_BEFORE_PROBING 10
336
-* \#define Z_RAISE_BETWEEN_PROBINGS 10
368
+Next you need to define the Z endstop (probe) offset from hotend.
369
+My preferred method:
337
 
370
 
338
-The Z axis is lifted when traveling to the first probe point by Z_RAISE_BEFORE_PROBING value
339
-and then lifted when traveling from first to second and second to third point by Z_RAISE_BETWEEN_PROBINGS.
340
-All values are in mm as usual. 
371
+* a) Home the X and Y axes.
372
+* b) Move the X axis to about the center of the print bed. Make a mark on the print bed.
373
+* c) Move the Y axis to the maximum position. Make another mark.
374
+* d) Home the X axis and use a straight edge to make a line between the two points.
375
+* e) Repeat (b)-(d) reversing the X and Y. When you are done you will have two lines on the print bed. We will use these to measure the offset for the Z probe endstop.
376
+* f) Move the nozzle so that it is positioned on the center point of the two lines. You can use fine movement of 0.1mm to get it as close as possible. Note the position of X and Y.
377
+* g) Zero the Z axis with the G92 Z0 command.
378
+* h) Raise the Z axis about 20mmm.
379
+* i) Use the G32 command to retrieve the sled.
380
+* j) Now more the X and Y axis to the position recorded in (f).
381
+* k) Lower the Z axis in 0.1mm steps until you hear the "click" meaning the mechanical endstop was trigged. You can confirm with the M119 command. Note the position of the Z axis.
382
+* l) Make a mark on the print bed where the endstop lever has touched the print bed. Raise the Z-axis about 30mm to give yourself some room.
383
+* m) Now measure the distance from the center point to the endstop impact site along the X and Y axis using the lines drawn previously.
384
+* n) Fill in the values below. If the endstop mark is in front of the line running left-to-right, use positive values. If it is behind, use negative values. For the Z axis use the value from (k) and subtract 0.1mm.
385
+
386
+For example, suppose you measured the endstop position and it was 20mm to the right of the line running front-to-back, 10mm toward the front of the line running left-to-right, and the value from (k) was 2.85. The values for the defines would be:
387
+
388
+* \#define X_PROBE_OFFSET_FROM_EXTRUDER 20
389
+* \#define Y_PROBE_OFFSET_FROM_EXTRUDER 10
390
+* \#define Z_PROBE_OFFSET_FROM_EXTRUDER 2.75
341
 
391
 
342
 That's it.. enjoy never having to calibrate your Z endstop neither leveling your bed by hand anymore ;-)
392
 That's it.. enjoy never having to calibrate your Z endstop neither leveling your bed by hand anymore ;-)
343
 
393
 

Loading…
Cancel
Save