When to Use Custom Macros With a CAM System
Custom macros can offer benefits even when using a CAM system to prepare programs – but must be implemented with the right considerations.
Share
There are some applications in which computer aided manufacturing (CAM) systems and the use of custom macros truly conflict. With part families, for example, the application should be handled using one method or the other, but not both. Additionally, with certain canned cycle applications, like thread milling or bolt circle patterns, a CAM system can easily generate the required G-code commands, often making the use of canned cycle custom macros seem inappropriate.
Too many people in manufacturing conclude from this that, when using a CAM system to prepare programs, there is no reason to use a custom macro. But there are things that custom macros can do, often behind the scenes, that improve safety, minimize mistakes, improve quality and reduce production time. There are also situations when machine actions must be taken in real time based upon some condition that exists when the machine is in cycle. In these cases, a CAM system cannot help — but a custom macro running in the CNC can make the related decisions.
Utility Applications. I call any custom macro enhancing the way a CNC machine behaves a utility application. As Ben Staats of Abcissa Ordinate LLC puts it, “I like the term ‘marriage’ of CAM to macros for the fact that when you mix in program restarts that require human intervention on bridge mills where castings are expensive, things must happen correctly — and utility macros fit the bill.”
Ben’s utility application involves tracking the current origin point for multiple surfaces being machined on a bridge mill. Up to five sides of the workpiece could be worked on, and if the incorrect origin is selected or if the origin position is improperly entered (by operator error), the result would likely be a machine crash.
A CAM system will, of course, correctly output programmed coordinates for any of the five sides being machines. But it cannot properly determine the position of the workpiece on the machine table, nor can it assign the related program origins. This was done by a custom macro and only after the setup was made.
There are many times when utility custom macros enhance the ways CNC machines behave, regardless of the programming method used to create the G-code program. Often, setup programs assigning program zero involve custom macro techniques. Indeed, if a touch probe is used with a FANUC CNC, there are custom macros used to control it.
Custom macros also allow people to error-trap certain mistakes that operators make. If a mistake is made, the custom macro can generate an alarm that stops the machine. Common mistakes trapped in this fashion include improper offset entries, incorrect specification of axis starting position and attempting to run the wrong program. Any time a mistake is made, the possibility of “trapping” it with custom macro should be considered. No CAM system will have access to the real-time data needed to trap these kinds of erroneous conditions at the machine.
Real-time applications. As stated, custom macros run in real time — while the machine is in production. A spindle probe may, for example, measure the amount of raw material that is on a given surface for machining. The related custom macro can then determine the number of machining passes that must be made. A CAM system cannot do this since the number of required passes will change based on probing results. This data is not available to the CAM system at the time of program creation.
Canned-cycle applications. Most CAM systems do generate G code that incorporates the use of certain canned cycles. For machining centers, most will take advantage of hole-machining canned cycles (G81, G82, G83 and the like). For turning centers, many specify threading to be done by a canned cycle. This shortens the G-code program and makes it easier to manipulate the way machining occurs at the machine with simple program edits.
Consider other possibilities when shortening programs or providing more control of program behavior at the machine. A company may be using end mills to rough machine round pockets or cored holes using helical motion. This provides a way to machine deep holes with an end mill that has a short flute or insert. Again, a CAM system can easily generate the G-code commands to helix mill based upon a specified depth-of-cut per pass, but many commands will be required and there will be no way to change the depth per pass at the machine.
If a CAM system can generate a calling command to the related custom macro (all current CAM systems should allow this), it can create a helix-milling custom macro and keep it in the CNC memory. This will allow CNC users to easily change the depth per pass and anything else about how helix milling is done right at the machine.
Getting back to Ben’s marriage analogy, be sure the custom macro applications elected to use with CAM system programming are compatible. As with any good marriage, eliminating conflict is a job all its own.
Related Content
Can ChatGPT Create Usable G-Code Programs?
Since its debut in late 2022, ChatGPT has been used in many situations, from writing stories to writing code, including G-code. But is it useful to shops? We asked a CAM expert for his thoughts.
Read MoreBuilding A Powerful Bridge from the CAM Programmer to the Shop Floor Operator
SolidCAM for Operators provides a powerful bridge from CAM programming to the shop floor to best streamline the machine shop process with its CAM part simulation. It provides a clear picture to the operator for setup and prove-out, enables minor G-Code changes and avoids crashes, broken tools and scrapped parts.
Read MoreAdvanced CAMs Simplify Programming of Conical Barrel Cutters
Conical barrel cutters have grown in popularity thanks to the large stepovers that reduce the time needed for some finishing processes, but advanced CAM systems can dramatically improve their usefulness.
Read MoreLarge-Format Machining With Small Cutting Tools and Dynamic Motion
Napoleon Machine, a defense contractor that provides parts for the M1 Abrams tank, recently took advantage of a CAM feature that allowed the company to streamline its cutting strategies and program offline. Here’s how the shop cut cycle times nearly in half with its large-format five-axis machining operations.
Read MoreRead Next
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 More5 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 MoreBuilding 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