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.
M codes are the Snow Leopards of CNC Machining
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.
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.
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.
For example this beast is a 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.
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)
I had a boss once who actually learnt sines and 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.