Thread: parametric program for spiral helical interpolation

1. Originally Posted by fordav11
there are many G-code gurus here but you'll be lucky to find any Fanuc G-code programmer who is interested in Siemens/Heidenhain.
I wrote something like this (internal tapered thread milling) in Fanuc macro for a Fanuc 6M mill that didn't have helical interpolation about 25 years ago as an apprentice in about 20 lines..... much much easier to understand and far less complicated. Maybe I'll post it if there's interest.
Why is that that a fanuc programmer wouldn't be interested in Siemens/Heidenhain?

If you have a 20 line program please post it would like to see how easy it is.

2. Originally Posted by sinha_nsit
See the attachment for a simple algorithm.
The given program would not work on your control, however.
Here is a quick translation of your supplied program written in HDH.

1 Q20 = 10 ;NUMBER OF TURNS
2 Q19 = 50 ;START RADIUS
3 Q8 = 40 ;END RADIUS
4 Q7 = 30 ;TOTAL DEPTH
5 Q1 = 45 ;START ANGLE X AXIS
6 Q17 = 1 ;INCREMENT IN ANGLE
7 Q9 = 60 ;FEEDRATE
8 ;
9 FN 12: IF +Q19 LT +0 GOTO LBL "ERROR" ; (NEGATIVE START RADIUS)
10 FN 12: IF +Q8 LT +0 GOTO LBL "ERROR" ; (NEGATIVE END RADIUS)
11 FN 12: IF +Q20 LT +0 GOTO LBL "ERROR" ; (NEGATIVE NUMBER OF TURNS)
12 ;
13 FN 18: SYSREAD Q50 = ID270 NR1 IDX1 ; (Current X-position determined)
14 FN 18: SYSREAD Q51 = ID270 NR1 IDX2 ; (Current Y-position determined)
15 FN 18: SYSREAD Q52 = ID270 NR1 IDX3 ; (Current Z-position determined.
16 Q53 = Q50 - Q19 * COS ( Q1 )
17 Q54 = Q51 - Q19 * SIN ( Q1 )
18 Q55 = Q17 ;
19 Q56 = Q55 ;
20 ;
21 LBL "BEGIN"
22 Q61 = ABS Q56
23 Q62 = 360 * Q20
24 FN 9: IF +Q61 EQU +Q62 GOTO LBL "END"
25 FN 12: IF +Q61 LT +Q62 GOTO LBL "END"
26 Q57 = Q19 ( ( Q19 - Q8 ) * ABS Q56 / ( 360 * Q20 ) )
27 Q58 = Q53 + Q57 * COS ( Q1 + Q56 )
28 Q59 = Q54 + Q57 * SIN ( Q1 + Q56 )
29 Q60 = Q52 + ( Q7 * ABS Q56 / ( 360 * Q20 ) )
30 L X+Q58 Y+Q59 Z+Q60 FQ9
31 Q56 = Q56 + Q55
32 FN 9: IF +0 EQU +0 GOTO LBL "BEGIN"
33 ;
34 LBL "ERROR"
35 ;ERROR IN PROGRAM
36 STOP
37 LBL "END"

Page 3 of 3 First 123