Heidenhain Q Defs

Q DEFS or Q Parameters
Q Defs allow you to program using variables instead of fixed numerical values, you can mix Q Defs and fixed numerical values iwithin a program.

 

Q Defs can represent information such as Coordinate values, RPM, Feed rates, Cycl data, Mathamatical Functions.

Q Def Example 1
You have to Bore 2 80mm Dia Holes in a 50mm Thick Plate, you drill the holes with the largest drill available say a 30mm drill.

Solution 1 is to use cycle 5 Circular pocket, but you will be machining fresh air in the 30mm hole so wasting machining time.

Solution 2 is to Spiral mill the hole, In this example no radius oversize allowance has been used so older controls can use thiis example, If using radius oversize allowance make Q3 40 mm.

The best way to use this program is to use cycle 12 PGM Call go to your positions and use cycle call, if your next job requires 90mm Bore 25mm deep change Q1 to 25 and Q3 to 45.

0 BEGIN PGM SPIRALPL MM
1 FN 0: Q1 = +50 ; DEPTH
2 FN 0: Q2 = +1 ; DEPTH PER ROTATION
3 FN 0: Q3 = +40 ; RAD
4 FN 0: Q4 = +0
5 CC IX+0 IY+0
6 L Z+1 R0 F7200
7 L Z+0 R0 F150
8 L IX+Q3 RL F1500
9 LBL 1
10 FN 1: Q4 = +Q4 + +Q2
11 CP IPA+360 Z-Q4 DR+ F1000
12 FN 12: IF +Q4 LT +Q1 GOTO LBL 1
13 CP IPA+360 DR+ RL F1000
14 L IX-Q3 R0
15 L Z+60 R0 F7200
16 END PGM SPIRALPL MM

 

Q Def Example 2
This example is used to mill a slot 8 mm deep 1mm increments.

0 BEGIN PGM QPROFILE MM
1 BLK FORM 0.1 Z X-100 Y-200 Z-10
2 BLK FORM 0.2 X+110 Y+0 Z+0
3 TOOL DEF 8
4 TOOL CALL 8 Z S3000
5 L M6
6 FN 0: Q1 = +0
7 FN 0: Q2 = +1
8 FN 0: Q3 = +8
9 L X+99.715 Y-150.777 Z+1 R0 F7500 M3
10 LBL 2
11 L X+99.715 Y-150.777 R0 F7500
12 L Z-Q1 R0 F50
13 L X+107.501 Y-152.617 RL F500
14 CC X+99.715 Y-150.777
15 C X+91.93 Y-148.938 DR+ RL F500
16 L X+77.281 Y-210.942 RL F500
17 CC X+85.066 Y-212.781
18 C X+92.852 Y-214.62 DR+ RL F500
19 L X+107.501 Y-152.617
20 L X+99.715 Y-150.777 R0
21 FN 1: Q1 = +Q1 + +Q2
22 FN 9: IF +Q1 EQU +Q3 GOTO LBL 2
23 FN 12: IF +Q1 LT +Q3 GOTO LBL 2
24 L Z+2 R0 F7500
25 L Z+250 R0 F7200 M5
26 END PGM QPROFILE MM