; Auto calibration routine for SeeMeCNC Rostock MAX V3 ; About the G30 S parameter ; S=-1 Don't adjust anything, just print the height error at each probe point ; 6-factor: as 4-factor but also adjusts the X and Y tower position corrections. ; 7-factor: as 6-factor but also adjusts the diagonal rod length (M665 L parameter). ; 8-factor: as 6-factor but also adjusts the X and Y tilt angles (M666 A and B parameters). ; 9-factor: as 8-factor but also adjusts the diagonal rod length (M665 L parameter). var factors = 8 var max_deviation = 0.06 var max_attempts = 3 M561 ; Clear any bed transform G1 X0.00 Y0.00 Z20 F4000 ; Move to just above the first probe point M98 P"0:/macros/Commands/set_acceleration_probing" ; Lower acceleration to eliminate false smarteffector triggers M98 P"0:/macros/Commands/set_jerk_probing" ; Lower jerk to eliminate false smarteffector triggers while true if (iterations + 1) > var.max_attempts echo "Too many calibration attemps, current deviation is " ^ move.calibration.final.deviation ^ "mm." G28 break echo "Proping attempt "^(iterations + 1)^" of "^var.max_attempts ; Outer probing ring, radius: 180 G30 P0 X0.00 Y180.00 Z-99999 H0 if result != 0 continue G30 P1 X90.00 Y155.88 Z-99999 H0 if result != 0 continue G30 P2 X155.88 Y90.00 Z-99999 H0 if result != 0 continue G30 P3 X180.00 Y0.00 Z-99999 H0 if result != 0 continue G30 P4 X155.88 Y-90.00 Z-99999 H0 if result != 0 continue ; Collision avoidance with the tower G1 X180.00 Y0.00 F10000 G1 X0 Y0 F10000 G1 X0 Y-180 F10000 G30 P5 X90.00 Y-155.88 Z-99999 H0 if result != 0 continue G30 P6 X0.00 Y-180.00 Z-99999 H0 if result != 0 continue G30 P7 X-90.00 Y-155.88 Z-99999 H0 if result != 0 continue G30 P8 X-155.88 Y-90.00 Z-99999 H0 if result != 0 continue G30 P9 X-180.00 Y-0.00 Z-99999 H0 if result != 0 continue G30 P10 X-155.88 Y90.00 Z-99999 H0 if result != 0 continue G30 P11 X-90.00 Y155.88 Z-99999 H0 if result != 0 continue ; Middle probing ring, radius: 100 G30 P12 X0.00 Y100.00 Z-99999 H0 if result != 0 continue G30 P13 X86.60 Y50.00 Z-99999 H0 if result != 0 continue G30 P14 X86.60 Y-50.00 Z-99999 H0 if result != 0 continue G30 P15 X0.00 Y-100.00 Z-99999 H0 if result != 0 continue G30 P16 X-86.60 Y-50.00 Z-99999 H0 if result != 0 continue G30 P17 X-86.60 Y50.00 Z-99999 H0 if result != 0 continue ; Inner probing ring, radius: 50 G30 P18 X0.00 Y50.00 Z-99999 H0 if result != 0 continue G30 P19 X43.30 Y-25.00 Z-99999 H0 if result != 0 continue G30 P20 X-43.30 Y-25.00 Z-99999 H0 if result != 0 continue G30 P21 X0 Y0 Z-99999 S{var.factors} if result != 0 continue if move.calibration.final.deviation <= var.max_deviation echo "Stopping attempts with deviation " ^ move.calibration.final.deviation ^ "mm)" break else echo "Repeating calibration because deviation is higher than "^ var.max_deviation ^" (" ^ move.calibration.final.deviation ^ "mm)" G28 M98 P"0:/macros/Commands/set_acceleration_default" ; Restore acceleration M98 P"0:/macros/Commands/set_jerk_default" ; Restore jerk G1 X0 Y0 Z75 F3000 ; get the head out of the way of the bed