Author Archives: David

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)
M99

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.

G28 G91 Z0 (THE EVIDENCE)

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

09101(TOOL CHANGE MACRO)
#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)
M6

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

OK What’s Going On Here

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

#3=#4003(STORES G CODE GROUP 3)
(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.

Thanks

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.

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 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 Milling M Codes List For Beginners

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

 

 

 

 


CNC Training Centre
WP to LinkedIn Auto Publish Powered By : XYZScripts.com