Manufacturing Information Solutions Forum Index Manufacturing Information Solutions
Your Place for Support and Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Paramtetric Programing Examples

 
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> G-Code Programming
View previous topic :: View next topic  
Author Message
mistux
Site Admin


Joined: 25 Jun 2004
Posts: 1042
Location: South Bend, Indiana USA

PostPosted: Sat Dec 04, 2004 4:26 am    Post subject: Paramtetric Programing Examples Reply with quote

These are from the web, so buyer be ware. Wink

============================
Mathmatical formulas are the basis for parametrics.
For example: If you needed to perform an operation at x=1000 on a DX=1220 size material you could, instead, write x=DX-220. You could then use this program on a different size material and, by changing the DX value at the header, maintain the operation at DX-220 without going into the program to modify absolute values.
i.e. If DX=820 then the operation would get performed at x=600.
==================
Code:

O0001 (Program number)
#100=1. (Diameter of end mill)
#101=3.0 (X position of hole)
#102=1.5 (Y position of hole)
#103=.5 (Depth of counterbored hole)
#104=400 (Speed in RPM)
#105=3.5 (Feedrate in IPM)
#106=3. (Tool length offset number)
#107=2.0 (Diameter of counterbored hole)
G90 G54 S#104 M03 (Select abs mode, coordinate system, start spindle)
G00 X#101 Y#102 (Rapid to hole center)
G43 H#106 Z.1 (Instate tool length compensation, rapid to approach Z position)
G01 Z-#103 F[#105 / 2]
Y[#102 + #107 / 2 - #100 / 2] F#105
G02 J-[#107 / 2 - #100 / 2]
G01 Y#102
G00 Z.1
M30

=============
This is an example of a basic parametric program for a Biesse Rover FT with an XNC control. (Note the leading and trailing lines have been removed for clarity.)
Code:

N10 G70 HC=1 LY=20 PLPZ=0.75 FIL=0 BLO=0 ACC=0 RUO=0 PRS=1 PRL=1 Z=PRK KA=0.000 LZ=0.750 LX=80
N30 RR=6 TX=4 TY=3
N40 PAN=1 ST1="CC" ST2="NULL" L=PCUA
N50 X97.25 Y-0.5 TP=1 PRF=0.752 L=PON F=22.9 VF=3. S=18000 G41 G46 TRZ=0 M55
N60 G1 X97 Y-0.25 F22.9
N70 X.25 G1
N80 Y=LPY-TY-.25 G1
N90 X=TX+.25
N100 Y=LPY-.25
N90 X=LPX-RR+.25 G1
N100 X=LPX+.25 Y=LPY-RR-.25 I=LPX-RR+.25 J=LPY-RR-.25 G2
N110 X=LPX+.25 Y-.25 G1
N120 G1 G40 X=LPX+.5 Y-.5 ZI0.
N130 G0 L=PSU
N140 G0 L=POFF

LPX = Panel X
LPY = Panel Y
RR = Radius
TX = Toe Notch X
TY = Toe Notch Y

This program will adjust the program according to the panel size. Also the parameters are for the radius corner and toe notch.
===============
Here's an old macro subprogram (note the date) for routing holes. It will rout just the diameter of the hole or it will hog the entire center before finishing the hole depending on the value of "H". It assumes the tool is turning and centered over the hole when called from the main. It was written for a Fanuc 11M control.
Code:

O4028(HOLE BORING)
(VERSION 1.2 - 08/19/89 - HOGS OUT CENTER OF CIRCLE)
(TO HOG OUT CENTER OF HOLE SET H TO 1 WHEN CALLING MACRO)
(START POS SHOULD BE OVER CENTER OF HOLE)
(A=#1=DIAMETER ADJUSTMENT)
(D=#7=DIAMETER OF HOLE)
(F=#9=FEEDRATE)
(H=#11=SET TO 1 TO HOG CENTER)
(R=#18=RAPID TRAVEL DIST TO WORK SURFACE)
(T=#20=OFFSET # FOR TOOL RADIUS)
(Z=#26=DEPTH OF HOLE FROM WORK SURFACE)
#2=#5001(X START POS)
#3=#5002(X START POS)
#4=#5003(X START POS)
#12=#[2000.+#20](READ DIA OFFSET)
#10=[#7/2-#12]+[#1/2](CALC RAD AND ADD ADJUSTMENT)
IF[#11EQ1.]GOTO100(HOG CENTER?)
G91G00X[#10-.03]Z-[ABS[#18]]
G02I-[#10-.03]Z-[ABS[#26]]F#9
G01X.03
G02I-#10
X-[#10*2]I-#10Z[ABS[#26]]
G90G01Z#4
X#2Y#3
GOTO500
N100#21=[#12*.9]
G91G00X#21Z-[ABS[#18]]
G02I-#21Z-[ABS[#26]]F#9
I-#21
#23=#21
#22=#21*2
WHILE[#22LT#10]DO1
G01X#21
G02I-#22
#23=#22
#22=#22+#21
END1
G01X-[#10-#23]
G02I-#10
X-#10Y#10I-#10
X-[#10*.9]Y-[#10*.9]J-[#10*.9]Z[ABS[#26]]
G90G01X#2Y#3Z#4
N500M99
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> G-Code Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group