Probe deployment and z probe homing at different locations
-
I am working through the details of setting up a Touch Mi probe and I am having a problem I cannot figure out.
These two seem to interact in a weird way:
- Deploying the probe requires hitting a magnet, which ideally is at a fixed location that is not being reached during normal prints. An idealized deployprobe.g would look like this for a cartesian where the magnet is reachable when going to 0 on the X axis:
G91 ; relative positioning G1 Z7 F600 S2 ; lift Z relative to current position G90 ; absolute positioning G1 X0 F1800 ; move X to zero for magnet action
- homing z with a z probe requires a simple
G30
.
The challenge here is that I cannot move to my desired location (for example, middle of the bed, keeping probe offsets in mind) because the move in deployprobe.g changes the location and the location from before deployprobe.g is not restored. G30 then tries to probe at X0, which in my case is just left of the bed.
Since I cannot easily move the X endstop on my printer, and I really want to probe somewhere else where the deploy trigger magnet is not, I am currently working around by setting the printer coordinates and then prompting for manual triggering using
M291
...So, my question is: Can I prompt the printer to go to a specific location inside deployprobe.g and return to it's previous coordinates? Or even better, how about a
G30 Xnnn Ynnn
which homes at that location, using the offsets from aG31
? -
Is this done with
G60 S1
to store the current position and then aG1 R1
? This would allow me to call deployprobe from wherever and then return to the previous location likeG60 S1 [.... deployprobe code] G1 R1
if I understand the documentation correct. Can anyone confirm?
(The
G0/G1
documentation mentions restore points, where as G60 calls them save points ... that made this hard to find and connect. I'll give this a try tomorrow and probably answer myself here ...) -
That should work. Another way is to use this to home Z in homez.g and homeall.g:
M401 ; deploy probe
G1 X100 Y100 F6000 ; move to bed centre
G30 ; probe
M402 ; retract probeM401 runs deployprobe.g and also flags the probe as deployed, so that the subsequent G30 doesn't run deployprobe.g again. M402 runs retractprobe.g and flags the probe as retracted.