|
|
发表于 2020-8-8 16:45:51
|
显示全部楼层
global mom_kin_machine_type
! V+ W/ f$ V' i% G global mom_kin_4th_axis_type mom_kin_4th_axis_plane/ y6 P3 o0 q6 C: w- x$ Q. L$ Z! q
global mom_kin_5th_axis_type3 n, _+ V _! L3 u9 t7 W
global mom_tool_axis mom_sys_spindle_axis mom_kin_spindle_axis
1 t$ b2 E; P+ z9 K global mom_pos, w' ~8 E# K$ R9 ^# E
global mom_cycle_spindle_axis mom_cutcom_plane mom_pos_arc_plane7 j" T( l3 R+ ?9 o d
6 e: P" O# N( q
+ E5 i! h2 S q7 L+ k # Default cycle spindle axis to Z
4 U% e/ b- O1 X. q0 ?% U/ T- Y! N2 a set mom_cycle_spindle_axis 23 x/ n4 h; {$ P
6 t, @" y5 h) F" h8 Y! x( F& r% j9 O4 m
+ s) m0 S4 i( d, }" n( T
if { ![string match "*3_axis_mill*" $mom_kin_machine_type] } {
! @. j* c6 w3 I0 P j8 D
/ Q) d9 |( W# w1 U- B# G. s! f5 G6 U if { $mom_kin_4th_axis_type == "Head" } {: {( u' R3 u" s. I
& y) O6 A* h6 n, _% S" P9 G if [EQ_is_equal [expr abs($mom_tool_axis(0))] 1.0] {
! B7 T, R Z5 o set mom_cycle_spindle_axis 0
$ E6 q3 S; l( p Q# A* N! P% [ }5 Q8 h1 f0 y- R
7 I9 k9 g/ w/ v) Q% P- p if [EQ_is_equal [expr abs($mom_tool_axis(1))] 1.0] {
6 y4 p! U% L1 |+ b2 I& K# _- a: v set mom_cycle_spindle_axis 1. _2 z! j2 E4 D# A
}
/ V( a! }; Z& H, @" E* o/ d. w* o( Y; B! I
if { $mom_kin_5th_axis_type == "Table" } {9 ` }6 A1 x7 y6 Y% `" E
- z5 Q: w; Z" Y) q' t if { [EQ_is_equal [expr abs($mom_pos(3))] 90.0] || [EQ_is_equal [expr abs($mom_pos(3))] 270.0] } {
( `8 f* @; w& s9 n |3 w( n; C1 F1 i" N- \7 J) c6 B5 u* l
switch $mom_kin_4th_axis_plane {
_' m2 E. R# F ?, I4 i9 _, `/ | "YZ" {6 f# ^/ D) j7 S* A
set mom_cycle_spindle_axis 1
4 a+ H* W% J' V. S$ y/ P" [, R }
1 H8 Y& c0 A0 B Z. T% T& H "ZX" {
5 ]! S7 j* t1 [- O' F set mom_cycle_spindle_axis 00 |1 `2 F$ ^3 l' h$ X9 N/ L5 g, O, l
}
" G z4 ^: Z( x: }4 e }* P* E- D: g; l+ r+ h* n
}' I( X9 r4 S/ l* O7 J9 N( K" A: n" Q
}
+ o/ ^. ?$ t) r }- m1 l3 A1 ~ O6 a: o
}5 X, }3 r& ~$ T ^9 P
9 v+ V' {$ h; w& z1 w. N
% m9 S' P. X. Q" V" t" ?9 O
switch $mom_cycle_spindle_axis {8 n, Z0 M: l* R) j( Q( q( z
0 {/ g1 g% J* m. v: d* R
set mom_cutcom_plane YZ
" e, x. i% q# M2 Y' p& i9 z set mom_pos_arc_plane YZ
Z5 B% X! p+ D! b- p set principal_axis X- u* j* ] c+ q5 ~; Y: ~
}- v% I1 J/ Z# b8 E9 O. t
1 {
$ C! N4 z. r6 s7 f6 P' W0 M set mom_cutcom_plane ZX: i+ }; |& v; ?; I' \; `) p% o
set mom_pos_arc_plane ZX
- F0 Z" I* Z) G set principal_axis Y& q% G- W# R% U5 ^' @+ ]
}5 h, l9 G- E6 z7 o3 l
2 {
* v0 l& F6 T, f8 }' x, E; k) f set mom_cutcom_plane XY
) K( h8 S0 \3 M$ {0 h. g set mom_pos_arc_plane XY
9 i1 O5 h- D6 {$ G+ j& x set principal_axis Z
+ ]1 P& j7 n+ H; M0 T }. m5 i4 P1 k0 N3 w9 A3 P; Z. S0 u* i
default {0 b! T/ r. o# \
set mom_cutcom_plane UNDEFINED
; X4 M+ _4 d+ r1 e9 A6 W/ n set mom_pos_arc_plane UNDEFINED
7 @9 @3 B' ]& c% M5 V set principal_axis ""
2 q( N! w3 U0 y4 c+ D6 U- a }
* G2 Y/ f) f9 u" ` }6 f% v; l/ k/ Q. w$ x a8 c3 p% x
: `( q" |% f' P5 m6 k _$ K: Y9 ~: v, `; [
if { $suppress_principal_axis && [string length $principal_axis] > 0 } {& C, q' \: W8 K7 a" n% d
MOM_suppress once $principal_axis
/ Y8 a- b7 t E }9 ~ c, D. d% I6 m9 w9 O
6 D$ R, k( ]$ E! |+ g
' }" m2 L5 o( T: e5 z, l! f2 M: ? if { $force_plane_code } {& f! E( L" d, U8 l
global cycle_init_flag7 k A# S o0 I* {( l" c% O# Z
1 Z- W$ Q8 x# t2 Q- o9 J6 d4 m
if { [info exists cycle_init_flag] && [string match "TRUE" $cycle_init_flag] } {
! Z% ~) g, U! u MOM_force once G_plane e- b5 V9 b/ M, S( U% I& n6 z
}
1 G7 L) D |% y% B } |
|