Advertisement
Guest User

Movement & Delta settings

a guest
Jun 14th, 2016
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 11.87 KB | None | 0 0
  1. // ##########################################################################################
  2. // ##                           Movement settings                                          ##
  3. // ##########################################################################################
  4.  
  5. // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. Currently only works for RAMBO boards
  6. #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
  7.  
  8. #define FEATURE_BABYSTEPPING 1
  9. #define BABYSTEP_MULTIPLICATOR 1
  10.  
  11. /** \brief Number of segments to generate for delta conversions per second of move
  12. */
  13. #define DELTA_SEGMENTS_PER_SECOND_PRINT 180 // Move accurate setting for print moves
  14. #define DELTA_SEGMENTS_PER_SECOND_MOVE 70 // Less accurate setting for other moves
  15.  
  16. /** 1 for more precise delta moves. 0 for faster computation.
  17. Needs a bit more computation time. */
  18. #define EXACT_DELTA_MOVES 1
  19.  
  20. /** \brief Delta rod length (mm)
  21. */
  22. #define DELTA_DIAGONAL_ROD 304 // mm
  23.  
  24. /*  =========== Parameter essential for delta calibration ===================
  25.  
  26.             C, Y-Axis
  27.             |                        |___| CARRIAGE_HORIZONTAL_OFFSET (recommend set it to 0)
  28.             |                        |   \------------------------------------------
  29.             |_________ X-axis        |    \                                        |
  30.            / \                       |     \  DELTA_DIAGONAL_ROD (length)    Each move this Rod Height
  31.           /   \                             \                                 is calculated
  32.          /     \                             \    Carriage is at printer center!   |
  33.          A      B                             \_____/--------------------------------
  34.                                               |--| END_EFFECTOR_HORIZONTAL_OFFSET (recommend set it to 0)
  35.                                          |----| ROD_RADIUS (Horizontal rod pivot to pivot measure)
  36.                                      |-----------| PRINTER_RADIUS (recommend set it to ROD_RADIUS)
  37.  
  38.     Column angles are measured from X-axis counterclockwise
  39.     "Standard" positions: alpha_A = 210, alpha_B = 330, alpha_C = 90
  40. */
  41.  
  42. /** \brief column positions - change only to correct build imperfections! */
  43. #define DELTA_ALPHA_A 210
  44. #define DELTA_ALPHA_B 330
  45. #define DELTA_ALPHA_C 90
  46.  
  47. /** Correct radius by this value for each column. Perfect builds have 0 everywhere. */
  48. #define DELTA_RADIUS_CORRECTION_A 0
  49. #define DELTA_RADIUS_CORRECTION_B 0
  50. #define DELTA_RADIUS_CORRECTION_C 0
  51.  
  52. /** Correction of the default diagonal size. Value gets added.*/
  53. #define DELTA_DIAGONAL_CORRECTION_A 0
  54. #define DELTA_DIAGONAL_CORRECTION_B 0
  55. #define DELTA_DIAGONAL_CORRECTION_C 0
  56.  
  57. /** \brief Horizontal offset of the universal joints on the end effector (moving platform).
  58. */
  59. #define END_EFFECTOR_HORIZONTAL_OFFSET 35
  60.  
  61. /** \brief Horizontal offset of the universal joints on the vertical carriages.
  62. */
  63. #define CARRIAGE_HORIZONTAL_OFFSET 32
  64.  
  65. /** Max. radius (mm) the printer should be able to reach. */
  66. #define DELTA_MAX_RADIUS 95
  67.  
  68. //Horizontal rod pivot to pivot measure
  69. #define ROD_RADIUS 180
  70.  
  71. /** \brief Printer radius in mm,
  72.   measured from the center of the print area to the vertical smooth tower.
  73.   Alternately set this to the pivot to pivot horizontal rod distance, when head is at (0,0)
  74. */
  75. #define PRINTER_RADIUS 180
  76.  
  77.  
  78. /** When true the delta will home to z max when reset/powered over cord. That way you start with well defined coordinates.
  79. If you don't do it, make sure to home first before your first move.
  80. */
  81. #define DELTA_HOME_ON_POWER 0
  82. #define STEP_COUNTER
  83.  
  84. /** To allow software correction of misaligned endstops, you can set the correction in steps here. If you have EEPROM enabled
  85. you can also change the values online and autoleveling will store the results here. */
  86. #define DELTA_X_ENDSTOP_OFFSET_STEPS 0
  87. #define DELTA_Y_ENDSTOP_OFFSET_STEPS 0
  88. #define DELTA_Z_ENDSTOP_OFFSET_STEPS 0
  89.  
  90. // Margin (mm) to avoid above tower minimum (xMin xMinsteps)
  91. // If your printer can put its carriage low enough the rod is horizontal without hitting the floor
  92. // set this to zero. Otherwise, measure how high the carriage is from horizontal rod
  93. // Also, movement speeds are 10x to 20x cartesian speeds at tower bottom.
  94. // You may need to leave a few mm for safety.
  95. // Hitting floor at high speed can damage your printer (motors, drives, etc)
  96. // THIS MAY NEED UPDATING IF THE HOT END HEIGHT CHANGES!
  97. #define DELTA_FLOOR_SAFETY_MARGIN_MM 15
  98. //#define SOFTWARE_LEVELING
  99.  
  100.  
  101. /** \brief Number of delta moves in each line. Moves that exceed this figure will be split into multiple lines.
  102. Increasing this figure can use a lot of memory since 7 bytes * size of line buffer * MAX_SELTA_SEGMENTS_PER_LINE
  103. will be allocated for the delta buffer.
  104. PrintLine PrintLine::lines[PRINTLINE_CACHE_SIZE (default 16?)];
  105. Printline is about 200 bytes + 7 * DELTASEGMENTS_PER_PRINTLINE
  106. or 16 * (200 + (7*22=154) = 354) = 5664 bytes! !1
  107. min is 5 * (200 + (7*10=70) =270) = 1350
  108.  This leaves ~1K free RAM on an Arduino which has only 8k
  109. Mega. Used only for nonlinear systems like delta or tuga. */
  110. #define DELTASEGMENTS_PER_PRINTLINE 22
  111.  
  112. /** After x seconds of inactivity, the stepper motors are disabled.
  113.     Set to 0 to leave them enabled.
  114.     This helps cooling the Stepper motors between two print jobs.
  115.     Overridden if EEPROM activated.
  116. */
  117. #define STEPPER_INACTIVE_TIME 360
  118.  
  119. /** After x seconds of inactivity, the system will go down as far it can.
  120.     It will at least disable all stepper motors and heaters. If the board has
  121.     a power pin, it will be disabled, too.
  122.     Set value to 0 for disabled.
  123.     Overridden if EEPROM activated.
  124. */
  125. #define MAX_INACTIVE_TIME 0L
  126.  
  127. /** Maximum feedrate, the system allows. Higher feedrates are reduced to these values.
  128.     The axis order in all axis related arrays is X, Y, Z
  129.      Overridden if EEPROM activated.
  130.     */
  131. #define MAX_FEEDRATE_X 200//500
  132. #define MAX_FEEDRATE_Y 200//500
  133. #define MAX_FEEDRATE_Z 200//500
  134.  
  135. /** Home position speed in mm/s. Overridden if EEPROM activated. */
  136. #define HOMING_FEEDRATE_X 50 //200
  137. #define HOMING_FEEDRATE_Y 50 //200
  138. #define HOMING_FEEDRATE_Z 50  //200
  139.  
  140. /** Set order of axis homing. Use HOME_ORDER_XYZ and replace XYZ with your order.
  141.  * If you measure Z with your extruder tip you need a hot extruder to get right measurement. In this
  142.  * case set HOME_ORDER_ZXYTZ and also define ZHOME_HEAT_HEIGHT and ZHOME_MIN_TEMPERATURE. It will do
  143.  * first a z home to get some reference, then raise to ZHOME_HEAT_HEIGHT do xy homing and then after
  144.  * heating to minimum ZHOME_MIN_TEMPERATURE will z home again for correct height.
  145.  * */
  146. #define HOMING_ORDER HOME_ORDER_ZXY
  147. // Used for homing order HOME_ORDER_ZXYTZ
  148. #define ZHOME_MIN_TEMPERATURE 0
  149. // needs to heat all extruders (1) or only current extruder (0)
  150. #define ZHOME_HEAT_ALL 1
  151. // Z-height for heating extruder during homing
  152. #define ZHOME_HEAT_HEIGHT 20
  153.  
  154. #define ZHOME_X_POS 0
  155. #define ZHOME_Y_POS 0
  156.  
  157. /* If you have a backlash in both z-directions, you can use this. For most printer, the bed will be pushed down by it's
  158. own weight, so this is nearly never needed. */
  159. #define ENABLE_BACKLASH_COMPENSATION 0
  160. #define X_BACKLASH 0
  161. #define Y_BACKLASH 0
  162. #define Z_BACKLASH 0
  163.  
  164. /** Comment this to disable ramp acceleration */
  165. #define RAMP_ACCELERATION 1
  166.  
  167. /** If your stepper needs a longer high signal then given, you can add a delay here.
  168. The delay is realized as a simple loop wasting time, which is not available for other
  169. computations. So make it as low as possible. For the most common drivers no delay is needed, as the
  170. included delay is already enough.
  171. */
  172. #define STEPPER_HIGH_DELAY 2
  173.  
  174. /** If your driver needs some additional delay between setting direction and first step signal,
  175.  you can set this here. There are some commands between direction and signal, but some drivers
  176.  might be even slower or you are using a fast Arduino board with slow driver. Normally 0 works.
  177.  If you get skewed print, you might try 1 microsecond here.
  178.  */
  179. #define DIRECTION_DELAY 0
  180.  
  181. /** The firmware can only handle 16000Hz interrupt frequency cleanly. If you need higher speeds
  182. a faster solution is needed, and this is to double/quadruple the steps in one interrupt call.
  183. This is like reducing your 1/16th microstepping to 1/8 or 1/4. It is much cheaper then 1 or 3
  184. additional stepper interrupts with all it's overhead. As a result you can go as high as
  185. 40000Hz.
  186. */
  187. #define STEP_DOUBLER_FREQUENCY 12000
  188.  
  189. /** If you need frequencies off more then 30000 you definitely need to enable this. If you have only 1/8 stepping
  190. enabling this may cause to stall your moves when 20000Hz is reached.
  191. */
  192. #define ALLOW_QUADSTEPPING 0
  193.  
  194. /** If you reach STEP_DOUBLER_FREQUENCY the firmware will do 2 or 4 steps with nearly no delay. That can be too fast
  195. for some printers causing an early stall.
  196. */
  197. #define DOUBLE_STEP_DELAY 1 // time in microseconds
  198.  
  199. /** \brief X, Y, Z max acceleration in mm/s^2 for printing moves or retracts. Make sure your printer can go that high!
  200.  Overridden if EEPROM activated.
  201. */
  202. #define MAX_ACCELERATION_UNITS_PER_SQ_SECOND_X 2000
  203. #define MAX_ACCELERATION_UNITS_PER_SQ_SECOND_Y 2000
  204. #define MAX_ACCELERATION_UNITS_PER_SQ_SECOND_Z 100
  205.  
  206. /** \brief X, Y, Z max acceleration in mm/s^2 for travel moves.  Overridden if EEPROM activated.*/
  207. #define MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND_X 3000
  208. #define MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND_Y 3000
  209. #define MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND_Z 100
  210.  
  211. /** If you print on a moving bed, it can become more shaky the higher and bigger
  212.  your print gets. Therefore it might be helpfull to reduce acceleration with
  213.  increasing print height. You can define here how acceleration should change.
  214.  You set ACCELERATION_FACTOR_TOP to the factor in percent for the top position
  215.  of your printer. Acceleration will then be modified linear over height.
  216.  INTERPOLATE_ACCELERATION_WITH_Z sets, which accelerations get changed:
  217.  0 = do not interpolate at all
  218.  1 = interpolate x and y acceleration
  219.  2 = interpolate z acceleration
  220.  3 = interpolate x,y and z acceleration
  221.   */
  222. #define INTERPOLATE_ACCELERATION_WITH_Z 0
  223. #define ACCELERATION_FACTOR_TOP 100
  224.  
  225. /** \brief Maximum allowable jerk.
  226.  
  227. Caution: This is no real jerk in a physical meaning.
  228.  
  229. The jerk determines your start speed and the maximum speed at the join of two segments.
  230. Its unit is mm/s. If the printer is standing still, the start speed is jerk/2. At the
  231. join of two segments, the speed difference is limited to the jerk value.
  232.  
  233. Examples:
  234. For all examples jerk is assumed as 40.
  235.  
  236. Segment 1: vx = 50, vy = 0
  237. Segment 2: vx = 0, vy = 50
  238. v_diff = sqrt((50-0)^2+(0-50)^2) = 70.71
  239. v_diff > jerk => vx_1 = vy_2 = jerk/v_diff*vx_1 = 40/70.71*50 = 28.3 mm/s at the join
  240.  
  241. Segment 1: vx = 50, vy = 0
  242. Segment 2: vx = 35.36, vy = 35.36
  243. v_diff = sqrt((50-35.36)^2+(0-35.36)^2) = 38.27 < jerk
  244. Corner can be printed with full speed of 50 mm/s
  245.  
  246. Overridden if EEPROM activated.
  247. */
  248. #define MAX_JERK 20
  249. #define MAX_ZJERK 0.3
  250.  
  251. /** \brief Number of moves we can cache in advance.
  252. This number of moves can be cached in advance. If you wan't to cache more, increase this. Especially on
  253. many very short moves the cache may go empty. The minimum value is 5.
  254. */
  255. #define PRINTLINE_CACHE_SIZE 12
  256.  
  257. /** \brief Low filled cache size.
  258.  
  259. If the cache contains less then MOVE_CACHE_LOW segments, the time per segment is limited to LOW_TICKS_PER_MOVE clock cycles.
  260. If a move would be shorter, the feedrate will be reduced. This should prevent buffer underflows. Set this to 0 if you
  261. don't care about empty buffers during print.
  262. */
  263. #define MOVE_CACHE_LOW 10
  264.  
  265. /** \brief Cycles per move, if move cache is low.
  266.  
  267. 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
  268. if you are printing many very short segments at high speed. Higher delays here allow higher values in PATH_PLANNER_CHECK_SEGMENTS.
  269. */
  270. #define LOW_TICKS_PER_MOVE 250000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement