Advertisement
bld

Untitled

bld
Mar 30th, 2012
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.33 KB | None | 0 0
  1. #ifndef CONFIGURATION_H
  2. #define CONFIGURATION_H
  3.  
  4. // BASIC SETTINGS: select your board type, thermistor type, axis scaling, and endstop configuration
  5.  
  6. //// The following define selects which electronics board you have. Please choose the one that matches your setup
  7. // MEGA/RAMPS up to 1.2 = 3,
  8. // RAMPS 1.3/1.4 = 33
  9. // Gen6 = 5,
  10. // Sanguinololu up to 1.1 = 6
  11. // Sanguinololu 1.2 and above = 62
  12. // Gen 7 @ 16MHZ only= 7
  13. // Gen 7 @ 20MHZ only= 71
  14. // Teensylu (at90usb) = 8
  15. // Printrboard Rev. B (ATMEGA90USB1286) = 9
  16. // Gen 3 Plus = 21
  17. // gen 3 Monolithic Electronics = 22
  18. // Gen3 PLUS for TechZone Gen3 Remix Motherboard = 23
  19. #define MOTHERBOARD 33
  20.  
  21. //// Thermistor settings:
  22. // 1 is 100k thermistor
  23. // 2 is 200k thermistor
  24. // 3 is mendel-parts thermistor
  25. // 4 is 10k thermistor
  26. // 5 is ParCan supplied 104GT-2 100K
  27. // 6 is EPCOS 100k
  28. // 7 is 100k Honeywell thermistor 135-104LAG-J01
  29. #define THERMISTORHEATER 5
  30. #define THERMISTORBED 2
  31.  
  32. //// Calibration variables
  33. // X, Y, Z, E steps per unit - Metric Prusa Mendel with Wade extruder:
  34. #define _AXIS_STEP_PER_UNIT {80.376, 80.376, 3200/1.25, 1915.306}
  35. // Metric Prusa Mendel with Makergear geared stepper extruder:
  36. //#define _AXIS_STEP_PER_UNIT {80,80,3200/1.25,1380}
  37. // MakerGear Hybrid Prusa Mendel:
  38. // Z axis value is for .9 stepper(if you have 1.8 steppers for Z, you need to use 2272.7272)
  39. //#define _AXIS_STEP_PER_UNIT {104.987, 104.987, 4545.4544, 1487}
  40.  
  41.  
  42. //// Endstop Settings
  43. //#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
  44. // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
  45. //If your axes are only moving in one direction, make sure the endstops are connected properly.
  46. //If your axes move in one direction ONLY when the endstops are triggered, set [XYZ]_ENDSTOP_INVERT to true here:
  47. const bool X_ENDSTOP_INVERT = true;
  48. const bool Y_ENDSTOP_INVERT = true;
  49. const bool Z_ENDSTOP_INVERT = true;
  50.  
  51. // This determines the communication speed of the printer
  52. //#define BAUDRATE 115200
  53. #define BAUDRATE 250000
  54.  
  55. // Comment out (using // at the start of the line) to disable SD support:
  56. //#define SDSUPPORT
  57.  
  58. // Uncomment to make run init.g from SD on boot
  59. //#define SDINITFILE
  60.  
  61. //Only work with Atmega1284 you need +1 kb ram
  62. //#define SD_FAST_XFER_AKTIV
  63.  
  64. //-----------------------------------------------------------------------
  65. //// STORE SETTINGS TO EEPROM
  66. //-----------------------------------------------------------------------
  67. // the microcontroller can store settings in the EEPROM
  68. // M500 - stores paramters in EEPROM
  69. // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
  70. // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
  71. // M503 - Print settings
  72. // define this to enable eeprom support
  73. //#define USE_EEPROM_SETTINGS
  74.  
  75. // to disable EEPROM Serial responses and decrease program space by ~1000 byte: comment this out:
  76. // please keep turned on if you can.
  77. //#define PRINT_EEPROM_SETTING
  78.  
  79. //-----------------------------------------------------------------------
  80. //// ARC Function (G2/G3 Command)
  81. //-----------------------------------------------------------------------
  82. //Uncomment to aktivate the arc (circle) function (G2/G3 Command)
  83. //Without SD function an ARC function the used Flash is smaller 31 kb
  84. #define USE_ARC_FUNCTION
  85.  
  86. //-----------------------------------------------------------------------
  87. //// ADVANCED SETTINGS - to tweak parameters
  88. //-----------------------------------------------------------------------
  89.  
  90. #ifdef SDSUPPORT
  91. #ifdef SD_FAST_XFER_AKTIV
  92. //Fast transfer chunk size (> 1024 is unstable, change at your own risk).
  93. #define SD_FAST_XFER_CHUNK_SIZE 1024
  94. #endif
  95. #endif
  96.  
  97. //-----------------------------------------------------------------------
  98. // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
  99. //-----------------------------------------------------------------------
  100. #define X_ENABLE_ON 0
  101. #define Y_ENABLE_ON 0
  102. #define Z_ENABLE_ON 0
  103. #define E_ENABLE_ON 0
  104.  
  105. //Uncomment if you have problems with a stepper driver enabeling too late, this will also set how many microseconds delay there will be after enabeling the driver
  106. #define DELAY_ENABLE 15
  107.  
  108. //Uncomment if you have problems with the stepper driver for Z overheating from being enabled too early
  109. #define LATE_Z_ENABLE 1
  110.  
  111. //-----------------------------------------------------------------------
  112. // Disables axis when it's not being used.
  113. //-----------------------------------------------------------------------
  114. const bool DISABLE_X = false;
  115. const bool DISABLE_Y = false;
  116. const bool DISABLE_Z = true;
  117. const bool DISABLE_E = false;
  118.  
  119. //-----------------------------------------------------------------------
  120. // Inverting axis direction
  121. //-----------------------------------------------------------------------
  122. const bool INVERT_X_DIR = false;
  123. const bool INVERT_Y_DIR = true;
  124. const bool INVERT_Z_DIR = true;
  125. const bool INVERT_E_DIR = false;
  126.  
  127. //-----------------------------------------------------------------------
  128. //// ENDSTOP SETTINGS:
  129. //-----------------------------------------------------------------------
  130. // Sets direction of endstops when homing; 1=MAX, -1=MIN
  131. #define X_HOME_DIR -1
  132. #define Y_HOME_DIR -1
  133. #define Z_HOME_DIR -1
  134.  
  135. //#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
  136.  
  137. const bool min_software_endstops = false; //If true, axis won't move to coordinates less than zero.
  138. const bool max_software_endstops = true; //If true, axis won't move to coordinates greater than the defined lengths below.
  139.  
  140.  
  141. //-----------------------------------------------------------------------
  142. //Max Length for Prusa Mendel, check the ways of your axis and set this Values
  143. //-----------------------------------------------------------------------
  144. const int X_MAX_LENGTH = 200;
  145. const int Y_MAX_LENGTH = 200;
  146. const int Z_MAX_LENGTH = 110;
  147.  
  148. //-----------------------------------------------------------------------
  149. //// MOVEMENT SETTINGS
  150. //-----------------------------------------------------------------------
  151. const int NUM_AXIS = 4; // The axis order in all axis related arrays is X, Y, Z, E
  152. #define _MAX_FEEDRATE {400, 400, 3, 15} // (mm/sec)
  153. #define _HOMING_FEEDRATE {1500,1500,150} // (mm/min) !!
  154. #define _AXIS_RELATIVE_MODES {false, false, false, false}
  155.  
  156. #define MAX_STEP_FREQUENCY 30000 // Max step frequency
  157.  
  158.  
  159. //-----------------------------------------------------------------------
  160. //// Not used at the Moment
  161. //-----------------------------------------------------------------------
  162.  
  163. // Min step delay in microseconds. If you are experiencing missing steps, try to raise the delay microseconds, but be aware this
  164. // If you enable this, make sure STEP_DELAY_RATIO is disabled.
  165. //#define STEP_DELAY_MICROS 1
  166.  
  167. // Step delay over interval ratio. If you are still experiencing missing steps, try to uncomment the following line, but be aware this
  168. // If you enable this, make sure STEP_DELAY_MICROS is disabled. (except for Gen6: both need to be enabled.)
  169. //#define STEP_DELAY_RATIO 0.25
  170.  
  171. ///Oscillation reduction. Forces x,y,or z axis to be stationary for ## ms before allowing axis to switch direcitons. Alternative method to prevent skipping steps. Uncomment the line below to activate.
  172. //#define RAPID_OSCILLATION_REDUCTION
  173. #ifdef RAPID_OSCILLATION_REDUCTION
  174. long min_time_before_dir_change = 30; //milliseconds
  175. #endif
  176.  
  177. //-----------------------------------------------------------------------
  178. //// Acceleration settings
  179. //-----------------------------------------------------------------------
  180. // 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.
  181. #define _ACCELERATION 1000 // Axis Normal acceleration mm/s^2
  182. #define _RETRACT_ACCELERATION 150 // Extruder Normal acceleration mm/s^2
  183. #define _MAX_XY_JERK 20.0
  184. #define _MAX_Z_JERK 0.4
  185. #define _MAX_START_SPEED_UNITS_PER_SECOND {25.0,25.0,0.2,2.0}
  186. #define _MAX_ACCELERATION_UNITS_PER_SQ_SECOND {5000,5000,50,500} // X, Y, Z and E max acceleration in mm/s^2 for printing moves or retracts
  187.  
  188.  
  189. // Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
  190. // of the buffer and all stops. This should not be much greater than zero and should only be changed
  191. // if unwanted behavior is observed on a user's machine when running at very slow speeds.
  192. #define MINIMUM_PLANNER_SPEED 2.0 // (mm/sec)
  193.  
  194. #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
  195. #define DEFAULT_MINTRAVELFEEDRATE 0.0
  196.  
  197. // If defined the movements slow down when the look ahead buffer is only half full
  198. #define SLOWDOWN
  199.  
  200.  
  201. const int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
  202.  
  203. //-----------------------------------------------------------------------
  204. // Machine UUID
  205. //-----------------------------------------------------------------------
  206. // This may be useful if you have multiple machines and wish to identify them by using the M115 command.
  207. // By default we set it to zeros.
  208. #define _DEF_CHAR_UUID "00000000-0000-0000-0000-000000000000"
  209.  
  210.  
  211.  
  212. //-----------------------------------------------------------------------
  213. //// Planner buffer Size
  214. //-----------------------------------------------------------------------
  215.  
  216. // The number of linear motions that can be in the plan at any give time
  217. // if the SD Card need to much memory reduce the Values for Plannerpuffer (base of 2)
  218. #ifdef SDSUPPORT
  219. #define BLOCK_BUFFER_SIZE 16
  220. #define BLOCK_BUFFER_MASK 0x0f
  221. #else
  222. #define BLOCK_BUFFER_SIZE 16
  223. #define BLOCK_BUFFER_MASK 0x0f
  224. #endif
  225.  
  226. //-----------------------------------------------------------------------
  227. //// SETTINGS FOR ARC FUNCTION (Command G2/G2)
  228. //-----------------------------------------------------------------------
  229.  
  230. // Arc interpretation settings:
  231. //Step to split a cirrcle in small Lines
  232. #define MM_PER_ARC_SEGMENT 1
  233. //After this count of steps a new SIN / COS caluclation is startet to correct the circle interpolation
  234. #define N_ARC_CORRECTION 25
  235.  
  236. //-----------------------------------------------------------------------
  237. //// HEATERCONTROL AND PID PARAMETERS
  238. //-----------------------------------------------------------------------
  239.  
  240. //Testfunction to adjust the Hotend temperatur in case of Printingspeed
  241. //If the Printer print slow the Temp is going to AUTO_TEMP_MIN
  242. //At the moment this Value dont change the targettemp from the Hotend
  243. //The result of this function is only send with the Temperaturerequest to the host
  244. //#define AUTOTEMP
  245. #ifdef AUTOTEMP
  246. #define AUTO_TEMP_MAX 240
  247. #define AUTO_TEMP_MIN 205
  248. #define AUTO_TEMP_FACTOR 0.025
  249. #define AUTOTEMP_OLDWEIGHT 0.98
  250. #endif
  251.  
  252. //// AD595 THERMOCOUPLE SUPPORT UNTESTED... USE WITH CAUTION!!!!
  253.  
  254. //// PID settings:
  255. // Uncomment the following line to enable PID support. This is untested and could be disastrous. Be careful.
  256. #define PIDTEMP 1
  257. #ifdef PIDTEMP
  258. //Sanguinololu 1.2 and above, the PWM Output Hotend Timer 1 is used for the Hardware PWM
  259. //but in this Software use Timer1 for the Stepperfunction so it is not possible to use the "analogWrite" function.
  260. //This Soft PWM use Timer 2 with 400 Hz to drive the PWM for the hotend
  261. #define PID_SOFT_PWM
  262.  
  263. //Measure the MIN/MAX Value of the Hotend Temp and show it with
  264. //Command M601 / Command M602 Reset the MIN/MAX Value
  265. //#define DEBUG_HEATER_TEMP
  266.  
  267. //PID Controler Settings
  268. #define PID_INTEGRAL_DRIVE_MAX 80 // too big, and heater will lag after changing temperature, too small and it might not compensate enough for long-term errors
  269. #define PID_PGAIN 18.84 //2560 //256 is 1.0 // value of X means that error of 1 degree is changing PWM duty by X, probably no need to go over 25
  270. #define PID_IGAIN 0.43 //64 //256 is 1.0 // value of X (e.g 0.25) means that each degree error over 1 sec (2 measurements) changes duty cycle by 2X (=0.5) units (verify?)
  271. #define PID_DGAIN 276.58 //4096 //256 is 1.0 // value of X means that around reached setpoint, each degree change over one measurement (half second) adjusts PWM by X units to compensate
  272.  
  273. // magic formula 1, to get approximate "zero error" PWM duty. Take few measurements with low PWM duty and make linear fit to get the formula
  274. // for my makergear hot-end: linear fit {50,10},{60,20},{80,30},{105,50},{176,100},{128,64},{208,128}
  275. #define HEATER_DUTY_FOR_SETPOINT(setpoint) ((int)((187L*(long)setpoint)>>8)-27)
  276. // magic formula 2, to make led brightness approximately linear
  277. #define LED_PWM_FOR_BRIGHTNESS(brightness) ((64*brightness-1384)/(300-brightness))
  278. #endif
  279.  
  280. // Change this value (range 1-255) to limit the current to the nozzle
  281. #define HEATER_CURRENT 255
  282.  
  283. // How often should the heater check for new temp readings, in milliseconds
  284. #define HEATER_CHECK_INTERVAL 500
  285. #define BED_CHECK_INTERVAL 5000
  286.  
  287. // Comment the following line to enable heat management during acceleration
  288. #define DISABLE_CHECK_DURING_ACC
  289. #ifndef DISABLE_CHECK_DURING_ACC
  290. // Uncomment the following line to disable heat management during moves
  291. //#define DISABLE_CHECK_DURING_MOVE
  292. #endif
  293.  
  294. // Uncomment the following line to disable heat management during travel moves (and extruder-only moves, eg: retracts), strongly recommended if you are missing steps mid print.
  295. // Probably this should remain commented if are using PID.
  296. // It also defines the max milliseconds interval after which a travel move is not considered so for the sake of this feature.
  297. #define DISABLE_CHECK_DURING_TRAVEL 1000
  298.  
  299. //// Temperature smoothing - only uncomment this if your temp readings are noisy (Gen6 without EvdZ's 5V hack)
  300. //#define SMOOTHING
  301. //#define SMOOTHFACTOR 16 //best to use a power of two here - determines how many values are averaged together by the smoothing algorithm
  302.  
  303.  
  304. //// Experimental watchdog and minimal temp
  305. // The watchdog waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
  306. // 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
  307. //#define WATCHPERIOD 5000 //5 seconds
  308.  
  309. // Actual temperature must be close to target for this long before M109 returns success
  310. //#define TEMP_RESIDENCY_TIME 20 // (seconds)
  311. //#define TEMP_HYSTERESIS 5 // (C°) range of +/- temperatures considered "close" to the target one
  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. // Select one of these only to define how the nozzle temp is read.
  323. #define HEATER_USES_THERMISTOR
  324. //#define HEATER_USES_AD595
  325. //#define HEATER_USES_MAX6675
  326.  
  327. // Select one of these only to define how the bed temp is read.
  328. #define BED_USES_THERMISTOR
  329. //#define BED_USES_AD595
  330.  
  331. //This is for controlling a fan to cool down the stepper drivers
  332. //it will turn on when any driver is enabled
  333. //and turn off after the set amount of seconds from last driver being disabled again
  334. //#define CONTROLLERFAN_PIN 23 //Pin used for the fan to cool controller, comment out to disable this function
  335. #define CONTROLLERFAN_SEC 60 //How many seconds, after all motors were disabled, the fan should run
  336.  
  337.  
  338. //-----------------------------------------------------------------------
  339. // DEBUGING
  340. //-----------------------------------------------------------------------
  341.  
  342.  
  343. //Uncomment this to see on the host if a wrong or unknown Command is recived
  344. //Only for Testing !!!
  345. //#define SEND_WRONG_CMD_INFO
  346.  
  347. // Uncomment the following line to enable debugging. You can better control debugging below the following line
  348. //#define DEBUG
  349. #ifdef DEBUG
  350. //#define DEBUG_PREPARE_MOVE //Enable this to debug prepare_move() function
  351. //#define DEBUG_MOVE_TIME //Enable this to time each move and print the result
  352. //#define DEBUG_HEAT_MGMT //Enable this to debug heat management. WARNING, this will cause axes to jitter!
  353. //#define DEBUG_DISABLE_CHECK_DURING_TRAVEL //Debug the namesake feature, see above in this file
  354. #endif
  355.  
  356. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement