Sunteți pe pagina 1din 3

The Bolt Circle Example

A bolt circle program is a good example of what Custom Macro can do. Looping,
Trigonometry, IF-GOTO, Local and Common
variables are all used in this example. The bolt circle macro makes it quick and easy
to program a circular pattern of holes. Any of
the "G" code drilling cycles can be used with the bolt circle command. The pattern
can be centered anywhere on the part and the
first hole can be at any angle. The information needed to use the command is listing in
the following table:

X
X axis center of the Bolt Circle.
Y
Y axis center of the Bolt Circle.
Z
Depth to drill or bore the hole.
R
Reference point above part.
D
Diameter of bolt circle.
C
"G" code to be used. Any standard Drilling or Boring Cycle can be use.
H
Number of holes in the pattern.
A
Starting angle of first hole from the X axis.
F
Feed rate to be used.
T
Dwell value if G82 cycle is used.
Q
Peck interval if G73 or G83 peck drilling cycle is used.

A value for T and Q are not required for a G81 drilling cycle. All other addresses are
necessary to drill the pattern. This macro
works with any control that has a macro B style language. The manual shows how to
write better error traps for newer controls.

Alarm Generation
If a required address is not given an alarm will occur when the command is executed.
See the bottom of the program for a list of the
alarms. This is one advantage of Custom Macro, you can put error traps in your
cycles!

How the Cycle Works


The tool will rapid to the first hole. The cycle selected by "C" will be executed. The
tool will return to the reference point given by
"R" if G99 is in effect or to the initial point if G98 is in effect. The tool will then rapid
to the next hole. The sequence will be
repeated until all holes are completed. The complete command for a 2.0” diameter
bolt circle centered at X0.0 Y0.0 drilling 1.0”
deep referenced .1” above the part with 4 holes starting at 45 degrees would be:

G65 P9010 X0 Y0 Z-1. D2. R.1 C81. A45. H4. F10.

The macro program for the bolt circle is:

O9010(BOLT HOLE MACRO)

IF[#7EQ#0]GOTO2001

IF[#11EQ#0]GOTO2002

IF[#9LT#0]GOTO2003

IF[#3EQ#0]GOTO2004

IF[#18EQ#0]GOTO2005

#100=1

#27=#7/2.0

G0X[[COS[#1]*#27]+#24]Y[[SIN[#1]*#27]+#25]

G#3Z#26R#18F#9Q#17P#20

#101=360/#11

N1WHILE[#100LTABS[#11]]DO1
X[[[COS[[#101*#100]+#1]*#27]+#24]]Y[[[SIN[[#101*#100]+#1]*#27]+#25
]]

#100=#100+1

END1

G0T02006

N2001#3000=1(NO DIAMETER GIVEN)

N2002#3000=2(NO HOLES GIVEN)

N2003#3000=3(NO FEED RATE "F" GIVEN)

N2004#3000=4(NO DRILL CYCLE GIVEN)

N2005#3000=20(NO REFERENCE POINT GIVEN)

(X=X AXIS CENTER)

(Y=Y AXIS CENTER)

(Z=Z AXIS DEPTH)

(R=REFERENCE POINT ABOVE PART)

(T=DWELL VALUE FOR G82)

(Q=PECK INTERVAL FOR G73,G83)

(H=NUMBER OF HOLES TO DRILL)

(A=START ANGLE OF FIRST HOLE)

(D=DIAMETER OF BOLT CIRCLE)

(C=DRILL CYCLE TO USE)

N2006M99

S-ar putea să vă placă și