Share this

Design and Implementation of an Open EDM Numerical Control System Based on DSP

2026-04-06 06:37:25 · · #1
Hu Jianhua and Xu Qihua from the Department of Mechanical Engineering, Huaihai Institute of Technology, and Wang Wei from the School of Mechanical and Electrical Engineering, Nanjing University of Aeronautics and Astronautics, introduced the design and implementation technology of an open-architecture EDM CNC system based on a digital signal processor (DSP). They presented the main structure and functions of the system's hardware and software, and focused on analyzing the DSP's tasks and operating procedures. Position and speed closed-loops were achieved through speed and acceleration feedforward filtering, thus ensuring the system's static accuracy and dynamic performance. Finally, a successful CNC system retrofit application to a TM735 EDM machine was presented as an example. 1 Introduction In recent years, with the development of LSI technology, some large foreign companies such as Texas Instruments and Analog Devices have launched a new type of microprocessor chip, the digital signal processor (DSP). Some DSPs, in addition to increasing the capacity of on-chip RAM and off-chip addressing capabilities, have also increased the number and speed of serial/parallel ports, and added counting timers, ADCs, DACs, etc. Their instruction processing time has increased to tens of nanoseconds, and their data throughput capacity has reached tens of MIPS or higher, making them very suitable for high-speed data acquisition systems and real-time control systems with large data volumes. Abroad, DSPs are widely used in fields such as communication, remote sensing, voice and image processing, electronic measurement, automatic control, and pattern recognition; however, the application of DSPs in my country is still in its early stages. In CNC machining, especially in EDM (Electrical Discharge Machining), the CNC system is required to process position signals and intermittent voltage signals within a very short time. EDM is a highly complex process, and using DSPs enables rapid adjustment of process parameters, thereby significantly improving labor productivity. Therefore, applying DSPs to the development of high-performance EDM CNC systems is a sound strategy. Currently, most manufacturers capable of producing CNC EDM machines use Siemens CNC systems from Germany or various systems manufactured in Taiwan. These products are technologically mature and often employ new technologies such as 32-bit RISC chips, mathematical coprocessors, and dynamic memory, further improving system speed and accuracy. However, they use non-standard buses, resulting in poor openness. Currently, general-purpose computers are used as the foundation of CNC systems. Leveraging the abundant hardware and software resources and ease of upgrading with general-purpose computers, this approach maintains technological leadership and has a promising future. PC-based CNC systems have become the mainstream of international CNC system development. In light of this, this paper, based on in-depth research into open architecture, directly applies the latest advancements in microelectronics and computer technology—the Texas Instruments TMS320C40 DSP chip. Appropriate components and parts are selected to improve hardware reliability and compatibility by reducing their number. In terms of software design, a modular and open structure is adopted, incorporating various valuable application software to improve system functionality. A DSP-based open EDM CNC system has been successfully developed and applied in actual production. This system offers good compatibility and is convenient for maintenance and upgrades. 2 Hardware Design of the Open CNC System 2.1 System Hardware Structure The core of this open architecture is the development of an open multi-axis motion control card with an STD/PCI04 bus and a built-in high-speed DSP chip. This card, together with an embedded PC host, forms a multi-processor structure, fully utilizing the DSP's high data throughput of tens of MIPS and instruction cycles as short as tens of nanoseconds. These characteristics are ideal for high-speed data acquisition and real-time control, thereby enabling functions such as real-time electrical discharge machining intermittent voltage acquisition, high-speed interpolation, and calculation. [IMG=Figure 1 Simplified Hardware Structure Diagram of CNC System]/uploadpic/THESIS/2007/11/2007111414251284097D.jpg[/IMG] Figure 1 Simplified Hardware Structure Diagram of CNC System [IMG=Figure 2 Flowchart of DSP Execution Program]/uploadpic/THESIS/2007/11/2007111414253126106W.jpg[/IMG] Figure 2 Flowchart of DSP Execution Program [IMG=Figure 3 Software Structure Diagram of PC System]/uploadpic/THESIS/2007/11/20071114142547200365.jpg[/IMG] Figure 3 Software Structure Diagram of PC System Since the motion control card can complete spatial linear and circular interpolation, the burden on the host computer is greatly reduced. At the same time, the system uses a dual-port memory method to exchange data between the host computer and the DSP, solving the input/output communication bottleneck problem. Because a standard industrial PC is used as the host, the system has a dual-CPU structure. The host (industrial PC) and DSP are directly connected via a bus, and both the host and DSP can read and write memory. Simultaneously, the host CPU can also directly read and write I/O signals and read feedback signals. The DSP uses a 50MHz TMS320C40 chip, which features a multi-bus, multi-processing unit, pipeline, and hardware multiplier structure, giving it high-speed data processing and logic control capabilities, enabling it to perform relatively complex control algorithms well. The control system can provide 4-axis closed-loop analog voltage (±10V) servo control signals, 8-channel opto-isolated limit switch signal input, 4-channel opto-isolated origin switch signal input, 16-channel opto-isolated general-purpose signal input, 16-channel opto-isolated general-purpose signal output, 8-channel 12-bit A/D conversion, and 4-channel 4x frequency photoelectric encoder feedback signal interfaces. The encoder input signal frequency can reach up to 8MHz. All input and output interfaces use opto-isolation protection to meet the needs of industrial environments. Figure 1 is a simplified hardware structure diagram of the CNC system. 2.2 System Hardware Working Principle Analysis In this control system, the DSP communicates with the computer via STD or PCI04 bus. The host computer collects data from each control axis for calculation; on the other hand, it generates motion control commands based on the process and mathematical model, exchanges data with the DSP through a dual-port memory, and the DSP sends the commands to the servo drives of each axis after calculation, completing motion control and producing qualified products that meet the process requirements. The main CPU and DSP can directly access the data bus to achieve fast communication. The motion control card does not require the PC computer to be in a communication state at all times; the computer only needs to read or write to the data bus when there is information transmission or command execution. Moreover, any motion command can be temporarily stored in the DSP's memory for execution. This facilitates the use of standardized interfaces and general software development tools, allowing for flexible system development, making the system open and universal, and enabling convenient remote control via Ethernet. 3 Software Design of the Open CNC System 3.1 DSP's Task The primary task of the DSP is to calculate the average value of the machining gap voltage over a certain time period (generally around 10ms, called the analysis cycle). This value is used to determine whether the machining state is normal, thereby controlling the gap voltage in electrical discharge machining (EDM). Unlike other machining processes, EDM does not involve cutting force; instead, it relies on the physical and chemical changes caused by spark discharge between the tool electrode and the workpiece to continuously erode the workpiece surface. In engineering practice, the average gap voltage over a detection cycle is generally used to determine the discharge state. If the gap voltage is too high, a discharge channel cannot be formed, and machining is not possible; if the gap voltage is moderate, normal machining is possible; if the gap voltage is too low, a short circuit will occur, burning the workpiece. A common method is to divide the discharge state into three regions by setting threshold voltage values ​​(Vref1, Vref2, etc.): when the discharge voltage value is higher than Vref1, it is an open circuit; when the discharge voltage value is between Vref1 and Vref2, it is a normal discharge region; and when the discharge voltage value is lower than Vref2, it is an abnormal discharge region. Traditionally, the threshold voltage value is set using empirical data. Therefore, controlling the EDM process has its own unique characteristics; it requires controlling not only the feed displacement but also the gap voltage. As mentioned earlier, the detected gap voltage value is a statistical average, which makes it difficult to set a precise threshold voltage value. Judging whether the gap voltage is too large, moderate, or too small is essentially a fuzzy judgment, thus the gap voltage exhibits fuzzy set characteristics. Using fuzzy control theory, by summarizing the operator's experience in machining processes and control, control rules are constructed using fuzzy conditional statements. Employing the minimax synthesis principle, a fuzzy machining control model is obtained. Based on the machining gap voltage and its rate of change, the input voltage value of the servo motor is inferred, generating a fuzzy control decision table. This table then controls the motor's rotation direction and speed, stabilizing the gap voltage within the set range. The second task of the DSP controller is position control, which involves running a PID servo control algorithm in each servo cycle. During position control, the DSP generates theoretical position, velocity, acceleration, and jerk in each servo cycle based on instructions from the PC. This is compared with the position, velocity, acceleration, and jerk determined by the signal feedback from the encoder, resulting in PID adjustment. The result of the PID calculation is used as the system output. In each servo cycle, the theoretical jerk acts on the theoretical acceleration, the theoretical acceleration acts on the theoretical velocity, and the theoretical velocity acts on the theoretical position. This new theoretical position is then used by the PID loop to update the analog voltage. Finally, for each sampling, the controller checks the dedicated I/O port of each axis. If a sensor is activated, the controller captures this information and executes the pre-set corresponding action. 3.2 DSP Workflow and Related Algorithms The main CPU uses hardware reset to reset the DSP controller. After the DSP is reset, the following boot program is executed: (1) Initialize all variables; (2) Reset all peripherals; (3) Turn off all outputs (high impedance). This system adopts velocity feedforward and acceleration feedforward methods. In each sampling cycle, the DSP continuously executes the program shown in Figure 2. Read the current position: encoder; analog input; parallel input. Calculate the new trajectory: Tn=Tn-1+Fs (1) An=An-1+Fs*Jn (2) Vn=Vn-1+Fs*An (3) Xn=Xn-1+Fs*Vn (4) Where: Fs is the sampling time; Tn is the time when sampling n starts; Jn is the acceleration of sampling n; Xn is the displacement of sampling n; Vn is the velocity of sampling n; An is the acceleration of sampling n. Event checks: limit switch; original position sensor; amplifier failure; external input; software limit; time limit (trajectory calculation). Execution events: no response; emergency stop; stop; new motion parameters. Calculate and set control output: PID parameters and calculation; user output port. PID algorithm of DSP controller: The DSP controller uses digital filtering technology to determine the output control signal by the output error. How to calculate the output value is determined by 6 parameters. The PID algorithm used by the DSP is as follows: On=Kr(Kp*En+Kd*(En-En-1)+Ki*Sn+Kv*Vn+64*Ka*An)+Ko (5) Where: Sn=Sn-1+En if -Smax<Sn<Smax Sn=Smax if Sn>Smax Sn=-Smax if Sn<-Smax On is the motor control output at sampling n; Kr is the amplification parameter; Kp is the proportional gain; Kd is the differential gain; Ki is the integral gain; Kv is the speed front feedback; Ka is the acceleration front feedback; Ko is the static bias; En is the command acceleration in sampling n multiplied by 2 to the power of -6; Z is the position error in sampling n; Vn is the command speed in sampling n; Sn is the integral error; Smax is the maximum integral error. 3.3 System Software Description 3.3.1 Functional Description of First-Level Modules (1) Initialization Program. After the CNC system is powered on, it automatically sets the working status of the relevant interfaces and sets constants or clears the relevant registers or storage units. (2) Input data processing program. Input data generally refers to keyboard or switch input. Input data processing generally includes modules such as code conversion, tool radius offset calculation, and switch function analysis. Some processing is performed during the program input process, which can reduce the amount of data to be processed during the machining process, thereby improving the machining speed. (3) Interpolation calculation program. Interpolation calculation realizes the function of coordinate axis motion allocation. Motion allocation includes three aspects: point, line and curve. Since the computer has rich instructions and corresponding arithmetic subroutines, it will bring many conveniences to interpolation. The instructions used in the interpolation program should be as few as possible to improve the interpolation speed and accuracy. (4) Speed ​​control program. Speed ​​control is used to control the interpolation frequency to realize the feed amount given by the F instruction. It can be implemented in two ways: one is to implement it in software by using program counting; the other is to use a timer counting circuit to count by an external clock and use the interrupt method to control the interpolation speed. In the speed control program, a fuzzy control strategy and program for the gap voltage should be added at the same time, so as to realize the control of speed and displacement, as well as the control of gap voltage, to ensure the normal operation of machining. (5) System management program. The system management program is the main software for realizing the coordinated operation of the CNC system. Input program, data processing program and other NC special programs are all managed by it. (6) Diagnostic program. The diagnostic program can detect system faults at any time during the operation of the system and indicate the fault type, or find the working status of relevant components during maintenance, determine whether they are normal, and display abnormal components to facilitate timely handling by maintenance personnel. Among them, modules 1, 2, 5 and 6 run on the PC, and program modules 3 and 4 run on the DSP. 3.3.2 Functional description of the main secondary modules (1) Decoding processing program. Since the input instructions are all program segments of the workpiece processing process, they contain various workpiece contour information (such as start point, end point, straight line and arc, etc.), processing speed information (F code) and other auxiliary processing information (such as M, S, T code, etc.). Therefore, they must be decoded into a data form that the computer can understand and stored in a designated memory area in a certain format. During the decoding process, the syntax of the program segment should also be checked. If an error is found, the decoding should be stopped and an alarm should be triggered. (2) Electrode compensation processing program. Electrode compensation includes electrode radius compensation and electrode length compensation (also known as electrode wear compensation). Usually, the workpiece machining program is programmed based on the contour trajectory of the part. The function of electrode radius compensation is to convert the contour information of the part into the center trajectory of the electrode. It should also include automatic transfer judgment between program segments. (3) Display function modules. They provide a user-friendly human-machine interface for the operator. They should include part program display, parameter display, tool position display, machine tool status display, and real-time dynamic graphic display of the tool movement trajectory during the machining process. 4 Application examples and conclusions In order to verify the correctness and practicality of the EDM CNC system described in this paper, this CNC system was used to modify the TM735 EDM forming machine tool produced by Nantong Weite Machinery Co., Ltd., and this machine tool was compared with the Japanese Sodick-A50R CNC EDM forming machine tool. The specific experimental conditions used copper electrodes, aluminum workpieces, kerosene as the working fluid, and negative polarity machining. Table 1 shows the machining specifications and parameter schemes adopted. Table 2 compares the machining time of the same part on two machine tools under the same machining conditions. The experimental results show that the machining efficiency of the TM735 machine tool equipped with the CNC system developed in this paper is close to, and even exceeds, that of imported machine tools under certain machining conditions. The open EDM CNC system based on DSP developed in this paper uses the high-speed DSP TMS320C40 as the core of motion control. Its powerful computing capabilities and extremely high processing speed give the control system good real-time performance. The embedded motion control card and the PC host form a multi-processor structure, easily leveraging the rich hardware and software resources of the PC platform. The human-machine interface is user-friendly, the operation is simple, and the operation is reliable. This system supports the further development of CNC machine tools towards openness, high speed and high precision, intelligence, integration, and networking. (Proceedings of the 2nd Servo and Motion Control Enterprise Forum and the 3rd Servo and Motion Control Forum)
Read next

CATDOLL Yuki Hard Silicone Head

The head made from hard silicone does not have a usable oral cavity. You can choose the skin tone, eye color, and wig, ...

Articles 2026-02-22