Virtual servo full-closed-loop control system and method based on EtherCAT
Through the virtual servo full-closed-loop control system, utilizing the Zynq-7020 SOC chip and a rich set of full-closed-loop grating encoder interfaces, seamless integration of the EtherCAT system and heterogeneous servo drives is achieved, solving the problems of protocol incompatibility and full-closed-loop control, improving the system's control performance and reducing costs.
Patent Information
- Application Number
- CN202511328239.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-09-17
AI Technical Summary
In the existing technology, when CNC systems based on the EtherCAT protocol are integrated with servo drives of different brands and generations, there are problems such as protocol incompatibility, inability to achieve full closed-loop control, poor synchronization performance, poor encoder interface adaptability, and high upgrade costs.
A virtual servo full-closed-loop control system is designed, including an EtherCAT master module, a virtual servo full-closed-loop control module, a servo drive working module, and a displacement feedback device. Full closed-loop control is achieved through the virtual servo full-closed-loop control module. High-speed real-time control is achieved using the Zynq-7020 SoC chip. The system integrates a rich set of full-closed-loop grating encoder interfaces and flexible software parsing capabilities, supports the standard EtherCAT communication protocol, and executes actions synchronously with microsecond accuracy.
It achieves high-performance full-closed-loop position control, solves the problems of protocol fragmentation, incomplete functions and high upgrade costs, provides an efficient and economical solution for heterogeneous device integration, improves the system's dynamic response speed and anti-disturbance capability, and reduces integration complexity and cost.
Smart Images

Figure CN120821232A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial automation motion control, and in particular to an EtherCAT-based virtual servo full-closed-loop control system and method. Background Art
[0002] In modern high-end manufacturing equipment such as CNC machine tools, robots, and precision electronic assembly lines, the core of motion control lies in the CNC system (master station) commanding multiple servo drives via real-time industrial Ethernet networks (such as EtherCAT), which in turn drive motors to precisely move mechanical components. To achieve extremely high positioning accuracy (e.g., micron-level), fully closed-loop control is ideal. This means that in addition to reading the motor's built-in encoder (semi-closed-loop), the drive must also, more importantly, receive signals from a high-precision position feedback device mounted on the final controlled mechanical component (such as the machine tool table). This creates a fully closed-loop control system, eliminating errors introduced by the mechanical drive chain (such as screw backlash and thermal deformation).
[0003] However, in reality, factory production lines are often not newly constructed but rather gradually upgraded. This leads to a common problem: while upper management desires advanced CNC systems based on the standard EtherCAT protocol, the underlying components are connected to servo drives of various brands (such as Siemens, Mitsubishi, Yaskawa, and Delta), from different generations, and using analog-to-digital interfaces. These drives themselves lack EtherCAT support and lack the interfaces or capabilities to connect to external high-precision position feedback devices for fully closed-loop control. To address communication protocol incompatibility, a common device on the market is the protocol conversion gateway. This gateway essentially acts as a translator between the upper-layer EtherCAT master and the underlying drivers of various protocols. While this solves the basic communication protocol conversion problem, it suffers from fundamental and insurmountable drawbacks when it comes to achieving high-performance, high-precision motion control, particularly when it comes to meeting fully closed-loop requirements: 1. Protocol conversion only, no capability enhancement: The core function of the gateway is simply protocol translation and data forwarding. It cannot change the functional limitations of the underlying physical drive. If the physical drive is an older model without full closed-loop control capabilities or lacks an interface for external feedback devices such as a grating scale, then even if it is connected to the EtherCAT network through the gateway, the drive will still only be able to perform semi-closed-loop control and cannot achieve high-precision full closed-loop control of the final mechanical position. Specifically, (1) The control loop is limited and has poor performance: To achieve a fully closed loop, users are sometimes forced to write a position closed loop control algorithm in the gateway or upper-level master station, or in an additional PLC / motion controller. However, closing the position loop at the gateway or master station / PLC level results in a much slower control cycle (usually ≥1ms) than closing the loop inside the drive (usually ≤hundreds of microseconds or even lower). This results in slow dynamic response, low bandwidth, and poor anti-disturbance capability, making it difficult to meet the requirements of high-speed and high-precision machining. (2) Poor synchronization performance: When multiple axes move in coordination, closed-loop control at the upper layer will introduce additional communication delays and calculation delays, which seriously undermines the excellent distributed clock synchronization capability of EtherCAT itself, resulting in a decrease in synchronization accuracy between axes and contour errors; 2. Failure to provide a standard, consistent interface: Even if the gateway completes protocol conversion, the upper-layer host still sees the underlying, diverse physical drive object model. This forces host developers to adapt and handle specific drives behind different gateways, defeating the original purpose of standardization and further complicating system integration and maintenance. 3. Poor encoder interface compatibility: Old drivers or simple conversion gateways usually do not support the encoder interface of high-precision grating scales. They lack flexible adaptive support for various new or high-precision absolute encoder protocols, limiting the selection of high-precision feedback devices. 4. High upgrade and transformation costs and waste: If the performance of the existing physical drive itself is acceptable, it is forced to replace the entire set with a new drive that supports EtherCAT and full closed-loop simply because the protocol is outdated or does not support the full closed-loop function. This is very expensive (the cost of a single drive may exceed 10,000 yuan) and results in waste of the original hardware. It is not in line with the principle of gradualism of green economy and industrial upgrading. Summary of the Invention
[0004] The present invention provides a virtual servo full-closed-loop control system and method based on EtherCAT to overcome the above technical problems.
[0005] In order to achieve the above object, the technical solution of the present invention is: An EtherCAT-based virtual servo full-closed-loop control system, comprising: an EtherCAT master module, a virtual servo full-closed-loop control module, a servo driver that only supports semi-closed-loop control, a servo driver working module, and a displacement feedback device; The EtherCAT master module interacts only with the virtual servo full-closed-loop control module based on the standard EtherCAT protocol, and sends control instructions for controlling the motion mode of the servo drive working module to the virtual servo full-closed-loop control module; The displacement feedback device is used to collect the actual motion signal of the servo drive working module and transmit it to the virtual servo full closed-loop control module; The virtual servo full closed-loop control module has a virtual servo driver that supports the standard Ethercat communication protocol and can implement local full closed-loop control. The corresponding control process includes: Obtaining a control instruction transmitted by the EtherCAT master module, and obtaining an instruction position based on parsing the control instruction; Decoding a motion signal transmitted by a displacement feedback device to obtain an actual position of the servo drive working module, obtaining a compensation control amount according to the actual position and a command position, obtaining a correction instruction according to the command position and the compensation control amount, and transmitting the correction instruction to the servo drive that only supports semi-closed loop control; The servo driver that only supports semi-closed-loop control only interacts with the virtual servo full-closed-loop control module and completes the full-closed-loop motion control of the servo drive working module according to the correction instruction.
[0006] Furthermore, the virtual servo full closed-loop control module includes a communication module and a data analysis module; The communication module is used to perform bottom-layer protocol analysis on the control instructions, and transmit the control instructions after bottom-layer protocol analysis to the data analysis module; The underlying protocol parsing includes CRC check and distributed clock synchronization operations. The CRC check operation is used to verify the integrity of the control instructions transmitted by the EtherCAT master station module; the distributed clock synchronization operation is used to unify the time base to ensure that all modules execute actions synchronously within microsecond accuracy; the data analysis module is used to receive control instructions and parse the control instructions to obtain the instruction location.
[0007] Furthermore, the virtual servo full closed-loop control module further includes a differential receiving module, a level conversion module, an absolute value isolation module and a decoding module; The differential receiving module is used to receive the actual motion signal of the servo drive working module collected by the displacement feedback device, and convert the actual motion signal into a single-ended signal before transmitting it to the level conversion module; The level conversion module is used to convert the voltage range of the single-ended signal into a voltage range compatible with the data analysis module, and transmit the converted level signal to the absolute value isolation module; The absolute value isolation module is used to isolate high-frequency noise in the input level signal and transmit it to the decoding module; The decoding module is used to decode the input level signal to obtain the actual position of the servo drive working module and transmit it to the data analysis module.
[0008] Furthermore, the virtual servo full closed-loop control module further includes a full closed-loop control module; The full-closed-loop control module is used to execute a full-closed-loop control algorithm within a set period, calculate the error between the actual position and the command position in real time to obtain a compensation control amount, obtain a correction instruction based on the command position and the compensation control amount, and transmit the correction instruction to the servo drive that only supports semi-closed-loop control.
[0009] Furthermore, the virtual servo full-closed-loop control module includes a Zynq-7020 SOC chip.
[0010] Furthermore, the displacement feedback device is a grating scale or a magnetic scale.
[0011] Furthermore, the EtherCAT-based virtual servo full-closed-loop control system also includes a following error monitoring module, which is used to calculate the following error value in each control cycle in real time: Error_follow=P_cmd-P_actual, Where Error_follow is the following error; P_cmd is the command position; P_actual is the actual position; Compare the calculated following error value with the warning threshold and fault threshold set by the user in real time; If the following error exceeds the warning threshold, a warning flag is sent to the master station; If the following error exceeds the fault threshold, the internal fail-safe mechanism is triggered.
[0012] Furthermore, the EtherCAT-based virtual servo full-closed-loop control system also includes an FFT vibration spectrum analysis module, which is used to perform fast Fourier transform on the actual position to obtain a spectrum graph, and to locate the vibration source and perform vibration safety warning based on the spectrum graph.
[0013] A virtual servo full closed-loop control method based on system implementation, comprising: S1 through the EtherCAT master module, so that it sends control instructions to the virtual servo full closed-loop control module based on the standard EtherCAT protocol; S2. The actual motion signal of the servo drive module is collected by the displacement feedback device and transmitted to the virtual servo closed-loop control module; S3 obtains the control instructions through the interaction between the virtual servo full-loop control module and the EtherCAT master module, and parses the command position; S4. At the same time, the actual position of the servo drive working module is decoded by the virtual servo full-closed-loop control module, and a compensation control amount is obtained according to the actual position and the command position, a correction instruction is obtained according to the command position and the compensation control amount, and the correction instruction is transmitted to the servo drive that only supports semi-closed-loop control; S5. Complete full closed-loop motion control of the servo drive working module through the servo driver that only supports semi-closed-loop control and the correction instruction.
[0014] Beneficial effects: The present invention designs a virtual servo full-closed-loop control module, which has a virtual servo driver that supports the standard Ethercat communication protocol and can realize local execution of full-closed-loop control, including interacting with the EtherCAT master module to obtain control instructions, and obtaining the instruction position based on the control instruction analysis; the virtual servo full-closed-loop control module can also decode the motion signal transmitted by the displacement feedback device to obtain the actual position, obtain the compensation control amount according to the actual position and the instruction position, and obtain the correction instruction according to the instruction position and the compensation control amount, and transmit the correction instruction to the servo driver that only supports semi-closed-loop control; the servo driver that only supports semi-closed-loop control can complete the full-closed-loop motion control of the servo drive working module according to the correction instruction. The virtual servo full-closed-loop control module in the present invention is not only a communication protocol converter, but also a driver virtualization platform with an embedded high-speed real-time control engine, through which high-performance full-closed-loop position control is realized, fundamentally solving the problems of protocol fragmentation, incomplete functions, insufficient control performance and high upgrade cost in the prior art, and providing an efficient, economical and high-performance solution for heterogeneous equipment integration and high-precision motion control in industrial sites. It is suitable for scenarios that require seamless, fully closed-loop, high-performance integration of the upper-layer standard EtherCAT CNC system with the underlying multiple heterogeneous (different brands, protocols, and generations) or functionally limited (such as not supporting full closed-loop) physical servo drives. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0016] Figure 1 Schematic diagram of the structure of a virtual servo full-closed-loop control system based on EtherCAT in the present invention; Figure 2 This is a flow chart of a virtual servo full-closed-loop control method based on EtherCAT in the present invention. DETAILED DESCRIPTION
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0018] This embodiment provides a virtual servo full closed-loop control system based on EtherCAT, such as Figure 1 and Figure 2 As shown, it includes: EtherCAT master module, virtual servo full closed-loop control module, servo drive that only supports semi-closed-loop control, servo drive working module and displacement feedback device; The EtherCAT master module interacts only with the virtual servo full-closed-loop control module based on the standard EtherCAT protocol, and sends control instructions for controlling the motion mode of the servo drive working module to the virtual servo full-closed-loop control module; The displacement feedback device is used to collect the actual motion signal of the servo drive working module and transmit it to the virtual servo full closed-loop control module; The virtual servo full closed-loop control module has a virtual servo driver that supports the standard Ethercat communication protocol and can implement local full closed-loop control. The corresponding control process includes: Obtaining a control instruction transmitted by the EtherCAT master module, and obtaining an instruction position based on parsing the control instruction; Decoding a motion signal transmitted by a displacement feedback device to obtain an actual position of the servo drive working module, obtaining a compensation control amount according to the actual position and a command position, obtaining a correction instruction according to the command position and the compensation control amount, and transmitting the correction instruction to the servo drive that only supports semi-closed loop control; The servo driver that only supports semi-closed-loop control only interacts with the virtual servo full-closed-loop control module and completes the full-closed-loop motion control of the servo drive working module according to the correction instruction.
[0019] In a specific embodiment, the virtual servo full closed-loop control module includes a communication module and a data analysis module; The communication module is used to perform bottom-layer protocol analysis on the control instructions, and transmit the control instructions after bottom-layer protocol analysis to the data analysis module; The underlying protocol parsing includes CRC checksum and distributed clock synchronization operations. The CRC checksum is used to verify the integrity of the control instructions transmitted by the EtherCAT master module. The distributed clock synchronization operation is used to unify the time base to ensure that all modules execute actions synchronously within microsecond accuracy. The data analysis module is used to receive a control instruction and obtain an instruction position based on the analysis of the control instruction.
[0020] In a specific embodiment, the virtual servo full closed-loop control module further includes a differential receiving module, a level conversion module, an absolute value isolation module and a decoding module; The differential receiving module is used to receive the actual motion signal of the servo drive working module collected by the displacement feedback device, and convert the actual motion signal into a single-ended signal before transmitting it to the level conversion module; The level conversion module is used to convert the voltage range of the single-ended signal into a voltage range compatible with the data analysis module, and transmit the converted level signal to the absolute value isolation module; The absolute value isolation module is used to isolate high-frequency noise in the input level signal and transmit it to the decoding module; The decoding module is used to decode the input level signal to obtain the actual position of the servo drive working module and transmit it to the data analysis module.
[0021] In a specific embodiment, the virtual servo full closed-loop control module further includes a full closed-loop control module; The full-closed-loop control module is used to execute a full-closed-loop control algorithm within a set period, calculate the error between the actual position and the command position in real time to obtain a compensation control amount, obtain a correction instruction based on the command position and the compensation control amount, and transmit the correction instruction to the servo drive that only supports semi-closed-loop control.
[0022] In a specific embodiment, the displacement feedback device is a grating scale or a magnetic scale.
[0023] Specifically, the virtual servo full-closed-loop control module integrates a wealth of full-closed-loop grating scale encoder interface hardware and flexible software parsing capabilities. While retaining the underlying servo drive's own encoder semi-closed-loop control, it can adaptively access various types of full-closed-loop grating scale encoder feedback devices, such as SSI, Biss C, EnDat, etc., solving the compatibility problem of accessing high-precision full-closed-loop feedback devices. Example 1: Taking the CNC milling machine in a precision mold processing workshop as an example, the original system used Mitsubishi MR-JE servo driver (supporting only digital-analog input and semi-closed-loop control) to drive the ball screw. Due to mechanical clearance, the machining contour error was large and it could not meet the production requirements of high-precision molds. By deploying the virtual servo full closed-loop control module proposed in this paper ( Figure 2 The core layer in the servo drive), combined with a high-precision grating ruler, can achieve full closed-loop control while retaining the original drive and motor, thereby completing the full closed-loop control transformation of the servo drive that only supports semi-closed-loop control.
[0024] Specifically, if Figure 2 As shown, the signal flow process includes: (1) Uplink command path (from the master station to the virtual servo full closed-loop control module) The CNC system (EtherCAT master) serves as the control core, sending position control commands to the virtual servo full-closed-loop control module at a 2ms cycle. The control commands are transmitted to the LAN9252 communication chip within the virtual servo full-closed-loop control module via an RJ45 network cable to achieve distributed clock synchronization. The synchronized commands are then transmitted to the Zynq-7020 SoC chip via the SPI bus. The virtual servo full-closed-loop control module then calls the pre-stored CiA402 protocol stack to parse the control commands, extract parameters such as the target position and speed, and synchronously start the full-closed-loop control algorithm (including PID regulation and feedforward compensation).
[0025] Specifically, the LAN9252 communication chip is the core controller of the EtherCAT slave station, responsible for underlying protocol parsing (such as CRC check and distributed clock synchronization).
[0026] (2) Feedback signal path (from the workbench to the virtual servo full closed-loop control module) The actual position of the machine tool worktable is measured in real time by a grating ruler. The actual motion signal of the servo drive working module output by the grating ruler (EnDat differential signal with strong common mode noise resistance) first enters the adaptive interface circuit of the virtual servo full closed-loop control module: Step 1: Convert the differential signal into a single-ended signal through the differential receiving module; Specifically, the differential receiving module is established based on the MC3486 chip; Step 2: Use the level conversion module to convert the single-ended signal from 5V logic level to 3.3V logic level suitable for Zynq-7020 SoC; Specifically, the level conversion module is built based on the SN74LVTH245A level conversion chip; Step 3: Isolate the high-frequency noise of the driver through the absolute value isolation module to avoid interfering with the precise calculation of the virtual servo full-closed-loop control module. Specifically, the absolute value isolation module is built based on the ADuM3440 magnetic coupling isolation chip; Step 4: The input level signal is decoded by the decoding module to obtain the actual position and transmitted to the virtual servo full closed-loop control module.
[0027] Specifically, the virtual servo full-closed-loop control module runs a full-closed-loop control algorithm based on the command position and actual position within an ultra-short cycle of ≤125μs, calculates the error between the command position and the actual position in real time, generates a compensation control variable, and performs PID operation based on the command position and the compensation control variable to obtain a digital control variable. The digital control variable is then converted into a ±10V analog voltage signal by the AD5757 DAC chip. The analog signal is amplified and isolated by the OPA4197 op amp to ensure signal purity (±0.1% accuracy), and then outputs a correction command to the Mitsubishi servo drive. The Mitsubishi servo drive operates in "speed loop mode", and its analog input interface (such as the VC-COM port of the Mitsubishi MR-JE) linearly maps the ±10V voltage into a speed command (for example: +10V = rated forward speed) and drives the motor to move.
[0028] Specifically, the error calculation includes: the virtual servo full-closed-loop control module compares the actual position of the grating ruler feedback with the EtherCAT command position in real time to generate a compensation control quantity; the PID operation includes: proportional operation (P) - real-time response to the current deviation, directly affecting the system response speed and steady-state error; integral operation (I) - eliminates historical accumulated deviations and has the absolute ability to correct long-term errors; differential operation (D) - predicts the deviation change trend and improves the dynamic stability of the system; feedforward compensation is performed by pre-compensating the pre-compensation amount of the superimposed command acceleration / speed to improve the dynamic response speed, and a digital control quantity is generated through PID operation. In a specific embodiment, the virtual servo full closed-loop control module includes a Zynq-7020 SOC chip. The specific selection of the SOC chip is based on the following: The SOC chip integrates a dual-core ARM Cortex-A9@866MHz+Artix-7 FPGA, suitable for single-chip integration solutions and meeting hardware collaboration requirements; FPGA: Processes EnDat / SSI protocol decoding (nanosecond delay) and 125μs timing interrupts for scalers; ARM Cortex-A9: capable of running the CiA402 protocol stack, PID algorithm, and diagnostic logic; The key advantages of SOC chips are: (1) PS+PL architecture: ARM processes software tasks, and FPGA handles hardware interfaces and timing (such as grating scale differential signal decoding); (2) Low-latency interconnection: AXI bus enables intra-chip data exchange (microsecond level); (3) Cost-effectiveness: Single chip price is $25 (integrated FPGA + ARM), saving 50% of PCB area; Other solutions are shown in Table 1: Table 1:
[0029] Specifically, traditional gateways use a pure MCU solution, which cannot simultaneously meet the three major requirements of protocol analysis, high-speed closed-loop, and grating scale interface adaptation. The heterogeneous computing architecture of Zynq-7020 is the best choice for virtual servo full-closed-loop control modules.
[0030] In this embodiment, a virtual servo full closed-loop control method based on a virtual servo full closed-loop control system is also provided, including: S1 through the EtherCAT master module, so that it sends control instructions to the virtual servo full closed-loop control module based on the standard EtherCAT protocol; S2. The actual motion signal of the servo drive module is collected by the displacement feedback device and transmitted to the virtual servo closed-loop control module; S3 obtains the control instructions through the interaction between the virtual servo full-loop control module and the EtherCAT master module, and parses the command position; S4. At the same time, the actual position of the servo drive working module is decoded by the virtual servo full-closed-loop control module, and a compensation control amount is obtained according to the actual position and the command position, a correction instruction is obtained according to the command position and the compensation control amount, and the correction instruction is transmitted to the servo drive that only supports semi-closed-loop control; S5. Complete full closed-loop motion control of the servo drive working module through the servo driver that only supports semi-closed-loop control and the correction instruction.
[0031] In this embodiment, the virtual servo full closed-loop control system also has intelligent diagnostic functions, including a following error monitoring module and an FFT vibration spectrum analysis module, wherein: The following error monitoring module is used to monitor the following error. The following error is the instantaneous difference between the command position and the actual position. It is a core indicator for measuring the dynamic response performance, rigidity, and whether there is mechanical overload or transmission failure of the servo system. Excessive following error will directly lead to machining contour error.
[0032] This embodiment calculates the following error value in real time within each control cycle (≤125μs): Error_follow=P_cmd-P_actual, Where Error_follow is the following error; P_cmd is the command position; and P_actual is the actual position.
[0033] Compare the calculated following error value with the warning and fault thresholds pre-set by the user via EtherCAT SDO (Service Data Object) in real time; If the following error exceeds the warning threshold, the virtual servo fully closed-loop control system will send a warning sign to the master station via EtherCAT EMCY (emergency) messages or periodic process data (PDO), prompting the operator to pay attention to performance degradation and ensure system safety; If the following error further exceeds the fatal fault threshold, the virtual servo full closed-loop control system will immediately trigger the internal fail-safe mechanism and notify the master station via EtherCAT EMCY message. At the same time, the virtual servo full closed-loop control module will stop analog output, causing the virtual servo full closed-loop control system to shut down safely to prevent equipment damage. This embodiment further provides for periodically uploading the real-time value of the following error as process data to the master station for subsequent analysis such as graphical display, data recording or process optimization analysis.
[0034] Specifically, the FFT vibration spectrum analysis module is used to upgrade the virtual servo full-closed-loop control system from "blind execution" to "perceptible and diagnosable intelligent execution." This allows users to not only know "there is a problem with the system," but also precisely determine "where the problem lies" and "what the problem is." This provides strong data support for predictive maintenance, remote diagnosis, and process parameter optimization (such as adjusting servo gain and avoiding resonant speed zones). It addresses the difficulty of traditional servo systems in diagnosing high-frequency vibration caused by mechanical resonance, transmission component wear, or improper assembly. It provides key data for predictive maintenance and high-precision process debugging, including: (1) Data acquisition: The virtual servo full closed-loop control module continuously collects the actual position data fed back by the high-precision grating ruler and caches it in a fixed-length memory (for example, 1024 points are selected, covering a time window of approximately 128ms at a 125μs period). This data truly reflects the actual motion trajectory of the mechanical load end and contains rich vibration information; (2) FPGA accelerated calculation: Due to the large amount of FFT calculation, in order not to affect the real-time performance of the core control task, the present invention utilizes the logic resources of the FPGA in the Zynq chip. The cached position data is efficiently transmitted to the FPGA via the AXI bus. The FPGA hardware acceleration is used to perform a fast Fourier transform on the actual position data fed back by the grating ruler, and the position signal in the time domain is converted into a frequency spectrum in the frequency domain. (3) Feature extraction and diagnosis: The ARM core in the virtual servo full closed-loop control module analyzes the spectrum and extracts the main characteristic vibration frequencies (for example, identifying significant energy peaks at 500Hz and 1200Hz). These characteristic vibration frequencies are compared with the known natural frequencies of the mechanical system to accurately locate the vibration source (for example, determining whether it is damage to the screw support bearing or resonance of the guide rail). At the same time, the amplitude (energy) value of the vibration can also be monitored. If it exceeds the safety threshold, the virtual servo full closed-loop control system can also issue an early warning.
[0035] Specifically, the core innovation of this embodiment lies in achieving a significant leap in CNC machine tool performance with minimal hardware changes. This is achieved by creatively constructing an intelligent middle layer (a virtual servo full-closed-loop control module) between the CNC system (EtherCAT master) and the original servo drive. The virtual servo full-closed-loop control module completely virtualizes itself to the EtherCAT master as a servo drive that supports the standard EtherCAT communication protocol and the fully closed-loop CiA402 protocol. The master only needs to perform standard interactions with this "virtual drive" without having to know or care about the specific brand, model, protocol, or capability limitations of the underlying physical servo drive. This completely decouples the master from the physical servo drive. To the physical servo drive, the virtual servo full-closed-loop control module takes over the core position full-closed-loop control function, translating standard CiA402 commands into a protocol understandable to the physical servo drive. When the physical servo drive only supports semi-closed-loop control, the virtual servo full-closed-loop control module locally executes the full-closed-loop control algorithm, thereby achieving seamless integration and high-performance control of various heterogeneous or functionally limited physical servo drives.
[0036] Specifically, the virtual servo full-closed-loop control module receives commands from the master at high speed (2ms cycle) over a standard EtherCAT network and uses a high-precision optical scale to determine the worktable's true position. Internally, the module not only efficiently interprets the CiA402 protocol and adaptively processes multiple optical scale feedback loops, but also performs precise position loop calculations (including PID and feedforward) at ultra-high speed (≤125μs), generating compensation in real time. Finally, the module transmits analog velocity commands, output by a high-precision DAC, to the physical drive (operating in velocity loop mode). In this mode, the physical drive operates solely in velocity loop mode (the basic mode supported by almost all drives), acting as an "actuator." This breakthrough lies in the ability to achieve full closed-loop control using the existing drive system simply by adding an optical scale and the virtual servo full-closed-loop control module, completely eliminating mechanical transmission chain errors. Furthermore, the module's built-in high-speed processing (≤125μs position loop) and intelligent diagnostic capabilities (following error monitoring and FFT vibration analysis) far surpass the performance of traditional semi-closed-loop or drive-based closed-loop systems, providing a cost-effective upgrade solution for high-precision machining. In this way, even if the physical drive itself is old or does not support full closed-loop, the entire system can achieve true high-performance full closed-loop control through the "empowerment" of this module.
[0037] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A virtual servo full closed-loop control system based on EtherCAT, characterized in that: include: EtherCAT master module, virtual servo full closed-loop control module, servo drive that only supports semi-closed-loop control, servo drive working module and displacement feedback device; The EtherCAT master module interacts only with the virtual servo full-closed-loop control module based on the standard EtherCAT protocol, and sends control instructions for controlling the motion mode of the servo drive working module to the virtual servo full-closed-loop control module; The displacement feedback device is used to collect the actual motion signal of the servo drive working module and transmit it to the virtual servo full closed-loop control module; The virtual servo full closed-loop control module has a virtual servo driver that supports the standard Ethercat communication protocol and can implement local full closed-loop control. The corresponding control process includes: Obtaining a control instruction transmitted by the EtherCAT master module, and obtaining an instruction position based on parsing the control instruction; Decoding a motion signal transmitted by a displacement feedback device to obtain an actual position of the servo drive working module, obtaining a compensation control amount according to the actual position and a command position, obtaining a correction instruction according to the command position and the compensation control amount, and transmitting the correction instruction to the servo drive that only supports semi-closed loop control; The servo driver that only supports semi-closed-loop control only interacts with the virtual servo full-closed-loop control module and completes the full-closed-loop motion control of the servo drive working module according to the correction instruction.
2. The EtherCAT-based virtual servo full-closed-loop control system according to claim 1, characterized in that: The virtual servo full closed-loop control module includes a communication module and a data analysis module; The communication module is used to perform bottom-layer protocol analysis on the control instructions, and transmit the control instructions after bottom-layer protocol analysis to the data analysis module; The underlying protocol analysis includes CRC check and distributed clock synchronization operations, and the CRC check operation is used to verify the integrity of the control instructions transmitted by the EtherCAT master module; The distributed clock synchronization operation is used to unify the time base to ensure that all modules execute actions synchronously within microsecond accuracy; the data analysis module is used to receive control instructions and parse the control instructions to obtain the instruction position.
3. The EtherCAT-based virtual servo full-closed-loop control system according to claim 2, characterized in that: The virtual servo full closed-loop control module also includes a differential receiving module, a level conversion module, an absolute value isolation module and a decoding module; The differential receiving module is used to receive the actual motion signal of the servo drive working module collected by the displacement feedback device, and convert the actual motion signal into a single-ended signal before transmitting it to the level conversion module; The level conversion module is used to convert the voltage range of the single-ended signal into a voltage range compatible with the data analysis module, and transmit the converted level signal to the absolute value isolation module; The absolute value isolation module is used to isolate high-frequency noise in the input level signal and transmit it to the decoding module; The decoding module is used to decode the input level signal to obtain the actual position of the servo drive working module and transmit it to the data analysis module.
4. The EtherCAT-based virtual servo full-closed-loop control system according to claim 3, characterized in that: The virtual servo full closed-loop control module also includes a full closed-loop control module; The full-closed-loop control module is used to execute a full-closed-loop control algorithm within a set period, calculate the error between the actual position and the command position in real time to obtain a compensation control amount, obtain a correction instruction based on the command position and the compensation control amount, and transmit the correction instruction to the servo drive that only supports semi-closed-loop control.
5. The EtherCAT-based virtual servo full-closed-loop control system according to claim 1, characterized in that: The virtual servo full closed-loop control module includes a Zynq-7020 SOC chip.
6. The EtherCAT-based virtual servo full-closed-loop control system according to claim 1, characterized in that: The displacement feedback device is a grating scale or a magnetic scale.
7. The EtherCAT-based virtual servo full-closed-loop control system according to claim 1, characterized in that: It also includes a following error monitoring module, which is used to calculate the following error value in each control cycle in real time: Error_follow=P_cmd-P_actual, Where Error_follow is the following error; P_cmd is the command position; P_actual is the actual position; Compare the calculated following error value with the warning threshold and fault threshold set by the user in real time; If the following error exceeds the warning threshold, a warning flag is sent to the master station; If the following error exceeds the fault threshold, the internal fail-safe mechanism is triggered.
8. The EtherCAT-based virtual servo full-closed-loop control system according to claim 1, characterized in that: It also includes an FFT vibration spectrum analysis module, which is used to perform fast Fourier transform on the actual position to obtain a spectrum diagram, and to locate the vibration source and provide vibration safety warning based on the spectrum diagram.
9. A virtual servo full closed-loop control method implemented based on the system of claim 1, characterized in that: include: S1 through the EtherCAT master module, so that it sends control instructions to the virtual servo full closed-loop control module based on the standard EtherCAT protocol; S2. The actual motion signal of the servo drive module is collected by the displacement feedback device and transmitted to the virtual servo closed-loop control module; S3 obtains the control instructions through the interaction between the virtual servo full-loop control module and the EtherCAT master module, and parses the command position; S4. At the same time, the actual position of the servo drive working module is decoded by the virtual servo full-closed-loop control module, and a compensation control amount is obtained according to the actual position and the command position, a correction instruction is obtained according to the command position and the compensation control amount, and the correction instruction is transmitted to the servo drive that only supports semi-closed-loop control; S5. Complete full closed-loop motion control of the servo drive working module through the servo driver that only supports semi-closed-loop control and the correction instruction.
Citation Information
Patent Citations
Linux-based Ethercat maser / slave station control system and method
CN103425106A
EtherCAT-based full closed-loop stepping motor servo control system
CN107317529A
Time sequence control method, device and system of servo driver
CN112327707A
Feedback servo control method, device and equipment and readable storage medium
CN116578125A
Motor driver protection device
CN119382028A
Cited By
CNC numerical control system, method, device and equipment and readable storage medium
CN121657585A
