GCode Z Height issue in Current Position Mode (Neje Max 4)

Hello people, I’m back again ! :grinning_face:

I’ve noticed what I’d say a wrong behaviour about the GRBL code.

Let’s start from the beginning:

I have a Neje Max 4 which is a f**ing pain to set for the Z axis. It has some kind of reversed mathematical operation where you must make an offset adjustment in the engraving level to let the laser get in the correct focal distance; setting material thickness (Lightburn) doesn’t work well so you must consider an initial +47 offset (meaning laser focal point is 47 mm above the bed level).

So, a clever guy on YT showed how to get rid of this issue permanently by setting once-for-ever machine GRBL in that exact offset

G10 L2 P1 Z-47

by doing this, after homing process machine sets its XYZ at the correct positions (X=0, Y=450, Z=47) so, when you go into engraving, Lightburn usage is perfect as every other machine.

BUT

if I use ABSOLUTE COORDINATES the Gcode produced by Lightburn starts with

G00 G17 G40 G21 G54
G90 (All distances and positions are Absolute values from the current origin.)
M4
; Scan @ 6000 mm/min, 0.2% power
M8
G0 X306.788Y363.835
G0 Z10 (Move to this Z height according to the given material thickness)

If I go with CURRENT POSITION the Gcode is

G00 G17 G40 G21 G54
G91 (All distances and positions are Relative values from the current position.)
M4
; Scan @ 6000 mm/min, 0.2% power
M8
G0 X6.556Y1.744
G0 Z10 (Move Z according to the given material thickness)

this is giving an issue as long as with CURRENT POSITION Z axes gets 0-ed so it moves +10mm from where it is in that moment; this means that I should put laser at my ground position (meaning my engraving basement surface) so it gets 0-ed and let it raise by given material thickness amount. This would make laser behave in the correct way BUT it’s obviously unhandy as long as while positioning and framing we usually keep laser head at top height (to avoid underneath material).

SO

I think the G91 command doesn’t keep into consideration this.

I’m also thinking that this problem doesn’t occur with good quality lasers as long as they don’t need this offset process, so their natural homed Z position is 0 (not +47 like in the Neje) so, even if you start them with the G91 code, it remains 0 and everything works well.

I’m still doubting that this can be related to something I’m forcing with this custom Neje process, also the frequent firmware updates let me think about some machine issues BUT, in the end, I think it would be just logic that Z position reset done by the Gcode shouldn’t be done as long as Z is never supposed to be initially set by the gcode:

  • If manually adjustable, is not supposed to be controlled by the gcode.
  • If motorized, it’s supposed to be always at its preset 0 (maximum) height.

Can’t avoid this even with a pre-gcode command into Lightburn 'cuz that G91 will occur after it.

So, in the end, I’m fine with ABOSULTE COORDINATES while in CURRENT POSITION MODE I have to preset my focal distance before engraving and put material thickness = 0.

Thanks for your time and patience

:growing_heart:

When using Absolute coordinates, every move is relative to a known position, the Home position. All plus and minus moves are predictable because they reference a fixed point.

In Current Position, there is no reference point. It is simply Start Here and hope for the best. If you do not select the correct starting point, you will not get the correct motions. The Zaxis is no exception. There is no way you can juggle the math and it mysteriously work.

Absolute: Predictable and repeatable. :grinning:
Current Position: You have to know exactly where you are and exactly where it will go. :flushed:

G90: References a single point for all moves. Know as absolute moves.
G91: References the current location for each next move. Known as incremental moves.

Thank you for your effort but I’m talking about an exclusive issue due to Neje Z management

2 Likes

I get it now. I missed that part about putting in the material thickness.

1 Like

Anyone from the support please?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.