|
发表于 2020-8-8 16:45:51
|
显示全部楼层
global mom_kin_machine_type
4 U" T* ^1 Q1 ^- l global mom_kin_4th_axis_type mom_kin_4th_axis_plane
6 `' y- E0 q( w# n3 H2 P. n global mom_kin_5th_axis_type% h! R: d9 i- j3 V8 u$ Q
global mom_tool_axis mom_sys_spindle_axis mom_kin_spindle_axis
; |4 Y- o2 O: J$ q$ m5 b- d global mom_pos$ W# T. B: n* [5 X
global mom_cycle_spindle_axis mom_cutcom_plane mom_pos_arc_plane
5 f$ x" o- j5 D' S* I$ Q! M
# V9 \, p, Y* _1 o
7 ]8 @9 O3 \9 F # Default cycle spindle axis to Z
6 g3 T9 C3 L w" U set mom_cycle_spindle_axis 2
- O2 k/ H7 w2 I, F" d& y) W. W7 E1 n
1 B9 ^7 r% S' z- V
if { ![string match "*3_axis_mill*" $mom_kin_machine_type] } {
! E! {: D7 y% Z% }- A9 Y& G: w$ x h' c" [/ ^' d
if { $mom_kin_4th_axis_type == "Head" } {
# p$ H0 s/ k% {9 l! R: X+ K1 O2 V, a4 J$ d& q
if [EQ_is_equal [expr abs($mom_tool_axis(0))] 1.0] {
" m, l6 E' [2 ~, I2 n8 Z: G0 V/ s set mom_cycle_spindle_axis 0
: U( r3 [! \# w/ K } J( C, b) K8 f6 \( |, e9 H* ~+ J
8 ?5 Q" |2 v( q
if [EQ_is_equal [expr abs($mom_tool_axis(1))] 1.0] {
3 N9 u$ S$ Y0 W7 C1 x set mom_cycle_spindle_axis 18 J1 i& z% b+ `& u% v
}- |2 ~) b- Z) d. b* i5 K8 @* J9 p
! F' p6 B5 [6 h! f9 L
if { $mom_kin_5th_axis_type == "Table" } {
/ p g. s( Y. u: Z) m, B9 U- f' j
if { [EQ_is_equal [expr abs($mom_pos(3))] 90.0] || [EQ_is_equal [expr abs($mom_pos(3))] 270.0] } {8 T' f. c3 i$ X4 m6 Z+ m) M
6 j5 G8 H: ^# b
switch $mom_kin_4th_axis_plane {, i. w, q+ R8 q; n7 C( E
"YZ" {
1 _' f! `+ p1 w* s1 q' Z set mom_cycle_spindle_axis 1
/ i$ |7 N% K! x! c }
. ]6 U8 Q- a- K) [ "ZX" {/ ~/ k6 a9 R! E, Y* h
set mom_cycle_spindle_axis 0, Q2 U/ z! v( E$ i1 A
}
7 X8 _" f0 P, }+ ^6 R }2 w+ H/ q1 }7 d/ _! ~% H8 F# ]
}
, j! ]+ P( {0 w, z }7 n+ L' L$ o K" O" L' F. M
}# J+ k" _ Y) c# Q
}& t( S" ]0 o# b; P: Y& a; f
5 m m8 G4 b) K( ]2 `
& ?' D( J& S3 P6 Y8 x switch $mom_cycle_spindle_axis {
0 h2 A! k- X4 J5 t- } 0 {, G: N$ M% R1 G3 r9 p! R5 d
set mom_cutcom_plane YZ2 B6 i; Q* h6 T g& q
set mom_pos_arc_plane YZ1 W8 D* W# p$ }7 H
set principal_axis X
! N, p Q' D4 k9 [1 e R }
) z2 r+ i ^2 K0 |4 a) J 1 {
) h, C- P% v, t- L set mom_cutcom_plane ZX
4 b0 S4 q4 D) ] set mom_pos_arc_plane ZX
7 s, @6 W2 K+ U. f6 b- u3 e. l set principal_axis Y! h* S0 O5 w4 s
}
. G6 }) A. _3 S M9 @7 u+ P* C 2 {
' t1 |' j$ P, w set mom_cutcom_plane XY
+ y* {7 U, K, J. L: `5 ] set mom_pos_arc_plane XY4 F0 b# ?; u# g
set principal_axis Z
' `- v4 y# M2 q' d+ }* u8 `- Y }
6 |! E: S4 M+ e default {
2 C5 x, {" _7 m, L @% K set mom_cutcom_plane UNDEFINED( h9 E6 ?6 n( N8 `" @5 r* p! z
set mom_pos_arc_plane UNDEFINED& }/ g$ A5 q* L" L" G4 T. d
set principal_axis "". ]" B" a9 u0 e
}" `: X* B* I/ G1 `
}
* ?1 R: P1 q/ h) Z
8 m, e0 k1 V+ ?1 g" ~6 @" g& Y' c0 L* o5 _
if { $suppress_principal_axis && [string length $principal_axis] > 0 } {; H3 I% n+ z* F- {3 I8 Z
MOM_suppress once $principal_axis: f& {% D& Z: ]6 Y, z& }( Z
}; z8 Y6 M! b# k' ~9 ?& x
4 _# f, p3 M( x$ @' S
- z2 A `. \. j, t
if { $force_plane_code } {" j' f) o8 J$ u9 [, T
global cycle_init_flag
, ^$ n. t6 V" t4 d* R w* i x" D- P& V# v5 W/ L. C+ j! X
if { [info exists cycle_init_flag] && [string match "TRUE" $cycle_init_flag] } {
" C0 I/ R4 j* K% C% G MOM_force once G_plane0 x* K8 B7 H @/ I
}
% K- h# [6 N& Y$ I- a) E } |
|