Author Archives: David

CNC Turning Using T00 to Cancel Offset

CNC Turning Using T0000 to Cancel Offset

This article is about CNC turning programs and the use of T00 to cancel the tool offset.

My daughter is autistic, and one of the things that she has taken great delight in doing during the current lock down, is picking up on the stupid nonsensical phrases and expressions that neurotypicals have created in their non-binary brains.

In case you don’t already know neurotypical is an expression used by autistic people to describe non-autistic people. I still haven’t worked out if it is a term of endearment or mildly offensive but I don’t really care anyway.

Anyway, whilst I was writing an article about using multiple offsets, yet to be completed, I suddenly realised why it is a good idea to cancel the tool offset on a CNC Lathe (more about that later).

We were sat drinking tea in our summer house, me my wife and my daughter.

I know it sounds grand but really, it’s not exactly a summer-house it’s more of an old shed. It’s one I converted to compete with my neighbours when they had a fancy new summer house built.

Just a few finishing touches needed

I was talking about this article in rather abstract terms as my wife and daughter are none engineers but always pretend to be interested in my rantings.

Anyway, with reference to tool offset cancellation I said “you learn something new every day”.
My daughter immediately retorted “oh so what did you learn yesterday?”. Fortunately, I could think of something I remembered learning that there are 206 bones in the human body, so I used it.


I need to add a this point that my daughter is not an autistic savant and we still need google and takeaway menus. She’s not like that bloke in “Rain Man” who can remember every number in a fuckin’ phonebook.

The expression is “if you know one autistic person, you know one autistic person”

Anyway with her autistic brain I should have known this wouldn’t suffice. “The world tilts at 23.5 degrees on its axis” I quickly added.

“You already knew that” she said.

(Please ignore this if you think the world is flat as I know a lot of my readers do)

She insisted that I should go back at least three weeks in order to prove the validity of the statement.
I decided to give in and the conversation ended by me admitting that all neurotypicals are stupid. In our household that’s a result and a common strategy we use to resolve this kind of conflict.
Such idioms as “washing your dirty laundry in public” are just banned unless you think you have a simple way of explaining it.

A friend once exclaimed that “there is more than one way to skin a cat!” and as a result required a police escort to get home (joke).

My daughter has a cat and her whole existence revolves around it. I’ll let you imagine her reaction.

Using T00 to Cancel tool Offsets

Anyway, this was going to be an article about using multiple offsets in a CNC Turning program.

It’s a bit like multiple orgasms but not nearly as much fun. Anyway I had this eureka moment with regards to T00 and ditched the whole thing.

On a CNC Lathe we use a four-digit number when we do a tool change.

T0101 for example.

The first two digits make the turret index T01 (index to tool 1)

The second two T0101 will call an offset. You will note I said an offset because it can be any.

CNC Turning
Geometry offset page on a Fanuc CNC Lathe

In the above case it’s offset 1 but it could be T0112 this would index to tool 1 and use offset 12.

CNC Turning
Geometry offset page on a Fanuc CNC Lathe

Anyway thinking about these four digit numbers made me think about when you use zeros.

On older machines you used to have to cancel the offset by stating T0100 or much safer T0000. Otherwise the machine would add the new offset to the old one and a shitstorm would ensue.

I had consigned this now inert procedure to the CNC Turning equivalent of room 101 or at least the annals of CNC History. Anyhow, it seems there is life in the old T000 dog yet.

I love this puppy I’m going to use it in every post from now on

Now this is where that eureka moment happened in my summer house and I wrongly claimed to learn something new every day.

The Theory

When you write a CNC Turning program you can either return the tool back to the machine reference or return it to a tool change position.

Now the first option (reference) is OK if it is a small a machine. In other words it’s not gonna take it a week to get there.

On a big machine you would have to navigate around all sorts of shit like the tailstock or a steady or the boss’s Bentley. And it would almost definitely be a waste of time.

Soooo normally we would use a tool change position this would be making use of G53

CNC Turning

Using G53 for tool change position

CNC Turning G53

Because the G53 uses the machine coordinate system it will be the same place for each tool.

You could then put this position in a sub program. That way it would be the same for every tool. If you needed to change the position you would only need to change it once in the sub-program.

I will forgive beginners for thinking you could just rapid each tool to the same position away from the work piece.

For example G0 X100. Z100. for every tool.

CNC Turning
Sending a drill to a position
CNC Turning
Sending a turning tool to a position

Just look at the turret position in the pictures above. Although the X Z position of both tools is the same there is a huge difference in the turret position.

This could work but when you pick the program up again maybe months later. The tools could be different lengths the tool-change position would have to be altered.

Your drills may not be the same length and the machine may even over-travel when you try to move it to your old tool change position..

Using a G53 you can always allow for the longest tool and know your index position is safe.

Remember G53 does not consider the tool offset or the work offset. To be honest G53 is the selfish bastard of the G codes it just does not give a flying shit what offset is active.


Anyway, thinking about cancelling tool offsets it gave me an idea.

If at the end of each CNC Turning tool you cancel its offset. you could send it to a known position.

Because no tool offset is active this would always be the same place.

Some of you probably already do this but honestly, I never thought of it.

I intend to program this way from now on.

CNC Turning
Using T00 for your tool change position

You should be able to use T00 or T000 to cancel your tool offset.

Don’t Do This (I really shouldn’t be telling you)

You can use the tool number plus the zeros so to cancel T0101 you could put T0100. I strongly recommend that you do not do this because it introduces an index move and therefore another potential collision.

You would need to remember to change this on all tools if for some reason you moved the tools around in the turret.

Oh yea about the multiple offsets. I will be writing and article on it when I can be arsed but in the meantime here is a video.

Thanks for reading my articles (no flies were killed in the writing of this article)


G Code Groups What Use Are They?

G Code Groups, every G code is in a group and I remember looking at G codes for years thinking why on earth do they do that?

I thought it was just to satisfy the geeks, it gave them more bullshit to talk about.

Anyway now I’m all grown up, I know exactly why G Codes are in groups.

The good news is today I am going to tell you why and….. I am going to give you a practical example.

Here is a list of G codes and the group that they are in

G Code
G Code List with Groups

Hass G Code Groups do vary a little.

Now I know this is boring but please try to keep focused it gets exciting soon honestly. If you are loosing the will to live already then off you go, this video is amazing.

I know it’s only two of us now but I will carry on. I wrote this article a bit back about macro for the over 18’s.

When you start to write serious macros you need to write alarms to protect the opeator just incase he types in bollocks instead of an R number or some such thing.

Anyway there is a thing I call tidying up after youself. This is not like when you cook a meal and your ungrateful girlfriend expects you to tidy up the kitchen just because it looks like a post war bombsite.

I made cheese on toast and I must say it tasted great. Cooking’s got to be easier than this G Code shit.

What this is about is putting things back as they were. So the G Codes that were in use before going into your macro need to be restored before coming out.

For example most machines when you issue an M6 command jump into a macro program. See this article

The macro program might look something like this.

09101                           (TOOL CHANGE MACRO)
G80G40G49             (CANCEL ACTIVE G CODE) 
M9                               (COOLANT OFF)
G28 G91 Z0              (SEND TOOL BACK TO ZERO)
M19                             (SPINDLE ORIENTATION)
M6                               (TOOL CHANGE)

What this macro actualy does is all the crap you can’t be arsed with.

In your main program you would have to do all this every time you want a tool change. You don’t see any of this because the program is not visble. The M6 aliases program 9101.

So when you program M6 you get program 9010 running behind the scenes.

So as I said your an advanced G Code programmer now so I expect a bit more from you. “What me” you say. “Yes you” I saw it on your CV.

Oh and you just swapped the control into G91 in the macro above (you naughty boy)

So for example if the machines was in rapid G0 and absolute G90 the guy who called the tool-change will expect it to stay that way.


So when the control comes out of your tool change macro it’s in G91, not good.

This could easily cause a collision. You say “ah but the programmer should use G90 when he states the first position”.

Right, We Need To Talk

As I said you are an adult now and in the adult world of Macro programming you tidy up and you take responsibilty for the G code you change.

I’ll be honest with you now, lots of people who should know better don’t do this. A good example are probing programs.

Anyway what shall we do about it?

We Do This

#1=#4001                  (STORES ACTIVE G CODE IN GROUP 1)
(G0 1 G2 G3)

#3=#4003                (STORES ACTIVE G CODE IN GROUP 3)
(G90 G91)

#14=#4014             (STORES ACTIVE G CODE IN GROUP 14)
(G54 G55 G56 G57 G58 G59)

G80G40G49             (CANCEL EVERYTHING) 
M9                               (COOLANT OFF)
G28 G91 Z0              (SEND TOOL BACK TO ZERO)
M19                             (SPINDLE ORIENTATION)

G#1 G#3 G#14            (RESTORE G CODES)

OK What’s Going On Here

(G0 1 G2 G3)

(G90 G91)

#14=#4014(STORES G CODE GROUP 14)
(G54 G55 G56 G57 G58 G59)

The lines above take the G codes from three groups.

  • G0 G1 G2 G3
  • G90 G91
  • G54 G55 G56 G57 G58 G59

It stores those values in #1 #3 and #14

So if the machine were in feed (G1) it would store 1 in #1

If the machine were in absolute (G90) it would store 90 in #3

And if the machine were in work offset G59 it would store 59 in #14

The four thousand system variable looks into the various G code goups.

Now Let’s Magic Them Back

Magic Back The G Codes

Restore The G Code Groups

At the end of the program we have

G#1 G#3G#14

Which is the same as.

G1 G90 G59

This would depend on the state of the machines before you went into the macro.

So what we have done is restore the G codes back to their original values before we started tampering with them.

That way if the machine crashes you can say “look mate I never touched a thing”


Reset To G54 Fanuc Parameter 1201

Category : Fanuc Parameters

Messing With Parameters Can Be Fatal!!!!!

Reset To G54 Fanuc Parameter, altering this parameter will make the control reset back to G54.

If you find it annoying that your control keeps jumping back to G54 when you press reset change this parameter to a 1.

To change parameters you need to go to the setting screen in MDI. first of all take a deep breath and prepare yourself.

Now put a 1 in the parameter write box.

Reset To G54 Fanuc Parameter 1201

How annoying is it when you press reset on your Fanuc control and suddenly it dumps the work offset. You know your in G55 and it jumps back to G54.

I reminds me of my teenage years when girls used to hit the reset button on me. I didn’t default to G54 or anything just got really pissed off.

One particularly ungrateful girl dumped me after I had spent nearly an hour trying to explain to her about the system variables on a Fanuc Control. I even offered to lend her the Fanuc Manual.

This parameter is quite difficult to find. Now I know I often go on about me not being very bright but it really is true. I often say to customers I’m the one who just reads all the boring shit in the manuals that you can’t be bothered with and that’s really all I do.

It’s actually true although,0000000000000000000000000000000000000000 I do like to think that I have a good way of explaining things in “laymans terms” as they call it, profanities included.

(sorry the cats on my keyboard again)


This is my cat she is called Hagnes, that’s not a typo. Her name was Agnes but as she is an upper class cat I added an H because posh people add H to a lot of words like they say “help” when they mean “elp”.

This is all really hypocritical from the guy who fuckin hates it when people put gratuetous crap on Linkedin that belongs on TikTok or Facebook. I mean do I really care if you had two eggs for your fuckin breakfast or one.

Anyway she did stand on my fuckin keyboard.


The parameter, the parameter oh yes…..

The reason not many people adjust this parameter is because it’s kind of hidden. That means it’s down to people like me who sit reading Fanuc Parameter Manuals when all other adult men are playing Candy Crush or Cyberpunk 2077.

This Is It Folks (1201 bit 7)

This is the Explanation.

Reset To G54 Fanuc Parameter
Parameter 1201 bit 6

Phew I need a lie down after that.

This parameter is complicated because it’s all about G code groups. Every G code is in a group it is not something you need to worry too much about until you get on to more advanced Macro Programming.

If you think of it as G codes that you couldn’t have in the same block like G0 G1 G2 and G3.

You can only have one or the other. I mean you couldn’t G0 and G1 together that would be stupid telling the machine to rapid and feed at the same time.

Well…… these are in the same group it’s group 1 actually. This parameter will reset whatever G code is active in group 14.

Group 14 just happens to be G54 G55 G56 G57 G58 and G59 (your work offsets).

As they are all in the same group (14) only one can be active.

So all it means is when you press reset if the machine was in G55 G56 G57 G58 or G59 it would always default back to G54

Now you know how to reset to G54 by altering a Parameter.

So 1 means don’t reset to G54 and 0 means reset to G54

Here is More Total Confusion

Parameter are listed like this


Reset To G54 Fanuc Parameter
Parameter bits

I’ve written the bit number below because it can be a bit confusing. There are 8 bits beginning with bit zero. The first one is not bit 1 it’s actually bit zero.

So what’s confusing?

Well for one thing they work from right to left.

The other thing is they start at number zero not number one.

It’s all because they are binary numbers without these you and I would still be winding handles.

I’m not gonna go there by the way.

Just One Thing

Oh just one other thing before you go off and cripple your machine forever.

Do yourself a favour take a picture of the screen before you change your parameter.

Make a screen shot if you can.

If you aint got a camera then you must have a piece of paper so write it down.

(Oh and get a camera they are very useful you can take pictures of your arse and send them to your mates)

Even better back everything up.


If you have been affected by any of the issues in this post or need CNC Counselling then contact me.

If you want to learn to program CNC Milling Machines

Look no further Contact CNC Training Centre

CNC Turning M Codes List For Beginners


CNC Turning M Codes
CNC turning M Codes

Download CNC Turning M Code List

This is my list of CNC Turning 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 Lathe. 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.

M8 G0 X50. Z2. G97 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 G97 S1500;

Or the end.

G97 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 Turning M Codes

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

Download CNC Turning M Code List

Sorry I’m being flippant again.

CNC Turning 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 Turning M Codes
Hand Em Over

For example this beast is a Mazak Megaturn

CNC Turning 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.

Some M codes That Might be Useful

Open Chuck                         (Might be M11)

Close Chuck                         (Could be M10)

Parts Catcher Up               (Mmmmm)

Parts Catcher Down         (No idea)

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.



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 Turning 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 Turning M Code List






CNC Turning G Code List For Beginners

Download and print this nice large print CNC Turning G Code List

Download CNC turning G Code List PDF

I always begin my training sessions by telling my students not to remember anything I say.

This sounds completely stupid and my excuse is it wasn’t my idea to say it.

About ten years ago I worked in France. After about a year and it seemed obvious that I would need to speak to people to order “Fish n Chips” and stuff like that.

Anyway I got these CD’s to teach me French and the bloke (can’t remember his name) started off by telling you not to remember anything he told you.

I think there is a bit of reverse psychology going on but the main idea is that you understand not remember. It didn’t work for me because I still managed to completely fuck up the language. Not realizing French Canadians speak differently to native Frenchmen (I was working for Bombardier) . Anyway I asked this bloke, in French, to “come with me”. I can’t remember what it is in French and after all the bloke on the CD had specifically told me not to remember.

Anyway turns out this had a sexual connotation and made me the complete laughing stock everywhere I went from then on. (I’ll let you do the maths on that one.)

“OK which one of you bastards bought all the fuckin toilet paper in lock-down?”

Now I know what your thinking, “that is the gnats cock of CNC Turning G Code Lists”. Honestly size isn’t everything.

Learn these first and just by seeing um every day they will just sink into your brain.

When it comes to CNC Programming it is important to enjoy your self and not get bogged down trying to remember loads of G Codes.

The truth is you only need to remember a few and it’s all about understanding what they do.

For Example This is in your Program.

You watch in amazement as it cuts your part.

So you look up what G71 means on your list of G Codes printed in large letters on the side of your machine.

Download CNC turning G Code List PDF

“Oh yea it’s that’s roughing shit” you say.

As You Watch it Run It All Makes Sense

From your Classroom Training you know that there is a multi repetitive cycle that can rough out a part.

You understand how the cycle works already.

CNC Turning G Code List
G71 Rough Turning Cycle

So as it runs, it all makes sense.


CNC Turning G Code List
Keep it Simple

Type up or print this list in nice big letters and stick it to the side of your machine

Download CNC Turning G Code List PDF

CNC Turning G Code List

G00                 Move at Rapid speed
G01                 Feed in a Straight Line
G02                 Clockwise Arc
G03                 Counter Clockwise Arc

G04                 Time Dwell

G28                 Return Axis to Home

G41                 Cutter Compensation Left
G42                 Cutter Compensation Right
G40                 Cancel Cutter Compensation

G50                 Maximum Spindle Speed
G54                Work Offsets

G71                 Stock Removal Cycle
G70                 Finishing Cycle for Above
G76                 Threading Cycle

G83                 Peck Drilling Cycle

G96                 Constant Surface Speed
G96                 Speed in RPM

Download CNC turning G Code List PDF

CNC Training Centre
WP to LinkedIn Auto Publish Powered By :