G74 Drilling Cycle With G96

Tags :

Category : Fanuc Turn Mazak Turn

G74 Drilling Cycle With G96

G74 Drilling Cycle with G96.

On a CNC lathe G96 is used for most machining. It was amazing in the old days when we suddenly discovered G96.

Because you are using a constant surface speed the metal cutting is consistent so you get a great finish.

The Black Art Of CNC Programming

CNC Programming was a bit of a black art back in the old days and generally speaking we used G96 for everything except for screw cutting and drilling holes on centreline (G74 Drilling Cycle).

When CNC Programming a drilled hole you would always use G97, (this means the speed is in RPM).

If you were to program for example G96 S50 M3 and then rapid to X0 and Z3. ready to drill a hole the machine would just go to its maximum RPM. This would be the speed you set in your G50. (The G code used to restrict the speed.)

Oh by the way that 50 meters per minute is for a B & Q drill.

Don’t get me wrong I love B & Q products but HSS drills are not for grown up engineers they are great for metal work classes at school and making a coffee table for the misses but it’s time to join the big boys and spend some money.

I Digress

Anyway the machine would calculate the speed at its current diameter. So at zero the spindle would always be flat out.

So you could say G96 is pretty useless for a drill.

But you would be wrong!!!!!!

Take a look at this bit of code.

G74 Drilling Cycle

The idea is to send the machine to the drill diameter. Because the machine is in G96 it calculates the correct speed. When you then issue G97 it fixes the speed. Now when you move to X0 it has the correct speed.

Let The Machine Do What It’s Good At

Mmmmmmm… So all you need to do is send the drill to its diameter and the machine does the arithmetic.

Let the machine do what it’s good at and you do what you’re good at.

What are you good at by the way?

Threading is the same if you were machining an M20 thread at 100m/min calculate the surface speed.

(This is the quickest way I have seen)

20/314.2 =.06365

100/.06365 = 1571 RPM

You could do the same thing let the machine do it’s shit.

Rapid to the diameter of the thread then program G96

G0 X20. Z5.;
G96 S100 M3 (Start Spindle at 100 metres per min);
;
G97 (This will swap to RPM and clamp the speed at the correct RPM);
X21.;
;
G76 P010060 Q20 R.02;
G76 X16.93 Z-25. P1534 Q485 F2.5;
;

ETC

So with this bit of code you can get the machine to calculate your speed.

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.

Or call us

If you want to learn to program CNC Milling Machines

Look no further Contact CNC Training Centre

 

 


D01 END1 Macro How does it work?

Category : Macro

D01 END1 How does it work?

Someone said to me the other day to “why don’t you just do one”. In fact people often say this to me, even complete strangers. I was forced in the end to google it.

Anyway having researched it at length I can safely say it’s not a term of endearment. It actually means “fuck off”.

Now in macro programming it all takes on a different meaning. If you ever programmed computers back in the 1980’s then you’ll remember BASIC

(Beginner’s All-Purpose Symbolic Instruction Code)

This was a computer language very similar to Macro programming. Mmmmm not come far have we?

Anyway that’s where this language originates. Often known a Spaghetti programming. A pejorative phase to describe this type of programming used mainly because you can be hop skipping and jumping all over the program with GOTO statements and all sorts of confusing shit.

You have to be very disciplined with this type of programming and add loads of explanations. You must space the code out in neat chunks.

Although crude, macro programming has some great uses.

Oh and it adds real functionality to CNC programming.

D01 END1 What is it then?

This is a kind of loop and is best explained in an example. My example is a macro that will drill a grid of holes. The user states the spacing in X and the spacing in Y. Also the number of holes in each direction.

Now I know the smart arses are saying “fuck me, doesn’t he know there are cycles that already do this, yawn yawn”

Well actually I do.

I also know that the wheel was invented 3500 B.C. but the wheel can be used for demonstration which is what I’m about to do.

Demonstrate grids that is not wheels.

First of all this is just drilling one line of holes I’ll then go on to complicate the shit out of it by doing a grid.

First of all I drill one hole at X0 Y0, or whatever I want as my first  position. The G202 has two parameters W and X.

W is the number of holes along the X axis.

X is the width between holes.

So this will give me 6 holes 10mm apart along the X axis.

I have aliased G202 to program O09011 which is my macro. Here’s how you do it in case you forgot.

This is program O9011

D01 END1

The line WHILE [#23 GT 1] DO1

Tells the control that as long as #23 is greater than 1 to go around the loop.

It’s now looking for END1 which corresponds to D01 and it whizzes around the loop.

You can have loads of these.

The END must match the D0.

It could be D02 & End2 the choice is yours. The D02 is just the name it’s nothing to do with how many times you go around the loop.

Just make sure you don’t get mixed up else you will have a nightmare trying to sort them out.

Each time it goes around the loop it checks the condition in the statement.

The line #23 = #23 -1 will reduce #23 by one each time it goes around the loop. (Eventually #23 will not be greater than 1 and the control will escape the loop and carry on)

The next line moves X incrementally (G91) by the amount stored in #24 (this was the X value you put in the G202). It drills a hole because the G81, stated in the main program, is still active.

The control is then put back into G90 (Absolute) as a safety measure.

Read this article for more on G and M code aliasing.

Now Lets Complicate Things

OK so you understood that?

Good now lets completely fuck it up.

D01 END1, This is the complete program.

First of all I drill one hole at X0 Y0, my first position same as above.

The G202 now has four parameters D,W and X, Y

D is the number of rows in Y.

W is the number of holes in X.

X is the width between holes along the X axis.

Y is the depth between holes along the Y axis.

So this should give me 6 holes 10mm apart in the X axis and 6 rows of holes 10mm apart in Y.

(A grid of holes)

 

More D0’s and Ends

Now we have D01 END1 inside D02 END2.

D01 END1

So……… the D01 END1 is the rows of holes across (X Axis).

The D02 END2 s the number of rows (Y Axis).

Now lets break it all down.

O09012 (Drill Grid of Holes)
G103 P1 (NO BLOCK LOOK AHEAD)

#100= #23 (Store W Value)

The line above puts #23 which was the W value into #100. This is because we are going to need it again when we go round the D01 END1 again. This loop reduces it down each time it goes around, so it needs to be restored.

WHILE [ #7 GT 0 ] DO2 (DO LOOP)

The line above is the condition that allows it to keep going around the loop as long as #7 is greater than zero.

WHILE [ #23 GT 1 ] DO1 (DO LOOP)
#23= #23 – 1 (COUNTER DECREASES BY ONE)
G91 X#24 (Drill a Hole)
END1

The D01 END 1 above is one row of holes once the condition is satisfied it escapes the loop.

#23= #100 (Restore W Value)

Remember we saved #24 in #100. you need to set this back to it’s original value because the loop above reduced it down to zero.

#24= – #24 (Reverse X)

This is to make the X move in the opposite way to make the path zig-zag. This will make it toggle between plus and minus.

#7= #7 – 1 (COUNTER DECREASES BY ONE)

The above is the counter for the rows. Number of rows was in D (#7) so wee need to reduce this number as we go.

IF [ #7 EQ 0 ] GOTO1
G91 Y#25
N1

This little bit of code above is for when we get to the last row of holes we don’t want the Y move as we have completed the grid.

END2

G103 P0 (RESTORE BLOCK LOOK AHEAD)
M99

It looks like this.

So there you have it. I hope you now have an understanding of how these loops work.

This kind of programming is notoriously difficult to get your head around. Once the penny drops it gets easier.

The problem is our brains are not too good at thinking about two things at the same time.

It’s called spaghetti programming for a reason.

My advice with all programming is to break the program down into small manageable chunks. Make simple little programs of each part and prove them till they work. You can the piece your program back together.

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

 

 


5 Axis Machining is it all it’s Cracked up to be?

Category : 5 Axis

5 Axis Machining

 

 

 

5 Axis Machine
XYZ 5 Axis

 

5 Axis Machining The latest Buzz Word

A few years back, probably more than I think. I was asked to speak at the Edgecam user group meetings.

If you have Edgecam you really should be going to these (they’re brilliant).

Anyway the buzzword was 5 Axis machining everything was bloody 5 axis machining. Anyway me being the agent provocateur, that I am, didn’t want to talk about 5 axis machining.

(Agent Provocateur: French meaning awkward old bastard)

Before you panic, 5 axis machining is not illegal but it may not be the panacea you think it is.

Armitage Shanks

Apart from being a great track by Greenday. Armitage Shanks is a company known for its toilets and its bathroom fittings.

At one time these were in every Shithouse in the UK.

Anyway the story I told was about when I worked for Armitage shanks making bidet taps.

A bidet is a sink that posh people wash their arses in.

They were making these bidet taps on a 5 axis machine. This meant that a completely machined tap could come off the machine in one hit.

I was asked to speed it up. After much deliberation I went back to the boss, who wanted a cycle time of about 3 minutes per tap, to explain that it was not possible.

I think the cycle time they were getting was about 10 minutes.

“Imagine” I said “if we only did tool changes and no machining”. He looked at me a bit strange (as they do in Wolverhampton).

“The cycle time would be 2.5 minutes. So there wouldn’t be much time left for machining”. I also asked him if he needed to be able to produce one complete tap at a time.

The five axis method would be perfect if they had needed to produce say five of one type then five of another type on a “just in time” basis.

Anyway it transpired that this was not the case.

There Lies The Problem

Because they were only making one tap per cycle the tool changes really added up. The solution was that we bought four three axis CNC Milling machines and each machine had a manual pallet changer.

The component was broken down into single operations presenting one or two operations per machine.

This meant each machine was working on 12 taps at once.

Just like a car track production line the time to produce one tap was the longest operation. The final time was about 2 minutes per tap.

Tool Change Time

So you pick up a tool and make 12 parts before you change to the next tool. If the tool change time was 12 seconds then that’s 1 second per part.

Are you with me on this one?

Can you see how all the tool change time is disappearing?

5 Axis Machining

Happy Ending

The five axis machine got used for something else it wasn’t scrapped it’s ok no need to worry.

Five Axis Machining

A five axis machine will be a huge drain on your wallet and  can turn your brain to fudge.

So imagine I am a machine tool salesman and I am about to sell you five axis machine. Dead easy the machines would fly out the showroom like “shit off a stick”.

My Pitch (If I was flogging you a 5 axis Machine)

How often do you damage parts moving them from one machine to the next?

How often do you lose parts between operations?

Why set up a part for five operations when you can do it in one hit?

Yea and you get to do shit like this.

 

5 Axis Machine

This is called a swarf cut Side Wall Axial Relief Feed. (Go on impress your mates with that one)

This is something you can only do on a 5 Axis Machine. And yes you need all five of em to do this.

Also unless your name is Alfred Einstein you will need a computer to calculate the code.

Now The Down Side of 5 Axis

It always makes me smile when people brag about being a 5 Axis CNC setter Operator. It’s actually more difficult trying to operate the self service checkout at Morrisons (an English supermarket)

5 Axis Machine

I can certainly recommend the fish at Morrisons by the way, but go to one of the staffed checkouts otherwise you’ll meet me still trying scan my fuckin pizza.

The reason why I say this, before I get a terrade of hate mail from all the 5 axis machinists, is because it’s all programmed on a CAD/CAM system and downloaded to the machine.

The operator has the privilege of pressing the cycle start button.

5 Axis Machine

5 Axis Machine

5 Axis Machine

Easy As X Y Z A C

So from an operating point of view once you get over the fancy footwork they are a pretty boring machine to run.

Disadvantages Of 5 Axis Machining

  • Lots of tools to manage.
  • Loads of features to check.
  • High level of CAD CAM programming skill required.
  • Machine initial cost.
  • Software cost.
  • Big investment in one machine, if it breaks down your haemorrhaging money.
  • Set up time will be much longer.
  • Difficult to multi load parts.

Three Plus Two 5 Axis Machining

You must have heard people say that?

Well what does it mean?

It means you have a three axis machine X Y and Z and then you stuffed on a rotary axis (4th axis) usually called A and then on top of that you mounted another rotary axis (5th axis) sometimes called C.

You can program the XYZ as usual and then add a position in A and C something like A60. C45.

Now the A and C axis don’t have a clue what the other axis are doing and frankly they don’t give a shit.

So you get to present a part at a compound angle and once it’s there you can do stuff.

You know stuff like milling a face, machining a pocket or drilling and tapping a hole.

 

So What’s The Difference

So to do simultaneous five axis machining your machine has got to have the software to produce simultaneous moves like SWARF cuts.

Three plus two could be done just by placing manual indexers on the table to create the compound angle you need.

Advantages of Thee Plus Two

  • You can load a part and machine on different faces so you may only need to pick it up once.
  • Cheaper to buy or can be retro fitted.
  • It’s easier to control dimensions because once the datums are set each part will be the same.
  • Reaches the parts other machines can’t reach.

Multi Loading With 5 Axis Machining

By the way you can multi load on a five axis CNC Machine but it does need to be quite a big machine.

This means you have a cube with several parts mounted on each face.

Thanks for reading my article.

Please contact me if you require:

  • Fanuc training.
  • CNC programming training.
  • Want to learn CNC programming.
  • Fanuc programming training.
  • Yasnac programming training.
  • Any type of CNC course.

Don’t forget to watch my Tutorial Videos

We offer training on all types of CNC Machines and controls check em out.

co*****@***************re.com

Or fill out the contact form below

 

 

 

 

 


Surface Finish CNC Turning

Category : Beginners

CNC Turning Surface Finish

Ever wondered what feed rate is best to give you a particular CNC Turning surface finish? Or do you just guess?

Well look no further. From now on you’ll be able to work out what feed-rate will give you the surface finish you require when CNC Turning.

Oh and there’s a formula where you can work out what surface finish you’re going to achieve without a fortune teller.

 

 

We are going to use um Ra.

The um stands for microns.

The Ra stands for roughness average.

Here is a full explanation if you really want to know. 

CNC Turning

 

You can buy a flat block like the one above which you can use as a comparison to see what surface finish you’re getting.

The section above is for CNC Turning surface finishes.

So you can already see that 12.5 is like a plowed field and .4 is like a babies arse (as my father used to say) .

So if you’re fixing a fence post then 12.5 might be OK.

Surface Finish The Dreaded Formula

surface finish

First of all what feed rate would you need to obtain a certain CNC Turning surface finish.

CNC Turning

Now what if you’re already machining the part. That means you know the feed rate. What surface finish will you get?

CNC Turning

So………….

Our tip radius is .8mm

CNC Turning

We want to achieve a 3.2 um Ra  CNC Turning surface finish

CNC Turning

So here’s the formula.

CNC Turning

Let’s do this bit first.

https://www.youtube.com/watch?v=vWQgBtlUUMM&ab_channel=MotoMadness

8 x .8 x 3.2 = 20.48

Now let’s divide it by 1000

https://www.youtube.com/watch?v=vWQgBtlUUMM&ab_channel=MotoMadness

20.48 / 1000 = .02048

Now lets square root the answer.

https://www.youtube.com/watch?v=vWQgBtlUUMM&ab_channel=MotoMadness

Square root of .02048 = .143

So the feed-rate you need is F.143

CNC Turning

OK… You Came Back. You Ready to Carry On?

Anyway let’s see how you do it backwards.

surface finish

So imagine you had been turning these imaginary bits with a .8mm radius insert at a feed-rate of .143 (F.143)

First of all square the feed rate .143 x .143 = .020449

CNC Turning

Now do the bottom bit 8 x .8 = 6.4

surface finish

Now divide the top by the bottom.

surface finish

.020449 / 6.4 = 0.00319515625

Then simply multiply this by 1000

0.00319515625 x 1000 =3.19515625 (3.2)

That’s 3.2 to you

surface finish
A surface finish comparator

It worked backwards!!! Phew what a relief.

Surface Finish, Now Let’s Think About This

So to get a 3.2 finish with a .8 tip radius you would need a feed rate of .14

Now let’s do the same calculation with a .4 radius tip.

surface finish
Calculate surface finish

So did you work it out?

Here’s one I prepared earlier.

The answer is .101

And if you can be bothered to work it out with a 1.2 radius tip.

The answer is .175

.4    =  .101
.8    =  .143
1.2  =  .175

Interesting

So as the tip radius gets bigger you get to increase the feed rate!

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.

Oh yea we do CNC Training too not to mention Classroom Training.

Or call us

If you want to learn to program CNC Milling Machines

Look no further Contact CNC Training Centre

 


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

 

 

 


Careers in CNC

View all current vacancies in CNC

Click here

Call David: 07834 858 407