beautypg.com

HEIDENHAIN TNC 360 User Manual User Manual

Page 152

background image

TNC 360

7-18

7

Programming with Q Parameters

20 LBL 10
21 CYCL DEF 7.0 DATUM SHIFT
22 CYCL DEF 7.1 X+Q1
23 CYCL DEF 7.2 Y+Q2 ............................................. Shift datum to center of ellipse
24 CYCL DEF 10.0 ROTATION
25 CYCL DEF 10.1 ROT +Q8 ..................................... Activate rotation, if Q8 is loaded
26 FN2: Q35 = +Q6 – +Q5 ........................................ Calculate angle increment (end angle to start angle

divided by number of steps)

27 FN4: Q35 = +Q35 DIV +Q7 .................................. Current angle for calculation =

set start angle

28 FN0: Q36 = +Q5 ................................................... Set counter for milled steps
29 FN0: Q37 = +0 ...................................................... Call subprogram for calculating the points of the ellipse
30 CALL LBL 11 REP ................................................. Call subprogram for calculating the points of the ellipse
31 L X+Q21 Y+Q22 R0 F MAX M03 ......................... Move to start point in the plane
32 L Z+Q12 R0 F MAX M .......................................... Rapid traverse in Z to setup clearance
33 L Z–Q9 R0 FQ10 M ............................................... Plunge to milling depth at plunging feed rate

34 LBL 1
35 FN1: Q36 = +Q36 + +Q35 .................................... Update the angle
36 FN1: Q37 = +Q37 + +1 ........................................ Update the counter
37 CALL LBL11 REP .................................................. Call subprogram for calculating the points of the ellipse
38 L X+Q21 Y+Q22 R0 FQ11 M ................................ Move to next point
39 FN 12: IF +Q37 LT +Q7 GOTO LBL 1 .................. Unfinished?

40 CYCL DEF 10.0 ROTATION
41 CYCL DEF 10.1 ROT+0 ......................................... Reset rotation
42 CYCL DEF 7.0 DATUM SHIFT
43 CYCL DEF 7.1 X+0
44 CYCL DEF 7.2 Y+0 ................................................ Reset datum shift
45 L Z+Q12 R0 F MAX M .......................................... Move in Z to setup clearance
46 LBL 0 ..................................................................... End of subprogram for milling the ellipse

47 LBL 11
48 FN7: Q21 = COS + Q36
49 FN3: Q21 = +Q21* + Q3 ...................................... Calculate X coordinate
50 FN6: Q22 = SIN + Q36
51 FN3: Q22 = +Q22 * +Q4 ...................................... Calculate Y coordinate
52 LBL 0
53 END PGM 360079 MM

7.8

Examples for Exercise