7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 1/68
5 Axis Generic Post5 Axis Generic Post
5-axis post training
Date: October 14, 2002
This presentation is intended as a guide for setting up the
generic 5 axis posts, MPGEN5X_FANUC.PST and
MPGEN5X_MILLPLUS.PST. Run this presentation in
conjunction with a text editing program.
5 Axis Generic Post5 Axis Generic Post
MPGEN5X_FANUC.PST and MPGEN5X_MILLPLUS.PST are generic
5 axis posts that are configurable to these basic machine types:
What are generic 5 axis posts???
Table/Table
Tilt Head/Table
Head/Head
Nutator Table/Table
Nutator Tilt Head/Table
Nutator Head/Head
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 2/68
5 Axis Generic Post5 Axis Generic Post
With these basic machine control types:
What are generic 5 axis posts???
Fanuc M (MPGEN5X_FANUC)
Heidenhain MillPlus (MPGEN5X_MILLPLUS)
5 Axis Generic Post5 Axis Generic Post
But this post offers more than positioning data. Some special
features are:
What are generic 5 axis posts???
Intelligence is built in to detect rotary limits and automatically
retract and reposition the tool to continue the cut.Define a safety box and the tool moves to it whenrepositioning. A head/head machine configuration followsthe safety box to position around the part.Bias the starting angles at toolchanges and/or on thesecondary axis.
Fan a cut with a rotary axis on the tool to prevent partgouging.
Supports axis substitution and polar conversion.
Limited support for Right/Compound angle head.
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 3/68
5 Axis Generic Post5 Axis Generic Post
MPGEN5X_FANUC.PST and MPGEN5X_MILLPLUS.PST are MP
post processors that have part of the post encrypted using the
MPBIN utility. The encrypted post section is written to a file with
a PSB extension. You should have these files to run the post.
PST File
PSB File
TXT File
These files can be renamed to produce new post processors.
MPBIN has been modified to re-encrypt a PSB file setup to run on
“any SIM”.
The encrypted code is not being released to customers or
dealers.
Required files
5 Axis Generic Post5 Axis Generic Post
Get the Data. What is the axis layout on the machine? Where
are the rotary axis when the machine is at the home position?
How does the machine interpret the rotary data? What are
the rotary axis limits?
Define the part orientation in Mastercam.
Determine which axis is the primary and secondary axis.
Configure the post.
5 Axis Configuration
How do you configure a 5 axis post?
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 4/68
5 Axis Generic Post5 Axis Generic Post
Obtain a picture or drawing with the machine at the home
position. Have the axis address marked on the drawing. Show
the signed axis movement with the limits.
5 Axis ConfigurationGet the Data
5 Axis Generic Post5 Axis Generic Post
How the part is placed relative to the
Mastercam WCS is critical in producing
the proper NC code. Parts are normally
oriented to match the machine zero state.Train your customer to always place the
part drawing or WCS with the orientation
you have determined is needed to
produce proper code.
Nutating machines always have the part
oriented in the top view.
5 Axis Configuration
Define the part orientation in Mastercam
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 5/68
5 Axis Generic Post5 Axis Generic Post
The primary axis is the rotary axis
that is rotated first to position a tool
vector in the plane that is
perpendicular to the secondary axis
rotation.
Determine the primary and
secondary axis by imposing the
machine coordinate gnomon onto asimple part drawing in the proper
orientation for the machine.
5 Axis ConfigurationDetermine which axis is the primary and secondary axis
(This step not needed with nutating types)
5 Axis Generic Post5 Axis Generic Post
Observe the axis of rotation for the
machine tool. The Y and Z are the
axis of rotation for this machine.
Select the vectors that represent the
rotary axis. Z+ and Y+ are thosevectors in this example.
Resolve each of these vectors for the
assumed primary axis. Rotate the
vector on the primary axis and
attempt to resolve the vector in the
plane perpendicular to the secondary
axis of rotation. The correct solution
is when both vectors have logical
results.
5 Axis Configuration
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 6/68
5 Axis Generic Post5 Axis Generic Post
Assuming the Y axis (B) as the primary axis, resolve by
viewing the vector formed by the Z+ axis by first viewing
down the axis of rotation of the assumed primary axis.
Mentally rotate the vector on the primary axis into the plane
perpendicular to the secondary axis of rotation. View down
the axis of rotation of the assumed secondary axis to
observe the result for the secondary axis. Repeat this for
the Y+ vector. Assume that zero is at 3 o'clock and positive
direction is counterclockwise from the viewing direction.
5 Axis Configuration
5 Axis Generic Post5 Axis Generic Post
5 Axis ConfigurationAssuming the Y axis (B) as the primary axis for Z+ vector:
Z+ rotates to B90 on primary Z+ solves to C180 on secondary
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 7/68
5 Axis Generic Post5 Axis Generic Post
5 Axis ConfigurationAssuming the Y axis (B) as the primary axis for Y+ vector:
Y+ is infinite on primary Y+ solves to C90 on secondary
5 Axis Generic Post5 Axis Generic Post
5 Axis Configuration
Now re-examine the axis selection assuming the Z axis (C) as the
primary axis. Again, resolve by viewing the vector by first
viewing down the axis of rotation of the assumed primary axis.
Mentally rotate the vector on the primary axis into the plane
perpendicular to the secondary axis of rotation. View down theaxis of rotation of the assumed secondary axis to observe the
result for the secondary axis. Repeat this for the Y+ vector.
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 8/68
5 Axis Generic Post5 Axis Generic Post
5 Axis ConfigurationAssuming the Z axis (C) as the primary axis for Z+ vector:
Z+ is infinite on primary Z+ solves to B90 on secondary
5 Axis Generic Post5 Axis Generic Post
5 Axis ConfigurationAssuming the Z axis (C) as the primary axis for Y+ vector:
Y+ rotates C90 on primary Y+ resolves to B180 on secondary
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 9/68
5 Axis Generic Post5 Axis Generic Post
5 Axis Configuration
From the examination where the Yaxis (B) was assumed as theprimary axis; the result of "Y+ isinfinite on primary" and "Y+ solvesto C90 on secondary" is NOTlogical. Therefore, the conclusioncan be drawn that the Z axis is theprimary axis.
Be aware that some trial and error
is often required to make thecorrect selection.
5 Axis Generic Post5 Axis Generic Post
5 Axis Configuration (known cases)
The primary axis is always the rotary axisfixed to the machine tool and thesecondary axis is always the axismounted on the primary axis with the
head/head type machine tools.
The primary axis is always the rotary axis
aligned to the Z axis of the WCS and the
secondary axis is always the nutated axis
with the nutating type machine tools.
See the specific requirements for
configuring the nutating type machine.
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 10/68
5 Axis Generic Post5 Axis Generic Post
The post can now be configured for the machine tool. Thefollowing slides cover the basic settings. Later slides cover themore advanced options and their meaning.
Open the post in the editor of your choice and find these postvariables...
5 Axis ConfigurationConfigure the post
5 Axis Generic Post5 Axis Generic Post
‘mtype’ selects the machine type the post needs to support. The
type is based on where the rotary axis are placed on the machine
tool. This post supports the 6 machine types in the list. Enter the
value corresponding to desired basic machine type.
Post Type Selection
#Machine rotary routine settingsmtype : 0 #Machine type (Define base and rotation planebelow)
#0 = Table/Table#1 = Tilt Head/Table#2 = Head/Head#3 = Nutator Table/Table#4 = Nutator Tilt Head/Table#5 = Nutator Head/Head
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 11/68
5 Axis Generic Post5 Axis Generic Post
Table/Table - type 0
Both rotary axis are located on the machine base and the spindle
remains constant.
Post Type Selection
5 Axis Generic Post5 Axis Generic Post
Tilt Head/Table - type 1
One axis tilts the spindle while the other rotary axis is located on
the machine base.
Post Type Selection
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 12/68
5 Axis Generic Post5 Axis Generic Post
Head/Head - type 2
Both rotary axis are located in the machine head and tilt the
spindle.
Post Type Selection
5 Axis Generic Post5 Axis Generic Post
Nutator Table/Table - type 3
Both rotary axis are located on the machine base and the spindle
remains constant. The rotary axis are not perpendicular.
Post Type Selection
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 13/68
5 Axis Generic Post5 Axis Generic Post
Nutator Tilt Head/Table - type 4
Both rotary axis are located on the machine table and the spindle
remains constant. The rotary axis are not perpendicular.
Post Type Selection
5 Axis Generic Post5 Axis Generic Post
Nutator Head/Head - type 5
Both rotary axis are located in the machine head and tilt the
spindle. The rotary axis are not perpendicular.
Post Type Selection
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 14/68
5 Axis Generic Post5 Axis Generic Post
The primary and secondary axis as selected earlier are used to
setup these plane selections used in the internal math
calculations. The rotary axis is the normal to the plane that we
use with the global variables in the following code.
Define Rotary Axis
#Primary axis angle description (in machine base terms)#With nutating (mtype 3-5) the nutating axis must be the XY planerotaxis1 = vecy #Zerorotdir1 = vecx #Direction
#Secondary axis angle description (in machine base terms)#With nutating (mtype 3-5) the nutating axis and this plane normal#are aligned to calculate the secondary angle
rotaxis2 = vecz #Zerorotdir2 = vecx #Direction
5 Axis Generic Post5 Axis Generic Post
The only valid variables to use with ‘rotaxis1’, ‘rotdir1’, ‘rotaxis2’,
and ‘rotdir2’ are ‘vecx’, ‘vecy’ and ‘vecz’. ‘vecx’, ‘vecy’ and ‘vecz’
can be signed (-vecx for example). The variables correspond to
the gnomon axis designations as shown.
Define Rotary Axis
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 15/68
5 Axis Generic Post5 Axis Generic Post
This is the general relationship of the rotation axis to the plane
selection variables.
Define Rotary Axis
5 Axis Generic Post5 Axis Generic Post
The primary rotation is defined by selecting the gnomon vector
that defines zero (Y+) and assigning it to ‘rotaxis1’. From the zero
vector, select the perpendicular vector in the plane that is the
positive direction of travel (X+) and assign it to ‘rotdir1’.
Define Rotary Axis
rotaxis1 = vecy #Zerorotdir1 = vecx #Direction
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 16/68
5 Axis Generic Post5 Axis Generic Post
The secondary rotation is defined by selecting the gnomon vector
that defines zero (Z+) and assigning it to ‘rotaxis2’. From the zero
vector, select the perpendicular vector in the plane that is the
positive direction of travel (X+) and assign it to ‘rotdir2’.
Define Rotary Axis
rotaxis2 = vecz #Zerorotdir2 = vecx #Direction
5 Axis Generic Post5 Axis Generic Post
The secondary rotation for a nutating axis is defined by the plane
formed by the Z+ vector and the normal to the plane the
secondary (nutated) axis lays in. The assignment implies the
plane the nutated axis is in.
Define Rotary Axis (Nutating)
rotaxis2 = vecz #Zerorotdir2 = vecx #Direction
The nutating axis is in the YZ
plane in this example.
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 17/68
5 Axis Generic Post5 Axis Generic Post
For a nutating axis, the post needs to know the tilt from the Z+
axis. The angle is signed negative if the direction in the plane is
toward X- or Y-.
Define Rotary Axis (Nutating)
#Nutating machine (mtype 3-5) describe the plane that the nutated axis#lays in, this is the plane perpendicular to the primary axis and#secondary axisnut_ang_pri : -45 #Nutating head secondary axis angle from machine Z positive
5 Axis Generic Post5 Axis Generic Post
Often, the setting for the axis signed direction is entered
incorrectly. Setting the direction for table motion is confusing
because the direction the tool vector moves on the part is
opposite of the table direction. Switching the sign is as easy as
changing the sign for the ‘rotdir1’ or ‘rotdir2’ variable.
Rotary Axis Direction Correction
rotaxis1 = vecy #Zerorotdir1 = vecx #Direction
Becomes:rotaxis1 = vecy #Zerorotdir1 = -vecx #Direction
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 18/68
5 Axis Generic Post5 Axis Generic Post
The primary and secondary axis planes must not be the same.
Mathematically this is unacceptable. The following table lists the
acceptable plane combinations.
Rotary Axis Valid Plane Selection
XZXY YZ
YZXYXZ
YZXZXY
Secondary
Option 2
Secondary
Option 1
Primary
Valid Plane Relations
5 Axis Generic Post5 Axis Generic Post
The post variable ‘shift_90_s’ may need to be reversed when the
primary axis zero is not in the plane of the secondary axis and the
secondary axis zero is perpendicular to the primary plane. This is
because the post can select the wrong rotation direction in the
internal calculations. This variable is rarely changed.
Rotary Axis Definition Corrections
shift_90_s : 1 #Shift pos.=1, neg.=-1
Primary Zero
Secondary Zero
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 19/68
5 Axis Generic Post5 Axis Generic Post
The primary and secondary axis can be output with the options
of signed absolute output or implied shortest distance absolute
output within the range of 0 to 360 degrees.
The post always works internally with the angles as if normal
angle output was applied (rotary axis windup in a linear fashion)
and manipulates the angle when writing to the NC file based on
these settings.
Rotary Output Options
pang_output : 0 #Angle output options, primarysang_output : 0 #Angle output options, secondary
#0 = Normal angle output#1 = Signed absolute output, 0 - 360#2 = Implied shortest direction absolute output, 0 - 360
5 Axis Generic Post5 Axis Generic Post
Signed absolute output
Starting at zero (CW positive) -
Rotary Output Options
A-135-135
A270+135
A135+180
A-315-90
A-45-45
A90+90
OutputMotion
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 20/68
5 Axis Generic Post5 Axis Generic Post
Implied shortest distance absolute
Starting at zero (CW positive) -
Rotary Output Options
A135-135
A270+135A135 direction?+180
A315-90
A45-45
A90+90
OutputMotion
5 Axis Generic Post5 Axis Generic Post
The primary and secondary axis address are assigned to the
string variables in this code. ‘str_pri_axis’ is the address for the
primary axis. ‘str_sec_axis’ is the address for the secondary axis.
The post uses the vector math routines with 3D arrays and
‘str_dum_axis’ is a place filler.
Rotary Address
#Assign axis addressstr_pri_axis "C"str_sec_axis "B"str_dum_axis "A"
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 21/68
5 Axis Generic Post5 Axis Generic Post
Rotary limits must be applied to each rotary axis. The range of
the limits, the toolpath and the machine type determines how the
post reacts when a limit is violated. Avoiding the limits is the best
machining practice but this is not always possible. The following
slide is the section from the post where the limits are set. It is
important that the limits are set in degrees and that they are in
terms of normal (unlimited windup) output. Limits are resolved to
these four types:
Less than 180 degrees
Equal or greater than 180 degrees and less than 360 degrees
Soft limit at 0-360 degrees with hard limits slightly beyond
Greater than 360 degrees
Rotary Limits
5 Axis Generic Post5 Axis Generic Post
Rotary Limits
auto_set_lim : 1 #Set the type from the angle limit settings (ignore these)pri_limtyp : 0sec_limtyp : 0
#Rotary axis travel limits, always in terms of normal angle output#Set the absolute angles for axis travel on primary
pri_limlo : -9999pri_limhi : 9999#Set intermediate angle, in limits, for post to reposition machinepri_intlo : -9999pri_inthi : 9999
#Set the absolute angles for axis travel on secondarysec_limlo : -9999sec_limhi : 9999#Set intermediate angle, in limits, for post to reposition machinesec_intlo : -9999sec_inthi : 9999
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 22/68
5 Axis Generic Post5 Axis Generic Post
‘auto_set_lim’ allows the post to examine the limit entries and
automatically set the limit type variables. Leave this enabled.
Rotary Limits
auto_set_lim : 1 #Set the type from the angle limit settings (ignore these)pri_limtyp : 0sec_limtyp : 0
5 Axis Generic Post5 Axis Generic Post
The total rotary axis travel is under 180 degrees. The intermediate
angle is set equal to the axis travel.
Rotary Limit Types
#Set the absolute angles for axis travel on primarypri_limlo : 0
pri_limhi : 110#Set intermediate angle, in limits, for post to reposition machinepri_intlo : 0pri_inthi : 110
Less than 180 degrees
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 23/68
5 Axis Generic Post5 Axis Generic Post
The total rotary axis travel is equal to or over 180 degrees and the
less than 360 degrees. The intermediate angle is set equal to the
axis travel.
Rotary Limit Types
#Set the absolute angles for axis travel on primarypri_limlo : 0pri_limhi : 225#Set intermediate angle, in limits, for post to reposition machinepri_intlo : 0pri_inthi : 225
Equal or greater than 180 degrees and less than 360 degrees
5 Axis Generic Post5 Axis Generic Post
This type, when assigned to the
primary axis, attempts to
reduce the number of limit
retract and approach moves byresetting the limits whenever
the secondary axis is flipped.
Rotary Limit TypesEqual or greater than 180 degrees and less than 360 degrees
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 24/68
5 Axis Generic Post5 Axis Generic Post
The rotary axis travel is normally 360 degrees but the rotary axis
can exceed the travel by a small amount. The intermediate angle
is set at the normal travel and the axis travel is set to the
maximum limits.
Rotary Limit Types
#Set the absolute angles for axis travel on primarypri_limlo : -5pri_limhi : 365#Set intermediate angle, in limits, for post to reposition machinepri_intlo : 0pri_inthi : 360
Soft limit at 0-360 degrees with hard limits slightly beyond
5 Axis Generic Post5 Axis Generic Post
This type uses the
intermediate limit to create a
position to retract and
approach when the nextmove can not be reached
within the repositioned rotary
limits (usually a 360 degree
move).
Prior Move - 45
Post Generated Move - 0
Current Move - 315
Rotary Limit TypesSoft limit at 0-360 degrees with hard limits slightly beyond
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 25/68
5 Axis Generic Post5 Axis Generic Post
The total rotary axis travel is over 360 degrees. The intermediate
angle is set equal to the axis travel. The axis is allowed to
windup. The intermediate angle is set equal to the axis travel.
Rotary Limit Types
#Set the absolute angles for axis travel on primarypri_limlo : -9999pri_limhi : 9999#Set intermediate angle, in limits, for post to reposition machinepri_intlo : -9999pri_inthi : 9999
Greater than 360 degrees
5 Axis Generic Post5 Axis Generic Post
When a limit is reached with this type rotary limit, the variable
‘typ3_brk_evn’ automatically adjusts the axis travel angles to an
even 360 degree revolution within the travel limits.
Rotary Limit Types
typ3_brk_evn : 0 #Windup limit, use even revolution break position
Greater than 360 degrees
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 26/68
5 Axis Generic Post5 Axis Generic Post
The variable ‘adj2sec’ stands for “adjust to secondary”. The
purpose of this post switch is to allow the secondary axis limit to
exercise control over the primary axis. By default, the post
attempts to avoid large primary axis moves. When the secondary
limit is tripped, the post attempts to reposition the primary axis.
The primary axis is repositioned with a 180 degree move and the
secondary axis is checked to see if it is within the limits.
Rotary Limit Option
adj2sec : 1 #Attempt to adjust the primary axis from secondary?#Allows primary axis to flip 180 to satisfy secondary#0 = Off #1 = Use method when secondary is out of limit
#Use with pri_limtyp = one to keep secondary as controlling#limit when limit tripped#Use with pri_limtyp = two to allow 180 degree reposition
5 Axis Generic Post5 Axis Generic Post
The rotary axis offset variables hold the distance that the primary
and secondary axis of rotation are offset. They have different
meaning based on the machine type selected. ‘saxisx’, ‘saxisy’
and ‘saxisz’ are used with non-nutating type machine axis offsets
and nutating machine types with the Mill Plus output option and
tool plane toolpaths. ‘n_saxisx’, ‘n_saxisy’ and ‘n_saxisz’ areused with nutating type machine output. The axis offsets are
relative to the machine base matrix (usually the top view).
Rotary Axis Offsets
saxisx : 0 #The axis offset direction?saxisy : 0 #The axis offset direction?saxisz : 0 #The axis offset direction?
n_saxisx : 0 #The axis offset direction?n_saxisy : 0 #The axis offset direction?n_saxisz : 0 #The axis offset direction?
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 27/68
5 Axis Generic Post5 Axis Generic Post
Rotary Axis Offsets – Table/Table
5 Axis Generic Post5 Axis Generic Post
Rotary Axis Offsets – Head/Table
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 28/68
5 Axis Generic Post5 Axis Generic Post
Rotary Axis Offsets – Head/Head
5 Axis Generic Post5 Axis Generic Post
The rotary axis offset for table/table and tilt head/table can have
two interpretations where the program zero point is located
relative to the offset axis. This is a user preference and the
variable must reflect the users preference. The selection is
ignored if the axis have no offset.
Rotary Axis Offsets
r_intersect : 1 #Rotary axis intersect on their center of rotations#Determines if the zero point shifts relative to zero#or rotation with axis offset.
n_r_intrsct : 0 #Rotary axis intersection with nutating (normally zero)
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 29/68
5 Axis Generic Post5 Axis Generic Post
‘r_intersect’ set to 0 directs the
post to calculate output with the
machine coordinate origin at the
part zero (Part/Machine Zero).
The offset distance is from the
Machine Zero to the secondary
axis centerline (Axis Centerline).
The part zero can be set at the
face of the primary axis table.
Rotary Axis Offsets
saxisz : -100 #The axis offset direction?
5 Axis Generic Post5 Axis Generic Post
‘r_intersect’ set to 1 directs
the post to calculate output
with the machine coordinate
origin at the secondary axis
centerline (Machine Zero).
The offset distance is fromthe Machine Zero to the
origin of the part as drawn
(Part Zero). Coordinates are
relative to the Machine Zero
as the secondary axis turns
the part.
Rotary Axis Offsets
saxisz : -100 #The axis offset direction?
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 30/68
5 Axis Generic Post5 Axis Generic Post
The post is capable of breaking large rotary moves into several
smaller rotary moves based on chordal deviation. The variables
‘brk_tol’ (empirical) and ‘brk_tol_m’ (metric) are used when the
fanning routine is enabled. Fanning is normally enabled for
machine types with rotary motion on the spindle and nutating
type machines. Fanning is usually not used with table/table type
machines. See 'brk_mv_head' to enable/disable.
Post Tolerances
brk_tol : .001 #Break up chordal tolerance for 'brk_mv_head'brk_tol_m : .025 #Break up chordal tolerance for 'brk_mv_head', metric
Note: Arc linearization uses the ‘vtol’ and ‘vtol_m’ variables.
5 Axis Generic Post5 Axis Generic Post
Exclusive to this post is a cut location flag. This allows for
spawning events in the post file based on the flags value. The
“retract position” and “plunge point” are generated from the
posts rotary reposition routines.
Post Cut Location Flag
cutflag : one #Path location flag, set in post#Before start - 1#On start - 2#In path - 3#On end - 4#After end - 5#Retract position - 6#Plunge point - 7
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 31/68
5 Axis Generic Post5 Axis Generic Post
The post has the option to convert rapid moves to high feedrate.
Post Feed Options
rot_feed : 0 #Rapid rotary motion only feed options#0 - convert to G0 rapid
#1 - apply rapid feedrate
38. Rapid feedrate? 300.01538. Rapid feedrate (metric)? 10000.0
Rotary moves with no linear motion has the option to be output as
Gcode rapid “G00” or with the high feedrate.
The high feedrate is taken from question 38. or 1538. in the post.
convert_rpd : 0 #Convert rapid to rapid feed
5 Axis Generic Post5 Axis Generic Post
‘use_fr’ selects the feedrate output type. The post only has the
option for unit per minute or inverse feedrate. Degree per minute
is not an option because it is normally not compatible with 5 axis
motion.
Programmed feedrate – Units per minute as programmed in
Mastercam.Inverse feedrate – All feeds are converted to inverse time.
Inverse feedrate on 5 axis continuous – Only 5 axis toolpaths are
output with inverse feedrate.
Inverse feedrate on motion with rotary – Linear moves are output
as unit per minute.
Post Feed Options
use_fr : 2 #Output feedrate#0 - programmed feedrate#1 - inverse feedrate#2 - inverse feedrate on 5 axis continuous#3 - inverse feedrate on motion with rotary
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 32/68
5 Axis Generic Post5 Axis Generic Post
Inverse feed time calculation options allow the post to calculate
the feedrate based on the flute length and to the pivot point on
head/head type machines. The flute length is taken from the
“Flute” entry in the Define Tool dialog from the Mastercam tool
library.
Post Feed Options
inv_fd_typ : 0 #Calculate feed location options#0 - inverse feed at tip#1 - min-max on flute length#2 - tip to pivot on tool length#3 - min-max on flute length to pivot on tool length
5 Axis Generic Post5 Axis Generic Post
Inverse feed at tip – Calculations from tool tip
Min-max on flute length – Calculation from max length on flute
Tip to pivot on tool length - Calculations from tool tip as ratio to
pivot.
Min-max on flute length to pivot on tool length - Calculation from
max length on flute as ratio to pivot.
Post Feed Options
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 33/68
5 Axis Generic Post5 Axis Generic Post
The feedrate can be calculated or passed to the post as zero.
Zero feed calculations often happen when the length between
positions from the NCI file are extremely small. After rounding to
the output format, these moves are coincident. Zero feedrate in
the NC code is a serious problem. To avoid stopping the machine
tool, the following should be set to apply the default feed values
in zero feedrate cases.
Post Feed Options
fix_fr : 1 #If feedrate is zero, apply these valuesdeffeedpm : 1.0 #Default for zero feed in inch/mindeffeedpm_m : 25.0 #Default for zero feed in mm/mindeffrinv : 500.0 #Default for zero feed inverse time
5 Axis Generic Post5 Axis Generic Post
String assignments for the MillPlus control's feedrate axis control
address should be set if enabled. The feedrate axis control
variables are used prior to V410 on the MillPlus control to
calculate rotary feeds and are enabled with the 'radius_fr' switch.
radius_fr : 0 #Use axis radius distance
#Mill Plus, Assign feedrate axis addressstr_pri_f40 "C40="str_sec_f40 "B40="
'mpgen5x_millplus' Post Setting
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 34/68
5 Axis Generic Post5 Axis Generic Post
This is primarily added to handle the nutating machine types but
can also be used with the standard machine types. When
‘top_map’ is active, the toolpaths are output as if a table/table
machine was specified. Code must be added to the post to
handle the machine specific mapping routine. Other post
variables must be set for this output. The following slides are a
guide to these additional variables.
'top_map' Post Settings
top_map : 1 #Output toolplane toolpaths mapped to top view
5 Axis Generic Post5 Axis Generic Post
'top_map' actually switches machine type based on 5 axis
continuous toolpaths or toolplane positioning toolpaths. To
restore the original machine setting, the postblock below is
embedded in the initialization section of the post. Replace the
second argument in the formulas with the global assignments for
‘rotaxis1’, ‘rotdir1’, ‘rotaxis2’ and ‘rotdir2’.
rotaxis1 = vecy #Zerorotdir1 = vecx #Directionrotaxis2 = vecz #Zerorotdir2 = vecx #Direction
#NOTE: Use of 'top_map' requires the dealer match the# above settings below. These must match initial settings!!!p_nut_restore #Postblock, restores original axis settings
result = updgbl(rotaxis1, vecy) #Zeroresult = updgbl(rotdir1, vecx) #Directionresult = updgbl(rotaxis2, vecz) #Zeroresult = updgbl(rotdir2, vecx) #Direction
'top_map' Post Settings
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 35/68
5 Axis Generic Post5 Axis Generic Post
The toolplane angle position address is used with the 'top_map'
command for toolplane positioning and mapping on the control.
See the next slide for toolplane rotation angle selections.
#Toolplane mapped to top angle position stringsstr_n_a_axis "A5="str_n_b_axis "B5="str_n_c_axis "C5="
'top_map' Post Settings
5 Axis Generic Post5 Axis Generic Post
Switching to toolplane positioning toolpaths with 'top_map'
requires that a selection be made for the rotary axis to be used.
Make a selection from the options presented.
top_type : 3 #With 'top_map' select toolplane output#0 = Post selects map rotation axis
#1 to 4, user selected map rotation axis#1 = Primary C : X zero, Secondary B#2 = Primary C : Y zero, Secondary A#3 = Primary C : -X zero, Secondary B#4 = Primary C : -Y zero, Secondary A
'top_map' Post Settings
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 36/68
5 Axis Generic Post5 Axis Generic Post
Tool length is most often used with post types - Tilt Head/Table or
Head/Head. How the tool length is obtained can be selected with
the variable ‘use_tlength’. Enter 0 to use the value entered in the
variable ‘toollength’ (See code below). Initialize to 1 and the
length is taken from the “Overall” entry in the Define Tool dialog
from the Mastercam tool library. Set to 2 prompts the user for the
tool length at each tool change when the post is run.
Post Tool Length
use_tlength : 0 #Use tool length, read from tool overall length#0=Use 'toollength' var, 1=Mastercam OAL, 2=Prompt
toollength : 0 #Tool length if not read from overall length
5 Axis Generic Post5 Axis Generic Post
The tool length with Head/Head machine types can be applied to
the output positions. The options are 0 to add the tool length in
the current tool direction to the output, 1 to add the tool length as
in option 0 and then subtract the length from the Z axis. Enter 2
and the tool length is not added (tool tip programming) but we
have the length for feed and fanning calculations.
Post Tool Length
shift_z_pvt : 0 #Shift Z by tool length, head/head program to pivot (Z axis only)#0=Pivot, 1=Pivot-Z, 2=Tool Tip Programming (without zero length)#Option 2, So we can still take advantage of brk_mv_head feature
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 37/68
5 Axis Generic Post5 Axis Generic Post
Post Tool LengthOption 0 is used when the tool tip is the zero pick up position.
Option 1 is used when the tool pivot is the zero pick up position.
5 Axis Generic Post5 Axis Generic Post
‘add_tl_to_lim’ stands for “add tool length to limits”. The limits
referred to are the linear limits enabled with the variable
‘use_stck_typ’. This controls if the limits are considered absolute
when retracting for repositioning.
Post Tool Length
add_tl_to_lim : 0 #Add tool length after intersecting limit, always#on if limit from stock
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 38/68
5 Axis Generic Post5 Axis Generic Post
Linear stock limits are used by the post during approach and
retract from the part and during a rotary axis reposition triggered
by a rotary axis limit violation. These do not trigger a warning
when violated, they are intended as a safety zone the same as
those defined in Mastercam.
Post Linear Limits
use_stck_typ : 0 #0=Off, 1=Stock def., 2=Limitsup_x_lin_lim : 500.0 #X axis limit in positive directionup_y_lin_lim : 500.0 #Y axis limit in positive directionup_z_lin_lim : 500.0 #Z axis limit in positive directionlw_x_lin_lim : -500.0 #X axis limit in negative directionlw_y_lin_lim : -500.0 #Y axis limit in negative directionlw_z_lin_lim : -100.0 #Z axis limit in negative direction
‘use_stck_typ’ uses the values from job setup to fill the limit
variables when set to 1. When set to 2, the values are used as
they are set in the post.
5 Axis Generic Post5 Axis Generic Post
How do the linear stock limits work? The limits are used to create
a box. This box is then intersected by the tool vector for the
retract move and the tool vector for the approach move. The
vectors are adjusted for the machine type and moves are
generated to follow the extents of the box to reposition the tool.
Post Linear Limits
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 39/68
5 Axis Generic Post5 Axis Generic Post
‘clear_stck’ is used to modify the linear stock limits. This is used
when using the stock size from Job Setup to add an additional
clearance to the stock size.
Post Linear Limits
clear_stck : 0.0 #Add inc. offset to stock definition for transition boundary
5 Axis Generic Post5 Axis Generic Post
This variable allows the post to retract and reposition the tool on
rapid motion from the NCI file. Normally this is enabled. It would
be disabled when the user is making all retracts and approach
moves in the tool path at rapid traverse. Feed moves are not
expected to be part of a retract or approach by the post.
Rotary Limit Option
retract_on_rpd : 1 #This control allows retract on rapids too (don'tassume rapid is safe)
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 40/68
5 Axis Generic Post5 Axis Generic Post
The variable 'use_clamp' adds the rotary axis clamp Mcodes to
the NC output. These are applied with toolplane positioning and
drill cycles. 5 axis tool paths can not have the rotary axis
clamped because rotary motion is expected.
Post Clamp Option
use_clamp : 0 #Use the automatic clamp Mcode
Find this section in the post to change the strings for the clamp
code.
# Primary axis lock/unlockspunlock M79 # Unlock Rotary Tablesplock M78 # Lock Rotary Table
# Secondary axis lock/unlockssunlock M11 # Unlock Rotary Tablesslock M10 # Lock Rotary Table
5 Axis Generic Post5 Axis Generic Post
The machine base option allows the NCI input to be mapped to a
different coordinate system in the NC output. Alter the matrix
settings to a view that is the target output. This is helpful for
machines with left hand coordinate systems or horizontal
machines where the user prefers a setup relative to the machine
tool.
Post Machine Base Option
#Machine base matrix (Base matrix to map positions into)matb1 : 1matb2 : 0matb3 : 0matb4 : 0matb5 : 1matb6 : 0matb7 : 0matb8 : 0matb9 : 1
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 41/68
5 Axis Generic Post5 Axis Generic Post
This example shows a horizontal machine setup where the user
prefers a setup relative to the front view in Mastercam. The user
can now program the tool paths with the part relative to the
machine zero (as shown below). The post configuration settings
are relative to this matrix.
Post Machine Base Option
matb1 : 1matb2 : 0matb3 : 0matb4 : 0matb5 : 0matb6 : 1matb7 : 0matb8 : -1matb9 : 0
5 Axis Generic Post5 Axis Generic Post
The rotary limit tolerances are used in the post to trigger the
revolution counter, find large rotary moves to flip the secondary
axis and determine when limits have been violated requiring
repositioning. Normally, these values do not need adjustment.
The following slides give a more detailed description of each
variable.
As a general rule, large changes in the tool vector directions
should be avoided with 5 axis tool paths to avoid unexpected
repositioning.
Post Rotary Limit Tolerances
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 42/68
5 Axis Generic Post5 Axis Generic Post
The tolerance settings for wind up determines at what point to
add or subtract from the internal revolution counter. The
comparison is to the raw angle calculations which are in the
range of 0 to 360 degrees. The design is to prevent moves
exceeding this threshold.
Post Rotary Limit Tolerances
#Tolerance settings for wind upp_tol_ang : 210 #Primary angle move to exceed for direction changes_tol_ang : 210 #Secondary angle move to exceed for direction changed_tol_ang : 210 #Dummy angle move to exceed for direction change
5 Axis Generic Post5 Axis Generic Post
'p_rsoft_tol' is the primary angle change in degrees to exceed to
trip for tool reposition or adjustment to the secondary axis. For
'rotary limits less than 180 degrees', 'equal or greater than 180
degrees and less than 360 degrees' and 'soft limit at 0-360
degrees' any rotary move exceeding the value makes a call to the
routines to check for limit violations or adjustment to thesecondary axis.
Post Rotary Limit Tolerances
#pri_limtyp = 1, tolerance to validate tripping limit# reset the p_frc_adj_sec flag when back to normal range#pri_limtyp = 2, angle move >= to trigger reposition on primary and# angle move >= with rev5 or 180 reposition to validate tripping limitp_rsoft_tol : 45
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 43/68
5 Axis Generic Post5 Axis Generic Post
The variable 's_soft_tol' is the secondary angle change in degrees
to exceed to trip a tool reposition. This tolerance is only used
with soft limit at 0-360 degrees on the secondary axis.
Post Rotary Limit Tolerances
#sec_limtyp = 2, Angle move >= for repositions_soft_tol : 270
5 Axis Generic Post5 Axis Generic Post
After a limit has been tripped by either a limit or a large rotary
move, the post attempts to adjust the move within an acceptable
range. If the recalculated rotary move is below the degree value
in 'adj_lim_trp', the limit trip indicators are set off and the
repositioning routine is not called.
Post Rotary Limit Tolerances
adj_lim_trp : 90 #Angle move in p_pri_rot180 to trip reposition
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 44/68
5 Axis Generic Post5 Axis Generic Post
'p_rsoft_tol3' is the primary angle change in degrees to exceed to
trip for tool reposition or adjustment to the secondary axis. For
'greater than 360 degrees' any rotary move exceeding the value
makes a call to the routines to check for limit violations or
adjustment to the secondary axis.
Post Rotary Limit Tolerances
#pri_limtyp = 3 and sec_limtyp = 3 control valuesp_rsoft_tol3 : 90 #Angle move >= with rev5 or 180 reposition
5 Axis Generic Post5 Axis Generic Post
The post relies on the miscellaneous reals and integers to
interpret the users intent and control the rotary axis. These are
also used to provide additional functionality.
A major problem for any post is understanding what occurred
through a null toolchange or a retract and approach from one
chain to another. The post can not see if adequate clearance from
the part was programmed in the toolpath or if a collision could
occur by calling the routines to retract and approach in the post.
The post can not determine the optimum starting angles for the
rotary axis to avoid tripping a limit. All these and more can be
controlled with the miscellaneous reals and integers.
Miscellaneous Reals/Integers
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 45/68
5 Axis Generic Post5 Axis Generic Post
Select absolute or incremental positioning output. Toolchange
positioning is always in absolute mode.
Miscellaneous Integers# mi2 - Absolute or Incremental positioning at top level# 0 = absolute# 1 = incremental
G0 G54 G90 X .5676 Y7.4665 C182.81 B 25.671 S2139 M3
G43 H1 Z.8198 M8
G1 X .3588 Y7.4842 Z.7483 C181.73 B 24.288 F6.42
X .1316 Y7.4968 Z.6799 C180.525 B 22.913
G0 G54 G90 X .5676 Y7.4665 C182.81 B 25.671 S2139 M3
G43 H1 Z.8198 M8
G1 G91 X.2088 Y.0177 Z .0715 C 1.08 B1.383 F6.42
X.2272 Y.0126 Z .0684 C 1.205 B1.375
mi2 = 0:
mi2 = 1:
5 Axis Generic Post5 Axis Generic Post
mi3 selects the reference return position. mpgen5x_millplus uses
G74 and the entries in mr3, mr4 and mr5.
Miscellaneous Integers# mi3 - Select G28 or G30 reference point return.# 0 = G28, 1 = G30
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 46/68
5 Axis Generic Post5 Axis Generic Post
A bias is a request to the post to attempt to start the machine
position close to the entered value. The actual value output to the
post is a result of the internal calculations. 999 and -999 are
interpreted as a command to position as close to the limits set in
'pri_limlo' and 'pri_limhi'. 0 indicates that the calculations should
occur without attempting any bias.
Miscellaneous Integers# mi4 - Start initial primary rotary axis bias# +/-999 represents start as close to limit as possible# 0 represents calculate without using bias# Any other value represents an angle in degrees to attempt# to position near.# -999 = Low, 0 = Off/Default, 999 = Hi, Value = Angle bias
5 Axis Generic Post5 Axis Generic Post
The secondary bias functions the same as the primary biasexcept it is subordinate to the primary axis in cases of conflict.
999 and -999 are interpreted as a command to position as close to
the limits set in 'sec_limlo' and 'sec_limhi'. 0 indicates that the
calculations should occur without attempting any bias.
Miscellaneous Integers# mi5 - Start initial secondary rotary axis bias# +/-999 represents start as # close to limit as possible# 0 represents calculate without using bias# Any other value represents an angle in degrees to attempt# to position near.# -999 = Low, 0 = Off/Default, 999 = Hi, Value = Angle bias
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 47/68
5 Axis Generic Post5 Axis Generic Post
The bias settings are used to control the initial rotary axis
positions at the start of file or a toolchange. Depending on the
machine rotary limits, the user may need to edit 'mi4' and 'mi5'
after posting to remove retracts and approaches because of the
initial rotary calculations. The post does not have logic to look
ahead in the toolpath to determine the optimal start angles. The
'bias_null' variable allows the post to use 'mi4' and 'mi5' to adjust
the angle through a null toolchange (no change in tool number).
Miscellaneous Integers
bias_null : 1 #mi4 and mi5 bias are applied at null toolchanges
5 Axis Generic Post5 Axis Generic Post
Depending on the type of toolpath (5 axis motion or toolplane
positioning), the user may want to select a different work origin
on the machine tool. The part origin must remain a constant with5 axis motion. With toolplane positioning the user may select a
different origin location and enter the work offset in the control
register. mi6 shifts the output coordinates to the origin selected
in Mastercam for toolplane positioning. 5 axis toolpaths are
always output relative to the Mastercam WCS origin.
Miscellaneous Integers# mi6 - Add work shift position for rotation center programming# 0 = Output relative to work origin (toolplane)# 1 = Output relative to WCS origin (axis shifts)
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 48/68
5 Axis Generic Post5 Axis Generic Post
mi7 disables the post generated retract and approach from the
part. The moves should be disabled when the user has made
moves in the toolpath to clear the part at a rotary reposition or an
obstacle is present where the retract is occurring. The rotary axis
moves required to stay in the rotary limits are generated.
Miscellaneous Integers# mi7 - Enable retract to and from linear limits. Disable for# internal work to prevent part collisions.# 0 = Disable, 1 = Enable
5 Axis Generic Post5 Axis Generic Post
mi8 controls when the retract and approach are used relative to
the toolpath toolchanges and 5 axis chains. This is needed
because the post does not know if the user has made the retract
and approach part of the toolpath at toolchanges and the
beginning and end of 5 axis chains with multiple cuts.
Miscellaneous Integers# mi8 - Safe retract/approach at toolchange.# The tool retracts/approachs to limits from last path to current# path or after/before a toolchange# (limits must be enabled, see 'use_stck_typ')# 0 = Disable all toolchange retract/approach# 1 = Enable null toolchange retract/approach only
# 2 = Enable toolchange retract/approach only# 3 = Enable both toolchange retract/approach# 4 = Enable retract/approach between 5 axis chains (cutpos) in# toolpath or sign 1 to 3 negative with toolchange options
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 49/68
5 Axis Generic Post5 Axis Generic Post
The calculations for the nutating machine types can be controlled
by selecting the linear axis direction that is normal to the plane of
the nutated axis. This should be set to avoid erratic rotary axis
moves in the toolpath.
Miscellaneous Integers# mi9 - Nutating bias calculation.# 0 = Calculate angle bias to original vector# 1 = Bias to positive# 2 = Bias to negative
5 Axis Generic Post5 Axis Generic Post
The secondary axis for the non-nutating machine types can be
controlled by mi10. This value is normally used with head/headtype machines where the secondary axis rotary limits are under
360 degrees. The post controls the travel by temporarily setting
the appropriate limit to 0.
Miscellaneous Integers# mi10 - Secondary axis control (non-nutating)# 0 = Continuous secondary (primary controlled)# 1 = Always stay positive# 2 = Always stay negative
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 50/68
5 Axis Generic Post5 Axis Generic Post
This value is an incremental distance applied to the retract and
approach with the post reposition routine. The retract is at rapid
and the approach is at the plunge feedrate.
Miscellaneous Reals# mr1 - Retract/approach clearance distance at tool reposition
5 Axis Generic Post5 Axis Generic Post
mr2 "rotates" the toolpath on the secondary axis by the entered
value. Any value can be entered but the machine must be setupwith the direction of the tool in the head so it is in the plane
perpendicular to the secondary axis.
Miscellaneous Reals# mr2 - Right angle head toolpath conversion (not with nutating machine).# Right angle rotates secondary axis by degrees# The head may only be rotated perpendicular to the secondary axis# 0 = Off, Enter angle for amount of head rotation (RA = +/- 90)
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 51/68
5 Axis Generic Post5 Axis Generic Post
mr2 applies the tool length along the direction of the tool. This is
the total distance from the intersection of the tool axis and the
spindle axis to the tool tip. mr10 is used for the length along the
spindle axis. This is temporarily applied to the axis shift 'saxisz'.
Miscellaneous Reals
5 Axis Generic Post5 Axis Generic Post
mpgen5x_fanuc for Fanuc controls and table/table configuration
can be setup to use the offset registers on the machine control. It
is not necessary to offset the toolpath (use a tool length or mr10)
when using the control registers. Enable the registers with the
following variables. The offset for the length is stored in the H
register and the shift value is stored in the D register on themachine.
Miscellaneous Reals
use_g45 : 1 #Use G45 offset with right angle head (RA)g45_of_add : 30 #Add this number to tool length no. for G45 offset number
T1 M6
G0 G54 G90 Y .25 C0. B 90. S2139 M3
G45 D31 X.25
G43 H1 Z 1.375 M8
X.1
G1 X0. F6.42
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 52/68
5 Axis Generic Post5 Axis Generic Post
Enter the value to be output with the MillPlus G74 home position
in the mpgen5x_millplus post.
'mpgen5x_millplus' Miscellaneous Reals# mr3 - Mill Plus G74 toolchange X axis home position# mr4 - Mill Plus G74 toolchange Y axis home position# mr5 - Mill Plus G74 toolchange Z axis home position
5 Axis Generic Post5 Axis Generic Post
In addition to the automatic retract and approach, the user may
specify a safe Z level for rotary reposition and toolchanges. The
procedure is ignored when the value is zero. This value is not
checked against the linear limits. Note that the stock limits can
be ignored even though they must be enabled for this option
Miscellaneous Reals# mr6 - Absolute Safe height in Z for unwinds and toolchanges# (limits must be enabled and mi8, see 'use_stck_typ')# (set the limits to zero to ignore limits and use this safe height)# 0 = Off
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 53/68
5 Axis Generic Post5 Axis Generic Post
The axis shift variables can be modified through the
miscellaneous reals as shown. These must be enabled by the
post switch shown below.
Miscellaneous Reals# mr7 - Axis shift for X axis, See 'shft_misc_r'## mr8 - Axis shift for Y axis, See 'shft_misc_r'## mr9 - Axis shift for Z axis, See 'shft_misc_r'
shft_misc_r : 0 #Read the axis shifts from the misc. reals
5 Axis Generic Post5 Axis Generic Post
mr10 serves double duty to provide entry for incremental shift
from the nutating machine Z offset to the table face.
This accommodates for the distance from the part zero location to
the table offset location.For Right Angle head support with non-nutating machine types,
the value is used for the length along the machine spindle.
Miscellaneous Reals# mr10 - Nutating distance from work coordinate zero to table zero (Z axis)# Non-nutating Z axis shift with RA (See mr2)
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 55/68
5 Axis Generic Post5 Axis Generic Post
Header information can be placed in the postblock 'pheader'. The
post was written with the header information in the postblock
'psof'.
pheader #Call before start of file
##### Custom changes allowed below #####
##### Stop custom changes #####
psof #Start of file for non-zero tool number
##### Custom changes allowed below #####
Header Output
Postblock Customization
5 Axis Generic Post5 Axis Generic Post
This post has been designed to use one common postblock for
toolchange output. This is called for both SOF and toolchanges.
p_goto_strt_tl #Make the tool start up at toolchangepfd_shft_inc
psign_ang_out
##### Custom changes allowed below #####
Toolchange Output
Regular toolchanges call 'ptlchg' prior to the call to 'p_goto_strt_tl'.
ptlchg #Tool change
##### Custom changes allowed below #####
pbld, n, "M01", e
Postblock Customization
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 56/68
5 Axis Generic Post5 Axis Generic Post
Null toolchange output occurs in 'ptlchg0' and 'p_goto_strt_ntl'
postblocks. The calls to the postblocks are in this order.
ptlchg0 #Call from NCI null tool change (tool number repeats)
##### Custom changes allowed below #####
p_goto_strt_ntl #Make the tool start up at null toolchange
Null Toolchange Output
Postblock Customization
5 Axis Generic Post5 Axis Generic Post
The post uses a common postblock for the end of a tool path and the
end of the file output.
pretract #End of tool path, toolchange
pretract_movsav_absinc = absinccoolant = zero
End of Tool Output
The end of file postblock, 'peof', is called to write the NC code for
the program end. This postblock calls 'pretract'.
peof #End of file for non-zero tooltoolchng = one!gcode #to see that this is the EOF in pretractpretract
Postblock Customization
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 57/68
5 Axis Generic Post5 Axis Generic Post
The postblocks for motion output are grouped starting with
'prapidout'. The variables may be reordered but 'xout', 'yout', 'zout',
'p_out' and 's_out' should be used for positioning output. These
variables output absolute or incremental based on the 'absinc'
variable.
prapidout #Output to NC of linear movement - rapid
plinout #Output to NC of linear movement - feed
pcirout #Output to NC of circular interpolation
Motion Output
Postblock Customization
5 Axis Generic Post5 Axis Generic Post
These postblocks are for specific motion output. 'ppos_cax_lin' is
called for toolplane toolpaths with rotary positioning. It's purpose is
to output the rotary moves before the linear axis motion.
'p_safe_z' is called when the miscellaneous real 6 (mr6) has been setto a non-zero value and the routine enabled by setting mi8 and
'use_stck_typ' on. The call to 'p_goto_pos' calls back to 'pncoutput'
to call the motion output.
ppos_cax_lin #Position the rotary axis before move - rapid
p_safe_z #Safe Z retract move with reposition, see mr6if safe_z_ret,[gcode = zeroza = safe_z_retp_goto_pos]
Motion Output, Special Routines
Postblock Customization
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 58/68
5 Axis Generic Post5 Axis Generic Post
The postblocks for canned drill cycles output are grouped starting
with 'pdrlcommonb'.
pdrlcommonb #Canned Drill Cycle common call, before..
pdrill #Canned Drill Cyclepdrlcommonb
Canned Drill Cycles Output
Postblock Customization
5 Axis Generic Post5 Axis Generic Post
The postblocks for canned text output are grouped starting with
'pcan'.
pcan #Canned text - before output call
pcan1 #Canned text - with move
pcan2 #Canned text - after output call
pcant_out #Canned text - build the string for output
Canned Text Output
Postblock Customization
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 59/68
5 Axis Generic Post5 Axis Generic Post
Postblocks have been provided to afford some control over the post
calculations. These are exposed to allow some flexibility with out
having to make custom PSB files.
plin0 pfd_shft_ovrd #Overide prior to shift and feed calculationif cutflag = 7,[!fr_posfr_pos = plunge_feed]
ppln_mtch_ovrd #Overide plane match, can drill is off if planes don't matchif plane_no = zero,[
Post Overrides
Postblock Customization
5 Axis Generic Post5 Axis Generic Post
Strings for error messages can be changed for language conversion.
Find this section in the post.
Post Error Messages
# --------------------------------------------------------------------------# Error messages
# --------------------------------------------------------------------------#One time message#Calculationscalcerr "ERROR-POST CALCULATION ERROR"scalcerr1 "ERROR-PRIMARY AND SECONDARY PLANES ARE COINCIDENT"scalcerr2 "ERROR-SPINDLE CAN NOT BE ALIGNED TO AXIS, SEE 'spind_align'"scalcerr3 "ERROR-SETUP FOR PRIMARY OR SECONDARY AXIS IS ILLEGAL"sratioerr "ERROR-THE CALCULATED BREAK IS OUTSIDE THE MOVES"
Post Error Messages
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 60/68
5 Axis Generic Post5 Axis Generic Post
The following slides present some typical machine types and the
basic settings required in MPGEN5X.
Typical Machine Types
Our thanks to Glenn Stephens of CAD/CAM Consulting Services
for allowing us to use his documentation.
5 Axis Generic Post5 Axis Generic Post
Rotary Table on Trunion Table
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 62/68
5 Axis Generic Post5 Axis Generic Post
Rotary Table on Trunion Table (Fadal)pang_output : 1 #Angle output options, primary
sang_output : 1 #Angle output options, secondary
str_pri_axis "A"str_sec_axis "A"
str_dum_axis "C"
mtype : 0 #Machine type (Define base and rotation plane below)
rotaxis1 = vecz #Zero
rotdir1 = vecy #Direction
rotaxis2 = vecz #Zero
rotdir2 = -vecx #Direction
pri_limlo : -9999
pri_limhi : 9999
pri_intlo : -9999
pri_inthi : 9999
sec_limlo : 0
sec_limhi : 110
sec_intlo : 0sec_inthi : 90
5 Axis Generic Post5 Axis Generic Post
Tilting Head on Tilting Head
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 63/68
5 Axis Generic Post5 Axis Generic Post
Tilting Head on Tilting Headpang_output : 0 #Angle output options, primary
sang_output : 0 #Angle output options, secondary
str_pri_axis "B"str_sec_axis "A"
str_dum_axis "C"
mtype : 2 #Machine type (Define base and rotation plane below)
rotaxis1 = vecz #Zero
rotdir1 = vecx #Direction
rotaxis2 = vecz #Zero
rotdir2 = -vecy #Direction
use_tlength : 1 #Use tool length, read from tool overall length
toollength : 100 #Tool length if not read from overall length
shift_z_pvt : 1 #Shift Z by tool length, head/head program to pivot (Z axis only)
pri_limlo : -120
pri_limhi : 120
pri_intlo : -120
pri_inthi : 120sec_limlo : -90
sec_limhi : 30
sec_intlo : -90
sec_inthi : 30
5 Axis Generic Post5 Axis Generic Post
Tilting Head on Tilting Head (Gantry)
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 64/68
5 Axis Generic Post5 Axis Generic Post
Tilting Head on Tilting Head (Gantry)pang_output : 0 #Angle output options, primary
sang_output : 0 #Angle output options, secondary
str_pri_axis "C"str_sec_axis "A"
str_dum_axis "B"
mtype : 2 #Machine type (Define base and rotation plane below)
rotaxis1 = -vecy #Zero
rotdir1 = vecx #Direction
rotaxis2 = vecz #Zero
rotdir2 = -vecy #Direction
use_tlength : 1 #Use tool length, read from tool overall length
toollength : 100 #Tool length if not read from overall length
shift_z_pvt : 1 #Shift Z by tool length, head/head program to pivot (Z axis only)
pri_limlo : -5
pri_limhi : 365
pri_intlo : 0
pri_inthi : 360sec_limlo : -135
sec_limhi : 135
sec_intlo : -135
sec_inthi : 135
5 Axis Generic Post5 Axis Generic Post
Rotary Table/Tilting Head
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 65/68
5 Axis Generic Post5 Axis Generic Post
Rotary Table/Tilting Headpang_output : 0 #Angle output options, primary
sang_output : 0 #Angle output options, secondary
str_pri_axis "A"str_sec_axis "B"
str_dum_axis "C"
mtype : 1 #Machine type (Define base and rotation plane below)
rotaxis1 = vecz #Zero
rotdir1 = vecy #Direction
rotaxis2 = -vecx #Zero
rotdir2 = vecz #Direction
pri_limlo : -9999
pri_limhi : 9999
pri_intlo : -9999
pri_inthi : 9999
sec_limlo : -5
sec_limhi : 180
sec_intlo : 0sec_inthi : 180
5 Axis Generic Post5 Axis Generic Post
Rotary Table/Tilting Head (Cincinnati)
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 66/68
5 Axis Generic Post5 Axis Generic Post
Rotary Table/Tilting Head (Cincinnati)pang_output : 0 #Angle output options, primary
sang_output : 0 #Angle output options, secondary
str_pri_axis "B"str_sec_axis "A"
str_dum_axis "C"
mtype : 1 #Machine type (Define base and rotation plane below)
rotaxis1 = vecz #Zero
rotdir1 = vecx #Direction
rotaxis2 = vecz #Zero
rotdir2 = vecy #Direction
use_tlength : 1 #Use tool length, read from tool overall length
toollength : 100 #Tool length if not read from overall length
shift_z_pvt : 1 #Shift Z by tool length, head/head program to pivot (Z axis only)
pri_limlo : -9999
pri_limhi : 9999
pri_intlo : -9999
pri_inthi : 9999sec_limlo : -30
sec_limhi : 120
sec_intlo : -30
sec_inthi : 120
5 Axis Generic Post5 Axis Generic Post
Rotary Table on Rotary Table (Nutating)
7/21/2019 5 Axis Generic Post
http://slidepdf.com/reader/full/5-axis-generic-post 67/68
5 Axis Generic Post5 Axis Generic Post
Rotary Table/Rotary Table (Nutating)
top_map : 0 #Output toolplane toolpaths mapped to top view
str_pri_axis "C"
str_sec_axis "B"
str_dum_axis "A"
str_n_a_axis "A5="
str_n_b_axis "B5="
str_n_c_axis "C5="
mtype : 3 #Machine type (Define base and rotation plane below)
rotaxis1 = vecy #Zero
rotdir1 = vecx #Direction
rotaxis2 = vecz #Zero
rotdir2 = vecx #Direction
p_nut_restore #Postblock, restores original axis settings
result = updgbl(rotaxis1, vecy) #Zeroresult = updgbl(rotdir1, vecx) #Direction
result = updgbl(rotaxis2, vecz) #Zero
result = updgbl(rotdir2, vecx) #Direction
Note: These setting reflect a Deckel Maho Gildemeister machine
tool with the ISO MillPlus control. The 'mpgen5x_millplus' generic
5 axis post should be modified in this case.
5 Axis Generic Post5 Axis Generic Post
Rotary Table/Rotary Table (Nutating)nut_ang_pri : -45 #Nutating head secondary axis angle from machine Z positive
saxisx : 0 #The axis offset direction?
saxisy : 0 #The axis offset direction?
saxisz : 0 #The axis offset direction?
n_saxisx : 0 #The axis offset direction?
n_saxisy : 0 #The axis offset direction?
n_saxisz : 6.1027 #The axis offset direction?
top_type : 3 #With 'top_map' select the top toolplane output
pri_limlo : -9999
pri_limhi : 9999
pri_intlo : -9999
pri_inthi : 9999
sec_limlo : -9999
sec_limhi : 9999
sec_intlo : -9999
sec_inthi : 9999