Design and Implementation of Control System for Five-Axis CNC Spring Coiling Machine
2026-04-06 06:00:41··#1
1. Introduction Springs are common components in the machinery industry, with a wide range of applications. Industrial development has stimulated the demand for springs, while also placing higher demands on spring processing equipment. Previous processing equipment was mostly purely mechanical spring coiling machines, which were complex in structure but relatively simple in function, cumbersome to debug, and difficult to improve processing accuracy. Therefore, the development of new spring coiling machine products is imperative. The development of computer technology has provided an effective means to transform traditional industries. Our 8 mm five-axis CNC spring coiling machine, developed in cooperation with a spring company, fills a domestic gap and replaces imported products. This product has won awards such as the Jiangsu Provincial Science and Technology Progress Award and the Gold Award at the National New Technology and New Product Expo. 2. Machine Working Principle There are many types of springs, such as compression springs, tension springs, and torsion springs. Here, we only introduce the working principle of the most widely used compression spring forming machine. The forming mechanism is shown in Figure 1. One or more pairs of rollers press and rotate the steel wire, pushing it to the right. The upper and lower diameter rods limit and guide the steel wire to form its shape. The upper and lower diameter rods can move within their respective grooves. By controlling the positions of the upper and lower diameter rods, the size of the spring coil diameter can be controlled. The pitch rod moves perpendicular to the paper plane, and its function is to create a spiral angle for the wound wire. By controlling the position of the pitch rod, the size of the spring pitch can be controlled. When winding is complete, the wire is cut with a cutter. The mandrel serves as a support for the cutter when cutting the wire. Through the combined movement of the wire feeding roller, the upper and lower diameter rods, the pitch rod, and the cutter, various shapes of circular compression springs with variable diameters and pitches can be wound. For mechanical spring coiling machines, because there is only one power source, the linkage of each action rod relies entirely on gears, cams, clutches, and other mechanisms, resulting in a complex structure and time-consuming adjustments. Each time a new product is introduced, the cam shape often needs to be adjusted, requiring a high level of operator skill. In particular, the adjustment range of the wire feeding length depends on the size of a sector gear, which limits the spring's extension. When the sector gear returns, a clutch must be used to disengage the wire feeding roller, which not only increases noise but also reduces wire feeding accuracy. To facilitate computer control, we completely redesigned the mechanical structure of the spring coiling machine. First, each motion mechanism was made independent, each controlled by a servo motor. For example, the wire feeding mechanism is a simple gear transmission, allowing for unlimited wire length; the upper and lower diameter rods and pitch rods are directly driven by motors connected to ball screws; the cutting mechanism is also a simple cam transmission, capable of general shearing and, in addition to matching upper and lower cutters, to perform torsional shearing to handle springs with large wire diameters and small winding ratios. When the operator needs to process different types of springs, for the CNC spring coiling machine, only the corresponding parameters need to be entered into the computer, and the desired springs can be coiled by coordinating the actions of each mechanism through program control. 3. Hardware Composition of the Control System A good electromechanical system should be inexpensive to manufacture, have reasonable performance allocation, reliable operation, and convenient maintenance and replacement, achieving optimal performance under these constraints. Implementing this design philosophy in the specific hardware design means using readily available systems and boards as much as possible. Circuit boards that must be designed in-house are made functional and modular to improve the overall reliability and maintainability of the machine. Through engineering practice, we have found this to be crucial for users. The functional modules of the hardware system are shown in Figure 2. 3.1 CNC System The CNC system includes a PC bus industrial control computer, purchased circuit boards, and self-designed control and interface cards. 3.1.1 The industrial control computer host adopts the 80486/100 motherboard and chassis from Advantech, Taiwan, which was among the first companies to enter the mainland market. It has two circuit boards: one is a 144-bit digital I/O card with six main ports, each port simulating an 8255 programmable peripheral interface, but providing better drive capability than the 8255; the other is a two-channel isolated 12-bit D/A output card, providing ±10V drive voltage to control the motor speed of the wire feeding system and the cutting system. 3.1.2 Position Control Board and Detection Board The position control board is used to complete the closed-loop control of the servo system position loop, as shown in Figure 3. The upper diameter plate, lower diameter plate, and pitch plate have identical hardware configurations, using a 16-bit 8096 microcontroller as the processor and controller. The interface with the industrial control computer is a 24-bit data channel and includes interrupt control signals. The interface with the servo driver is ±10V analog output, encoder signal detection, and some I/O control signals, such as servo ready, enable, speed reached, and fault alarm. The main function of the wire feeding and cutting position detection board is to measure the respective encoder signals, process them, and then send them to the host port. Since wire feeding and cutting do not occur simultaneously, this port can be reused. 3.2 Servo System The servo system includes a servo driver and a servo motor. To improve the overall performance and reliability, we adopted an AC servo system licensed from Siemens, Germany. Because the position loop control is completed within the servo system (this allows for flexible selection of algorithms to adapt to the overall system requirements), and to reduce costs, we chose a transistor pulse width modulation inverter with only current and speed loops and a permanent magnet AC servo motor driven by rectangular wave current. The system's speed ratio is 1:10000, and the response time is 20 milliseconds. 3.3 Sorting System The sorting system has two functions: wire defect removal and spring free height sorting. The system block diagram is shown in Figure 4. 3.3.1 Wire Defect Removal After the wire is fed from the feeding tray, it first enters the magnetic flaw detector, which uses the eddy current principle to detect whether the wire has defects. The positions of the flaw detector's detection point and the spring coiling machine's cutting point are fixed. After the flaw detector detects a wire defect, it sends an interrupt request signal to the sorting system. The sorting system immediately starts the counter, counting the rotary encoder installed on the main machine's wire feeding roller. Once the specified length is exceeded, the cut spring is considered scrap. In practice, considering that several defects may occur within the length between the flaw detector's detection point and the spring coiling machine's cutting point, a set of units is reserved in the processor. When the machine is running, the position of each defect is updated after each spring is cut. 3.3.2 Spring Free Height Sorting: When the main machine winds the spring, the sorting machine's control cylinder pushes the probe to the required position. When the spring contacts the probe, the sorting machine immediately notifies the main machine to stop feeding the wire. Simultaneously, it compares the spring wire's elongation with the standard value. Only springs within the deviation range are considered qualified products; otherwise, they are considered over-length or under-length. The results are then communicated to the sorting system. The operator can set the deviation range according to the required precision of the processed spring. If the main machine is set to automatic correction, the CNC system automatically adjusts the feed rate based on the processing result of the previous spring, ensuring the spring's free height meets the requirements. Manual correction can also be set, allowing the operator to change the spring's processing parameters. If several consecutive springs fail to meet the requirements, the main machine stops and issues an alarm. The sorting system's controller is an 8051 series microcontroller, using membrane keys to set working parameters. By controlling the stepper motor to rotate at different angles, the springs are fed into different bins, such as qualified, over-length, under-length, and material defect positions, to achieve the sorting purpose. The statistical results are displayed on a digital tube. 3.4 Auxiliary Feeding System The block diagram of the auxiliary feeding system is shown in Figure 5. Ordinary feeders use the main machine's wire feeding rollers to drive the steel wire, causing the feed tray to rotate and feed the wire. This increases the load on the main machine and easily causes the rollers to slip, affecting the feeding accuracy. Automatic feeders, however, use a swing arm to adjust the feeding speed. We place four proximity switches within the swing range of the swing arm: the initial position, two intermediate positions, and one extreme position. When the swing arm is at the initial position, the corresponding speed is zero. The two intermediate positions correspond to the three speeds of the frequency converter, from slow to fast. If the steel wire on the tray gets tangled, the main machine drags the steel wire to the swing arm to the extreme position, at which point the extreme switch disconnects the enable signal of the main machine's servo motor and simultaneously issues an alarm signal. After the fault is cleared, the main machine continues winding from the point of interruption, ensuring the spring is not wasted. 4 Software Design For industrial control, a good software design should have a simple user interface, reasonable resource utilization, and complete control functions, all designed to adapt to the characteristics and needs of the machine. 4.1 Simple and intuitive operation interface Most imported CNC spring coiling machines use the CNC system of general machine tools, which is not only complicated to operate, but also has unreasonable software resource configuration. Based on the processing characteristics of the spring coiling machine, we strive to make the interface design simple and clear, and all use the table input method with Chinese prompts. The operator only needs to fill in the relevant parameters according to each item. The layout of the main working screen is shown in Figure 6. It is divided into five areas. The contents of each area are introduced below. (1) Comprehensive parameter area includes spring code, material type, wire diameter, wire feed speed, production quantity, total output, etc. (2) Spring size parameter area includes helix direction, coil diameter, pitch, effective number of coils, total number of coils. For irregular springs, coil diameter and pitch need to be input in segments. (3) Spring graphic display area After the spring parameters are input, the spring graphic is automatically generated. The operator can judge the correctness of the input data by the shape of the spring. (4) Machine adjustment parameter area The offset of each axis such as upper coil diameter, lower coil diameter, pitch and the cumulative offset of each axis are set and displayed. (5) The prompt area includes parameter input error prompts, operation step prompts, machine working status prompts, fault alarm prompts, etc. 4.2 Reasonable use of hardware resources According to the characteristics of the spring forming process, we adopted a master-slave control mode, that is, the wire feeding axis is the active axis and the other axes are the follower axes, and the hardware design constitutes a two-level control. The main computer is mainly used for data calculation and processing, while the microcontroller completes the closed-loop control of the corresponding axis position. In each interpolation cycle, the host detects the wire feeding length, calculates the corresponding geometric position of each motion mechanism in real time, and calculates the elastic recovery of the wire at the coil diameter and pitch according to the mechanical properties of the wire material. Finally, the actual displacement of each axis is obtained, and these displacement data are sent to each port and a synchronization signal is sent to notify each axis to take it away. The controller of each axis retrieves the new position data at regular intervals, compares it with the detected actual position, and after calculation, sends the control quantity to the servo system. Because the axis controller uses the 8096 microcontroller, which has strong processing and control functions, after conducting various algorithm experiments, we adopted a control algorithm with variable proportional coefficients and simultaneous integral processing, enabling the servo system to have fast tracking performance and high positioning accuracy. 4.3 Comprehensive Operation and Control Functions Throughout the software design process, we adhered to the principle of maximizing the role of the computer, reducing the human burden, and improving machine efficiency. First, when the operator inputs spring parameters, the computer provides prompts and data ranges, and the automatically generated spring graph based on the input parameters intuitively helps the operator quickly identify erroneous data. Simultaneously, the automatically generated machining data and compensation amounts reduce the technical skill requirements for the operator. Second, whether during spring adjustment or continuous winding, the computer provides prompts for various situations. During the adjustment phase, it provides adjustment steps, such as roller pressurization, gear shifting, displacement correction, zero-point search, single-axis operation, single-piece machining, and continuous operation. During normal processing, the machine will provide corresponding prompts if it stops due to special circumstances, such as production completion, no material, material rack malfunction, no lubrication, servo out-of-tolerance, motor overheating, or excessive scrap, thus shortening the operator's debugging and problem-solving time. Third, the system design is flexible and can be selected according to user needs without changing hardware or software. For example, the main unit can establish signal interlocking relationships with auxiliary feeding and sorting systems via an online switch, forming a complete processing system. It can also independently perform single-machine processing of the spring coiling machine. The advantage of this is that it allows the use of auxiliary equipment from other manufacturers, and it can easily isolate its own auxiliary system in case of failure, without affecting the operation of the main unit. 4.4 Main Unit System Software Block Diagram The entire software design is considered according to a front-end and back-end type. The front-end software is an interrupt service routine used to calculate the geometric position of each mechanism and the deformation compensation of the wire material to realize position control and related logic functions. Here, an interrupt signal is triggered every time the wire feeding wheel moves one step. The back-end software implements human-machine interface, data processing, and monitoring management functions. The entire program block diagram is shown in Figure 7. 5. Conclusion Due to the unparalleled advantages of CNC spring coiling machines compared to ordinary mechanical spring coiling machines, more and more spring processing enterprises are willing to adopt them. However, currently, this field is dominated by foreign and Taiwanese products. Therefore, it is hoped that this article will serve as a starting point, arousing the interest of experts and encouraging them to work together to revitalize the national industry.