Prioritise macros

Basic Information:

Printer Model: Coustom Cartesian Printer
MCU / Printerboard: Rambo Board (16Bit Atmega)
Host / SBC Raspberry Pi
klippy.log
klippy_Klipper.zip (2.0 MB)

I have created some macros for my machine with which I can readjust a few settings during printing. For example, the print bed height.
However, these macros are always executed with a very long delay. Can I prioritise the macros so that they can jump to the front of the command queue? Readjustment is much easier if the printer reacts more quickly to the input.

Here is a macro as an example. The print bed should be adjusted during the printing process. In addition, all offsets and sensor settings must also be adjusted so that the changes are immediately taken into account during the next homing or measuring process.

[gcode_macro M290]
description: “Reads out the current Z position, adjusts the Z offset and moves the Z axis back to the original position.”
gcode:
{% set z_change = params.Z|default(0)|float %}
{% set val_z_offset = printer.save_variables.variables.var_z_offset %}
{% set pos_sensor_height = printer.save_variables.variables.var_pos_sensor_height %}
{% set z_pos = printer[“gcode_move”].gcode_position.z %}
G91
G4 P1 #Do not remove
G1 Z{z_change}
G4 P1
G92 Z{z_pos}
G90
#Save Offset
{% set val_z_offset = val_z_offset - z_change %}
{% set pos_sensor_height = pos_sensor_height - z_change %}
M118 new value { val_z_offset }
SAVE_VARIABLE VARIABLE=var_z_offset VALUE={val_z_offset}
SAVE_VARIABLE VARIABLE=var_pos_sensor_height VALUE={pos_sensor_height}

Hint:

For code snippets, please use the Preformatted Text feature of the forum editor. Else the code can be mess up (lost spaces etc) as it happend with your code here.

Format

Simple answer: No.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.