v2.4: update things

This commit is contained in:
Konstantin Koslowski 2021-11-25 22:57:41 +01:00
parent d287262e72
commit 1694da09bc
5 changed files with 165 additions and 150 deletions

View file

@ -1,55 +1,73 @@
####################################################################
# Helper macros
# - MOVE_SPEED
# - ZES
# - ...
####################################################################
[gcode_macro MOVE_SPEED]
description: move along certain patterns with selected speed
gcode:
{% set F=params.F|default(3000)|int %}
{% set N=params.N|default(1)|int %}
{% if printer.idle_timeout.state != "Printing" %}
{% if "xyz" in printer.toolhead.homed_axes %}
{action_respond_info("moving with F%d" % F)}
; square clockwise
M117 > square clockwise
G0 X275 Y275 F{F}
G0 Y25
G0 X25
G0 Y275
G0 X275
; square counter-clockwise
M117 > square counter-clockwise
G0 X25
G0 Y25
G0 X275
G0 Y275
; diagonal motor a
M117 > diagonal motor a
G0 X25 Y25
G0 X275 Y275
G0 X25
; diagonal motor b
M117 > diagonal motor b
G0 X275 Y25
G0 X25 Y275
G0 X275 Y275
M118 moving {N}x with F{F}
{% set X0=275 %}
{% set X1=25 %}
{% set Y0=275 %}
{% set Y1=25 %}
; start
G0 X{X0} Y{Y0} F3000
G0 F{F}
{% for i in range(N) %}
M118 move {(i+1)}/{N}
; move 1
G0 X{X1} Y{Y0}
G0 X{X0} Y{Y1}
; move 2
G0 X{X0} Y{Y0}
G0 X{X1} Y{Y1}
; move 3
G0 X{X0} Y{Y1}
G0 X{X1} Y{Y0}
; move 4
G0 X{X1} Y{Y1}
G0 X{X0} Y{Y0}
{% endfor %}
M118 done
{% else %}
{action_respond_info("Printer not homed")}
M118 Printer not homed
{% endif %}
{% else %}
{action_respond_info("Already printing")}
M118 Already printing
{% endif %}
[gcode_macro ZES]
description: Z_ENDSTOP_CALIBRATE + extras
[gcode_macro fes]
description: query filament sensor encoder_sensor
gcode:
{% if printer.idle_timeout.state != "Printing" %}
G28
G0 X150 Y150 Z10 F10000
Z_ENDSTOP_CALIBRATE
TESTZ Z=-9
{% else %}
{action_respond_info("Already printing")}
{% endif %}
QUERY_FILAMENT_SENSOR SENSOR=encoder_sensor
[gcode_macro fts]
description: query filament sensor toolhead_sensor
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}
[gcode_macro zm]
gcode:
{% set speed = params.SPEED|default(300)|int %}
{action_respond_info("moving with F%d" % speed)}
G0 Z30 F{speed}
G0 Z10 F{speed}