|
1 #ifndef CONFIGURATION_H |
|
2 #define CONFIGURATION_H |
|
3 |
|
4 // ============================================================================== |
|
5 |
|
6 // For instructions on setting these constants, see: |
|
7 // Mendel: http://reprap.org/wiki/RepRapPro_Mendel_maintenance |
|
8 // Huxley: http://reprap.org/wiki/RepRapPro_Huxley_maintenance |
|
9 |
|
10 // Uncomment ONE of the next three lines - the one for your RepRap machine |
|
11 //#define REPRAPPRO_HUXLEY |
|
12 //#define REPRAPPRO_MENDEL //Legacy Mendel |
|
13 #define REPRAPPRO_MENDEL2 // Mono Mendel |
|
14 |
|
15 // Uncomment ONE of the next two lines - the one for your master controller electronics |
|
16 #define REPRAPPRO_MELZI |
|
17 //#define REPRAPPRO_SANGUINOLOLU |
|
18 |
|
19 // Uncomment ONE of the next two lines - the one for the series resistors on your controller |
|
20 #define SERIAL_R 4700 |
|
21 //#define SERIAL_R 10000 |
|
22 |
|
23 |
|
24 // ------------------------------------------------------------------------------- |
|
25 |
|
26 #ifndef REPRAPPRO_HUXLEY |
|
27 #ifndef REPRAPPRO_MENDEL |
|
28 #ifndef REPRAPPRO_MENDEL2 |
|
29 #error Uncomment one of #define REPRAPPRO_HUXLEY, REPRAPPRO_MENDEL, or REPRAPPRO_MENDEL2 at the start of the file Configuration.h |
|
30 #endif |
|
31 #endif |
|
32 #endif |
|
33 |
|
34 #ifndef REPRAPPRO_MELZI |
|
35 #ifndef REPRAPPRO_SANGUINOLOLU |
|
36 #error Uncomment one of #define REPRAPPRO_MELZI or REPRAPPRO_SANGUINOLOLU at the start of the file Configuration.h |
|
37 #endif |
|
38 #endif |
|
39 |
|
40 #ifndef SERIAL_R |
|
41 #error Uncomment one of #define SERIAL_R 10000 or 4700 at the start of the file Configuration.h |
|
42 #endif |
|
43 |
|
44 // ============================================================================== |
|
45 |
|
46 // Uncomment this if you are experimenting, know what you are doing, and want to switch off some safety |
|
47 // features, e.g. allow extrude at low temperature etc. |
|
48 //#define DEVELOPING |
|
49 |
|
50 // This configurtion file contains the basic settings. |
|
51 // Advanced settings can be found in Configuration_adv.h |
|
52 // BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration |
|
53 |
|
54 //User specified version info of THIS file to display in [Pronterface, etc] terminal window during startup. |
|
55 //Implementation of an idea by Prof Braino to inform user that any changes made |
|
56 //to THIS file by the user have been successfully uploaded into firmware. |
|
57 #define STRING_VERSION_CONFIG_H "2014-06-02-MB" //Personal revision number for changes to THIS file. |
|
58 #define STRING_CONFIG_H_AUTHOR "NEO" //Who made the changes. |
|
59 |
|
60 // This determines the communication speed of the printer |
|
61 //#define BAUDRATE 250000 |
|
62 #define BAUDRATE 115200 |
|
63 |
|
64 //// The following define selects which electronics board you have. Please choose the one that matches your setup |
|
65 // Sanguinololu 1.2 and above = 62 |
|
66 // Melzi 63 |
|
67 |
|
68 #ifdef REPRAPPRO_SANGUINOLOLU |
|
69 #define MOTHERBOARD 62 |
|
70 #endif |
|
71 |
|
72 #ifdef REPRAPPRO_MELZI |
|
73 #define MOTHERBOARD 63 |
|
74 #endif |
|
75 |
|
76 |
|
77 |
|
78 //=========================================================================== |
|
79 //=============================Thermal Settings ============================ |
|
80 //=========================================================================== |
|
81 |
|
82 // Set this if you want to define the constants in the thermistor circuit |
|
83 // and work out temperatures algebraically - added by AB. |
|
84 |
|
85 // See http://en.wikipedia.org/wiki/Thermistor#B_or_.CE.B2_parameter_equation |
|
86 |
|
87 // BETA is the B value |
|
88 // RS is the value of the series resistor in ohms |
|
89 // R_INF is R0.exp(-BETA/T0), where R0 is the thermistor resistance at T0 (T0 is in kelvin) |
|
90 // Normally T0 is 298.15K (25 C). If you write that expression in brackets in the #define the compiler |
|
91 // should compute it for you (i.e. it won't need to be calculated at run time). |
|
92 |
|
93 // If the A->D converter has a range of 0..1023 and the measured voltage is V (between 0 and 1023) |
|
94 // then the thermistor resistance, R = V.RS/(1023 - V) |
|
95 // and the temperature, T = BETA/ln(R/R_INF) |
|
96 // To get degrees celsius (instead of kelvin) add -273.15 to T |
|
97 |
|
98 // This DOES assume that all extruders use the same thermistor type. |
|
99 |
|
100 |
|
101 #define ABS_ZERO -273.15 |
|
102 #define AD_RANGE 16383 |
|
103 |
|
104 |
|
105 #ifdef REPRAPPRO_HUXLEY |
|
106 |
|
107 // Bed thermistor: VISHAY BC COMPONENTS NTCS0603E3104FXT - All Huxleys with heated bed PCB |
|
108 #define BED_BETA 4100.0 |
|
109 #define BED_NTC 100000.0 |
|
110 |
|
111 // Extruder thermistor: RS 198-961 100k ohm 10% DO-35 NTC thermistor - All Huxleys before 25/2/14 |
|
112 // #define E_BETA 3960.0 |
|
113 // #define E_NTC 100000.0 |
|
114 |
|
115 // Extruder thermistor: Digikey 480-3137-ND - All Huxleys shipped after 25/2/14 |
|
116 #define E_BETA 4138.0 |
|
117 #define E_NTC 100000.0 |
|
118 |
|
119 #endif |
|
120 |
|
121 |
|
122 #ifdef REPRAPPRO_MENDEL |
|
123 |
|
124 // Extruder thermistor: RS 198-961 100k ohm 10% DO-35 NTC thermistor - All Mendels before 1/4/13 |
|
125 #define E_BETA 3960.0 |
|
126 #define E_NTC 100000.0 |
|
127 |
|
128 // Bed thermistor: RS 484-0149; EPCOS B57550G103J - All Mendels before 1/4/13 |
|
129 #define BED_BETA 3480.0 |
|
130 #define BED_NTC 10000.0 |
|
131 |
|
132 #endif |
|
133 |
|
134 |
|
135 #ifdef REPRAPPRO_MENDEL2 |
|
136 |
|
137 // Bed thermistor: Rapid 61-0446 ; Semitec 103GT-2 - All Mendel2 shipped after 1/4/13 (launch) |
|
138 // #define BED_BETA 4126.0 |
|
139 // #define BED_NTC 10000.0 |
|
140 |
|
141 // Bed thermistor: Farnell 1299930 ; EPCOS B57863S103F040 - All Mendel2 shipped after 29/5/14 |
|
142 #define BED_BETA 3988.0 |
|
143 #define BED_NTC 10000.0 |
|
144 |
|
145 // Extruder thermistor: RS 198-961 100k ohm 10% DO-35 NTC thermistor - All Mendel2 shipped after 1/4/13 (launch) |
|
146 // #define E_BETA 3960.0 |
|
147 // #define E_NTC 100000.0 |
|
148 |
|
149 // Extruder thermistor: Digikey 480-3137-ND - All Mendels shipped after 25/2/14 |
|
150 #define E_BETA 4138.0 |
|
151 #define E_NTC 100000.0 |
|
152 |
|
153 #endif |
|
154 |
|
155 |
|
156 #define E_RS SERIAL_R |
|
157 #define E_R_INF ( E_NTC*exp(-E_BETA/298.15) ) |
|
158 |
|
159 #define BED_RS SERIAL_R |
|
160 #define BED_R_INF ( BED_NTC*exp(-BED_BETA/298.15) ) |
|
161 |
|
162 |
|
163 |
|
164 #define BED_USES_THERMISTOR |
|
165 #define HEATER_0_USES_THERMISTOR |
|
166 #define HEATER_1_USES_THERMISTOR |
|
167 #define HEATER_2_USES_THERMISTOR |
|
168 |
|
169 |
|
170 |
|
171 // Actual temperature must be close to target for this long before M109 returns success |
|
172 #define TEMP_RESIDENCY_TIME 5 // (seconds) |
|
173 #define TEMP_HYSTERESIS 5 // (C°) range of +/- temperatures considered "close" to the target one |
|
174 #define TEMP_WINDOW 2 // (degC) Window around target to start the recidency 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 1 |
|
180 #ifdef REPRAPPRO_MULTIMATERIALS |
|
181 #define HEATER_1_MINTEMP 1 |
|
182 #define HEATER_2_MINTEMP 1 |
|
183 #endif |
|
184 #define BED_MINTEMP 1 |
|
185 |
|
186 // When temperature exceeds max temp, your heater will be switched off. |
|
187 // This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! |
|
188 // You should use MINTEMP for thermistor short/failure protection. |
|
189 #define HEATER_0_MAXTEMP 399 |
|
190 #ifdef REPRAPPRO_MULTIMATERIALS |
|
191 #define HEATER_1_MAXTEMP 275 |
|
192 #define HEATER_2_MAXTEMP 275 |
|
193 #endif |
|
194 #define BED_MAXTEMP 150 |
|
195 |
|
196 |
|
197 // PID settings: |
|
198 // Comment the following line to disable PID and enable bang-bang. |
|
199 #define PIDTEMP |
|
200 #define PID_MAX 255 // limits current to nozzle; 255=full current |
|
201 #define FULL_PID_BAND 150 // Full power is applied when pid_error[e] > FULL_PID_BAND |
|
202 #ifdef PIDTEMP |
|
203 //#define PID_DEBUG // Sends debug data to the serial port. |
|
204 #define PID_INTEGRAL_DRIVE_MAX 125 //limit for the integral term |
|
205 #define K1 0.95 //smoothing factor withing the PID |
|
206 #define PID_dT 0.122 //sampling period of the PID |
|
207 |
|
208 |
|
209 // RepRapPro Huxley + Mendel |
|
210 #define DEFAULT_Kp 12.0 |
|
211 #define DEFAULT_Ki (2.2*PID_dT) |
|
212 #define DEFAULT_Kd (80/PID_dT) |
|
213 |
|
214 #endif // PIDTEMP |
|
215 |
|
216 #ifndef DEVELOPING |
|
217 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit |
|
218 //can be software-disabled for whatever purposes by |
|
219 #define PREVENT_DANGEROUS_EXTRUDE |
|
220 #define EXTRUDE_MINTEMP 170 |
|
221 #define EXTRUDE_MAXLENGTH (999) //prevent extrusion of very large distances. |
|
222 #else |
|
223 #define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE |
|
224 #endif |
|
225 |
|
226 //=========================================================================== |
|
227 //=============================Mechanical Settings=========================== |
|
228 //=========================================================================== |
|
229 |
|
230 // Endstop Settings |
|
231 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors |
|
232 |
|
233 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. |
|
234 const bool X_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops. |
|
235 const bool Y_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops. |
|
236 const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops. |
|
237 |
|
238 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 |
|
239 #define X_ENABLE_ON 0 |
|
240 #define Y_ENABLE_ON 0 |
|
241 #define Z_ENABLE_ON 0 |
|
242 #define E_ENABLE_ON 0 // For all extruders |
|
243 |
|
244 // Disables axis when it's not being used. |
|
245 #define DISABLE_X false |
|
246 #define DISABLE_Y false |
|
247 #define DISABLE_Z true |
|
248 #define DISABLE_E false // For all extruders |
|
249 |
|
250 #ifdef REPRAPPRO_MENDEL |
|
251 #define AXES_MAX_LENGTHS {210, 210, 140} |
|
252 #define INVERT_X_DIR false // for Mendel set to false, for Orca set to true |
|
253 //#define INVERT_Y_DIR true // for Mendel set to true, for Orca set to false |
|
254 #define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false |
|
255 #define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true |
|
256 #define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false |
|
257 #define INVERT_E1_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false |
|
258 #define INVERT_E2_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false |
|
259 #endif |
|
260 |
|
261 #ifdef REPRAPPRO_MENDEL2 |
|
262 #define AXES_MAX_LENGTHS {210, 210, 140} |
|
263 #define INVERT_X_DIR true // for Mendel set to false, for Orca set to true |
|
264 #define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false |
|
265 #define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true |
|
266 #define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false |
|
267 #define INVERT_E1_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false |
|
268 #define INVERT_E2_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false |
|
269 #endif |
|
270 |
|
271 #ifdef REPRAPPRO_HUXLEY |
|
272 #define AXES_MAX_LENGTHS {155, 150, 90} |
|
273 #define INVERT_X_DIR false // for Mendel set to false, for Orca set to true |
|
274 #define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false |
|
275 #define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true |
|
276 #define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false |
|
277 #define INVERT_E1_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false |
|
278 #define INVERT_E2_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false |
|
279 #endif |
|
280 |
|
281 |
|
282 // ENDSTOP SETTINGS: |
|
283 // Sets direction of endstops when homing; 1=MAX, -1=MIN |
|
284 #define X_HOME_DIR -1 |
|
285 #define Y_HOME_DIR -1 |
|
286 #define Z_HOME_DIR -1 |
|
287 |
|
288 #define min_software_endstops true //If true, axis won't move to coordinates less than zero. |
|
289 #define max_software_endstops true //If true, axis won't move to coordinates greater than the defined lengths below. |
|
290 |
|
291 // The position of the homing switches. Use MAX_LENGTH * -0.5 if the center should be 0, 0, 0 |
|
292 #define X_HOME_POS 0 |
|
293 #define Y_HOME_POS 0 |
|
294 #define Z_HOME_POS 0 |
|
295 |
|
296 //// MOVEMENT SETTINGS |
|
297 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E |
|
298 |
|
299 /* |
|
300 We've shipped a number of different configurations of belt and pulley now, so probably need some ifdef statements! At the moment, they all get the same. |
|
301 |
|
302 White polyurethane belt (T2.5), 14-tooth printed pulley: 91.4286 step per mm (Original Huxley, Legacy Mendel) |
|
303 Black rubber belt (MXL), 17-tooth printed pulley: 92.635 step per mm (Huxley, Mendel Mono and Tri since 1/4/2013) |
|
304 Black rubber belt (MXL), 18-tooth aluminium pulley: 87.489 step per mm (Huxley, Mendel Mono and Tri since 1/1/2014) |
|
305 |
|
306 Also, two different extruders: |
|
307 |
|
308 Original eMaker/RepRapPro-style: 920 steps per mm (Original Huxley, Legacy Mendel) |
|
309 New version (NEMA14 and NEMA17): 660 steps per mm (Huxley, Mendel Mono and Tricolour since 1/4/2013) |
|
310 */ |
|
311 |
|
312 #ifdef REPRAPPRO_MENDEL |
|
313 |
|
314 #define X_MAX_LENGTH 210 |
|
315 #define Y_MAX_LENGTH 210 |
|
316 #define Z_MAX_LENGTH 110 |
|
317 #define HOMING_FEEDRATE {10*60, 10*60, 1*60, 0} // set the homing speeds (mm/min) |
|
318 #define FAST_HOME_FEEDRATE {50*60, 50*60, 1*60, 0} // set the homing speeds (mm/min) |
|
319 #define DEFAULT_MAX_FEEDRATE {500, 500, 3, 45} |
|
320 #define DEFAULT_MAX_FEEDRATE {300, 300, 3, 45} // (mm/sec) |
|
321 #define DEFAULT_MAX_ACCELERATION {800,800,30,250} // X, Y, Z, E maximum start speed for accelerated moves. E default values |
|
322 |
|
323 // X, Y, Z, E steps per mm |
|
324 |
|
325 #define DEFAULT_AXIS_STEPS_PER_UNIT {80, 91.4286, 4000, 950.0} // <- 14 tooth T2.5 belt + original extruder drive |
|
326 |
|
327 #else |
|
328 |
|
329 #ifdef REPRAPPRO_MENDEL2 |
|
330 |
|
331 #define X_MAX_LENGTH 210 |
|
332 #define Y_MAX_LENGTH 210 |
|
333 #define Z_MAX_LENGTH 110 |
|
334 #define HOMING_FEEDRATE {10*60, 10*60, 1*60, 0} // set the homing speeds (mm/min) |
|
335 #define FAST_HOME_FEEDRATE {50*60, 50*60, 1*60, 0} // set the homing speeds (mm/min) |
|
336 #define DEFAULT_MAX_FEEDRATE {500, 500, 3, 60} |
|
337 //#define DEFAULT_MAX_FEEDRATE {300, 300, 3, 45} // (mm/sec) |
|
338 #define DEFAULT_MAX_ACCELERATION {1000,1000,30,250} // X, Y, Z, E maximum start speed for accelerated moves. E default values |
|
339 |
|
340 // X, Y, Z, E steps per mm |
|
341 |
|
342 #define DEFAULT_AXIS_STEPS_PER_UNIT {80, 87.489, 4000, 950.0} // <- 18-tooth aluminium pulley |
|
343 //#define DEFAULT_AXIS_STEPS_PER_UNIT {92.635, 92.635, 4000, 660} // <- 17-tooth printed pulley |
|
344 |
|
345 #else |
|
346 |
|
347 #define X_MAX_LENGTH 155 |
|
348 #define Y_MAX_LENGTH 150 |
|
349 #define Z_MAX_LENGTH 90 |
|
350 #define HOMING_FEEDRATE {10*60, 10*60, 1*60, 0} // set the homing speeds (mm/min) |
|
351 #define FAST_HOME_FEEDRATE {80*60, 80*60, 4*60, 0} // set the homing speeds (mm/min) |
|
352 #define DEFAULT_MAX_FEEDRATE {500, 500, 5, 45} // (mm/sec) |
|
353 #define DEFAULT_MAX_FEEDRATE {500, 500, 5, 45} // (mm/sec) |
|
354 #define DEFAULT_MAX_ACCELERATION {1000,1000,50,250} // X, Y, Z, E maximum start speed for accelerated moves. E default values |
|
355 |
|
356 // X, Y, Z, E steps per mm |
|
357 |
|
358 #define DEFAULT_AXIS_STEPS_PER_UNIT {87.489, 87.489, 4000, 660.0} // <- 18-tooth aluminium pulley |
|
359 //#define DEFAULT_AXIS_STEPS_PER_UNIT {92.635, 92.635, 4000, 660} // <- 17-tooth printed pulley |
|
360 //#define DEFAULT_AXIS_STEPS_PER_UNIT {91.4286, 91.4286, 4000, 920.0} // <- 14 tooth T2.5 belt + original extruder drive |
|
361 |
|
362 |
|
363 #endif |
|
364 #endif |
|
365 |
|
366 |
|
367 |
|
368 // Defaults changed by the G10 command |
|
369 |
|
370 #define X_EXTRUDER_OFFSET 0 |
|
371 #define Y_EXTRUDER_OFFSET 0 |
|
372 #define Z_EXTRUDER_OFFSET 0 |
|
373 #define STANDBY_TEMP 140 |
|
374 #define PLA_TEMP 210 |
|
375 #define ABS_TEMP 250 |
|
376 #define DEFAULT_TEMP PLA_TEMP |
|
377 |
|
378 |
|
379 #define DEFAULT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves |
|
380 #define DEFAULT_RETRACT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for r retracts |
|
381 |
|
382 // |
|
383 #define DEFAULT_XYJERK 15.0 // (mm/sec) |
|
384 #define DEFAULT_ZJERK 0.4 // (mm/sec) |
|
385 #define DEFAULT_EJERK 15.0 // (mm/sec) |
|
386 |
|
387 //=========================================================================== |
|
388 //=============================Additional Features=========================== |
|
389 //=========================================================================== |
|
390 |
|
391 // EEPROM |
|
392 // the microcontroller can store settings in the EEPROM, e.g. max velocity... |
|
393 // M500 - stores paramters in EEPROM |
|
394 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). |
|
395 // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. |
|
396 //define this to enable eeprom support |
|
397 #define EEPROM_SETTINGS |
|
398 //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: |
|
399 // please keep turned on if you can. |
|
400 #define EEPROM_CHITCHAT |
|
401 |
|
402 //LCD and SD support |
|
403 //#define ULTRA_LCD //general lcd support, also 16x2 |
|
404 #define SDSUPPORT // Enable SD Card Support in Hardware Console |
|
405 |
|
406 //#define ULTIPANEL |
|
407 #ifdef ULTIPANEL |
|
408 //#define NEWPANEL //enable this if you have a click-encoder panel |
|
409 #define SDSUPPORT |
|
410 #define ULTRA_LCD |
|
411 #define LCD_WIDTH 20 |
|
412 #define LCD_HEIGHT 4 |
|
413 |
|
414 // Preheat Constants |
|
415 #define PLA_PREHEAT_HOTEND_TEMP 180 |
|
416 #define PLA_PREHEAT_HPB_TEMP 70 |
|
417 #define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 |
|
418 |
|
419 #define ABS_PREHEAT_HOTEND_TEMP 240 |
|
420 #define ABS_PREHEAT_HPB_TEMP 100 |
|
421 #define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 |
|
422 |
|
423 #else //no panel but just lcd |
|
424 #ifdef ULTRA_LCD |
|
425 #define LCD_WIDTH 16 |
|
426 #define LCD_HEIGHT 2 |
|
427 #endif |
|
428 #endif |
|
429 |
|
430 // Enable uM-FPU support: |
|
431 #define UMFPUSUPPORT 1 |
|
432 |
|
433 // M240 Triggers a camera by emulating a Canon RC-1 Remote |
|
434 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ |
|
435 // #define PHOTOGRAPH_PIN 23 |
|
436 |
|
437 #include "Configuration_adv.h" |
|
438 |
|
439 |
|
440 #endif //__CONFIGURATION_H |