I’m making this post to help people understand how to properly set and use multiple work coordinate offsets in the Buildbotics controller since I found this process very confusing initially. Hopefully someone finds it helpful.
Here, I’ll describe a common experience for someone first attempting to set multiple WCS:
You place your spindle at the desired origin for your G54 coordinate system and hit the zero button in the UI or probe XY. Next, you run G55 from the MDI and jog to a second location and do the same thing. “That was easy!”, you think to yourself as you punch G54 into the MDI. Then you look at the DRO and your heart sinks, X=0.000 Y=0.000. What happened? Where did your first work coordinate system go?
Probe, Zero, and Set-Position in the UI are all G92 commands:
This was the biggest point of confusion for me as a new user; the Buildbotics UI does not make it clear what gcode is actually executed when you probe, zero, or use the set-position buttons. Using the zero buttons or probing (effectively) performs a G92 X0 Y0 Z0 A0
command (depending on the axes being zeroed). I say effectively because probing operations compensate for bit radius. The “set position” buttons do exactly the same thing, but you can choose what position the current location should be mapped to. Hitting the zero X button in the UI is the same thing as set position 0 or G92 X0
.
What does G92 do?
To explain this, I’ll borrow from the linuxcnc documentation. Suppose you wanted to mill four different parts in batches. You create a pallet that you can repeatably fixture your parts to at known offsets from one another. The origins of the bottom two parts are 6in below the origins of the top two parts and the origins of the left two parts are 10in from the origins of the right two parts. With this information, you prepare a batch job in your CAM program. You model your pallet and tell the software where each part’s origin is in reference to the others. You assign G54-G57 to each of the origins and you export your gcode to run on the machine. You prepare your stock on the pallet and secure the pallet on the bed. There’s only one last thing to do; the machine needs to know where the pallet is. The locations of each part relative to each other are known to your CAM software, but the actual location of the pallet within your machine is completely unknown. By default, the origin of your G54 part will most likely be your machine origin. This is what G92 solves. The G92 command allows you to offset all work coordinate systems by the same amount. By probing the G54 origin of your pallet and using a G92 X0 Y0 Z0
command, you have shifted all of your part origins from their previous locations (with G54 likely centered at the machine origin) to their actual location within the machine.
This is why the UI can’t be used to set the origins of each WCS. There just aren’t any buttons for setting the position of each WCS, only buttons for offsetting them all by some constant displacement. In the scenario described at the beginning, the user’s G54 and G55 begin at the machine (G53) origin by default. Each time the user zeros, both the G54 and G55 coordinate systems are shifted to the zero location. The user never actually created an offset between the two coordinate systems.
How to do it properly:
- Ensure that the machine is homed. G92 commands will still execute when the machine is unhomed, but they don’t change offsets as I described above. This will cause all sorts of chaos if you’re trying to use multiple WCS. Ask me how I know. If you don’t want to deal with stall homing, you can just jog to your desired machine zero and run
G28.3 X0 Y0 Z0
from the MDI to set your machine home. TheG28.3
command can also be used to write a probing macro that sets your machine home for greater repeatability compared to stall homing (probably). - Activate your desired work coordinate system from the MDI (
G55
, for example) and jog to the location that you want to become your WCS origin. - Set the current location as your WCS origin.
G10 L20 P0 X0 Y0
,G10 L20 P0 Z0
. These make great macros. TheP0
parameter indicates the currently active WCS; you can also index other WCS explicitly. - Switch to another WCS and repeat the process.
G56
, jog,G10 L20 P0 X0 Y0 Z0
. - Now, you should be able to jog between the two stored locations.
G55
and the XY origin button should take you to your G55 origin.G56
and the XY origin button should take you back to your G56 origin.
That’s it! Once you understand that the UI buttons won’t help you set relative offsets between each WCS, the process isn’t that complicated.
Gotchas:
Even after properly setting your WCS offsets, a G92 will shift everything. You need to be careful about when you use the buttons in the UI. If you aren’t sure if a G92 is active, you can check to see if it’s enabled with (DEBUG, #5210)
. If you want to temporarily suspend G92 offsets, you can use G92.2
. You can then restore your G92 offset with G92.3
. You can completely wipe the G92 offset with G92.1
.
Final Notes:
I’m new to CNC, so maybe all of this is standard and only confusing to new users. Everything here has been pieced together from reading the source code, reading the documentation, and doing experiments. If I got something wrong, feel free to correct me. Check the LinuxCNC documentation if you want to understand what each of these commands do in more detail or how to adapt them to your needs: G-Codes, Coordinate Systems, M-Codes, O-Codes, Expressions and Overview, Everything. Buildbotics doesn’t run LinuxCNC, but the gcode is patterned after it. There are plenty of missing features and bugs in the Buildbotics implementation, so test everything in the MDI first. Hopefully this was helpful!