Category Archives: New Stuff

G91 Non modal Haas Setting 29

Now I don’t want to appear sexist here but sometimes my wife will be awake at night worrying about whether or not she left a gas ring turned on.

Now me I worry about different things I mean how can you compare a gas explosion to a collision on a CNC Machine.

(I really should clean that cooker)

Anyway my point is if you worry about G91 and if you left one active in a program and it causes a collision.

Help is at hand. Now this maybe another piece of useless shit and you might wish you had stayed on Facebook, reading your mates post, ruminating on the benefits of vegan cheese and how you can’t tell the difference. (I have tried and it’s really nice once you get the thought of eating semtex out of your brain).

Don’t set me off about vegans. Just answer one question, if they don’t like meat why do they have to keep banging on “I’ve just eaten this burger and you would think it was real beef”

Anyway if you change setting 29

G91 becomes non modal read this article if you need to know more

Anyway what it means is that if you wrote some code like this

G90 G0 X0 Y0
G81 G98 Z-20. R1. F100.
G91 X50
X10.
X20.
X30.
G90 X100.

You would have to write it like this

G90 G0 X0 Y0
G81 G98 Z-20. R1. F100.
G91 X50
G91 X10.
G91 X20.
G91 X30.
X100. (This would go back to G90 automatically)

“That’s daft” I hear you say.

Well not really because it means that if you ever forget to switch back to absolute (G90) it doesn’t matter because it never got swapped in the first place.

Every time you want G91 you need to write it in that block of code.

 Best Website with Crack Program:


Using Macro System Variables

Category : Macro New Stuff

Macro System Variables, I often get random emails from people asking me all sorts of questions.

I got one only the other day it began “Hi David, your articles are shit”

I don’t answer every email I get, but I try to answer when I think there is an appropriate response or I feel I can help.

Macro System Variables

Macro System Variables

Anyway someone called Neil from America (I think) asked me if I would create a tool setting macro. This involves using Macro System Variables

There is a really annoying thing on a Fanuc control (well actually there are quite a few). This one really pisses me off because I find myself making excuses for the control. I mean like I designed the fuckin thing.

For one, I am nowhere near clever enough and don’t even work for Fanuc. (I am available Mr. Fanuc, sorry I dissed your control)

To set a tool length it’s a really convoluted procedure. You first zero out the Z on the REL display.

You then bring down a tool and get the control to record the Z position by pressing Z then the soft key INP C.

Macro System Variables

Here’s a couple of videos showing you how.

Origin Z

Use INP C to Enter Offset

 

Once the Z has been set you can measure as many tools as you want. Just bring each tool down to the setting block and press Z then  INP C.

Macro System Variables

Here comes the problem…..

If you turn turn off the machine or, for some reason, you have to reference it again you will lose your REL Z position. You will now have to set it again.

Oh and if you don’t notice you’ll be in deep shit. (Your tool length will be wrong!!!)

There are ways around this by using a work offset, but to be honest it’s all a pain in the fuckin arse.

Oh and one other thing. Make sure you write the offset to the correct tool because you can write it to any tool.

Warning

Check the Z zero position each time before setting tools.

A good guide is to slap a good old steel rule or a tape measure against the tool for a rough check.

Macro System Variables to the Rescue

For years I have used a work around on Fanuc Controls. First of all you need to establish where your setting block is. In my case it’s a table probe.

Oh and you need macro (it is an option so if you don’t have it look away now.

To do this you need to note down your machine position in Z when you touch your block or setting probe.

This will later be stored in a variable to be used to calculate the tool length.

Try to set your block in a known position so that each time the Z figure is the same. You may even be able to fix it to the machines table. Don’t weld it, the boss won’t like it.

Read on to see how this variable can be written to automatically with a calibration programme.

The Programme…  OK Let’s Do This

  1. Bring the spindle nose down to touch your setting block. this is the value you will write into #102 (Mine says -500.877)
  2. Call your tool to be measured into the spindle in MDI (T06 M06;)
  3. Bring the tool down to the setting probe.
  4. Run the programme below.

O9001(Tool Measurement Macro)
1.  #100=#4120 (Grab Tool Number);
This will cause the machine to store the current tool number in #100

2. #101=#5023 (Store Machine Z Position);
This will cause the machine to store the current Z position in #101 

3. #102=-500.877 (Setting Block Z);
This is the figure you recorded from the position of the setting block.

4. #150=#102-#101 (Calculate Tool Length);
Now we can calculate the tool length by taking the known position from the current position.

This will give us a minus figure, we will reverse this in the code below.

5. #150=-#150 (Reverse Z Figure);

6. G90 G10 L10 P#100 R#150
This puts the tool length into the correct offset.

7. G28 G91 Z0 (Return Z To Zero Return);
8. G90;
M30;

More Explanation (Macro System Variables)

System variables know shit.

What I mean by this is that system variables contain information about the system. Some are read only and some you can write to, like the tool offsets for instance.

You can ask the system loads of stuff like.

  • What speed do you have stored?
  • What’s the tool in the spindle?
  • What position are you in?
  • What modal G codes do you have.
  • How old is my auntie Joan?
  • Do I have a fat arse?

These are all stored in special Macro System Variables except the last two.

You can read them and sometimes you can write to them. It’s not like that bloke at work who thinks he knows every fuckin thing. Sometimes he’ll listen, but most of the time he has to tell you.

No, no macro system variables follow special rules.

Anyway (The Explanation)

O9001(Tool Measurement Macro)

1.  #100=#4120 (Grab Tool Number);

2. #101=#5023 (Store Machine Z Position);

3. #102=-500.877 (Setting Block Z);

4. #150=#102-#101 (Calculate Tool Length);

5. #150=-#150 (Reverse Z Figure);

6. G90 G10 L10 P#100 R#150

7. G28 G91 Z0 (Return Z To Zero Return);
8. G90;
M99;

The first line 1. looks into system variable #4120 which contains the number of the current tool in the spindle.

You ask what this is and then put it in #100. Obviously you can’t write to this variable.

The next line 2. asks where the machine is in Z (Machine Position) #5023. Again you can’t write to this but you can store it in #101.

Line 3. stores the value that you measured early in #102. This is where your measuring block is from zero return.

In line 4. you take these values away from one another to give you the tool length

Macro System Variables

This ends up as a minus figure so we need to reverse it. We do this on line 5.

5. #150=-#150 (Reverse Z Figure);

6. G90 G10 L10 P#100 R#150

Line 6. is a standard G10 because we have L10 this means it writes to tool lengths. P is the tool number and R is the tool length.

I always stick a G90 at the front of this G10 in case some twat  leaves the machine in G91 in which case it will add to the existing tool length. (Oh dear total fuckin dog shit mayhem)

So You Want To Use Macro Like An Adult?

Lots of programmers use macro in a very complex and confusing way but I think that is the way they want it so you think “wow he must be a clever bastard.

In my opinion a good macro should have a really simple interface.

I’ll show you mine.

M200

Yep that’s all it is

M200 is aliased to my programme O9001 meaning if you run M200 it goes into my programme 9001 and returns.

Don’t forget you can run M200 in MDI too.

Read this article if you don’t know how to alias a macro to an M code or a G code.

More Macro System Variables

Now what we could also do is when we bring the spindle nose down to set the original Z figure, we could make the machine store this in #500 instead of my #102

500 series variables stay in the control even when it’s switched off. These variables are the cockroaches of macro programming (they survive anything).

In the event of a nuclear war the survivors would be as follows:

  • 500 system variables
  • Some cockroaches.
  • Ozzy Osbourne.
  • Keith Richards.
  • My mother in law.

The code for this is really simple. Just one line in fact,

All you need do is bring your spindle down to the setting block. Then run M300, which I have aliased to programme 9002

Or if you like just run programme 9002

O9002 (Calibrate Table Block);
#500=#5023 (Z Machine Position);
M30;

Word Of Caution

Don’t use M99 at the end of your Macro unless you are calling it with an M Code Alias. Otherwise it will be stuck in a never ending loop.

So Now It’s Simple

Bring the spindle down to setting block and run M300.

This sets #500. If the block is in the same place then this is not needed.

Call the tool you want to measure to the spindle in MDI otherwise it won’t be registered in #4120

T20 M06;

Bring the tool down to the block and run M200.

Or simply type M200 into MDI and run it.

This will then store the tool length in the correct offset.

Please contact me if you require:

  • Fanuc training.
  • CNC programmer training.
  • Want to Learn CNC programming.
  • Fanuc programming   training.
  • Any type of CNC course.

Don’t forget to watch my Tutorial Videos

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.

[contact-form-7 id=”2706″ title=”Contact Form”]

 


G98 and G99 It’s About Jumping Things

G98 and G99 It’s About Jumping Things

G98 and G99, a canned cycle is usually one line of code for example to drill a hole. This one line of code tells the machine all it needs to know about drilling my holes.

  •  Depth
  •  Feed-rate
  •  A point in the Z axis to rapid to before drilling
  •  Point to rapid back to after drilling
Sample program of G81 Drilling Cycle G98 and G99
G81 Drilling Cycle Sample Program G98 and G99

What happens then is each time you give the machine a new position it will drill one of these holes.

This is great because you don’t have to worry about what’s going to happen.

Each hole will be identical unless you change one of the parameters in the cycle like the Z depth or the feed-rate.

Therefore if on one hole you put a different Z depth that hole and all subsequent holes will be to the new depth.

Easy As ABC

So all in all it’s a really easy way to drill holes. You tell it what you want and then each time you give a position you get a hole. Then when you get sick of drilling holes you type in G80 and it stops drilling holes.

Machine says “OK this turkey doesn’t want anymore holes” so from now on when the machine moves to a position nothing happens.

Mitsubishi Drill In Action G98 and G99
Mitsubishi Drill In Action

Mitsubishi Carbide

There are loads of Canned Cycles I can’t be bothered to tell you about them all cos I’m going out tonight otherwise I would explain them all. If you scrat around this website for a while you’ll find them all.

Anyway they all do different shit.

They all work in the same way but with some variations.

Now the video at the bottom of the page is about G98 and G99.

G98 and G99 are in all of the drilling and tapping cycles. You have one or the other. You can even miss it out if you can’t be arsed with it.

OK so assuming I want it, what does it do?

You may well ask.

I know for a fact that some of you, and I won’t mention names, put this on the line with the canned cycle but you ain’t got a clue what it does. Maybe you don’t even put it in because you’re frightened of what it might do..

Now’s the time to learn or you will have it on your conscience for the rest of your life.

By the way if you don’t give a flying shit what it does then I wouldn’t waste anymore time reading this.

Here is a lovely video on kittens for you to watch. Off you go.

G98 and G99 How it works.

If you prefer  dogs read on.

  1. First of all the tool will rapid to what we call an initial point which the control remembers ready in case you decide to program G98. (This is the last Z move you made before the cycle is called).
  2. The tool will then rapid down close to the hole (this is called the R point). Don’t make this too far away or you will waste movement.
  3. Tool feeds down in Z to the Z depth at the feed-rate you specified.
  4. Then the tool will rapid back out of the hole. It can either rapid out to initial point (1) or the R point (2) depending on if you programmed G98 or G99.
Parts of the G81 drilling cycle with G98 and G99
How G81 works in action

Now if you program G99 it returns to the R point (2)
If you program G98 it returns to the initial point  (1)

OK why on earth would I want that? Maybe you wish you had chosen to watch the kittens video, but read on.

Well……. if you made that initial point 50mm above the job (about 2 inches) and the rapid point was 1mm above the job (.040 inches).

You could drill all your holes in G99 and the drill would each time return to 1mm (.040 inches) above the part.

If you add a clamp to jump over just put G98 on the hole before and it will jump to 50mm (2 inches) above the part. Oh and it misses the clamp.

Change back to G99 and it stays down returning to 1mm (0.040 inches) above the part.

Admit it, you like it don’t you?

Please don’t try this at home by the way.

Get it? So you eliminate wasted moves. Good init.

 

demonstration of G98 and G99 in action
G98 and G99 in Action

Oh and here is my video it explains how to use G98 and G99 to jump over clamps on a fixture.

The video is shit by the way but I had to learn (it’s been ages ago).

If you are completely crazy and you like 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
  • Siemens Training
  • Hatha Yoga
  • Flower arranging

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.


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.


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Why on Earth would you want to Become a CNC Machinist??

Category : Beginners New Stuff

If someone asked me why I wanted to be an engineer I’d have to be honest and say I don’t know why?

In actual fact it was because I knew I didn’t want to stay at school. They were still a little cross about me putting bromide in the flapjacks and shitting in the glove compartment of the headmasters Reliant Robin.

Anyway my dad was an engineer (Capstan Setter Operator)

Oh and I’d done metalwork at school. So I thought “fuck it” let’s have a go.

I applied for a few jobs in Coventry which was the manufacturing capital of the universe in those days.

I ended up at Rolls Royce. Anyway I’ll cut this short because I hated it with a screaming passion.

Bearing in mind this was in the days when kids obeyed their parents, so I could not leave before I completed my apprenticeship.

A little footnote here, my parents were real nice people but as was the practice in those days, they tended to beat the livin’ shit out of their offspring for the tiniest of misdemeanours.

What I mean is I’m sure that had a bearing on things.

Anyway I’d discovered rock music and I wanted to be a Rock star. What attracted me to this was the fact that they seemed to be shagging all the time and spending loads of cash.

I hadn’t done much of either of these things yet but relished the idea of trying.

My mate happened to mention that I was a good singer cos he heard me singing along to the radio so he gave me a job in his band as lead singer and front-man.

From this point onwards I was hooked. My first band was called RIP and we were shit.

We didn’t know we were crap so we forced our music onto our poor innocent unsuspecting audience’s night after night.

 

 

At one such gig I was spotted by a professional band who offered me a full time singing job for more money than I could spend.

It transpired that it was my band that were shit and that I was a half decent singer.

The old man went fuckin’ bonkers and said I couldn’t leave Rolls Royce.

As I was very close to the end of my apprenticeship and after many arguments he let me leave once my apprenticeship was over.

I managed to stay professional as a singer working in nightclubs all over England for the next five years.

I loved it and made good money but couldn’t help thinking their was more.

Soon, there was more, I got offered a job as a backing singer for a 70’s pop star.

This job turned out to have it’s perks but I soon found myself constantly on tour without a pot to piss in.

I left and went back to the nightclub scene.

Soon potential bullshit fame came knocking again when I was offered a job in an established rock-band. They had already had a few mildly successful records under their belt.

They had toured the world supporting the likes of AC/DC and Black Sabbath to name a few.

Completely sucked in by all this I joined, convinced I’d be living the rock n roll life style as soon as the next album was released.

It’s a long story but I ended up skint and never finished the record.

Fanuc Yellow Manuals Saved My Life

I knew I had to work because by now I had a wife and a son who needed a place to live and food.

My only option was to go back to Engineering. I think at the time I would rather perform my own appendectomy than return to that environment.

I removed my appendix and once I recovered started applying for jobs. Surprise Surprise I got them all.

This was because I had done my apprenticeship at Rolls Royce. I always went on to explain to my future employers that I was basically a fuckin idiot but they were so impressed by the Rolls Royce pedigree they still wanted me.

Two Hundred Quid a Week

They stuck me on a Horizontal milling machine and although I say it myself I was good. Soon I got on Bridgeport BRJ’s and stuff and I was doing well. I was working probably 70 plus hours a week and couldn’t believe how much cash I was making sometimes as much as £200.

Soon I started working as a singer in my spare time but it didn’t help being torn between two cultures.

It resulted in my often not turning up for work after a late night with my band.

Happy Birthday

I was my birthday just after Christmas.

I’m not telling you the date because I will probably be inundated with birthday cards and someone will steel my identity only to find they are worse off than if they had kept their own.

The boss called me into his office “David” he said “the other two directors have advised me so sack you”.

It was like the good news bad news thing.

“Anyway I have decided not to”.

(Sorry I cant keep doing the speech marks thing so I’m going to tell you what he said.)

What he told me was that he wanted to try me on the CNC Machines because he thought I’d be good at it. He did add that it was definitely my last chance. That’s where it all began.

Fanuc Yellow Manuals Saved My Life

I know I’ve used that title twice (I’ll have the S.E.O. police on my back), that’s an in joke if you know about search engine optimisation.

Anyway these manuals really did save me.

The machine they started me on was a Matsuura 710 with a Fanuc Control.

I was hooked. I just loved it so I took the big thick yellow manuals home and studied them.

While I was at work I constantly watched what the machine was doing and compared it to the program. I then checked it all out in the Pidgin English manual and made sense of it.

Picture of a Pidgin

The manuals were really shit in those days. They were really badly written and some times just wrong.

So while the other operators were reading the Daily Mail, scratching their arses and developing right wing, racist views. I was rapidly learning how to set operate and program CNC machines.

Every time my boss got a new machine guess who got to go on it?

Two years on I was running the whole CNC department. I had my own great big yellow Fanuc computer to program on.

I have continued to be fascinated by CNC machines to this day, that’s about forty years.

For the last twenty five years I have had my own business training people on CNC Machines.

I have had the pleasure of being involved in loads of exciting projects from making moulds for Viagra Pills to cutting Weetabix to writing macros to make wedding rings.

I still do loads of music and recording and all sorts of stuff but the mic I prefer to be holding is this one

 

 


Careers in CNC

View all current vacancies in CNC

Click here

Call David: 07834 858 407