91ÊÓÆµÍøÕ¾ÎÛ

Published

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

Leaders-In background

Custom macros can improve safety and quality when used correctly within CAM systems. Photo: Getty

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

CAD/CAM

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 More
CAD/CAM

Bringing Machining In-House to Keep up With Demand for Offroading Parts

To meet demand increases for its Ford offroad industry components, supplier RPG Offroad brought its machining processes in-house, saving the company nearly $50,000 per month. Here’s how its choice of integrated CAD/CAM software made it happen.

Read More
Sponsored

Building 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 More
CAD/CAM

TTI Brings Specialty Gear Production In-House with Multiaxis Machining

By investing in a 3+2-axis machine and utilizing simulation software for diagnostic checks, Techtronic Industries turned a four- to ten-week lead time into a one- to two-week lead time.

Read More

Read Next

Economics

Last Chance! 2025 Top Shops Benchmarking Survey Still Open Through April 30

Don’t miss out! 91ÊÓÆµÍøÕ¾ÎÛ's Top Shops Benchmarking Survey is still open — but not for long. This is your last chance to a receive free, customized benchmarking report that includes actionable feedback across several shopfloor and business metrics. 

Read More
Automation

AMRs Are Moving Into Manufacturing: Considerations for Implementation

AMRs can provide a flexible, easy-to-use automation platform so long as manufacturers choose a suitable task and prepare their facilities.

Read More
Top Shops

Machine Shop MBA

  Making Chips and 91ÊÓÆµÍøÕ¾ÎÛ are teaming up for a new podcast series called Machine Shop MBA—designed to help manufacturers measure their success against the industry’s best. Through the lens of the Top Shops benchmarking program, the series explores the KPIs that set high-performing shops apart, from machine utilization and first-pass yield to employee engagement and revenue per employee.  

Read More