Fanuc OT code problem

alloy

Dan, Retired old fart
H-M Supporter Gold Member
Joined
Jul 5, 2014
Messages
2,852
I've finally got my CNC lathe up and running. Had to have the Z axis ball screw rebuilt and have a problem with the turret repaired.

It's been 20 years since I've ran CNC lathe and wrote a program by hand for it. Did the usual put O's where zeros should be, and a few other things I caught and corrected

But I'm having problems with rapid moves using G00.

In the program below on lies 8 and 9, and 19 and 20 I tried using a G00 and immediately got servo errors. But if I replace the G00 with G01 and give it a high feed rate it works.

There are other programs in the machine from the PO and G00 works fine.

I'm sure it's my error this is happening, and I've fought it for 2 days now. Time to see if anyone here sees a problem with my program.

%
N2 O1201(T5-T56SLEEVE)
N3 G28U0W0
N4 T0101M6(TURN-FACETOOL)
N5 M8
N6 G50S2500
N7 G96S2000M3
N8 G01X1.4Z0F.030
N9 G01X-.03F.005
N10 X1.135
N11 M9
N12 G28U0W0
N13 M00(FIIPPART)
N14 T0101M6(TURN-FACETOOL)
N15 S100M3
N16 M8
N17 G50S2500
N18 G96S2000M3
N19 G01Z-.015X1.4F.030
N20 G01X-.03F.005
N21 X1.135
N22 M9
N23 G28U0W0
N24 M01
N25 T0303(SPOTDRILL)
N26 G00X0Z.1S2000M3
N27 G01Z-.15F.002.M8
N28 G00Z.5
N29 M9
N30 G28U0W0
N31 M01
N32 T0505M6(.755DRILL)
N33 G00X0Z.2S1200M3
N34 M8
N35 G83Z-1.7Q.15F.002
N36 G00Z1.
N37 M9
N38 G28U0W0
N39 M01
N40 T0808(13/16ENDMILL)
N41 S1000M3
N42 G00X0Z.2M8
N43 G01Z-1.4F.002
N44 Z-1.5F1.
N45 Z1.4
N46 Z-1.6
N47 Z-1.5
N48 Z-1.7
N49 Z-1.6
N50 Z-1.8
N51 G0Z1.
N52 M9
N53 G28U0W0
N54 M01
N55 T0707(5/8BORINGBAR)
N56 M3S2000
N57 G00Z1.X.870
N58 G01Z-1.8F.002
N59 X.84
N60 G00Z.2
N61 G01X.875F.002
N62 G-1.8
N63 X.8
N64 G00Z1.
N65 M9
N66 G28U0W0
N67 M30
%
 
Last edited:
Line 8 and 9 look OK
N8 G01X1.4Z0F.030 (N8 G00X1.4Z0 should work)
N9 G01X-.03F.005

but this could be a problem on line 19
N19 G01Z-.015 X1.4 Z0F.030
N20 G01X-.03F.005

I'm no expert in Fanuc programming.
 
I pulled that out of N19 earlier on the machine. I didn't update the file I uploaded here with the change.

I tried the G00 on #8. I immediately got 3 servo errors as soon as the turret starts to move into position. And naturally those errors require shutting the machine down and restarting it.

To me it doesn't make any sense. It's just a rapid positioning move.
 
Last edited:
Post a known good program, maybe I can see a difference.
 
I'll just chime in. Do not see a program problem. To investigate I'd first try just moving one axis G00 Z0 THEN G00 X1.4

do you have a rapid % dial on your control? Try putting it down to 50%
 
if it is not a GCODE problem then could it be that your Motion Controller has the Rapid speeds set to high for the servos, or the acceleration is too high? Just putting out some guesses as I am not familiar with Servos or Fanuc. Is there a Manual input mode where you could just issue a G00 command and see if you get the error outside of a program?
 
Here is a good program that runs. Was already in the control.

Just have to figure out why my program won't run when others will.

I'm sure it's something I'm doing wrong.

I see a difference on N3 where the G00 is on a different line than the X and Z positioning move are. But in line #11 the G00 and Z move are combined in one line.

Something else I noticed is the spindle is turning backwards. M03 turns it on in reverse, M04 turn on forward.

I tried this in my program and one of the ones that's on the machine. And the manual buttons are also reversed.

So ok, thought about phase rotation. Swapped two wires on the incoming power and gave it a shot. Same problem but with the wires swapped the hydraulic pump won't come on.

It's not a huge deal, just have to get used to using a M04. But it would be nice to have it turn the correct direction.

%
:0005(WRENCH 1ST OP)
(55 DEG. W/.032R)
N1 T0101
N2 G50S1200
N3 G00G96S320M03
N4 X1.92Z.2M08
N5 G01Z-4.2F.006
N6 X2.1
N7 G00Z.1
N8 G01X1.88F.01
N9 Z-4.2F.004
N10 X2.F.01
N11 G00Z1.M09
N12 G28U0W0
N13 M1
N14 M00
(1.062 SPADE DRILL)
N15 T0202
N16 G00G97S180M03
N17 X0.Z.2M08
N18 G83X0.Z-4.38F.006Q3000
N19 G00Z1.M09
N20 G28U0W0
N21 M1
N22 M00
(BORE)
N23 T0808
N24 G00G97S700M03
N25 X1.1Z.1M08
N26 G01Z-4.05F.004
N27 X1.
N28 G00Z.1
N29 X1.15
N30 G01Z-4.05F.004
N31 X1.1
N32 G00Z.1
N33 X1.2
N34 G01Z-4.05F.004
N35 X1.15
N36 G00Z.1
N37 X1.25
N38 G01Z-4.05F.004
N39 X1.2
N40 G00Z.1
N41 X1.3
N42 G01Z-4.05F.004
N43 X1.25
N44 G00Z.1
N45 X1.35
N46 G01Z-4.05F.004
N47 X1.3
N48 G00Z.1
N49 X1.375
N50 G01Z-4.05F.004
N51 X1.35
N52 G00Z.1
N53 G01X1.43Z0.F.004
N54 G02X1.39Z-.02R.02F.001
N55 G01Z-4.05F.003
N56 X1.35
N57 G00Z1.M09
N58 G28U0W0
N59 T0101
N60 M30
%
 
If you were standing at the tailstock looking at the spindle, which way does the spindle turn with a M3, CW or CCW?
 
If you were standing at the tailstock looking at the spindle, which way does the spindle turn with a M3, CW or CCW?


CW

Moving the GOO away from the X/Y line worked.

You would think it wouldn't matter, but it does.

One problem solved.
 
CW? Yup, I would say that's backwards. Odd. Maybe there is a setting somewhere you can change. On the other hand according to my friend Google, M3 = CW and M4 = CCW so maybe I've been doing it wrong all this time. Haas M3 = Spindle on Forward, M4 = Spindle on Reverse, CW or CCW is not specified. Fanuc specifies M3 = Forward CW, M4 = Reverse CCW.

On a mill M3 forward would be CW looking down from the top so I guess a lathe spindle direction is the same, I guess my lathe is the backwards one. Thinking about it makes my head hurt.

The only thing I can see in the known good G code is that under no condition is both Xn.nn and Zn.nn on the same line as the G00, very strange. Not sure what difference that would make, unless it's causing a voltage drop when running both servos at full power at the same time.

But I'm not sure that even makes sense because:
N24 G00 G97 S700 M03
N25 X1.1 Z.1 M08 (Both X and Z on the same line, but not on the same line as the G00)
 
Back
Top