Closed VIN-y closed 4 months ago
Thanks, adding automatic lazy homing.
On Wed, Apr 17, 2024, 23:22 VIN @.***> wrote:
When the user accidentally click on the macro T0, T1, etc. before the axis are homed, Klipper will crash.
My work-around so far is to modify the macro as such:
[gcode_macro T0] variable_color: "" gcode:
SELECT_TOOL T=0
{% if "xyz" in printer.toolhead.homed_axes %} ### Check if axes are homed SELECT_TOOL T=0 {% else %} RESPOND TYPE=error MSG='Printer is not homed' {% endif %}
It works, but this generate a bunch of repetitive codes (as we discussed in the tapchanger PR, a while back), as the that "home check" need to be copy into every new Tx macros. Therefore, it would be nice if the SELECT_TOOL comnand would check for the home-status before the gcode_position variable is set/used, line 259 in toolchanger.py https://github.com/viesturz/klipper-toolchanger/blob/main/klipper/extras/toolchanger.py .
— Reply to this email directly, view it on GitHub https://github.com/viesturz/klipper-toolchanger/issues/13, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMQT4ZFD2Z4NOEG3SJY6ETY53R2DAVCNFSM6AAAAABGMCKVZCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2DSMRZGAZTOMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I would suggest just return an error message “Printer is not homed”. In the same theme of accidental touches, it is best that the code at this level (i.e. where most people will never look-at/edit) does not assume what people would like to the motion system to do.
If people want to automatically home (if it is not already so) or do other things like nozzle-cleaning when Tx
macro is pressed, then they can mod the macro for that.
Added both options at the end. Personally like to minimize script writing. And home and tool buttons are equally dangerous.
When the user accidentally click on the macro
T0
,T1
, etc. before the axis are homed, Klipper will crash.My work-around so far is to modify the macro as such:
It works, but this generate a bunch of repetitive codes (as we discussed in the tapchanger PR, a while back), as the that "home check" need to be copy into every new
Tx
macros. Therefore, it would be nice if theSELECT_TOOL
comnand would check for the home-status before thegcode_position
variable is set/used, line 259 in toolchanger.py.