Skip to content
Home » Documentation Home » Coordinate systems & workpiece alignment

Coordinate systems & workpiece alignment

The most important links to the topic of coordinate systems:

LightBurnGRBLLinuxCNC CNCCookbook’s G-Code Tutorial & CNCCookbooks Offsets

Clarification of terms

There are two coordinate systems to distinguish. The machine coordinate system and the workspace coordinate system. These systems can be the same, but they don’t have to be. The firmware takes over the conversion of the coordinates if both systems are different.
Machine coordinate system: This coordinate system is the internal coordinate system of the firmware. It is set either at start or by a reference ride (if set). As a rule, the coordinates do not have to interest the user. They can be (and by default are) negative.
Workspace coordinate system: In this coordinate system (also known as the G54 coordinate system), the user’s control commands are executed. This allows the user to set different coordinates or limits than are available in the firmware. It is even possible to use other working coordinate systems and set two different positions as their zero points. But this usually leads too far for normal use. It is important that you can change the “normal” zero point of the system, which is necessary in different constellations. If you are interested in checking this further, here is a nice video about that: https://www.youtube.com/watch?v=fGtbkVJBXyE

Laser / Firmware

The following picture shows the coordinate system of grbl or CNC machines in general. The origin of the coordinate system is at the back right and goes in the positive direction to the back and right. That is, the work area is completely in a negative coordinate space. The further forward and left you move, the more negative the coordinates become. Ultimately, the front left corner corresponds to the maximum workspace size in a negative form: -Xmax and -Ymax.

Coordinate system of grbl

Set Zero Point

There are two ways to set the zero point of the machine (machine coordinate system):

  • With limit switches and a homing cycle
  • By moving the laser to the desired [0,0] position BEFORE switching on (at the moment of startup, the firmware sets the current position (work area and machine) to [0,0]). This is also maintained until the laser has been switched off or a reference run has been carried out. [Note: The laser will not turn off if you only press the power switch. In addition, the USB cable must also be de-energized, see chapter Firmware-Update]

You can manually tell the firmware at a certain position that the zero point for the work area should be set here. This makes it particularly easier to work with LightBurn, as LB sets the origin to the bottom left (see below). The command to set the zero position at the current position where the laser is currently standing is

G10 L20 P1 X0 Y0

So this is best done after moving the laser to the bottom left. However, this only sets the work area to [0,0] , the machine coordinate system is not. This keeps its zero point where it stood when it was turned on. If you have the position of the laser output, you get accordingly other (e.g., negative) values. You can change this by issuing $10=0 in the console. This sets the reporting to the workspace coordinate system. If you have carried out the firmware update of LaserGRBL as described in the chapter Firmware Update, the option “#define HOMING_FORCE_SET_ORIGIN” is activated, which leads to the [0,0] position (in machine coordinate system) being set in the place of the reference corner.

In addition, it should be noted that the above command stores the coordinates permanently. So, it only makes sense to use it if you use the automatic homing because otherwise you have to run it every time after switching it on or moving the laser by hand (since the start coordinates have most likely changed).

If no limit switches are mounted and therefore no homing is possible, you should move the laser head to the front left before starting and then switch on the machine. This is the only way to use the entire working space without further tinkering.

LightBurn & LaserGRBL

LightBurn and LaserGRBL work with the coordinate system origin at the bottom left. This is the most intuitive from the user’s perspective, as coordinate systems often start at the bottom left.

LightBurn coordinate system

In these screenshots you can see the coordinate systems of LB and LaserGRBL.

So, when LB or LaserGRBL send a command to the laser, it is sent in the workspace coordinate system. Suppose the laser is in position [0,0] (regardless of where the head actually stands, the decisive factor is where it stood when it was switched on, whether a homing cycle was made or whether a working coordinate system was manually set). In LB or LaserGRBL, if you give the command to move to the position [20,20], the laser will move 20 mm to the right and 20 mm to the rear. As discussed earlier, this is done in its workspace coordinate system. If the laser is already in the back right, it will drive into the frame. If it stood in the middle, it then stands 20 mm next to and behind the middle.

LB also offers the option of taking the “current” position as the starting point instead of the absolute position. This makes it possible to easily find the target point by manually positioning the laser at a corner or center of a workpiece and then starting the process. Then the coordinates are not used relating to the frame of the laser, but to the current position. For more information, see the LightBurn documentation or the following video:

LightBurn tutorial

Necessity of automatic homing

A question that often arises is whether you need limit switches / automatic homing at all. There is no general answer to this question. Theoretically, this is not necessary for operation. As described, there are also manual methods for aligning the laser. From my perspective, there are the following points to consider:

  • Monitoring / securing the working area: If the laser has a defined and known position at all times, you have the possibility to secure the working area. By using the so-called soft limits, the firmware can cancel commands that would guide the laser outside the working area. So, you can no longer crash into the frame, which is very gentle on the mechanics. However, this can also be achieved with the hard limits, for this purpose, a limit switch must be installed at each end of each axis, and the laser stops automatically when touched.
  • Repeatability: Since the laser with automatic referencing always starts at the same point, it is easier to create series of objects or stop and resume projects. The laser always has the same position during lasering.
  • Intuitive operation: If the coordinate system is set up parallel to the control software, the laser will also laser exactly where the object is displayed in the software’s work area. This usually makes operation easier, but is probably also a question of habituation.

Repeatable positioning without absolute coordinates

[Do you have a better / different workflow / method? Let me know and I’ll update this page! ⇒ diy@melvin-isken.de]

Often the question arises how to work with the coordinate system if you cannot use absolute coordinates (if no automatic homing can be done). I would recommend the following procedure in LightBurn if you need repeatable motion of the laser:

It is essential that the laser is NEVER moved by hand. The system has no sensors to determine the position and does not get this shift! It continues to start from the old point!

  • [Optional] Move the laser by hand to the position that is to serve as the starting position and switch it on. The following procedure only works in positive coordinate space, so in the area to the top and right of the laser head. Therefore, you should move the laser down to the left before turning it on.
  • [Move window] With the button “Set Origin” you can specify the starting point for all work. To do this, use the arrow buttons to move the laser to the desired position (if you didn’t do this by hand before turning it on) and then press the button.
  • [Move window] [optional] With the button “Set Finish Position” you can set the position that will be moved to when the job is done. This is helpful, for example, if you have to work on the workpiece between two jobs, but want to continue at the same position afterwards).
  • [Laser window] You can now move the laser back to the position that you defined at the beginning at any time with the “Go to Origin” button.
  • [Laser window] As starting point, you select “User Origin”. That means, jobs always start at the defined “Origin” position and end at the defined “Finish Position” if necessary.

Notice

Set Origin and Set Finish Position only work in positive coordinate space. You can easily set a zero point if you started at a different position and now want to select a position further left / down:
– the laser is moved (by direction buttons) to the place which should be taken as zero position
– in the console, one enters the command “G10L20P1X0Y0” (see also chapter about limit switches). This sets the working coordinate system at this position to [0,0].
– enter the command $10=0 in the console. Thus, the firmware transmits the coordinates in the workspace coordinate system from now on, which is now [0,0] at this position.
Be aware: the G10…-command is storing this position permanently. So you need to either update this at every restart, or revert it after you are done (issue $10=1 and $RST=# in the command line).

At the top of the move window, you can also save several positions, but this only makes sense if you can always start the laser at the same position.

Move and Laser windows in LightBurn

Positioning without absolute coordinates

Usually, it is not required to work with absolute coordinates. Just select “current position” as starting position in LightBurn and you can start right away. The following videos show some methods on how to align objects in such cases.

Here is video of a method to place a piece of material right in the center of the object

Here is another video from Mike, demonstrating some practices:

And here are two videos provided by Eelko for the official Sculpfun user group at Facebook:

Alignment tools

You can also simply use a mechanical stop so that you can always manually move the laser to the same place and thus have the same starting position.

Another option is to use a 3D printer to print out a support for the laser. You place this part on the laser, and then you can align the part exactly with the laser focus. Found on Etsy: https://www.etsy.com/de/listing/1159431135/laser-cutter-engraver-40mm30mm-laser. The free version shown below is created by Andre Champoux. There is another version from Stefano Maltauro: https://www.thingiverse.com/thing:5540992 (picture to the right).

If you don’t have a 3D printer, here is the version of Lydie Du, which can be created with the laser itself. The file can be downloaded here: Download-Link (LightBurn + SVG file; you might need to adjust the parameters in the LB file to your material!).

Here’s Lydies description how it works:

  • The inside corner of the ruler indicates where the laser beam starts (I’m not a pro, so maybe there is a slight deviation). (Photo 3)
  • Where the dot is in your design space (I’m using Lightburn), this is where the laser beam will start. Sometimes it is useful to place a guideline around your design. This is where you should place the inside corner of the ruler on your surface to be lasered. (Photo 4)
  • Place the bar with the inside corner on your surface to be lasered where you want the laser to start. (Photo 5)
  • Slide the laser head all the way to the corner of the ruler. (Photo 6)
  • It’s precisely where I want it. I was able to make optimal use of a scrap piece.
  • Remove the bar when you start lasering! Simple, easy, and fast.

Alignment using a camera (LightBurn)

LightBurn offers another very ingenious feature that allows you to align workpieces via camera image. The camera image is superimposed on the workspace and you can see the real object and align your design to it. Since this only works if LightBurn can correctly superimpose the camera image and the real workspace, a calibration must be performed and saved at the beginning. Afterwards the camera must not be moved, otherwise the calibration must be done again. The instructions can be found here: LightBurn: Using a Camera.

Screenshot taken from LightBurn Documentation

Note on camera type / webcam

The most common question on this topic is which webcam you can use for this. The answer is: any camera that is recognized as a USB webcam by the computer can be used! I tested it with a 10€ China webcam from Amazon. The higher the resolution, the better the detail sharpness. Depending on the distance to the laser, a more or less wide angle / fish eye lens is necessary. The rule is: only as much wide angle as necessary! The fewer pixels that have to be perspective-corrected, the better.

Here are a few more videos on how to set up & use the feature: