@Valld said in Triggering a macro with foot switch:
By enable Z to go below zero I mean that I have a macro for zeroing all axis at a current pozition and switch to work coordinates and the foot switch macro will run after I zerowed xyz and this 2 mm will be -2, below zero, into my stock as you said.
if you switch to work coordinates first then zero them, you should again always stay in positive machine coords?
anyways, if you need to ignore the machine limits use M564 S1 at the top of your macro and M564 S0 at the bottom
The just use something like making sure the relative Z motion is in the correct direction and replace slow and fast with actual feed rates.
M120 G91 G1 Z-2 Fslow G91 G1 Z2 Ffast M121(using relative moves you don't need to zero and switch work coordinates btw, push and pop will restore to absolute moves if that was in use before)