What's new
What's new

Looking for Programming insight - Fanuc 0T lathe

bengineer08

Plastic
Joined
Jun 17, 2022
Location
Northern KY / Cincinnati area
Hi, I'm trying to teach myself how to program my early 90's Miyano lathe (Fanuc 0T). I'm hoping someone might have some insight into what's going on. More than likely it's a syntax error or something. Or maybe the control is older than the examples I've dug up and repurposed, and it doesn't like the order of things or something? I've got a couple quirks I can't figure out.
First, when I start the program, it'll go through the first few lines and get to the tool change line, change tool and just hang up there (no error or anything). Cycle Start won't start it going, but still no error. I can hit reset, but then it skips the line immediately following the tool change. If I hit reset, then switch to edit and back up to the line that was skipped, I can hit cycle start and it seems to run ok.
Second, I was trying to turn a fillet at the back using Z-25.0, R1.0; and it didn't seem to like that at all. If I take the ", R1.0" out it'll work just fine (but, of course, no radius). I understand there are other ways to do the fillet, but would this control be too old to do a simple "Z-25.0, R1.0;"?

N1 (ROUGH TURN);
G40;
T0101 M06; (<this is where it hangs up)
G50 S2500; (<this is the line it skips)
G96 S250 M03;
G00 X28.0 Z5.0;
G01 Z0.1 F0.1;
X-0.2 F0.05;
G00 X 28.0 Z2.0;
G71 U1.0 R1.0;
G71 P100 Q200 U0.2 W0.05 F0.2;
N100 G00 X19.0;
G01 G42 Z0.0 F0.2;
X20.0 Z-0.5;
Z-25.0, R1.0; (<-this is where if I remove the ',R1.0' it runs fine)
X26.0;
N200 G40 X28.0 Z5.0 F10.0;
M05;
G97;
M30;

Any help to tips would be greatly appreciated. Thanks.
 
You don't use M06 on a lathe. Take it out, and it should read the line fine.
 
  • Like
Reactions: aj
I've only seen the ,R syntax used on Hardinge lathes. Try taking out the comma, and run the line

Z-25.0 R1.0

If it still doesn't work as desired, then you may need to do as 706jim suggests and use G02.
 
Hi, I'm trying to teach myself how to program my early 90's Miyano lathe (Fanuc 0T). I'm hoping someone might have some insight into what's going on. More than likely it's a syntax error or something. Or maybe the control is older than the examples I've dug up and repurposed, and it doesn't like the order of things or something? I've got a couple quirks I can't figure out.
First, when I start the program, it'll go through the first few lines and get to the tool change line, change tool and just hang up there (no error or anything). Cycle Start won't start it going, but still no error. I can hit reset, but then it skips the line immediately following the tool change. If I hit reset, then switch to edit and back up to the line that was skipped, I can hit cycle start and it seems to run ok.
Second, I was trying to turn a fillet at the back using Z-25.0, R1.0; and it didn't seem to like that at all. If I take the ", R1.0" out it'll work just fine (but, of course, no radius). I understand there are other ways to do the fillet, but would this control be too old to do a simple "Z-25.0, R1.0;"?

N1 (ROUGH TURN);
G40;
T0101 M06; (<this is where it hangs up)
G50 S2500; (<this is the line it skips)
G96 S250 M03;
G00 X28.0 Z5.0;
G01 Z0.1 F0.1;
X-0.2 F0.05;
G00 X 28.0 Z2.0;
G71 U1.0 R1.0;
G71 P100 Q200 U0.2 W0.05 F0.2;
N100 G00 X19.0;
G01 G42 Z0.0 F0.2;
X20.0 Z-0.5;
Z-25.0, R1.0; (<-this is where if I remove the ',R1.0' it runs fine)
X26.0;
N200 G40 X28.0 Z5.0 F10.0;
M05;
G97;
M30;

Any help to tips would be greatly appreciated. Thanks.
OK.
Most turning centers don't use an "M06" for tool change, they use a four to six digit T code.
Such as "T0101" - the first two digits are the turret station number, the second two are the offset number.
The G50 S line should always be first., right after the "O" number.
I rarely use G41/G42 cutter comp in a cycle, I prefer to use it on the finish tool only. When cancelling I usually use a G40 with a single axis pull off perpendicular to the part surface.
Your feedrate - IPR or IPM?

I have some great two axis manuals I wrote when I worked for Doosan. I'd be happen to send them to you. PM me.
 
OK.
Most turning centers don't use an "M06" for tool change, they use a four to six digit T code.
Such as "T0101" - the first two digits are the turret station number, the second two are the offset number.
The G50 S line should always be first., right after the "O" number.
I rarely use G41/G42 cutter comp in a cycle, I prefer to use it on the finish tool only. When cancelling I usually use a G40 with a single axis pull off perpendicular to the part surface.
Your feedrate - IPR or IPM?

I have some great two axis manuals I wrote when I worked for Doosan. I'd be happen to send them to you. PM me.
Why? I've used the following format for 37.5 years.

N100M91 (ROUGH TURN)
T0101S2421M13
X1.42Z.005
G50S4000
G96S900

Above is an example for a Hardinge. M91 is their Safe Index subprogram (O1 in their programming manual). G97 is in the subprogram. I use this same format on a few other makes of lathes.

Mori-Seiki SL-35 example.

N100G0G53X-8.Z-16.M42 (ROUGH TURN)
T0101G97S2421M3
X1.42Z.005M8
G50S2500
G96S900

Last programmer we had used your method. I've never had a problem with mine or his method.

I've seen this method used as well.

N100G28U0W0 (ROUGH TURN)
G50S3000
T0101G96S900M3 (or with a G97S2421 here and the G96S900 after the first movement)
X1.42Z.005M8

They all work fine.

Actually the G50 block is not in the G-code program on an EMAG. It is in the accompanying Macro program that sets a bunch of values including G50.

N100 (ROUGH TURN)
T0101X1.42G96S900M3
Z.005M8

Of course on the EMAGs the G-code and accompanying Macro program are run from their master program.

Guess you could say there is more than one way to skin a cat. :)
 
Guess you could say there is more than one way to skin a cat. :)
Yes, there is. That's why I didn't say it was the "only" way to code. :D

I put my G50 speed clamp right at the top so there is no chance of inadvertently commanding a speed higher than what I think is safe.
But, that's just me..
:o
 
Yes, there is. That's why I didn't say it was the "only" way to code. :D

I put my G50 speed clamp right at the top so there is no chance of inadvertently commanding a speed higher than what I think is safe.
But, that's just me..
:o
Try this

G50S1000
G97S1500M3

and get back to me.
 
You "should" know, but obviously don't, that in Fanuc-land, G50 is only for G96 conditions on the vast majority of their controls.
G50 limiting the G97 condition is - to my knowledge - only on Okuma OSP.
You might be correct, though I have not tested it. This is what the Fanuc manual says ...

1672935035589.png
Your comment in post#9 is not very clear on this.
 
Last edited:
You might be correct, though I have not tested it. This is what the Fanuc manual says ...

View attachment 383254
Your comment in post#9 is not very clear on this.
I tested on a Fanuc 10T, 11T, 0iT-D, 0iT-F, and 0T-C.
However there may be exceptions to this, that I am not aware of.

On the OSP, G50 clamps all S commands whether G96 or G97, on OSP3000, OSP5000, OSP5020, and 7000, U10, and presumably, the majority if not all of the others.

On post #9, I was referring to G96 operation, however I should have used more specific terminology.
 
You "should" know, but obviously don't, that in Fanuc-land, G50 is only for G96 conditions on the vast majority of their controls.
G50 limiting the G97 condition is - to my knowledge - only on Okuma OSP.
You shouldn't ass-u-me. I've known the difference between G96/G97 from day one (over 37.5 years ago).

You said, "I put my G50 speed clamp right at the top so there is no chance of inadvertently commanding a speed higher than what I think is safe."

I was simply pointing out that putting a G50 in the first block of every operation is no guarantee that you can't 'inadvertently' program a speed higher than what you think is safe. A G97 overrides a G50 in every lathe I've ever programmed....which admittedly is only around 12 brands of lathes. I don't know about you, but I've made many typing errors over the years.

You should also know that in Fanuc-land a G50 isn't used only with a G96 although it is by far the most used option.
 
Last edited:
You shouldn't ass-u-me. I've known the difference between G96/G97 from day one (over 37.5 years ago).

You said, "I put my G50 speed clamp right at the top so there is no chance of inadvertently commanding a speed higher than what I think is safe."

I was simply pointing out that putting a G50 in the first block of every operation is no guarantee that you can't 'inadvertently' program a speed higher than what you think is safe. A G97 overrides a G50 in every lathe I've ever programmed....which admittedly is only around 12 brands of lathes. I don't know about you, but I've made many typing errors over the years.

You should also know that in Fanuc-land a G50 isn't used only with a G96 although it is by far the most used option.
Well, with 50 years of working with CNC I have a lasting impression on what can happen.
G50 can be used to set workpiece datum as well as max speed clamp. Something that I used to have to do on Fanuc 5 and Fanuc 6 before learning a better technique.
On Fanuc 10 and later, the work coordinate system is usually present (VERY rare on System 6), making life easier.
As I've said, G50 doesn't affect G97 conditions, at least on the machines I've ever touched, save for aforementioned (three times now) Okuma OSP.

What I meant to express was that seeing as I am mostly in G96 mode, I cannot accidentally spool up a spindle to point where bad things happen. G97, I don't have that issue as I will not input a speed anywhere near where bad things can happen.
 
Well, with 50 years of working with CNC I have a lasting impression on what can happen.
G50 can be used to set workpiece datum as well as max speed clamp.
When I started working in a machine shop in '85, three of the lathes there were dang near as old as I was. They used G50 for tooling. Each type tool had its own X & Z value using G50. I didn't know how bad that was until we started getting new Hardinge lathes with 0T controls, and I could set (and change) the workshift with a G10. Little later we got a Daewoo Puma 8, but had to use G50 on it if a second workshift was needed for a job because it did not have the G10 option (and no G54-G59). What a pain! :angry:
 








 
Back
Top