|
|
发表于 2020-8-8 16:45:51
|
显示全部楼层
global mom_kin_machine_type
^4 e) B! v8 b9 w+ A global mom_kin_4th_axis_type mom_kin_4th_axis_plane
, D. y" F0 t0 X E! n! s global mom_kin_5th_axis_type
" K3 |% M2 z2 `7 |5 Z' m global mom_tool_axis mom_sys_spindle_axis mom_kin_spindle_axis
4 f9 [( G3 z: S# d# O( n: y global mom_pos3 H0 U5 F" b6 Q1 E$ L% G6 ?8 h
global mom_cycle_spindle_axis mom_cutcom_plane mom_pos_arc_plane
- z/ x$ g3 h+ f1 {8 C7 d( [0 E1 _; G! Y4 D# R" V
! }6 U' g; M! m # Default cycle spindle axis to Z/ [5 q! M+ L. U1 ~& W% V0 T
set mom_cycle_spindle_axis 2
8 a9 h. C4 S9 f" S+ @3 h1 v# K0 @+ q
9 M6 V2 T5 w |4 \3 g! t1 p5 \% B s; ^; n u% o2 C- P' H
if { ![string match "*3_axis_mill*" $mom_kin_machine_type] } {
- i, ^* q8 {, a1 I0 B7 h8 y* Y8 B( |
if { $mom_kin_4th_axis_type == "Head" } {
/ l8 e+ R% W( p O' v
6 u+ K; B7 E) Z! i: K+ X9 u if [EQ_is_equal [expr abs($mom_tool_axis(0))] 1.0] {
2 q" p z0 N8 u: R5 k# b set mom_cycle_spindle_axis 0: l. d; ?. e, J H" l
}
) a' r$ o' \2 G6 `" \
2 r$ z% }/ m6 y if [EQ_is_equal [expr abs($mom_tool_axis(1))] 1.0] {- x p/ h3 s: S) w Q
set mom_cycle_spindle_axis 1. u7 J* g" v0 n( } T& F
}
' C# _4 z, O i f, o0 ]. B0 A% w/ @# g' A
if { $mom_kin_5th_axis_type == "Table" } {3 i5 N& r; V- o: `3 f: @
# p1 V, k2 }7 I# R: a- S+ i2 c if { [EQ_is_equal [expr abs($mom_pos(3))] 90.0] || [EQ_is_equal [expr abs($mom_pos(3))] 270.0] } {
: K, z. Q# F1 x" [: M5 ]" w; o
) j: j" o! }& g8 |/ t switch $mom_kin_4th_axis_plane {
) K+ V. m# w) _ "YZ" {
7 ^ w4 e) D# M) B" A( c set mom_cycle_spindle_axis 19 Y& k3 { a# E+ T8 U
}8 n- l4 |5 s$ N% ]' }0 d- h, k* F7 \
"ZX" {4 |1 I, S; g$ ?0 t! v: @9 V
set mom_cycle_spindle_axis 0* ?/ ~ |8 {% G' K( o% b
}: m5 R$ Y+ I/ i6 g3 ?
}
2 D& d9 ?. h) C$ e! X }
- H: {5 m2 ]( ?( ~: V }3 W, D4 C, W" P8 ~' w& Z
}- z8 c4 E& u7 L8 @5 |
}) L! i4 {" G8 a
! W8 f1 f6 V& Z' ?+ |% h# C4 i" \
5 |% l# Z5 P; _1 _, o1 Q
switch $mom_cycle_spindle_axis {' V5 _" x+ p) z% Z; [2 l3 ~7 y" c
0 {$ d$ N* N. K4 m$ L/ o: B
set mom_cutcom_plane YZ3 T8 H: i1 P0 s: J- T" ]
set mom_pos_arc_plane YZ
* {" J# p6 {% i- y4 e set principal_axis X
" P7 p) r+ L9 o: ^ }+ t2 [; B c! y4 S
1 {
7 I2 w0 u9 K& _4 O& Q set mom_cutcom_plane ZX
0 w% K, e+ q4 u+ P set mom_pos_arc_plane ZX3 f2 o- g% L z4 E- l; W
set principal_axis Y% I% {/ s( m1 I# @* i& g
}( q4 k x; g' h: J" D2 U
2 {
0 D: l" I$ Y7 t set mom_cutcom_plane XY/ K6 d7 M' f/ M) Y
set mom_pos_arc_plane XY
4 o! o6 I! X! c* i k( i set principal_axis Z3 p0 G4 G! j: ~# x8 K( L) }9 s
}
9 E1 c8 c/ F5 u0 }% _0 I default {8 u0 v7 B( U; Z: u/ y2 q
set mom_cutcom_plane UNDEFINED
! r2 Q d: L: L$ T; F$ Q: S set mom_pos_arc_plane UNDEFINED+ z6 _( f+ V3 S ^
set principal_axis ""$ J! J; T. e7 b. T% b
}1 t3 m# C' Y8 k T0 c$ V
}3 z4 b- p# s5 O* f' f
S# ]2 _/ b5 g
: W0 y4 R5 ^( v$ ^- U
if { $suppress_principal_axis && [string length $principal_axis] > 0 } {
) Y: g! F& b5 c$ L MOM_suppress once $principal_axis
3 z+ ~- \2 n; g8 } }
/ ?# ? r+ w8 a" V+ g' t* D/ W7 M" Q6 P) w U0 v3 O
' t4 f$ q4 o: i( }' {1 I if { $force_plane_code } {/ j0 ]4 ~5 L4 m& @3 C! D- F
global cycle_init_flag
* B; H3 E/ O9 A$ d" d$ M9 S0 I3 U
if { [info exists cycle_init_flag] && [string match "TRUE" $cycle_init_flag] } {
( X& N+ D1 d3 O% T) N MOM_force once G_plane
( ^/ [5 O6 x/ l8 H0 h8 q4 x }
8 u8 a; W$ c# D; J } |
|