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
Hwacheon Machinery America, Inc.
Featured Content
View MoreECi Software Solutions, Inc.
Featured Content
View MoreTakumi USA
Featured Content
View MoreThere 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
The Intersection of Work, Play, Technology and Independence
The February issue dives into digital technologies that not only streamline production, but make a tangible difference in people’s lives.
Read MoreThe Power of Practical Demonstrations and Projects
Practical work has served Bridgerland Technical College both in preparing its current students for manufacturing jobs and in appealing to new generations of potential machinists.
Read MoreHow this Job Shop Grew Capacity Without Expanding Footprint
This shop relies on digital solutions to grow their manufacturing business. With this approach, W.A. Pfeiffer has achieved seamless end-to-end connectivity, shorter lead times and increased throughput.
Read MoreImprove Machining Efficiency Through Digital Twin Simulation
Full simulation of a machining cycle using digital twins can not only identify crashes before they happen, but provide insights that enable the user to reduce cycle times.
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