You are on page 1of 75

CUSTOM VQC TEMPLATES

N10 (CATEGORY) (NAME SLOTS) N11 (TEMPLATE) (NAME CIRCULAR SLOTS) (DIAGRAM) (DATUM [19,14]) (CIRCLE [19,14] 13) (CIRCLE [19,14] 9) (CCW [17,25][9,20]10) (CW [21,25][29,20]10) (LINE [17,26][17,24]) (LINE [21,26] [21,24]) (CCW [7,16] [8,9]10) (CCW [14,4] [24,4]10) (CW [31,16] [30,9]10) (ARROW [19,20] [19,23]) (ARROW [19,18] [19,15]) (LINE [5,31] [5,24]) (LINE [19,31] [19,28]) (ARROW [11,30] [5,30]) (ARROW [15,30] [19,30]) (END DIAGRAM) (PARAMETERS) (#ToolNo) (NO DECIMAL) (#WrkOfset) (NO DECIMAL) (#IR) (LABEL Inner Radius) (POSITION [15,19]) (#OR) (POSITION [8,30]) (LABEL Outer Radius) (#Slots) (LABEL # of Slots)

SLIDE LEGEND
PRESS

ACTIONS KEYS

THREE TIMES TO GET TO THIS PAGE

INSTRUCTIONS

(Continued on next slide) Note:

INFORMATION OTHER INFORMATION

This presentation will show you how to create a completely new VQC Template. You should review the VQC Templates presentation prior to this one to get a basic understanding of customizing templates. This presentation will use an aid called the Template Builder. It is simply a spreadsheet with some grids and code samples to make it a little easier to see how templates are created.

Open the Template Builder and go to the Basic worksheet.

You will notice that there are some basic shapes and sample code that you can alter when creating a custom template.

Lets say you want to create a template for finishing the ID of a part like that shown.

First delete the 3 lines indicated. They will not be needed.

Click on one of the Arcs and then select Format.

Now Select Auto Shape

From the menu, Select Size Change the Height and Width to 200%. You may also have to adjust the height and width to get a arc with a radius of 6 blocks

XDist

Repeat this procedure with the second arc.


YDist

XDist

Move the two arcs so they are centered above and equidistant from the datum.

YDist

XDist

Move the vertical line so that it connects the left side of the two arcs. You will need to shorten it a little
to make it fit.

YDist

XDist

Copy and paste the vertical line. (You can use Ctl C for copy and Ctl V for paste). You may want to zoom in to see the objects better.

YDist

XDist

Move the copied line so that it connects the right side of the two arcs.

YDist

XDist

Copy and paste this arrow line

Move it to the position shown. The size will need to be shortened. Dont worry if your drawing doesnt look perfect.

YDist

XDist

Copy and paste the small horizontal line


YDist

Move it to the position shown.

XDist

Type the word Radius in the cell indicated.


YDist

XDist

Move a small horizontal line to the position indicated.

Radius

YDist

XDist

Move the other small horizontal line to the position indicated.

Radius

YDist

XDist

Move this arrow line to the position shown. The size will need to be shortened.

Radius

YDist

XDist

Now, similarly move the other arrow line.

Radius

YDist

Then move YDist to the cell between the two arrows.

XDist

This will probably be enough of a drawing for our part. When we get to the G-code, however, we may discover that we need to add something, so we wont delete the unused lines just yet.

Radius

YDist

XDist

In this view, the colors of the segments in the drawing have been matched to the code that applies to each segment. Your next task will be to determine the end points for each segment and create the code.

Nxxxx( CATEGORY) (NAME ---------) Nxxxxx (TEMPLATE) (NAME ----------) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [16,16]) (LINE [8,31] [30,31]) (CW [30,31] [34,25] 4) (ARROW [36,13] [36,3]) (END DIAGRAM) YDist (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Radius

XDist

Lets take a look at the first eight lines of code. These have more to do with format than the picture we will create. You can make line numbers and NAMES whatever you want (within some length restrictions).

Nxxxxx (CATEGORY) (NAME ---------) Nxxxxx (TEMPLATE) (NAME ----------) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [16,16]) (LINE [8,31] [30,31]) (CW [30,31] [34,25] 4) (ARROW [36,13] [36,3]) (END DIAGRAM) YDist (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Radius

Nxxxxx (CATEGORY)
Change the underlined text to that shown in red, to the right. The text in blue is required and the lines in orange are optional, but help separate templates.

N2000

(NAME----) Nxxxxx (TEMPLATE) (NAME----)

(NAME Custom) N2100

(NAME ID w Radius)

(DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE[0,0] [0,37])

XDist

Next, look at the location of the datum. Using the numbers along the bottom and right side of the graph, you can see that its center is at: 19,17.

N2000 (CATEGORY) (NAME Custom) N2100 (TEMPLATE) (NAME ID w Radius) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [16,16]) (LINE [8,31] [30,31]) (CW [30,31] [34,25] 4) (ARROW [36,13] [36,3]) (END DIAGRAM) YDist (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Radius

Change the orange DATUM code to: [19,17])

XDist

Similarly, you will need to find the end points for each segment of the template drawing and create the code.

N2000 (CATEGORY) (NAME Custom) N2100 (TEMPLATE) (NAME ID w Radius) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [19,17]) (LINE [8,31] [30,31]) (CW [30,31] [34,25] 4) (ARROW [36,13] [36,3]) (END DIAGRAM) YDist (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Radius

Look at this line. You should see that its end points are: 13,10 and 13,24.

XDist

Using these points (13,10 & 13,24) change the blue code for LINE
The code should read: (LINE[13,10][13,24]). The parentheses and brackets are important. Each line of code must be enclosed in parentheses. Coordinates are placed within brackets.

N2000 (CATEGORY) (NAME Custom) N2100 (TEMPLATE) (NAME ID w Radius) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [19,17]) (LINE [8,31] [30,31]) (CW [30,31] [34,25] 4) (ARROW [36,13] [36,3]) (END DIAGRAM) YDist (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Radius

XDist

Now create the code for the second line. You should have found that its end points are: 25,10 and 25,24. Notice that the Y coordinates are the same as the previous line. Copy the code for the first line but change the X coordinates
Radius

N2000 (CATEGORY) (NAME Custom) N2100 (TEMPLATE) (NAME ID w Radius) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [19,17]) (LINE [13,10] [13,24]) (CW [30,31] [34,25] 4) (ARROW [36,13] [36,3]) (END DIAGRAM) YDist (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Now lets do the arcs. For an arc you need to define a radius as well as end points. What is the radius and end points for the top arc? End Points: 13,24 and 25,24 You should note that theses are the same as the endpoints of the two lines. Radius: 6

XDist

N2000 (CATEGORY) (NAME Custom) N2100 (TEMPLATE) (NAME ID w Radius) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [19,17]) (LINE [13,10] [13,24]) (LINE [25,10] [25,24]) (CW [30,31] [34,25] 4) (ARROW [36,13] [36,3]) (END DIAGRAM) YDist (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Radius

XDist

Change the green code for arc (CW) to match the coordinates and radius.
You should have (CW[13,24] [25,24]). This direction (CW) has nothing to do with the actual tool movement. It is simply the direction from the first point to the second point.

N2000 (CATEGORY) (NAME Custom) N2100 (TEMPLATE) (NAME ID w Radius) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [19,17]) (LINE [13,10] [13,24]) (LINE [25,10] [25,24]) (CW [30,31] [34,25] 4) (ARROW [36,13] [36,3]) (END DIAGRAM) YDist (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Radius

XDist

Looking at the other arc we see that its end points are: 13,10 and 25,10 (the beginning points of the two lines). Therefore we need the following line of code: (CW[25,10][13,10]). Or (CCW[13,10][25,10]).

N2000 (CATEGORY) (NAME Custom) N2100 (TEMPLATE) (NAME ID w Radius) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [19,17]) (LINE [13,10] [13,24]) (LINE [25,10] [25,24]) (CW [13,24][25,24) (ARROW [36,13] [36,3]) YDist (END DIAGRAM) (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Radius

Enter the code


(CW[25,10][13,10])

after the other arc.

Next lets work on the arrows. They are similar to lines in that you need a start and end point, however it is more important which point you list first. The arrowhead will be at the second point. The coordinates for each of the three arrows are shown at the right.

XDist [19,24] [19,30]

N2000 (CATEGORY) (NAME Custom) N2100 (TEMPLATE) (NAME ID w Radius) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37])

[27,17] [27,24]
Radius

(DATUM [19,17]) (LINE [13,10] [13,24]) (LINE [25,10] [25,24]) (CW [13,24][25,24) (CW [13,10][25,10) (ARROW [36,13] [36,3]) (END DIAGRAM) (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

YDist

[27,16] [27,10]

XDist

N2000 (CATEGORY) (NAME Custom) N2100 (TEMPLATE) (NAME ID w Radius) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [19,17]) (LINE [13,10] [13,24]) (LINE [25,10] [25,24]) (CW [13,24][25,24) (CW [13,10][25,10) (ARROW [36,13] [36,3]) YDist (END DIAGRAM) (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Create three lines of code similar to the red code for the three arrows.
(ARROW[19,24][19,30]) (ARROW[27,17][27,24]) (ARROW[27,16][27,10])

Radius

XDist

N2000 (CATEGORY) (NAME Custom) N2100 (TEMPLATE) (NAME ID w Radius) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [19,17]) (LINE [13,10] [13,24]) (LINE [25,10] [25,24]) (CW [13,24][25,24) (CW [13,10][25,10) (ARROW [19,24] [19,30]) (ARROW [27,17] [27,24]) (ARROW [27,16] [27,10]) (END DIAGRAM) (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate)

Now add the code for the small lines at the end of the arrows. Their end points are: 18,24 / 20,24 26,24 / 28,24 26,10 / 28,10. The code is shown on the next slide. and

Radius

YDist

XDist

This completes the code for the DIAGRAM section. The text (Radius, and Ydist) in this diagram will be placed in the PARAMETER section, which we will cover next.

N2000 (CATEGORY) (NAME Custom) N2100 (TEMPLATE) (NAME ID w Radius) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [19,17]) (LINE [13,10] [13,24]) (LINE [25,10] [25,24]) (CW [13,24][25,24) (CW [13,10][25,10) (ARROW [19,24] [19,30]) (ARROW [27,17] [27,24]) (ARROW [27,16] [27,10]) (END DIAGRAM) (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate)

Radius

YDist

G54

If you wanted to enter some other text in the diagram, you would use a PRINT statement and give the coordinates for where you want the text to begin. For example: (PRINT[18,15] G54)

(PARAMETERS) (#ToolNo) (NO DECIMAL) (#WrkOfset) (NO DECIMAL) (#XPos) (#YPos) (#SpdleRpm ) (NO DECIMAL) (#DpthCut) (#YDist) (POSITION [35,16]) (#Feedrate) (END PARAMETERS)

Here is the sample code for the PARAMETER section. The lines indicated are pretty standard and will not need to be modified for this example. You could however, have some standard numbers for Tool Number, Work Offset, Rpm, or Feedrate instead of requiring the operator to input these.

(PARAMETERS) (#ToolNo) (NO DECIMAL) (#WrkOfset) (NO DECIMAL) (#XPos) (#YPos) (#SpdleRpm ) (NO DECIMAL) (#DpthCut) (#YDist) (POSITION [35,16]) (#Feedrate) (END PARAMETERS)

We wont need the operator to input an X or Y position, so you can delete those lines.

(PARAMETERS) (#ToolNo) (NO DECIMAL) (#WrkOfset) (NO DECIMAL)

To make the required input clearer, you should change DpthCut to Zdepth. You will also need to change the coordinates or POSITION of YDist.

(#SpdleRpm ) (NO DECIMAL) (#DpthCut) (#YDist) (POSITION [35,16]) (#Feedrate) (END PARAMETERS)

XDist

(PARAMETERS) (#ToolNo) (NO DECIMAL) (#WrkOfset) (NO DECIMAL)

On the graph, you can see that YDist starts at location 26,17. This is what you will need to put in the POSITION line.

Radius

YDist

Note: There must be a space between POSITION and the bracket.

(#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [35,16]) (#Feedrate) (END PARAMETERS)

(PARAMETERS) (#ToolNo) (NO DECIMAL) (#WrkOfset) (NO DECIMAL) (#SpdleRpm ) (NO DECIMAL) (#DpthCut) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Another piece of information we need the operator to input is the radius of the arcs. So, you will need to add a PARAMETER for Radius.

XDist

(PARAMETERS)
(#ToolNo) (NO DECIMAL) (#WrkOfset) (#Radius) (NO DECIMAL) (POSITION[18,23]) (#Radius) (POSITION [17,23])
YDist

Also, since Radius shows on the template, you also will need to add a POSITION statement. The coordinates for Radius are 17,23.

Radius

(#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

At this point, you may want to create a program to make the cut for the part (if you dont already have one). Here is an example of how we might write the code for this part.

G17 G40 G49 G64 G80 G98 T1 M06 G90 G54 G00 X0. Y0. S1500 M03 G43 H1 Z1. M08 G01 Z0.1 F25. Z-0.5 G41 X1.5 X2. Y0 Y2. G03 X-2.0 R2. G01 Y-2. G03 X2. R2. G01 Y0 G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05 M30

You now have to determine what information the operator will provide and what you will need to calculate. The underlined codes at the right will not vary so we will not need variables for these.

G17 G40 G49 G64 G80 G98 T1 M06 G90 G54 G00 X0. Y0. S1500 M03 G43 H1 Z1. M08 Z0.1 G01 Z-0.5 F25. G41 X1.5 X2. Y0 Y2. G03 X-2.0 R2. G01 Y-2. G03 X2. R2. G01 Y0 G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05 M30

Compare the code to your list of PARAMETERS. We first see that the operator will need to input a tool number represented by the variable #ToolNo. Change the code T1 to T#ToolNo.

G17 G40 G49 G64 G80 G98 T1 M06 G90 G54 G00 X0. Y0. S1500 M03 G43 H1 Z1. M08 Z0.1 G01 Z-0.5 F25. G41 X1.5

(PARAMETERS) (#ToolNo) (NO DECIMAL) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION[18,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate)

X2. Y0 Y2. G03 X-2.0 R2. G01 Y-2. G03 X2. R2. G01 Y0 G40 X1.5 Y1. (END PARAMETERS) G00 Z1. M09 The statement NO M05 G28 G91 Y0 Z0 DECIMAL indicates that the operators input for #ToolNo will be interpreted as a whole integer. M30

Next, we see the operator will input a work offset. represented by the variable #WrkOfset.

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G54 G00 X0. Y0. S1500 M03 G43 H1 Z1. M08 Z0.1 G01 Z-0.5 F25. G41 X1.5 X2. Y0 Y2. G03 X-2.0 R2. G01 Y-2. G03 X2. R2. G01 Y0 G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05 M30

(PARAMETERS) (#ToolNo) (NO DECIMAL) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION[18,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Change the code G54 to G#WrkOfset.

The next line of code shows a Spindle Speed. This is also input by the operator as #SpdleRpm.

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G#WrkOfset G00 X0. Y0. S1500 M03 G43 H1 Z1. M08 Z0.1 G01 Z-0.5 F25. G41 X1.5 X2. Y0 Y2. G03 X-2.0 R2. G01 Y-2. G03 X2. R2. G01 Y0 G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05 M30

(PARAMETERS) (#ToolNo) (NO DECIMAL) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION[18,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Change the code S1500 to S#SpdleRpm.

Tool Length Compensation (H1) can be represented by the same variable as the tool number. Change the code H1 to H#ToolNo.

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G#WrkOfset G00 X0. Y0. S#SpdleRpm M03 G43 H1 Z1. M08 Z0.1 G01 Z-0.5 F25. G41 X1.5 X2. Y0 Y2. G03 X-2.0 R2. G01 Y-2. G03 X2. R2. G01 Y0 G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05 M30

(PARAMETERS) (#ToolNo) (NO DECIMAL) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION[18,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

There is also a feed rate and a depth of cut that the operator will input, represented by the variables #Feedrate and Zdepth. Change the code Z-0.5 to Z#Zdepth and F25. to F#Feedrate.

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G#WrkOfset G00 X0. Y0. S#SpdleRpm M03 G43 H#ToolNo Z1. M08 Z0.1 G01 Z-0.5 F25. G41 X1.5 X2. Y0 Y2. G03 X-2.0 R2. G01 Y-2. G03 X2. R2. G01 Y0. G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05 M30

(PARAMETERS) (#ToolNo) (NO DECIMAL) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION[18,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Positioning commands may be a little more complicated. Lets say for the first move in X, for Cutter Compensation, we want to feed to a distance of the tool nose radius plus 0.1 from the side of the part. This could be represented by X(#Radius-#TNR0.1). However, we have not yet defined #TNR.

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G#WrkOfset G00 X0. Y0. S#SpdleRpm M03 G43 H#ToolNo Z1. M08 Z0.1 G01 Z#Zdepth F#Feedrate G41 X1.5 X2. Y0 Y2. G03 X-2.0 R2. G01 Y-2. G03 X2. R2. G01 Y0. G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05 M30

TNR+0.1

(PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION[18,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS)

Add #TNR to the PARAMETER section. Change X1.5 in the code section to X(#Radius#TNR-0.1).

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G#WrkOfset G00 X0. Y0. S#SpdleRpm M03 G43 H#ToolNo Z1. M08 Z0.1 G01 Z#Zdepth F#Feedrate G41 X1.5 X2. Y0. Y2. G03 X-2.0 R2. G01 Y-2. G03 X2. R2. G01 Y0. G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05. M30

In the next line, we want to move over to a distance of the arc radius (#Radius) from the origin. Change X2. in the code section to X#Radius.

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G#WrkOfset G00 X0. Y0. S#SpdleRpm M03 G43 H#ToolNo Z1. M08 Z0.1 G01 Z#Zdepth F#Feedrate G41 X[#Radius-#TNR-0.1] X2. Y0. Y2. G03 X-2.0 R2. G01 Y-2. G03 X2. R2. G01 Y0. G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05. M30

In the next line, we want to move up in Y to the start point of the arc. We are having the operator input the distance between the two arcs as YDist so this position can be represented as Y(#YDist/2). Change Y2. in the code section to Y(#YDist/2).

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G#WrkOfset G00 X0. Y0. S#SpdleRpm M03 G43 H#ToolNo Z1. M08 Z0.1 G01 Z#Zdepth F#Feedrate G41 X[#Radius-#TNR-0.1] X#Radius Y0. Y2. G03 X-2.0 R2. G01 Y-2. G03 X2. R2. G01 Y0. G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05 M30

In the next line, we want to move over in X the radius value from the origin. The radius (R value) of the arc is #Radius.

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G#WrkOfset G00 X0. Y0. S#SpdleRpm M03 G43 H#ToolNo Z1. M08 Z0.1 G01 Z#Zdepth F#Feedrate G41 X[#Radius-#TNR-0.1] X#Radius Y0. Y[#YDist/2] G03 X-2.0 R2. G01 Y-2. G03 X2. R2. G01 Y0. G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05. M30

Change X-2.0. to X-#Radius and the R2. to R#Radius.

The next move is down the YDist.

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G#WrkOfset G00 X0. Y0. S#SpdleRpm M03 G43 H#ToolNo Z1. M08 Z0.1 G01 Z#Zdepth F#Feedrate G41 X[#Radius-#TNR-0.1] X#Radius Y0. Y[#YDist/2] G03 X-#Radius R#Radius G01 Y-2. G03 X2. R2. G01 Y0. G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05. M30

Change Y-2. to Y(-#YDist/2).

For the next G03 move change the X2. to X#Radius and the R2. to R#Radius.

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G#WrkOfset G00 X0. Y0. S#SpdleRpm M03 G43 H#ToolNo Z1. M08 Z0.1 G01 Z#Zdepth F#Feedrate G41 X[#Radius-#TNR-0.1] X#Radius Y0. Y[#YDist/2] G03 X-#Radius R#Radius G01 Y[-#YDist/2] G03 X2. R2. G01 Y0. G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05. M30

On the next line the tool moves back to Y0. Then we turn Cutter Comp off. To define this move, Change the X1.5 to X#Radius#TNR-0.1) and the Y1. to Y(#YDist/2).

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G#WrkOfset G00 X0. Y0. S#SpdleRpm M03 G43 H#ToolNo Z1. M08 Z0.1 G01 Z#Zdepth F#Feedrate G41 X[#Radius-#TNR-0.1] X#Radius Y0. Y[#YDist/2] G03 X-#Radius R#Radius G01 Y[-#YDist/2] G03 X#Radius R#Radius G01 Y0. G40 X1.5 Y1. G00 Z1. M09 G28 G91 Y0 Z0 M05. M30

This completes the CODE section. Copy the code into the created Template Builder section you have been working on. You will need to make sure that every line is enclosed in parentheses.

G17 G40 G49 G64 G80 G98 T#ToolNo M06 G90 G#WrkOfset G00 X0. Y0. S#SpdleRpm M03 G43 H#ToolNo Z1. M08 Z0.1 G01 Z#Zdepth F#Feedrate G41 X[#Radius-#TNR-0.1] X#Radius Y0. Y[#YDist/2] G03 X-#Radius R#Radius G01 Y[-#YDist/2] G03 X#Radius R#Radius G01 Y0. G40 X[#Radius-#TNR-0.1] Y[#YDist/2] G00 Z1. M09 G28 G91 Y0 Z0 M05. M30

Add percent signs at the top and bottom of the file and add a program number.

% O09997 N2000 (CATEGORY) (NAME CUSTOM) N2100 (TEMPLATE) (NAME ID w Radius) (DIAGRAM) (LINE [0,0] [40,0]) (CENTER LINES) (LINE [0,0] [0,37]) (DATUM [19,17]) (LINE [13,10] [13,24]) (LINE [25,10] [25,24]) (CW [13,24] [25,24] 6) (CW [25,10] [13,10] 6) (ARROW [19,24] [19,29]) (ARROW [27,19] [27,24]) (ARROW [27,16] [27,10]) (LINE [18,24][20,24]) (LINE [26,24] [28,24]) (LINE [26,12] [28,12]) (END DIAGRAM) (PARAMETERS) (#ToolNo) (NO DECIMAL) (#TNR) (#WrkOfset) (NO DECIMAL) (#Radius) (POSITION [17,23]) (#SpdleRpm ) (NO DECIMAL) (#Zdepth) (#YDist) (POSITION [26,17]) (#Feedrate) (END PARAMETERS) (GCODE) (G17 G40 G49 G64 G80 G98) (T#ToolNo M06) (G90 G#WrkOfset G00 X0. Y0.) (S#SpdleRpm M03) (G43 H#ToolNo Z1. M08) (Z0.1) (G01 Z#Zdepth F#Feedrate) (G41 X[#Radius-#TNR-0.1]) (X#Radius Y0.) (Y[#YDist/2]) (G03 X-#Radius R#Radius) (G01 Y[-#YDist/2]) (G03 X#Radius R#Radius) (G01 Y0.) (G40 X[#Radius-#TNR-0.1] Y[#YDist/2]) (G00 Z1. M09) (G28 G91 Y0 Z0 M05) (M30) (END GCODE) (END TEMPLATE) (END CATEGORY) %

VQC for PC

Test your program using the Template Checker in VQC for PC.

Select the Program dropdown and then select VQC Template Checker.

Template Checker
You can enter the name of your file in the TEMPLATE NAME block or press F3 for a directory. Press <F3>.

Scroll through the directory and find your file name. Press <Enter> to select the file.

The file will now appear in the block for TEMPLATE NAME. Press <Enter> to run the Checker.

N2000.TXT

If there is an error, it will show what the error is and the line number where it is located. It will not show all the errors at once. Make corrections with a text editor (there is a menu selection for one in the VQC for PC) and run the checker again.

Before you run the checker again on an edited file, make sure you have closed the file in the text editor.

If everything is O.K. you will get this message. Close the window by pressing <ESC> and return to the basic program.

Press <F2> to select your new template. Arrow down until you find it and press <Enter>.

N2000.txt

You should see your template name on the right. Press <Enter>

You should see the template diagram in the left corner and the name at the bottom right. Press <Enter>

Look at the template diagram and make sure everything looks right. If you need to make adjustments (like the length of the arrow) make the corrections in a text editor and run the template again.

Once you are satisfied with how the template looks, enter some data and check the program output. Then try it out on a Control in Graphics Mode.

Instead of using the Template Builder, you could just draw a sketch on some graph paper, or use a drawing or CAD program. Making the drawing on a graph will help you to plot the points. You could then use the sample program in this presentation or the Manual to help you construct the necessary code.

Prepared by Haas Automation Training Department Oxnard, CA 93030

You might also like