Change Y Axis to negative values

Hello, I am using Lightburn for exporting Gcode toMach4 with ESS which requires custom Gcode commands and only software which supported it in proper way is Lighburn.

Now my problem is: Normally I put home to upper left side. This way the Y axis should be in negative numbers rising downwards. Instead it is rising in positive numbers which causes when I export to gcode and load to Mach4 that Y axis is reversed.

Any solution to this problem?

The basic problem is that LightBurn requires positive coordinates. Matching LightBurn to a negative-coordinate CNC machine involves offsets of one kind or another.

Perhaps:

Another method:

1 Like

What Custom GCode flavor type are you using?
Can you post your Custom Device .lbdev file here in a reply?

Normally so, but since v1.6 negative coordinates are allowed with ‘CNC Machine’ enabled.

For example, here I have forced an Ortur laser to home to rear-right and you can see in the saved GCode the negative coordinates which run fine.

One thing to be aware of is that the workspace coordinates and ‘Get Position’/‘Move to Position’ figures stay positive, however, under the hood it’s negative coordinates as you can see in the saved gcode for this job:

Only problem in application to this particular case is that as far as I know, using ‘CNC Machine’ negates the output coordinates in both axes regardless of where the origin is set, so might not help the OP if only Y is negative.

For now, maybe setup LightBurn with origin front left, and look for a GCode editor (if Mach4 cannot) that can apply transformations to the gcode file - such as ‘Mirror about the X axis’.

T.I.L. how that works! :grin:

I thought it was a bare offset, but IIUC it’s flipping the workspace from Q3 to Q1. In this case, it would also flip the machine’s Q4 to Q2, so the X coordinates would be wrong.

Could combining CNC Mode with an X offset or different origin slide the flipped coordinates from Q2 to Q1?

@ednisley @NicholasL
I had already tested only the negative Y coordinates in Lightburn, but you have to trick the controller into not knowing where the real 0.0 is, in my test, using “Current Position” and turning on the laser with the laser head in the Top-left position as if there were no home switches. It even worked without selecting CNC-Machine.

So basically the custom g code looks like this:

Grbl is Gcode flavor.

You can negate the Y. but have to Y reverse your design before saving.
image

That’s a good idea, you could do something like this;

-‘CNC Machine’ enabled
-origin rear-right
-apply a workspace offset to put the X coordinates to positive,
e.g while in top left position G92 X-400 Y0
-put a little tool-layer rec in top left corner with ‘Frame’ enabled to hold the origin
-use Current Position
-Job Origin top left.

No cnc mode in custom gcode

Possibly? I’m not sure if I’d recommend doing that with the custom gcode at this stage since it’s still somewhat under development and there might be other issues with attempting to negate Y like that.

The other (possibly safer) way is to do it is by a transformation using a third party GCode editor, e.g if you want to output like the orange apply a ‘Y - (axis length)’ translation.

1 Like

Bother, I forgot that you needed it to be in Custom GCode!, and it looks like you definitely need that for your ‘M67 E1 [Q]{power}’ lines.

But actually, since you are using the output file and won’t care about framing you can change your Y axis to negative values simply by including a negative ‘Laser Offset’ like this (not sure why I didn’t think of this before);

It doenst seem to help. One photo is Lighburn preview other how it loads in Mach4


I would like to try solution with 3rd part software to inver Y. What SW did you use for it?

If the red L shape in Mach4 is indicating origin at the top left corner?, then is not your program running in Y neg space now?

Although, because your device Origin was not set to front left corner as it should have been (in LightBurn), your part was also vertically mirrored which you probably do not want. In LightBurn for you, just imagine that the rear left corner is your device origin corresponding to Mach4 home, even though the red dot will be in the front left corner.

Can you show the ‘Program extents’ figures in Mach4? I tested the file output from LightBurn just now and it looks ok to me in Mach4:

Hello program extent:

As you can see the problem still persists. Closest I can get If I set origin as on my cnc so rear left corner but still i get mirrored object:


Please check your settings carefully,

-origin front left
-offset is negative
-absolute coordinates

Even though the origin is set front-left, when you run the job it will be rear-left because of the negative Y offset as shown in the example attached output file.

This quick example was generated from the GRBL device type but it also works for Custom GCode.


xfd.nc (349 Bytes)

Thanks it finally loads correctly:

1 Like

Nice one!

Although you are preparing jobs in absolute mode, can still work in way that gives you a closer (more relative) control over job origin. Just use ‘Alt+Shift+U’ to push selected work to the upper left corner which is where X0 Y0 will be in the GCode.

For example, imagine you have a piece of wood to engrave an oval onto;

-in LightBurn the T1 rectangle here represents the wood;

-then at your CNC machine, from wherever you might choose to zero the machine (G54 coordinates) like in the corner of this jig - the job will be contained to a small area - and you won’t need to think about awkward large absolute offsets for correct job placement.

1 Like

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