If I run this, G1 Z11 F300
either as a macro or in the console it does exactly that. Up 11mm at a speed of 300mm/min.
If I put that command in the device settings/ GCode/End GCode box, it goes much higher. Even if I edit it to G1 Z0.2 F300
it goes quite a bit higher than 11mm.
There may be a G92
offset in effect for all three coordinates, which will put the Z origin somewhere other than where you expect.
Issuing a G92.1
resets that, but it’s not clear to me how the current coordinates will change.
Look into the job’s G-Code to find the G92
that sets the initial offsets.
You may also find a G10 L2
command setting the origin for the current coordinate system.
Those offsets take effect during a job and are (probably) reset afterward, so the coordinates you see in the console need not match the coordinates in effect during the job.
If I understand you, I should look at the complete job in console. Here is from the time it leaves origin until it returns to origin.
G00 G17 G40 G21 G54
G90
M4
M7
G0 X318Y234
M3
Layer 2000
G1 Y240S0F1000
G1 X324
G1 Y234
G1 X318
M9
G1 S0
M5
G90
G1 Z0.2 F300
G53 X6.1 Y344 F2400
M2
[MSG:Program End]
Stream completed in 0:15
I’m pretty new, I don’t see any of the codes you suggested. Should that last G90 be a G91?
GRBL uses the LinuxCNC dialect of the G-Code language:
https://linuxcnc.org/docs/stable/html/gcode/g-code.html
https://linuxcnc.org/docs/stable/html/gcode/m-code.html
Valid commands have a letter and a number, but “adjacent” commands need not have any relation to each other.
Unless a G91
is in effect to select relative motion, which is unlikely to be the case, that G1
command will move the head until it is 11 mm above the current Z-axis origin.
If you see the head move upward 11 mm, then it started at Z=0, which would be set during the homing cycle as the Z-axis carriage trips its homing switch.
If you see it move more than 11 mm, then the Z-axis origin is not where you expected it to be. When the motion finishes, however, the Z axis will be exactly 11 mm above its origin.
In your added code down at the bottom, you can use relative motion to move the head upward (assuming it has that much travel from wherever it started), regardless of the current position and origin, but you must reset absolute mode so subsequent commands behave the way they should:
G91
G0 Z10 F300
G90
Perhaps @berainlb can explain how your machine sets its initial coordinates during the homing cycle, because that’s typically done with the G10 L2
command I mentioned or a G92
command. If you can figure that out, you’ll have more confidence changing the position within the known limits.
I can’t quite recall from memory but I believe GRBL will stay on the last used work offset even after homing. Or perhaps it defaults to no offset.
But that’s not really important in terms of LightBurn. LightBurn will always issue G54 for g-code so you’re always working in G54 for LightBurn generated code for GRBL.
In any case, I suspect you’re dead right about the issue being a matter of G90 vs G91 in this case.
Thanks that works. One more question. On the rare occasion that I don’t want this to run. Can you comment out the gcode or do I have to remove it?
In theory, yes.
In practice, It Depends™, because it’s never clear what gets sent to the controller or how the controller interprets it.
GRBL should ignore comments, per the LinuxCNC spec, but most host programs strip the comments before sending to improve the data rate. If your commented lines don’t show up in the console, that may be what’s going on.
A few careful experiments outweigh a kilo-opinion!
At least from a sending perspective LightBurn makes no attempt at parsing the text in those fields. It will dutifully send whatever garbage you include in those fields whether it’s properly formatted g-code or not…
That certainly simplifies the debugging!
Back in the day, at least one version of Marlin required capital letters, which the slicer produced, but I used lowercase letters in my prefix code. The streaming program passed them unchanged.
Hilarity ensued.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.