## The following is EXAMPLE configuration; it is intended to guide you in the ## configuration of the Euclid probe for YOUR printer. ## ## When incorporating this config into your own, make sure you address all ## comment markers starting with "@TODO". Failure to do so could result in ## damage to your probe, your printer, or your pride. ## ## ## This example is for a fixed dock, fixed gantry/carriage and moving bed motion ## system like RailCore, Ender5, V-Core3, etc. Delta printes will be similar. ## ## Moving gantry printers like Voron need a few tweaks to ensure proper ## clearances and leveling procedures; some hints are provided inline below. ## ## Array variables implementation and macro setups credited to Brian Lalor, ## yolo-dubstep#8033 on Discord. See https://github.com/blalor/vcore3-ratos-config ## for updates and details. ## # Below is an example bed diagram to correlate with macros and movements below. # __________________________________________________________________________ # | | # | * Dock * Dock Side | # | X25, Y118 X60 Y118 | # | | # | * Dock Prefilight * Dock Exit Position | # | X25, Y90 X60,Y90 | # | | # | | # | | # | | # | | # | | # | | # |________________________________________________________________________| # [force_move] enable_force_move: True # Set to true to enable FORCE_MOVE and SET_KINEMATIC_POSITION # extended G-Code commands. The default is false. [respond] default_type: echo # Sets the default prefix of the "M118" and "RESPOND" output to one # of the following: # echo: "echo: " (This is the default) # command: "// " # error: "!! " default_prefix: echo: # Directly sets the default prefix. If present, this value will # override the "default_type". [gcode_macro EuclidProbe] description: config vars for Euclid probe deploy/stow ## @TODO Replace the coordinates to suit your printer variable_position_preflight: [ 25, 90 ] # position for probe to have clear path to dock variable_position_side: [ 60, 118 ] # position for probe near dock to swipe on/off variable_position_dock: [ 25, 118 ] # dock position variable_position_exit: [ 60, 90 ] # exit position ## clearance between the toolhead and bed when traveling to pick up the probe variable_bed_clearance: 25 ## move speeds in mm/min variable_move_speeds: 3000 ## internal state variables; not for configuration! variable_batch_mode_enabled: False variable_probe_state: None gcode: RESPOND TYPE=command MSG="{ printer['gcode_macro EuclidProbe'] }" [gcode_macro _ASSERT_PROBE_STATE] description: ensures probe is in a known state; QUERY_PROBE must have been called before this macro! gcode: ## QUERY_PROBE manually-verified results, when microswitch not depressed ## "TRIGGERED" -> 1 :: probe stowed ## "open" -> 0 :: probe deployed {% set last_query_state = "stowed" if printer.probe.last_query == 1 else "deployed" %} {% if params.MUST_BE != last_query_state %} { action_raise_error("expected probe state to be {} but is {} ({})".format(params.MUST_BE, last_query_state, printer.probe.last_query)) } {% else %} ## all good; update state SET_GCODE_VARIABLE MACRO=EuclidProbe VARIABLE=probe_state VALUE="'{ last_query_state }'" {% endif %} [gcode_macro ASSERT_PROBE_DEPLOYED] description: error if probe not deployed gcode: # wait for moves to finish, then pause 0.25s for detection M400 G4 P250 QUERY_PROBE _ASSERT_PROBE_STATE MUST_BE=deployed [gcode_macro ASSERT_PROBE_STOWED] description: error if probe not stowed gcode: # wait for moves to finish, then pause 0.25s for detection M400 G4 P250 QUERY_PROBE _ASSERT_PROBE_STATE MUST_BE=stowed [gcode_macro EUCLID_PROBE_BEGIN_BATCH] description: begin euclid probe batch mode gcode: SET_GCODE_VARIABLE MACRO=EuclidProbe VARIABLE=batch_mode_enabled VALUE=True RESPOND TYPE=command MSG="Probe batch mode enabled" [gcode_macro EUCLID_PROBE_END_BATCH] description: end euclid probe batch mode and stow probe gcode: SET_GCODE_VARIABLE MACRO=EuclidProbe VARIABLE=batch_mode_enabled VALUE=False RESPOND TYPE=command MSG="Probe batch mode disabled" STOW_PROBE # deploy probe macro # @TODO Check the servo dock values to ensure the dock releases the probe at the right height [gcode_macro DEPLOY_PROBE] description: deploy Euclid probe gcode: {% set euclid_probe = printer["gcode_macro EuclidProbe"] %} {% if euclid_probe.batch_mode_enabled and euclid_probe.probe_state == "deployed" %} RESPOND TYPE=command MSG="Probe batch mode enabled: already deployed" {% else %} RESPOND TYPE=command MSG="Deploying probe" # ensure the probe is currently stowed; can't deploy what isn't stowed. ASSERT_PROBE_STOWED G90 # set approach elevation to clear probe over bed on fixed gantry machine G0 Z{ euclid_probe.bed_clearance } F500 ########################## # open Servo Dock # @TODO check ANGLE ########################## SET_SERVO SERVO=probe_servo ANGLE=10 # wait 1/2 second for dock M400 M400 # move the toolhead to safe position to start probe pickup G0 X{ euclid_probe.position_preflight[0] } Y{ euclid_probe.position_preflight[1] } F{ euclid_probe.move_speeds } # @TODO fixed bed dock and moving gantry printers need to add a move # @TODO command here to lower the gantry to dock height # G0 Z {euclid_probe.dock_height} F500 # move sideways over the dock to pick up probe G0 X{ euclid_probe.position_dock[0] } Y{ euclid_probe.position_dock[1] } F1500 # wait 1/4 second M400 G4 P250 # confirm deploy was successful ASSERT_PROBE_DEPLOYED # move to the side of the dock G0 X{ euclid_probe.position_side[0] } Y{ euclid_probe.position_side[1] } F{ euclid_probe.move_speeds } ########################## # close Servo Dock # @TODO check ANGLE ########################## SET_SERVO SERVO=probe_servo ANGLE=115 # move out of the dock in a straight line G0 X{ euclid_probe.position_exit[0] } Y{ euclid_probe.position_exit[1] } F{ euclid_probe.move_speeds } {% endif %} # stow probe macro # @TODO Check the servo dock values to ensure the dock releases the probe at the right height [gcode_macro STOW_PROBE] description: stow Euclid probe gcode: {% set euclid_probe = printer["gcode_macro EuclidProbe"] %} {% if euclid_probe.batch_mode_enabled %} RESPOND TYPE=command MSG="Probe batch mode enabled: not stowing" {% else %} RESPOND TYPE=command MSG="Stowing probe" # ensure the probe is currently deployed; can't stow what isn't deployed. ASSERT_PROBE_DEPLOYED # set approach elevation for fixed gantry system to clear probe over bed G0 Z{ euclid_probe.bed_clearance } F3000 ########################## # open Servo Dock # @TODO check ANGLE ########################## SET_SERVO SERVO=probe_servo ANGLE=10 # wait 1/2 second for dock M400 M400 G90 # move out of the dock in a straight line G0 X{ euclid_probe.position_exit[0] } Y{ euclid_probe.position_exit[1] } F{ euclid_probe.move_speeds } # move to the side of the dock G0 X{ euclid_probe.position_side[0] } Y{ euclid_probe.position_side[1] } F{ euclid_probe.move_speeds } # slowly move into dock G0 X{ euclid_probe.position_dock[0] } Y{ euclid_probe.position_dock[1] } F3000 # wait for moves to finish, pause to force 90deg travel swipe M400 G4 P250 # quick swipe off # move the toolhead to safe position to start probe pickup G0 X{ euclid_probe.position_preflight[0] } Y{ euclid_probe.position_preflight[1] } F{ euclid_probe.move_speeds } ########################## # close Servo Dock # @TODO check ANGLE ########################## SET_SERVO SERVO=probe_servo ANGLE=115 # confirm stowing was successful ASSERT_PROBE_STOWED {% endif %} # Z-Tilt Adjust and BED_Mesh Overrides [gcode_macro Z_TILT_ADJUST] description: modified Z_TILT_ADJUST, wrapped with DEPLOY_PROBE/STOW_PROBE rename_existing: Z_TILT_ADJUST_ORIG gcode: DEPLOY_PROBE Z_TILT_ADJUST_ORIG STOW_PROBE [gcode_macro BED_MESH_CALIBRATE] description: modified BED_MESH_CALIBRATE, wrapped with DEPLOY_PROBE/STOW_PROBE rename_existing: BED_MESH_CALIBRATE_ORIG gcode: DEPLOY_PROBE BED_MESH_CALIBRATE_ORIG STOW_PROBE