How to find which line throws an error?
-
I keep getting
Error: G0/G1: target position outside machine limits
But visually inspecting the gcode I can't see why.
It goes a few mm negative on X and Y, but shouldn't be a problem as Work Coordinates 0 are set at about X120 Y580.
; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X695 Y835 Z66 S0 ; set axis maxima
Is there any way to get the error to actually state which line is supposedly outside machine limits?
-
-
I used to get this error when running a g-code file where I had either forgotten to zero the X, Y and Z axes at the workzero spot (so the machine thought X, Y and Z zeros were at it's Home position), or the job I was trying to run had a Z height "safe" clearance that was too high for the available Z height movement.
The latter reason occurred when I used files I'd designed in Carbide Create, so reducing the safe Z worked for me, but bear in mind the safe height is there for a reason!
-
@nightowl
Yes it's very strange. For some reason when using Work Coordinates and setting Z=0 with the Z-Probe, the machine won't go to Z0.M208 Z-0.01 S1
If I add this to the end of my Z Probe macro, the file will run through as expected.
Easy enough workaround, but it seems something fishy is going on, as on a freshly homed machine without work coordinates I can indeed trigger G1 Z0 without errors.(I'm clicking the Set X and Set Y in DWC to set work coordinates, leaving Z alone)
M291 P"Probing to find Z=0" S0 T2 G90 G0 Z35 ; Quick move down to Z30. (Comment this out for long drill bits) M208 Z-10 S1 ; Temporarily allow negative movement G30 Z-205 ; Single Z Probe. (Descend slowly untill the probe is triggered) G1 H3 Z205 F360 ; Move Z up stopping at the endstop and set Z maximum to current position. M208 Z-0.01 S1 ; Allow slight negative to prevent errors on G1 Z0
-
@tqkez-0 said in How to find which line throws an error?:
Yes it's very strange. For some reason when using Work Coordinates and setting Z=0 with the Z-Probe, the machine won't go to Z0.
Do you have mesh levelling enabled? That may be relevant.
-
Still struggling with this. Just can't work it out. I'm not using mesh levelling (at least I've never enabled it intentionally and I don't see anything related to it in my configs)
;Run the Z Probe at the current position M291 P"Probing to find Z=0" S0 T2 G90 G0 Z30 ; Quick move down to Z30. (Comment this out for long drill bits) M208 Z-10 S1 ; Temporarily allow negative movement G30 Z-205 ; Single Z Probe. (Descend slowly untill the probe is triggered) M208 Z0 S1 ; Dissallow negative movement G1 H3 Z205 F360 ; Move Z up stopping at the endstop and set Z maximum to current position. M208 Z-0.75 S1 ; Allow slight negative movement for drilling etc
This is my Z-Probe Macro which I just ran to make 0 the top of the spoils board.
In this Job I have the final contour pass set to go -0.1 to make sure it goes all the way through and skims the spoils board by a hair.
Ran the job and it quits at line 1380 with this as usual.
Error: in GCode file line 1380: G1: target position outside machine limits
1379 G1 X144.661 Y19.888 1380 G1 Z-0.1 F250 1381 G1 X144.527 Y20.25 F1920
Given that my probe macro just set Z axis minimum to -0.75, why is it triggering this error?
What common can I issue to the console to check what Z axis minimum is actually set to to check if its working?
EDIT:
Could it have something to do with Tool Change?
Even though Fusion360 free wont combine multiple tool operations into a single NC program, this operation is still technically tool 5 in the list so the post processor is including a T5 command at the beginning of this program.Could that be wiping out my M208 minimum?
I dont see anything in the Duet or Reprap docs about whether M208 is applied per tool, or globally.
If it is per tool, how would one set it for every tool? -
@TQKez-0 said in How to find which line throws an error?:
What common can I issue to the console to check what Z axis minimum is actually set to to check if its working?
Just send M208 with no parameters.
You could also put the following into your code in areas you suspect.
echo "Z minima is : " ^ move.axes[2].min
-
@TQKez-0 said in How to find which line throws an error?:
Is there any way to get the error to actually state which line is supposedly outside machine limits?
This has been fixed in 3.5.0-rc.2. See https://github.com/Duet3D/RepRapFirmware/issues/800