Details
A 5-axis milling machine tool is fitted with a rotary head that only moves in increments of whole degrees. No partial degree values are allowed. How to have the post evaluate the rotary solution as programmed in NX and prevent partial degree output? in these situations the post needs to issue a warning that the angle can't be achieved using the current machine head and not process the tool path.
Solution
The following tcl procedure can be placed in the post to evaluate the current value of mom_out_angle_pos. If this is a whole number, the post continues. If not, post processing is aborted with the message in the MOM_abort command line.
This logic can be placed as a custom command in the Operation Start Sequence and/or added to the PB_CMD_before_motion command so the post repeats the check before every motion event.
Please note that this is a very simple example to illustrate the concept. The following was written for a specific use case of a rotating head that uses only positive values of whole degree increments. If the machine has more extensive capabilities, including the ability to use negative angle values, or the user desires to add angle evaluations within a specific tolerance value, then more advanced math will be required. It is suggested that you consult a tcl programming guide to write those functions and tests as suit your needs. Once the mathematical evaluation is complete to determine of the current angle is or is not a whole number degree within tolerance, the MOM_abort command format can be used as noted.
#=============================================================
proc PB_CMD_check_head_angles { } {
#=============================================================
# This command is used to verify that the rotary angles for the 4th and 5th
# axes are whole numbers. If either is not, issue a message and abort.
global mom_out_angle_pos
set 4th_test [expr abs($mom_out_angle_pos(0)) - int($mom_out_angle_pos(0))]
set 5th_test [expr abs($mom_out_angle_pos(1)) - int($mom_out_angle_pos(1))]
if { $4th_test > 0 || $5th_test > 0 } {
MOM_abort "ROTARY ANGLE IS NOT A VALID POSITION"
}
}
Hardware/Software Configuration
Platform: all
OS: n/a
OS Version: n/a
Product: NX
Application: CAM
Version: V11.0.2
Function: POSTBUILDER
Ref: 002-8017573