Multiple Origins Has Unexpected Behaivior on BB Controller / Solved works as expected using G92 offsets

I have been playing with origins again to get a firm understanding as to how they work on the BB controller.

I used them several times a couple of years ago but found setting origins other than G54 was buggy and really only worked reliably right after a reboot. That was on 1.0.9 for completeness. I am on 1.3.1 now and used multiple origins this last weekend but still found them not to work as expected unless I rebooted.

Now I think I know why.

From the cheat sheet on the controller screen it says:

G10 L2 offsets the origin of the axes in the coordinate system specified to the value of the axis word.
The offset is from the machine origin established during homing.

This is the same wording as in the Camotics docs - [Camotics - G10]

Through my testing tonight I have discovered these point:

1:
For the purpose of G10 L2 the machine origin is the same as machine home only if you have not set a work origin using any of these buttons or used the touch probe.

Untitled

In other words – after homing the machine you can set origins like this:
G10 L2 P1 X10 Y10 ; ← G54 will be set to X10 Y10 from home
G10 L2 P2 X10 Y20 ; ← G55 will be set to X10 Y20 from home

And this also works as expected:
G10 L2 P1 X0 Y0 : ← G54 will be set back to machine home
G10 L2 P2 X0 Y0 ; ← G55 will be set back to machine home

2:
Setting your work origin is not generally possible like that. So we use the probe block or paper and use the axis origin buttons.
But this makes your work piece origin the machine origin for the purpose of G10 L2. Having G90 or G91 set before calling G10 L2 makes no difference.

So now all origins will be set relative to G54:
G10 L2 P2 X10 Y20 ; ← G55 will be set to X10 Y20 away from where G54 is set.

And this also happens:
G10 L2 P2 X0 Y0 ; ← G55 will be set back to the same origin as G54

3:
But here is an even stranger thing. Once you have some origins - G55, etc, set as in point 2 - use the probe block or axis origin buttons to set G54 to a new location. Do not change any other origins – G55, etc.
You will find that all the other origins will have shifted with the G54 to maintain relative distance from it.

So if you set G55 like this:
G10 L2 P2 X10 Y10 : ← G55 will be X10 Y10 away from G54

Then move G54 using probe or buttons to some other random place you will find that G55 has moved so it is still X10 Y10 away from the new G54.

I cannot see how this behaviour complies with the standard set out in the Camotics manual but at least now I know what is happening I can figure out how to use origins more reliably.

Comments or your own results welcome.

Hey Chris,

I cannot reproduce what you describe (I am at v1.0.9 however). The coordinates you give with G10 L2 P{1-9} are machine coordinates (G53). Buildbotics calls them “absolute” which may be misleading, they are shown in the “Absolute” column on CONTROL page. On Buildbotics, “Position” = “Absolute” − “Offset”. The correct term however is machine coordinates (and G53 G0 X0 Y0 Z0 goes to machine zero or machine origin).

G10 L2 offsets the origin of the axes in the coordinate system specified to the value of the axis word. The offset is from the machine origin established during homing.

– Source: G10 L2 (Set Coordinate System) – LinuxCNC

G10 L2 P2 X10 Y20 ; ← G55 will be set to X10 Y20 in machine coordinates (X+10 and Y+20 away from machine zero (G53))

You can select one of the nine systems by using G54, G55, G56, G57, G58, G59, G59.1, G59.2, or G59.3 (see Section 3.5.13). It is not possible to select the absolute coordinate system directly.

You can offset the current coordinate system using G92 or G92.3. This offset will then apply to all nine program coordinate systems. This offset may be cancelled with G92.1 or G92.2. See Section 3.5.18.

You can make straight moves in the absolute machine coordinate system by using G53 with either G0 or G1. See Section 3.5.12.

Data for coordinate systems is stored in parameters.

If origin offsets (made by G92 or G92.3) were in effect before G10 is used, they will continue to be in effect afterwards.

The coordinate system whose origin is set by a G10 command may be active or inactive at the time the G10 is executed.

–Source: The NIST RS274NGC Interpreter - Version 3

When G92 is executed, the origins of all coordinate systems move. They move such that the value of the current controlled point, in the currently active coordinate system, becomes the specified value. All of the coordinate system’s origins (G53-G59.3) are offset this same distance.

– Source: G92 (Coordinate System Offset) – LinuxCNC

The “axis zero” buttons on CONTROL page in fact execute a G92, which means they set the current position in the currently active coordinate system in effect to zero. “Absolute” and “Position” values are updated accordingly in the table.

G92 is also the most important command of a touch plate probing routine. It is set after the probe took the three axes (ore one axis when probing Z) values for the workpiece and makes the position the workpiece zero. If you use multiple coordinates systems G54–G59.3, I would probe first and then have the wood blank or your multiple fences clamped to the wasteboard in a way the workpiece origin is the one you want for all coordinate systems, that are then all relative to the G92 probed zero coordinate. Just be sure that you probe when G54 (or the correct plane you want as reference position for the other planes) is in effect.

1 Like

Thanks Aiph5u,
There is much to absorb. I read thru all the links you provided to fully understand how offsets work.

The key take away to me is that when setting a work origin I am not setting just G54 but rather am using G92 to offset all origins.

And to clear one thing up in my mind: G53 is the same as machine home? and cannot be moved?

To put it simply so I can visualize it in a very step by step manner:
When you home the machine all offsets are set to the home position - i.e. G54 - G59.3 are all zero at home position.
There are no G92 offsets active. ( I assume G92 Persistence #5210 is disabled on startup )
Setting a work origin using probe block or axis origin buttons actually sets the G92 variables ( #5211-#5219) such that G54 - G59.3 appear to be at the newly set work origin. ( G92 is global so all origins appear to have moved by the amount in the G92 variables) In actual fact G54 - G59.3 variables (#5221-#5390) are still set to zero from machine home.

Now if I enter this command:
G10 L2 P2 X10 Y10
then G55 will indeed be set to X10 Y10 away from machine home. But then the G92 global offsets get added to them as well. So they appear to be X10 and Y10 away from where I set the work origin. Or in other words the G55 ends up being X10 and Y10 away from G54 instead of what I would have expected which is machine home.

So then if I move my work origin to a new place using probe block or axis origin buttons I am actually just putting new values in the G92 variables. So when I call G55 again it will put that origin at X10 Y10 from machine home plus the new offsets in G92 variables. So G55 appears to move relative to G54. But that is somewhat an illusion because G54 is still at machine home. It is the G92 variables I am moving relative to.

Am I correct in my simplified view?

Hey Chris,

G54 is just a coordinate system like the others, with the exception that it is selected after power up. All G54–59.3 commands persist until another of them is given.

You may have a G92 offset in effect before switching to another coordinate system (e.g. to the one selected with G55) and the G92 offset will remain in effect (=the G54–G59.3 coordinate systems add on this then) or you may set G92 later, which will have the same result.

See Coordinate Systems – LinuxCNC.

G53 – Move in machine coordinates

But this has nothing to do with G54. G55 is a coordinate system of its own. The offsets are given in machine coordinates and a G92 offset adds to all coordinate systems.

1 Like

Yes, now I understand. That was my confusion in my first post ( and for many years ) that I thought I was setting G54 when touching off a work piece. I could not understand why all the other origins moved relative to G54 that I thought I set. It is the G92 offsets I am actually setting.

It looks like the only way to actually set G54 variables is thru:
G10 L2 P1
or
G10 L20 P1 ← i don’t fully understand the use for this yet.

As an aside: How do we use or check a variable? For instance if I wanted to see what value is stored in #5221 can it be done on the controller?
I see how variables can be used in a program like G10 L2 P2 X[#5221+5] Y[#5222]
So I was thinking I could see the variable in a message box like this:
(MSG, X = [#5221])
But I don’t think that works.

Hey Chris,

“msg” does not resolve the parameters, but “debug” and “log” do. You can use

(debug, the value of 5221 is #5221)
(log, the value of 5221 is #5221)

G10 L2 (Set Coordinate System) sets values for the coordinate system P. P is one coordinate system of {0–9}

G10 L20 is similar to G10 L2 except that instead of setting the offset/entry to the given value, it is set to a calculated value that makes the current coordinates become the given value.

G10 L20 Example Line

G10 L20 P1 X1.5 (set the X axis current location in coordinate system 1 to 1.5)
1 Like

Yup, they work great, thanks

Thru simple testing I see that G10 L20 works opposite to G10 L2
G10 L2 P1 X10 -makes the X axis to read X-10 so the origin has been set 10 to the right.
G10 L20 P1 X10 -makes the X axis to read X10 so the origin has been set 10 to the left.

Thanks for all the help. I feel very confident using origins now.

1 Like