Run macro as part of homing move
-
There may well be a simpler way however I'm trying to setup my mishmash tool changer to unload the tool before doing a Z-home. I have a trigger on the 1LC board that when triggered stores the tool with each tool head having their own trigger. The idea being that if there is a tool on the head it is parked in it's holder prior to probing. The issue I'm having is that I currently have macros for each trigger and the triggers are enable when they're needed and disabled when they're not.
The issue I have is that the trigger macros are not being run in sequence when the Home-Z button is pressed and run at the end of the probe move which means the tool remains on the head which causes a suboptimal head crash. I have tried both using pauses as well as making a separate homez macro that the homez.g refers to but it still runs in the same backward sequence. Running the macro seperately runs perfectly even before a first home.
my homez.g
m98 P"0:/macros/HomeZ"
my HomeZ macro
Setup unload before probe M581 P11 T11 R0 M582 T11 M581 P11 T11 R-1 G4 S0 G91 ; relative positioning G1 H2 Z5 F420 ; lift Z relative to current position G90 ; absolute positioning G1 X190 Y50 F6000 ; go to first probe point G30 X150 Y150 ; home Z by probing the bed G1 Z0
I suspect that this could be done with a conditional gcode however I can't seem to find how to check if a trigger is depressed or not.
-
This post is deleted! -
@herve_smith Thanks for picking up my copy and paste error. Unfortunately running them manual still doesn't seem to make things any different. The best solution I've found is issuing a dwell of 5s after the trigger to give it time to run the unload command.
-
I eventually managed to solve my issue by working out the conditional GCode (if sensors.gpIn[In].value = 1 with the macro in the file. Just would be nice to be able to keep this information centrally in a macro.
-
@nriviera said in Run macro as part of homing move:
The issue I have is that the trigger macros are not being run in sequence
You can achieve this by placing
M400
at the end of the sequence which must be fully completed
-
@diy-o-sphere unfortunately it doesn't seem (G4 S0 has the same function) to work with the home buttons.