Advertisement
Rickybk

Configuration.h

Feb 7th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 9.67 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 = 33
  9. // Gen6 = 5,
  10. // Sanguinololu up to 1.1 = 6
  11. // Sanguinololu 1.2 and above = 62
  12. // Teensylu (at90usb) = 8
  13. // Gen 3 Plus = 21
  14. // gen 3  Monolithic Electronics = 22
  15. // Gen3 PLUS for TechZone Gen3 Remix Motherboard = 23
  16. #define MOTHERBOARD 33
  17.  
  18. //// Thermistor settings:
  19. // 1 is 100k thermistor
  20. // 2 is 200k thermistor
  21. // 3 is mendel-parts thermistor
  22. // 4 is 10k thermistor
  23. // 5 is ParCan supplied 104GT-2 100K
  24. // 6 is EPCOS 100k
  25. // 7 is 100k Honeywell thermistor 135-104LAG-J01
  26. #define THERMISTORHEATER 7
  27. #define THERMISTORBED 2
  28.  
  29. //// Calibration variables
  30. // X, Y, Z, E steps per unit - Metric Prusa Mendel with Wade extruder:
  31. float axis_steps_per_unit[] = {80, 80, 2560,777.6};
  32. //float axis_steps_per_unit[] = {5, 5, 2560,568.18};
  33. // Metric Prusa Mendel with Makergear geared stepper extruder:
  34. //float axis_steps_per_unit[] = {80,80,3200/1.25,1380};
  35. // MakerGear Hybrid Prusa Mendel:
  36. // Z axis value is for .9 stepper(if you have 1.8 steppers for Z, you need to use 2272.7272)
  37. //float axis_steps_per_unit[] = {104.987, 104.987, 4545.4544, 1487};
  38.  
  39. //// Endstop Settings
  40. #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
  41. // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
  42. //If your axes are only moving in one direction, make sure the endstops are connected properly.
  43. //If your axes move in one direction ONLY when the endstops are triggered, set [XYZ]_ENDSTOP_INVERT to true here:
  44. const bool X_ENDSTOP_INVERT = true;
  45. const bool Y_ENDSTOP_INVERT = true;
  46. const bool Z_ENDSTOP_INVERT = true;
  47.  
  48. // This determines the communication speed of the printer
  49. #define BAUDRATE 115200
  50.  
  51. // Comment out (using // at the start of the line) to disable SD support:
  52. //#define SDSUPPORT
  53. // Uncomment to make Sprinter run init.g from SD on boot
  54. //#define SDINITFILE
  55.  
  56.  
  57. //// ADVANCED SETTINGS - to tweak parameters
  58.  
  59. #include "thermistortables.h"
  60.  
  61. // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
  62. #define X_ENABLE_ON 0
  63. #define Y_ENABLE_ON 0
  64. #define Z_ENABLE_ON 0
  65. #define E_ENABLE_ON 0
  66.  
  67. // Disables axis when it's not being used.
  68. const bool DISABLE_X = false;
  69. const bool DISABLE_Y = false;
  70. const bool DISABLE_Z = true;
  71. const bool DISABLE_E = false;
  72.  
  73. // Inverting axis direction
  74. const bool INVERT_X_DIR = false;
  75. const bool INVERT_Y_DIR = false;
  76. const bool INVERT_Z_DIR = true;
  77. const bool INVERT_E_DIR = false;
  78.  
  79. //// ENDSTOP SETTINGS:
  80. // Sets direction of endstops when homing; 1=MAX, -1=MIN
  81. #define X_HOME_DIR -1
  82. #define Y_HOME_DIR -1
  83. #define Z_HOME_DIR -1
  84.  
  85. const bool min_software_endstops = false; //If true, axis won't move to coordinates less than zero.
  86. const bool max_software_endstops = true;  //If true, axis won't move to coordinates greater than the defined lengths below.
  87. const int X_MAX_LENGTH = 200;
  88. const int Y_MAX_LENGTH = 200;
  89. const int Z_MAX_LENGTH = 100;
  90.  
  91. //// MOVEMENT SETTINGS
  92. const int NUM_AXIS = 4; // The axis order in all axis related arrays is X, Y, Z, E
  93. float max_feedrate[] = {200000, 200000, 240, 500000};
  94. float homing_feedrate[] = {1500,1500,120};
  95. bool axis_relative_modes[] = {false, false, false, false};
  96.  
  97. // Min step delay in microseconds. If you are experiencing missing steps, try to raise the delay microseconds, but be aware this
  98. // If you enable this, make sure STEP_DELAY_RATIO is disabled.
  99. //#define STEP_DELAY_MICROS 1
  100.  
  101. // Step delay over interval ratio. If you are still experiencing missing steps, try to uncomment the following line, but be aware this
  102. // If you enable this, make sure STEP_DELAY_MICROS is disabled. (except for Gen6: both need to be enabled.)
  103. //#define STEP_DELAY_RATIO 0.25
  104.  
  105. // Comment this to disable ramp acceleration
  106. //#define RAMP_ACCELERATION
  107.  
  108. //// Acceleration settings
  109. #ifdef RAMP_ACCELERATION
  110. // 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.
  111. float max_start_speed_units_per_second[] = {25.0,25.0,0.2,10.0};
  112. long max_acceleration_units_per_sq_second[] = {1000,1000,50,10000}; // X, Y, Z and E max acceleration in mm/s^2 for printing moves or retracts
  113. long max_travel_acceleration_units_per_sq_second[] = {500,500,50,500}; // X, Y, Z max acceleration in mm/s^2 for travel moves
  114. #endif
  115.  
  116. // Machine UUID
  117. // This may be useful if you have multiple machines and wish to identify them by using the M115 command.
  118. // By default we set it to zeros.
  119. char uuid[] = "0.2 SuperEstable - R2-RELOADED";
  120.  
  121.  
  122. //// AD595 THERMOCOUPLE SUPPORT UNTESTED... USE WITH CAUTION!!!!
  123.  
  124. //// PID settings:
  125. // Uncomment the following line to enable PID support. This is untested and could be disastrous. Be careful.
  126. //#define PIDTEMP 1
  127. #ifdef PIDTEMP
  128. #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
  129. #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
  130. #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?)
  131. #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
  132. // 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
  133. #define HEATER_DUTY_FOR_SETPOINT(setpoint) ((int)((187L*(long)setpoint)>>8)-27)  // for my makergear hot-end: linear fit {50,10},{60,20},{80,30},{105,50},{176,100},{128,64},{208,128}
  134. // magic formula 2, to make led brightness approximately linear
  135. #define LED_PWM_FOR_BRIGHTNESS(brightness) ((64*brightness-1384)/(300-brightness))
  136. #endif
  137.  
  138. // Change this value (range 1-255) to limit the current to the nozzle
  139. #define HEATER_CURRENT 255
  140.  
  141. // How often should the heater check for new temp readings, in milliseconds
  142. #define HEATER_CHECK_INTERVAL 500
  143. #define BED_CHECK_INTERVAL 5000
  144. // Comment the following line to enable heat management during acceleration
  145. #define DISABLE_CHECK_DURING_ACC
  146. #ifndef DISABLE_CHECK_DURING_ACC
  147.   // Uncomment the following line to disable heat management during moves
  148.   //#define DISABLE_CHECK_DURING_MOVE
  149. #endif
  150. // 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.
  151. // Probably this should remain commented if are using PID.
  152. // It also defines the max milliseconds interval after which a travel move is not considered so for the sake of this feature.
  153. #define DISABLE_CHECK_DURING_TRAVEL 1000
  154.  
  155. //// Temperature smoothing - only uncomment this if your temp readings are noisy (Gen6 without EvdZ's 5V hack)
  156. //#define SMOOTHING
  157. //#define SMOOTHFACTOR 16 //best to use a power of two here - determines how many values are averaged together by the smoothing algorithm
  158.  
  159. //// Experimental watchdog and minimal temp
  160. // The watchdog waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
  161. // 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
  162. //#define WATCHPERIOD 5000 //5 seconds
  163.  
  164. // Actual temperature must be close to target for this long before M109 returns success
  165. //#define TEMP_RESIDENCY_TIME 20  // (seconds)
  166. //#define TEMP_HYSTERESIS 5       // (CĀ°) range of +/- temperatures considered "close" to the target one
  167.  
  168. //// The minimal temperature defines the temperature below which the heater will not be enabled
  169. #define MINTEMP 5
  170.  
  171. //// Experimental max temp
  172. // When temperature exceeds max temp, your heater will be switched off.
  173. // This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
  174. // You should use MINTEMP for thermistor short/failure protection.
  175. #define MAXTEMP 275
  176.  
  177. // Select one of these only to define how the nozzle temp is read.
  178. #define HEATER_USES_THERMISTOR
  179. //#define HEATER_USES_AD595
  180. //#define HEATER_USES_MAX6675
  181.  
  182. // Select one of these only to define how the bed temp is read.
  183. #define BED_USES_THERMISTOR
  184. //#define BED_USES_AD595
  185.  
  186. //This is for controlling a fan to cool down the stepper drivers
  187. //it will turn on when any driver is enabled
  188. //and turn off after the set amount of seconds from last driver being disabled again
  189. //#define CONTROLLERFAN_PIN 23 //Pin used for the fan to cool controller, comment out to disable this function
  190. #define CONTROLLERFAN_SEC 60 //How many seconds, after all motors were disabled, the fan should run
  191.  
  192. // Uncomment the following line to enable debugging. You can better control debugging below the following line
  193. //#define DEBUG
  194. #ifdef DEBUG
  195.   //#define DEBUG_PREPARE_MOVE //Enable this to debug prepare_move() function
  196.   //#define DEBUG_BRESENHAM //Enable this to debug the Bresenham algorithm
  197.   //#define DEBUG_RAMP_ACCELERATION //Enable this to debug all constant acceleration info
  198.   //#define DEBUG_MOVE_TIME //Enable this to time each move and print the result
  199.   //#define DEBUG_HEAT_MGMT //Enable this to debug heat management. WARNING, this will cause axes to jitter!
  200.   //#define DEBUG_DISABLE_CHECK_DURING_TRAVEL //Debug the namesake feature, see above in this file
  201. #endif
  202.  
  203. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement