-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample_drill.sbp
More file actions
166 lines (144 loc) · 6.78 KB
/
sample_drill.sbp
File metadata and controls
166 lines (144 loc) · 6.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
'S_drill.sbp -- Program to drill an array of holes
'David Nadeau 5/28/01
' The following licensing information must accompany this file at all times.
' ********** Licensing Information **********
' Copyright 2001 ShopBot Tools
'
' We encourage ShopBot users to modify this part file to suit their own needs and have licensed it
' under the Creative Commons Atribution 3.0 license. This license allows you to copy, distribute,
' or modify the file with certain restrictions. Any other use requires permission from ShopBot Tools.
'
' A simplified explanantion of this license is available at
' http://creativecommons.org/licenses/by/3.0/us/
'
' and the full legal code can be found at
' http://creativecommons.org/licenses/by/3.0/us/legalcode
' We encourage you to read this legal code before modifying or distributing this file,
' ESPECIALLY sections 5 and 6 that cover warranties and liability.
'
' If you plan on distributing your new version, you must also state in the header of your file that it
' is a modification of a file supplied by Shopbot Tools, supply information on finding the original file,
' and rename the file to make it clear to the user that it is a modified version.
'
' ********** End Licensing Information **********
' User takes responsibility for the effects and outcomes of the use of this program, and ShopBot Tools assumes
' no liability it's use.
'Test Run this program in Preview Mode and with air-cutting above material to make
' sure you are satisfied that it is doing what you expect it to do.
'This program will prompt you for values to create layout.
'Set your Tool's X=0,Y=0 to the center point of the first hole.
'Set your Z=0 as you would for creating an single hole.
'This program assumes you have already set the correct Move and Jog Speed values
'You should also make sure the Cutter Diameter [VC] is correct
'By default, cutting of circles will be in a clockwise direction (1) with a
' spiral plunge (in 3 equal passes) and Z depths offset from zero
'Initialize
SA 'set to absolute mode
SL 'clear all variables
&colcount=0 'set up counting variables
&rowcount=0
'Sample default values ... if you would like to run the file without prompts and
' using your own default values, just remove the " ' " from the last line of this
' section and the program will run with the defaults without the user prompts.
&xperpart = 5 'X distance between centers of holes
&yperpart = 5 'Y distance between centers of holes
&zclear = 1 'Safe Z clearance height between holes
&numcolumns = 18 'Number of holes along X axis
&numrows = 9 'Number of holes along Y axis
&holediam = 1 'Hole diameter
&holedepth = -1 'Hole depth (should be negative z=0 at material surface)
&in_out_true = T 'Circle-cutting offset (T=True=no bit compensation)
&cutdiam = %(23) 'Sets cutter diameter equal to current VC command value
&xstart = 0 'X location of first hole
&ystart = 0 'Y location of first hole
' GOTO Cutrow
'This is where we get the variables from user
PRINT " "
PRINT "Current cutter diameter is set to:", &cutdiam, " (Any key to Continue)"
PAUSE
INPUT "Is this the correct cutter diameter? (Y)es or (N)o?" &answer
&answer="&answer"
IF &answer="Y" THEN GOTO Continue1
INPUT "Enter cutter DIAMETER" &cutdiam
VC,&cutdiam
Continue1:
INPUT "Diameter of Holes?" &holediam
INPUT "Depth of Holes? (NEGATIVE value for a standard plunge)" &holedepth
INPUT "(I)nside (O)utside or (T)rue cutting ?" &in_out_true
&realdiam=&holediam
&in_out_true="&in_out_true"
IF &in_out_true="I" THEN &realdiam=&realdiam-&cutdiam
IF &in_out_true="O" THEN &realdiam=&realdiam+&cutdiam
INPUT "X Location of first Hole?" &xstart
INPUT "Y Location of first Hole?" &ystart
PRINT " "
INPUT "Distance between hole centers in X direction?" &xperpart
INPUT "Distance between hole centers in Y direction?" &yperpart
INPUT "Clearance height for moves between holes?" &zclear
'Figure out if we are just plunging
&Type=0 'Plunge only type
IF &realdiam > &cutdiam THEN &type=1 'Circle type
IF &type=1 THEN GOTO Continue2
Smallholes:
INPUT "Holes Equal or Smaller than bit. Continue w/straight plunges ('Y' or 'N')?" &answer
PRINT " "
&answer="&answer"
IF &answer="Y" THEN GOTO Continue2
IF &answer="N" THEN GOTO Getout
GOTO Smallholes 'loop back if incorrect response
Continue2:
'Specify the number of parts in row and columns or compute
&answer=M 'default
INPUT "Cut by specifying (N)umber of holes OR by specifying (M)aterial size?" &answer
&answer="&answer"
IF &answer="M" THEN GOTO Material
'If we are just telling it how many holes to cut...
INPUT "Number of holes to be cut along the X axis?" &numcolumns
INPUT "Number of holes to be cut along the Y axis?" &numrows
GOTO Cutrow
Material:
INPUT "X Distance with holes?" &xcuttable
&xsizeper=&xperpart
&numcolumns=(&xcuttable/&xsizeper)
&numcolumns=(&numcolumns-.5)\1 'make integer
PRINT &numcolumns, " columns of holes will be cut in the X direction."
PAUSE 3
IF &numcolumns=0 THEN END
INPUT "Y Distance with holes?" &ycuttable
&ysizeper=&yperpart
&numrows=(&ycuttable/&ysizeper)
&numrows=(&numrows-.5)\1 'make integer
PRINT &numrows, " rows of holes will be cut in the Y direction."
PAUSE 3
IF &numrows=0 THEN END
Cutrow:
Cutsingle:
JZ, &zclear
&xloc=&xstart+(&colcount*&xperpart)
&yloc=&ystart+(&rowcount*&yperpart)
IF &type=0 THEN GOSUB PlungeType
IF &type=1 THEN GOSUB CircleType
&colcount=&colcount+1
IF &colcount < &numcolumns THEN GOTO Cutsingle
&colcount=0
&rowcount=&rowcount+1
IF &rowcount < &numrows THEN GOTO Cutrow
PRINT " Finished....Raising bit"
PAUSE 3
JZ, &ZCLEAR
PRINT " Cutting completed ! "
PAUSE 10
END
'SUBROUTINES----------------------------------------------------------------------
CircleType:
CP,&holediam,&xloc,&yloc,&in_out_true,1,,,(&holedepth/3),3,,,4,,1
'You can change parameters on the end of this line if you want
' to change how circles are cut (use the HC command in ShopBot
' software to view details on CP command parameters)
RETURN
PlungeType:
J2, &xloc, &yloc
MZ, &holedepth
RETURN
Getout:
END