What's new
What's new

Program will only run correctly the first time

dn889312

Plastic
Joined
May 18, 2018
Hello,

I'm working on a program for Doosan lathes, with different series Fanuc controllers. This is a macro program. The program will run fine one the Doosan 480 lathes, i series controllers, but not on the Doosan 700 lathes, with 32i controllers. The issue arises before it even starts cutting. The first thing that the machine does is use the Renishaw probe the part for length and diameter values. I have not edited the probing part of the program. These values are then used in calculations to determine the depths of cuts and all that. The first time that I run the program on the Doosan 700, it does just fine. The macro variables are calculated correctly and there are no issues. The second time that the program runs it does not return the correct length of the part. It is consistently several inches short. If I reprobe, it gives the same incorrect Z value. The X values are correct though. If I run the probe re-calibration programs it will then get the program to work correctly, one time.

All I did in my program revision is change how it calculates depths of cuts. I don't see how I'm screwing up the Z value.
I am trying to attach the code here, hopefully it will work. The original and new should be included. This is just the intros to the programs, the rest seems irrelevant as it is screwing up in this section.

Please ask any questions you have if this doesn't make sense. Any advice is appreciated.

Original:
Code:
%
O7001(MULT FINISH  700)
 
(T0101 Left - CMRGNL-204)
(T0202 Right- CMRGNR-204)
(T0303 Left - CMRGNL-204)
(T0404 Nuetral - GMSDNN-204D)
(T0505 Left - CMRGNL-204)
(T0606 Right - CMRGNR-204) 
(T0707 Left - CMRGNL-204)
(T1010 RENISHAW PROBE) 
 
 
(USE MACR0 #500 F0R Z SETTING) 
(#500 = Exact Mult Length - Operator Input)
(#501 = Finish Diameter - Operator Input)
(#504 = Edge Prep - Operator Input)
(1.0 = Break Edge) 
(2.0 = Core Mult Radius) 
(3.0 = .437 Radius)
(4.0 = .625 Radius)
(Z 0 at Face Driver Pad) 
 
(#507 = Operator Input - PART CLEARANCE IN Z)
(#508 = Operator Input - PART CLEARANCE IN X DIA)
 
(#509 = Set in Program - PART LENGTH MEASURED) 
(#510 = Set in Program - PART TAILSTOCK END DIAMETER MEASURED) 
(#511 = Set in Program - PART HEADSTOCK END DIAMETER MEASURED) 
(#512 = Set in Program - USED IN CALCULATION)
(#513 = Set in Program - USED IN CALCULATION)
(#514 = Set in Program - USED IN CALCULATION)
 
(#520 = Set in Program - USED IN CALCULATION)
(#521 = Set in Program - ROUGH DIAMETER 1) 
(#522 = Set in Program - ROUGH DIAMETER 2) 
(#523 = Set in Program - ROUGH DIAMETER 3) 
(#524 = Set in Program - ROUGH DIAMETER 4) 
(#525 = Set in Program - PRE FINSIHED DIAMETER)
(#526 = Set in Program - FINSIH DIAMETER)
 
G65P9800(PROBE HEALTH CHECK) 
 
 
G0X25.0
Z[#500+1.0]
 
T1010
G65P9832(FLASH ON) 
G65P9610F100.Z[#500-1.0] 
 
G65P9611X4.0 
#510=#135+#508 
G65P9610F100.Z1.0
G65P9611X4.0 
#511=#135+#508 
G0X20.0
Z[#500+1.0]
G65P9610F100.X[#510-1.0] 
G65P9611Z3.25
#509=#137+#507 
G65P9833(FLASH OFF)
G99
G0X20.0
Z[#500+1.0]
#512=[#511-#508-#501]
#520=[#510-#511] 
#513=[#512-.062] 
#514=[#513/3]
#521=[#511-#508-#514]
#522=[#511-#508-[#514*2]]
#523=[#511-#508-[#514*3]]
#524=[#523-.05]
#525=[#524-.002] 
#526=[#525-.01]

New:
Code:
%
O7001B(MULT FINISH  700)
 
(T0101 Left - CMRGNL-204)
(T0202 Right- CMRGNR-204)
(T0303 Left - CMRGNL-204)
(T0404 Nuetral - GMSDNN-204D)
(T0505 Left - CMRGNL-204)
(T0606 Right - CMRGNR-204) 
(T0707 Left - CMRGNL-204)
(T1010 RENISHAW PROBE) 
(T1212 CMRGNR-204) 
 
(USE MACR0 #500 F0R Z SETTING) 
(#500 = Exact Mult Length - Operator Input)
(#501 = Finish Diameter - Operator Input)
(#504 = Edge Prep - Operator Input)
(1.0 = Break Edge) 
(2.0 = Core Mult Radius) 
(3.0 = .437 Radius)
(4.0 = .625 Radius)
(Z 0 at Face Driver Pad) 
 
(#507 = Operator Input - PART CLEARANCE IN Z)
(#508 = Operator Input - PART CLEARANCE IN X DIA)
 
(#509 = Set in Program - PART LENGTH MEASURED) 
(#510 = Set in Program - PART TAILSTOCK END DIAMETER MEASURED) 
(#511 = Set in Program - PART HEADSTOCK END DIAMETER MEASURED) 
(#512 = Set in Program - USED IN CALCULATION)
(#513 = Set in Program - USED IN CALCULATION)
(#514 = Set in Program - USED IN CALCULATION)
(#527 = Set in Program - USED IN CALCULATION) 
 
(#520 = USED IN CALCULATION) 
(#521 = ROUGH DIAMETER 1, SET IN PROGRAM)
(#522 = ROUGH DIAMETER 2, SET IN PROGRAM)
(#523 = ROUGH DIAMETER 3, SET IN PROGRAM)
(#524 = ROUGH DIAMETER 4, SET IN PROGRAM)
(#525 = ROUGH DIAMETER 5, SET IN PROGRAM)
(#526 = PRE FINSIHED DIAMETER, SET IN PROGRAM) 
(#527 = FINISH DIAMETER, SET IN PROGRAM) 
(#528 = STEEL CLEAR REQUIREMENT, OPERATOR INPUT, 0-NO, 1-YES)
(#529 = NUMBER OF CUTS REQUIRED, SET IN PROGRAM)
(#530 = DIAMETER BEFORE DEBURR, SET IN PROGRAM)

(USE MACRO #528 TO SPECIFY IF STEEL CLEAR CUT REQUIRED)
(0 - NO)
(1 - YES)


G65P9800(PROBE HEALTH CHECK) 
 
 
G0X25.0
Z[#500+1.0]
 
T1010
G65P9832(FLASH ON) 
G65P9610F100.Z[#500-1.0] 
 
G65P9611X4.0 
#510=#135+#508 
G65P9610F100.Z1.0
G65P9611X4.0 
#511=#135+#508 
G0X20.0
Z[#500+1.0]
G65P9610F100.X[#510-1.0] 
G65P9611Z3.25
#509=#137+#507 
G65P9833(FLASH OFF)
G99
G0X20.0
Z[#500+1.0]
#512=[#511-#508-#501]
#520=[#510-#511] 
#513=[#512-.062] 

IF[#512GE.362]GOTO10
IF[[#512 LT .362] AND [#512 GE .262]]GOTO11
IF[[#512 LT .262] AND [#512 GE .162]]GOTO12
IF[#512 LT .162]GOTO13

N10 #529=4
GOTO20
N11 #529=3
GOTO20
N12 #529=2
GOTO20
N13 #529=1
GOTO20


N20
#514=[#513/#529]
#521=[#511-#508-#514]
#522=[#511-#508-[#514*2]]
#523=[#511-#508-[#514*3]]
#524=[#511-#508-[#514*4]]

IF[#529EQ1]GOTO30
IF[#529EQ2]GOTO31
IF[#529EQ3]GOTO32
IF[#529EQ4]GOTO33

N30 #530 = #521
GOTO40
N31 #530 = #522
GOTO40
N32 #530 = #523
GOTO40
N33 #530 = #524
GOTO40


N40
#525=[#530-.05]
#526=[#525-.002] 
#527=[#526-.01]
 
quite common to need to zero (or set to certain values) macro variables before program run. usually its in the program beginning
.
other wise old value and new value might be added together. same with work offsets sometimes they need to be zeroed (or set to certain expected values) at program beginning.
.
also if #531 controls something like probing circular tolerance, program should set it like #531=.005
....not good to assume any variables is any value. program should set it to expected value at program beginning.
.
if program restarted not at program beginning than variables might not get reset to expected values and mess things up later.
 
Without getting out the probe manual, I would say your problem is the #500 macros numbers you are using are the same ones that the probe uses for probe length, tip diameter, etc. Change your #500 numbers to #600 numbers, recalibrate the probe and then try running the program again.
 
All permanent common variables (#500 series), which are to be used, must be cleared in the beginning of the program.
 
Without getting out the probe manual, I would say your problem is the #500 macros numbers you are using are the same ones that the probe uses for probe length, tip diameter, etc. Change your #500 numbers to #600 numbers, recalibrate the probe and then try running the program again.

I have had to do this before. We had a machine that the previous programmer was using #500 variables for permanent fixture locations. When a probe was added to the machine years later I ended up changing the prbe variables to #600
 
What measuring program are you using ? Where are the probe calibration data stored ? It is quite common that program that runs correctly on Fanuc ** is not running correctly on Fanuc ##.
CLEARING 500 variables is not a proper way to work. If necessary, one should LOAD the 500 variables at the beginning of the program.
In general 500 variables should be kept exclusively for the data of measuring systems only. Other can be used freely by the user. Sometimes it is not applicable because of the variable "hunger" of user's application. In such case one should be very careful and avoid overwriting the probing system data. But it doesn't seems to be the problem in this case, as it runs correctly on other Fanuc.
 
Good practice .....especially if you dont think you have to....Clear them....set them

A better practice is to maintain an up-to-date list of all 500 series variables, and use the unused ones; otherwise, one may accidently overwrite a meaningful variable.
 
very common on cnc mill with pallet changer when the pallet or table is changed it zeroes the G55 work offset and possibly zeroes the macro variables. (zeroed by different program)
.
if you run a program and it sets G55 work offset then 2nd time program runs it will add the probe value to current G55. if G55 is manually zeroed it works ok.
.
to me its the program not written too well as you can in program set G55 to all zeroes at program beginning. i see this on older programs. i usually repeat probing and see if the G55 thats set repeats +/-.0002 if its way off i manually zero G55 and rerun probing. 99% of time then it will then repeat +/-.0002
 
Hi guys,

I changed my new variables from #5xx to #6xx numbers and that seemed to fix it. I do not know why, but there must have been some variable conflict that I did not see. Why it is an issue on one machine and not the other, I have no idea, as I would have thought they probe programs would be basically the same. Oh well, seems to work now so I'll leave it at that! Not best practice of course, but for now it'll work.
 
Hi guys,

I changed my new variables from #5xx to #6xx numbers and that seemed to fix it. I do not know why, but there must have been some variable conflict that I did not see. Why it is an issue on one machine and not the other, I have no idea, as I would have thought they probe programs would be basically the same. Oh well, seems to work now so I'll leave it at that! Not best practice of course, but for now it'll work.

.
i have seen machines cause of a parameter setting if you gave
G43 H1 X1.0000 Z4.0000 it would add length comp to X AND Z
.
and if parameter set different it would only do length comp on Z axis and ignore any other axis
.
identical machines can behave very different cause of parameters. one machine on reset may change to G54 work offset and on a different machine reset press does not change work offset. if it was G55 it stays what ever was last work offset
.
i cannot tell you how many times a reset press caused a problem cause operator missed a change to work offset, length comp and dia comp
.
i often use #531 for probing circle tolerance if set for .004" and probe measures rough bore over .004 out of round machine stops with error which does not say its out of round. often error message is not clear what problem is
.
obviously if #531=.0001 it will usually always say bore out of round. usually probing program needs to state
#531=.004
that way it is definitely set to tolerance required not assumed to be set to tolerance required
.
also have seen logic where it ask
IF[#531 GT.004] GOTO 7777
IF[#531 LT.004] GOTO 8888
whats annoying is when its exactly .004 neither greater OR less messes up logic. one of statements should have said GE or greater or equal
 
Personally - I'm interested to see your probe on the lathe.
Never seen that before.

Doo you blast coolant on it to clean it before each use?


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

Think Snow Eh!
Ox
 
Personally - I'm interested to see your probe on the lathe.
Never seen that before.

Doo you blast coolant on it to clean it before each use?

It is a Renishaw RLP40. Seems to do a good job. It does not get cleaned off, our tolerances are pretty wide so if it's a little dirty it isn't a problem. It sets the part length and diameter for the program.
 
Oh, so you are just using this for set-up?
Not "in process"?

Are you probing bar-stock or forgings/castings?


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

Think Snow Eh!
Ox
 








 
Back
Top