Category Archives: Mazak Mill

CNC Milling G02 G03 to Mill a Full Circle

CNC Milling G02 G03

 

CNC Milling G02 G03

To produce a full circle on a Fanuc or Haas G code type programming system is really easy.

Last week I was training four very experienced programmers and I asked them how they would programme a full circle.

The answers they gave shocked me, I had to take out my hip flask and drink a large shot of brandy.

What they were doing was perfectly correct but definitely not the simplest way.

One said he broke the circle into two halves. One said he copied some code he already had in the machine. The other one said he got the bloke who did it in two halves to do it for him. Oh and the other one used I and J and X and Y.

OK so just imagine you want to mill internally around a 40mm diameter circle.

Training Courses Let Me at Em

CNC Milling G02 G03 to Produce a Full Circle, here’s the code.

First in two halves

G0 X0 Y0 S1500 M3
G43 Z3. H01 M8
G1 Z-5. F100.

G41 X20. Y0 D1 F200.    (Apply Cutter Compensation)
G3 X-20. R20.                   (First Half)
X20.                                     (Second Half)
G1 G40 X0 Y0                   (Cancel Cutter Compensation)

G0 G53 Z0

All in one complete with wasted Code

G1 G41 X20. Y0 D1 F200.
G3 X20. Y0  I-20. J0 (Mill Full Circle)
G1 G40 X0 Y0

But this is really all you need

G1 G41 X20. Y0 D1 F200.
G3 I-20.         (Mill Full Circle….. Sooo Simple)
G1 G40 X0 Y0

Remember that song by the Average white Band “Let’s Go round Again”? I used to love it.

Actually I still do, as an old twat I’m allowed to like this shit.

Ok let’s go round again. It’s so easy and it saves leaving a mark.

G1 G41 X20. Y0 D1 F200.
G3 I-20. (Mill Full Circle)
I-20.        (Lets go round again)
G1 G40 X0 Y0

Now if you have a Toshiba with Tosnuc control or Haas or maybe a Yasnac CNC control…..

CNC Milling G02 G03 to produce a full circle you just need this:

G13 D1 I20. F200. (Everything all in one)

                G13 (Counter Clockwise) G12 (Clockwise)
                D1 (Use offset 1)
                I20. (20mm Radius)

G13 does everything. It’s the an all inclusive holiday of circular milling except you don’t gain weight and you’re not pissed everyday.

How cool is that and you even get a tangential approach. At my age you’re glad of all the tangential approaches you can get.

No there is no sexual innuendo here it just means you approach the circle using a circular move. You sort of creep up when it’s not looking.

Know what I mean??

Here is a nice picture to demonstrate.

CNC Milling G02 G03

Think about it, why would we do this?

Well the older and more inaccurate your CNC machine is the more likely it is that your machine will leave a mark at the entry and exit point. This is also dependant on the material and the size of the cut you are using.

A quick workaround for this is to just go round the circle twice (let’s go round again). It very often does the trick.

CNC Milling G02 G03

Oh by the way if I saw a tangential move that big I would think it was a wasted move. (It’s just to demonstrate). You only need a short tangential move to do the job.

The easiest way to programme a tangential approach is like the ones above. Coming in from North, South, East or West on the compass.

Now look at this.

CNC Milling G02 G03

This is the best way, although it’s more difficult to programme.

I think it’s South West on a Compass?? 

 

 

The reason is that there is no axis change of direction and no animals are injured or hurt in any way during the process.

If you watch the movement above and watch carefully what the X axis is doing. It changes direction before it is in contact with the circle. And the same thing on the way out of cut with the Y axis.

Direction Change When Using G02 G03 to mill full circle

When milling a full circle each time an axis changes direction there is a chance you will be left with a visible mark on the circle. These points are North South West and East on a compass.

Watch below to see where these points are. If you have a new machine there should be no visible mark on this change of direction.

On an old machine this can be really noticeable and cause real problem.

CNC Milling G02 G03

 

Circular Motion and Skid Marks

If you have an old machine you will know what I mean. Those little annoying marks where the machine changes direction. If CNC Machines were underpants then these would be the skid marks.

For my American readers in the UK we call those annoying brown marks at the back of your underwear skid marks. I don’t think you get them in America.

 

I have been working on a 12 year old Mazak Horizontal machine recently and was amazed at just how good a circle it produced. It beats the shit out of using a reamer. Oh and you can easily adjust the size with your D offset.

CNC Milling G02 G03

Just a note. If you do use circular milling to produce a bore just remember that if your cutter is not parallel then your bore won’t be either. So don’t use that crappy old re-ground cutter. Try n get the boss to buy you a shiny new one.

 

CNC Milling G02 G03

oh and just one other thing………..

Measure the bore at the top and the bottom.

Simple Full Circle Programme

G1 G41 X20. Y0 D1 F200.
G3 I-20.     
G1 G40 X0 Y0

There are actually four choices which produce four totally different circles.

And potentially a scrap part. So use those machine graphics to check your code if you got em!!

CNC Milling G02 G03

G3 I-20.    (The one on the left and the one we used)

G3 I20.     (The one on the right)

G3 J20.    (The top one)

G3 J-20.  (The bottom one)

Here They Are In Action

CNC Milling G02 G03

 

CNC Milling G02 G03

Click for More on G02 and G03

If you want to do this on a Sinumeric Siemens 840D read this

Thanks For Reading

Don’t forget there’s loads more folks.

And a YouTube channel

Call David

Learn CNC Programming

Services offered at CNC Training Centre

Edgecam programming and training.

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.


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


CNC Milling G Code List For Beginners

CNC Milling G Code List

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

Download CNC Milling 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 who bought all The fuckin toilet paper?”

When it comes to CNC Programming the idea of not remembering loads of G Codes is really important. Truth is you only need a few and it’s all about understanding what they do.

For Example I want to drill a hole.

You completed a training course at the CNC Training Centre. You understood it all and you practiced with you free simulation software that you get with the course.

You start writing a program to drill some holes.

From your training you know that there is a cycle that drills holes.

You understand how the cycle feeds the tool down to a depth and then it rapids out ready to do another.

Quick Fix G81 Video

You also know that if you keep adding more positions (X50. Y50.) it will keep drilling holes.

And… when you are sick of drilling holes there’s another G code to stops it.

What Are These G Codes?

So you just look em up on your CNC Milling G Code List.

G81 Drilling Canned Cycle
G80 Cancel Canned Cycle

Then you think “mmm I’m sure there’s one that pecks the material out and breaks it up”

“Let me see… Ah this looks like the one

G73                 Peck Drilling

CNC Milling G Code List

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

Download CNC Milling G Code List PDF

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

G43                 Apply Tool Length Offset
G54 to G59     Work Offsets

G81                 Drilling Cycle
G73                 Peck Drilling
G83                 Deep Hole Drilling Cycle
G84                 Tapping Cycle
G80                 Cancel All Canned Cycles

G90                 Absolute Programming
G91                 Incremental Programming

Download CNC Milling 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

 

 

 

 


G82 Drilling Program Example

G82 Drilling Program Example

G82 Drilling Program Example, this simple part has four M12 holes drilled countersunk and tapped.

The datum is the centre of the part so the holes positions are.

X55. Y55.
X-55. Y55.
X-55. Y-55.
X55. Y-55.

G82 Drilling Program Example

Here is the CNC code

G82 Drilling Program Example

The machine first moves to X-55. Y-55. and rapids the Z axis to 3mm above the part.

It then rapids the Z axis down to 1mm above the part R1.

The G82 Cycle instructs it to drill a hole 6mm deep (Z-6.) at a feed of 200mm per minute (F200.)

When it gets to depth the P3000 tells it to dwell for 3000 milliseconds which is 3 seconds. No decimal point allowed. (Varies on controls)

When the hole is done it rapids back to the initial point (Z3.) This was in the line

This is because of the G98.

If it were G99 it would return to 1mm above the job (R1.)

See explanation of G98 and G99

Once the cycle is active each time it sees a position it repeats the drilling process.

When the G80 is programmed it no longer drills holes.

Now watch the video to see it all in action.

G82 Drilling Program Example

Haas G82 example

It’s been great fun writing this article for you but to be totally honest i think this cycle is a complete waste of time. Whenever I have put a dwell in a spot drilling cycle it always seems to chatter.

However if you do use this cycle please let me know if you have success with it.

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

 

 

 


G73 Peck Drilling Example (Canned Cycle)

G73 Peck Drilling Example

G73 is a peck drilling canned cycle.

This cycle drills holes and breaks up the chips as it goes. It does not fully retract from the hole.

It retracts just enough to break the chips up.

This simple part has four M12 holes drilled countersunk and tapped. The datum is the centre of the part so the holes positions are.

X55. Y55.
X-55. Y55.
X-55. Y-55.
X55. Y-55.

G73 Peck Drilling Example

Here is the CNC code (G73 Peck Drilling Example)

G73 Peck Drilling Example

The machine first moves to X-55. Y-55. and rapids the Z axis to 3mm above the part.

 

G73 Peck Drilling Program Example

It then rapids the Z axis down to 1mm above the part R1.

The G73 Cycle instructs it to drill a hole 17.5mm deep (Z-17.5) at a feed of 200mm per minute (F200.) 

The Q2. tells the machine to drill the hole in 2mm steps. After each step it retracts a small amount to break up the chips from the drilling.

As it drills the depth increases by 2mm each time.

When the hole is done it rapids back to the initial point (Z3.) This was in the line

G73 Peck Drilling Program Example

This is because of the G98.

If it were G99 it would return to 1mm above the job (R1.)

See explanation of G98 and G99

Once the cycle is active each time it sees a position it repeats the drilling process.

When the G80 is programmed it no longer drills holes.

Now watch the video to see it all in action (G73 Peck Drilling Example)

G73 Drilling Example

Haas G73 example

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

 

 

 


Careers in CNC

View all current vacancies in CNC

Click here

Call David: 07834 858 407