Creating a Mill-Turn Postprocessor Part 1
This is the first in a series of articles on creating a Mill Turn postprocessor. In this article, I will go through creating the postprocessors and configuring the Mill Turn NX CAM template file. In future articles, I will address customizing the postprocessor.
Mill-Turn CAM Template
The first thing that we need to do is set up the NX CAM Configuration file and the NX CAM template part. Refer to Creating a Custom NX Cam Configuration File and Creating a Custom CAM Template for instructions on how to do this. The only additional thing you need to do in you NX CAM Template part is assign the different postprocessors to the different methods in your NX CAM file. So for our example, we are going to have 3 postprocessors, one lathe and two mills. Therefore, at the very least, we need three methods in or NX CAM file; however, you would probably have more because you have would rough, semi-finish and finish methods for both milling and turning as well as methods for Polar coordinates and XYZC coordinates potentially.
As always, the easiest way to customize NX CAM is to copy the default file into the appropriate directory in your custom CAM directory and then change it. So, copy MillTurn_Exp.prt from the default template_part directory and put in your custom template_part directory, rename it to whatever you want and add it to your custom CAM configuration file. Then open it and select the Method view for the Operation Navigator – it should look like what you see below.
As you can see, there are both Mill methods (which include the drill methods) and lathe methods. These methods include settings such as tolerances, stock and feedrates just like any other methods; however, they also include Start Events that alert the postprocessor as to which postprocessor each operation needs to use. So you create all your CAM operations and assign them to the appropriate method groups and then before each operation, NX alerts the postprocessor as to what type of operation is coming next and which postprocessor is needed. Right click on one of the methods and go to Object and then Click Start Events and you should see a screen like the one below. I chose a Lathe method, so the head name passed with the event is TURN. This tells the postprocessor that it needs to be using the postprocessor associated with TURN. For the milling methods, the head names that we need are xhead and zhead (these correspond with the default postprocessor that we will be looking at). This particular CAM template is intended for a machine that only has milling capabilities in the Z axis; therefore, we are going to need to add/edit the milling methods.
So, copy all of the milling methods and then rename them so that half of them have ZHEAD on the end and the other half have XHEAD on the end. Then you need to edit the start event for each of them and put in the appropriate head name. You can also delete the Live Tooling Mode event because we are looking at a machine with only one turret. The Start Events for one of the ZHEAD method is shown.
That’s it for the CAM template. Now you can create a CAM file with your template and start putting in turning and milling ops and all you have to do is make sure they are in the right method and the right MCS (depending on how you set up the coordinate systems on the machine).
Now let’s look at the postprocessor. Again, we will start with a postprocessor that is supplied with NX and take a look at how it works with the CAM template. If you take a look in default postprocessor directory, you will see a few mill turn postprocessors. Some are generic (they just say millturn) and some are machine specific (like the Mori NL1500Y). We are going to look at millturn_4axis_mill, so open up Postprocessor Builder and select Open and then browse to the default postprocessor directory and select the millturn_4axis_mill postprocessor and you should see the screen below.
So, essentially, this is a 4 axis mill postprocessor. The only difference is on this screen, you have the option of specifying whether this is a Simple Mill-Turn or an XZC Mill, you specify whether or not the machine can position the tool in the Y-axis and whether or not your machine can take Cartesian coordinates. For this particular postprocessor, we have an Initial Spindle Axis of Z and the Default Coordinate mode is Polar and the Machine Mode is XZC Mill. If your machine is essentially a lathe with live tooling, then you could select Simple Mill-Turn and choose lathe_tool_tip for the lathe postprocessor and then the postprocessor uses the operation type to switch between your mill postprocessor and your lathe postprocessor, so you don’t need the Start Events in the Methods in the NX CAM template part; however, because we are also going to configure a postprocessor for milling with tools perpendicular to the spindle, we need to check XZC Mill and link 3 postprocessors together.
In milling mode, an XYZC Mill-Turn machine is just a XYZ Mill with a 4th axis mounted on the table, so if you click Rotary Axis in the tree view, you see the same options that you would for a 4 axis mill. The options set below are typical.
Because we did not select the Simple Mill-Turn option, we need to go to the Linked Postprocessors tab on the Program & Tool Path tab and specify the lathe postprocessor that we want to use as well as the postprocessor that will be used for milling perpendicular to the lathe spindle axis. This is shown below. Whenever you have linked postprocessors, one postprocessor is the master postprocessor. The master postprocessor is the postprocessor that is used for the Start of Program sequence and is also the only postprocessor that has linked postprocessors specified. So the millturn_4axis_mll postprocessor is the master postprocessor and the lathe_tool_tip and millturn_side_spindle postprocessors are the linked postprocessors
The lathe_tool_tip postprocessor is just a basic lathe postprocessor. Remember, the Start of Program and End of Program event sequences are taken from the master postprocessor, which in this case is the millturn_4axis_mill postprocessor. The few settings on the Machine Tool – General Parameters tab and the linked postprocessors are all that set this postprocessor apart from any other 4 axis mill postprocessor.
Let’s take a quick look at the millturn_side_spindle postprocessor. As you can see, the settings are the same as those for the millturn_4axis_mill postprocessor, except the Initial Spindle Axis is now +X and the Position in Y-Axis setting is no longer greyed out. If your machine can position in Y, then check this box.
Other than that, this postprocessor is just a 4 axis mill postprocessor. It does not have any linked postprocessors, because only the master postprocessor has linked postprocessors.
So, NX essentially comes with enough postprocessors and CAM templates to cover the majority of mill-turn machines out there, you may just have to do a little tweaking to get what you want. The millturn_3axis_mill postprocessor covers a simple lathe with live tooling where the tooling axis is Z only. The millturn_4axis_mill postprocessor covers a mill-turn machine like we have been talking about here. The millturn_baxis_5axis postprocessor covers a mill-turn machine with a milling head that rotates in the XZ plane. This postprocessor is simply a 5 axis milling postprocessor that is linked to a lathe postprocessor. Then, if you have multiple spindles and multiple turrets, you just link additional postprocessors to the master for all the different sets of kinematics.
Next time, we will take a closer look at the postprocessors that we talked about here and customize them a little.