YCM Alliance
Published

Divide and Conquer

For simplicity, break up your part family custom macro into multiple programs.

Share

Leaders-In background

Last month we stressed the importance of minimizing the amount of process-specific information in input data (the part definition program). Ideally, the person inputting data should be able to get everything he needs right from the blueprint. This means you must build process-related intelligence into your custom macro(s).

Let’s take this concept further. Regardless of how complex your application, I recommend breaking up your part family custom macro into several programs. If you use common variables (#100 or #500 series) to store data, this data will remain active at least until the power is turned off, so variables set in one program will be available in others.

One advantage of the divide and conquer method is that the main program will remain short and simple. Here is an example:

O0001 (Ring turning center program)
M98 P1000 (Call part definition program)
M98 P8001 (Call system constants program)
M98 P8003 (Call cutting conditions program)
M98 P8004 (Call tool selection program)
M98 P8002 (Call error trapping program)

N1 (Side one, process one – rough face and turn)
M98 P8031 

N2 (Side one, process two – rough bore)
M98 P8032

N3 (Side one, process three – finish bore thru and face)
M98 P8033
N4 (Side one, process four – finish turn)
M98 P8034

M30 (End of program)

The M98 commands get everything ready; N1 through N4 command the machining operations and provide restart blocks should cutting tools need to be rerun. This program could be shortened even more by combining all the M98 commands in a separate sub-program.

Program O1000 (input data): This is the series of common variables set to workpiece attribute values that are needed by the custom macro(s) to machine the workpiece.

Program O8001 (system constants): Use system constants instead of writing fixed values in the machining programs. This way, should a constant need to be changed, you need only do it in one place. For example, it is common to use a rapid approach distance of 0.1 inch. Consider how many times you reference this value during motion commands. Changing it with traditional methods requires changing a lot of commands. With a system constant, you only have one value to change. Any time you find yourself writing a fixed value in a program is probably a good time to use a system constant.

Program O8003 (cutting conditions): This program will be especially helpful if parts in your family must be made from several different materials. If your input data includes a material specification, you can easily key on this value to determine which set of cutting conditions must be used. Consider this example in which common variable #101 is set in the part definition program to the material specification (1018 or 1045):

O8003 (Cutting conditions)
IF [#101EQ1018.0] GOTO 1018
IF [#101EQ1045.0] GOTO 1045
#3000=104 (Material specification not found)
N1018 (1018 material)
#161=0.125 (Depth of cut for rough face and turn)
#151=425 (sfm for rough face and turn)
#152=0.012 (ipr for rough face and turn)
#162=0.08 (Depth of cut for rough boring)
#155=400 (sfm for rough bore)
#156=0.01 (ipr for rough bore)
#157=450 (sfm for finish bore)
#158=0.008 (ipr for finish bore)
#159=500 (sfm for finish turn)
#160=0.009 (ipr for finish turn)
N20 GOTO 99
N1045 (1045 material)
#161=0.1 (Depth of cut for rough face and turn)
#151=425 (sfm for rough face and turn)
#152=0.012 (ipr for rough face and turn)
#162=0.07 (Depth of cut for rough boring)
#155=400 (sfm for rough bore)
#156=0.01 (ipr for rough bore)
#157=450 (sfm for finish bore)
#158=0.008 (ipr for finish bore)
#159=500 (sfm for finish turn)
#160=0.009 (ipr for finish turn)
N40 GOTO 99
(More materials here)
N99 M99

Program O8004 (tool station selection): Like the cutting conditions program, this program will provide logic to determine which cutting tool stations are currently being used. This is especially important if a given machining operation requires a different cutting tool based on the size of the related workpiece attribute. 

Program O8002 (error trapping): Ensure that all input data is acceptable before you allow any machining to take place. Test anything you think a person may incorrectly specify. As you begin using your part family program, watch for mistakes and add more error trapping as needed.

Programs O8031-O8034 (machining): Notice how each machining operation is contained in a separate program. All commands needed for each tool must be included.

 

YCM Alliance
World Machine Tool Survey
Starrett W9400 Touch Screen Indicator
Innovative Manufacturing for the Medical Industry
MMS Made in the USA
QualiChem Metalworking Fluids
To any Measurement Question there is an Answer
JTEKT
MWI
KraussMaffei
High Accuracy Linear Encoders
Hurco

Related Content

CNC Tech Talks

Troubleshooting Differences in Programming Methods, Machine Usage

Regardless of the level of consistency among machines owned by your company, you probably have experienced consistency-related issues. Here are some tips to help solve them.

Read More
CNC Tech Talks

4 Commonly Misapplied CNC Features

Misapplication of these important CNC features will result in wasted time, wasted or duplicated effort and/or wasted material.

Read More
CNC Tech Talks

3 Mistakes That Cause CNC Programs to Fail

Despite enhancements to manufacturing technology, there are still issues today that can cause programs to fail. These failures can cause lost time, scrapped parts, damaged machines and even injured operators.

Read More
CNC Tech Talks

6 Ways to Streamline the Setup Process

The primary goal of a setup reduction program must be to keep setup people working at the machine during the entire setup process.

Read More

Read Next

5 Rules of Thumb for Buying CNC Machine Tools

Use these tips to carefully plan your machine tool purchases and to avoid regretting your decision later.

Read More
Workforce Development

Building Out a Foundation for Student Machinists

Autodesk and Haas have teamed up to produce an introductory course for students that covers the basics of CAD, CAM and CNC while providing them with a portfolio part.

Read More

Registration Now Open for the Precision Machining Technology Show (PMTS) 2025

The precision machining industry’s premier event returns to Cleveland, OH, April 1-3.   

Read More
YCM Alliance