What's new
What's new

CNC Lathe: G76 threading for internal 1/4 NPT

crow71

Plastic
Joined
Aug 24, 2021
I'm having trouble trying to get this code to work out properly. The machine in question is a Mori Seiki NL2500 lathe and the material is 316 stainless. The threads i need to cut are 1/4-18 NPT and start 0.1" into the part and needs to go .55 in. its drilled to .4219 and bored with the appropriate taper.
I'm not totally savvy with G76 since we've never had to use it, but for the life of me, I cant get it to behave like an internal threading op. :angry:
I can get the taper down, but it always retracts to the X value I started with before the G76 and if I go lower than x.502, it alarms out with a "P204 VALUE ERR(MRC) 0 0"


N5(THREADER)
G97 S550 M3 T0505
G0 X.502 Z.2 M8
Z.05
G76 P030060
G76 X.42 Z-.59 R.02 P-.041 Q.010 F.0556
G0 Z.2
Z.05
X6. Z6. M9
M1
 
I am not familiar with your control, but I think 0.502 should be smaller than 0.42
Also, may try positive P value.
 
Like Sinha said, the start X should be less than .42.
Even if the control isn't pooping at it, it WILL break the tool on retract ( will go to X.502 at every return )
Also, why is the P negative? It should be P410

Which also brings up another point.
I don't know what control you have on the NL, but if it is Fanuc then the R, P and Q values should be without decimals.

Try this:

N5(THREADER)
G97 S550 M3 T0505
G0 X.4 Z.2 M8
Z.05
G76 P030060 Q100 R0
G76 X.42 Z-.59 R200 P410 Q.100 F.0556
G0 Z.2
Z.05
X6. Z6. M9
M1
 
The P value is thread height, and as such it is positive.
R is the taper amount, which is is the signed, radial distance, measured from the ENDING X coordinate to the STARTING X coordinate.
So, for OD threads the ENDING X is larger than the STARTING X, therefore the R is negative.
For ID threads the ENDING X is smaller than the STARTING X, therefor the R is positive.

My machine also has the same Mits control, but honestly never did try the decimals in any of the canned cycles just to keep it compatible-looking with the Fanuc.
 
I put the P value as negative because that's what got it to taper in the right direction, but ill give that one a try. As far as the decimals go, I'm just going off of what's in the programming manual. Also, the controller is Mitsubishi, model MSX-850II

the example in the manual it gives is this

STANDARD FORMAT:
G76 P(1) R(1)
G76 X(U) Z(W) R(2) P(2) Q(2) F

F15 FORMAT:
G76 X(U) Z(W) I K D F A P Q

P= 02 (FINISH CUTS) 12 (THREAD CHAMFER) 60 (THREAD ANGLE)
R= FINISHING ALLOWANCE
X, Z = THREAD CUTTING END POINT
U, W = INCREMENTAL FROM START POINT
R(2), I = DISTANCE OF TAPER IN X AXIS DIRECTION (SIGNED VALUE, IN RADIUS)
P(2), K = THREAD HEIGHT (IN RADIUS, UNSIGNED VALUE)
Q(2), D = DOC FOR FOR FIRST THREAD CUTTING PATH (IN RADIUS, UNSIGNED VALUE)
F = THREAD LEAD
A = ANGLE OF THREAD
P = SPECIFIES INFEED MODE (F15 FORMAT ONLY)
(P1 = STRAIGHT FEED ALONG THREAD FACE AT FIXED REMOVAL RATE)
(P2 = ZIGZAG INFEED AT MIXED REMOVAL RATE(OPTION))
Q = SPECIFIES THE SHIFT ANGLE OF THREAD CUTTING START ANGLES (F15 FORMAT ONLY)

EXAMPLE (EXTERNAL, IN METRIC)

O1
N1
G00 T0101
G97 S640 M03
X70.0 Z20.0 M08
G01 Z5.0 F1.0 M24 (CHAMFERING OFF)
G76 P010060
G76 X57.4 Z-24.0 P1.3 Q0.35 F2.0
G00 X200.0 Z150.0 M09
M30
 
I tried it out and I'm still getting the same error when it goes to run the G76. I tried decimal and non decimal, flipping the P and R from positive to negative every which way and still the same
 
Did you try to run my version of your code?
Looked up your error code, found on Page 310 of the programming manual.

Kinda non-descriptive....
What happens if you write the G76 line like this:

N5(THREADER)
G97 S550 M3 T0505
G0 X.4 Z.2 M8
Z.05
G76 D.01 X.42 Z-.59 I.02 K.041 F.0556
G0 Z.2
Z.05
X6. Z6. M9
M1
 
yup, ran it exactly as posted. book 310 of my manual is synchronized tapping cycles.

i ran that new one and i got a "P32 ADDRESS. ERROR 0 0"
 
yup, ran it exactly as posted. book 310 of my manual is synchronized tapping cycles.

i ran that new one and i got a "P32 ADDRESS. ERROR 0 0"

Maybe because it needs a parameter change to use the single block format.


From my manual, Error P204 is:


(Note 4) Program error (P204) results in the following cases.
(a) When "a" is outside the rating
(b) When both the X and Z commands have not been issued or when the start and end
point coordinates are the same for either the X or Z command.
(c) When the thread is greater than the movement of the X axis at the thread bottom


You sure that the first G76 line has P Q and R populated?
 
Based off of what I'm seeing, my controller doesnt use a Q value in the first line, but I gave it a spin anyway and got the same result. It only seems to run when the retract position is x.502 or higher if I set it below that, it wont run at all. tried both the standard and F15 format
 
Based off of what I'm seeing, my controller doesnt use a Q value in the first line, but I gave it a spin anyway and got the same result. It only seems to run when the retract position is x.502 or higher if I set it below that, it wont run at all. tried both the standard and F15 format

The control uses the X Start Coordinate related to the the X value specified in the G76 to determine if the Thread is OD or ID. Does the control behave normally if the R address in the second G76 Block (the Taper Amount) is omitted and therefore, set to cut a parallel thread, with an X Start Point of X0.4 and the following second line G76 Block:

G76 X.42 Z-.59 R.02 P-.041 Q.010 F.0556

Regards,

Bill
 
I omitted the taper in both versions, the standard program throws up a P204 error and the F15 program throws up a P32 error

N5(THREADER)
G97 S550 M3 T0505
G0 X.4 Z.2 M8
Z.05
G76 P030060
G76 X.42 Z-.59 P.041 Q.01 F.0556
G0 Z.2
Z.05
X6. Z6. M9
M1

------------------------

N5(THREADER)
(F15 VERSION)
G97 S550 M3 T0505
G0 X.4 Z.2 M8
Z.05
G76 X.42 Z-.59 K-.041 D.01 F.0556 A60.
G0 Z.2
Z.05
X6. Z6. M9
M1
 
Based off of what I'm seeing, my controller doesnt use a Q value in the first line, but I gave it a spin anyway and got the same result. It only seems to run when the retract position is x.502 or higher if I set it below that, it wont run at all. tried both the standard and F15 format


Yes it does.
Q is the min DOC, R is the Finish allowance.

Not sure why your book doesn't mention it.

Search for "2-part System Synchronous Thread Cutting Cycle " in your PDF manual.

It also talks about parameters that can be omitted, those that cannot and where the defaults come from.
( But again, it's in Jinglish so .... )

With all that said, I don't see why your machine is throwing an error....
Just for shits and giggles, see what happens when you start the threading cycle at X0 Z.05
 
It only seems to run when the retract position is x.502 or higher if I set it below that, it wont run at all. tried both the standard and F15 format
Hello crow71,
That's because X0.4 is still to large a starting coordinate for the Control to determine that you're cutting an Internal Thread. In the case of an Internal Thread, you specify the Major Diameter of the Thread with the address "X" in the second G76 Block. The control calculates the Minor Diameter using the Thread Height specified by the "P" address in the second G76 Block. Accordingly, the Minor Diameter calculated by the control will be as follows:

Min Dia = 0.42 (X) - 0.041 x 2 (twice the Thread Height "P")
Min Dia = 0.338

Therefore, the X Start Position of the Threading Tool must be smaller than 0.338". The Control also uses these numbers to determine if the Thread is Male or Female. Because you have an X Start coordinate larger than the calculated Minor Diameter, you're confusing the control with both Male and Female Thread data.

The X Start Position of X0.4 is in nowhere land; neither large enough to be an External Thread, nor small enough to be an Internal Thread. The Cycle runs in a fashion when you specify an X Start Coordinate X0.502 or greater, because the control thinks the Thread is an External Thread when X0.502 or greater is specified. Where does the X0.502 value come from? It's derived from the following:

Major Diameter = 0.42 (specified X value) + 0.041 x 2 (twice the Thread Height)
Major Diameter = 0.502

Whilst ever the Start Coordinate is less that the Control calculated value for the Major Diameter of an External Thread (0.502) and greater than Control calculated value for the Minor Diameter of an Internal Thread (0.338) the Control will raise an alarm, for the Thread can't be determined to be either Internal or External. Once the X Start Position is specified as X0.502 or greater, the Control is happy to assume that you have specified an External Thread.

Specify an X Start Diameter as shown in the following example and the Cycle should run.

N5(THREADER)
G97 S550 M3 T0505
G0 X0.300 Z0.2 M8
Z0.05
G76 P030060
G76 X0.42 Z-0.59 R0.02 P0.041 Q0.010 F.0556
G0 Z0.2
X6.0 Z6.0 M9
M1

Regards,

Bill
 
Last edited:
that did the trick! funny the book doesn't mention anything about that. thanks!
Hello crow71,
With respect, its common sense that you would start the Threading Cycle from an X Coordinate outside the envelope that contained the material to be cut during Threading Operation. The smallest X Coordinate used in machining the Internal Taper Profile in preparing the part for Screw Cutting would be the clue.

When cutting a Thread with a manual lathe, you wouldn't retract the tool only to a diameter larger than the Minor Diameter of an Internal Thread, or smaller than the Major Diameter of an External Thread and not expect the Threading Tool to wreck the Thread when moving the tool back to the Z Start Position. The CNC Control by raising an alarm is preventing that from happening.

With a G76 Threading Cycle, the only limit to how far in X the tool can start for an External Thread is the Over-travel limit of the machine. With an Internal Thread, its at a diameter that interferes with the back of the Internal Threading Tool. The control calculates the Minor and Major Diameter respectively for an Internal or External Thread and applies the First pass and all successive threading passes from those calculated diameters.

Regards,

Bill
 
OK, so when cutting internal tapered threads, it should look "something" like this:

N10(THREAD)
G0G40G54G99T0707
G97S250M3
X.375Z.25M8
G76P020060
G76X.5025Z-.59R.0312P0383Q0080F.0555
G0Z2.M9
G28U0
M5
G28W0
M30
%
 
Ok, now the program runs fine, but the tool barely cuts anything. I double checked the tool offset and the thread dimensions and made an adjustment to the taper, but all it cuts at most is maybe a .005" scratch of a thread. I have to adjust the threader offset +.06" in X to get it to where its supposed to be. its doable since i have just over .08" of clearance to work with, but now its got me scratching my head again. I was aiming to taper the thread all the way to the drill diameter, but do I need to extend the z depth to do that? Or just bump up the thread endpoint by .06 in x?

Sorry if these questions seem stupid, but I've only ever worked with G92 threading cycles and we've always tapped NPT threads in the past, but we're trying to cut down on process steps and try and get as much done in one go as possible, but this is a bit of a learning curve for me


N5(THREADER)
G97S500M3T0505
G0X.335Z.2M8
Z.05
G76P020060Q010R.001
G76X.42Z-.55R.0375P410Q120F.0556
G0Z.2
Z.05
X6.Z6.M9
M1
 








 
Back
Top