|
|
发表于 2020-8-8 16:45:51
|
显示全部楼层
global mom_kin_machine_type- m3 c( C! ?9 p* ^" k
global mom_kin_4th_axis_type mom_kin_4th_axis_plane' m Z1 j( f2 g ]; x s, `' ]
global mom_kin_5th_axis_type
* O% C" t0 o( Z2 o: w global mom_tool_axis mom_sys_spindle_axis mom_kin_spindle_axis
$ A& q8 l) r' P2 l global mom_pos. U% M3 O/ H( |2 j0 {6 s( O
global mom_cycle_spindle_axis mom_cutcom_plane mom_pos_arc_plane
: D* {# C* F9 d7 @: a( p
* s+ Y) U3 l+ ]& C: Q
* z& q# l) `# \, Q1 [( L # Default cycle spindle axis to Z4 [9 g1 h, B9 Q$ E* g2 n4 P
set mom_cycle_spindle_axis 2
- I) s" I& c, X; N4 O. W" H @$ W' l
1 R3 C, H! N' C3 |% G+ o) i if { ![string match "*3_axis_mill*" $mom_kin_machine_type] } {
# f+ @. I7 F' S& P# E) G6 v# k+ C, W1 }& z3 d* W
if { $mom_kin_4th_axis_type == "Head" } {4 t; ?3 k" t- S' X: G( P4 y
# u6 b7 M. d( Z$ n if [EQ_is_equal [expr abs($mom_tool_axis(0))] 1.0] {( G. C7 |% D% V
set mom_cycle_spindle_axis 0
5 E0 W6 T5 T/ w) Q5 R8 k }
3 w, a M' V$ r( g6 t* y+ k$ i/ s( Q3 {3 v1 n! x& U- l
if [EQ_is_equal [expr abs($mom_tool_axis(1))] 1.0] {
& {' V) l. `# l6 Q# Z2 w; Z5 [ set mom_cycle_spindle_axis 1 O1 R- O6 M; ]) Q3 f& ^
}
0 O) c- s+ c% s4 o! x
3 Q7 l+ Y: J7 Q. s$ Y if { $mom_kin_5th_axis_type == "Table" } {( H5 `8 `, s# E1 H
, ]* i2 q1 y$ B
if { [EQ_is_equal [expr abs($mom_pos(3))] 90.0] || [EQ_is_equal [expr abs($mom_pos(3))] 270.0] } {
7 A4 R) r% o6 }- [4 K3 }% |( S7 f- O6 N2 v
switch $mom_kin_4th_axis_plane {
5 C4 W. R1 q. I5 P) |! y+ S# I "YZ" {/ A* w6 _5 E" _/ C5 [9 u) \# c
set mom_cycle_spindle_axis 1
3 j" s. n% Q% b- |2 x) R }$ ?; a) C! {$ T% y2 P) B6 L0 c; W
"ZX" {
" B% {* o; v2 ~! B% [+ P( c" { set mom_cycle_spindle_axis 0/ b! n _' V3 W3 ]) ]' T/ W7 ]. g
}
5 R% T+ b' T) r- y |+ G }" _) r3 Q: x3 g/ S7 X) s. w
}1 C+ z3 Z% z! o8 R+ x5 Y# C" e, U: m
}: ~( d% `. T# i* c3 I6 S' R6 l
}
) g) F) _1 L' d3 G) c: B }% }6 A' I/ ^+ V, V$ `
5 C9 L, G) b S: T
5 j& A& [- K" a3 n1 n( i& Q' w
switch $mom_cycle_spindle_axis {# q8 h6 |7 t* u
0 {7 D# m. e7 d8 J) w
set mom_cutcom_plane YZ
4 M* A( s7 d1 x2 y% A4 Z9 C9 c& }9 f set mom_pos_arc_plane YZ6 V7 d, T2 }" M& ?7 F) \
set principal_axis X: G* E, t7 D7 P F9 r
}
+ z7 N6 B$ V# j/ R 1 {
# \& S0 l1 f; A# ]2 z3 A set mom_cutcom_plane ZX
0 Z; b2 E' ~' e) E0 k set mom_pos_arc_plane ZX; B" r- [& v) ~
set principal_axis Y# i* [' l1 r" N5 u
}
7 O2 o3 ^# s+ B; T9 a 2 {: j" M& E' `0 `; Q$ s7 h/ ~
set mom_cutcom_plane XY1 h* F5 r8 B0 l: t& N( I+ d8 n, B
set mom_pos_arc_plane XY. f9 {2 u1 }9 ]( p6 d- N
set principal_axis Z
( N& O4 Q2 Z# F, C6 _ }. p4 W6 A! _$ m$ l( k. S" R
default {; Q# W0 ]& M9 Y
set mom_cutcom_plane UNDEFINED
5 G, Z: T2 O6 ~# e set mom_pos_arc_plane UNDEFINED- l* H! P; T+ q
set principal_axis "". N; M' `8 D0 w
}
5 t" g+ k/ ]/ P& a& P# w }
8 G; x9 Y" x, I# V% N) u4 q, X# i0 L5 @. } [5 {1 O
8 B Z) j7 f7 I if { $suppress_principal_axis && [string length $principal_axis] > 0 } {
+ y9 J9 }' |& X. \+ }/ q MOM_suppress once $principal_axis
& i3 C. Z' {# C. [ }
3 T' y6 l9 V0 X7 C$ h$ q
. @( v" r. q6 w# X1 C I9 P1 x" N" {
0 J* v, n7 Z9 }7 \5 @5 O1 T if { $force_plane_code } {4 {8 A9 N" q2 t
global cycle_init_flag
) r) z+ r1 x0 T6 r: X0 o) C3 }
# h& s1 o9 ? t, n if { [info exists cycle_init_flag] && [string match "TRUE" $cycle_init_flag] } {
& k$ Q$ x" {1 _' W MOM_force once G_plane
0 I* U9 J* T- l }
! e4 W$ I3 T! b/ | a: g1 v- k } |
|