chiark / gitweb /
settings
[marlin.git] / Marlin / reprappro--Configuration.h
1 #ifndef CONFIGURATION_H
2 #define CONFIGURATION_H
3
4 // Uncomment ONE of the next three lines - the one for your RepRap machine
5 #define REPRAPPRO_HUXLEY
6 //#define REPRAPPRO_MENDEL
7 //#define REPRAPPRO_WALLACE
8
9 #ifndef REPRAPPRO_HUXLEY
10 #ifndef REPRAPPRO_MENDEL
11 #ifndef REPRAPPRO_WALLACE
12 #error Uncomment one of #define REPRAPPRO_HUXLEY, REPRAPPRO_MENDEL or REPRAPPRO_WALLACE at the start of the file Configuration.h
13 #endif
14 #endif
15 #endif
16
17 // Uncomment this if you are experimenting, know what you are doing, and want to switch off some safety
18 // features, e.g. allow extrude at low temperature etc.
19 //#define DEVELOPING
20
21 // This configurtion file contains the basic settings.
22 // Advanced settings can be found in Configuration_adv.h 
23 // BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
24
25 //User specified version info of THIS file to display in [Pronterface, etc] terminal window during startup.
26 //Implementation of an idea by Prof Braino to inform user that any changes made
27 //to THIS file by the user have been successfully uploaded into firmware.
28 #define STRING_VERSION_CONFIG_H "2012-06-25-1" //Personal revision number for changes to THIS file.
29 #define STRING_CONFIG_H_AUTHOR "RepRapPro" //Who made the changes.
30
31 // This determines the communication speed of the printer
32 #define BAUDRATE 250000
33 //#define BAUDRATE 115200
34
35 //// The following define selects which electronics board you have. Please choose the one that matches your setup
36 // Gen7 custom (Alfons3 Version) = 10 "https://github.com/Alfons3/Generation_7_Electronics"
37 // Gen7 v1.1, v1.2 = 11
38 // Gen7 v1.3 = 12
39 // Gen7 v1.4 = 13
40 // MEGA/RAMPS up to 1.2 = 3
41 // RAMPS 1.3 = 33 (Power outputs: Extruder, Bed, Fan)
42 // RAMPS 1.3 = 34 (Power outputs: Extruder0, Extruder1, Bed)
43 // Gen6 = 5
44 // Gen6 deluxe = 51
45 // Sanguinololu 1.2 and above = 62
46 // Melzi 63
47 // Ultimaker = 7
48 // Teensylu = 8
49 // Gen3+ =9
50 #define MOTHERBOARD 62
51
52 //===========================================================================
53 //=============================Thermal Settings  ============================
54 //===========================================================================
55
56 // Set this if you want to define the constants in the thermistor circuit
57 // and work out temperatures algebraically - added by AB.
58 //#define COMPUTE_THERMISTORS
59
60 #ifdef COMPUTE_THERMISTORS
61
62 // See http://en.wikipedia.org/wiki/Thermistor#B_or_.CE.B2_parameter_equation
63
64 // BETA is the B value
65 // RS is the value of the series resistor in ohms
66 // R_INF is R0.exp(-BETA/T0), where R0 is the thermistor resistance at T0 (T0 is in kelvin)
67 // Normally T0 is 298.15K (25 C).  If you write that expression in brackets in the #define the compiler 
68 // should compute it for you (i.e. it won't need to be calculated at run time).
69
70 // If the A->D converter has a range of 0..1023 and the measured voltage is V (between 0 and 1023)
71 // then the thermistor resistance, R = V.RS/(1023 - V)
72 // and the temperature, T = BETA/ln(R/R_INF)
73 // To get degrees celsius (instead of kelvin) add -273.15 to T
74
75 // This DOES assume that all extruders use the same thermistor type.
76
77 #define ABS_ZERO -273.15
78 #define AD_RANGE 16383
79
80 // RS 198-961
81 #define E_BETA 3960.0
82 #define E_RS 4700.0
83 #define E_R_INF ( 100000.0*exp(-E_BETA/298.15) )
84
85 // RS 484-0149; EPCOS B57550G103J
86 #define BED_BETA 3480.0
87 #define BED_RS 4700.0
88 #define BED_R_INF ( 10000.0*exp(-BED_BETA/298.15) )
89
90 #define BED_USES_THERMISTOR
91 #define HEATER_0_USES_THERMISTOR
92 //#define HEATER_1_USES_THERMISTOR
93 //#define HEATER_2_USES_THERMISTOR
94
95 #endif
96
97
98
99 //// Temperature sensor settings:
100 // -2 is thermocouple with MAX6675 (only for sensor 0)
101 // -1 is thermocouple with AD595
102 // 0 is not used
103 // 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
104 // 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
105 // 3 is mendel-parts thermistor (4.7k pullup)
106 // 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
107 // 5 is ParCan supplied 104GT-2 100K
108 // 6 is EPCOS 100k
109 // 7 is 100k Honeywell thermistor 135-104LAG-J01
110 // 100 is 100k GE Sensing AL03006-58.2K-97-G1 with r2=4k7
111 // 101 is 100k 0603 SMD Vishay NTCS0603E3104FXT with r2=4k7
112 // 102 is 100k EPCOS G57540 Nozzle with r2=4k7
113 // 103 is 100k EPCOS G57540 Bed with r2=4k7
114 // 104 is 10k G57540 Bed with r2=4k7
115 // 105 is 10k G57540 Bed with r2=10k
116 // 110 is 100k RS thermistor 198-961 hot end with 10K resistor
117
118 #define TEMP_SENSOR_0 102
119 #define TEMP_SENSOR_1 0
120 #define TEMP_SENSOR_2 0
121 #define TEMP_SENSOR_BED 101
122
123 // Actual temperature must be close to target for this long before M109 returns success
124 #define TEMP_RESIDENCY_TIME 10  // (seconds)
125 #define TEMP_HYSTERESIS 5       // (C°) range of +/- temperatures considered "close" to the target one
126 #define TEMP_WINDOW     2       // (degC) Window around target to start the recidency timer x degC early.
127
128 // The minimal temperature defines the temperature below which the heater will not be enabled It is used
129 // to check that the wiring to the thermistor is not broken. 
130 // Otherwise this would lead to the heater being powered on all the time.
131 #define HEATER_0_MINTEMP 1
132 //#define HEATER_1_MINTEMP 5
133 //#define HEATER_2_MINTEMP 5
134 #define BED_MINTEMP 1
135
136 // When temperature exceeds max temp, your heater will be switched off.
137 // This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
138 // You should use MINTEMP for thermistor short/failure protection.
139 #define HEATER_0_MAXTEMP 399
140 //#define HEATER_1_MAXTEMP 275
141 //#define HEATER_2_MAXTEMP 275
142 #define BED_MAXTEMP 150
143
144
145 // PID settings:
146 // Comment the following line to disable PID and enable bang-bang.
147 #define PIDTEMP
148 #define PID_MAX 255 // limits current to nozzle; 255=full current
149 #define FULL_PID_BAND 150 // Full power is applied when pid_error[e] > FULL_PID_BAND
150 #ifdef PIDTEMP
151   //#define PID_DEBUG // Sends debug data to the serial port. 
152   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104 sets the output power in %
153   #define PID_INTEGRAL_DRIVE_MAX 125  //limit for the integral term
154   #define K1 0.95 //smoothing factor withing the PID
155   #define PID_dT 0.122 //sampling period of the PID
156
157 // If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it
158 // Ultimaker
159 //    #define  DEFAULT_Kp  22.2
160 //    #define  DEFAULT_Ki (1.25*PID_dT)  
161 //    #define  DEFAULT_Kd (99/PID_dT)  
162
163 // Makergear
164 //    #define  DEFAULT_Kp 7.0
165 //    #define  DEFAULT_Ki 0.1  
166 //    #define  DEFAULT_Kd 12  
167
168 // RepRapPro Huxley + Mendel
169     #define  DEFAULT_Kp 12.0
170     #define  DEFAULT_Ki (2.2*PID_dT)
171     #define  DEFAULT_Kd (80/PID_dT)
172
173 // Mendel Parts V9 on 12V    
174 //    #define  DEFAULT_Kp  63.0
175 //    #define  DEFAULT_Ki (2.25*PID_dT)  
176 //    #define  DEFAULT_Kd (440/PID_dT)
177 #endif // PIDTEMP
178
179 #ifndef DEVELOPING
180 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
181 //can be software-disabled for whatever purposes by
182 #define PREVENT_DANGEROUS_EXTRUDE
183 #define EXTRUDE_MINTEMP 170
184 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
185 #endif
186
187 //===========================================================================
188 //=============================Mechanical Settings===========================
189 //===========================================================================
190
191 // Endstop Settings
192 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
193
194 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
195 const bool X_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops. 
196 const bool Y_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops. 
197 const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops. 
198
199 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
200 #define X_ENABLE_ON 0
201 #define Y_ENABLE_ON 0
202 #define Z_ENABLE_ON 0
203 #define E_ENABLE_ON 0 // For all extruders
204
205 // Disables axis when it's not being used.
206 #define DISABLE_X false
207 #define DISABLE_Y false
208 #define DISABLE_Z true
209 #define DISABLE_E false // For all extruders
210
211 #define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
212 #define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
213 #define INVERT_Z_DIR false     // for Mendel set to false, for Orca set to true
214 #define INVERT_E0_DIR true   // for direct drive extruder v9 set to true, for geared extruder set to false
215 #define INVERT_E1_DIR true    // for direct drive extruder v9 set to true, for geared extruder set to false
216 #define INVERT_E2_DIR true   // for direct drive extruder v9 set to true, for geared extruder set to false
217
218 // ENDSTOP SETTINGS:
219 // Sets direction of endstops when homing; 1=MAX, -1=MIN
220 #define X_HOME_DIR -1
221 #define Y_HOME_DIR -1
222 #define Z_HOME_DIR -1
223
224 #define min_software_endstops true //If true, axis won't move to coordinates less than zero.
225 #define max_software_endstops true  //If true, axis won't move to coordinates greater than the defined lengths below.
226
227 // The position of the homing switches. Use MAX_LENGTH * -0.5 if the center should be 0, 0, 0
228 #define X_HOME_POS 0
229 #define Y_HOME_POS 0
230 #define Z_HOME_POS 0
231
232 //// MOVEMENT SETTINGS
233 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
234
235 #ifdef REPRAPPRO_MENDEL
236
237 #define X_MAX_LENGTH 210
238 #define Y_MAX_LENGTH 210
239 #define Z_MAX_LENGTH 140
240 #define HOMING_FEEDRATE {10*60, 10*60, 1*60, 0}  // set the homing speeds (mm/min)
241 #define FAST_HOME_FEEDRATE {50*60, 50*60, 1*60, 0}  // set the homing speeds (mm/min)
242 #define DEFAULT_MAX_FEEDRATE  {500, 500, 3, 45}
243 #define DEFAULT_MAX_FEEDRATE          {300, 300, 3, 45}    // (mm/sec)    
244 #define DEFAULT_MAX_ACCELERATION      {800,800,30,250}    // X, Y, Z, E maximum start speed for accelerated moves. E default values
245
246 #else
247
248 #define X_MAX_LENGTH 155
249 #define Y_MAX_LENGTH 150
250 #define Z_MAX_LENGTH 90
251 #define HOMING_FEEDRATE {10*60, 10*60, 1*60, 0}  // set the homing speeds (mm/min)
252 #define FAST_HOME_FEEDRATE {80*60, 80*60, 4*60, 0}  // set the homing speeds (mm/min)
253 #define DEFAULT_MAX_FEEDRATE  {500, 500, 5, 45}    // (mm/sec)
254 #define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 45}    // (mm/sec)    
255 #define DEFAULT_MAX_ACCELERATION      {1000,1000,50,250}    // X, Y, Z, E maximum start speed for accelerated moves. E default values
256
257 #endif
258
259
260 // default settings 
261
262 #define DEFAULT_AXIS_STEPS_PER_UNIT   {91.4286, 91.4286,4000,875}                    // default steps per unit for ultimaker 
263
264
265 #define DEFAULT_ACCELERATION          1000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves 
266 #define DEFAULT_RETRACT_ACCELERATION  1000   // X, Y, Z and E max acceleration in mm/s^2 for r retracts
267
268 // 
269 #define DEFAULT_XYJERK                15.0    // (mm/sec)
270 #define DEFAULT_ZJERK                 0.4     // (mm/sec)
271 #define DEFAULT_EJERK                 15.0    // (mm/sec)
272
273 //===========================================================================
274 //=============================Additional Features===========================
275 //===========================================================================
276
277 // EEPROM
278 // the microcontroller can store settings in the EEPROM, e.g. max velocity...
279 // M500 - stores paramters in EEPROM
280 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  
281 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
282 //define this to enable eeprom support
283 #define EEPROM_SETTINGS
284 //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
285 // please keep turned on if you can.
286 #define EEPROM_CHITCHAT
287
288 //LCD and SD support
289 //#define ULTRA_LCD  //general lcd support, also 16x2
290 #define SDSUPPORT // Enable SD Card Support in Hardware Console
291
292 //#define ULTIPANEL
293 #ifdef ULTIPANEL
294   //#define NEWPANEL  //enable this if you have a click-encoder panel
295   #define SDSUPPORT
296   #define ULTRA_LCD
297   #define LCD_WIDTH 20
298   #define LCD_HEIGHT 4
299
300 // Preheat Constants
301   #define PLA_PREHEAT_HOTEND_TEMP 180 
302   #define PLA_PREHEAT_HPB_TEMP 70
303   #define PLA_PREHEAT_FAN_SPEED 255             // Insert Value between 0 and 255
304
305   #define ABS_PREHEAT_HOTEND_TEMP 240
306   #define ABS_PREHEAT_HPB_TEMP 100
307   #define ABS_PREHEAT_FAN_SPEED 255             // Insert Value between 0 and 255
308
309 #else //no panel but just lcd 
310   #ifdef ULTRA_LCD
311     #define LCD_WIDTH 16
312     #define LCD_HEIGHT 2
313   #endif
314 #endif
315
316 // Enable uM-FPU support:
317 #define UMFPUSUPPORT 1
318
319 // M240  Triggers a camera by emulating a Canon RC-1 Remote
320 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
321 // #define PHOTOGRAPH_PIN     23
322
323 #include "Configuration_adv.h"
324 #include "thermistortables.h"
325
326 #endif //__CONFIGURATION_H