|
global mom_kin_machine_type
$ f) }: c' I1 n5 Z* O/ |5 `! v$ x: C global mom_kin_4th_axis_type mom_kin_4th_axis_plane i4 r& j# H8 `- I
global mom_kin_5th_axis_type
. k1 X% N# v! T7 Q global mom_tool_axis mom_sys_spindle_axis mom_kin_spindle_axis
) j6 h2 F! `) U1 a global mom_pos
( [, G* [6 L3 `% J$ ^ global mom_cycle_spindle_axis mom_cutcom_plane mom_pos_arc_plane
2 ^; }. Y8 g E+ \1 e* W4 r/ @, E" s( }" k# i0 F% z
U, _. r' e+ p # Default cycle spindle axis to Z& h/ _' I9 s9 J3 h) O% v
set mom_cycle_spindle_axis 2( C2 \/ m6 P( |. B
. k3 U/ q9 ] @1 |3 z2 o- c
c, j+ U# v$ E$ m- b; ` if { ![string match "*3_axis_mill*" $mom_kin_machine_type] } {/ ^( s' M M4 g8 O% A
) D1 s, X7 x1 d# Z8 A if { $mom_kin_4th_axis_type == "Head" } {3 }% x# R/ J; X
; Q7 X+ c ^9 c: z$ m6 S; o
if [EQ_is_equal [expr abs($mom_tool_axis(0))] 1.0] {
6 s7 d! F/ A1 H set mom_cycle_spindle_axis 0
( C1 E) t8 A( c }
; m% B+ U5 u# |" y
* O; F# ]7 F& N K7 S9 l, H if [EQ_is_equal [expr abs($mom_tool_axis(1))] 1.0] {. F' h: y, |$ |& F
set mom_cycle_spindle_axis 12 A( K3 v' E3 A/ {
}1 C4 `% S% x* i- B( R
- N t# x; ^. u3 t if { $mom_kin_5th_axis_type == "Table" } {
1 l+ {. G5 `+ \0 S' X# W/ K' [2 n$ c* T
if { [EQ_is_equal [expr abs($mom_pos(3))] 90.0] || [EQ_is_equal [expr abs($mom_pos(3))] 270.0] } {
$ c. h6 Q+ c7 L0 n' N3 _# w
5 a, E1 Y8 a4 l switch $mom_kin_4th_axis_plane {
( [! F. L$ n5 ~: m7 T "YZ" {
3 T7 } {3 Q# w7 e set mom_cycle_spindle_axis 1
# e/ D* g* ]% f7 k }
0 A# P3 ?' n: Z "ZX" {
4 }- i/ T' `' [% U% v4 m' | set mom_cycle_spindle_axis 0
# t: p8 J+ O8 b; u }
5 Y) S7 J4 U# y2 n }
9 b+ E1 B! h9 N7 L4 l }6 G+ f: a7 T, v# G& {; `
}
" x2 e ^: ]* O& k, \7 E$ P }( n7 [% S D5 _8 E: A
}
: d$ m* B3 y6 q8 f" [
) c) M: ?) j1 ^' L0 V( T' G3 u' k5 l0 n a$ G3 e/ n5 X% |5 u
switch $mom_cycle_spindle_axis {# c# r4 I/ s( K& P4 Z+ Q! e% x
0 {" w) [' g2 j! j0 R- N1 U7 B7 z c
set mom_cutcom_plane YZ/ |9 k3 A) k6 r
set mom_pos_arc_plane YZ
: q& p6 V- c; Y5 ^" q6 E( ] set principal_axis X
+ C$ G$ J1 d0 X9 p; g }
2 D9 i/ A! ^, C6 A6 B* O. B! L, u 1 {1 I8 t5 O8 b3 n6 u1 g3 z$ I! G
set mom_cutcom_plane ZX7 [# F+ w% z: c$ A% s) |
set mom_pos_arc_plane ZX5 E' o7 a) W( `
set principal_axis Y
. [6 l" J& P# F& B3 k9 A5 F }
/ [! }& ~% T9 P# q$ C' a% D 2 {
* T) Q5 L2 ?5 T) T& |8 ~ set mom_cutcom_plane XY
$ J3 Z: D f. k2 P set mom_pos_arc_plane XY* r! V1 |. l6 a$ ^& P( h; Z* n
set principal_axis Z
8 C/ Q. N0 R+ x% a# t# r }
& @/ [# ~" N* n' H4 s default {
: Y$ e6 @- l- a( M1 V/ @ set mom_cutcom_plane UNDEFINED
) \! k' ~1 Q: p5 x, O set mom_pos_arc_plane UNDEFINED% M5 p% \/ |. Z+ a. b2 Q2 ~
set principal_axis ""
2 ~: s( j4 f9 j; L" h( a3 J+ @ }
) n% }- Y5 D0 l' C# D1 B }8 ^8 \! N% } y. r0 n
u% \4 |7 H; Z& c6 L: @
+ e+ `8 D, I1 H+ L5 T# x
if { $suppress_principal_axis && [string length $principal_axis] > 0 } {4 t! h5 Y) Y8 v2 D% M' f, \
MOM_suppress once $principal_axis
0 H. @6 s: X6 L }2 c L# a8 a" f5 [+ C
5 @( _) _/ v1 {/ l4 g% u0 D
* z6 y( n) v7 R8 J" z7 j if { $force_plane_code } {- I. o T% `- E3 B7 k( Y, E. t
global cycle_init_flag% C3 E5 T E8 H6 ^3 @
/ w0 h, ~: J% z/ \" X1 I if { [info exists cycle_init_flag] && [string match "TRUE" $cycle_init_flag] } {7 x8 W) y9 S( K$ D
MOM_force once G_plane5 o4 Y) q( r. \9 Z
}
d8 _ o2 G+ e i9 t } |
|