上尉
UID9331731
U币1
G币6120
技术0
主题27
精华0
阅读权限90
注册时间2019-9-15
最后登录2024-11-21
在线时间553 小时
手机15671033022
上尉
|
那是因为你的后处理不完善,下面定制命令加在程序开始目录下
#正常判断G17 G18 G19,三平面输出的判断语句#########
# 在定制命令中用的名称 { PB_CMD_fix_RAPID_SET }
if { ![CMD_EXIST ugpost_RAPID_SET] } {
if { [CMD_EXIST RAPID_SET] } {
rename RAPID_SET ugpost_RAPID_SET
}
} else {
return
}
#***********
uplevel #0 {
#====================
proc RAPID_SET { } {
#====================
if { [CMD_EXIST PB_CMD_set_principal_axis] } {
PB_CMD_set_principal_axis
}
global mom_cycle_spindle_axis mom_sys_work_plane_change
global traverse_axis1 traverse_axis2 mom_motion_event mom_machine_mode
global mom_pos mom_prev_pos mom_from_pos mom_last_pos mom_sys_home_pos
global mom_sys_tool_change_pos
global spindle_first rapid_spindle_inhibit rapid_traverse_inhibit
global mom_current_motion
if { ![info exists mom_from_pos($mom_cycle_spindle_axis)] && \
[info exists mom_sys_home_pos($mom_cycle_spindle_axis)] } {
set mom_from_pos(0) $mom_sys_home_pos(0)
set mom_from_pos(1) $mom_sys_home_pos(1)
set mom_from_pos(2) $mom_sys_home_pos(2)
} elseif { ![info exists mom_sys_home_pos($mom_cycle_spindle_axis)] && \
[info exists mom_from_pos($mom_cycle_spindle_axis)] } {
set mom_sys_home_pos(0) $mom_from_pos(0)
set mom_sys_home_pos(1) $mom_from_pos(1)
set mom_sys_home_pos(2) $mom_from_pos(2)
} elseif { ![info exists mom_sys_home_pos($mom_cycle_spindle_axis)] && \
![info exists mom_from_pos($mom_cycle_spindle_axis)] } {
set mom_from_pos(0) 0.0 ; set mom_sys_home_pos(0) 0.0
set mom_from_pos(1) 0.0 ; set mom_sys_home_pos(1) 0.0
set mom_from_pos(2) 0.0 ; set mom_sys_home_pos(2) 0.0
}
if { ![info exists mom_sys_tool_change_pos($mom_cycle_spindle_axis)] } {
set mom_sys_tool_change_pos($mom_cycle_spindle_axis) 100000.0
}
set is_initial_move [string match "initial_move" $mom_current_motion]
set is_first_move [string match "first_move" $mom_current_motion]
if { $is_initial_move || $is_first_move } {
set mom_last_pos($mom_cycle_spindle_axis) $mom_sys_tool_change_pos($mom_cycle_spindle_axis)
} else {
if { [info exists mom_last_pos($mom_cycle_spindle_axis)] == 0 } {
set mom_last_pos($mom_cycle_spindle_axis) $mom_sys_home_pos($mom_cycle_spindle_axis)
}
}
if { $mom_machine_mode != "MILL" && $mom_machine_mode != "DRILL" } {
# When machine mode is UNDEFINED, ask machine type
if { ![string match "MILL" [PB_CMD_ask_machine_type]] } {
return
}
}
WORKPLANE_SET
set rapid_spindle_inhibit FALSE
set rapid_traverse_inhibit FALSE
if { [EQ_is_lt $mom_pos($mom_cycle_spindle_axis) $mom_last_pos($mom_cycle_spindle_axis)] } {
set going_lower 1
} else {
set going_lower 0
}
if { ![info exists mom_sys_work_plane_change] } {
set mom_sys_work_plane_change 1
}
# Reverse workplane change direction per spindle axis
global mom_spindle_axis
if { [info exists mom_spindle_axis] } {
# - This flag has no effect if the work plane change is not set.
#
set disable_non_principal_spindle 0
switch $mom_cycle_spindle_axis {
0 {
if [EQ_is_lt $mom_spindle_axis(0) 0.0] {
set going_lower [expr abs($going_lower - 1)]
}
}
1 {
if [EQ_is_lt $mom_spindle_axis(1) 0.0] {
set going_lower [expr abs($going_lower - 1)]
}
}
2 {
# Multi-spindle machine
if [EQ_is_lt $mom_spindle_axis(2) 0.0] {
set going_lower [expr abs($going_lower - 1)]
}
}
}
# Per user's choice above, disable work plane change for non-principal spindle axis
#
if { $disable_non_principal_spindle } {
if { ![EQ_is_equal $mom_spindle_axis(0) 1] && \
![EQ_is_equal $mom_spindle_axis(1) 1] && \
![EQ_is_equal $mom_spindle_axis(0) 1] } {
global mom_user_work_plane_change
global mom_user_spindle_first
set mom_user_work_plane_change $mom_sys_work_plane_change
set mom_sys_work_plane_change 0
if [info exists spindle_first] {
set mom_user_spindle_first $spindle_first
} else {
set mom_user_spindle_first NONE
}
}
}
}
if { $mom_sys_work_plane_change } {
if { $going_lower } {
set spindle_first FALSE
} else {
set spindle_first TRUE
}
# Force output in Initial Move and First Move.
if { !$is_initial_move && !$is_first_move } {
if { [EQ_is_equal $mom_pos($mom_cycle_spindle_axis) $mom_last_pos($mom_cycle_spindle_axis)] } {
set rapid_spindle_inhibit TRUE
} else {
set rapid_spindle_inhibit FALSE
}
if { [EQ_is_equal $mom_pos($traverse_axis1) $mom_prev_pos($traverse_axis1)] && \
[EQ_is_equal $mom_pos($traverse_axis2) $mom_prev_pos($traverse_axis2)] && \
[EQ_is_equal $mom_pos(3) $mom_prev_pos(3)] && [EQ_is_equal $mom_pos(4) $mom_prev_pos(4)] } {
set rapid_traverse_inhibit TRUE
} else {
set rapid_traverse_inhibit FALSE
}
}
} else {
set spindle_first NONE
}
} ;# RAPID_SET
} ;# uplevel
|
|