A method of position synchronization control for a servo drive and related apparatus
By employing an interpolation strategy that combines real-time detection of new position commands from the master station with a local timer, the problem of insufficient position synchronization control accuracy of the servo drive in SM mode was solved. This resulted in high-precision and stable servo motor motion, reduced hardware costs, and enhanced system robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG KOSSI INTELLIGENT TECH CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-16
AI Technical Summary
In the existing technology, servo drives in SM mode have insufficient position synchronization control accuracy, asynchronous updates and clock drift problems in non-distributed clock mode, which leads to low-frequency speed jitter of servo motors and makes it difficult to meet the requirements of high-precision machining.
By detecting the arrival of new position commands from the master station in real time, and combining this with the periodic triggering of position loop calculation interrupts by a local timer, position command coordination is performed. An interpolation strategy is used to generate the current period's position command, and compensation is performed when necessary to update the cached valid commands.
It achieves high-precision and stable position synchronization control in SM mode, eliminates speed jitter, reduces system hardware costs, enhances system robustness and determinism, and improves the reliability and stability of the servo system.
Smart Images

Figure CN121841205B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of servo control technology, and more specifically, to a servo driver position synchronization control method and related equipment. Background Technology
[0002] As industrial automation develops towards higher precision and stability, bus-based servo drive systems are increasingly widely used in precision machining and other fields. Among them, the non-distributed clock (SM) mode has become the mainstream choice for small and medium-sized servo systems due to its low cost and simple architecture. However, the insufficient position synchronization control accuracy in this mode restricts its expansion into high-end fields.
[0003] In existing technologies, SM mode servo drives mainly adopt an architecture where the master station periodically sends commands and the slave station executes control via interrupts triggered by local timers. This approach has many drawbacks, severely affecting the accuracy and stability of motion control. First, synchronization accuracy is limited by master station jitter, and the timing of slave station command execution cannot be precisely aligned with the timing of master station command updates, resulting in inherent time uncertainty in the commands. Second, asynchronous updates are a significant problem; new position commands may arrive at any time before or after a local control interruption. Whether it's the use of outdated commands due to early arrival or the omission of the latest commands due to late arrival, time-varying delays will occur, leading to low-frequency speed jitter in the servo motor. Finally, master-slave clock drift is unavoidable. The frequency difference between the master station communication cycle and the slave station's local timer cycle due to crystal oscillator differences will further exacerbate position command jitter as the deviation accumulates over time.
[0004] Current market-available improvement solutions fail to address the root cause of the problem. Speed jitter remains significant in high-speed scenarios, and excessively large filtering parameters lead to position lag, making it difficult to meet the demands of high-precision machining. Therefore, a new servo drive position synchronization control method is urgently needed to overcome the shortcomings of existing technologies and achieve high-precision, stable position synchronization control in SM mode. Summary of the Invention
[0005] This application provides a servo drive position synchronization control method and related equipment. Through a cooperative interpolation strategy in a non-distributed clock mode, it can eliminate speed jitter at the source, achieve high-order synchronization in SM mode and reduce costs, enhance system robustness and determinism, and effectively solve the defects of the prior art.
[0006] A servo drive position synchronization control method is applied to a bus-based servo drive system, wherein the servo drive operates in a non-distributed clock mode. The method includes:
[0007] Real-time detection of arrival events of new location command values sent by the master station;
[0008] Based on the local timer inside the servo driver, the position loop calculation interrupt is periodically triggered;
[0009] Each time the position ring calculation interrupt is triggered, position command coordination is executed, which includes:
[0010] Read the valid position instruction value from the previous cycle in the cache and use it as the reference value for the current plan;
[0011] Determine the status of the arrival event of the new position command value since the last interruption of the position loop calculation;
[0012] Based on the different states of the arrival event, the reference value is processed using the corresponding interpolation strategy to generate the position command for the current period;
[0013] Based on the position command of the current cycle, execute drive control of the servo motor;
[0014] After the interpolation strategy is executed, if there is a newly received and uncached valid position instruction value, it will be updated in the cache.
[0015] Optionally, determining the state of the arrival event of the new position command value since the last position loop calculation interruption includes:
[0016] Each time a position ring calculation interruption is triggered, the current value of the event count variable is obtained, and the event count variable increments as the arrival event occurs;
[0017] Compare the current value of the event count variable with the historical count value saved when the last position ring calculation was interrupted;
[0018] If the difference between the current value of the event count variable and the historical count value is one, then the arrival status of the new position command value event is determined to be a normal synchronization state.
[0019] If the difference between the current value of the event count variable and the historical count value is zero, then the state of the arrival event of the new position command value is determined to be a command missing state.
[0020] If the difference between the current value of the event count variable and the historical count value is greater than one, then the state of the arrival event of the new position command value is determined to be the command overload state.
[0021] Update the historical count value to the current value of the event count variable.
[0022] Optionally, processing the reference value using a corresponding interpolation strategy includes:
[0023] For the normal synchronization state, a normal interpolation strategy is adopted, including linear interpolation based on the reference value and the latest new position command value that has arrived and been stored in the cache, to generate a series of smoothly increasing position command sequences, which are uniformly distributed within a single master station communication cycle;
[0024] For the missing instruction state, a missing frame compensation strategy is adopted, including generating a position instruction using the reference value and recording a period compensation amount. In subsequent multiple position loop calculation cycles, the period compensation amount is amortized and superimposed on the position instruction of each cycle in a positive compensation manner.
[0025] For the overload state of the command, a superframe correction strategy is adopted, which includes discarding the earliest arriving redundant position command value, recalculating the interpolation reference based on the latest arriving valid position command value, and recording a cycle compensation amount. In the subsequent multiple position ring calculation cycles, the cycle compensation amount is amortized and deducted from the position command of each cycle in a negative compensation manner.
[0026] Optionally, the periodic compensation amount can be amortized and then added to or subtracted from the position commands of each period in a positive or negative compensation manner, including:
[0027] Based on the recorded periodic compensation amount, determine the total positional deviation to be compensated;
[0028] In a subsequent predefined compensation time interval, the total position deviation is evenly distributed to each position loop calculation cycle within that interval to obtain the fine-tuning compensation amount for each cycle.
[0029] In each position ring calculation cycle within the compensation time interval, the originally planned position command for this cycle is algebraically added to the fine-tuning compensation amount to determine the final position command. The fine-tuning compensation amount is positive during positive compensation and negative during negative compensation.
[0030] Optional, also includes:
[0031] At the beginning of each master station communication cycle, record the first timestamp when the arrival event is fully captured;
[0032] Within the same communication cycle, record the second timestamp of the first position ring calculation interruption triggered by the local timer;
[0033] The difference between the first timestamp and the second timestamp is calculated as the observed single-cycle phase deviation;
[0034] The single-cycle phase deviation of multiple consecutive communication cycles is filtered to determine the long-term phase drift trend;
[0035] Based on the long-term phase drift trend, the timing period parameter of the local timer is adjusted so that the average value of the second timestamp is aligned with the first timestamp, thereby suppressing the accumulated phase error caused by clock asynchrony.
[0036] Optionally, the real-time detection of the arrival event of the new location command value sent by the master station includes:
[0037] Poll the hardware status flags in the bus communication controller that indicate the readiness of new process data;
[0038] When the hardware status flag bit undergoes a valid transition, direct memory access transfer is initiated to move the new location instruction value from the communication data buffer to the internal buffer for location ring access.
[0039] In the confirmation interrupt triggered by the completion of the direct memory access transfer, a software update flag is set and the event count variable is incremented to complete the recording of an arrival event.
[0040] A servo drive position synchronization control device, applied to a bus-based servo drive system, the device comprising:
[0041] The event detection module is used to detect the arrival of new location command values sent by the master station in real time;
[0042] The timing trigger module is used to periodically trigger position loop calculation interrupts based on the local timer inside the servo driver;
[0043] A cache unit is used to store valid location instruction values;
[0044] The planning and control module is connected to the event detection module, the timed triggering module, and the cache unit, and is configured to execute position command coordination each time the position ring calculation interruption is triggered. The position command coordination includes:
[0045] Read the valid position instruction value from the previous cycle in the cache and use it as the reference value for the current plan;
[0046] Determine the status of the arrival event of the new position command value since the last interruption of the position loop calculation;
[0047] Based on the different states of the arrival event, the reference value is processed using the corresponding interpolation strategy to generate the position command for the current period;
[0048] Based on the position command of the current cycle, execute drive control of the servo motor;
[0049] After the interpolation strategy is executed, if there is a newly received and uncached valid position instruction value, it will be updated in the cache.
[0050] A servo drive position synchronization control device includes a memory and a processor;
[0051] The memory is used to store programs;
[0052] The processor is configured to execute the program to implement the various steps of the servo drive position synchronization control method as described in any of the preceding claims.
[0053] A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the servo drive position synchronization control method as described in any of the preceding claims.
[0054] A computer program product includes a computer program that, when executed by a processor, performs the steps of the servo drive position synchronization control method as described in any of the preceding claims.
[0055] As can be seen from the above technical solutions, the servo drive position synchronization control method and related equipment provided in this application embodiment detect the arrival event of a new position instruction from the master station in real time, and combine it with the local timer to periodically trigger the position loop calculation interrupt; when the interrupt is triggered, position instruction coordination is performed, that is, the cached valid position instruction of the previous cycle is read as the reference value, the status of the instruction arrival event is determined and the corresponding interpolation strategy is used to generate the position instruction of the current cycle, and the cached valid instructions that are not cached are updated after the drive control is executed.
[0056] This application precisely addresses the shortcomings of existing technologies, achieving several significant benefits. Firstly, it eliminates speed jitter at its source, effectively solving the time-varying control delay problem caused by asynchronous updates and clock drift in existing technologies. The solution utilizes coordinated control logic of instruction arrival event detection and local timer interrupts to dynamically determine the instruction arrival status each time a position loop interrupt occurs. It then processes the reference value using a targeted interpolation strategy, avoiding the use of outdated instructions or the omission of the latest instructions, thus completely cutting off the root cause of speed jitter and achieving smoother, more precise motion control, resolving the defect in existing technologies where speed jitter affects precision machining. Secondly, it achieves high-order synchronization performance in SM mode, breaking the traditional constraint of existing technologies that rely on DC hardware for high-performance synchronization. This application does not require additional DC hardware costs; through algorithm optimization alone, it enables the driver in SM mode to achieve synchronization control timing performance approaching or even equivalent to DC functionality. While ensuring synchronization accuracy, it significantly reduces system hardware costs, providing greater flexibility for servo system design and effectively compensating for the shortcomings of insufficient synchronization accuracy and limitations in high-end applications in existing SM modes. Third, it enhances the robustness and determinism of the system, solving the problem of local crystal oscillator accuracy affecting control stability in existing technologies. In this application, the control cycle is strictly constrained by the master station communication, eliminating the long-term influence of local crystal oscillator accuracy and making the system's timing behavior more deterministic and predictable. This not only facilitates system stability analysis and controller parameter tuning by technicians but also significantly improves the reliability of the entire motion control system, avoiding the problem of continuous decline in control accuracy caused by accumulated clock drift in existing technologies, and ensuring the long-term stable operation of the servo system. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0058] Figure 1 This is a flowchart of a servo driver position synchronization control method disclosed in an embodiment of this application;
[0059] Figure 2 This is a schematic diagram of a servo driver position synchronization control device disclosed in an embodiment of this application;
[0060] Figure 3 This is a hardware structure block diagram of a servo driver position synchronization control device disclosed in an embodiment of this application. Detailed Implementation
[0061] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0062] This application applies to a bus-based servo drive system, wherein the servo drive operates in a non-distributed clock mode.
[0063] The following section introduces the solution proposed in this application. The technical solution is as follows, and details are provided below.
[0064] Figure 1 This is a flowchart of a servo driver position synchronization control method disclosed in an embodiment of this application.
[0065] like Figure 1 As shown, the method may include:
[0066] Step S1: Real-time detection of the arrival of new location command values sent by the master station.
[0067] Specifically, the servo drive incorporates a dedicated bus communication monitoring module. This module employs a monitoring mechanism combining continuous scanning and event triggering to capture and parse all data frames transmitted from the master station to the bus in real time. To ensure accurate command recognition, the monitoring module pre-stores the standard data frame format, identifier fields, and verification rules corresponding to the master station's position commands. This allows it to quickly filter out position command-related data from complex bus data streams, effectively distinguishing it from other types of data such as status feedback data and control command data on the bus. When the monitoring module parses a new position command data frame that conforms to the preset rules, it immediately determines it as a new position command value arrival event. Simultaneously, it records the timing information corresponding to this event using the servo drive's internal system clock and generates a command arrival trigger signal, which is then transmitted to the control unit. This timing information not only includes the specific time of command arrival but also associates it with the corresponding bus communication cycle identifier, providing core timing basis for subsequent steps to determine command arrival status and match interpolation strategies. The command arrival trigger signal is used to wake up subsequent related processing flows, ensuring that every new position command value sent by the master station is responded to immediately. This fundamentally avoids command omissions, delayed detection, or false detection, guaranteeing the timeliness and reliability of command processing.
[0068] The real-time detection of the arrival event of the new location command value sent by the master station specifically includes:
[0069] ① Polling the hardware status flag in the bus communication controller to indicate that new process data is ready: The servo drive control unit continuously monitors the hardware status flag inside the bus communication controller through a preset polling cycle. This hardware status flag is automatically set or cleared by the bus communication controller according to the status of the received data. The flag will only change effectively when the new process data containing the new position command value sent by the master station is completely received and stored in the communication data buffer, ensuring the relevance and reliability of the polling object and avoiding false detection of communication data unrelated to position commands.
[0070] ② When the hardware status flag undergoes a valid transition, direct memory access (DMA) transfer is initiated to move the new position instruction value from the communication data buffer to the internal buffer accessed by the position loop: After the control unit detects a preset valid transition in the hardware status flag, it immediately triggers the start command of the DMA controller without the control unit core participating in data transfer. The DMA controller accurately moves the new position instruction value stored in the communication data buffer to the high-speed buffer inside the servo driver, which is specifically designed for the position loop, according to the preset transfer path and data length. This internal buffer has low-latency access characteristics, which can ensure that instruction data can be quickly obtained during subsequent position loop calculations, while avoiding the data transfer process from occupying the control unit core resources and improving the overall system response efficiency.
[0071] ③ In the confirmation interrupt triggered upon completion of the direct memory access transfer, a software update flag is set, and the event count variable is incremented to complete the recording of an arrival event: After the DMA controller completes the transfer of the new location command value, it automatically sends a transfer completion signal to the control unit, triggering a DMA transfer completion confirmation interrupt. Upon responding to this interrupt, the control unit first sets a software update flag in the interrupt service routine to indicate the existence of a new valid location command value to the subsequent location loop calculation process; simultaneously, the control unit retrieves the preset event count variable and performs an increment operation, accurately representing the number of arrival events through the count change. Thus, the real-time detection and recording process for a new location command value arrival event at the master station is completed.
[0072] Step S2: Based on the local timer inside the servo driver, periodically trigger the position loop calculation interrupt.
[0073] Specifically, the servo drive integrates a local timer driven by a crystal oscillator. This timer features high frequency stability and low timing error, meeting the stringent time reference requirements of precision motion control. During the servo drive's initialization phase, the system configures the local timer's period parameters through the control unit based on preset motion control accuracy and response speed requirements, specifying the timer's counting period (i.e., the fixed interval for position loop calculation) and counting threshold. During normal operation of the servo drive, the local timer continuously accumulates counts in units of the configured period. Whenever the count reaches the preset period threshold, the timer automatically generates a standard interrupt trigger signal. This signal is directly transmitted to the interrupt interface of the core control unit through the driver's internal interrupt control circuit. Upon receiving the interrupt trigger signal, the control unit immediately suspends the currently executing non-critical tasks and prioritizes starting the preset position loop calculation interrupt program, thereby forcing the position loop calculation process to execute in an orderly and timed manner at fixed time intervals. This periodic interruption triggering mechanism provides a stable and unified time reference for the coordinated planning, interpolation calculation and drive control of subsequent position commands, ensuring the timing consistency of the entire motion control process, avoiding control deviations caused by chaotic calculation timing, and ensuring the smoothness and regularity of servo motor motion.
[0074] Step S3: Execute position command coordination each time the position ring calculation interruption is triggered.
[0075] Whenever a position loop calculation interruption is triggered, the servo drive control unit immediately enters the position command coordination process. Through a series of orderly operations, it achieves a smooth transition and precise execution of the old and new position commands, ensuring the continuity and stability of the servo motor's movement. This coordination process specifically includes the following sub-steps:
[0076] ① Read the valid position command value from the previous cycle from the cache and use it as the reference value for the current planning: The servo drive has a dedicated command cache unit to store the position command values from the previous cycle that have been validated and executed. During this step, the control unit directly reads the corresponding valid position command value from the previous cycle from this cache unit and uses it as the reference for planning the position command in the current cycle. This ensures the continuity between position commands in adjacent cycles and avoids sudden changes in the servo motor movement due to command gaps.
[0077] ② Determine the status of the arrival event of the new position command value since the last position loop calculation interruption: The control unit retrieves the recorded arrival timing information of the new position command and performs a timing comparison analysis with the trigger time of the last position loop calculation interruption. This comparison clarifies whether the new position command value has arrived within the time window from the end of the last interruption to the trigger of the current interruption, and whether the arrival time is earlier or later than the trigger time of the current interruption. This provides an accurate basis for subsequently selecting an appropriate interpolation strategy.
[0078] ③ Based on the different states of the arrival event, the reference value is processed using a corresponding interpolation strategy to generate the position command for the current cycle: The control unit has multiple preset interpolation strategies adapted to different command arrival states. If the judgment result is that no new position command value arrives within the above time window, a uniform interpolation strategy is used to extend the reference value to generate the position command for the current cycle; if the judgment result is that a new position command value arrives early, a compensatory interpolation strategy is used to correct the reference value to eliminate errors caused by outdated commands; if the judgment result is that a new position command value arrives late, a transitional interpolation strategy is used to connect the reference value and the new command value to generate a smooth position command for the current cycle, ensuring that the position command for the current cycle can accurately adapt to motion control requirements regardless of the state.
[0079] ④ Based on the position command of the current cycle, execute drive control of the servo motor: The control unit transmits the generated position command of the current cycle to the power drive module of the servo driver. The power drive module precisely adjusts the output drive current, voltage and other signals according to the position command, thereby driving the servo motor to move according to the motion trajectory and speed corresponding to the position command of the current cycle, so as to realize the precise position following control of the servo motor.
[0080] ⑤ After the interpolation strategy is executed, if there is a newly received and unbuffered valid position command value, it is updated in the cache: After the interpolation strategy is executed, the control unit first verifies the validity of the detected new position command value and removes invalid or erroneous commands. If, after verification, there is a valid new position command value that has been received but not yet stored in the cache unit, the control unit immediately writes the valid new command value into the cache unit, overwriting the original position command value from the previous cycle, completing the cache update, and preparing data for the command coordination processing when the next position loop calculation interruption is triggered.
[0081] As can be seen from the above technical solutions, the servo drive position synchronization control method and related equipment provided in this application embodiment detect the arrival event of a new position instruction from the master station in real time, and combine it with the local timer to periodically trigger the position loop calculation interrupt; when the interrupt is triggered, position instruction coordination is performed, that is, the cached valid position instruction of the previous cycle is read as the reference value, the status of the instruction arrival event is determined and the corresponding interpolation strategy is used to generate the position instruction of the current cycle, and the cached valid instructions that are not cached are updated after the drive control is executed.
[0082] This application precisely addresses the shortcomings of existing technologies, achieving several significant benefits. Firstly, it eliminates speed jitter at its source, effectively solving the time-varying control delay problem caused by asynchronous updates and clock drift in existing technologies. The solution utilizes coordinated control logic of instruction arrival event detection and local timer interrupts to dynamically determine the instruction arrival status each time a position loop interrupt occurs. It then processes the reference value using a targeted interpolation strategy, avoiding the use of outdated instructions or the omission of the latest instructions, thus completely cutting off the root cause of speed jitter and achieving smoother, more precise motion control, resolving the defect in existing technologies where speed jitter affects precision machining. Secondly, it achieves high-order synchronization performance in SM mode, breaking the traditional constraint of existing technologies that rely on DC hardware for high-performance synchronization. This application does not require additional DC hardware costs; through algorithm optimization alone, it enables the driver in SM mode to achieve synchronization control timing performance approaching or even equivalent to DC functionality. While ensuring synchronization accuracy, it significantly reduces system hardware costs, providing greater flexibility for servo system design and effectively compensating for the shortcomings of insufficient synchronization accuracy and limitations in high-end applications in existing SM modes. Third, it enhances the robustness and determinism of the system, solving the problem of local crystal oscillator accuracy affecting control stability in existing technologies. In this application, the control cycle is strictly constrained by the master station communication, eliminating the long-term influence of local crystal oscillator accuracy and making the system's timing behavior more deterministic and predictable. This not only facilitates system stability analysis and controller parameter tuning by technicians but also significantly improves the reliability of the entire motion control system, avoiding the problem of continuous decline in control accuracy caused by accumulated clock drift in existing technologies, and ensuring the long-term stable operation of the servo system.
[0083] In some embodiments of this application, the process of determining the state of the arrival event of the new position command value since the last interruption of the position loop calculation is described, which may specifically include:
[0084] ①When each position ring calculation interruption is triggered, the current value of the event count variable is obtained, and the event count variable increments as the arrival event occurs;
[0085] ② Compare the current value of the event count variable with the historical count value saved when the last position ring calculation was interrupted:
[0086] The first method is to determine the state of the arrival event of the new position instruction value as normal synchronization state if the difference between the current value of the event count variable and the historical count value is one.
[0087] The second method is to determine the state of the arrival event of the new position instruction value as the instruction missing state if the difference between the current value of the event count variable and the historical count value is zero.
[0088] The third method is to determine the state of the arrival event of the new position instruction value as the instruction overload state if the difference between the current value of the event count variable and the historical count value is greater than one.
[0089] ③ Update the historical count value to the current value of the event count variable.
[0090] Specifically, whenever the local timer inside the servo driver periodically triggers a position loop calculation interrupt, the control unit will prioritize executing the status judgment process related to the event count variable, thereby accurately identifying the number of events in the previous cycle where the new position command value of the master station arrives, providing a core judgment basis for subsequent position command collaborative operations.
[0091] The servo drive internally uses a dedicated event counter variable, stored in a dedicated register of the control unit. This variable is incremented only when a new position command value sent by the master station is detected, triggered by the bus communication monitoring module to ensure a one-to-one correspondence between the count result and the command arrival event. When a position loop calculation interruption is triggered, the control unit immediately suspends other non-critical tasks, retrieves the current value of the event counter variable via an internal data read command, and temporarily stores it in a temporary buffer within the control unit. This prevents subsequent operations from interfering with the original count data and ensures the real-time performance and accuracy of the acquired count value.
[0092] The control unit has an independent historical count value storage unit to persistently store the event count variable values obtained during the previous position ring calculation interruption process. This storage unit also has a data latching function to prevent read-write conflicts. In this step, the control unit retrieves the current event count value obtained in this process from the temporary buffer and reads the historical count value from the historical count value storage unit. The internal numerical comparator calculates the difference between the two values and determines the status of the new position command arrival event in the previous cycle based on the calculation result. The specific determination rules are as follows: First, if the difference is one, it means that since the last position ring calculation interruption, the master station has only sent one new position command value and it has been successfully detected, which is determined to be a normal synchronization state; Second, if the difference is zero, it means that no new master station position command value arrival event was detected in the previous cycle, which is determined to be a command missing state; Third, if the difference is greater than one, it means that multiple new master station position command value arrival events were detected in the previous cycle, indicating a command backlog, which is determined to be a command overload state. The control unit will store the determined status result in the status flag register, providing a clear basis for subsequent adaptation of the corresponding position command processing strategy.
[0093] After completing the above status determination, the control unit immediately executes the historical count value update operation. Specifically, the control unit sends a write enable signal to the historical count value storage unit, and uses an atomic operation to overwrite the current value of the event count variable stored in the temporary buffer into the historical count value storage unit, replacing the original historical count value. This atomic operation avoids data read / write conflicts during the update process, ensuring that the historical count value accurately corresponds to the current event count value of the current location loop calculation interruption, providing an accurate historical reference benchmark for numerical comparison during the next location loop calculation interruption.
[0094] Based on this, the process of processing the reference value using a corresponding interpolation strategy includes:
[0095] For the normal synchronization state, a normal interpolation strategy is adopted, including linear interpolation based on the reference value and the latest new position command value that has arrived and been stored in the cache, to generate a series of smoothly increasing position command sequences, which are uniformly distributed within a single master station communication cycle;
[0096] For the missing instruction state, a missing frame compensation strategy is adopted, including generating a position instruction using the reference value and recording a period compensation amount. In subsequent multiple position loop calculation cycles, the period compensation amount is amortized and superimposed on the position instruction of each cycle in a positive compensation manner.
[0097] For the overload state of the command, a superframe correction strategy is adopted, which includes discarding the earliest arriving redundant position command value, recalculating the interpolation reference based on the latest arriving valid position command value, and recording a cycle compensation amount. In the subsequent multiple position ring calculation cycles, the cycle compensation amount is amortized and deducted from the position command of each cycle in a negative compensation manner.
[0098] Specifically, after determining the status of the event count variable (normal synchronization, missing command, or excessive command), the servo drive control unit will process the reference value of the valid position command from the previous cycle using the corresponding interpolation strategy based on the determination result, in order to generate a precise position command adapted to the current cycle. The specific execution process of each interpolation strategy is as follows:
[0099] For the normal synchronization state, a normal interpolation strategy is adopted: The control unit first retrieves the latest arriving position command value stored in the command cache unit through the internal dedicated data bus, and simultaneously extracts the pre-stored valid position command reference value of the previous cycle from the core register, ensuring the integrity and real-time performance of the two sets of command data. Subsequently, the control unit starts the built-in linear interpolation calculation module, using the reference value as the starting point and the latest position command value as the ending point, to initiate the linear interpolation calculation process. During the calculation, the control unit strictly follows the preset interpolation accuracy requirements, converting the position difference between the reference value and the latest command value into a series of smoothly increasing position command sequences. The numerical difference between adjacent commands is controlled within a preset small range, ensuring the continuity and smoothness of the command sequence. After the command sequence is generated, the control unit, through the timing calibration module, combines the preset communication cycle parameters of the master station to calibrate the command issuance timing, ensuring that within a single master station communication cycle, the generated position command sequence is evenly issued to the command preprocessing unit of the power drive module at fixed time intervals, providing a smooth speed gradient command for the servo motor and achieving precise position following control.
[0100] For the missing instruction state, a missing frame compensation strategy is adopted: the control unit directly uses the reference value of the valid position instruction from the previous cycle as the core basis to generate the current cycle position instruction that maintains continuity with the previous cycle's motion state, avoiding servo motor motion interruption or sudden changes due to missing instructions. Simultaneously, the control unit, through its internal timing comparison and deviation calculation module, combined with preset motion trajectory planning parameters, calculates the theoretical position deviation caused by the missing new instruction in the current cycle, quantifies this deviation into a corresponding cycle compensation amount, stores it in a dedicated compensation amount register within the control unit, and adds a status flag to this compensation amount to indicate its positive compensation attribute. During subsequent execution, the control unit will perform compensation amortization and superposition operations based on this cycle compensation amount in multiple subsequent preset position loop calculation cycles, gradually compensating for the position deviation caused by missing instructions and ensuring the accuracy of overall motion control.
[0101] For the aforementioned command overload state, a super-frame correction strategy is adopted: The control unit first retrieves the arrival time information of all new position command values arriving in excess, recorded by the bus communication monitoring module. Using the latest arrival as the core filtering principle, the command filtering module sorts and filters the excess commands, discarding the earliest arriving redundant position command values and retaining only the latest arriving valid position command values, ensuring the timeliness and accuracy of command processing. Subsequently, the control unit recalculates the interpolation reference (replacing the original valid position command reference value from the previous cycle) based on the latest filtered valid position command value, ensuring that the interpolation calculation is based on the latest master station control requirements. Simultaneously, the control unit calculates the position deviation caused by discarding redundant commands and changing the interpolation reference through the deviation calculation module, quantifies this deviation into a corresponding periodic compensation amount, stores it in a dedicated compensation amount register, and adds a negative compensation status flag to this compensation amount. During subsequent execution, the control unit will perform compensation amortization and deduction operations within multiple preset position loop calculation cycles to gradually correct the position offset caused by the command overload, avoiding sudden changes or disturbances in the servo motor's motion trajectory.
[0102] The process involves amortizing the periodic compensation amount and then adding or subtracting it from the position instructions of each period using either positive or negative compensation methods. The specific execution process includes:
[0103] ① Based on the recorded periodic compensation amount, determine the total position deviation to be compensated: The control unit first retrieves the recorded periodic compensation amount from the dedicated compensation amount register, and performs a validity check on the periodic compensation amount by combining the corresponding status flag (positive / negative) and eliminating invalid data generated by data transmission or storage. After the check passes, the control unit directly determines the periodic compensation amount as the total position deviation to be compensated, and at the same time clarifies the compensation direction of the total position deviation (positive compensation is the deviation to be supplemented, and negative compensation is the excessive deviation to be corrected), and synchronously stores the total position deviation amount and compensation direction information in a temporary compensation register to provide basic data for subsequent allocation operations.
[0104] ② Within a subsequent predefined compensation time interval, the total position deviation is evenly distributed to each position loop calculation cycle within that interval to obtain the fine-tuning compensation amount for each cycle: The control unit has a preset compensation time interval parameter, which can be configured according to the system's motion accuracy and response speed requirements, specifying the number of subsequent position loop calculation cycles covered by the compensation operation. The control unit reads this predefined compensation time interval parameter, determines the total number of position loop calculation cycles participating in the compensation allocation, and then, through an equal allocation algorithm, evenly distributes the total position deviation stored in the temporary compensation register to each position loop calculation cycle to obtain the fine-tuning compensation amount corresponding to each cycle. Specifically, the fine-tuning compensation amount is positive during positive compensation and negative during negative compensation, ensuring that the compensation direction is consistent with the deviation correction requirements. Simultaneously, the control unit stores the fine-tuning compensation amount for each cycle in cyclical order into the compensation sequence register, forming an ordered compensation data sequence.
[0105] ③ In each position loop calculation cycle within the compensation time interval, the originally planned position command for this cycle is algebraically added to the fine-tuning compensation amount to obtain the final position command: When each position loop calculation cycle within the compensation time interval is triggered, the control unit first generates the original planned position command for this cycle, and then retrieves the corresponding fine-tuning compensation amount for this cycle from the compensation sequence register. The control unit performs an algebraic addition operation on the original planned position command and the fine-tuning compensation amount for this cycle through its internal calculation unit: During positive compensation, the positive fine-tuning compensation amount is superimposed on the original planned command to increase the command value to compensate for the position deviation; during negative compensation, the negative fine-tuning compensation amount is superimposed on the original planned command, i.e., to achieve a subtraction effect, reducing the command value to correct excessive deviation. After the calculation is completed, the final position command for this cycle is generated, which meets both the requirements of conventional motion control and deviation compensation. Subsequently, the control unit transmits the final position command to the power drive module to drive the servo motor to run until the end of the compensation time interval, completing all compensation operations and ensuring the accuracy and stability of the overall motion control.
[0106] In some embodiments of this application, considering that in practical applications, the master station communication clock and the servo driver local timer clock are easily affected by factors such as crystal oscillator accuracy and ambient temperature changes, which can lead to long-term cumulative phase shifts. These shifts will gradually exacerbate the position synchronization error and affect the motion control accuracy. Therefore, this application may also include a phase deviation detection and local timer parameter adjustment process to achieve long-term synchronization accuracy stability through active clock phase calibration. Specifically:
[0107] ① At the beginning of each master station communication cycle, the first timestamp of the arrival event being fully captured is recorded: The servo driver's bus communication monitoring module is pre-synchronized with the master station communication cycle and can accurately identify the start time of each master station communication cycle. When a new position command value sent by the master station is detected to arrive and the command data is fully captured, the bus communication monitoring module immediately sends a capture completion signal to the control unit. After receiving this signal, the control unit records the current time using its internal high-precision system clock, generates a first timestamp, binds this timestamp with the corresponding master station communication cycle identifier, and stores it in a dedicated timing record register. This ensures that the first timestamp can be accurately associated with the corresponding communication cycle, providing accurate reference time data for subsequent phase deviation calculations.
[0108] ② Within the same communication cycle, record the second timestamp of the first position loop calculation interruption triggered by the local timer: Within the same master station communication cycle corresponding to the first timestamp, when the local timer inside the servo driver triggers the first position loop calculation interruption according to a preset cycle, the interrupt signal will be synchronously transmitted to the timing capture interface of the control unit. The control unit prioritizes responding to this timing capture request, records the current interruption trigger time through the system clock, generates a second timestamp, and associates the second timestamp with the corresponding master station communication cycle identifier, storing it in the timing record register. This achieves paired storage of data from two key moments within the same communication cycle, ensuring the correlation and accuracy of subsequent difference calculations.
[0109] ③ Calculate the difference between the first timestamp and the second timestamp as the observed single-cycle phase deviation: The control unit retrieves the first and second timestamps corresponding to the same communication cycle from the timing record register according to the master station communication cycle sequence. The internal numerical calculation module calculates the difference between the two timestamps to obtain the time interval between the two key moments; this interval is the observed single-cycle phase deviation. After calculation, the control unit binds the single-cycle phase deviation with the corresponding communication cycle identifier and stores it in the phase deviation buffer. Simultaneously, it marks the calculation status of the deviation as valid. If there are missing timestamps or incorrect associations, the data is marked as invalid and discarded, ensuring that all phase deviation data participating in subsequent processing are valid data.
[0110] ④ Filtering the single-cycle phase deviation across multiple consecutive communication cycles to determine the long-term phase drift trend: The control unit integrates a moving average filtering module with a preset filtering window size, i.e., the number of consecutive communication cycles participating in the filtering, which can be configured according to system response speed and stability requirements. The control unit extracts single-cycle phase deviation data from the phase deviation buffer in chronological order for multiple consecutive valid communication cycles and inputs it to the moving average filtering module. The filtering module performs an average calculation on the continuous deviation data to remove deviation noise caused by instantaneous fluctuations, electromagnetic interference, and other factors, outputting a smooth phase deviation change curve. Based on this change curve, the control unit analyzes the variation pattern of the deviation to determine the long-term phase drift trend, such as judging whether the deviation shows a trend of continuous increase, continuous decrease, or periodic fluctuation, and clarifies the drift direction and rate of the local timer relative to the master station communication clock.
[0111] ⑤ Based on the long-term phase drift trend, adjust the timing period parameter of the local timer to align the average value of the second timestamp with the first timestamp, thereby suppressing the accumulated phase error caused by clock asynchrony: The control unit generates a corresponding local timer period adjustment command based on the determined long-term phase drift trend. If the drift trend shows that the local timer period is too long (causing the average value of the second timestamp to lag behind the first timestamp), the adjustment command is to slightly shorten the timing period parameter of the local timer; if the drift trend shows that the local timer period is too short (causing the average value of the second timestamp to lead the first timestamp), the adjustment command is to slightly extend the timing period parameter. After the adjustment command is generated, the control unit writes the adjusted period parameter into the configuration register of the local timer through a dedicated configuration interface, completing the dynamic update of the timer parameter. After the update, the control unit continuously monitors the change in the difference between the first and second timestamps in subsequent communication cycles, and gradually aligns the average value of the second timestamp with the first timestamp through iterative adjustments, realizing the phase calibration of the master station communication clock and the local timer clock, suppressing the accumulated phase error caused by long-term clock asynchrony from the root, and further improving the position synchronization control accuracy and long-term stability of the servo driver.
[0112] The following describes a servo drive position synchronization control device provided in the embodiments of this application. The servo drive position synchronization control device described below and the servo drive position synchronization control method described above can be referred to and correspond to each other.
[0113] See Figure 2 , Figure 2 This is a schematic diagram of a servo driver position synchronization control device disclosed in an embodiment of this application.
[0114] like Figure 2As shown, the servo drive position synchronization control device is applied to a bus-based servo drive system, and the device may include:
[0115] Event detection module 110 is used to detect the arrival of new location command values sent by the master station in real time;
[0116] The timing trigger module 120 is used to periodically trigger position loop calculation interrupts based on the local timer inside the servo driver;
[0117] Cache unit 130 is used to store valid location instruction values;
[0118] The planning and control module 140 is connected to the event detection module, the timed triggering module, and the cache unit, and is configured to execute position command coordination each time the position ring calculation interruption is triggered. The position command coordination includes:
[0119] Read the valid position instruction value from the previous cycle in the cache and use it as the reference value for the current plan;
[0120] Determine the status of the arrival event of the new position command value since the last interruption of the position loop calculation;
[0121] Based on the different states of the arrival event, the reference value is processed using the corresponding interpolation strategy to generate the position command for the current period;
[0122] Based on the position command of the current cycle, execute drive control of the servo motor;
[0123] After the interpolation strategy is executed, if there is a newly received and uncached valid position instruction value, it will be updated in the cache.
[0124] As can be seen from the above technical solutions, the servo drive position synchronization control method and related equipment provided in this application embodiment detect the arrival event of a new position instruction from the master station in real time, and combine it with the local timer to periodically trigger the position loop calculation interrupt; when the interrupt is triggered, position instruction coordination is performed, that is, the cached valid position instruction of the previous cycle is read as the reference value, the status of the instruction arrival event is determined and the corresponding interpolation strategy is used to generate the position instruction of the current cycle, and the cached valid instructions that are not cached are updated after the drive control is executed.
[0125] This application precisely addresses the shortcomings of existing technologies, achieving several significant benefits. Firstly, it eliminates speed jitter at its source, effectively solving the time-varying control delay problem caused by asynchronous updates and clock drift in existing technologies. The solution utilizes coordinated control logic of instruction arrival event detection and local timer interrupts to dynamically determine the instruction arrival status each time a position loop interrupt occurs. It then processes the reference value using a targeted interpolation strategy, avoiding the use of outdated instructions or the omission of the latest instructions, thus completely cutting off the root cause of speed jitter and achieving smoother, more precise motion control, resolving the defect in existing technologies where speed jitter affects precision machining. Secondly, it achieves high-order synchronization performance in SM mode, breaking the traditional constraint of existing technologies that rely on DC hardware for high-performance synchronization. This application does not require additional DC hardware costs; through algorithm optimization alone, it enables the driver in SM mode to achieve synchronization control timing performance approaching or even equivalent to DC functionality. While ensuring synchronization accuracy, it significantly reduces system hardware costs, providing greater flexibility for servo system design and effectively compensating for the shortcomings of insufficient synchronization accuracy and limitations in high-end applications in existing SM modes. Third, it enhances the robustness and determinism of the system, solving the problem of local crystal oscillator accuracy affecting control stability in existing technologies. In this application, the control cycle is strictly constrained by the master station communication, eliminating the long-term influence of local crystal oscillator accuracy and making the system's timing behavior more deterministic and predictable. This not only facilitates system stability analysis and controller parameter tuning by technicians but also significantly improves the reliability of the entire motion control system, avoiding the problem of continuous decline in control accuracy caused by accumulated clock drift in existing technologies, and ensuring the long-term stable operation of the servo system.
[0126] Optionally, determining the state of the arrival event of the new position command value since the last position loop calculation interruption includes:
[0127] Each time a position ring calculation interruption is triggered, the current value of the event count variable is obtained, and the event count variable increments as the arrival event occurs;
[0128] Compare the current value of the event count variable with the historical count value saved when the last position ring calculation was interrupted;
[0129] If the difference between the current value of the event count variable and the historical count value is one, then the arrival status of the new position command value event is determined to be a normal synchronization state.
[0130] If the difference between the current value of the event count variable and the historical count value is zero, then the state of the arrival event of the new position command value is determined to be a command missing state.
[0131] If the difference between the current value of the event count variable and the historical count value is greater than one, then the state of the arrival event of the new position command value is determined to be the command overload state.
[0132] Update the historical count value to the current value of the event count variable.
[0133] Optionally, processing the reference value using a corresponding interpolation strategy includes:
[0134] For the normal synchronization state, a normal interpolation strategy is adopted, including linear interpolation based on the reference value and the latest new position command value that has arrived and been stored in the cache, to generate a series of smoothly increasing position command sequences, which are uniformly distributed within a single master station communication cycle;
[0135] For the missing instruction state, a missing frame compensation strategy is adopted, including generating a position instruction using the reference value and recording a period compensation amount. In subsequent multiple position loop calculation cycles, the period compensation amount is amortized and superimposed on the position instruction of each cycle in a positive compensation manner.
[0136] For the overload state of the command, a superframe correction strategy is adopted, which includes discarding the earliest arriving redundant position command value, recalculating the interpolation reference based on the latest arriving valid position command value, and recording a cycle compensation amount. In the subsequent multiple position ring calculation cycles, the cycle compensation amount is amortized and deducted from the position command of each cycle in a negative compensation manner.
[0137] Optionally, the periodic compensation amount can be amortized and then added to or subtracted from the position commands of each period in a positive or negative compensation manner, including:
[0138] Based on the recorded periodic compensation amount, determine the total positional deviation to be compensated;
[0139] In a subsequent predefined compensation time interval, the total position deviation is evenly distributed to each position loop calculation cycle within that interval to obtain the fine-tuning compensation amount for each cycle.
[0140] In each position ring calculation cycle within the compensation time interval, the originally planned position command for this cycle is algebraically added to the fine-tuning compensation amount to determine the final position command. The fine-tuning compensation amount is positive during positive compensation and negative during negative compensation.
[0141] Optional, also includes:
[0142] At the beginning of each master station communication cycle, record the first timestamp when the arrival event is fully captured;
[0143] Within the same communication cycle, record the second timestamp of the first position ring calculation interruption triggered by the local timer;
[0144] The difference between the first timestamp and the second timestamp is calculated as the observed single-cycle phase deviation;
[0145] The single-cycle phase deviation of multiple consecutive communication cycles is filtered to determine the long-term phase drift trend;
[0146] Based on the long-term phase drift trend, the timing period parameter of the local timer is adjusted so that the average value of the second timestamp is aligned with the first timestamp, thereby suppressing the accumulated phase error caused by clock asynchrony.
[0147] Optionally, the real-time detection of the arrival event of the new location command value sent by the master station includes:
[0148] Poll the hardware status flags in the bus communication controller that indicate the readiness of new process data;
[0149] When the hardware status flag bit undergoes a valid transition, direct memory access transfer is initiated to move the new location instruction value from the communication data buffer to the internal buffer for location ring access.
[0150] In the confirmation interrupt triggered by the completion of the direct memory access transfer, a software update flag is set and the event count variable is incremented to complete the recording of an arrival event.
[0151] The servo driver position synchronization control device provided in this application embodiment can be applied to servo driver position synchronization control equipment. Figure 3 The hardware structure block diagram of the servo drive position synchronization control device is shown. (Refer to...) Figure 3 The hardware structure of a servo drive position synchronization control device may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;
[0152] In this embodiment of the application, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4;
[0153] Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0154] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;
[0155] The memory stores a program, which the processor can call. The program is used for:
[0156] Real-time detection of arrival events of new location command values sent by the master station;
[0157] Based on the local timer inside the servo driver, the position loop calculation interrupt is periodically triggered;
[0158] Each time the position ring calculation interrupt is triggered, position command coordination is executed, which includes:
[0159] Read the valid position instruction value from the previous cycle in the cache and use it as the reference value for the current plan;
[0160] Determine the status of the arrival event of the new position command value since the last interruption of the position loop calculation;
[0161] Based on the different states of the arrival event, the reference value is processed using the corresponding interpolation strategy to generate the position command for the current period;
[0162] Based on the position command of the current cycle, execute drive control of the servo motor;
[0163] After the interpolation strategy is executed, if there is a newly received and uncached valid position instruction value, it will be updated in the cache.
[0164] Optionally, the refined and extended functions of the program can be referred to the above description.
[0165] This application embodiment also provides a readable storage medium that can store a program suitable for execution by a processor, the program being used for:
[0166] Real-time detection of arrival events of new location command values sent by the master station;
[0167] Based on the local timer inside the servo driver, the position loop calculation interrupt is periodically triggered;
[0168] Each time the position ring calculation interrupt is triggered, position command coordination is executed, which includes:
[0169] Read the valid position instruction value from the previous cycle in the cache and use it as the reference value for the current plan;
[0170] Determine the status of the arrival event of the new position command value since the last interruption of the position loop calculation;
[0171] Based on the different states of the arrival event, the reference value is processed using the corresponding interpolation strategy to generate the position command for the current period;
[0172] Based on the position command of the current cycle, execute drive control of the servo motor;
[0173] After the interpolation strategy is executed, if there is a newly received and uncached valid position instruction value, it will be updated in the cache.
[0174] Optionally, the refined and extended functions of the program can be referred to the above description.
[0175] This application also provides a computer program product, including a computer program, wherein the computer program is executed by a processor using the following method:
[0176] Real-time detection of arrival events of new location command values sent by the master station;
[0177] Based on the local timer inside the servo driver, the position loop calculation interrupt is periodically triggered;
[0178] Each time the position ring calculation interrupt is triggered, position command coordination is executed, which includes:
[0179] Read the valid position instruction value from the previous cycle in the cache and use it as the reference value for the current plan;
[0180] Determine the status of the arrival event of the new position command value since the last interruption of the position loop calculation;
[0181] Based on the different states of the arrival event, the reference value is processed using the corresponding interpolation strategy to generate the position command for the current period;
[0182] Based on the position command of the current cycle, execute drive control of the servo motor;
[0183] After the interpolation strategy is executed, if there is a newly received and uncached valid position instruction value, it will be updated in the cache.
[0184] Optionally, the refined and extended functions of the program can be referred to the above description.
[0185] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0186] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0187] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A servo driver position synchronization control method, characterized in that, For bus-based servo drive systems where the servo driver operates in a non-distributed clock mode, the method includes: Real-time detection of arrival events of new location command values sent by the master station; Based on the local timer inside the servo driver, the position loop calculation interrupt is periodically triggered; Each time the position ring calculation interrupt is triggered, position command coordination is executed, which includes: Read the valid position instruction value from the previous cycle in the cache and use it as the reference value for the current plan; Determining the status of the arrival event of the new position command value since the last position loop calculation interruption includes: Each time a position ring calculation interruption is triggered, the current value of the event count variable is obtained, and the event count variable increments as the arrival event occurs; Compare the current value of the event count variable with the historical count value saved when the last position ring calculation was interrupted; If the difference between the current value of the event count variable and the historical count value is one, then the arrival status of the new position command value event is determined to be a normal synchronization state. If the difference between the current value of the event count variable and the historical count value is zero, then the state of the arrival event of the new position command value is determined to be a command missing state. If the difference between the current value of the event count variable and the historical count value is greater than one, then the state of the arrival event of the new position command value is determined to be the command overload state. Update the historical count value to the current value of the event count variable; Based on the different states of the arrival event, the reference value is processed using the corresponding interpolation strategy to generate the position command for the current period; Based on the position command of the current cycle, execute drive control of the servo motor; After the interpolation strategy is executed, if there is a newly received and uncached valid position instruction value, it is updated in the cache. The process of processing the reference value using the corresponding interpolation strategy includes: For the normal synchronization state, a normal interpolation strategy is adopted, including linear interpolation based on the reference value and the latest new position command value that has arrived and been stored in the cache, to generate a series of smoothly increasing position command sequences, which are uniformly distributed within a single master station communication cycle; For the missing instruction state, a missing frame compensation strategy is adopted, including generating a position instruction using the reference value and recording a period compensation amount. In subsequent multiple position loop calculation cycles, the period compensation amount is amortized and superimposed on the position instruction of each cycle in a positive compensation manner. For the overload state of the command, a superframe correction strategy is adopted, which includes discarding the earliest arriving redundant position command value, recalculating the interpolation reference based on the latest arriving valid position command value, and recording a cycle compensation amount. In the subsequent multiple position ring calculation cycles, the cycle compensation amount is amortized and deducted from the position command of each cycle in a negative compensation manner.
2. The method according to claim 1, characterized in that, The periodic compensation amount is amortized and then added to or subtracted from the position instructions of each period in a positive or negative compensation manner, including: Based on the recorded periodic compensation amount, determine the total positional deviation to be compensated; In a subsequent predefined compensation time interval, the total position deviation is evenly distributed to each position loop calculation cycle within that interval to obtain the fine-tuning compensation amount for each cycle. In each position ring calculation cycle within the compensation time interval, the originally planned position command for this cycle is algebraically added to the fine-tuning compensation amount to determine the final position command. The fine-tuning compensation amount is positive during positive compensation and negative during negative compensation.
3. The method according to claim 1, characterized in that, Also includes: At the beginning of each master station communication cycle, record the first timestamp when the arrival event is fully captured; Within the same communication cycle, record the second timestamp of the first position ring calculation interruption triggered by the local timer; The difference between the first timestamp and the second timestamp is calculated as the observed single-cycle phase deviation; The single-cycle phase deviation of multiple consecutive communication cycles is filtered to determine the long-term phase drift trend; Based on the long-term phase drift trend, the timing period parameter of the local timer is adjusted so that the average value of the second timestamp is aligned with the first timestamp, thereby suppressing the accumulated phase error caused by clock asynchrony.
4. The method according to claim 1, characterized in that, The real-time detection of the arrival event of the new location command value sent by the master station includes: Poll the hardware status flags in the bus communication controller that indicate the readiness of new process data; When the hardware status flag bit undergoes a valid transition, direct memory access transfer is initiated to move the new location instruction value from the communication data buffer to the internal buffer for location ring access. In the confirmation interrupt triggered by the completion of the direct memory access transfer, a software update flag is set and the event count variable is incremented to complete the recording of an arrival event.
5. A servo driver position synchronization control device, characterized in that, For use in bus-based servo drive systems, the device includes: The event detection module is used to detect the arrival of new location command values sent by the master station in real time; The timing trigger module is used to periodically trigger position loop calculation interrupts based on the local timer inside the servo driver; A cache unit is used to store valid location instruction values; The planning and control module is connected to the event detection module, the timed triggering module, and the cache unit, and is configured to execute position command coordination each time the position ring calculation interruption is triggered. The position command coordination includes: Read the valid position instruction value from the previous cycle in the cache and use it as the reference value for the current plan; Determine the status of the arrival event of the new position command value since the last interruption of the position loop calculation; Based on the different states of the arrival event, the reference value is processed using the corresponding interpolation strategy to generate the position command for the current period; Based on the position command of the current cycle, execute drive control of the servo motor; After the interpolation strategy is executed, if there is a newly received and uncached valid position instruction value, it is updated in the cache. Determining the status of the arrival event of the new position command value since the last position loop calculation interruption includes: Each time a position ring calculation interruption is triggered, the current value of the event count variable is obtained, and the event count variable increments as the arrival event occurs; Compare the current value of the event count variable with the historical count value saved when the last position ring calculation was interrupted; If the difference between the current value of the event count variable and the historical count value is one, then the arrival status of the new position command value event is determined to be a normal synchronization state. If the difference between the current value of the event count variable and the historical count value is zero, then the state of the arrival event of the new position command value is determined to be a command missing state. If the difference between the current value of the event count variable and the historical count value is greater than one, then the state of the arrival event of the new position command value is determined to be the command overload state. Update the historical count value to the current value of the event count variable; The process of processing the reference value using the corresponding interpolation strategy includes: For the normal synchronization state, a normal interpolation strategy is adopted, including linear interpolation based on the reference value and the latest new position command value that has arrived and been stored in the cache, to generate a series of smoothly increasing position command sequences, which are uniformly distributed within a single master station communication cycle; For the missing instruction state, a missing frame compensation strategy is adopted, including generating a position instruction using the reference value and recording a period compensation amount. In subsequent multiple position loop calculation cycles, the period compensation amount is amortized and superimposed on the position instruction of each cycle in a positive compensation manner. For the overload state of the command, a superframe correction strategy is adopted, which includes discarding the earliest arriving redundant position command value, recalculating the interpolation reference based on the latest arriving valid position command value, and recording a cycle compensation amount. In the subsequent multiple position ring calculation cycles, the cycle compensation amount is amortized and deducted from the position command of each cycle in a negative compensation manner.
6. A servo driver position synchronization control device, characterized in that, Including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement the various steps of the servo drive position synchronization control method as described in any one of claims 1-4.
7. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the various steps of the servo drive position synchronization control method as described in any one of claims 1-4.
8. A computer program product, comprising a computer program, characterized in that, The computer program is executed by the processor to perform the various steps of the servo drive position synchronization control method as described in any one of claims 1-4.
Citation Information
Patent Citations
CANopen-based servo driver position control synchronizing method
CN106647672A
Motion control system
JP2006072399A