We all know that programming can be complicated. So let me explain to you how it all works. This article explains the real meaning of Modal and non modal G codes.
Modal means that once a command is issued it stays in the control.
How Can you Actually Use This?
If you issue a G0 or G00 command the machine is in rapid and you do not need to re-state it.
Rapid means all motors are flat out, like a teenager in a Ferrari.
Every move from then on will be a rapid move unless you tell it otherwise. The G code that changes it must be in the same group. For example G0 G1 G2 and G3 are all in the same group a bit like The Beatles used to be.
The other day I was talking to a “young person” who hadn’t even heard of the Beatles. I mean fuckin hell, am I really really old or are they doomed to be forgotten?
I am always amazed that so many companies still don’t use G10 in their CNC programs. If you know you know.
I must admit I fuckin hate a lot of the things that young people say like “can I get a Latte”. (Get behind this fuckin counter and make it yoursef if you want to “get it”).
Anyway I kind of like “If you know you know”
No G10… Is this you?
I am sure you have your reasons which I will accept. But if your reason is that you don’t understand it then that’s just not good enough.
So you make a part, it’s all setup and you need to break it down.
If you can fix the work holding in such a way that you can reload it in exactly the same place then you need G10.
Let me explain, watch this video to see how single point location works.
G10 No need to spend loads of money.
You could just bolt a sub plate to your machine table so that vices and chucks etc can have dowels to locate them.
But the main idea is that you can relocate your work holding in exactly the same place every time.
Using G10 on a Fanuc Type Control
This is your work offset page on a Fanuc control.
These figures are written in by hand or by automatic setting.
If you had written this line in your program.
G90 G10 L2 P1 X-440.500 Y-265.200 Z-443.00
They would have been written in automatically when you ran the program.
So the work offset page could have any values in G54 but as soon as you run your program this G10 command will replace them with its preset values.
Make Sure Your in Absolute
Try not to forget the G90 (Absolute) because you may accidentally be in G91 (Incremental). What would then happen is it would add these numbers to what is already in the work offset. Oh dear me.
In G90 it will always replace them.
You can write to G54 G55 G56 G57 G58 or G59 just by changing the P number.
It’s not a competition G99 vs G98. sometimes you need G98 sometimes you need G99.
CNC Canned Cycles Using G98 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.
What happens then is each time we give the machine a new position it will drill one of these holes. Each hole will be identical unless we change one of the parameters. So if on one hole we put a different Z depth that hole and all subsequent holes will be to the new depth.
CNC Canned Cycles Using G98 G99
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.
Machine says OK he don’t want anymore holes so from now on when the machine moves to a position nothing happens.
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. Anyway they all do different stuff like.
G84 Tapping
G73 High speed Peck Drilling
G83 Deep hole Drilling
G81 Drilling
They all work in the same way as each other but with variations.
Now the video at the bottom of the page is about CNC Canned Cycles Using G98 G99 and that’s in all the drilling and tapping type cycles.
Ok what does it do? You may well ask, G99 vs G98
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. Maybe you don’t care.
Anyway it’s simple.
You rapid to an initial point
You rapid down close to the hole (this is the R point)
You feed down to depth (Z Depth)
Then you rapid out to either the initial point (1) or the R point (2)
Now if you program G99 it returns to the R point .
If you program G98 it returns to the initial point (that means the first one)
Ok why on earth would I want that?
Well……. if you made the first point say 50mm above the job (About 2 inches) and the rapid point was 1mm above the job (.040”).
You could drill all your holes in G99 and the drill would each time return to 1mm (.040″) above the part. You get to a clamp and you put G98 and it jumps to 50mm (2”) above the part and misses the clamp. Change back to G99 and it stays down returning to 1mm (0.040) above the part.
CNC Programming Running Order, the order of your CNC code within one block does not matter (see below)
Or does it?
O0001(G81 DEMO) G21 G90 G40 (G90 G40 G21) Works the same T01 M06 (20.0 MM DIA X 90 POINT SPOT DRILL) (M06 T01)Works the same G90 G0 G54 X12.64 Y88.0 S2546 M3 (S2546 M3 G90 G0 G54 X12.64 Y88.0)Works the same
However it is best to keep the order the same. Create your own convention and stick to it.
G90 G0 G54 X12.64 Y88.0 S2546 M3
So if you always put the speed and M3 (spindle start clockwise) at the end of the first position line try to always stick to that.
It Could Save You
If one day you miss out the speed for example. You will look at the code and it will look strange. You will immediately realise what is wrong.
It’s like the time my cooker got pinched, I looked in the kitchen and their was an old pince of cheese and a dirty floor where it used to be. Whilst I was thinking of a recipe to use the old cheese in I thought “something is wrong”.
Anyway
You will get used to the order of your programs and they will be easier to read, so the CNC Programming Running Order is important.
This helps not only you but your customer, the machine operator or setter.
Imagine you have not seen this program for a while. How long will it take you to realise how it works and what it does?