0 Introduction
Robot programming and simulation software is an indispensable tool in industrial robot applications and research. The medical programming and simulation system introduced in this paper is a medical project application based on the industrial robot offline programming software HedraCAM. Compared to industrial robots, medical applications demand higher cleanliness and hygiene standards for robot hardware, as well as more stringent software requirements. HedraCAM software features powerful graphical programming capabilities, enabling convenient extraction of topological paths and generation of robot-executable machining programs. Its accessibility analysis functionality assists users in path optimization, and the simulation results are consistent with actual robot operation, effectively supporting production and reducing machining cycle times.
The core of the robotic radiation therapy system is interactive robotics technology, based on a 6-axis robot achieving 0.05mm positioning accuracy. The system consists of six subsystems: the robot system, real-time image tracking and positioning, infrared synchronous tracking cameras, treatment planning system, and quality assurance and control. This fully integrated system can receive real-time feedback on patient tumor position changes caused by breathing motion. Based on this feedback, the robot system continuously tracks the dynamic position of the tumor during motion, automatically and continuously delivering each treatment beam with sub-millimeter accuracy.
The robot system consists of three robots (treatment table robot, C-arm imaging system, and particle beam treatment robot), combined with robot safety systems and complex dynamic modeling systems. The robots require extensive real-time data exchange among all hardware and software components. The scanning programming and control software for these three robots is critical to ensuring safe and efficient radiation therapy.
1 HedraCAM Programming and Simulation System Features
1.1 Layout Construction
HedraCAM employs triangular mesh-based model technology, with the significant advantage of being lightweight. HedraCAM offers a rich library of model components with over 10 types of modeling elements that users can freely combine for custom model construction. The system can read mainstream CAD software models from CATIA, UGS, Pro/E, SolidEdge, SolidWorks, and others, supporting file formats including *.3ds, *.dwg, *.dxf, *.dgn, *.stl, *.STEP, and *.IGES.
1.2 Motion Control
Motion models constructed through HedraCAM require corresponding motion control algorithms to drive and manage robot actions. HedraCAM is a highly customizable simulator where almost every programming and simulation step can be user-defined. It also supports customization of robot and automation tool motion control through templates or Python script programming. In the industrial robotics field, its algorithms support multiple rotary axis robots or machine tools, as well as production line fixtures, personnel, conveyor belts, and other auxiliary equipment, including serial and parallel configurations with various slide rails and positioners.
Figure 1: Motion Control Algorithm
1.3 Topological Paths
Existing path generation methods can only generate paths for idealized models. If model files are too complex with too many fragments, the generated cutting paths will contain many errors. HedraCAM software can repair complex model files, delete invalid data, retain useful information, and consolidate fragments into an idealized complete model, then use mature topological technology to generate robot paths.
Figure 2: Topological Path
1.4 Collision Detection
Collision detection is one of the important problems in robot trajectory planning and computer programming simulation. HedraCAM can perform collision detection between two entities in a flexible manner. Its collision detection module enables rapid identification of various interferences and collisions among geometric components, calculates minimum distances between multiple components, and provides real-time visualization in the interface. Users can customize collision tests using the collision detection editor with visualized collision states displayed in different colors.
Figure 3: Collision Detection
1.5 Virtual Programming Simulation
Virtual programming simulation can virtually run generated robot paths and trajectories. During execution, collision detection can be enabled or disabled at will. Position reachability detection and other functions allow pausing, continuing, or resetting the simulation. Users can switch between virtual and real-time modes, freely control simulation step increments for acceleration or deceleration, and record the entire simulation process as PDF animations or MP4 video files.
2 Medical Application of HedraCAM Programming and Simulation System
The medical system consists of medical hardware devices, image processing systems, position tracking systems, robots, patients, and other elements. The medical system application software, as an important component, consists of two subsystems: the offline construction system and the online implementation system.
When formulating treatment plans for tumor patients, the workflow is as follows: the offline system first generates original discrete waypoints based on patient tumor characteristics, filters them with relevant parameters to obtain a safe reachable workspace. The image system then selects the optimal treatment point set from the safe workspace. The offline software performs path planning on the treatment point set to meet application requirements, and finally the programming and simulation system verifies treatment path feasibility through simulation. After the treatment plan is completed, the online system can remotely control treatment room robot equipment to treat patients while synchronously simulating equipment operating status.
Figure 4: Medical System Elements
2.1 Offline Construction System
2.1.1 Scene Layout
This application references the CyberKnife robotic surgery platform to construct a radiation therapy robotic surgery platform. The platform consists of two 6-joint serial robots: the treatment head robot and the treatment table robot. The treatment head robot connects to an external axis — the rotary positioner (C-arm imaging system), and the treatment table robot connects to an external axis — the linear slide rail. The center of the C-arm is the treatment sphere center. During treatment, the treatment table robot delivers the patient's tumor center to the C-arm center, and the treatment head robot performs radiation therapy on the tumor center according to the physician's treatment plan, with the C-arm following the motion.
Figure 5: Radiation Therapy Robotic Surgery Platform
(Note: 1. Treatment head robot, 2. Treatment head, 3. C-arm, 4. Patient, 5. Treatment sphere, 6. Treatment table, 7. Slide rail, 8. Treatment table robot)
2.1.2 Safe Workspace
A treatment safety zone must be constructed for human tumors. The treatment safety zone is the spherical area set where, when the treatment table robot delivers the tumor center to the treatment sphere center position, the treatment head robot TCP moves along this zone and all components in the robotic surgery system maintain distances beyond the safe distance, preventing any collision.
2.1.3 Path Planning
Based on the patient's condition, physicians filter and select specific spherical points as optimal treatment positions from all reachable workspace discrete point sets. These initial treatment point sets are unordered and require path planning. The overall principle uses spherical arc transitions: points at the same latitude or longitude use arc transitions, while transitions between different latitudes/longitudes require right-angle transition points.
2.1.4 Treatment Plan Storage
After simulation confirms path safety and reliability, the filtered and path-planned treatment plan can be saved as specific data files for online control system use.
2.2 Online Implementation System
2.2.1 Real-time Communication Configuration
Online robot control depends on whether the robot controller can perform real-time data transmission with the host computer. This application uses KUKA robots, where EthernetKRL is one of multiple external communication options. The module first configures the data format for communication channels, then writes corresponding control program code into the robot control system, and exchanges data with external systems through relevant interfaces.
2.2.2 Remote Online Control
The online control panel consists of treatment plan data management, connection status display, treatment operation control, emergency status control, real-time data file storage, and other functions. Connection status is displayed in three colors: white (initial), green (connected), and red (connection failed).
2.2.3 Synchronized Programming Simulation
The real-time data storage module in the online control panel saves robot controller real-time data to a specified file at approximately 20ms frequency, including real-time Cartesian coordinates, joint angles, and orientation information. Users can view and analyze this data. Meanwhile, through special programming of the real-time information transmitted via the real-time status channel, the simulation panel's moving components can be synchronized with actual equipment actions. Physicians can monitor the simulation interface in the control room to remotely observe equipment operating status in the treatment room.
3 Conclusion
This paper primarily introduces HedraCAM software features and its medical applications, demonstrating the construction of a radiation therapy robotic surgery platform for tumor treatment. The application of robots in the medical industry has become a current development trend, and robotic radiation therapy systems represent the most advanced tumor treatment technology today, suitable for treating tumors throughout the body with particularly significant advantages for thoracic tumors, lung cancer, liver cancer, pancreatic cancer, head and neck tumors, prostate cancer, retroperitoneal tumors, various localized lymph node metastases, and local recurrences. The entire treatment process takes approximately 30-90 minutes, representing the only form of whole-body radiation surgery that is wound-free, pain-free, bloodless, anesthesia-free, and requires no recovery period.