Using "secondary" Z probe for X and Y
-
I have a printer with an inductive probe that I want to use for edge detection. I use sensorless homing for rough homing, then probe the bed, then move within trigger range of the probe, and move the print head until the probe doesn't trigger anymore
I have a solution for this which is hacky: I am redefining the Z probe at the beginning of the homing macro, like so:
; -- probe bed. If we can't, something is amiss. G30 if ! move.axes[2].homed abort ; -- wait a hot second G4 S1 ; -- invert z probe compared to normal bed probing operations M558 P5 C"^e0stop" H5 F300 T6000 G31 P500 X{global.probe_x_offset} Y{global.probe_y_offset} Z{global.probe_z_offset} ; -- wait a hot second G4 S1 [homing moves; elided] ; -- re-set z probe to normal mode M558 P5 C"!^e0stop" H5 F300 T6000 G31 P500 X{global.probe_x_offset} Yglobal.probe_y_offset} Z{global.probe_z_offset} ; -- absolute mode G90 ; -- move to center of bed G0 X0 Z10 F1200 ; -- re-home Z for good measure G30
As you can see this is cumbersome because I need to redefine the probe twice to invert it's trigger, once at the beginning of the script, and once at the end. This is also dangerous because if the script fails the redefinition at the end doesn't happen. So not cool. Use of global variables ensures I don't miss these various places but it's not ideal.
Now I know I can define multiple Z probes like so:
M558 K0 P5 C"!^e0stop" H5 F300 T6000 ; set Z probe type to switch and the dive height + speeds M558 K1 P5 C"^e0stop" H5 F300 T6000 ; set Z probe type to switch and the dive height + speeds G31 K0 P500 X{global.probe_x_offset} Y{global.probe_y_offset} Z{global.probe_z_offset} ; set Z probe trigger value, offset and trigger height G31 K0 P500 X{global.probe_x_offset} Y{global.probe_y_offset} Z{global.probe_z_offset} ; set Z probe trigger value, offset and trigger height
But how can I select the second Z probe for my X and Y homing moves?
-
Actually I am getting another error in my config.g trying this:
Error: M558: Types 1,2,3 and 5 are available for Z probe 0 only
Why does this limitation exist? If it's correct, I have no choice other than redefining the probe for the edge sensing step.
-
@oliof yea, you can't have P5 for anything other than probe 0. you can use P8 though
-
@jay_s_uk thanks I will try that should be fine. I still need a way to pick the second probe for the homing operation.
-
@jay_s_uk while config.g throws no error using
M558 K1 P8 ...
querying for the probe after initialization yields an errorM558 K1 Error: M558: Z probe 1 not found
maybe RepRapFirmware ignores the second configuration because it uses the same pin (albeit inverted)?
-
@oliof ah, yes. you can't define the same pin for more than one thing.
can you redefine it in the homing files? -
@jay_s_uk yes, that's my current solution as I showed above, but I hoped for something a bit more streamlined. I guess I will need to live with that.