- ###############################Macros and related################################
- #This secton contains macros and related config sections. Some should be used, others are optional. Read the comment above each one to find out whether or not to uncomment it for your installation.
-
-
- # Uncomment this if you are using Eddy as the probe AND the homing endstop AND would like to use the beta z-offset control
- [delayed_gcode RESTORE_PROBE_OFFSET]
- initial_duration: 1.
- gcode:
- {% set svv = printer.save_variables.variables %}
- {% if not printer["gcode_macro SET_GCODE_OFFSET"].restored %}
- SET_GCODE_VARIABLE MACRO=SET_GCODE_OFFSET VARIABLE=runtime_offset VALUE={ svv.nvm_offset|default(0) }
- SET_GCODE_VARIABLE MACRO=SET_GCODE_OFFSET VARIABLE=restored VALUE=True
- {% endif %}
-
- # Uncomment this if you are using Eddy as the probe AND the homing endstop
- [gcode_macro SET_Z_FROM_PROBE]
- gcode:
- {% set cf = printer.configfile.settings %}
- SET_GCODE_OFFSET_ORIG Z={printer.probe.last_z_result - cf['probe_eddy_current btt_eddy'].z_offset + printer["gcode_macro SET_GCODE_OFFSET"].runtime_offset}
- G90
- G1 Z{cf.safe_z_home.z_hop}
-
-
- # Uncomment this if you are using Eddy as the probe AND the homing endstop AND would like to use the beta z-offset control
- [gcode_macro Z_OFFSET_APPLY_PROBE]
- rename_existing: Z_OFFSET_APPLY_PROBE_ORIG
- gcode:
- SAVE_VARIABLE VARIABLE=nvm_offset VALUE={ printer["gcode_macro SET_GCODE_OFFSET"].runtime_offset }
-
-
-
- # Uncomment the lines in this macro if you are using Eddy as the probe AND the homing endstop AND would like to use the beta z-offset control
- [gcode_macro SET_GCODE_OFFSET]
- rename_existing: SET_GCODE_OFFSET_ORIG
- variable_restored: False # Mark whether the var has been restored from NVM
- variable_runtime_offset: 0
- gcode:
- {% if params.Z_ADJUST %}
- SET_GCODE_VARIABLE MACRO=SET_GCODE_OFFSET VARIABLE=runtime_offset VALUE={ printer["gcode_macro SET_GCODE_OFFSET"].runtime_offset + params.Z_ADJUST|float }
- {% endif %}
- {% if params.Z %}
- {% set paramList = rawparams.split() %}
- {% for i in range(paramList|length) %}
- {% if paramList[i]=="Z=0" %}
- {% set temp=paramList.pop(i) %}
- {% set temp="Z_ADJUST=" + (-printer["gcode_macro SET_GCODE_OFFSET"].runtime_offset)|string %}
- {% if paramList.append(temp) %}{% endif %}
- {% endif %}
- {% endfor %}
- {% set rawparams=paramList|join(' ') %}
- SET_GCODE_VARIABLE MACRO=SET_GCODE_OFFSET VARIABLE=runtime_offset VALUE=0
- {% endif %}
- SET_GCODE_OFFSET_ORIG { rawparams }
-
-
-
- # This macro automates a lot of the frequency mapping process and simplifies the steps significantly.
- [gcode_macro PROBE_EDDY_CURRENT_CALIBRATE_AUTO]
- gcode:
- BED_MESH_CLEAR
- G28 X Y
- G90 # Abs positioning
- G1 X{ printer.toolhead.axis_maximum.x/2 } Y{ printer.toolhead.axis_maximum.y/2 } F6000
- {% if 'z' not in printer.toolhead.homed_axes %}
- SET_KINEMATIC_POSITION Z={ printer.toolhead.axis_maximum.z-1 } # Allows the user to work it down until it touches.
- {% endif %}
- PROBE_EDDY_CURRENT_CALIBRATE {rawparams}
-
-
- #This macro is optional but useful if you want to run a rapid scan before each print. Simply uncomment it and add BED_MESH_SCAN to your print start code.