|
楼主 |
发表于 2011-11-28 11:07
|
显示全部楼层
UG后处理刀补的正确输出方法
2 b: z% O" c# n/ E+ }+ `% s
4 k& K! l4 {; h# v- s, S
3 N: d- d) }: u* f1 U3 Y
* x! E( C; `; Z前一段时间搞ug 刀补的多刀处理问题,蛮头疼的,看到一强人Yeager给了一个方法
- S* {. R# I* W" I5 k; N在Cutcom On里面增加一個Custom Command.,.填入"MOM_force once D",这个方法可以解决D号的模态省略的问题) o, O7 Q. [; [; A" y1 e
,即在分层刀路里第二层G41/G42后没有D号的问题. 佩服啊!
+ w* `0 A, S4 S) e. h+ u; v关于G40的处理:* w6 B+ P+ f# o7 _& a5 {2 x9 E" c
在Cutcom off项中删除G40 ,生成程序的效果如下:
6 d+ F+ ]5 b6 k; U; P
1 a' X: n7 j! k1 KN40 G0 G90 X-58. Y30. M03 S2000) e% x" v& W+ h- W% n; k- B* Z
N50 G43 Z3. H01
- {/ K$ v7 f" I+ D" Y/ m3 d2 @N60 Z1.077 O4 j9 F+ Y3 }% b
N70 G1 Z-1.923 F250.
. M/ G5 c1 A7 l/ PN80 G41 X-55. D01! x. O3 Z" l$ i2 J4 G9 T( V
N90 G2 X-50. Y35. I5. J0.0
+ a M) N( y `! }8 f6 s3 QN100 G1 X50.' ~' ?- Q# a5 h# a' E! _
N110 G2 X55. Y30. I0.0 J-5.- R- A" g* g& V' i p4 [7 ^
N120 G1 Y-30.7 M( x( z6 b, M5 [* W
N130 G2 X50. Y-35. I-5. J0.0- {5 K* ^( N$ |' y1 Y, {
N140 G40 G1 Y-37.54$ V# p2 @: X" g$ A
N150 G0 Z1.077# E* A- h# N1 E, t, r$ B8 t
N160 Y-38.
; O' r" S6 `2 C. H; yN170 Z-.846! E2 t/ _2 h: S+ ^4 A, K
N180 G1 Z-3.846
% g- @5 y c* s& X* yN190 G42 Y-35. D01% ]; T4 F! O# r$ K6 Q
N200 G3 X55. Y-30. I0.0 J5.. |2 Z* x8 ^5 j! s4 {( _
N210 G1 Y30.. i7 J: h0 Q7 J8 s% [, s% j' e
N220 G3 X50. Y35. I-5. J0.02 a$ c# a* S. t. i$ s3 I
N230 G1 X-50.
1 j$ q" W- q: P1 F+ YN240 G3 X-55. Y30. I0.0 J-5.* x7 h; s. d' D; G
N250 G40 G1 X-57.54' d, a% n8 |3 }% F$ w( O8 K g0 M
N260 G0 Z-.846
! h8 E- {2 z2 b( h$ L- [% oN270 X-58.
3 Z* q4 e8 _; ?3 a. n& F7 rN280 Z-2.7697 |7 A0 H1 z0 S' I4 [
N290 G1 Z-5.769
6 Z" V8 x: m- v; @3 d- sN300 G41 X-55. D019 f3 H! t$ N" C# ^1 c1 I
N310 G2 X-50. Y35. I5. J0.05 z8 V4 x0 t) M) G: H$ v
+ H* q# |7 ?2 T' U# \5 J* Q# {3 x
在fanuc 、mazak等机床上试验过,在fanuc系统上如果G41后没有D号,可以执行前一个模态的有效的D号,在G40后如果没有撤销刀补的直线段,刀补撤销没有问题,在G40这一句不产生移动,在下一句G1 x y 的语句执行
, L% u$ j- E u。如果将G41D1 单独列一行,可以对下一个坐标点进行补偿,但是补偿点的位置有误7 a0 e' p4 _. U3 Y9 ]. F8 s
在mazak系统中:G41D1单独列一行的语句运行后,立即对前一个坐标点进行补偿,G40也是如此,也就是说补的位置不是我们要补的位置。
' j k0 `, h6 m: U所以我们为了程序的正确性,必须保证G41 D1 position
m2 W1 G1 V- g" z,G40 position 的格式。# [3 t, j3 G- Q1 d$ m5 {
) ^# D- c0 V/ F( ~
做好刀补的方法:
. }) ~( d. y) P总结:1.在Cutcom On里面增加一個Custom Command.,.填入"MOM_force once D",这个方法可以解决D号的模态省略的问题
, w* Y6 j' n7 B9 z3 G 2.删除Cutcom Off的G40。
- X" n7 y2 j) ~/ p% c 3.在rapid move 里加入G40。1 m: \7 [) z, t p
4.加入G54
# F: A b2 o0 V# P l7 a# ^9 z H 5.刀具信息:global mom_tool_name& |$ G5 a J1 p* A
MOM_output_literal "(TOOL NAME $mom_tool_name)": v& T# i" `! m
; {* s2 z+ c* X! N/ [9 A 6.加工时间:global mom_machine_time
1 s% {# ]* F0 p5 l) S. [
e& {2 F: k: l+ C i) g& N% T/ pMOM_output_literal "(MACHINE TIME [format "%.2f" $mom_machine_time] MIN )"1 v- M7 N4 p9 w2 \! F X9 @; m/ l
1 E8 O) s7 g% N" V9 U% A 7.在每个操作前加入行号及路径名$mom_path_name
9 S/ m `7 _" k$ J& p1 D/ z' X0 P on
) n! ~ y$ S! H3 {$ z0 | 路径名(operator message)2 E5 H$ w k. m; X) P
off% ]1 y% i" F5 v4 f) P% V- h) W9 v
8.在rapid move中,需对rap1,rap2,rap3及m13强制输出.! x" p+ l A2 B) Y5 \
( e9 j, c% o e o($mom_output_file_basename)(刀轨文件名)" F D4 ]9 C/ K
$mom_path_name(操作名)5 ^, j' A+ O3 c$ r$ q. }
9."MOM_force once M03" 。% V! H @3 T! O
10. 要用M8-Coolant Flood: X+ \: t! m, N4 U
11.螺纹铣:init_helix
+ s' S$ c. W* U4 r! p0 c O' o$ S uplevel #0 {
# s8 P8 K9 Y0 J( i0 i0 R2 p#
3 ?, E$ m( c4 `; L* k8 P# This procedure will be executed automatically at the start of program and
$ b( @, ^$ {! `# anytime it is loaded as a slave post of a linked post.' Y( @* N5 R; Q, T1 p( ~6 |# q' c
#
K8 n7 }1 [& L0 K( n# This procedure can be used to enable your post to output helix.4 {0 `7 z6 j( I# J! I+ X( `
# You can choose from the following options to format the circle
0 v' V8 I. M: h6 i# block template to output the helix parameters./ B G/ k3 y) E; w2 Q
#
; ^* J0 D8 W. ]& W( r, u( Q) K2 M4 i# Z# T3 p _
set mom_sys_helix_pitch_type "rise_radian" " `6 `8 t( l0 m) j5 f9 E) D
1 v9 `5 Y9 k$ c5 Y#! Q8 C3 j% q3 {4 t7 S5 c$ o! g
# The default setting for mom_sys_helix_pitch_type is "rise_radian".
: z9 f* \$ Q- W0 `& l1 V& [# This is the most common. Other choices are:
2 x' s% R* `: q7 @# |#
) M/ v) |3 d% a' k$ u- n# i# "rise_radian" Measures the rise over one radian.
: B; ~, [0 Y1 F& C: o# ]& A# "rise_revolution" Measures the rise over 360 degrees.* ]2 ~5 E( p; b2 N. U: C: a, a
# "none" Will suppress the output of pitch.: u+ [6 ^2 |+ y% Z8 H# M
# "other" Allows you to calculate the pitch
6 ?2 C: u% p0 V& p& W6 W+ d/ N- \# using your own formula.
5 D7 U+ {9 E4 {0 f% K" B- K# \#
3 ]# Z# d: O# a! U+ t# This custom command uses the block template circular_move to output
2 o, Q8 L( u- o8 R5 U/ r5 f( @# the helix block. If your post uses a block template with a different: P' Q% y$ N7 }* L% O' e
# name, you must edit the line that outputs the helix block.
4 ?( R$ H) w! Q
6 ^ X1 w! W$ m1 x& K#
6 N% Z% N& O- @ h! N/ A% P( U# The following variable deines the output mode for helical records.
! |8 |( B- y6 z9 p, v#
* y* Y5 H5 m7 {9 K3 m# FULL_CIRCLE -- This mode will output a helix record for each 360
]% H% P8 z% R4 R) r3 ]: m/ r$ L# degrees of the helix.
2 ^$ A8 _8 {. a2 L# QUADRANT -- This mode will output a helix record for each 90 3 X( \+ @/ `4 c4 E Q2 l3 Q$ g
# degrees of the helix.
# E+ S( _# R$ g2 c# LINEAR -- This mode will output the entire helix as linear gotos.
, M8 d3 W5 q9 Y8 v/ }' U# END_POINT -- This mode will assume the control can define an entire' I8 r @' ^8 F! t% O) x
# helix in a single block.
v# K6 ^# {2 K, }% J, I$ S2 Z
4 P+ p$ ~' r. ?$ C* p5 C9 S5 W set mom_kin_helical_arc_output_mode FULL_CIRCLE
3 J" ?' j# o- s0 i, [" K
8 w; q$ q5 ?& \0 n% V MOM_reload_kinematics
' ^% { Y u# x6 `$ t( d2 J4 r* w1 Z# i8 e4 R1 Y
2 s6 w1 B: V4 u0 J1 }$ B& K" y4 M0 \# Q$ B% p2 H8 w3 f
#=============================================================; S$ {8 G: y2 Y3 A6 n8 `% b5 C
proc MOM_helix_move { } {
) }& O. T- a5 h#=============================================================6 k. d: V, ?# l- U# f
global mom_pos_arc_plane, `2 _2 B% @# M7 }! x
global mom_sys_cir_vector
' C, @& A/ C& y* U% W global mom_sys_helix_pitch_type
5 f1 P# {' Z, ?; B3 b+ [8 @2 u- L global mom_helix_pitch3 Q- U e# y+ U6 H7 s1 F" J& Q* I
global mom_prev_pos mom_pos_arc_center
9 B; M1 w: Y" I5 O8 E global PI/ d2 p" G0 I9 m3 Q6 H, I8 \1 A# @
- o+ p* Q. r6 A. w* f; n switch $mom_pos_arc_plane {
' `+ B$ w( p. y9 G/ r XY { MOM_suppress once K ; set cir_index 2 }
/ J# r7 O# Z. N1 _3 w% x: G' p) [ YZ { MOM_suppress once I ; set cir_index 0 }
+ U3 i( N; s1 M# T2 J- Y9 l ZX { MOM_suppress once J ; set cir_index 1 }
7 _1 b3 ~7 @! W T' `' ~; X }
/ A/ x) N( W( I- F' B# F! b1 }, N$ Y \+ e# q
switch $mom_sys_helix_pitch_type {
: X; s& M/ c1 z none { }3 A" [6 Q6 V8 U; C
rise_revolution { set pitch $mom_helix_pitch }
& D9 u; [6 O- }& P, Q& G7 X/ U( D# b rise_radian { set pitch [expr $mom_helix_pitch / ($PI * 2.0)]}4 \& [- k. c% A# h% q. h
other {
/ g+ b& B' i5 W# R8 y) ?#
* A0 b2 p$ J2 m; Y. w" L8 h% e. j# Place your custom helix pitch code here) E/ M9 \( Y# m n1 l( m5 V3 ` h
#
* I1 W" G- \; l }
4 @6 @: @) D& l: _) _ default { set mom_sys_helix_pitch_type "none" }
) C0 x5 s; W' u. d0 E! v) f | }
# L- d+ t8 O7 Q3 L
& y. {% ]+ i0 c MOM_force once X Y Z
! V( ^0 ?! e# Q1 W, R0 w' e% Z4 v1 c9 c
if {$mom_sys_helix_pitch_type != "none"} {# C, ]4 D# U, B7 m% _5 k$ e1 U, B6 j
MOM_force once I J K4 m7 d, L' M6 G5 k! l2 Z+ v
if {$mom_sys_cir_vector == "Vector - Arc Center to Start"} {
7 c* M& S, [+ h, D$ ]& ^ set mom_prev_pos($cir_index) 0.0& y% v; s& e6 n9 C
set mom_pos_arc_center($cir_index) $pitch
7 G, L1 a/ O# V0 `/ J0 i% n } elseif {$mom_sys_cir_vector == "Vector - Arc Start to Center"} {% j4 K2 I. V, ^2 f$ u& H
set mom_prev_pos($cir_index) $pitch8 p* P s: t" D4 Z& _
set mom_pos_arc_center($cir_index) 0.05 |1 h0 R8 @- ^& V
} elseif {$mom_sys_cir_vector == "Unsigned Vector - Arc Center to Start"} {
& n. g& N" D" a set mom_prev_pos($cir_index) 0.04 O5 {2 x! ~. ?1 t' A
set mom_pos_arc_center($cir_index) $pitch1 \1 g/ o2 C% ~+ H, @3 [1 w0 d3 m
} elseif {$mom_sys_cir_vector == "Absolute Arc Center"} {
1 A" \8 D" e. y6 e8 x set mom_pos_arc_center($cir_index) $pitch
9 A" @' @* D% v- q' D5 O7 K# @' @ }! f8 D" [( ]6 g, {+ A' W; r
}
: o" S3 L) v$ Q3 c/ D% j; K
3 T6 i/ e0 p4 p2 V+ u3 m1 J- m! J5 l
#
4 T2 `- N4 U. ~+ W9 T' I# You may need to edit this line if you output more than one block
, U# p7 O: f8 I' B# or if you have changed the name of your circular_move block template
) G8 x- Y' Q: A. Q2 H#& t, F [+ x# k- G+ h1 T4 g
MOM_do_template circular_move } Y! \7 i& y! ^5 C# S- E
5 s/ _0 b7 j4 G$ {# V; M0 ^$ w5 v# U
} ;# MOM_helix_move7 b \7 q" `. Q& j4 D
* C: m; h: O7 J3 H) g$ ]
@3 g. z* M8 Z2 ~( [( H
} ;# uplevel
8 Q, ]" F7 U$ |- {5 j3 v p, b7 y
0 h4 C% o! l. C `" h" \/ d |
|