CNC Work Offsets G54 to G59 How to Use Them

CNC Work Offsets G54 to G59 How to Use Them

CNC Training Call David: 07834 858 407

30 Five Star Reviews

CNC Training Centre Reviews

Contact CNC Training Centre

As part of the basics of CNC Programming you need to have a good grasp of Work Offsets. This article explains how they work on various controls.

More Heidenhain

Make sure you read to the end to see how good use of Work Offsets can dramatically increase production on your CNC Machine.

So you wrote your program and it looks great on your simulation. Great but your machine hasn’t got a clue where your part is.

That’s where the work offset come in.

The control say’s “where the fuck’s the part?” machine says “ask the work offset G54 to G59 they’ll know”.

Drawing Datum

When we write a CNC program we work from a datum on the drawing. All the X and Y figures will be measured from this datum.

CNC Work Offsets G54 to G59

Once we put the component on the machine it needs to know where the part is.

This is called the work offset.

On  a Fanuc control it’s a G code usually G54 although as standard you have six of these.

G54 G55 G56 G57 G58 G59

Once you set one of these all you need do is use the G code (54 to 59) and the machine will use that offset.

Each one of these G Codes represents a datum position on the machine.

G0 G54 X0 Y0 (Rapid to X0 Y0 using G54)

G0 G55 X0 Y0 (Rapid to X0 Y0 using G55)

Because the work offset is modal once you state it you don’t need to repeat yourself. (It stays in)

Read this if you don’t know what modal means.

G0 G54 X0 Y0 (Rapid to X0 Y0 using G54)
X50. Y50. (Still rapid still G54)
Z10. (Don’t panic I know you still want rapid and G54)

Zero Return

When you first turn on your CNC Machine you would normally reference or Zero Return all the axis. The machine then knows where it is.

All machines will have a position display. This position display will have one set of figures normally called “MACHINE“. This is the machines position from zero return. So when the machine is at zero return this will read.

X 0.000
Y 0.000
Z 0.000

CNC Work Offsets G54 to G59

The “MACHINE” position tells us how far we are from the machine zero. We don’t use this once we have set our datums.

This is the position we need to write into the work offset page to tell the control where each datum is (G54 to G59)

What we do when we are setting (G54 to G59) is enter this position in the work offset page.

CNC Work Offsets G54 to G59

When we subsequently call this G code the machine will use this position as it’s datum.

On the screen above if you programmed G0 G54 X0 Y0 the machine would move -75. in X and –145.5 in Y. This is it’s new zero position. Every subsequent command will work from this datum.

Now Let’s Set The Work Offsets

What we do when we are setting the machines datums or Work Offsets is we tell the machine where our datum is from Zero Return.

CNC Work Offsets G54 to G59

In the above case the datum is 806.25 away from X Zero Return and 147.1 away from Y Zero Return. These will both be minus figures.

CNC Work Offsets G54 to G59

What about Z you say?

Well yes we need to do that also. The Z will be the distance from Zero return to the top of the work-piece.

CNC Work Offsets G54 to G59

So in the above case the distance from the spindle nose to the top of the work-piece is 530.570. Again this will be a minus figure.

CNC Work Offsets G54 to G59

So there you have it your work offset in X Y and Z.

This is how it looks in the offset file on a Haas machine.

This is an imperial (inch) machine so this datum is 12.568 inches away from the X zero and 8.489 from the Y zero.

CNC Work Offsets G54 to G59

On the Fanuc control below it has values set in G54 G55 and G56. you could use any of these offsets.

Not all machines will have minus figures in these offsets as the zero return can be in a different place.

Mazak Work Offsets

Now if this were on a Mazak control it would be exactly the same if you were using the machine in ISO G Code type programming.

CNC Training Mazak

If you were using Mazatrol and not ISO this would be recorded in a WPC. No that’s not a Woman Police Constable.

Anyway it looks the same it’s just that they call them WPC 1 and WPC 2 etc.

WPS’s are set in the program as you go along. It’s the sort of “pay as you go” datum system.

Toshiba BMC 800 Work Offsets

On the Toshiba BMC 800 machine which uses the Tosnuc Control, H numbers are used for Work Offsets H901 to H999. Even the greediest programmer won’t run out of work offsets on this machine.

Is Six Enough?

Unfortunately on most Fanuc Controls you only get six offsets G54 to G59 this should be enough really. Anyway you can get what is called “Extended Offsets” as an option this gives you another 99.

These are called G54.1 P1, G54.1 P2, G54 P3 etc etc. You get the idea?

They work in exactly the same way as G54 to G59 you just stick in a P number.

G0 G54 X0 Y0 (Work offset G54)

G0 G54.1 P1 X0 Y0 (Work offset G54.1 P1)

Right Let’s Wrap This Up

So what we did is told the machine where G54 was in it’s own master “Machine Coordinate System”.

So now if we program

G0 G54 X0 Y0 the machine will rapid to the position that we set as the datum. All subsequent moves will be around this G54 Datum.

Because G54 is Modal. 

Digital Readout

Imagine how difficult it would be if we had to keep adding all our figures onto the machine position. It’s just like when you have a manual machine with a Digital Readout (DRO).

You just clock up your datum position and Zero the display. Well that’s what this is doing on your CNC Machine.

The good news is you get to keep the position and there are six of them.

Toshiba BMC 800 Tosnuc 888 Control

Oh yea let’s come back to the Toshiba BMC 800 Tosnuc Control.

Toshiba Tosnuc CNC Training

This is one of my favourite controls. Call me a geek but I get really excited about this kind of stuff. Below is the 888 control. (The 666 is a bit of a devil to program)

Toshiba Tosnuc CNC Training

Considering how old these controls are they are packed with great functions. Sorry this is a blatant plug cos if you got one I’d love to train you on it.

On this control you would just record the figures in H901. The program would read.

G57 H901
G0 X0 Y0

The G57 activates H numbered offsets and it needs to be on a separate line.

So Where’s This All Going?

Now then think about this.

Once this offset is in the machine it stays in no matter what. Like the curry you spilt down your white shirt when you were pissed on Saturday. “It’s going nowhere”.

So where do the other offsets come in.

Well. Imagine you set this job up and the boss came over and said “Jack, can you fit in an urgent job before you do that one”

(Please substitute your own name above)

Don’t panic no need to punch the boss or tell him to stick his job up his arse. No no it’s easy. You smile and say “No problem sir I’ll leave that job set up in G54 and I will use G55 for your new job”

Don’t Just Plonk It Anywhere

Something I forgot to tell you. Always set your parts up as near to one end of the table as you possibly can. Never in the middle of the table. That way you get to leave the part on the table and set up another job.

So you would just load up another vice or whatever and set the datum in G55.

Now when you program.

G0 G55 X0 Y0

The machine will use the new datum…. Easy what.

By The Way

Oh and obviously if you call out your old program, for that job the boss doesn’t want yet, it will use G54. Everything will work around the old datum.

There’s More

A tool change on a modern machine is amazingly fast like a fraction of a second.

CNC Work Offsets G54 to G59

But we don’t all have super fast tool changers and I have worked on big machines where a tool change can be two minutes!!

Well let’s compromise. Your machine is a bit of n old banger.

Matsuura Training 500v

Actually these old Matsuura Machines with Yasnac Controls are awesome if you can get hold of one.

The tool change chip to chip is going to be about 17 seconds. Machines like the new Matsuura MX 520 tool change in just over a second. In my world that’s shit off a fuckin stick.

Lets Save Some Time

Imagine if we could get 17 parts on the machine table and set 17 datums. We pick up a spot drill. The tool change time is 17 seconds.

Ah but sunshine it’s gonna spot drill 17 parts so the tool change time really is only one second.

That’s 17 seconds divided by 17 parts. One second per part. It really is that simple.

It’s A Myth Size Really Does Matter

I had you fooled there just when you thought I was talking about Pizzas. I was talking about machines.

Mazak Training

Look at the size of this Mazak Machining Centre it has the new Mazak Smooth Technology control.

Imagine you have an old machine but it has a huge table. Well if you fill the table with parts suddenly your slow tool changer does not matter.

Oh and about the slow rapid moves.

Doesn’t matter either.

The longest rapid moves are the ones to and from tool change. But we took care of them because one tool change does 17 parts.

From part to part there are only small rapid moves so we gain there too.

So our big old Tortoise can beat the Young Fast Hare.

Now The Bit You All Waited For

Work Offset G54 G55 G56

CNC Work Offsets G54 to G59

CNC Work Offsets G54 to G59

So these figures above would be entered into your work Offsets.

This is how it looks when it machines all three parts. No wasted moves and your making maximum use of each tool.

Another thing, notice how the drill starts at one end and instead of going all the way back. The next tool starts where the last one finished.

This won’t be possible on some machines but on most you can tool change wherever you want.

Lets Take A Look Under The Bonnet

 

The program looks something like this.

Just by putting the new work offset in front of the X and Y figures will make the coordinate system swap to the new work offset.

And…

Because the G code is modal it stays active until you call a different work offset.

Heidenhain

Found on a lot of Bridgeport Machines like the Interact 412, the Heidenhain Control can use the same method as above. You would have an offset table the same where all your offsets are stored.

Bridgeport Interact 412

Great little machines Bridgeport Interact 412 still loads of these in service.

These are then called out by numbers.

Heidenhain Training

This would call out offset 1.

Heidenhain There’s Always a Simple Way

Just zero the display.

How easy is that?

Mmm don’t be confused. That really is all you do and your datum is set.

When you want a different datum you just use a datum shift command.

Heidenhain Training

This would shift the datum by the above amount from your zero. And to change it back.

Heidenhain Training

These can be put in Label commands so that they can be retrieved and used again.

Heidenhain Training

Oh and you can have as many of these as you like.

So there you go from Heidenhain on a Bridgeport Machine to Matsuura MX520 with a Matsuura G-Tech 31i control. There are loads of different machines but the principle is always the same.

Understand one and you’ll easily understand them all.

Thanks For Reading

Don’t forget there’s loads more folks.

And a YouTube channel

Call David 07834 858 407

Learn CNC Programming

Services offered at CNC Training Centre

Classroom programmer training.

Onsite CNC Machine Training.

CNC Programming and Training on all controls and machines.

Mazak Training Fanuc Training

Don’t forget we offer training on all types of Mazak Machines and all Fanuc Controls 6m to 31i Oi old to young.


 

 

 


Tool Length Offsets Beginners CNC

CNC Training Call David: 07834 858 407

30 Five Star Reviews

CNC Training Centre Reviews

Contact CNC Training Centre

 

This article will explain all you need to know about tool length offsets and setting tool length offsets Fanuc

Ok so you managed to write a CNC Programme for your CNC Milling Machine, well done.

A CNC program is a set of instructions telling your CNC Machine exactly how to machine your component.

It contains all the necessary tool paths XY position and Z depths.

It also contains on off signals to do things like starting the spindle (M3 clockwise M4 counterclockwise).

The progam will have all the feeds and speeds for your tools. You may have performed a simulation using the graphics on your machine.

 

tool length offsets

Lots of software like Edgecam can perform full collision detection. You have a model of every tool and it’s holder. There is full model of the machine and all the work-holding.

tool length offsets

Edgecam will even tell you if the flute length of the tool is too short!

Ok so that is all great so far but when we put this program in the machine to run there are three things the machine doesn’t know.

Can you guess what they are?

No it doesn’t know jackpot winning lottery numbers (that would be four things it didn’t know).

  1. It doesn’t know where the part is in the machine coordinate system.

  2. It doesn’t know how long the tools are (tool length offsets).

  3. It doesn’t know the diameter of the tools.

Vital information wouldn’t you say?

So first of all we use the Work Offsets to tell the machine where the part is.

Read this for more CNC Help if you want to learn how Work Offsets are used.

Please don’t worry if you don’t know how to do this after all this is beginners help with tool length offsets .

Your mates don’t know your reading it, you can tell them you already knew all this shit.

tool length offsets

So in the picture above we would touch the spindle nose onto the Z datum of our work-piece. This would tell the machine where the part is in the Z axis.

 

tool length offsets

 

This distance is input into our work offset table (in this case G54).

If we now program G0 G54 Z0 the spindle would rapid down to this position (G54 is where the values are stored).

We wouldn’t do this by the way cos the machine would crash.

tool length offsets

Now The Tool Length

What we now need to do is take into account the length of the tool.

We would measure each tool length and store it in our tool length offsets file.

tool length offsets
This is how they look on a Haas Machine

This tool length offsets file stays in the machine and is independent of your CNC Programs. So now any program can access this file.

So how does it do that?

It uses G43 and G43 says “ok get me a tool length offset”

G0 G43 Z3. H1

Which tool offset?? Well that’s the H number.

So the line above says to the machine rapid to Z3. Oh and by the way allow for the length of Tool 1 before you get there.

That’s the H1

So it gets the tool length from the tool length offsets file. It then does all the maths for you.

Actually it’s just a bit of simple arithmetic. Your (G54) work offset) minus your tool length.

Your tool will arrive 3mm above your component.

So whatever tool you called into the spindle with your M6 command you need to use the corresponding H number.

M6 T5                                                  (Get tool 5 in the spindle)
G90 G0 G54 X0 Y0 S1500 M3    (Rapid to X0 Y0 and start the spindle)
G43 Z3. H5                        (Rapid to Z3. but allow for the length of tool 5)

How do you measure the tools?

tool length offsets

Well some people use a bit of paper!!!

And some buy one of these little babies.

“It’s just a light on a fuckin stick” I hear you say. But it’s so much more. I comes on at an exact distance above your part. And because it’s all spring loaded, if the tool carries on a bit it don’t bust anything.

Only cheap but do a great job.

setting tool length offsets fanuc

And if your a very good boy you might get one of these for Christmas.

tool length offsets

Auto tool measurement (yes it’s all done for you)

In the cases above we are storing the actual tool length in the offset file.

Now let’s take a look at that tool file again.

tool length offsets

Some of my readers are very astute but before you start writing me an email or commenting on this article. “oh David it looks like you fucked up again”

I know……

Why are the tool lengths (Under Geometry) minus figures?

That’s because as always there are several ways to do this. What some people do (and I am not one of them) is……

They bring each tool down from zero return and touch on the part. This figure is then recorded in the tool length offsets file. And yes it’s a minus figure. Of course the G54 work offset would be zero in the case of Z.

tool length offsets

 

Now I am not prepared to argue with you about this (your doctor told me not to). It’s just bad.

Maybe you might want to read this?

That figure has no relation to the actual tool length and you need to reset every tool for every Job!!

I’m saying no more I’ll just wait for the comments.

There is Only One Way

Actually there is something else to consider. (I know I
said I’m saying no more).

By setting your tool length the correct way (my way), the stored offset is the actual tool length and you can do a rough check with your steel ruler before proving your program.

Auto tool length measurement will always give actual tool length and so will a tool pre-setter. That means you can swap tools between machines.

A Few Other Things About Tool Length Offsets

If you have a Mazak. Mmmmm if you have a Mazak.

Well it’s easy. Mazak machines have active offsets so the minute you do a tool change and get your tool in the spindle the tool lengths offsets are active. They also nearly always have an auto tool measurement system

.

Sorry if you are a Mazak user and you are thinking “this dozy bastard has made me read all this gratuitous shit for nothing”

Now’s the time to leave. Go on off you go.

Ok so what.

Mazaks also do this…….

When you write a G code type program for a Mazak you don’t need a G43 and you don’t need the H

M6 T5                                                  (Get tool 5 in the spindle)
G90 G0 G54 X0 Y0 S1500 M3    (Rapid to X0 Y0 and start the spindle)
Z3.                        (Rapid to Z3. but allow for the length of tool 5)

Forget the G43 H5 shit…. soooo easy.

Those Mazak guys just don’t believe in stating the obvious and wasting your precious finger tips typing in a load of bollocks that the machine should know anyway.

Just remember you can change this by parameter if you want it to work the same way as your Fanuc or your Haas. Oh and you don’t care about increasing your carbon footprint with those extra finger presses.

That way you can put programs from your Fanuc into your Mazak and vice versa.

One other thing

 

Haas have a little trick up their sleeve.

You can alter the settings on a Haas machine so that if your H and your T are not the same you get an alarm.

M6 T5                                                 
G90 G0 G54 X0 Y0 S1500 M3   
G43 Z3. H1                       

Remember our program. If you changed the tool number but forgot to change the H you would be using the length of T1 for T5

 

 

Yes you just bent your machine.

Of course if it’s a Haas you just get an alarm.

Learn all this and more

 


G80 G-code Fanuc

CNC Training Call David: 07834 858 407

CNC Training Centre Reviews

Contact CNC Training Centre

I noticed a common search in google is G80 G-code Fanuc.

CNC Machines use what we call canned cycles in a nutshell G80 cancels a canned cycle.

What is a canned Cycle?

To be honest I think it is a funny choice of words “Canned Cycle”.

My guess would be that all the information to drill a hole would be kept together in a “Tin Can” to use whenever you want.

I made this…….G80 G-code Fanuc

First of all we program the cycle this is a G81:

G81 G98 Z-10. R1.5 F200. X55. Y55. F250.

The machine will move to the position X55. Y55. then it will rapid to 1.5mm above the part (this is the R1.5). It will then feed down to Z-10. at a feed-rate of 250 mm per minute F250.

Finally it will use rapid to come out of the hole.

It then sits ready for the next move.

 

All you do now is just give more positions.

G81 G98 Z-10. R1.5 F150. X56. Y56. F200.
X70.
X85.
X90.
X95. Y65.
G80

Every time it moves to a position it will do whatever you stated in the canned cycle (G81)

You don’t add anything else to these positions.

G80 G-code Fanuc

“Read More”

CNC Milling M Codes List For Beginners

CNC Training Call David: 07834 858 407

30 Five Star Reviews

CNC Training Centre Reviews

Contact CNC Training Centre

 

CNC Milling M Codes
List of M Codes for a CNC Milling Machine

Download CNC Milling M Code List

This is my list of CNC Milling M Codes and you will notice there aren’t many.

That’s because you don’t actually need many.

M Codes are used to turn things on and off on a CNC Milling Machine. Sometimes known as miscellaneous functions.

A typical M Code would be M03 which would start your spindle forwards.

M04 would be reverse and guess what?

M05 is stop the spindle.

There, you learned three already.

You don’t need the extra zero so I advise you leave it out, program M3 M4 M5.

It really doesn’t matter but….. You could be wasting memory space or wearing out the tips of your fingers.

Here’s what I think about leading zeros.

M codes are the Snow Leopards of CNC Machining

Snow Leopards are Solitary Animals

Snow Leopards only ever get together to mate, they don’t even have a Christmas party or get pissed on a stag night.

With M codes they hate being on the same line of code. If they are then they will fight to the death.

Tigers Playing

Please note no animals were hurt in the making of this post.

There are exceptions to this rule, M Codes that is, but please don’t overload yourself with this at the moment.

Just trust me.

The first one in the block usually wins but I can’t  guarantee it. So you could get some crazy shit happening.

G90 M8 G0 G54 X0 Y0 S1500 M3;

You wouldn’t even get an alarm on most controls and it may just obey the first M Code it sees and ignore the last one.

The other thing to note with M Codes is that it makes no difference where they are in a block of code.

So if you put your M Code at the front of a block of code.

M3 S1500 G0 X0 Y0;

Or the end.

G0 X0 Y0 S1500 M3 ;

The spindle will start according to the logic of the machine not where the M Code is in the block of code.

The Boring CNC Milling M Codes

That’s my list of M Codes the rest are really boring doing stuff like changing gear ranges and stuff.

Download CNC Milling M Code List

Sorry I’m being flippant again.

CNC Milling M Codes Where Are The Rest?

Sorry you can’t have them. The reason for this is that they are different depending on what machine they are on.

CNC Milling M Codes
Hand Em Over

For example this beast is a Mazak Megaturn

CNC Milling M Codes
Mazak Megaturn

It Has a Gearbox.

To change gear you program M41 M42 and M43 for the different gears

M40 is neutral. Now on machines with gearboxes they do normally use these same M Codes.

However they can be different.

M10….. mmmm well that’s normally a clamp.

I think you get the picture. It is up to the machine tool builder.

It is best to get a specific set of M Codes from your machine manual.

The manual by the way is that book that nobody ever reads, it’s usually at the bottom of a bent up old filing cabinet.

Please Don’t Read It

I’ll read it for you then charge you a shit load of money for training.

Click here for CNC Training

Joking aside please don’t be arsed to learn a load of M Codes you will probably never use.

Well Commented Programs

Try to put M Code descriptions in your program. That way you won’t need to keep looking them up. A part transfer on a CNC Lathe is a good example, there are an absolute shit load of em.

They are everywhere. If you put a meaning to each one in brackets it will make proving the program out really easy. Oh and if you have a CAM system then change your post processor to output them for you.

M11 (OPEN CHUCK)

M10 (OPEN CHUCK)

etc etc

I had a boss once who actually learnt sines and cosines of angles.

Cosines of Angles

Holy shit I mean it’s impressive and I must add in 1975 it was actually worth doing because we didn’t even have calculators.

Hope you enjoyed reading my article on CNC Milling M Codes.

Please remember that it keeps me occupied and while I’m writing these articles I am not holding you up in the supermarkets queue trying to find a coupon for 10p off my incontinence briefs.

Download CNC Milling M Code List

 

 

 

 


Fanuc Display – Relative Position

 

CNC Training Call David: 07834 858 407

30 Five Star Reviews

CNC Training Centre Reviews

Contact CNC Training Centre

 

Fanuc Display (Relative Position) is used only by the operator.

Fanuc Display

You can reset Fanuc Display (Relative Position) just like you would on a manual machine with a DRO. So use it for setting or even measurements. One thing to remember is it will not retain it’s position when you turn the machine off. The control in the video is a Fanuc 18i on a big vertical lathe but all other Fanuc controls are similar.

Subscribe to my YouTube channel (I beg you)

“Read More”


Careers in CNC

View all current vacancies in CNC

Click here

Call David: 07834 858 407