Re: Macro programming help
Look up PROGRAMMABLE PARAMETER ENTRY (G10) in the programming manual for controller that is on your machine.
Re: Macro programming help
A couple of books that could help are
fanuc custom macro b by Sihna
fanuc cnc custom macro's by Peter Smid
to have the program make changes to the machining of the part by having the operators change a macro variable
#1-#33 ARE LOCAL
#100-#199 ARE COMMON -( POWER OFF RESETS THEM)
#500-#999 ARE COMMON (STAY ACTIVE DURING POWER OFF)
O1234
G00G90G20G40G97G99
#500=2.000(MATERIAL OD)
#501=1.900(TURN DIA.)
#502=-1.000(Z TURN LENGTH)
N1(TURNING TOOL)
G28U0.W0.
G0G97S2000T0101M3
M8
G0X[#500+.1]Z.100(MATERIAL DIA.+.100)
G1Z0.F.005
G1X-.06
G0Z.05
G0X[#501-.05](TURN DIA. -.05)
G1Z0.F.005
G1X#500,C.03(TURN DIA WITH CHAMFER.)
G1Z#502(Z TURN LENGTH)
G1X#500,C.03(MATERIAL DIA. WITH CHAMFER)
G1Z[#502-.05](MOVE FOR CHAMFER)
G0X[#500+.1](CLEARANCE MOVE)
G0Z-.1
G28U0.W0.
M9
M01
I would also include some safety's to avoid some crashes if the data is wrong
IF[#500LT1.75]GOTO9000(SMALLEST OD.)
IF[#500GT2.500]GOTO9000(LARGEST OD)
IF[#500LT#501]GOTO9000(TURN DIA LARGER THAN MATERIAL)
IF[#502GT0.]GOTO9000(Z LENGTH IS POSITIVE)
N9000( DATA. OUT OF RANGE)
Re: Macro programming help
I'm late to the party so you should already have it figured out. I've got both books mentioned by rcs60. The book by S. K. Sinha is the one you want.
Let me know if you still need help. I've written several master programs for families of parts. It isn't hard once you write the first program. This is the type of programming I love to do. Consider using macros to control each diameter and to control any possible taper on an O.D. (or I.D.). That way you just put a value in a variable with no need to go into the program and make modifications. Incremental moves for chamfers are your friend.
.010 x 45 degree chamfer at the face
G1 X[.9456+#500]Z0F.005
G3U.0268W-.0056R.019F.002
G1U.0164W-.0082
G3U.0112W-.0134R.019 (X1.)
G1X[1.+#501]Z-1.25F.004
U.03
Say you were also turning a 1.375 diameter on the part that also needed a .010 x 45 degree chamfer. Simply cut, paste and modify one value (and in this case a couple variables and obviously the final turned depth).
G1 X[.9456+#500]Z0F.005
G3U.0268W-.0056R.019F.002
G1U.0164W-.0082
G3U.0112W-.0134R.019 (X1.)
G1X[1.+#501]Z-1.25F.004
X[1.3206+#502]
G3U.0268W-.0056R.019F.002
G1U.0164W-.0082
G3U.0112W-.0134R.019 (X1.375)
G1X[1.375+#503]Z-2.5F.004
U.03
B controls are a pain. Our last 2 EMAGS purchased have them. Previous EMAGS and all our other Fanuc controls are C. For a B control:
G1X[.9456+#500]Z0F.005
G91G3X.0268Z-.0056R.019F.002
G1X.0164Z-.0082
G3X.0112Z-.0134R.019 (X1.)
G90G1X[1.+#501]Z-1.25F.004
X[1.3206+#502]
G91G3X.0268Z-.0056R.019F.002
G1X.0164Z-.0082
G3X.0112Z-.0134R.019 (X1.375)
G90G1X[1.375+#503]Z-2.5
Re: Macro programming help
Quote:
Consider using macros to control each diameter and to control any possible taper on an O.D. (or I.D.).
q x uz
Quote:
1.375 diameter on the part that also needed a .010 x 45 degree chamfe
q x1.375 (c0.01)
hy :) such that becomes input, and postprocesed for whatever you wish / kindly :)
Re: Macro programming help
Quote:
Originally Posted by
deadlykitten
q x uz
q x1.375 (c0.01)
hy :) such that becomes input, and postprocesed for whatever you wish / kindly :)
I think your words got frozen because some letters are missing. Must have broken up and dropped to the ground. :) I don't understand much of what you said.
I am aware of putting on chamfers with 'C' (or radius with 'R'), but never have done it for the same reason I never learned to use G41/G42. I was told not to when I first started as my programs had to run on any of our lathes. Most were old enough not to be able to use that kind of programming.
To the best of my knowledge 'C' will not swing a radius at the beginning and end of a chamfer. The chamfer is made in a straight line. I always swing a radius on chamfers to avoid a burr being kick back which often happens when the insert gets a little worn. If a burr is made when swinging a radius, then you know the insert is shot.
BTW, I was told in 2008 that the company wanted me to use MasterCam for all my programming. They wanted a newbie to be able to call up the part and change the post processor so it could be run on any of our lathes. Personally I don't do that to run on a different lathe. It is easy for me to make the necessary format changes to go from one lathe to a different one. I have a bunch of Macros in the editor or I do a Ctrl H to make global changes.
Previously I just used MasterCam to save myself from using a lot of trig. I might have driven a tool or two and copied the output into my program. The rest of the program was manually written.
MasterCam doesn't do Macro programming worth a damn. LOL.
Re: Macro programming help
Quote:
chamfer is made in a straight line. I always swing a radius on chamfers
q3 (r0.003c0.01r0.003) x1.375
q3 x1.355 (r0.003) x1.375u45 (r0.003)
q3 x1.355z0 (r0.003) x1.375u45 (r0.003)
q3 (r0.003) x1.375z0.01u45 (r0.003)
Re: Macro programming help
Quote:
Originally Posted by
deadlykitten
q3 (r0.003c0.01r0.003) x1.375
q3 x1.355 (r0.003) x1.375u45 (r0.003)
q3 x1.355z0 (r0.003) x1.375u45 (r0.003)
q3 (r0.003) x1.375z0.01u45 (r0.003)
Thanks. I can see that I need to revisit a programming manual from one of our new lathes.
Re: Macro programming help
Quote:
Originally Posted by
g-codeguy
Thanks. I can see that I need to revisit a programming manual from one of our new lathes.
EDIT: Also deadlykitten I believe you work with Okuma controls. I may not have this flexibility with Fanuc controls. Afraid I haven't checked into this yet. Been swamped and it isn't looking any better in the foreseeable future. If I didn't post from home, I wouldn't be posting. And that's after my wife goes to bed. :D
Re: Macro programming help
Quote:
If I didn't post from home, I wouldn't be posting. And that's after my wife goes to bed
you mean posting cnc programs, or posting on cnc zone ? :) in both cases, seems a bit weird :)
why don't you post both from work, and have more free time ?
Re: Macro programming help
Quote:
Originally Posted by
deadlykitten
you mean posting cnc programs, or posting on cnc zone ? :) in both cases, seems a bit weird :)
why don't you post both from work, and have more free time ?
I mean posting on cnczone. I'm doing a lot of posting (Mastercam) at work. We are always short-handed so I not only trouble shoot, but help set up occasionally. I'm the only programmer for 26 lathes.
Re: Macro programming help
you are a bit busy :) just hang on, a little bit more