Macro to zero the laser to the same point as the CNC

I have a Millright Carve King with a Jtech Laser. The laser mounts to the front left of the router clamp giving is an offset of X31.5 X Y73.92. I’ve carved a grid into my spoil board and would like to set up a macro that will bring the laser to the same zero point as the CNC. I’ve set up other macros to make sure the workspace is proper for lightburn such as the work offset of g10 L2 p1 x-432 y-432 and set $10=0. I can then get lightburn to zero to the front left. From there I can send G91 X31.5 Y73.92 and it works as it should, but if I use the job function to say navigate to x2 y2 G91 no longer works and seems to want to work from Machine zero rather than work zero.

What am I missing?

G91 doesn’t set a new work zero. G91 changes the position values to increments rather than absolute values. So, for example, when you zero your system and then command G91 X31.5 Y73.92, it WILL go to the right place, but ONLY because you’re starting at 0,0. If you were starting at 2,2, for example, G91 X31.5 would send your gantry to X=33.5.

What you need is (don’t use G91 at all):
Zero your gantry then:
G0X31.5Y73.92 <= this will move your gantry to your grid 0 (from what you’ve described)
G10 P1 L20 X0 Y0 <= this makes the current position (31.5,73.92) your new work zero.

Now, if you issue G0 X2Y2 the gantry will move to your work zero + 2,2

Thank you I’ll try that. I thought g91 was relative and incremental to the current position? no?

It is relative, but to current position, not work coordinates and it has no effect on the work coordinates. You want to set your work coordinates to your new zero position.

NOTE that I updated the set work coordinate command. Apparently GRBL uses G10 command.

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