Category Archives: Mazak Turn

CNC Turning 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 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 once had a boss once who actually learnt sines and cosines of angles.

Cosines of Angles

Holy shit I mean it’s fuckin impressive and I must add in the 1970’s  it was actually worth doing because we didn’t even have calculators. We just had bits of paper, pencils and Ford Capris.

The Market Online Classic Car Auctions

Mine was just like this but mine was a P reg three litre, vinyl roof handled like a cow on a march. Very fast at the time. Dream car, loved it.

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

 

 

 

 

 


Jump Around Using M99 Plus Block Skip

CNC Training Call David: 07834 858 407

30 Five Star Reviews

CNC Training Centre Reviews

Contact CNC Training Centre

Using M99 Plus Block Skip


Call David 07834 858 407


M99 Plus Block Skip, M99 on a Fanuc, Haas or Mazatrol ISO control can be used to jump sections of code.

Learn to use this in conjunction with the block skip command to switch it off and on.

Now I know you are all thinking “Dave you’re wrong it’s the end of a sub-program”. (Please in the name of holy shit do not call me Dave.)

Well you are right and you are wrong.

Yes it means continue and is used at the end of a sub program.

But it also has another nifty use.

Imagine you want to skip a complete section of program in the case below it’s the Spot Drill.

Let’s See Some Crap Ways Of Doing This

(If you want to do this on a Toshiba Tosnuc 888 or similar control go to the end of the article)

In this example it’s a spot drill we want to miss out.

M99 Plus Block Skip
Standard Code

You could delete it and make two programmes (sounds like hard work and loads of errors). Not to metion wear on your finger tips. Truth is it’s just a shit way to do it.

M99 CNC Code
Block Skip

The programme above  contains BLOCK SKIPS sometimes called BLOCK DELETES.

When you switch on your BLOCK DELETE/BLOCK SKIP switch, each time a forward slash (/) is seen that block will not be processed and the control will move on to the next block.

M99 Plus Block Skip

On most Fanuc controls it’s B.D.T not to be confused with CBT (Cock and balls torture) please do not google this in company time.

It works ok but it is very time consuming. If you want to skip a big section of code you will have to write in loads of block skips.

Call me a lazy bastard but I definitely couldn’t be arsed with that.

Some controls even have two three and four block skips so you can switch on any combination of these switches, mmmm complicated. Good luck with that one.

Do You Have Adequate Life Insurance?

M99 CNC Code (Now let’s use it)

The next example is the easiest way.

You probably normally see an M99 at the end of a sub programme.

In the case below it tells the control to jump to N100 (M99 P100).

The P part is the N number you want to jump to.

M99 P600 (Jump to N600)
M99 P6666 (Jumps to N6666)

 

M99 Plus Block Skip
M99

If you put the BLOCK SKIP/BLOCK DELETE on it will not jump the spot drill.

You would have a choice. If you temporarily want to skip a section of code.

Be careful what N Numbers you choose so as not to mix them up.

Maybe you broke all the taps and you don’t have anymore so you want to skip the tapping. In this case I’d just jump with M99 and then take it out before saving the program.

However, see the next Example.

For this last example you might have to think a bit. Call me finicky but I like the BLOCK SKIP/BLOCK DELETE as a default to be off.

Most machines now don’t have a mechanical switch for BLOCK DELETE/BLOCK SKIP so when you turn on the machine block skip will always be off.

That means the default would be to jump the code.

My way of looking at it, is that you would want the default to be running the whole program as normal.

So We Are Agreed

The default should really be the way the programme was originally done.

In the example below if the block skip is off, which it will be when you start up your machine.

The first thing it will do is jump over the bit that tells it to jump the code.

Meaning it runs as normal not jumping any tools.

The Clever Shit (M99 Plus Block Skip)

M99 Plus Block Skip
What’s This?

Now I know this is a bit confusing and maybe I didn’t explain it too well. Trust me it works.

What’s the matter with you lot just take some time to fuckin read it.

Sorry I’m losing my temper a bit here, the dog’s just pissed on the TV remote again. Just read through it a few times and the penny will drop.

CNC Training Centre Classroom Training

Where the teacher is never angry.

DO NOT PASS GO DO NOT COLLECT £200

Yes you can do this with GOTO

This is my pet Cockroach his name is Boris

GOTO 100
Same as M99 P100

To do this you must have the Macro Option if you don’t then this is where M99 comes in handy.

Best way to see if you have macro is to try using it in MDI.

In MDI Type in #1=6 if you have macro it will work if you don’t you’ll get an alarm and your machine will self destruct in 15 minutes.

Jumping Sections of Code on a Toshiba Tosnuc 888 or Similar

This is how you do it on a Toshiba (the blue bit).

Don’t forget it’s GO (that’s G and letter O) not G0 which is G and number zero (Rapid Command).

Don’t get your letter O’s and your number zeros mixed up.

/M99 P50                                   /[GO,50]               (JUMP TO N50)
M99 P100                                    [GO,100]            (JUMP TO N100)
N50                                              N50                      (ARRIVE HERE
THE CODE
THE CODE
THE CODE
ETC
ETC
ETC
ETC
N100                                            N100                      (ARRIVE HERE)

Without Fancy Shit  (Just jump some code)

M99 P100                                    [GO,100]            (JUMP TO N100)
THE CODE
THE CODE
THE CODE
ETC
ETC
ETC
ETC
N100                                            N100                      (ARRIVE HERE)

If you have macro you can do a similar thing on Mazak, Haas or Fanuc.

Services offered at CNC Training Centre

Edgecam training.

Classroom programmer training.

Onsite CNC Machine Training.

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

Call 07834 858 407


G71 and G70 Use to Rough and Finish Turn

New video about the G71 roughing cycle on a Haas or a Fanuc control, also covers the G70 finishing cycle.

CNC Training Call David: 07834 858 407

30 Five Star Reviews

CNC Training Centre Reviews

Contact CNC Training Centre

 

 

G71 is sometimes known as a canned cycle when in fact it is a multi repetitive cycle. The G70 cycle goes with it and can pick up the same lines to finish.

The N numbers are important as the cycle uses these as the points of reference to jump to.

G71 cycle interprets the shape between these two N numbers and then breaks up the shape for roughing.

“Read More”

G96, G97 and How To Calculate Surface Speeds

CNC Training Call David: 07834 858 407

30 Five Star Reviews

CNC Training Centre Reviews

Contact CNC Training Centre

Basic Turning

Basic Turning
G96 Hamsters Large wheel Small wheel
Call us for CNC Training and hamsters

Basic Turning, in the early days of CNC Turning G96 was one of the things that really made a massive difference.

It meant that instead of having to turn a part at a fixed speed and feed, the part could be programmed in G96 which was a constant surface speed.

Where diameters changed, particularly when facing, it made a massive improvement to tool life and surface finish as well as speeding up the whole process.

G97 Speed In RPM

In Basic Turning when you program G97 your machine will start the chuck up at a speed in RPM. So if you program.
G97 S1500 M3
Your chuck will start revolving clockwise at 1500 rpm.

G97 for Drilling Tapping and Screwcutting

When drilling  a hole you are on the centreline of the machine so you just want plain old simple RPM.

When tapping or spot drilling it’s the same.

Screw Threading (G76) can only be done in G97

G96

G96 however means meters per minute. This is a surface speed.
G96 S200 M3
Your machine would start up at a surface speed of 200 meters a minute. Now your RPM would depend on where on the diameter the tool was positioned.

Basic Turning

If the tool was positioned  at a 100mm diameter it would be as if the tool were able to run around this diameter at  a speed 200 meters a minute.
It’s a bit like being on a running machine if you ran at 200 meters a minute and placed various diameters under your feet the large ones would turn at slow rpm and the small ones would turn at high rpm. (Just like the hamsters above)

Basic Turning

 That’s why on a manual lathe it is hard to face a large diameter without changing speed half way.

Neeeeeoooooooowwww

You know when you face a part on a CNC Lathe and you hear that change in pitch? It’s the spindle increasing in RPM as it gets closer to the center of the part.

When it gets to the center your spindle is flat out so the G50 becomes crucial.

The G50 restricts the speed of the machine.

G50 S2000 machine will go no higher than 2000 rpm.

 

G96 G97 hamster on a Wheel

Did you have a pet hamster as a child?

I know it’s a random question but bear with me there is a point to this.

Well maybe you still have a Hamster and that’s not a problem. Time you fuckin grew up but it’s not for me to judge.

Anyway I did and his name was Harold Wilson (British Prime Minister at the time).

Well I bought my hamster loads of different wheels to play on just like the one above.

My hamster suffered with depression on account of being stuck in a cage all day and not having a girlfriend oh and he had a lot of credit card debts too.

These wheels varied in diameter from about 6 inches to a massive 2 foot one. They kept him happy all night. He was so tired he slept all day.

Harold could only run so fast but I noticed when he was on the small 6 inch wheel it absolutely whizzed around. Now on the big two foot diameter one it took him ages just to get it to spin around once.

Basic Turning
G96 G97 all about hamsters

Harold Had G96

A CNC machine in G96 will give a lovely finish because the surface speed always remains the same.

So even though Harold ran at 200 metres a minute (this is fuckin lightening speed for a hamster)

The wheels ran at different RPM depending on what diameter they were.

Harold Was a Clever Bastard

Oh by the way Harold had a tail (unlike other hamsters) and a maths qualification.

He knew that if he multiplied the diameter of the wheel by .00312 it would give him the circumference of whatever wheel he was running on in meters.

200 mm wheel (.00312 x 200 = .6864)

All he now needed to do was divide this answer into the speed he was running at and he would know how many RPM his wheel was revolving at.

If he was running at 200 meters a minute not only would he be fuckin knackered but the wheel would be running at 291 rpm

200 / .6864 = 291

Basic Turning Manual Machining

Using a manual machine you have to compromise. At the outside your speed is too fast and when you get to the centre you are too slow.

Manual Lathe


On a CNC lathe we would normally program in mm per revolution as well because the speed is changing all the time so we need our feed to be locked into the speed.
With a machining centre our cutter is always revolving at the same speed so the feed can be constant in mm per minute.

Someone out there will be thinking “what happens in G96 when you get to the centre of the part”. Well the spindle will be flat out!

Could be a problem. That’s where your G50 comes in to restrict the speed. Very important! CNC Basics G50

cnc turning basics
G50 Warning

Watch the video

See how surface speeds are translated to speeds in RPM. There are many converters online that you can use for this and I do recommend their use. It will also mean you don’t have to watch my tedious video.
When I train people at the CNC Training Centre my emphasis is on understanding not memorising. I usually start by saying “please don’t remember all the things I am telling you”.

 In the early days training students in Basic Turning I remember them saying to me the next day that they had G codes floating around in their head from the lessons the day before.

Basic Turning
G96 and G97


What I really mean is that the most important thing is to understand what the machine can do and the concepts of programming and Basic Turning.
You could say “I know there is a G code that makes the machine run in RPM” so all you need is a list of G codes.

If you can be bothered to work through the simple maths above. It will help you to fully understand how G96 is works.

Here is a list of Basic Turning G Codes.

The ones you use every day you will remember whether you want to or not.

G96 Whoopee It’s amazing

So use G96 for everything.

Except for:

  • Drilling.
  • Tapping
  • Threading (Screw cutting)
  • Cutting the Lawn

If you feel you have been affected by any of the issues mentioned in this post please Contact me

If you liked this video, please don’t forget to subscribe to my YouTube channel by going to: CNC Training Centre

Please contact me if you require:

  • CNC programming training.
  • Want to learn CNC programming.
  • Fanuc control training.
  • Yasnac programming training.
  • Any type of CNC course.
  • Fanuc training courses
  • CNC lathe training
  • CNC Vertical Machining Centre training

Services offered at CNC Training Centre

Edgecam Training.

Classroom programmer training.

Onsite CNC Machine Training.

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


G92 Threading Single Line Method

CNC Training Call David: 07834 858 407

CNC Training Centre Reviews

G92 threading Cycle is something that concerns me. It’s sadly neglected. Now I know you’re probably saying “no one uses that old shit anymore”

Well you could be wrong.

G92 Threading works exactly the same as G76 except you need to programme every pass. This would be a pain in the arse but hear me out.

The Haas G76 cycle does not have any facility for a spring pass. This is where you add extra cuts at the end of a threading cycle to take out any metal left from the tool pushing off.

On a Fanuc control you can put these extra spring passes in as part of the G76 cycle.

Read this if you need to know more.

If you want this on your Haas control or an old Fanuc control then you can do this.

G76 X16.93 Z-25. K1.534 D.485 F2.5

G92 X16.93 Z-25.
X16.93
X16.93

Just add the G92 after your G76 cycle and whatever X figure you want to go to.

The G92 is modal so you will need a G0 move to cancel it. The code above would give you three spring passes.

Here is a load more interesting stuff.

I hope you have enjoyed reading this article.

Thanks for watching and reading

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

Siemens 828 840 Sinumerik Training

Or call us 

If you want to learn to program CNC Milling Machines

Look no further Contact CNC Training Centre

 

 


Careers in CNC

View all current vacancies in CNC

Click here

Call David: 07834 858 407