v2.4: update macros

This commit is contained in:
Konstantin Koslowski 2022-01-06 18:25:53 +01:00
parent e06e6385f4
commit 988257a6f1
3 changed files with 77 additions and 59 deletions

View file

@ -1,7 +1,10 @@
####################################################################
# Helper macros
# - MOVE_SPEED
# - ...
# - NOTIFY_BED
# - NOTIFY_EXTRUDER
# - ZC - calibrate z and move to front to measure
# - TZC - Test Z Calibration
####################################################################
[gcode_macro MOVE_SPEED]
@ -42,30 +45,33 @@ gcode:
M118 Already printing
{% endif %}
[gcode_macro fes]
description: query filament sensor encoder_sensor
gcode:
QUERY_FILAMENT_SENSOR SENSOR=encoder_sensor
[gcode_macro fts]
description: query filament sensor toolhead_sensor
[gcode_macro NOTIFY_BED]
gcode:
QUERY_FILAMENT_SENSOR SENSOR=toolhead_sensor
[gcode_macro zc]
gcode:
{% set z_run = params.CUR|default(0.4)|float %}
{% set z_hold = z_run %}
{action_respond_info("zc: setting zcurrent to %.2f" % z_run)}
SET_TMC_CURRENT STEPPER=stepper_z CURRENT={z_run} HOLDCURRENT={z_hold}
SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={z_run} HOLDCURRENT={z_hold}
SET_TMC_CURRENT STEPPER=stepper_z2 CURRENT={z_run} HOLDCURRENT={z_hold}
SET_TMC_CURRENT STEPPER=stepper_z3 CURRENT={z_run} HOLDCURRENT={z_hold}
{% set BED=params.BED|default(0)|int %}
M117 HEATING BED from {printer.heater_bed.temperature} to {BED}
M118 HEATING BED from {printer.heater_bed.temperature} to {BED}
[gcode_macro zm]
[gcode_macro NOTIFY_EXTRUDER]
gcode:
{% set F = params.SPEED|default(300)|int %}
{action_respond_info("moving with F=%d" % F)}
G0 Z30 F{F}
G0 Z10 F{F}
{% set EXTRUDER=params.EXTRUDER|default(0)|int %}
M117 HEATING EXTRUDER from {printer.extruder.temperature} to {EXTRUDER}
M118 HEATING EXTRUDER from {printer.extruder.temperature} to {EXTRUDER}
[gcode_macro ZC]
gcode:
G28
CALIBRATE_Z
G0 X150 Y30 Z2 F10000
G0 Z1 F300
[gcode_macro TZC]
gcode:
{% set N=params.N|default(1)|int %}
{% for i in range(N) %}
M118 move {(i+1)}/{N}
G28
CALIBRATE_Z
{% endfor %}