Dugg, I'm new here so please forgive my inexperience with the use of forums.
I agree with scappini, I have been programming for twenty years, mostly manual G-code but a fair amount of CAM system as well. If you were to compare 50 of my programs side by side you would swear they were post-processed from a CAM system because I program very very consistently.
Whether lathe or mill programming, I always break each program into manageable, logical "processes". For instance, Face, Rough Turn, Drill, Finish Turn, Thread, Cutoff and I use a "man-readable" comment (that will show my age!) as such at the beginning of the process with a sequence number.
In lathe programs I always program a rapid to a safe tool change position after the comment, call up the tool, start the spindle, then move to the clearance point while picking up the offset. After machining that process, rapid back to the tool change position, canceling the offset and end the process with an M01. One note: I always program the beginning and end of the process in absolute mode so the program can be started from any safe place away from the part.
It looks like this:
N5 (FINISH TURN)
G90 G95 G00 X8. Z10.
M3 S600 T0606
X2.05 Z.1
G1 ...etc...
G0 X8. Z10 T0
M1
Most of the time this is a must because each tool has a fairly specific job in a lathe of course but sometimes you will face and rough turn, etc. with the same tool. By breaking the program into smaller processes you can easily turn on the Optional Stop and measure, etc. after each process.
Once you are ready to begin again, say after examining/measuring a close tolerance bearing journal diameter and adjusting the tool offset, you simply search for the appropriate sequence number and press cycle start even if you had to jog the turret away from the part to measure it.
This becomes even more useful in maching center programming where one tool may work in many areas of the part and perform several functions. What is really nice is that most controls nowadays don't freak out if you call for a tool change to the same tool that is in the spindle. This allows me to use a block-skip ahead of a "go home" or tool change position move with a program stop on the end of the line. The net effect is that when the block-skip option is on, the program goes from one process to the next seamlessly. It looks like this for a Haas VF3 in metric mode:
...some previous process for 1/2 carbide end mill
G0 Z25. M9
/G53 X-500. Y0 Z0 M0
T1 D1 H1 M6 (1/2 Carbide End Mill)
(Rough Small Pocket)
M3 S2500
G90 G95 G0 X... next process for 1/2 inch carbide end mill
G43 Z25. M8
Make liberal use of comments, it helps when the program is run, obviously, but is invaluable the next time the job is set up, especially if it is months or years later.
I hope I have not insulted you intelligence, I'm sure you already know much of what I have explained here but I don't want to assume anything. The main thing I am trying to say is to develop a programming style and be consistent with it; it helps so much to know what to expect as far as what is coming up next in the program.
Regards,
Gary |