What's new
What's new

Please evaluate this program.

FanucPhil

Plastic
Joined
Mar 10, 2021
Hello.
I’ve recently started a position and this is one of their programs.
I don’t want to say anything to guide anyones opinion, I’ll let you reply then I’ll add my comments.
All I will ask is could you briefly explain your history and give the programs a mark out of ten.
For example I’ve been a programmer / set up guy for 20 years and I give their excellent programming 10 out of 10. Or I’m a CNC Turner with 9 years experience and I give them 7/10.
I’m going to show management your replies as hopefully it will back up what I’ve been trying to say to them.

Thank you.

Operation 1:

3054(OP1)
G21G40G99
N9(38MM UDRILL)M8
G0G97T909S1150
X1.Z4.
M3
G1Z-22.F.08
G0X0Z5.S850
G90X6.Z-21.F.23
X11.
G0X13.
G90X16.
X21.
G28U0W0M1
N1(ROUGH TURN 1.2RAD INSERT)M8
G50S1500
G0G96T101S150
X114.5Z3.
M3
G71U2.R.3
G71P20Q30U.3F.35
N20G0X111.594
G1Z.07
X114.,A135.
Z-13.
N30X114.5Z-14.
G0X114.Z.2
G1X50.
G28U0W0M1
N6(25MM BORING BAR .8RAD)M8
G0G96T606S150
X59.Z1.
M3
G71U1.7R.3
G71P40Q50U-.25W.1F.33
N40G0X72.4
G1Z0
X70.2R1.1
Z-8.
X66.7R1.1
Z-19.
N50X64.Z-21.
G28U0W0M1
N3(FINISH TURN .8RAD)M8
G50S2200
G0G96T303S190
X68.Z1.
M3
G1Z0F.22
X115.
G0X110.5Z.5
G1Z.05F.15
X112.062Z0R.95F.1
X114.,A135.R.9
X114.025Z-9.2F.22
U.25Z-12.
U12.S800
G28U0W0M1
N6(8.5MM CARBIDE DRILL /S2100)M8
(OR 7MM /S2500)
G28H0M91
G50C0
G0G97G98T1111S2100M3
X92.1Z3.
G83Z-20.2F190H45.K8.M86
G80G28U0W0H0M5
M19
M1
N10(SPOT DRILL)M8
G50C0
G0G97G98T1010S1000M3
X92.1Z2.
G83Z-4.1R-4.5P200F150
H45.K7.P200
G80G28U0W0M5
M41
M1
N7(25MM DCMT BORING BAR .4RAD)M8
G0G96G99T707S180
X65.Z1.
Z-7.8
M3
G1X69.Z-7.95F.08
X70.4F.04
X66.7R.7F.08
Z-18.F.12
G0U-1.Z-8.
G1X70.4F.08
G4U1.
X70.2W.03
G0U-1.Z50.
X71.5Z1.
G1Z0F.12
X70.2R.65F.08
Z-8.
G0U-1.Z5.
G28U0W0M5
M30
%

Operation 2:

3055(OP2)
G130X120.W20.
M1
N1(ROUGH TURN 1.2RAD INSERT)M8
G50S1500
G0G96T101S140
X116.Z3.
M3
G71U1.5R.3
G71P20Q30U.3F.28
N20G0X111.094
G1Z.07
X113.5,A135.
N30Z-10.
G0X114.Z.1
G1X55.
G30U0W0M1
N5(25 MM BORING BAR .8RAD)M8
G0G96T505S140
X66.4Z1.
M3
G1Z-2.F.2
G0U-1.Z.1
G94X82.45Z-.5F.25
X76.6Z-1.12
G30U0W0M1
N03(SEMI FINISH FACE .8RAD)M08
G0G96T303S160
X115.Z-2.
M3
G1X113.7F.2
X113.6Z-.949
Z.02,A315.
X80.
G30U0W0M1
N02(ROUGH PLUNGE KNIFE EDGE)M8
G0G96T202S130
X82.55Z1.
M3
G1Z.2F.2
Z-.5F.05
Z-1.41F.025
Z-.5,A290.F.13
X76.6
Z-1.17
U-2.W.03
G0Z1.
G30U0W0M1
N8M8
G28H0M91
G50C0
G0G97G98T808S1950M3
X92.2Z1.
G83Z-19.3Q5000F155H45.K8.M86
G80G30U0W0H0M5
M19
M1
N9(BROACH GAS SLOT)M8
G28H0M91
G50C0
G0G98T909S0M3
G65P9030X119.Y80.5Z-.6C21.25F3200
M1
N3( FINISH TURN .8RAD)M8
G50S1600
G0G96G99T303S160
X110.Z1.
M3
G1Z.05F.15
X111.462Z0R.95F.08
X113.4,A135.R.9
X113.6Z-12.8F.22
G0X114.5Z0S110
G1X80.
G30U0W0
M1
N2(FINISH KNIFE EDGE)M8
G50S1500
G0G96T202S150
X83.8Z1.
M3
G1Z0F.15
G2X82.6Z-.6R.6F.05
G1Z-1.45
X78.233Z-.658
G2X76.952Z-.957R.5F.015
G1Z-1.2,A200.F.03
X68.05F.1
G2X66.75Z-1.9R.65F.05
G1U-.15Z-3.
G0U-1.Z5.
G30U0W0M5
M9
T808
M30
%

And here is the drawing which - of course - maintains all customer confidentiality.
E11AF09E-7858-47D2-B33C-B82B885C1E6D.jpg
 
That's a lot of reading and analysing that you're asking people to do purely out of the goodness of their hearts - to be blunt you're not going to get any takers like that unless it's someone who is actually that bored with nothing better to do.

I can see many questionable things in that code just glancing at it, some if it looks like typos though so I guess you typed that out rather than copying it directly from the control or nc file.

Condense it down a bit and rephrase the question and you'll be more likely to get responses.
 
I'll play.
I've been programming, set-up and running mills and lathes for 30+ yrs. Here's my thoughts.

It looks like it was done with some CAM program but the format is very difficult to read.
Looks like there are some crashes and near misses in there, although I didn't read thru the whole program.

IMO a program like that shouldn't be going to the shop floor. A few edits are understandable, but that needs serious work. 0/10
 
I can see many questionable things in that code just glancing at it, some if it looks like typos though so I guess you typed that out rather than copying it directly from the control or nc file.
That’s a used file copied and pasted straight from the computer.
 
I'll play.
I've been programming, set-up and running mills and lathes for 30+ yrs. Here's my thoughts.

It looks like it was done with some CAM program but the format is very difficult to read.
Looks like there are some crashes and near misses in there, although I didn't read thru the whole program.

IMO a program like that shouldn't be going to the shop floor. A few edits are understandable, but that needs serious work. 0/10
That’s how the program came off the machine and they’re written on the machine.
 
That’s a used file copied and pasted straight from the computer.

That’s how the program came off the machine and they’re written on the machine.

I asked because there are several lines in there that shouldn't execute without an alarm, and several that are extremely dubious what they would actually do.

Eg. G1Z-1.2,A200.F.03 should alarm out because of the comma I'd have thought??

G50C0, might get ignored by the control I suppose, but most likely sets G50 to an undefined value which could be very unsafe.

G30 without a P word, does it assume P1 and behave the same as G28? I have no idea.

M codes after comments, do they even get executed? I saw a completely out of sequence N number in there somewhere with an M8 after it, presumably because the M8 after the comment was ignored by the control.

Plenty more. Like BD said, it's a really badly written program.
 
+1 To bad formatting. As Gregor(?) said, condense, add some spaces between operations, make it more readable and you might get more help. Also, it appears you know something is wrong, if your boss won't listen to you it's unlikely he is going to listen to people he doesn't know sitting behind their keyboards...
 
First tool:

3054(OP1)
G21G40G99
N9(38MM UDRILL)M8
G0G97T909S1150
X1.Z4.
M3
G1Z-22.F.08 You're drilling at X1.0?
G0X0Z5.S850 clearance move. OK
G90X6.Z-21.F.23 did you just crash here?
X11. why are the next 4 lines X moves?
G0X13.
G90X16.
X21.
G28U0W0M1


You said this was hand programmed? This program actually ran as written?
 
After just skimming through, there are things I like and things I do not like. My biggest complaint would be the placement of the M codes. The use of angle commands suggest the programmer has above, average, code knowledge.
As for the comma in the angle (A) command, that is dependent upon the machine parameter settings.
 
On all my machines G30 without a P word behaves as P1, same as / is assumed as /1

I was under the impression all controls assume G30 to equal G30 P1 but maybe there are some exceptions?
G30 is essentially a programmable G28.
So G30 U0 will go to the X home position and W20. For example would go 20mm from your longest tool and Z zero if that makes sense?
 
I’ve been programming, running shops, and owning my own shop for 25 years. I read the code and recognized it. Please stop by the office and pick up your last paycheck. You’re fired for breach of confidentiality.

Just kidding... kind of.


Sent from my iPhone using Tapatalk
 
First tool:

3054(OP1)
G21G40G99
N9(38MM UDRILL)M8
G0G97T909S1150
X1.Z4.
M3
G1Z-22.F.08 You're drilling at X1.0?
G0X0Z5.S850 clearance move. OK
G90X6.Z-21.F.23 did you just crash here?
X11. why are the next 4 lines X moves?
G0X13.
G90X16.
X21.
G28U0W0M1


You said this was hand programmed? This program actually ran as written?
Yes, that works and no I would not do it that way.
You can and arguably should offset your U-drills in X.
What this is actually doing is using the drill as a pre rough bore.
The G90 is a repeat cycle so it repeats these moves for all the following lines with the corresponding X movement.
Again, I think these programs are horrendous.
One friend said looking at them made him sea-sick they skip around so randomly.
 
I’ve been programming, running shops, and owning my own shop for 25 years. I read the code and recognized it. Please stop by the office and pick up your last paycheck. You’re fired for breach of confidentiality.

Just kidding... kind of.


Sent from my iPhone using Tapatalk
I understand, that’s why there is no breach of confidentiality, I removed all part numbers and customer details on purpose. I take that kind of thing seriously. Neither have I not shall I mention the company in question. Though I will show this to them. Maybe they’ll fire me anyway? Maybe I’ll quit. We’ll see.
 
After just skimming through, there are things I like and things I do not like. My biggest complaint would be the placement of the M codes. The use of angle commands suggest the programmer has above, average, code knowledge.
As for the comma in the angle (A) command, that is dependent upon the machine parameter settings.
Thanks for the impartiality, though I wouldn’t call using angle commands as above average code knowledge. As an old timer I always thought that was for people who can’t do trig. ����
 
G30 is essentially a programmable G28.
So G30 U0 will go to the X home position and W20. For example would go 20mm from your longest tool and Z zero if that makes sense?

I am well aware of what second/third/.... reference point return is. I was merely stating that if the P word is omitted it is assumed to be P1. The same as / (block skip) is assumed to be /1
 
20+ years programming.

Not much more to add other than I'm agreeing with what others have posted above.

I read through a bunch of that code, then started skimming and now I want to call the police.
 
10 years programming, and I get that the code isn't pretty and some of it is downright dumb, but what is your actual angle here?

It's cute that you blocked out the customers name on the print, but since you posted your entire program and the print I could go make one of these right now. And so could almost anyone else, this is an international forum. I don't see this going well for you if you do show it to your managers.

Program: 4/10

Your plan: 0/10
 
G50C0, might get ignored by the control I suppose, but most likely sets G50 to an undefined value which could be very unsafe.

G50 with a coordinate value is an offset shift, not a spindle speed limit. In this case, he's setting the current position of his C axis to C0. He's using it after he homes the C axis to machine 0 though, so it seems like more of a redundant/safety line type of deal.
 
I understand, that’s why there is no breach of confidentiality, I removed all part numbers and customer details on purpose. I take that kind of thing seriously. Neither have I not shall I mention the company in question. Though I will show this to them. Maybe they’ll fire me anyway? Maybe I’ll quit. We’ll see.


10+ year's programming, mostly milling but experienced enough on turning to understand your question. I agree with everyone else on the sloppy coding. You're making conflat's for some sort of vacuum application. The bolt pattern, knife edge groove and full radius fiducial mark's give it away.

You may want to re-think your approach with management if you need to come to PM to get your point across.
 








 
Back
Top