CAIXA RECTANGULAR COM INCLINAÇÃO – HEIDENHAIN

OBJECTIVO

Acabamento duma caixa rectangular com inclinação (“saída”) igual em todas as paredes.
Garantia da profundidade exacta, independentemente dos valores iniciais e finais de Z, e do incremento programado, utilizando técnicas de salto.

HIPÓTESE 1

Condição de igualdade, a actuar depois da redefinição do valor da profundidade – Q0

0 BEGIN PGM 889 MM
1 FN 0 : Q0 = +0.000 Z inicial
2 FN 0 : Q1 = +1.000 Incremento
3 FN 0 : Q2 = +23.500 Z final
4 FN 0 : Q3 = +10.000 Inclinação
5 TOOL DEF 1 L+0.000 R+5.000
6 TOOL CALL 1 Z S 1000.000
7 FN 6 : Q4 = SIN +Q3 ( Heidenhain 155 / 355 )
8 FN 7 : Q5 = COS +Q3 Cálculo da tangente da inclinação
9 FN 4 : Q6 = +Q4 DIV +Q5 Valor da tangente
10 L Z+10.000 R0 F9999 M03
11 L X+0.000 Y+0.000 R F M
12 LBL 1
13 FN 3 : Q10 = +Q0 * +Q6 Cálculo do “delta X” – ‘a’ no esquema
14 FN 2 : Q20 = +100.000 – +Q10 Valor absoluto de X ( Ver esquema )
15 FN 2 : Q30 = +80.000 – +Q10 Valor absoluto de Y ( Ver esquema )
16 L Z-Q0 R F M
17 L X+0.000 Y+Q30 RR F500 M
18 L X+Q20 R F M
19 L Y-Q30 R F M
20 L X-Q20 R F M
21 L Y+Q30 R F M
22 L X+0.000 R F M
23 L X+0.000 Y+0.000 R0 F9999 M
24 FN 9 : IF +Q0 EQU +Q2 GOTO LBL 3 Condição de igualdade para evitar “loop”
25 FN 1 : Q0 = +Q0 + +Q1 Incremento da profundidade
26 FN 11 : IF +Q0 GT +Q2 GOTO LBL 2 Salto condicional para ‘label’ de redefinição
27 CALL LBL 1 REP 9999 /9999 Salto incondicional ( Alternativa : Se 1=1 salta … )
28 LBL 2
29 FN 0 : Q0 = +Q2 Redefinição de Q0 para profundidade exacta
30 CALL LBL 1 REP 9999 /9999
31 LBL 3
32 L Z+20.000 R0 F9999 M30
33 END PGM 889 MM

Código NC não comentado

0 BEGIN PGM 889 MM
1 FN 0 : Q0 = +0.000
2 FN 0 : Q1 = +1.000
3 FN 0 : Q2 = +23.500
4 FN 0 : Q3 = +10.000
5 TOOL DEF 1 L+0.000 R+5.000
6 TOOL CALL 1 Z S 1000.000
7 FN 6 : Q4 = SIN +Q3
8 FN 7 : Q5 = COS +Q3
9 FN 4 : Q6 = +Q4 DIV +Q5
10 L Z+10.000 R0 F9999 M03
11 L X+0.000 Y+0.000 R F M
12 LBL 1
13 FN 3 : Q10 = +Q0 * +Q6
14 FN 2 : Q20 = +100.000 – +Q10
15 FN 2 : Q30 = +80.000 – +Q10
16 L Z-Q0 R F M
17 L X+0.000 Y+Q30 RR F500 M
18 L X+Q20 R F M
19 L Y-Q30 R F M
20 L X-Q20 R F M
21 L Y+Q30 R F M
22 L X+0.000 R F M
23 L X+0.000 Y+0.000 R0 F9999 M
24 FN 9 : IF +Q0 EQU +Q2 GOTO LBL 3
25 FN 1 : Q0 = +Q0 + +Q1
26 FN 11 : IF +Q0 GT +Q2 GOTO LBL 2
27 CALL LBL 1 REP 9999 /9999
28 LBL 2
29 FN 0 : Q0 = +Q2
30 CALL LBL 1 REP 9999 /9999
31 LBL 3
32 L Z+20.000 R0 F9999 M30
33 END PGM 889 MM

HIPÓTESE 2

Redefinição do número do ‘label’ de salto

0 BEGIN PGM 890 MM
1 FN 0 : Q0 = +0.000
2 FN 0 : Q1 = +1.000
3 FN 0 : Q2 = +23.500
4 FN 0 : Q3 = +10.000
5 FN 0 : Q50 = +2.000 Número do label para salto ( ver linha 26 )
6 TOOL DEF 1 L+0.000 R+5.000
7 TOOL CALL 1 Z S 1000.000
8 FN 6 : Q4 = SIN +Q3
9 FN 7 : Q5 = COS +Q3
10 FN 4 : Q6 = +Q4 DIV +Q5
11 L Z+10.000 R0 F9999 M03
12 L X+0.000 Y+0.000 R F M
13 LBL 1
14 FN 3 : Q10 = +Q0 * +Q6
15 FN 2 : Q20 = +100.000 – +Q10
16 FN 2 : Q30 = +80.000 – +Q10
17 L Z-Q0 R F M
18 L X+0.000 Y+Q30 RR F500 M
19 L X+Q20 R F M
20 L Y-Q30 R F M
21 L X-Q20 R F M
22 L Y+Q30 R F M
23 L X+0.000 R F M
24 L X+0.000 Y+0.000 R0 F9999 M
25 FN 1 : Q0 = +Q0 + +Q1
26 FN 11 : IF +Q0 GT +Q2 GOTO LBL Q50 Salto condicional para redefinição ou fim de programa
27 CALL LBL 1 REP 9999 /9999
28 LBL 2
29 FN 0 : Q0 = +Q2 Redefinição da profundidade exacta
30 FN 0 : Q50 = +3.000 Redefinição do número do ‘label’ de salto
31 CALL LBL 1 REP 9999 /9999
32 LBL 3
33 L Z+20.000 R0 F9999 M30
34 END PGM 890 MM

Código NC não comentado

0 BEGIN PGM 890 MM
1 FN 0 : Q0 = +0.000
2 FN 0 : Q1 = +1.000
3 FN 0 : Q2 = +23.500
4 FN 0 : Q3 = +10.000
5 FN 0 : Q50 = +2.000
6 TOOL DEF 1 L+0.000 R+5.000
7 TOOL CALL 1 Z S 1000.000
8 FN 6 : Q4 = SIN +Q3
9 FN 7 : Q5 = COS +Q3
10 FN 4 : Q6 = +Q4 DIV +Q5
11 L Z+10.000 R0 F9999 M03
12 L X+0.000 Y+0.000 R F M
13 LBL 1
14 FN 3 : Q10 = +Q0 * +Q6
15 FN 2 : Q20 = +100.000 – +Q10
16 FN 2 : Q30 = +80.000 – +Q10
17 L Z-Q0 R F M
18 L X+0.000 Y+Q30 RR F500 M
19 L X+Q20 R F M
20 L Y-Q30 R F M
21 L X-Q20 R F M
22 L Y+Q30 R F M
23 L X+0.000 R F M
24 L X+0.000 Y+0.000 R0 F9999 M
25 FN 1 : Q0 = +Q0 + +Q1
26 FN 11 : IF +Q0 GT +Q2 GOTO LBL Q50
27 CALL LBL 1 REP 9999 /9999
28 LBL 2
29 FN 0 : Q0 = +Q2
30 FN 0 : Q50 = +3.000
31 CALL LBL 1 REP 9999 /9999
32 LBL 3
33 L Z+20.000 R0 F9999 M30
34 END PGM 890 MM