|
|
global mom_kin_machine_type
F# E6 Y$ j0 ?1 w( r H4 a global mom_kin_4th_axis_type mom_kin_4th_axis_plane; `7 y) ?3 L7 s2 q. l! j6 U
global mom_kin_5th_axis_type3 L5 s( W5 ?5 }% ~2 e/ d3 `$ f! H$ z1 I, h
global mom_tool_axis mom_sys_spindle_axis mom_kin_spindle_axis2 i9 ~5 {8 C% I$ L7 T
global mom_pos
t1 F6 |1 n3 Q% A! D2 Z global mom_cycle_spindle_axis mom_cutcom_plane mom_pos_arc_plane( b$ @ C% g4 ]6 \+ _0 L4 }
! f$ T' G) Z+ {: R0 {4 t4 y' \- I8 K6 K( R
# Default cycle spindle axis to Z6 c5 S/ ?; G2 m+ Q- H9 q; D
set mom_cycle_spindle_axis 2
+ ^1 Z5 b! m+ j5 k" \# `& F" n. U+ S' X$ [
; `! ~& v3 X9 ~3 g if { ![string match "*3_axis_mill*" $mom_kin_machine_type] } {
$ f; J* k" R$ I" S4 Q% t' e
& M+ N/ ?; e4 K4 w8 a1 F7 y& W if { $mom_kin_4th_axis_type == "Head" } {
) Y) |& f, F0 S1 e& V5 K2 v: I) x" Q4 @+ r6 C! p0 @. a
if [EQ_is_equal [expr abs($mom_tool_axis(0))] 1.0] {
; Q9 _ X0 {6 k/ _: Y6 n# m8 ? set mom_cycle_spindle_axis 0) X' |5 X D5 x6 d# v
}4 C, t7 K9 U7 d" ^
- n# n1 f" K$ |3 Y; Z
if [EQ_is_equal [expr abs($mom_tool_axis(1))] 1.0] {
# p8 }3 a% O* e set mom_cycle_spindle_axis 1
4 {% \, y0 w0 u0 h6 Z9 K& i& r }
# O2 J, A7 G% D2 M R8 B! o
% u8 t9 d4 g* n1 Q- J* y3 O& _ if { $mom_kin_5th_axis_type == "Table" } {
% T! ?; L5 c5 w6 `% a& x! S* k
/ g; z# g4 b% j/ }7 [ if { [EQ_is_equal [expr abs($mom_pos(3))] 90.0] || [EQ_is_equal [expr abs($mom_pos(3))] 270.0] } {
/ }4 T5 p( v& m0 v" g" x6 D
; x6 [% d# a! `# [, T' Z: A+ m/ n switch $mom_kin_4th_axis_plane {
/ Y' V& @- H9 C P. c# F1 q "YZ" {8 k. F. N4 r [/ y8 P
set mom_cycle_spindle_axis 1
2 q$ p! } B! m7 N. y3 @+ Y }7 b5 ^8 h. Z7 p7 T/ A
"ZX" {
& l3 ]$ e$ W5 K8 p set mom_cycle_spindle_axis 0
3 z. r( E# e, b' v9 L. r8 M }
9 G9 c4 n9 d5 w2 s" A }
0 C3 O4 x6 ?$ U }
' }" W* s9 M4 z' [5 \9 m# X+ _6 I }
: a' D6 c# e6 K0 Q) w6 ? }
1 p2 q' s: I% u' ]7 ?/ N }7 K+ {5 k/ E' I$ t! s0 L
3 M" Q/ m& Q+ u% \! g5 A R6 V0 a! M8 M0 e* c$ u9 P
switch $mom_cycle_spindle_axis {( u9 ^! [! A% Z
0 {
$ ]1 i6 k4 r8 ^ set mom_cutcom_plane YZ4 H4 r. {8 a" i X
set mom_pos_arc_plane YZ+ Q8 _, H+ m0 @) M& r4 l/ h
set principal_axis X
' \+ g" d5 t/ P$ s }% c# ~ ]. U$ B- [; W: p# l, v
1 {
1 F! A/ f& w& `2 c: ^- C* X set mom_cutcom_plane ZX
2 q" d* i, z1 S# b% q k set mom_pos_arc_plane ZX1 k; |$ @; w$ C4 X8 V2 _
set principal_axis Y
, l9 ?/ v% {7 I, ^( ` }' C% |8 [. W" a0 n; F- k& ~3 r
2 {% Y. [7 q G& _& ^0 L: u# p# q$ ]5 x
set mom_cutcom_plane XY
7 c9 Y5 u8 G0 j: p( `: I set mom_pos_arc_plane XY
\# }' B6 e) @3 z0 i set principal_axis Z( A7 I1 w8 l# h. n6 Q7 d
}
: {( o* F2 |& b" C+ { default {
v, l/ j; s l1 O& U set mom_cutcom_plane UNDEFINED) ~9 t7 P% S/ t
set mom_pos_arc_plane UNDEFINED# O( [/ L$ G+ F# S- M" ^/ C! S; d) q
set principal_axis "", D2 I `( _$ s3 \, w1 D
}
+ n, m1 O: J. @5 J) Y5 z% e }1 Q/ i3 K7 w( J# g% V
1 @& }$ ]7 F, J1 }& t% j& V6 d: E4 m# g
if { $suppress_principal_axis && [string length $principal_axis] > 0 } {, f9 ~% c6 `7 S7 W: ^
MOM_suppress once $principal_axis" ]' O4 N$ X% i- S4 h
}7 c0 g, C7 G9 s, z
' `/ ^# v2 w" w" [0 d" B
# d$ q+ H! a, Y. O( M
if { $force_plane_code } {
2 f+ {/ ^* J" G5 T" d global cycle_init_flag
: ~/ q. A- M; D! {5 I4 {. U, t! X1 R K" C' o7 z# m s8 U
if { [info exists cycle_init_flag] && [string match "TRUE" $cycle_init_flag] } {
0 F1 z1 t( S. t% ^4 z) X! u @ MOM_force once G_plane
2 n+ l# e5 k9 S( ? }
! V1 Y5 o! t9 a: _4 R } |
|