You are interested in our Newsletter?

Which one would you like to join? Please select one or more options.


CNC and Machine Tools





Real time collision avoidance on the CNC controller Part II

Monday May 22nd, 2017

Part II In the last article we explained why real-time collision detection on the CNC controller is indispensable and how the ModuleWorks CNC Simulator provides real-time collision prevention. In this article we explain the best practices for optimizing the real-time performance of the ModuleWorks CNC Simulator.

How to implement real-time CNC simulation
Despite the built-in real-time behavior of the ModuleWorks CNC Simulator, the processing power of the CNC controller remains a limiting factor for achieving real-time simulation. If your machine model is very detailed, the CNC controller might not be able to generate the real-time response required for CNC simulation. But not all of the detail is necessary for collision detection and there are techniques you can use to reduce the detail of your model without affecting the reliability of the collision detection algorithms.

Minimize the mesh data
A simple way to reduce detail without affecting the quality of the machined product is to minimize the amount of triangle mesh data. There is a difference between the amount of mesh detail required for graphic visualization in the CAD/CAM software and the amount required to check for collisions on the machine. For example, for collision checking there is no need to retain geometric information about shapes that are completely surrounded by an outer shell. To avoid a collision you only need to retain the outer geometric shell. Another easy place to reduce detail is drill holes and screws. Assume you want to produce a perforated metal plate. Depending on the number of holes, you might need hundreds or even thousands of triangles to produce a high quality graphic model of the plate. But the holes are irrelevant for collision checking and can be removed to leave a simple plate consisting of just two triangles. This can significantly boost the real-time performance of the CNC controller.

Bounding volumes
Reducing the mesh detail is important, but the total number of shapes in the model is another important factor. Collision prevention requires each triangle to be checked against all the other triangles in the model. So, the less triangles in your model, the faster the simulation. A well established technique to reduce the amount of checking is to use bounding volumes. These are simple volumes that fully contain more complex geometries. By checking the bounding volumes, you can be sure there are no collisions. There is no need to check the more complex geometries inside the boundaries. This reliable technique minimizes the amount of checking and accelerates real-time performance. Real time collision avoidance on the CNC controller - Part2
There are different types of bounding volume. The best known are bounding spheres, axis aligned bounding boxes and oriented bounding boxes. Bounding spheres are the simplest, but have a relatively poor coverage for typical engineering parts. The boxes are more complex but the coverage is good. It is a trade-off between the complexity of the bounding volume and how well the bounding volume covers the geometry of the complex shapes. More complex bounding volumes offer better coverage and more accurate collision checking, but they slow down the real-time performance of the CNC controller. The trade-off is summarized below:

Bounding volume Coverage Complexity Geometry
Spheres Poor Simple
Axis aligned boxes Good Moderate Edges run along standard axes in Euclidean space
Oriented boxes Very Good Complex Edges run along a local coordinate system

Platform specific optimization
Reducing the complexity of the machine model is something that works on any hardware / platform combination. But there are also techniques specific to the CPU and hardware configuration that can significantly boost the real-time performance of CNC simulation and collision checking. ModuleWorks has been involved in many successful integration projects for CNC Simulation technology, and we have gathered strong experience with different hardware / platform combinations ranging from small-scale ARM based CPUs up to standard desktop based x86 compatible CPUs with high TDP thermal allowances. This experience helps us advise our partners on how to fine-tune the simulation parameters to give an optimal user experience across a variety of platforms.

In this two part article we have explained why real-time collision avoidance software on the CNC controller is indispensable for meeting the demands of today’s and tomorrow’s machining processes. We have also explained some of the techniques you can use to optimize the ModuleWorks CNC Simulator. The ModuleWorks team of experts can help you get the most out of your real-time CNC simulation, please get in touch with us to find out more.

See Real time collision avoidance on the CNC controller – Part I

About ModuleWorks
ModuleWorks is a software component provider for the CAD/CAM industry. ModuleWorks’ expertise in toolpath creation and simulation is recognized throughout the CAM industry and its software components and development services are used by the majority of the leading CAM vendors. ModuleWorks 5-Axis and Simulation software has been used in the manufacture of complex parts for over a decade and they have many users across the global CAD/CAM industry.