Work offsets (G54-G59)

Here is an old thread I started and answered after figuring our wcs for myself… May help in some way…

1 Like

Funny you mention that. Your thread is the one that i found most of my information regarding work offsets. I’m surprised more people aren’t asking about this topic.

Based on your thread though, you’re editing your g-code manually correct?

So basically the process would be post your CAD in fusion, Copy g-code and paste into notepad (or some other text program)
On the machine, Home> then set zero for G54> then Jog machine to your zero locations for other fixtures and make note of the XYZ coordinates.

In g-code, Paste code, then set each offset using G10

So something like this? Can I just reference the G10 list at the top of my G-code like this the onetime?

N5G10 L2 P1 X0 Y0
N10G10 L2 P2 X12.123 Y0

N25 S20000 M3
N30 G54
N35 G0 X4.075 Y2.025
N40 G43 Z0.6 H1
N45 G1 Z0.2 F160
N50 Z0.0994 F53.33
N55 Z-0.035
N60 X4.0747 Z-0.0389 F160
N65 Z0.6
N70 G53 G0 Z0
N75 G53 G0 X0 Y0
N80 M30
%

N85 S20000 M3
N90 G55
N100 G0 X4.075 Y2.025
N105 G43 Z0.6 H1
N110 G1 Z0.2 F160
N115 Z0.0994 F53.33
N120 Z-0.035
N125 X4.0747 Z-0.0389 F160
N130 Z0.6
N135 G53 G0 Z0
N140 G53 G0 X0 Y0
N145 M30
%

Just tried this ^ and it does work. The machine ran the first code at my Zero location. and then ran the second one where I set G55.

Cool.

Still wish you could set your G55-59 locations in the 1F controller and forgo having to edit your G-code

Yeah that is how I solved for it… Manually replicating it. Because of wither building a fixture plate with repeatable locations or batching out the same project each time the workflow has worked well for me. I have applied it a few times now. I did not however think about the adjustment to x which would have helped the last time as my wasteboard bowed and so one of my positions was off on x a bit

Yeah I dont trust my fixture to be perfectly square to the machine haha but I’m glad this works. Should help out batching multiple items.

Also, I did find that right after homing, if you run a file with your G10 settings, the 1F controller will retain your g54-G55 positions. So if you have permanent fixtures with a known coordinates, you can run this before you run your programs. As long as Fusion (or other cad program) references G55 or G56 ect., the machine will move there. So you wont necessarily have to edit each G code file. I think you referenced this as a Macro file?

%
(T1 D=0.25 CR=0 - ZMIN=-0.75 - FLAT END MILL)
N10 G90 G94 G17 G91.1
N15 G20

N20 G53 G0 Z0

N21 G10 L2 P1 X0 Y0
N22 G10 L2 P2 X11.99 Y-0 Z-.072
N23 G10 L2 P3

N24 M30
%

I have been following this thread and have started to think about how to make this simpler.
Check out this topic i started and give feedback. Perhaps we can make something workable.
Work Coordinate Offset App proposal

1 Like

I looked at your app, Nice job. I like the idea of just punching in the XYZ for offsets and having it automatically do the G code for you. I would imagine that is how other controllers do it.

Hello All on this topic. I am a retired Journeyman CNC machinist with over 45 years of experience with CNC Mill, Lathes, Wire EDM and 5 axis, programing with Mastercam CNC software. I retired May of 2022 and received my Onefinity in August. The onefinity is the best machine I found for the price range. But I found two flaws I did not like! There is not a feed override on the controller and the machine was set up to probe the part and start running without a way to check your program before you start cutting. That’s an absolute no no for me! First, I stop using the probe and replace it with G55-G59. I can set these values by using an edge finder for x and y zero and z with a 1" block to touch off the top of part. I made the following changes in the control settings.

GCode
On program start (Runs at program start)
G90(Absolute distance mode)
G17(Select XY plane)
G10 L2 P1 X0 Y0
G10 L2 P2 Xxxxx Yyyyyy Zzzzzz (XYZ distance from home to part zero)


P1 = g54 input
P2 = g55 input
P3-P6 = g56-g59 input
Xxxxx Yyyyyy Zzzzz = X Y Z distance from home position.
Z can be adjusted to dryrun your program above you part before cutting. I like to leave G54 zero.
example:
Let’s say the distance from the tool tip at home to the top of part is Z-3.250. Instead of putting the full Z-3.25 you can raise the tool 1" by using Z-2.350 to dryrun your program first without touching the part.

This method can be used for a single part and multiple parts.
I used ( ) to eliminate the probing in the tool change area.

Have g55-g59 in your program
For multiple parts list the G10 line for each part in the setting
Later I may make a program to probe and put the values in P1-P6

1 Like

Hello Cadcamman, I also come from an industrial CNC background ( 25 years for me ). I feel your pain about no feedrate override. Just be a little conservative to start until you see what the cutters can take. In wood they can take a lot more than i was expecting.

I am very interested in your idea for handling offsets. I like how you left G54 set to 0. That way i assume the machine would act completely normal for the average user who just uses the default offset.
You mention you may make a program to probe and put the values in P1-P6.
Do you mean automatically fill in the values from your probing? I didn’t think the 1F controller was capable of that, but i would love to be proven wrong.

You mentioned an edge finder. I use the makita router which is limited to 1/4" shank. I have been looking for a 1/4" edge finder with no luck. If yours is 1/4" where did you get it?

Hello ChrisM, there are several reasons I did not go with the Makita Router, the 1/4" tool limit is the first one. 2) noisy, 3) programming spindle speed, and 4) Air cool spindle like the Mikita blows air from the back of the spindle to the front and cause interference with your dusk collection.
.

Are the G54, G55, etc locations based on the Home or where you set your origin (ie using the probe)?

Also if you have multiple say 4 different projects and want to run 4 toolpaths can you just pasted them one after the other with a different select coordinate command (G55, G56, etc) at the start of each subsequent tool path. What other commands would be needed? I assume a G4 dwell and raising the Z height? Sorry I’m totally new to G codes editing

Hi Jussi,
I am assuming you have the buildbotics controller - If not some of what follows is not useful to you.

They are the locations where you set your origin on each piece using a probe or any other method.
By default the controller puts wherever you set your origin into G54.
Where the machine considers the origin can be controlled by you however by putting this code line at the top of your NC file:
G10 L2 P_ X___ Y___ Z___
The P value is which offset register you want to use - i.e. P1=G54 P2=G55 P3=G56 etc. based on table here
For the X, Y and Z values you need to fill in the offset from your origin to home.
You can get that info when you find your origin. Just look under the “OFFSETS” column on the control. This is the offset distance from home.

Yes you are correct.
You can put the G10 commands at the top of your nc code then call each origin below as you need them.
Here is a test file:

%
(TEST FILE FOR OFFSETS)
(CUT 3 CIRCLES G54-G56)
G10 L2 P1 X2.345 Y4.567 Z-3.45 ( SET G54 )
G10 L2 P2 X6.456 Y9.567 Z-2.3 ( SET G55 )
G10 L2 P3 X15.356 Y20.456 Z-1.345 ( SET G56 )
G53 G0 G90 Z0
G54 G0 G90 X1.622 Y0 (G54)
G43 Z0 H1
G2 X1.622 Y0 I-1.622 J0 F100
G53 G0 G90 Z0
G55 G0 G90 X1.622 Y0 (G55)
G43 Z0 H1
G2 X1.622 Y0 I-1.622 J0
G53 G0 G90 Z0
G56 G0 G90 X1.622 Y0 (G56)
G43 Z0 H1
G2 X1.622 Y0 I-1.622 J0
G53 G0 G90 Z0
M30
%

You only need to make sure the tool is lifted up high enough before you move to a new origin. That is what the G53 G0 G90 Z0 does above ( takes the tool to the top of the travel ) before I change the origin.
If you just take each nc file that you have and just remove the:

%
O0100 ( not all posts use this - if a line starts with the letter O remove it )

from the top and the:

M30 ( some posts use M2 for this )
%

from the bottom it will have all you need.
Just search for wherever G54 occurs and change it to G55 or whatever you want.

Hey Jussi,

this helpful document, in conjunction with this one, could expand your mind :slight_smile:

I think I got it. I was just looking at some ngc files created from Vcarve and noticed the G54 command was not listed there. Is that abnormal? For example below is the code for making 4 square shaped profile cuts. I didn’t modify anything. This is what came out of vcarve.

If I recreated the exact same tool path on a different software (ie if I used Fusion 360) create a slightly different Gcode?

Thanks for the tips. Far from fully understanding everything but getting closer. Will do some experiments when I get my spoilboard rebuilt.

%
T1 (MSG, Insert Tool 1)
G0 G17 G20 G90 G49
G0 Z0.5000
G0 X0.0000 Y0.0000 M03 S16000
M0(MSG, Click ‘Continue’ when the spindle is up to speed)
G0X-0.0361Y0.0000Z0.2000
G1Z-0.0313F15.0
G1Y12.0000F45.0
G2X0.0000Y12.0361I0.0361J0.0000
G1X12.0000
G2X12.0361Y12.0000I0.0000J-0.0361
G1Y0.0000
G2X12.0000Y-0.0361I-0.0361J0.0000
G1X0.0000
G2X-0.0361Y0.0000I0.0000J0.0361
G1Z-0.0625F15.0
G1Y12.0000F45.0
G2X0.0000Y12.0361I0.0361J0.0000
G1X12.0000
G2X12.0361Y12.0000I0.0000J-0.0361
G1Y0.0000
G2X12.0000Y-0.0361I-0.0361J0.0000
G1X0.0000
G2X-0.0361Y0.0000I0.0000J0.0361
G0Z0.2000
G0X0.0000Y14.9639
G1Z-0.0313F15.0
G2X-0.0361Y15.0000I0.0000J0.0361F45.0
G1Y27.0000
G2X0.0000Y27.0361I0.0361J0.0000
G1X12.0000
G2X12.0361Y27.0000I0.0000J-0.0361
G1Y15.0000
G2X12.0000Y14.9639I-0.0361J0.0000
G1X0.0000
G1Z-0.0625F15.0
G2X-0.0361Y15.0000I0.0000J0.0361F45.0
G1Y27.0000
G2X0.0000Y27.0361I0.0361J0.0000
G1X12.0000
G2X12.0361Y27.0000I0.0000J-0.0361
G1Y15.0000
G2X12.0000Y14.9639I-0.0361J0.0000
G1X0.0000
G0Z0.2000
G0X19.9639Y14.9999
G1Z-0.0313F15.0
G1Y26.9999F45.0
G2X20.0000Y27.0360I0.0361J0.0000
G1X32.0000
G2X32.0361Y26.9999I0.0000J-0.0361
G1Y14.9999
G2X32.0000Y14.9638I-0.0361J0.0000
G1X20.0000
G2X19.9639Y14.9999I0.0000J0.0361
G1Z-0.0625F15.0
G1Y26.9999F45.0
G2X20.0000Y27.0360I0.0361J0.0000
G1X32.0000
G2X32.0361Y26.9999I0.0000J-0.0361
G1Y14.9999
G2X32.0000Y14.9638I-0.0361J0.0000
G1X20.0000
G2X19.9639Y14.9999I0.0000J0.0361
G0Z0.2000
G0X20.0000Y12.0361
G1Z-0.0313F15.0
G1X32.0000F45.0
G2X32.0361Y12.0000I0.0000J-0.0361
G1Y0.0000
G2X32.0000Y-0.0360I-0.0361J0.0000
G1X20.0000
G2X19.9639Y0.0000I0.0000J0.0361
G1Y12.0000
G2X20.0000Y12.0361I0.0361J0.0000
G1Z-0.0625F15.0
G1X32.0000F45.0
G2X32.0361Y12.0000I0.0000J-0.0361
G1Y0.0000
G2X32.0000Y-0.0360I-0.0361J0.0000
G1X20.0000
G2X19.9639Y0.0000I0.0000J0.0361
G1Y12.0000
G2X20.0000Y12.0361I0.0361J0.0000
G0Z0.2000
M5
G0 Z0.5000
G0 X0.0000 Y0.0000
M2

Vcarve post processor is therefore setup to not output it. Post processors can often be modified to get the output you want - but it does not matter generally. The onefinity control assumes G54 even if it’s not specified.
When I type out nc code by hand I don’t add a G54 either since I know the onefinity assumes it.

Yes different CAM packages output different things depending on how their post processor is setup. If post processor is new to you think of it as a template file that the Cam software uses to make the nc code look just the way you want it. ( some people do want to get it to look a certain way and some different CNC machines need it to look different )
My Fusion 360 post processor put G54 on the line after the “S” speed command.

In your case I would just type G54 ( or G55 whatever ) just before the “T1”

1 Like

That makes perfect sense. One last question. well for now. Do you trust the homing feature of the 1F to always get to the exact spot every time and always use that as G54 or is it better practice to make a fixture slightly offset of the home and use a probe to designate as G54. Thanks again for all the explanations.

It depends on what tolerance you want but for me the answer is no I do not trust the homing feature to get the exact spot.
Here is the method I use when it’s important to me. ( click on the title below )

1 Like

Jussi,
One more thing I think you need to be aware of.
When you set G54 or G55, etc. they are modal, meaning they will stay in effect until you shutdown or reboot.
The danger is if you have been running a program that finished off using G59 for example - then you start a new program from Vcarve that has no line for G54 or anything - you may assume the machine will default to G54. But that is not the case. G59 is still in effect. It will make whatever was set in G59 as it’s origin.
Just something to be aware of.
You could just go the the MDI and type G54 and press play. Then G54 is active.

That is why I have always wanted my post processors to specify G54 in the nc code - so I don’t have to worry about what I was playing with in the last program I ran.

1 Like

Thanks Will try that homing procedure.