Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [probe]
- pin:^PG10
- x_offset: 6 # offset for microswitch x direction off nozzle
- y_offset: 66 # offset for microswitch y direction off nozzle
- #z_offset: 0 # offset for microswitch in z height
- samples: 2
- sample_retract_dist: 3 # this is so the machine has time for the switch to reset properly, especially with a higher retract speed
- samples_result: average
- samples_tolerance: 0.04
- samples_tolerance_retries: 2
- speed: 7 # do not go higher than 10mm/s, you will destroy the switch
- lift_speed: 35
- #########################################################
- #[homing_override]
- #gcode: SET_KINEMATIC_POSITION X=0 Y=0 Z=0
- #G0 Z8 F500 ; raise bed to 8
- #G28 X Y ; home X & Y
- #M401 ; deploy Euclid Probe
- #G0 X244 Y185 F6000 ; move to X200 Y250
- #G28 Z ; home Z
- #M402 ; retract Euclid Probe
- #axes: z
- #set_position_z:-5
- ###########################################################
- [bed_mesh]
- speed = 200
- horizontal_move_z = 10
- mesh_min = 30,100
- mesh_max = 460,434
- probe_count = 7,7
- mesh_pps: 3, 3
- fade_start: 1
- fade_end: 10
- algorithm: bicubic
- bicubic_tension: 0.4
- #relative_reference_index: 24
- ###########################################################
- [z_tilt]
- z_positions:
- 0,200
- 493,6
- 493,385
- points:
- 50,215
- 470,7
- 470,380
- speed: 180
- horizontal_move_z: 10
- retries: 10
- retry_tolerance: 0.0075
- ## 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.
- ##
- ## @TODO the following is a hardware probe config for the hardware configuration.
- ## it can appear in either the printer.cfg OR in the euclid.cfg, not both.
- ## see https://euclidprobe.github.io/05_klipper.html for more details.
- # Below is an example bed diagram to correlate with macros and movements below.
- # __________________________________________________________________________
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | * Dock Exit Position |
- # | X0,Y40 |
- # | |
- # | |
- # | |
- # | |
- # | |
- # | X0,Y-4 X30,Y-4 X100,Y-4 |
- # | * Dock * Dock Side * Dock Preflight |
- # |________________________________________________________________________|
- #
- [gcode_macro EuclidProbe]
- description: config vars for Euclid probe deploy/stow
- ## @TODO Replace the coordinates to suit your printer
- variable_position_preflight: [ 250, 465 ] # position for probe to have clear path to dock
- variable_position_side: [ 220, 504 ] # position for probe near dock to swipe on/off
- variable_position_dock: [ 250, 504 ] # dock position
- variable_position_fail_dock: [ 220, 504 ] # if mesh fails before print
- ## @TODO if your printer has a fixed Z-Endstop that you will use define it here
- ## @TODO for example Voron Trident
- variable_position_zstop: [ 150,250 ] # zstop position
- ## exit/re-entry staging
- variable_position_exit: [ 250, 460 ] # exit position
- ## clearance between the toolhead and bed when traveling to pick up the probe
- variable_bed_clearance: 8
- ## probe dock height
- ## @TODO If the toolhead can move vertically in relation to the probe dock
- ## @TODO height(such as attached to the be on a moving-gantry printer like a
- ## @TODO Voron 2.4), set this to the Z position of the probe dock.
- # variable_dock_height: 15
- ## move speeds in mm/min
- variable_move_speeds: 10000
- ## internal state variables; not for configuration!
- variable_batch_mode_enabled: False
- variable_probe_state: None
- gcode:
- RESPOND TYPE=command MSG="{ printer['gcode_macro EuclidProbe'] }"
- # @TODO The homing override is machine specific. This example is for a
- # @TODO fixed-gantry/moving-bed printer such as the Rat Rig V-Core 3. Ensure you
- # @TODO only have [homing_override] defined in one place in your Klipper config
- # @TODO (typically here or in printer.cfg). It's particularly important to make
- # @TODO sure the probe is picked up before attempting to home the Z axis.
- [homing_override]
- axes: z
- set_position_z: -5
- gcode:
- {% set euclid_probe = printer["gcode_macro EuclidProbe"] %}
- G90
- # force the bed and toolhead apart
- SET_KINEMATIC_POSITION Z=0
- G0 Z{ euclid_probe.bed_clearance } F800
- # home Y and X, Y first to avoid running into the dock
- {% if "y" not in (printer.toolhead.homed_axes | lower) %}
- G28 X
- {% endif %}
- {% if "x" not in (printer.toolhead.homed_axes | lower) %}
- G28 Y
- {% endif %}
- ## @TODO If you are using Euclid to function as a Z-Endstop, then you need to deploy it.
- ## @TODO If you are using a fixed Z-stop, then comment out the next line
- DEPLOY_PROBE
- # @ TODO home Z at bed center with Euclid Probe
- G0 X{ printer.toolhead.axis_maximum.x/2 } Y{ printer.toolhead.axis_maximum.y/2 } F{ euclid_probe.move_speeds }
- G28 Z
- # after 'G28 Z' the probe stays in contact with the bed; move it away bed_clearance height.
- G0 Z{euclid_probe.bed_clearance} F800
- ## @TODO If you are using Euclid to function as a Z-Endstop, then you need to stow it.
- ## @TODO If you are using a fixed Z-stop, then comment out the next line
- STOW_PROBE
- [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 = "deployed" if printer.probe.last_query == 0 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=deployed
- [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
- [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 } F800
- # 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 }
- # 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 }
- # wait 1/4 second
- M400
- G4 P250
- # move sideways over the dock to pick up probe
- G0 X{ euclid_probe.position_dock[0] } Y{ euclid_probe.position_dock[1] } F2500
- # wait 1/4 second
- M400
- G4 P250
- # confirm deploy was successful
- ASSERT_PROBE_DEPLOYED
- # 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 %}
- [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
- G90
- # set approach elevation for fixed gantry system to clear probe over bed
- G0 Z{ euclid_probe.bed_clearance } F800
- # 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 }
- # move to the exit/re-entry staging position
- G0 X{ euclid_probe.position_exit[0] } Y{ euclid_probe.position_exit[1] } F{ euclid_probe.move_speeds }
- # slowly move into dock
- G0 X{ euclid_probe.position_dock[0] } Y{ euclid_probe.position_dock[1] } F5000
- # wait for moves to finish, pause to force 90deg travel swipe
- M400
- G4 P250
- # quick swipe off
- G0 X{ euclid_probe.position_side[0] } Y{ euclid_probe.position_side[1] } F{ euclid_probe.move_speeds }
- # confirm stowing was successful
- ASSERT_PROBE_STOWED
- {% endif %}
- ## Simple example macro to perform a bed mesh calibration by wrapping it in
- ## DEPLOY_PROBE/STOW_PROBE macros.
- ## For a more complex example that probes the area that will be printed, see
- ## https://github.com/blalor/vcore3-ratos-config/blob/50e757ec32e085bedb3b9fa317581f9aa1913dd2/euclid.cfg#L230-L305
- ## @TODO uncomment one of the following macros if necessary for your printer:
- ## * Z_TILT_ADJUST is for [z_tilt] config
- ## * QUAD_GANTRY_LEVEL is for [quad_gantry_level] config
- [gcode_macro PROBE_CALIBRATE]
- rename_existing: PROBE_CALIBRATE_ORIG
- gcode:
- {% set euclid_probe = printer["gcode_macro EuclidProbe"] %}
- DEPLOY_PROBE
- G90
- G0 X{ printer.toolhead.axis_maximum.x/2 } Y{ printer.toolhead.axis_maximum.y/2 } F{ euclid_probe.move_speeds }
- M117 Beginning probe calibration; remove probe before measuring nozzle height!
- PROBE_CALIBRATE_ORIG
- [gcode_macro START_PRINT]
- ## support PRINT_MIN={first_layer_print_min[0]},{first_layer_print_min[1]} PRINT_MAX={first_layer_print_max[0]},{first_layer_print_max[1]}
- variable_first_layer_min_xy: None
- variable_first_layer_max_xy: None
- gcode:
- {% set euclid = printer["gcode_macro EuclidProbe"] %}
- {% set extruder_temp = params.EXTRUDER_TEMP | default(printer.extruder.target, true) %}
- {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(0)|float %}
- ; {% endif %}
- # Metric values
- G21
- # Absolute positioning
- G90
- # Set extruder to absolute mode
- M82
- EUCLID_PROBE_BEGIN_BATCH
- # Home
- G28
- # Adjust bed tilt
- M117 Adjusting for tilt...
- Z_TILT_ADJUST
- # Home again as Z will have changed after tilt adjustment and bed heating.
- M117 Rehoming after tilt adjustment...
- G28 Z
- M117 Bed mesh calibration...
- SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=first_layer_min_xy VALUE="{ params.PRINT_MIN | default(None, true) }"
- SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=first_layer_max_xy VALUE="{ params.PRINT_MAX | default(None, true) }"
- BED_MESH_CALIBRATE PRINT_MIN={params.PRINT_MIN} PRINT_MAX={params.PRINT_MAX}
- ;BED_MESH_PROFILE LOAD="default"
- SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=first_layer_min_xy VALUE=None
- SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=first_layer_max_xy VALUE=None
- M104 S{EXTRUDER_TEMP} ; set extruder temp
- M109 S{EXTRUDER_TEMP} ; wait for extruder temp
- EUCLID_PROBE_END_BATCH
- M104 S{EXTRUDER_TEMP} ; set extruder temp
- M109 S{EXTRUDER_TEMP} ; wait for extruder temp
- G1 X10 Y10 Z5 F9000 ; Move safe Z height to shear strings
- G0 X10 Y20 Z0.0 F9000 ; Move in 1mm from edge and up [z] 0.2mm
- G92 E0 ; Set extruder to [0] zero
- G1 X200 E50 F500 ; Extrude 30mm filiment along X axis 100mm long to prime and clean the nozzle
- G92 E0 ; Reset extruder to [0] zero end of cleaning run
- G1 X205 F15000 ; quick wipe away from the filament line
- [gcode_macro PRINT_START]
- ## support PRINT_MIN={first_layer_print_min[0]},{first_layer_print_min[1]} PRINT_MAX={first_layer_print_max[0]},{first_layer_print_max[1]}
- variable_first_layer_min_xy: None
- variable_first_layer_max_xy: None
- gcode:
- {% set euclid = printer["gcode_macro EuclidProbe"] %}
- {% set extruder_temp = params.EXTRUDER_TEMP | default(printer.extruder.target, true) %}
- {% set hotendtemp = params.HOTEND|int %}
- ; {% endif %}
- #M109 S{hotendtemp}
- # Metric values
- G21
- # Absolute positioning
- G90
- # Set extruder to absolute mode
- M82
- EUCLID_PROBE_BEGIN_BATCH
- # Home
- G28
- # Adjust bed tilt
- M117 Adjusting for tilt...
- Z_TILT_ADJUST
- # Home again as Z will have changed after tilt adjustment and bed heating.
- M117 Rehoming after tilt adjustment...
- G28 Z
- M117 Bed mesh calibration...
- SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=first_layer_min_xy VALUE="{ params.PRINT_MIN | default(None, true) }"
- SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=first_layer_max_xy VALUE="{ params.PRINT_MAX | default(None, true) }"
- BED_MESH_CALIBRATE PRINT_MIN={params.PRINT_MIN} PRINT_MAX={params.PRINT_MAX}
- ;BED_MESH_PROFILE LOAD="default"
- SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=first_layer_min_xy VALUE=None
- SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=first_layer_max_xy VALUE=None
- EUCLID_PROBE_END_BATCH
- M109 S{hotendtemp}
- G1 X10 Y10 Z5 F9000 ; Move safe Z height to shear strings
- G0 X10 Y20 Z0.0 F9000 ; Move in 1mm from edge and up [z] 0.2mm
- G92 E0 ; Set extruder to [0] zero
- G1 X200 E50 F500 ; Extrude 30mm filiment along X axis 100mm long to prime and clean the nozzle
- G92 E0 ; Reset extruder to [0] zero end of cleaning run
- G1 X205 F15000 ; quick wipe away from the filament line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement