Advertisement
Guest User

repetier 93ff206

a guest
Apr 15th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.66 KB | None | 0 0
  1. /*
  2. This file is part of Repetier-Firmware.
  3.  
  4. Repetier-Firmware is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8.  
  9. Foobar is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with Repetier-Firmware. If not, see <http://www.gnu.org/licenses/>.
  16.  
  17. */
  18.  
  19. #ifndef CONFIGURATION_H
  20. #define CONFIGURATION_H
  21.  
  22. // BASIC SETTINGS: select your board type, thermistor type, axis scaling, and endstop configuration
  23.  
  24. //// The following define selects which electronics board you have. Please choose the one that matches your setup
  25. // MEGA/RAMPS up to 1.2 = 3,
  26. // RAMPS 1.3/RAMPS 1.4 = 33
  27. // Gen6 = 5,
  28. // Sanguinololu up to 1.1 = 6
  29. // Sanguinololu 1.2 and above = 62
  30. // Gen7 1.1 and above = 7
  31. // Teensylu (at90usb) = 8 // requires Teensyduino
  32. // Printrboard (at90usb) = 9 // requires Teensyduino
  33. #define MOTHERBOARD 33
  34. #include <avr/io.h>
  35. #include "pins.h"
  36.  
  37.  
  38. // ##########################################################################################
  39. // ## IMPORTANT ##
  40. // ##########################################################################################
  41.  
  42. // For easy configuration, the default settings enable parameter storage in EEPROM.
  43. // This means, after the first upload many variables can only be changed using the special
  44. // M commands as described in the documentation. Changing these value sin the configuration.h
  45. // has no effect. Parameters overriden by EEPROM settings are calibartion values, extruder
  46. // values except thermistor tables and some other parameter likely to change during usage
  47. // like advance steps or ops mode.
  48. // To override EEPROM settings with config settings, set EEPROM_MODE 0
  49.  
  50. // ##########################################################################################
  51. // ## Calibration ##
  52. // ##########################################################################################
  53.  
  54.  
  55. /** \brief Number of steps for a 1mm move in x direction. Overridden if EEPROM activated. */
  56. #define XAXIS_STEPS_PER_MM 44.44 // 80 for the T5 belt
  57. /** \brief Number of steps for a 1mm move in y direction Overridden if EEPROM activated.*/
  58. #define YAXIS_STEPS_PER_MM 80
  59. /** \brief Number of steps for a 1mm move in z direction Overridden if EEPROM activated.*/
  60. #define ZAXIS_STEPS_PER_MM 2560 // 2566.181336863
  61.  
  62. // ##########################################################################################
  63. // ## Extruder configuration ##
  64. // ##########################################################################################
  65.  
  66. /** Number of extruders. Maximum 2 extruder. */
  67. #define NUM_EXTRUDER 1
  68.  
  69. #define EXT0_X_OFFSET 0
  70. #define EXT0_Y_OFFSET 0
  71. // for skeinforge 40 and later, steps to pull the plasic 1 mm inside the extruder, not out. Overridden if EEPROM activated.
  72. #define EXT0_STEPS_PER_MM 479.43
  73. // What type of sensor is used?
  74. // 1 is 100k thermistor
  75. // 2 is 200k thermistor
  76. // 3 is mendel-parts thermistor
  77. // 4 is 10k thermistor
  78. // 5 is userdefined thermistor table 0
  79. // 6 is userdefined thermistor table 1
  80. // 7 is userdefined thermistor table 2
  81. // 50 is userdefined thermistor table 0 for PTC thermistors
  82. // 51 is userdefined thermistor table 0 for PTC thermistors
  83. // 52 is userdefined thermistor table 0 for PTC thermistors
  84. // 99 Generic thermistor table
  85. // 100 is AD595
  86. // 101 is MAX6675
  87. #define EXT0_TEMPSENSOR_TYPE 7
  88. // Position in analog input table below for reading temperatures or pin enabling SS for MAX6675
  89. #define EXT0_TEMPSENSOR_PIN 0
  90. // Which pin enables the heater
  91. #define EXT0_HEATER_PIN HEATER_0_PIN
  92. #define EXT0_STEP_PIN E_STEP_PIN
  93. #define EXT0_DIR_PIN E_DIR_PIN
  94. // set to 0/1 for normal / inverse direction
  95. #define EXT0_INVERSE true
  96. #define EXT0_ENABLE_PIN E_ENABLE_PIN
  97. // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
  98. #define EXT0_ENABLE_ON false
  99. // The following speed settings are for skeinforge 40+ where e is the
  100. // length of filament pulled inside the heater. For repsnap or older
  101. // skeinforge use hiher values.
  102. // Overridden if EEPROM activated.
  103. #define EXT0_MAX_FEEDRATE 1200
  104. // Feedrate from halted extruder in mm/s
  105. // Overridden if EEPROM activated.
  106. #define EXT0_MAX_START_FEEDRATE 10
  107. // Acceleration in mm/s^2
  108. // Overridden if EEPROM activated.
  109. #define EXT0_MAX_ACCELERATION 10000
  110. /** Type of heat manager for this extruder.
  111. - 0 = Simply switch on/off if temperature is reached. Works always.
  112. - 1 = PID Temperature control. Is better, but needs an output with PWM, which doesn't
  113. use Timer 0 and 1
  114. Overridden if EEPROM activated.
  115. */
  116. #define EXT0_HEAT_MANAGER 1
  117. /** Wait x seconds, after reaching target temperature. Only used for M109. Overridden if EEPROM activated. */
  118. #define EXT0_WATCHPERIOD 20
  119.  
  120. /** \brief The maximum value, I-gain can contribute to the output.
  121.  
  122. A good value is slightly higher then the output needed for your temperature.
  123. Values for startes:
  124. 130 => PLA for temperatures from 170-180°C
  125. 180 => ABS for temperatures around 240°C
  126.  
  127. The precice values may differ for different nozzle/resistor combination.
  128. Overridden if EEPROM activated.
  129. */
  130. #define EXT0_PID_INTEGRAL_DRIVE_MAX 130
  131. /** \brief lower value for integral part
  132.  
  133. The I state should converge to the exact heater output needed for the target temperature.
  134. To prevent a long deviation from the target zone, this value limits the lower value.
  135. A good start is 30 lower then the optimal value. You need to leave room for cooling.
  136. Overridden if EEPROM activated.
  137. */
  138. #define EXT0_PID_INTEGRAL_DRIVE_MIN 50
  139. /** P-gain in 0,01 units. Overridden if EEPROM activated. */
  140. #define EXT0_PID_PGAIN 500
  141. /** I-gain in 0,001 units
  142.  
  143. WATCH OUT: This value was in 0,01 units in earlier versions!
  144. Overridden if EEPROM activated.
  145. */
  146. #define EXT0_PID_IGAIN 1
  147. /** Dgain in 0,01 units. Overridden if EEPROM activated.*/
  148. #define EXT0_PID_DGAIN 3000
  149. // maximum time the heater is can be switched on. Max = 255. Overridden if EEPROM activated.
  150. #define EXT0_PID_MAX 255
  151. /** \brief Faktor for the advance algorithm. 0 disables the algorithm. Overridden if EEPROM activated.*/
  152. #define EXT0_ADVANCE_K 0.0f
  153. /** Number of entries in the user thermistortable 0. Set to 0 to disable it. */
  154. #define NUM_TEMPS_USERTHERMISTOR0 28
  155. /** Number of entries in the user thermistortable 1. Set to 0 to disable it. */
  156. #define NUM_TEMPS_USERTHERMISTOR1 20
  157. /** Number of entries in the user thermistortable 2. Set to 0 to disable it. */
  158. #define NUM_TEMPS_USERTHERMISTOR2 25
  159. /** \brief Set PID scaling
  160.  
  161. PID values assume a usable range from 0-255. This can be further limited to EXT0_PID_MAX by to methods.
  162. Set the value to 0: Normal computation, just clip output to EXT0_PID_MAX if computed value is too high.
  163. Set value to 1: Scale PID by EXT0_PID_MAX/256 and then clip to EXT0_PID_MAX.
  164. If your EXT0_PID_MAX is low, you should prefer the second method.
  165. */
  166. #define SCALE_PID_TO_MAX 0
  167.  
  168. /** Temperature range for target temperature to hold in M109 command. 5 means +/-5°C
  169.  
  170. Uncomment define to use force the temperature into the range for given watchperiod.
  171. */
  172. //#define TEMP_HYSTERESIS 5
  173.  
  174. /** \brief Simulate PWM
  175.  
  176. If your extruder uses a pin without pwm or with a pwm already in use for other functions, you
  177. can enable the PWM simulator instead. Only with PWM you can use PID control.
  178. For Sanguino boards (6 and 62) this is enabled by default. To force simulated PWM uncomment
  179. the define.
  180. */
  181. //#define SIMULATE_PWM
  182.  
  183. /** Userdefined thermistor table
  184.  
  185. There are many different thermistors, which can be combined with different resistors. This result
  186. in unpredictable number of tables. As a resolution, the user can define one table here, that can
  187. be used as type 5 for thermister type in extruder/heated bed definition. Make sure, the number of entries
  188. matches the value in NUM_TEMPS_USERTHERMISTOR0. If you span definition over multiple lines, make sure to end
  189. each line, except the last, with a backslash. The table format is {{adc1,temp1},{adc2,temp2}...} with
  190. increasing adc values. For more informations, read
  191. http://hydraraptor.blogspot.com/2007/10/measuring-temperature-easy-way.html
  192.  
  193. If you have a sprinter temperature table, you have to multiply the first value with 4 and the second with 8.
  194. This firmware works with increased precision, so the value read goes from 0 to 4095 and the temperature is
  195. temperature*8.
  196.  
  197. If you have a PTC thermistor instead of a NTC thermistor, keep the adc values increasing and use themistor types 50-52 instead of 5-7!
  198. */
  199. #define USER_THERMISTORTABLE0 {\
  200. {1*4,864*8},{21*4,300*8},{25*4,290*8},{29*4,280*8},{33*4,270*8},{39*4,260*8},{46*4,250*8},{54*4,240*8},{64*4,230*8},{75*4,220*8},\
  201. {90*4,210*8},{107*4,200*8},{128*4,190*8},{154*4,180*8},{184*4,170*8},{221*4,160*8},{265*4,150*8},{316*4,140*8},{375*4,130*8},\
  202. {441*4,120*8},{513*4,110*8},{588*4,100*8},{734*4,80*8},{856*4,60*8},{938*4,40*8},{986*4,20*8},{1008*4,0*8},{1018*4,-20*8} }
  203.  
  204. #define USER_THERMISTORTABLE1 {\
  205. {1*4,821*8},{54*4,252*8},{107*4,207*8},{160*4,182*8},{213*4,165*8},{266*4,152*8},{319*4,141*8},{372*4,131*8},\
  206. {425*4,123*8},{478*4,115*8},{531*4,107*8},{584*4,100*8},{637*4,93*8},{690*4,86*8},{743*4,78*8},{796*4,70*8},\
  207. {849*4,60*8},{902*4,49*8},{955*4,34*8},{1008*4,3*8} } // Ultimachine 100K : EPOS 100K
  208.  
  209. #define USER_THERMISTORTABLE2 {\
  210. { 1*4,864*8},{ 35*4,300*8},{ 40*4,250*8},{ 50*4,220*8},{ 63*4,210*8},{ 76*4,200*8},\
  211. { 91*4,190*8},{110*4,180*8},{134*4,170*8},{163*4,160*8},{184*4,150*8},{234*4,140*8},\
  212. { 280*4,130*8},{332*4,120*8},{399*4,110*8},{477*4,100*8},{568*4, 90*8},{654*4, 80*8},\
  213. { 724*4, 70*8},{791*4, 60*8},{860*4, 50*8},{911*4, 40*8},{951*4, 30*8},{954*4, 22*8},\
  214. {1023*4, 0*8} } // arcol 100k : measured using thermocouple
  215.  
  216. /** If defined, creates a thermistortable at startup.
  217.  
  218. If you dont feel like computing the table on your own, you can use this generic method. It is
  219. a simple approximation which may be not as accurate as a good table computed from the reference
  220. values in the datasheet. You can increase precision if you use a temperature/resistance for
  221. R0/T0, which is near your operating temperature. This will reduce precision for lower temperatures,
  222. which are not realy important. The resistors must fit the following schematic:
  223. @code
  224. VREF ---- R2 ---+--- Termistor ---+-- GND
  225. | |
  226. +------ R1 -------+
  227. | |
  228. +---- Capacitor --+
  229. |
  230. V measured
  231. @endcode
  232.  
  233. If you don't have R1, set it to 0.
  234. The capacitor is for reducing noise from long thermistor cable. If you don't have have one, it's OK.
  235.  
  236. If you don't need the generic table, uncomment the following define.
  237. */
  238. //#define USE_GENERIC_THERMISTORTABLE
  239. /** Reference resistance */
  240. #define GENERIC_THERM_R0 1042.7
  241. /** Temperature at reference resistance */
  242. #define GENERIC_THERM_T0 170
  243. /** Beta value of thermistor
  244.  
  245. You can use the beta from the datasheet or compute it yourself. See
  246. http://reprap.org/wiki/MeasuringThermistorBeta
  247. for more details.
  248. */
  249. #define GENERIC_THERM_BETA 4036
  250. #define GENERIC_THERM_R1 0
  251. #define GENERIC_THERM_R2 4700
  252. #define GENERIC_THERM_VREF 5
  253. /** Supply voltage to ADC, can be changed be setting ANALOG_REF below to different value. */
  254. #define GENERIC_THERM_VADC 5
  255. /** Number of entries in generated table. One entry takes 4 bytes. Higher number of entries increase computation time too. */
  256. #define GENERIC_THERM_NUM_ENTRIES 40
  257.  
  258. // uncomment the following line for MAX6675 support.
  259. //#define SUPPORT_MAX6675
  260.  
  261. // ############# Heated bed configuration ########################
  262.  
  263. /** \brief Switches fast between config for heated bed and non heated bed. Default setting is autodetect
  264. assuming only 2 heater outputs are available. */
  265. #if HEATER_1_PIN>-1 && NUM_EXTRUDER==1
  266. #define HAVE_HEATED_BED true
  267. #else
  268. #define HAVE_HEATED_BED false
  269. #endif
  270. //#define HAVE_HEATED_BED false // Override autodetected value
  271.  
  272. #if HAVE_HEATED_BED==true
  273. // Select type of your heated bed. It's the same as for EXT0_TEMPSENSOR_TYPE
  274. // set to 0 if you don't have a heated bed
  275. #define HEATED_BED_SENSOR_TYPE 6
  276. /** Index of analog sensor to read temperature of heated bed.
  277. THIS IS NOT A PIN NUMBER - IT'S A REFERENCE TO A TABLE WITH PIN NUMBERS!!!
  278. Look at ANALOG_INPUT_CHANNELS for the position
  279. or to add the Arduino pin id there. */
  280. #define HEATED_BED_SENSOR_PIN 1
  281. /** \brief Pin to enable heater for bed. */
  282. #define HEATED_BED_HEATER_PIN HEATER_1_PIN
  283. // How often the temperature of the heated bed is set (msec)
  284. #define HEATED_BED_SET_INTERVAL 5000
  285. #else
  286. #define HEATED_BED_SENSOR_TYPE 0
  287. #define HEATED_BED_SENSOR_PIN -1
  288. #define HEATED_BED_HEATER_PIN -1
  289. #endif
  290.  
  291. // uncomment to use AREF for reference voltage
  292. // on a GEN6 you want AVCC
  293. #define USE_AVCC_FOR_TEMP
  294. // how many samples do we want per reading. 1 sample takes 1/125000 seconds.
  295. // more samples get more reliable values, but take more time.
  296. #define ANALOG_SUPERSAMPLE 10
  297. /** The number of analog sensors, we need to read out. These are the thermistors used for temperature
  298. reading of the extruder and heated bed. */
  299. #if HAVE_HEATED_BED==true
  300. #define NUM_ANALOG_SENSORS 2
  301. #else
  302. #define NUM_ANALOG_SENSORS 1
  303. #endif
  304. /** Number of digital temp. sensors like MAX6675 */
  305. #define NUM_DIGITAL_SENSORS 0
  306. #define TEMP_PID true
  307.  
  308. //// Experimental watchdog and minimal temp
  309. // The watchdog waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
  310. // If the temperature has not increased at the end of that period, the target temperature is set to zero. It can be reset with another M104/M109
  311. //#define WATCHPERIOD 5000 //5 seconds
  312.  
  313. //// The minimal temperature defines the temperature below which the heater will not be enabled
  314. #define MINTEMP 5
  315.  
  316. //// Experimental max temp
  317. // When temperature exceeds max temp, your heater will be switched off.
  318. // This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
  319. // You should use MINTEMP for thermistor short/failure protection.
  320. #define MAXTEMP 275
  321.  
  322. /**
  323. Normally you need a PWM controlable output, to define different fan speeds. If you
  324. don't have one, you can only turn your fan on or off.
  325.  
  326. As a sulution, you can simulate PWM for your pin. This works for all pins, even non-PWM pins!
  327. If your fan is connected to a PWM output that is used by the firmware internally, you must
  328. activate PWM simulation.
  329.  
  330. To active fan PWM simulation uncomment the next define.
  331. */
  332. //#define SIMULATE_FAN_PWM
  333.  
  334. /** \brief number of analog input signals. Normally 1 for each temperature sensor */
  335. #define ANALOG_INPUTS NUM_ANALOG_SENSORS
  336. #if ANALOG_INPUTS>0
  337. /** Channels are the MUX-part of ADMUX register
  338.  
  339. Put all the pin numbers for the analog sensors (temp. sensor for extruder and heated bed) in here.
  340. In the configs of the sensor, use the index in this array. For the typical combination of
  341. one extruder with heated bed, write:
  342. #define ANALOG_INPUT_CHANNELS {TEMP_0_PIN,TEMP_1_PIN}
  343. */
  344. #if HAVE_HEATED_BED==true
  345. #define ANALOG_INPUT_CHANNELS {TEMP_0_PIN,TEMP_1_PIN}
  346. #else
  347. #define ANALOG_INPUT_CHANNELS {TEMP_0_PIN}
  348. #endif
  349. // Bits of the ADC converter
  350. #define ANALOG_INPUT_BITS 10
  351. // Build median from 2^ANALOG_INPUT_SAMPLE samples
  352. #define ANALOG_INPUT_SAMPLE 5
  353. #define ANALOG_REF_AREF 0
  354. #define ANALOG_REF_AVCC _BV(REFS0)
  355. #define ANALOG_REF_INT_1_1 _BV(REFS1)
  356. #define ANALOG_REF_INT_2_56 _BV(REFS0) | _BV(REFS1)
  357. /** \brief Used reference, normally ANALOG_REF_AVCC or ANALOG_REF_AREF */
  358. #define ANALOG_REF ANALOG_REF_AVCC
  359. #define ANALOG_PRESCALER _BV(ADPS0)|_BV(ADPS1)|_BV(ADPS2)
  360.  
  361.  
  362. #endif
  363. // ##########################################################################################
  364. // ## Endstop configuration ##
  365. // ##########################################################################################
  366.  
  367. //// Endstop Settings
  368. #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
  369. // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
  370. //set to true to invert the logic of the endstops
  371. #define ENDSTOP_X_MIN_INVERTING false
  372. #define ENDSTOP_Y_MIN_INVERTING false
  373. #define ENDSTOP_Z_MIN_INVERTING false
  374. #define ENDSTOP_X_MAX_INVERTING false
  375. #define ENDSTOP_Y_MAX_INVERTING false
  376. #define ENDSTOP_Z_MAX_INVERTING false
  377.  
  378. //If your axes are only moving in one direction, make sure the endstops are connected properly.
  379. //If your axes move in one direction ONLY when the endstops are triggered, set ENDSTOPS_INVERTING to true here
  380.  
  381.  
  382.  
  383. //// ADVANCED SETTINGS - to tweak parameters
  384.  
  385. // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
  386. #define X_ENABLE_ON 0
  387. #define Y_ENABLE_ON 0
  388. #define Z_ENABLE_ON 0
  389.  
  390. // Disables axis when it's not being used.
  391. #define DISABLE_X false
  392. #define DISABLE_Y false
  393. #define DISABLE_Z true
  394. #define DISABLE_E false
  395.  
  396. // Inverting axis direction
  397. #define INVERT_X_DIR false
  398. #define INVERT_Y_DIR true
  399. #define INVERT_Z_DIR true
  400.  
  401. //// ENDSTOP SETTINGS:
  402. // Sets direction of endstops when homing; 1=MAX, -1=MIN
  403. #define X_HOME_DIR -1
  404. #define Y_HOME_DIR -1
  405. #define Z_HOME_DIR -1
  406.  
  407. //If true, axis won't move to coordinates less than zero.
  408. #define min_software_endstop_x false
  409. #define min_software_endstop_y false
  410. #define min_software_endstop_z false
  411.  
  412. //If true, axis won't move to coordinates greater than the defined lengths below.
  413. #define max_software_endstop_x true
  414. #define max_software_endstop_y true
  415. #define max_software_endstop_z true
  416.  
  417. // If during homing the endstop is reached, ho many mm should the printer move back for the second try
  418. #define ENDSTOP_X_BACK_MOVE 5
  419. #define ENDSTOP_Y_BACK_MOVE 5
  420. #define ENDSTOP_Z_BACK_MOVE 2
  421.  
  422. // For higher precision you can reduce the speed for the second test on the endstop
  423. // during homing operation. The homing speed is divided by the value. 1 = same speed, 2 = half speed
  424. #define ENDSTOP_X_RETEST_REDUCTION_FACTOR 2
  425. #define ENDSTOP_Y_RETEST_REDUCTION_FACTOR 2
  426. #define ENDSTOP_Z_RETEST_REDUCTION_FACTOR 2
  427.  
  428. // You can disable endstop checking for print moves. This is needed, if you get sometimes
  429. // false signals from your endstops. If your endstops don't give false signals, you
  430. // can set it on for safety.
  431. #define ALWAYS_CHECK_ENDSTOPS true
  432. // maximum positions in mm - only fixed numbers!
  433. #define X_MAX_LENGTH 180
  434. #define Y_MAX_LENGTH 190
  435. #define Z_MAX_LENGTH 70
  436.  
  437. // ##########################################################################################
  438. // ## Movement settings ##
  439. // ##########################################################################################
  440.  
  441. /** After x seconds of inactivity, the stepper motors are disabled.
  442. Set to 0 to leave them enabled.
  443. This helps cooling the Stepper motors between two print jobs.
  444. Overridden if EEPROM activated.
  445. */
  446. #define STEPPER_INACTIVE_TIME 120L
  447. /** After x seconds of inactivity, the system will go down as far it can.
  448. It will at least disable all stepper motors and heaters. If the board has
  449. a power pin, it will be disabled, too.
  450. Set value to 0 for disabled.
  451. Overridden if EEPROM activated.
  452. */
  453. #define MAX_INACTIVE_TIME 0L
  454. /** Maximum feedrate, the system allows. Higher feedrates are reduced to these values.
  455. The axis order in all axis related arrays is X, Y, Z, E
  456. Overridden if EEPROM activated.
  457. */
  458. #define MAX_FEEDRATE {15000, 15000, 300, 600}
  459. /** Speed in mm/min for finding the home position. Overridden if EEPROM activated. */
  460. #define HOMING_FEEDRATE {2400,2400,200}
  461.  
  462. /** Comment this to disable ramp acceleration */
  463. #define RAMP_ACCELERATION 1
  464.  
  465. //// Acceleration settings
  466.  
  467. /** \brief Use RAMP acceleration for faster printing speed. */
  468. #ifdef RAMP_ACCELERATION
  469. /** \brief X, Y, Z and E max acceleration in mm/s^2 for printing moves or retracts. Make sure your printer can go that high!
  470. Overridden if EEPROM activated.
  471. */
  472. #define MAX_ACCELERATION_UNITS_PER_SQ_SECOND {3000,3000,100,1000}
  473. /** \brief X, Y, Z max acceleration in mm/s^2 for travel moves. Overridden if EEPROM activated.*/
  474. #define MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND {3000,3000,100,1000}
  475. #endif
  476.  
  477. /** \brief Maximum allowable jerk.
  478.  
  479. Caution: This is no real jerk in a physical meaning.
  480.  
  481. The jerk determines your start speed and the maximum speed at the join of two segments.
  482. It's unit is mm/s. If the printer is standing still, the start speed is jerk/2. At the
  483. join of two segments, the speed difference is limited to the jerk value.
  484.  
  485. Examples:
  486. For all examples jerk is assumed as 40.
  487.  
  488. Segment 1: vx = 50, vy = 0
  489. Segment 2: vx = 0, vy = 50
  490. v_diff = sqrt((50-0)^2+(0-50)^2) = 70.71
  491. v_diff > jerk => vx_1 = vy_2 = jerk/v_diff*vx_1 = 40/70.71*50 = 28.3 mm/s at the join
  492.  
  493. Segment 1: vx = 50, vy = 0
  494. Segment 2: vx = 35.36, vy = 35.36
  495. v_diff = sqrt((50-35.36)^2+(0-35.36)^2) = 38.27 < jerk
  496. Corner can be printed with full speed of 50 mm/s
  497.  
  498. Overridden if EEPROM activated.
  499. */
  500. #define MAX_JERK 40.0
  501. #define MAX_ZJERK 0.3
  502.  
  503. // ##########################################################################################
  504. // ## Extruder control ##
  505. // ##########################################################################################
  506.  
  507. /** \brief Prescale factor, timer0 runs at.
  508.  
  509. All known arduino boards use 64. This value is needed for the extruder timing. */
  510. #define TIMER0_PRESCALE 64
  511.  
  512. /** \brief speed of the extruder feeder
  513.  
  514. This is the maximum speed, the filament can be moved forward and backward without acceleration.
  515. The value determines, how often we can update the extruder stepper, to come up with the desired
  516. extruder position. Higher values increase precision. If you set the value too high, you will
  517. lose steps. Only discrete values between 1 and 255 can be set for the timer. The effectife update
  518. frequency is computed as:
  519.  
  520. f = floor(F_CPU/(TIMER0_PRESCALE*EXTRUDER_SPEED*STEPS_PER_MM))
  521.  
  522. Important: This is the speed, filament is pushed inside the extruder not the speed at the nozzle!
  523. If you set the extruder steps_per_mm for 1mm pushed outside, cause skeinforge<40 needed it, you must
  524. decrease the value to reflect this. (*filament_diameter^2/nozzle_diameter^2)
  525. */
  526. #define EXTRUDER_SPEED 20.0
  527.  
  528. /* \brief Minimum temperature for extruder operation
  529.  
  530. This is a saftey value. If your extruder temperature is below this temperature, no
  531. extruder steps are executed. This is to prevent your extruder to move unless the fiament
  532. is at least molten. After havong some complains that the extruder does not work, I leave
  533. it 0 as default.
  534. */
  535.  
  536. #define MIN_EXTRUDER_TEMP 0
  537. /** \brief Activate ooze prevention system
  538.  
  539. The ooze prevention system tries to prevent ooze, by a fast retract of the filament every time
  540. printing stops. Most slicing software have already an option to do this. Using OPS_MODE=1 will
  541. in fact mimic this. This works good, but can increase printing time. To reduce the additional
  542. waiting time, the OPS has a fast mode, which performs the retraction during the travelling move.
  543. The only reason, your slicer doesn't do it, is because it can't tell. There is simple no
  544. G-Code command telling the firmware to do that.
  545.  
  546. You can always compile including OPS. Then you can disable/enable it anytime you want. To disable it
  547. set USE_OPS 0
  548.  
  549. Caution: Don't enable anti-ooze in your slicer if you are using this.
  550. */
  551. #define USE_OPS 1
  552.  
  553. /** \brief Sets the ops operation mode
  554.  
  555. 0: Off
  556. 1: Classic mode. Stop head, retract move to target, push filament back.
  557. 2: Fast mode. Retract during move, start pushing back the filament during move. For safty, we start
  558. at with a low speed and wait for the push back, before the pintmove starts. Normally there is some
  559. time needed to wait for the filament.
  560.  
  561. Overridden if EEPROM activated.
  562. */
  563. #define OPS_MODE 0
  564.  
  565. /** \brief Minimum distance for retraction.
  566.  
  567. If a travel move is shorter than this distance, no retraction will occur. This is to prevent
  568. retraction with infill, where the angle to the perimeter needs a short stop. Unit is mm.
  569. Overridden if EEPROM activated.
  570. */
  571. #define OPS_MIN_DISTANCE 0.8
  572.  
  573. /** \brief Move printhead only after x% of retract distance have been retracted.
  574.  
  575. Overridden if EEPROM activated.*/
  576. #define OPS_MOVE_AFTER 50.0
  577. /** \brief Retraction distance in mm. If you want to enable OPS only sometimes, compile with
  578. OPS support and set retraction distance to 0. If you set it to e.g. 3 in your eeprom settings it is enabled.
  579. Overridden if EEPROM activated.*/
  580. #define OPS_RETRACT_DISTANCE 3.0
  581.  
  582. /** \brief Backslash produced by extruder reversal
  583.  
  584. If you are using a bowden extruder, you may need some extra distance to push the filament back into the
  585. original place. This is the value you enter here. Unit is mm.
  586. Overridden if EEPROM activated.
  587. */
  588. #define OPS_RETRACT_BACKSLASH 0.0
  589.  
  590.  
  591.  
  592. /** \brief Enable advance algorithm.
  593.  
  594. Without a correct adjusted advance algorithm, you get blobs at points, where acceleration changes. The
  595. effect increases with speed and acceleration difference. Using the advance method decreases this effect.
  596. For more informations, read the wiki.
  597. */
  598. #define USE_ADVANCE
  599.  
  600. /** The firmware supports trajectory smoothing. To acieve this, it divides the stepsize by 2, resulting in
  601. the double computation cost. For slow movements this is not an issue, but for really fast moves this is
  602. too much. The value specified here is the number of clock cycles between a step on the driving axis.
  603. If the interval at full speed is below this value, smoothing is disabled for that line.*/
  604. #define MAX_HALFSTEP_INTERVAL 1999
  605.  
  606. // ##########################################################################################
  607. // ## Communication configuration ##
  608. // ##########################################################################################
  609.  
  610. //// AD595 THERMOCOUPLE SUPPORT UNTESTED... USE WITH CAUTION!!!!
  611.  
  612. /** \brief Communication speed.
  613.  
  614. - 250000 : Fastes with errorrate of 0% with 16 or 32 MHz - update wiring_serial.c in your board files. See boards/readme.txt
  615. - 115200 : Fast, but may produce communication errors on quite regular basis, Error rate -3,5%
  616. - 76800 : Best setting for Arduino with 16 MHz, Error rate 0,2% page 198 AVR1284 Manual. Result: Faster communication then 115200
  617. - 57600 : Should produce nearly no errors, on my gen 6 it's faster than 115200 because there are no errors slowing down the connection
  618. - 38600
  619.  
  620. Overridden if EEPROM activated.
  621. */
  622. //#define BAUDRATE 76800
  623. //#define BAUDRATE 57600
  624. #define BAUDRATE 250000
  625. /** \brief Size in byte of the output buffer */
  626. #define OUTPUT_BUFFER_SIZE 64
  627. /** \brief Activates buffered output.
  628.  
  629. The Arduino libraries have a buffered input for serial connections. Write operations are
  630. always unbuffered, which means the controller will wait with execution, until the data
  631. is send. To solve this handicap, all write operations have to use out insted of Serial.
  632. If you uncomment this, you still have to use out, but it will use no buffers, so you
  633. keep with your slow communication version.
  634. */
  635.  
  636. /**
  637. Some boards like Gen7 have a power on pin, to enable the atx power supply. If this is defined,
  638. the power will be turned on without the need to call M80 if initially started.
  639. */
  640. #define ENABLE_POWER_ON_STARTUP
  641.  
  642. #if !defined(__AVR_AT90USB1286__) && !defined(__AVR_AT90USB1287__) // not needed for USB serial
  643. #define USE_BUFFERED_OUTPUT
  644. #endif
  645. /** \brief Number of moves we can cache in advance.
  646.  
  647. This number of moves can be cached in advance. If you wan't to cache more, increase this. Especially on
  648. many very short moves the cache may go empty. The minimum value is 5.
  649. */
  650. #define MOVE_CACHE_SIZE 16
  651.  
  652. /** \brief Low filled cache size.
  653.  
  654. If the cache contains less then MOVE_CACHE_LOW segments, the time per segment is limited to LOW_TICKS_PER_MOVE clock cycles.
  655. If a move would be shorter, the feedrate will be reduced. This should prevent buffer underflows. Set this to 0 if you
  656. don't care about empty buffers during print.
  657. */
  658. #define MOVE_CACHE_LOW 12
  659. /** \brief Cycles per move, if move cache is low.
  660.  
  661. This value must be high enough, that the buffer has time to fill up. The problem only occurs at the beginning of a print or
  662. if you are printing many very short segments at high speed.
  663. */
  664. #define LOW_TICKS_PER_MOVE 200000
  665. /** \brief Cache size for incoming commands.
  666.  
  667. There should be no reason to increase this cache. Commands are nearly immediately send to
  668. execution.
  669. */
  670. #define GCODE_BUFFER_SIZE 2
  671. /** Appends the linenumber after ever ok send, to acknowledge the received command. Uncomment for plain ok ACK if your host has problems with this */
  672. #define ACK_WITH_LINENUMBER
  673. /** Communication errors can swollow part of the ok, which tells the host software to send
  674. the next command. Not receiving it will cause your printer to stop. Sending this string every
  675. second, if our queue is empty should prevent this. Uncomment if you don't wan't this feature. */
  676. #define WAITING_IDENTIFIER "wait"
  677.  
  678. /** \brief Sets time for echo debug
  679.  
  680. You can set M111 1 which enables ECHO of commands send. This define specifies the position,
  681. when it will be executed. In the original FiveD software, echo is done after receiving the
  682. command. With checksum you know, how it looks from the sending string. With this define
  683. uncommented, you will see the last command executed. To be more specific: It is written after
  684. execution. This helps tracking errors, because there may be 8 or more commands in the queue
  685. and it is elsewise difficult to know, what your reprap is currently doing.
  686. */
  687. #define ECHO_ON_EXECUTE
  688.  
  689. /** \brief EEPROM storage mode
  690.  
  691. Set the EEPROM_MODE to 0 if you always want to use the settings in this configuration file. If not,
  692. set it to a value not stored in the first EEPROM-byte used. If you later want to overwrite your current
  693. eeprom settings with configuration defaults, just select an other value. On the first call to epr_init()
  694. it will detect a mismatch of the first byte and copys default values into EEPROM. If the first byte
  695. matches, the stored values are used to overwrite the settings.
  696.  
  697. IMPORTANT: With mode <>0 some changes in configuration.h are not set any more, as they are
  698. taken from the EEPROM.
  699. */
  700. #define EEPROM_MODE 0
  701. /** Comment out (using // at the start of the line) to disable SD support: */
  702. //#define SDSUPPORT 1
  703. /** Show extended directory including file length. Don't use this with pronterface! */
  704. #define SD_EXTENDED_DIR
  705.  
  706. // ##########################################################################################
  707. // ## Debug configuration ##
  708. // ##########################################################################################
  709.  
  710. /** Uncomment, to see detailed data for every move. Only for debugging purposes! */
  711. //#define DEBUG_QUEUE_MOVE
  712. /** Allows M111 to set bit 5 (16) which disables all commands except M111. This can be used
  713. to test your data througput or search for communication problems. */
  714. #define INCLUDE_DEBUG_COMMUNICATION
  715. /** Allows M111 so set bit 6 (32) which disables moves, at the first tried step. In combination
  716. with a dry run, you can test the speed of path computations, which are still performed. */
  717. //#define INCLUDE_DEBUG_NO_MOVE
  718. /** Writes the free RAM to output, if it is less then at the last test. Should always return
  719. values >500 for safety, since it doesn't catch every function call. Nice to tweak cache
  720. usage or for seraching for memory induced errors. Switch it off for production, it costs execution time. */
  721. //#define DEBUG_FREE_MEMORY
  722. //#define DEBUG_ADVANCE
  723. /** \brief print ops related debug info. */
  724. //#define DEBUG_OPS
  725. /** If enabled, writes the created generic table to serial port at startup. */
  726. //#define DEBUG_GENERIC
  727. /** If enabled, steps to move and moved steps are compared. */
  728. //#define DEBUG_STEPCOUNT
  729. // Uncomment the following line to enable debugging. You can better control debugging below the following line
  730. //#define DEBUG
  731. // ####################################################################################
  732. // # Below this line only for experts #
  733. // ####################################################################################
  734.  
  735.  
  736. // ####################################################################################
  737. // # No configuration below this line - just some errorchecking #
  738. // ####################################################################################
  739. #ifdef SUPPORT_MAX6675
  740. #if !defined SCK_PIN || !defined MOSI_PIN || !defined MISO_PIN
  741. #error For MAX6675 support, you need to define SCK_PIN, MISO_PIN and MOSI_PIN in pins.h
  742. #endif
  743. #endif
  744. #if X_STEP_PIN<0 || Y_STEP_PIN<0 || Z_STEP_PIN<0
  745. #error One of the following pins is not assigned: X_STEP_PIN,Y_STEP_PIN,Z_STEP_PIN
  746. #endif
  747. #if EXT0_STEP_PIN<0
  748. #error EXT0_STEP_PIN not set to a pin number.
  749. #endif
  750. #if EXT0_DIR_PIN<0
  751. #error EXT0_DIR_PIN not set to a pin number.
  752. #endif
  753. #if MOVE_CACHE_SIZE<4
  754. #error MOVE_CACHE_SIZE must be at least 5
  755. #endif
  756. #if OUTPUT_BUFFER_SIZE>250 || OUTPUT_BUFFER_SIZE<16
  757. #error OUTPUT_BUFFER_SIZE must be in range 16..250
  758. #endif
  759. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement