Advertisement
Guest User

Z-Probe settings

a guest
Jun 14th, 2016
606
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.70 KB | None | 0 0
  1. // #################### Z-Probing #####################
  2.  
  3. /* After homing the z position is corrected to compensate
  4. for a bed coating. Since you can change coatings the value is stored in
  5. EEPROM if enabled, so you can switch between different coatings without needing
  6. to recalibrate z.
  7. */
  8. #define Z_PROBE_Z_OFFSET 0 // offset to coating form real bed level
  9.  
  10. /* How is z min measured
  11.  0 = trigger is height of real bed neglecting coating
  12.  1 = trigger is current coating
  13.  
  14.  For mode 1 the current coating thickness is added to measured z probe distances.
  15.  That way the real bed is always the reference height. For inductive sensors
  16.  or z min endstops the coating has no effect on the result, so you should use mode 0.
  17. */
  18. #define Z_PROBE_Z_OFFSET_MODE 0
  19.  
  20. #define UI_BED_COATING 1
  21.  
  22. #define FEATURE_Z_PROBE 1
  23. #define Z_PROBE_BED_DISTANCE 11.800//5 // Higher than max bed level distance error in mm
  24. #define Z_PROBE_PIN ORIG_Z_MIN_PIN
  25. #define Z_PROBE_PULLUP 1 // NC = 1, NO = 0
  26. #define Z_PROBE_ON_HIGH 1 // Untriggered H = 1, Untriggered L = 0
  27. #define Z_PROBE_X_OFFSET -24
  28. #define Z_PROBE_Y_OFFSET -16
  29.  
  30. // Waits for a signal to start. Valid signals are probe hit and ok button.
  31. // This is needful if you have the probe trigger by hand.
  32. #define Z_PROBE_WAIT_BEFORE_TEST 0
  33.  
  34. /** Speed of z-axis in mm/s when probing */
  35. #define Z_PROBE_SPEED 3
  36. #define Z_PROBE_XY_SPEED 40
  37. #define Z_PROBE_SWITCHING_DISTANCE 1.5 // Distance to safely switch off probe after it was activated
  38. #define Z_PROBE_REPETITIONS 3 // Repetitions for probing at one point.
  39.  
  40. /** Distance between nozzle and bed when probe triggers. */
  41. #define Z_PROBE_HEIGHT 11.800//32.50
  42.  
  43. /** These scripts are run before resp. after the z-probe is done. Add here code to activate/deactivate probe if needed. */
  44. #define Z_PROBE_START_SCRIPT ""
  45. #define Z_PROBE_FINISHED_SCRIPT ""
  46.  
  47. /** Set 1 if you need a hot extruder for good probe results. Normally only required if nozzle is probe. */
  48. #define Z_PROBE_REQUIRES_HEATING 0
  49. /** Minimum extruder temperature for probing. If it is lower, it will be increased to that value. */
  50. #define Z_PROBE_MIN_TEMPERATURE 150
  51.  
  52.  
  53. /*
  54. Define how we measure the bed rotation.
  55. All methods need at least 3 points to define the bed rotation correctly. The quality we get comes
  56. from the selection of the right points and method.
  57.  
  58. BED_LEVELING_METHOD 0
  59. This method measures at the 3 probe points and creates a plane through these points. If you have
  60. a really planar bed this gives the optimum result. The 3 points must not be in one line and have
  61. a long distance to increase numerical stability.
  62.  
  63. BED_LEVELING_METHOD 1
  64. This measures a grid. Probe point 1 is the origin and points 2 and 3 span a grid. We measure
  65. BED_LEVELING_GRID_SIZE points in each direction and compute a regression plane through all
  66. points. This gives a good overall plane if you have small bumps measuring inaccuracies.
  67.  
  68. BED_LEVELING_METHOD 2
  69. Bending correcting 4 point measurement. This is for cantilevered beds that have the rotation axis
  70. not at the side but inside the bed. Here we can assume no bending on the axis and a symmetric
  71. bending to both sides of the axis. So probe points 2 and 3 build the symmetric axis and
  72. point 1 is mirrored to 1m across the axis. Using the symmetry we then remove the bending
  73. from 1 and use that as plane.
  74. */
  75. #define BED_LEVELING_METHOD 0
  76.  
  77. /* How to correct rotation.
  78. 0 = software side
  79. 1 = motorized modification of 2 from 3 fixture points.
  80. */
  81. #define BED_CORRECTION_METHOD 0
  82. // Grid size for grid based plane measurement
  83. #define BED_LEVELING_GRID_SIZE 5
  84. // Repetitions for motorized bed leveling
  85. #define BED_LEVELING_REPETITIONS 5
  86.  
  87. /* These are the motor positions relative to bed origin. Only needed for
  88. motorized bed leveling */
  89. #define BED_MOTOR_1_X 0
  90. #define BED_MOTOR_1_Y 0
  91. #define BED_MOTOR_2_X 200
  92. #define BED_MOTOR_2_Y 0
  93. #define BED_MOTOR_3_X 100
  94. #define BED_MOTOR_3_Y 200
  95.  
  96. /* Autoleveling allows it to z-probe 3 points to compute the inclination and compensates the error for the print.
  97.    This feature requires a working z-probe and you should have z-endstop at the top not at the bottom.
  98.    The same 3 points are used for the G29 command.
  99. */
  100. #define FEATURE_AUTOLEVEL 1
  101. #define Z_PROBE_X1 -15.81
  102. #define Z_PROBE_Y1 -45.00
  103. #define Z_PROBE_X2 -49.80
  104. #define Z_PROBE_Y2 22.00
  105. #define Z_PROBE_X3 11.45
  106. #define Z_PROBE_Y3 3.84
  107.  
  108. /* Bending correction adds a value to a measured z-probe value. This may be
  109.   required when the z probe needs some force to trigger and this bends the
  110.   bed down. Currently the correction values A/B/C correspond to z probe
  111.   positions 1/2/3. In later versions a bending correction algorithm might be
  112.   introduced to give it other meanings.*/
  113. #define BENDING_CORRECTION_A 0
  114. #define BENDING_CORRECTION_B 0
  115. #define BENDING_CORRECTION_C 0
  116.  
  117. /* DISTORTION_CORRECTION compensates the distortion caused by mechanical imprecisions of nonlinear (i.e. DELTA) printers
  118.  * assumes that the floor is plain (i.e. glass plate)
  119.  *     and that it is perpendicular to the towers
  120.  *     and that the (0,0) is in center
  121.  * requires z-probe
  122.  * G29 measures the Z offset in matrix NxN points (due to nature of the delta printer, the corners are extrapolated instead of measured)
  123.  * and compensate the distortion
  124.  * more points means better compensation, but consumes more memory and takes more time
  125.  * DISTORTION_CORRECTION_R is the distance of last row or column from center
  126.  */
  127. #define DISTORTION_CORRECTION 1
  128. #define DISTORTION_CORRECTION_POINTS 3
  129. /* For delta printers you simply define the measured radius around origin */
  130. #define DISTORTION_CORRECTION_R 20
  131.  
  132. /* For all others you define the correction rectangle by setting the min/max coordinates. Make sure the the probe can reach all points! */
  133. #define DISTORTION_XMIN 10
  134. #define DISTORTION_YMIN 10
  135. #define DISTORTION_XMAX 190
  136. #define DISTORTION_YMAX 190
  137.  
  138. /** Uses EEPROM instead of ram. Allows bigger matrix (up to 22x22) without any ram cost.
  139.   Especially on arm based systems with cached EEPROM it is good, on AVR it has a small
  140.   performance penalty.
  141. */
  142. #define DISTORTION_PERMANENT 1
  143.  
  144. /** Correction computation is not a cheap operation and changes are only small. So it
  145. is not necessary to update it for every sub-line computed. For example lets take DELTA_SEGMENTS_PER_SECOND_PRINT = 150
  146. and fastest print speed 100 mm/s. So we have a maximum segment length of 100/150 = 0.66 mm.
  147. Now lats say our point field is 200 x 200 mm with 9 x 9 points. So between 2 points we have
  148. 200 / (9-1) = 25 mm. So we need at least 25 / 0.66 = 37 lines to move to the next measuring
  149. point. So updating correction every 15 calls gives us at least 2 updates between the
  150. measured points.
  151. NOTE: Explicit z changes will always trigger an update!
  152. */
  153. #define DISTORTION_UPDATE_FREQUENCY 15
  154.  
  155. /** z distortion degrades to 0 from this height on. You should start after the first layer to get
  156. best bonding with surface. */
  157. #define DISTORTION_START_DEGRADE 0.5
  158.  
  159. /** z distortion correction gets down to 0 at this height. */
  160. #define DISTORTION_END_HEIGHT 1.5
  161.  
  162. /** If your corners measurement points are not measurable with given radius, you can
  163. set this to 1. It then omits the outer measurement points allowing a larger correction area.*/
  164. #define DISTORTION_EXTRAPOLATE_CORNERS 0
  165.  
  166. /* If your printer is not exactly square but is more like a parallelogram, you can
  167. use this to compensate the effect of printing squares like parallelograms. Set the
  168. parameter to then tangens of the deviation from 90° when you print a square object.
  169. E.g. if you angle is 91° enter tan(1) = 0.017. If error doubles you have the wrong sign.
  170. Always hard to say since the other angle is 89° in this case!
  171. */
  172. #define FEATURE_AXISCOMP 0
  173. #define AXISCOMP_TANXY 0
  174. #define AXISCOMP_TANYZ 0
  175. #define AXISCOMP_TANXZ 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement