Using G30 S0 inside homez.g fails
-
@Ralms ok, good luck then.
Works ok for me here with 3.5.2 -
@chrishamm said in [Bug] Using G30 S0 inside homez.g fails:
@Ralms I highly doubt there is something wrong with
G30
. Do you have adeployprobe.g
and/orretractprobe.g
? We also need to know what kind of probe you have configured.Well, I stand corrected, with you asking about deployprobe.g I remembered that I had some old draft gcode there and was the source of the error.
Removing the gcode from that file, allowed G30 to execute.Still, doesn't explain why G30 will execute when called from the Console, ignoring an error at
deployprobe.g
.
Which is concerning, as it leaves the possibility of having the printer probe the bed without the probe being ready.Regarding your question, about the probe, I forgot to share it but, essentially its a Klicky probe, running as type 8 due to being wired on the 1TL.
M558 P8 C"^121.io2.in" H5 F200:100 K0 T2000
@jay_s_uk Just to finish on your insistence in how I was running G30.
Running any of the mentioned configurations for G30 works and probes the bed successfully, that beingG30
,G30 S0
andG30 S0 Xnnn Ynnn Z-9999
.
However, specifyingS0
parameter will execute anyway, probe the bed and set Z, however throws errorError: Number of calibration factors (0) not equal to number of leadscrews (4)
.
The same thing can be said for the parameters X, Y and Z, they are all just ignored, but return no error.So yes, you were right that S, X, Y and Z parameters should not be used with
G30
in this scenario but they were not the source of the issue, as I showed that even running without them would fail anyway. -
@Ralms Thanks for reporting this. I can confirm that
G30 S0
does seem to be interpreted by the firmware as having a P parameter, and causes the error messages, even though the actual probing/homing completes successfully. I'll raise an issue to get this fixed, as G30, G30 S0 and G30 S-4 and lower should be synonymous.For now, don't use G30 S0 for homing, or S0 without a P parameter, until this is fixed, to avoid the error message. Use G30 on it's own.
@Ralms said in [Bug] Using G30 S0 inside homez.g fails:
So yes, you were right that S, X, Y and Z parameters should not be used with G30 in this scenario but they were not the source of the issue, as I showed that even running without them would fail anyway.
I think the code in your deployprobe.g was probably unhoming the X and/or Y axes. Homing by probing in Z (as opposed to homing Z by hitting an endstop) requires X and Y to be homed. This caused the initial 'Error: in file macro line 5: insufficient axes homed' message.
Ian
-
@droftarts Thanks for confirming.
The issue I had in my
deployprobe.g
was that I was trying to raise the gantry in absolute mode without having Z homed yet.
The goal of raising it is to avoid the probe hitting the bet when its attached.Regarding G30, yeah, I will be using it without any parameter, its achieving the same end-goal, so I'm ok with it.
I just hope that someone doesn't get caught off-guard by G30 ignoring failures in
deployprobe.g
when called from the console, as it could mean the probe is not even deployed/attached and than the printer rams the hotend into the bed waiting for a trigger.
This is a very niche scenario and would require the probe to be setup incorrectly (normally open instead of the more reliable normally closed and opens on trigger), but still, its a possibility. -
@Ralms note that when you call a homing file it first flags the axis as unhomed. My guess is when you did it from command line you had already homed the z axis?
-
@engikeneer said in Using G30 S0 inside homez.g fails:
@Ralms note that when you call a homing file it first flags the axis as unhomed. My guess is when you did it from command line you had already homed the z axis?
When calling from the console, is just doing G30.
G30 only resets the Z axis and doesn't touch X or Y.
And yes, before calling G30 from the console, I already have the X and Y homed and with the probe in place. -
@Ralms so basically, when you called G30 from console, Z was already homed, so the problematic G1 line to move an unhomed axis in your deployprobe.g wasn't an issue? But when calling homez.g with just a G30 in it, the z axis is marked as unhomed before deployprobe.g is called and hence you got the error. Your problematic command was to move z anyway so x and y don't come into it.
My point is that I think the behaviour you're seeing there is fully expected and 100% explainable
-
@engikeneer said in Using G30 S0 inside homez.g fails:
@Ralms so basically, when you called G30 from console, Z was already homed, so the problematic G1 line to move an unhomed axis in your deployprobe.g wasn't an issue? But when calling homez.g with just a G30 in it, the z axis is marked as unhomed before deployprobe.g is called and hence you got the error. Your problematic command was to move z anyway so x and y don't come into it.
My point is that I think the behaviour you're seeing there is fully expected and 100% explainable
You miss understood.
Z is never homed in any of the scenarios I've mentioned (doing Home Z in the UI or calling G30 in the console), only X and Y are.So yes, my G1 move in the deployprobe.g was a problem always as it was trying to move Z20.
The issue I'm raising now, is that G30 will execute from the console, even if deployprobe.g fails, it just ignores it and that should never happen.
-
@Ralms if you want to retain the clearing move on the z axis, you could do an unhinged move like this
G91 ; relative moves G1 Z10 H2 ; move up 10mm G90; absolute moves
-
@Ralms said in Using G30 S0 inside homez.g fails:
The issue I'm raising now, is that G30 will execute from the console, even if deployprobe.g fails, it just ignores it and that should never happen.
G30 works from the console or from within a macro, whether the Z axis is homed or not. The X and Y axes must be homed. When G30 is called, it will run deployprobe.g if the probe type requires it. When and why might deployprobe.g fail, and how would it know if deployprobe.g has failed? If running G30 from the console, it could possibly be too low to fully deploy, eg BLTouch, or off the bed, but I'd say this was operator error rather than the firmware's fault. You could have a check in deployprobe.g for current Z height, if it is below say 2mm, or if the axis is unhomed, move up 5mm. The stock homez.g from the configuration tool moves the Z axis up 5mm before homing to avoid this.
Ian