Advertisement
bld

Sprinter config with 26:1

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