|
global mom_kin_machine_type% G( W- r' B2 h' |; M1 y
global mom_kin_4th_axis_type mom_kin_4th_axis_plane
# ~ M9 b' j# |6 Q) L# i global mom_kin_5th_axis_type$ H9 _# D. {( ~
global mom_tool_axis mom_sys_spindle_axis mom_kin_spindle_axis3 `- z2 S" g1 T: n! ]
global mom_pos6 w# q: S2 X1 T; F% Q! z
global mom_cycle_spindle_axis mom_cutcom_plane mom_pos_arc_plane# W. P3 `' W0 K# _
6 l4 o; J8 ~/ {% O7 H Q0 d3 c, H& G3 |7 ?
# Default cycle spindle axis to Z
. a7 o: l& s4 |! K set mom_cycle_spindle_axis 2
( E1 [ Q# d. I5 R; @+ W0 g$ X( y! T; ]- {# C9 }. T" v
! d% U8 F9 Z! R8 p1 t( @ if { ![string match "*3_axis_mill*" $mom_kin_machine_type] } {
8 C1 u, V( j# y; h6 j0 }/ {0 n
) A1 a$ `: d! V if { $mom_kin_4th_axis_type == "Head" } { Q- n: {. H& Q5 ~/ Y4 z& G
8 O# K# d) L, H if [EQ_is_equal [expr abs($mom_tool_axis(0))] 1.0] {
; b0 r6 l# T7 L4 m/ V set mom_cycle_spindle_axis 0
0 Q+ c$ ^0 Q" S$ T }
/ M8 E) J- |" C; e, T/ Q. f2 r4 V
1 D9 G( h7 R8 }& N if [EQ_is_equal [expr abs($mom_tool_axis(1))] 1.0] {
0 X8 H6 |7 O( { U( K/ s2 t6 p$ q set mom_cycle_spindle_axis 1
4 \6 r9 c" Q U& Q% L8 m; W: ^ }
- G: z. q3 t4 k7 v# s! I& J" f
! d- b' L, \1 C8 o if { $mom_kin_5th_axis_type == "Table" } {9 `; s2 z; U! o5 h% ]
; {5 ], n7 K; \/ H6 N# q8 p
if { [EQ_is_equal [expr abs($mom_pos(3))] 90.0] || [EQ_is_equal [expr abs($mom_pos(3))] 270.0] } {4 B4 g5 l# ~0 A! }% s
. W9 L' Y& J& z switch $mom_kin_4th_axis_plane {
- S. e% Y# N9 U5 \% s "YZ" {
) n: ?2 u" M. ]% b' B set mom_cycle_spindle_axis 1
2 Q3 ^- G. U9 z) j0 J5 D }' L0 t/ \- a Y8 V4 h8 ]) k
"ZX" {+ L+ ]6 x/ v' s7 M. o+ t2 S; ^
set mom_cycle_spindle_axis 02 K5 s1 i2 x9 J8 Y! P
}9 Z7 x6 ^2 D( J x
}% ?4 X8 ^; Q) r# K
}
: G9 |2 t) s# B9 F p1 L; {2 m }% {- K+ N& L7 |- I X. l
}
% S( R/ T/ D; t }
# q% {, d$ ^% _7 f- B8 l* i
' G5 O1 H! D" `' h- k s: d" S) _( v. i1 }, {5 E' N: Q
switch $mom_cycle_spindle_axis {
: _. ^5 ?0 a, n4 H, O1 V 0 {
$ C: s# P9 ]) u* j set mom_cutcom_plane YZ
9 r7 E/ F* \4 s( P1 K* k set mom_pos_arc_plane YZ
1 G& c6 X( `, C9 f& X2 V o set principal_axis X
( U5 y. x1 r# L9 W& } n9 r, ~ }
, m! P0 @( Q$ X7 ^; } 1 {
, m2 v% Q+ R$ M- @ set mom_cutcom_plane ZX; a) V8 s5 q9 H" Y+ m
set mom_pos_arc_plane ZX) S$ c C# g7 z9 u. k/ ]
set principal_axis Y
5 h" V5 Y( B2 B" S }
5 e) T7 s) Y/ c9 N8 V5 G. r 2 {/ p9 D2 v4 E6 r2 _5 J# e0 g
set mom_cutcom_plane XY2 w: h& S+ w4 m4 j% Z3 [9 Y: f
set mom_pos_arc_plane XY5 K5 [2 Z4 [& d
set principal_axis Z
, u t& {! Y' t }
! {8 S& @& V( |# o; m! g9 U# c default {2 n, V! c0 x6 y* E; |9 J4 ]2 Z+ f
set mom_cutcom_plane UNDEFINED3 ]& ?: e+ N* M( t& o& T) d
set mom_pos_arc_plane UNDEFINED
: R6 q2 @3 ]+ F set principal_axis ""
C9 v5 w5 L! P- M S U }
$ O: T6 k. e% s9 Q. T }5 p! i: n; ?% g# r& _6 E
/ k$ Z' y7 ?1 f8 q7 O. q3 P, P5 i
* A% R* ^6 u: X3 T; W, g if { $suppress_principal_axis && [string length $principal_axis] > 0 } {
7 @' X4 ^2 ^ A# S1 a- A2 Z- @ MOM_suppress once $principal_axis7 o) f: R2 T; L+ U
}& Q" L! m7 ]; h
$ O4 }5 q: x, I; W+ v: o
* n2 c9 e) S6 i: { u# ]' _4 a/ ]( |% v
if { $force_plane_code } {, x$ f p8 _% l$ @+ p5 K5 u' W0 I
global cycle_init_flag
# j0 j. V$ z; g6 W+ V3 ^4 X1 q' Z: h0 x" J S0 o' A; I
if { [info exists cycle_init_flag] && [string match "TRUE" $cycle_init_flag] } {. y/ j: T! X; e/ K
MOM_force once G_plane
2 g3 f4 F) \4 Q }$ y- r! T' f) L% g4 m7 n1 T
} |
|