Synchronous control method and device of dual-motor driving shaft, electronic equipment and medium
Patent Information
- Application Number
- CN202611510652.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-10-30
AI Technical Summary
[0005]本发明提供一种双电机驱动轴的同步控制方法、装置、电子设备及介质,以解决相关技术中运动方向变化时超前轴判定失准导致补偿方向错误的问题,有效提升了双电机驱动轴的同步精度
判断所述补偿量的绝对值是否大于预设的输出限幅值;
Smart Images

Figure CN123019517A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of dual-motor synchronous drive control technology, and in particular to a method, device, electronic device and medium for synchronous control of dual-motor drive shafts. Background Technology
[0002] Dual-motor drive systems are widely used in CNC machine tools, laser cutting machines, 3D printing equipment, and other applications requiring high-precision coordinated motion. Taking a gantry CNC machine tool as an example, its crossbeam is driven by two servo motors at each end, requiring the two axes to maintain a high degree of synchronization during movement. If the synchronization error between the two axes is too large, it will cause the crossbeam to twist and deform, accelerate the wear of the guide rails, and in severe cases, even damage the mechanical structure, directly affecting machining accuracy and equipment lifespan.
[0003] In related technologies, the synchronous control of dual-motor drive shafts often adopts a cross-coupling control scheme based on PID (Proportional-Integral-Derivative). This involves acquiring the position feedback signals of the two axes in real time, calculating the synchronization error between the two axes, inputting the error into the PID controller to calculate the position compensation amount, and then superimposing the compensation amount onto the target position commands of the two axes in opposite directions.
[0004] However, this method suffers from a problem where the leading axis is misjudged when the direction of motion changes, leading to incorrect compensation direction, which urgently needs to be addressed. Summary of the Invention
[0005] This invention provides a synchronous control method, device, electronic device, and medium for dual-motor drive shafts, which solves the problem of incorrect compensation direction caused by inaccurate determination of the leading shaft when the direction of motion changes, and effectively improves the synchronization accuracy of dual-motor drive shafts.
[0006] To achieve the above objectives, a first aspect of the present invention provides a synchronous control method for a dual-motor drive shaft, comprising the following steps: In response to the start pulse of the current control cycle, the first target position of the dual motor drive shaft in the current control cycle, the actual position of the first motor drive shaft, the actual position of the second motor drive shaft, and the second target position of the previous control cycle adjacent to the current control cycle are obtained. Based on the first difference between the first target position and the second target position, the current movement direction of the dual-motor drive shaft is determined, and the target motor drive shaft in a preset leading state is determined according to the current movement direction. The preset leading state is used to characterize the state in which one motor drive shaft is in a leading position relative to the other motor drive shaft. The current synchronization error value is determined based on the second difference between the actual position of the first motor drive shaft and the actual position of the second motor drive shaft. Based on the current synchronization error value and the target motor drive shaft, the first target position is corrected so that the current synchronization error value converges.
[0007] According to an embodiment of the present invention, correcting the first target position based on the current synchronization error value and the target motor drive shaft includes: In response to the absolute value of the current synchronization error being less than or equal to a preset over-limit threshold, the output values of the proportional term, integral term, and derivative term are calculated based on the current synchronization error value, respectively. The output values of the proportional term, the integral term, and the derivative term are summed to generate a compensation amount. The difference between the first target position and the compensation amount is determined as the corrected target position of the target motor drive shaft, and the sum of the first target position and the compensation amount is taken as the corrected target position of the remaining motor drive shaft in the dual motor drive shaft.
[0008] According to an embodiment of the present invention, correcting the first target position based on the current synchronization error value and the target motor drive shaft includes: In response to the absolute value of the current synchronization error being greater than the preset over-limit threshold, the corrected target position of the target motor drive shaft is locked at the current actual position of the target motor drive shaft, and the corrected target position of the remaining motor drive shaft in the dual motor drive shafts is determined as the current actual position of the target motor drive shaft.
[0009] According to an embodiment of the present invention, determining the target motor drive shaft in a preset advanced state based on the current direction of motion includes: In response to the current direction of motion being the direction in which the value of the first target position increases, the motor drive shaft corresponding to the larger of the actual positions of the first motor drive shaft and the second motor drive shaft is determined as the target motor drive shaft; In response to the current direction of motion being the direction in which the value of the first target position decreases, the motor drive shaft corresponding to the smaller value between the actual position of the first motor drive shaft and the actual position of the second motor drive shaft is determined as the target motor drive shaft.
[0010] According to one embodiment of the present invention, determining the current direction of motion of the dual-motor drive shaft based on a first difference between the first target position and the second target position includes: In response to the absolute value of the first difference being greater than a first preset dead zone threshold and the first difference being within a first preset interval, the current direction of motion is determined as the direction in which the value of the first target position increases; In response to the absolute value of the first difference being greater than a first preset dead zone threshold and the first difference being within a second preset interval, the current direction of motion is determined as the direction in which the value of the first target position decreases.
[0011] According to an embodiment of the present invention, determining the current direction of motion of the dual-motor drive shaft based on a first difference between the first target position and the second target position includes: In response to the absolute value of the first difference being less than or equal to the first preset dead zone threshold, the average value of the actual position of the first motor drive shaft and the actual position of the second motor drive shaft is calculated, and the tracking error value between the average value and the first target position is calculated. In response to the absolute value of the tracking error being greater than a second preset dead zone threshold and the tracking error being within the first preset interval, the current direction of motion is determined as the direction in which the value of the first target position increases; In response to the absolute value of the tracking error being greater than the second preset dead zone threshold and the tracking error being within the second preset interval, the current direction of motion is determined to be the direction in which the value of the first target position decreases; In response to the absolute value of the tracking error being less than or equal to the second preset dead zone threshold, the motion direction of the previous control cycle adjacent to the current control cycle is determined as the current motion direction.
[0012] According to one embodiment of the present invention, after summing the output values of the proportional term, the integral term, and the derivative term to generate the compensation amount, the method further includes: Determine whether the absolute value of the compensation amount is greater than the preset output limit value; If the absolute value of the compensation amount is greater than the preset output limit value, the preset output limit value is used as the new compensation amount to correct the first target position based on the new compensation amount.
[0013] The synchronous control method for dual-motor drive shafts proposed in this invention obtains the current target position, the target position of the previous cycle, and the actual positions of the two drive shafts in response to the start pulse of the current control cycle. The motion direction is determined based on the difference between the current target position and the target position of the previous cycle, and a leading shaft is determined based on the motion direction. A synchronization error value is determined based on the difference between the actual positions of the two drive shafts. Based on the synchronization error value and the leading shaft, the current target position is corrected to bring the synchronization error value to convergence. Thus, by adaptively identifying the leading shaft through the trend of target position changes, and simultaneously performing correction based on the synchronization error value to reverse the target positions of the two shafts to achieve error convergence, this method solves the problem in related technologies where inaccurate determination of the leading shaft leads to incorrect compensation direction when the motion direction changes, effectively improving the synchronization accuracy of dual-motor drive shafts.
[0014] To achieve the above objectives, a second aspect of the present invention provides a synchronous control device for dual-motor drive shafts, comprising: The acquisition module is used to acquire, in response to the start pulse of the current control cycle, the first target position of the dual motor drive shaft in the current control cycle, the actual position of the first motor drive shaft, the actual position of the second motor drive shaft, and the second target position of the previous control cycle adjacent to the current control cycle. The first determining module is used to determine the current movement direction of the dual-motor drive shaft based on the first difference between the first target position and the second target position, and to determine the target motor drive shaft in a preset leading state according to the current movement direction. The preset leading state is used to characterize the state in which one motor drive shaft is in a leading position relative to the other motor drive shaft. The second determining module is used to determine the current synchronization error value based on the second difference between the actual position of the first motor drive shaft and the actual position of the second motor drive shaft. The correction module is used to correct the first target position based on the current synchronization error value and the target motor drive shaft, so as to make the current synchronization error value converge.
[0015] According to one embodiment of the present invention, the correction module is specifically used for: In response to the absolute value of the current synchronization error being less than or equal to a preset over-limit threshold, the output values of the proportional term, integral term, and derivative term are calculated based on the current synchronization error value, respectively. The output values of the proportional term, the integral term, and the derivative term are summed to generate a compensation amount. The difference between the first target position and the compensation amount is determined as the corrected target position of the target motor drive shaft, and the sum of the first target position and the compensation amount is taken as the corrected target position of the remaining motor drive shaft in the dual motor drive shaft.
[0016] According to one embodiment of the present invention, the correction module is specifically used for: In response to the absolute value of the current synchronization error being greater than the preset over-limit threshold, the corrected target position of the target motor drive shaft is locked at the current actual position of the target motor drive shaft, and the corrected target position of the remaining motor drive shaft in the dual motor drive shafts is determined as the current actual position of the target motor drive shaft.
[0017] According to an embodiment of the present invention, the first determining module, which determines the target motor drive shaft in a preset advanced state based on the current direction of motion, is specifically used for: In response to the current direction of motion being the direction in which the value of the first target position increases, the motor drive shaft corresponding to the larger of the actual positions of the first motor drive shaft and the second motor drive shaft is determined as the target motor drive shaft; In response to the current direction of motion being the direction in which the value of the first target position decreases, the motor drive shaft corresponding to the smaller value between the actual position of the first motor drive shaft and the actual position of the second motor drive shaft is determined as the target motor drive shaft.
[0018] According to an embodiment of the present invention, the first determining module, which determines the current movement direction of the dual-motor drive shaft based on a first difference between the first target position and the second target position, is specifically used for: In response to the absolute value of the first difference being greater than a first preset dead zone threshold and the first difference being within a first preset interval, the current direction of motion is determined as the direction in which the value of the first target position increases; In response to the absolute value of the first difference being greater than a first preset dead zone threshold and the first difference being within a second preset interval, the current direction of motion is determined as the direction in which the value of the first target position decreases.
[0019] According to an embodiment of the present invention, the first determining module, which determines the current movement direction of the dual-motor drive shaft based on a first difference between the first target position and the second target position, is specifically used for: In response to the absolute value of the first difference being less than or equal to the first preset dead zone threshold, the average value of the actual position of the first motor drive shaft and the actual position of the second motor drive shaft is calculated, and the tracking error value between the average value and the first target position is calculated. In response to the absolute value of the tracking error being greater than a second preset dead zone threshold and the tracking error being within the first preset interval, the current direction of motion is determined as the direction in which the value of the first target position increases; In response to the absolute value of the tracking error being greater than the second preset dead zone threshold and the tracking error being within the second preset interval, the current direction of motion is determined to be the direction in which the value of the first target position decreases; In response to the absolute value of the tracking error being less than or equal to the second preset dead zone threshold, the motion direction of the previous control cycle adjacent to the current control cycle is determined as the current motion direction.
[0020] According to an embodiment of the present invention, after summing the output values of the proportional term, the integral term, and the derivative term to generate the compensation amount, the correction module is further configured to: Determine whether the absolute value of the compensation amount is greater than the preset output limit value; If the absolute value of the compensation amount is greater than the preset output limit value, the preset output limit value is used as the new compensation amount to correct the first target position based on the new compensation amount.
[0021] The synchronous control device for dual-motor drive shafts proposed in this embodiment of the invention acquires the current target position, the target position of the previous cycle, and the actual positions of the two drive shafts in response to the start pulse of the current control cycle; determines the motion direction based on the difference between the current target position and the target position of the previous cycle, and determines the leading shaft based on the motion direction; determines the synchronization error value based on the difference between the actual positions of the two drive shafts; and corrects the current target position based on the synchronization error value and the leading shaft to bring the synchronization error value to convergence. Thus, by adaptively identifying the leading shaft through the trend of target position change, and simultaneously performing correction based on the synchronization error value to cause the target positions of the two shafts to shift in opposite directions to achieve error convergence, this solves the problem in related technologies where inaccurate determination of the leading shaft leads to incorrect compensation direction when the motion direction changes, effectively improving the synchronization accuracy of dual-motor drive shafts.
[0022] To achieve the above objectives, a third aspect of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the program to implement the synchronous control method for dual-motor drive shafts as described in the above embodiments.
[0023] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the synchronous control method for dual-motor drive shafts as described in the above embodiments.
[0024] To achieve the above objectives, a fifth aspect of the present invention provides a computer program product comprising a computer program that, when executed by a processor, is used to implement the synchronous control method for dual-motor drive shafts as described in the above embodiments.
[0025] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0026] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 A flowchart illustrating a synchronous control method for a dual-motor drive shaft according to an embodiment of the present invention; Figure 2 A block diagram of a synchronous control device for dual-motor drive shafts provided according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present invention. Detailed Implementation
[0027] Embodiments of the present invention are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0028] The following description, with reference to the accompanying drawings, outlines a synchronous control method, apparatus, electronic device, and medium for dual-motor drive shafts according to embodiments of the present invention.
[0029] Before introducing the synchronous control method for dual-motor drive shafts proposed in the embodiments of the present invention, a brief introduction to the relevant technical background is given.
[0030] In related technologies, the synchronous control of dual-motor drive shafts often employs a PID-based cross-coupling control method. The core principle of this method is as follows: Real-time acquisition of the position signals from the grating encoders of both shafts is used to calculate the synchronization error value e = e1 - e2 between the two shafts; this synchronization error value is input into the PID controller to calculate the position compensation amount ΔP; then, this compensation amount is superimposed in opposite directions onto the initial target position command P of both shafts. targetThe new target position instructions P1 and P2 are obtained, i.e., P1 = P2. target -ΔP, P2=P target +ΔP, by pulling the target position of the two axes, gradually converges the synchronization error value to zero.
[0031] However, the above method has at least the following problems: (1) This method defaults to determining the leading axis based on the size relationship between the actual positions of the two axes, that is, the axis with the larger position value is the leading axis. This determination rule only holds true during forward motion. When the system switches to reverse motion, the axis with the smaller position value is actually the leading axis. If compensation is still performed according to the original logic, the compensation direction will be completely reversed, which will exacerbate the synchronization error.
[0032] (2) This method is usually implemented in software serial mode on MCU (Microcontroller Unit) or DSP (Digital Signal Processor). The control cycle is affected by the operating system scheduling, resulting in task jitter and delay, which is difficult to further compress. The synchronization bandwidth is insufficient in high-speed motion scenarios. In addition, when porting to FPGA (Field-Programmable Gate Array), directly using floating-point operations will consume a lot of DSP and storage resources, which is difficult for low-cost FPGAs to support.
[0033] (3) When the synchronization error value exceeds the safety threshold, the relevant technology will either directly alarm and stop the machine, affecting the continuity of production, or forcibly continue to compensate, which poses a risk of mechanical distortion and damage.
[0034] Based on the aforementioned problems, this invention proposes a synchronous control method for dual-motor drive shafts. This method is implemented in hardware within an FPGA. It identifies the direction of motion by comparing the target position difference between the current cycle and the previous cycle, and adaptively determines the leading axis based on the direction of motion: the axis with the larger position value is the leading axis in forward motion, and the axis with the smaller position value is the leading axis in reverse motion, thus avoiding the problem of incorrect compensation direction during reverse motion. Simultaneously, a compensation amount is generated based on the synchronization error value, and the target position is corrected, causing the target positions of the two drive shafts to shift in opposite directions to achieve error convergence. Therefore, this solves the problem of inaccurate leading axis determination leading to incorrect compensation direction in related technologies when the direction of motion changes, achieving consistent leading axis determination throughout forward and reverse motion states, and effectively improving the synchronization accuracy of dual-motor drive shafts.
[0035] Furthermore, the synchronous control method for dual-motor drive shafts proposed in this embodiment of the invention adopts a single-cycle time-sharing pipeline architecture, and the control cycle supports user-defined configuration. The inputs to the FPGA top-level module may include the system clock clk, the reset signal rst_n, the externally input target position target_pos, and the encoder positions encoder1 (i.e., the actual position of the first motor drive shaft) and encoder2 (i.e., the actual position of the second motor drive shaft) of the dual-motor drive shafts. The outputs may include the corrected target positions motor1_target and motor2_target of the dual-motor drive shafts, the cycle end pulse capture_end, and the system error flag system_error. All position signals are represented by 32-bit signed integers, directly corresponding to the encoder counting units, allowing seamless integration with servo drives. Within one control cycle, the algorithm sequentially completes multiple stages, including data latching, synchronization error calculation, over-limit judgment, PID calculation when not exceeding limits, motion direction judgment and position locking strategy when exceeding limits, and final result output. In addition, the algorithm parameters and intermediate calculation processes all adopt Q32.16 or Q64.16 fixed-point number format, which effectively controls FPGA resource usage while ensuring sufficient control precision.
[0036] Figure 1 This is a flowchart of a synchronous control method for dual-motor drive shafts according to an embodiment of the present invention.
[0037] For example, such as Figure 1 As shown, the synchronous control method for the dual-motor drive shaft includes the following steps: In step S101, in response to the start pulse of the current control cycle, the first target position of the dual motor drive shaft in the current control cycle, the actual position of the first motor drive shaft, the actual position of the second motor drive shaft, and the second target position of the previous control cycle adjacent to the current control cycle are obtained.
[0038] The current control cycle refers to the periodic control timing driven by the FPGA's internal clock. Each cycle executes a complete synchronous control process, and the duration of the control cycle can be configured and modified according to application requirements. The start pulse is the synchronous trigger signal at the beginning of each control cycle, used to initiate all control logic for that cycle, ensuring strict time alignment of data acquisition, computation, and output. The target position refers to the common position command for the dual-motor drive axes (i.e., the first and second motor drive axes) issued by the host computer (such as a CNC (Computer Numerical Control) controller, motion control card, etc.) in each control cycle, representing the expected target position value for both motor drive axes to reach simultaneously. The first target position is the target position value issued by the host computer in the current control cycle; the second target position is the target position value issued by the host computer in the previous control cycle, stored in the FPGA's internal registers. The actual position refers to the current actual position value reached by the motor drive axis, acquired and fed back in real time by the grating encoder. Both the target position and the actual position are represented by 32-bit signed integers, corresponding to encoder counting units.
[0039] Specifically, before the algorithm starts, all control parameters required for PID calculation (such as proportional coefficient, integral coefficient, derivative coefficient, control cycle, output limit value, etc.) and their corresponding calculation formulas must be uniformly converted into Q32.16 or Q64.16 fixed-point format and written into the FPGA's internal registers to ensure the accuracy and efficiency of subsequent fixed-point calculations. Within each control cycle, the FPGA responds to the triggering of the current control cycle's start pulse by simultaneously latching the current cycle's target position (i.e., the first target position) from the host computer, the actual position feedback signals from the two grating encoders (i.e., the actual positions of the first and second motor drive shafts), and the historical target position stored in the registers from the previous control cycle (i.e., the second target position) through its internal data latching logic. This latching operation ensures that all data participating in the current cycle's calculation is captured simultaneously, avoiding calculation deviations caused by asynchronous data updates. The above four data points, together with the preset period parameter CYCLE_TIME (which defines how often the algorithm executes a complete control cycle), constitute the input basis for all control decisions within the current control cycle, providing a basis for subsequent synchronization error calculation and motion direction determination. Specifically, the target position is issued and updated by the host computer within each control cycle, the two actual positions are continuously fed back by the grating encoder, and the target position of the previous cycle is saved through register stamping.
[0040] In step S102, the current movement direction of the dual-motor drive shaft is determined based on the first difference between the first target position and the second target position, and the target motor drive shaft in a preset leading state is determined according to the current movement direction. The preset leading state is used to characterize the state in which one motor drive shaft is in a leading position relative to the other motor drive shaft.
[0041] The current direction of motion refers to the current movement trend of the dual-motor drive shaft, including forward and reverse motion. Forward motion indicates the direction in which the target position value increases (e.g., the beam moves forward), while reverse motion indicates the direction in which the target position value decreases (e.g., the beam moves backward).
[0042] Specifically, the FPGA first calculates the first difference between the first target position acquired in the current control cycle and the second target position stored in the previous control cycle. This difference reflects the direction and magnitude of the target position change between two adjacent control cycles. After determining the current direction of motion, the FPGA can further determine which of the two motor drive shafts is in a preset leading state, i.e., determine the target motor drive shaft (i.e., the leading shaft). This leading shaft determination result will serve as the basis for determining the direction of compensation application in subsequent steps.
[0043] In step S103, the current synchronization error value is determined based on the second difference between the actual position of the first motor drive shaft and the actual position of the second motor drive shaft.
[0044] The current synchronization error value refers to the deviation between the actual positions of the two motor drive shafts within the current control cycle. It is the second difference value itself (including the sign), used to characterize which motor drive shaft is leading, which is lagging, and the degree of leading. The larger the absolute value of the synchronization error, the more severe the asynchrony between the two motor drive shafts.
[0045] In other words, the FPGA can use the actual positions of the first motor drive shaft and the second motor drive shaft that have been latched in step S101 to calculate the second difference between them, i.e., sync_error=encoder1-encoder2. This difference is the synchronization error value of the current control cycle. The absolute value of the difference can directly reflect the severity of the asynchrony between the two motor drive shafts.
[0046] In step S104, the first target position is corrected based on the current synchronization error value and the target motor drive shaft so that the current synchronization error value converges.
[0047] In other words, the FPGA can correct the first target position of the current control cycle based on the current synchronization error value calculated in step S103 and the target motor drive shaft (i.e., the leading shaft) determined in step S102. By adjusting the target positions (i.e., the first target positions) of the two motor drive shafts in the opposite direction, the leading shaft decelerates and the lagging shaft accelerates, thereby gradually reducing the actual position deviation between the two shafts and achieving the convergence of the synchronization error value.
[0048] Therefore, by introducing the trend of target position change to determine the direction of motion and adaptively identifying the lead axis, the error in compensation direction caused by misjudgment of the lead axis during the reverse motion phase is avoided. At the same time, differential correction is performed based on the synchronization error value to reverse the target position of the two axes to achieve error convergence. This solves the problem of inaccurate lead axis determination leading to error in compensation direction when the direction of motion changes in related technologies, and achieves full consistency of lead axis determination and a significant improvement in the synchronization accuracy of the two axes in both forward and reverse motion states.
[0049] As one possible implementation, in some embodiments, the first target position is corrected based on the current synchronization error value and the target motor drive shaft, including: in response to the absolute value of the current synchronization error value being less than or equal to a preset over-limit threshold, calculating the output values of the proportional term, integral term, and derivative term based on the current synchronization error value; summing the output values of the proportional term, integral term, and derivative term to generate a compensation amount; determining the difference between the first target position and the compensation amount as the corrected target position of the target motor drive shaft, and using the sum of the first target position and the compensation amount as the corrected target position of the remaining motor drive shaft in the dual-motor drive shaft system.
[0050] The proportional, integral, and derivative terms are the three components of a PID controller. The proportional term is proportional to the current synchronization error value, reflecting the severity of the current deviation; the integral term is proportional to the cumulative amount of the current synchronization error value over time, used to eliminate steady-state residuals; and the derivative term is proportional to the rate of change of the current synchronization error value, used to predict the error trend and suppress oscillations. The sum of these three terms generates the final compensation value. This compensation value is the correction calculated by the PID controller based on the current synchronization error value, used to reverse the first target position of the dual-motor drive shaft.
[0051] In the specific implementation, the FPGA first determines whether the absolute value of the current synchronization error is greater than a preset over-limit threshold (e.g., 1000, corresponding to the counting unit of the grating encoder). If the absolute value of the current synchronization error is less than or equal to the over-limit threshold, it enters the normal compensation mode. In this mode, the FPGA performs PID compensation calculations. The entire PID calculation can use the Q32.16 fixed-point format. All control coefficients and control cycle parameters are quantized by shifting left by 16 bits before participating in the calculation, and then shifted right by 16 bits after the calculation to restore the original value. This effectively avoids the resource consumption of floating-point arithmetic units while ensuring calculation accuracy. The PID formula can be:
[0052] in, For compensation amount, This is the proportionality coefficient. The integral coefficient is... These are the differential coefficients. This is the current synchronization error value. For time.
[0053] The specific process of PID compensation calculation is as follows: The FPGA sends the current synchronization error value to the proportional, integral, and derivative channels respectively. The proportional channel calculates the proportional coefficient. Current synchronization error value The product term is obtained by multiplication. To ensure calculation accuracy, the intermediate result is extended to 81 bits and latched at the midpoint of the control cycle. In the integral channel, the control cycle is pre-calculated. With integral coefficient The product of these two factors serves as the integral coefficient constant. This constant is then multiplied by the current synchronization error value to obtain the integral increment for the current control cycle. The integral value is then accumulated through an accumulator register. The integrator has upper and lower limits. When the integral value exceeds the limit range (e.g., [-5000, 5000], corresponding to the grating encoder counting unit), the integral register is automatically cleared. The differential channel calculates the difference between the synchronization error of the current control cycle (i.e., the current synchronization error value) and the synchronization error of the previous control cycle, and multiplies it by the differential coefficient. Then, the FPGA's internal divider is called to divide by the control cycle. We obtain the differential term, that is The divider can operate in a pipelined mode to match the overall control timing. The proportional and integral terms are each shifted 16 bits to the right and then added to the derivative term to obtain the final position compensation. .
[0054] The FPGA determines the direction of compensation application based on the previously determined target motor drive shaft (i.e., the leading shaft): subtracting the compensation amount from the first target position. The difference is used as the corrected target position of the target motor drive shaft (i.e., the leading shaft), and the compensation amount is added to the first target position. The sum of the values is used as the corrected target position of the remaining motor drive shaft (i.e., the lagging shaft), thereby achieving the differential correction effect of decelerating the leading shaft and accelerating the lagging shaft, and the drive synchronization error value gradually converges.
[0055] Therefore, when the absolute value of the current synchronization error does not exceed the limit, the PID controller performs parallel calculations on the proportional, integral, and derivative channels of the current synchronization error and accumulates them to generate a compensation amount. Then, based on the judgment result of the leading axis, the compensation amount is applied to the target positions of the two drive axes in opposite directions, realizing closed-loop feedback regulation of the current synchronization error value, which enables the current synchronization error value to converge to zero quickly and stably. The above process utilizes the time window of the control cycle to complete multiplication, division, accumulation, and other operations in a time-sharing manner, and forms a pipeline structure through register timing to ensure that each operation step is completed in an orderly manner within a single cycle. The algorithm has built-in bit width overflow detection logic, which sets maximum and minimum values for monitoring the bit width of the intermediate results of the derivative term and the PID sum. When any operation result exceeds the specified bit width range, the system sets the system_error flag for alarm processing by the upper-level system, thereby avoiding uncontrolled output and ensuring the safety and reliability of the system.
[0056] Optionally, in some embodiments, after summing the output values of the proportional term, the integral term, and the derivative term to generate the compensation amount, the method further includes: determining whether the absolute value of the compensation amount is greater than a preset output limit value; if the absolute value of the compensation amount is greater than the preset output limit value, using the preset output limit value as the new compensation amount to correct the first target position based on the new compensation amount.
[0057] The preset output limit value is used to limit the maximum correction amplitude applied to the target position of the motor drive shaft within a single control cycle, preventing the compensation amount from exceeding the tolerance range of the mechanical or servo drive due to excessive instantaneous error.
[0058] Specifically, after generating the compensation amount, the FPGA can further perform output limiting judgment on the compensation amount: it determines whether the absolute value of the compensation amount is greater than a preset output limit value (e.g., 200, corresponding to the counting unit of the grating encoder). If the absolute value of the compensation amount is greater than the preset output limit value, the absolute value of the compensation amount is forcibly limited to the range of the output limit value, that is, only the preset output limit value is used as the new compensation amount for subsequent correction of the first target position; if the absolute value of the compensation amount is not greater than the preset output limit value, the compensation amount remains unchanged and is used for subsequent correction of the first target position. This limiting process can effectively prevent excessive compensation amounts caused by excessive instantaneous synchronization errors from exceeding the tolerance range of the servo driver, avoid impact on the mechanical structure, and improve the safety and stability of system operation.
[0059] In one possible implementation, in other embodiments, the first target position is corrected based on the current synchronization error value and the target motor drive shaft, including: in response to the absolute value of the current synchronization error value being greater than a preset over-limit threshold, locking the corrected target position of the target motor drive shaft at the current actual position of the target motor drive shaft, and determining the corrected target position of the remaining motor drive shaft in the dual motor drive shafts as the current actual position of the target motor drive shaft.
[0060] Specifically, when the FPGA determines that the absolute value of the current synchronization error is greater than the preset over-limit threshold, it triggers the over-limit protection logic and adopts a "stop fast, wait slow" protection strategy. That is, the FPGA locks the corrected target position of the previously determined target motor drive shaft (i.e., the leading shaft) at the current actual position of the shaft (the actual position value of the motor drive shaft in the current control cycle, which is collected and fed back in real time by the grating encoder (i.e., encoder1 or encoder2), represented by a 32-bit signed integer, corresponding to the grating encoder counting unit), thus stopping the leading shaft from moving forward; at the same time, it also determines the corrected target position of the remaining motor drive shaft (i.e., the lagging shaft) as the current actual position of the leading shaft, thus causing the lagging shaft to continue chasing with the current position of the leading shaft as the target.
[0061] The above strategy not only prevents the synchronization error from expanding further, avoiding beam twisting and mechanical damage, but also allows the lagging axis to automatically move closer to the leading axis, achieving natural error regression and recovery, all without manual intervention or shutdown. Furthermore, the system incorporates hysteresis characteristics to prevent frequent switching near thresholds: when the absolute value of the synchronization error exceeds a preset over-limit threshold, the system enters over-limit protection mode; in over-limit protection mode, the system exits over-limit protection mode and resumes normal PID control only when the absolute value of the synchronization error drops below the hysteresis recovery threshold, where the hysteresis recovery threshold is less than the preset over-limit threshold.
[0062] As one possible implementation, in some embodiments, determining the target motor drive shaft in a preset advanced state based on the current direction of motion includes: in response to the direction in which the value of the first target position increases, determining the motor drive shaft corresponding to the larger of the actual positions of the first and second motor drive shafts as the target motor drive shaft; and in response to the direction in which the value of the first target position decreases, determining the motor drive shaft corresponding to the smaller of the actual positions of the first and second motor drive shafts as the target motor drive shaft.
[0063] It is understandable that the increasing value of the first target position indicates that the target position command value issued by the host computer gradually increases over time, meaning the target position changes in the positive direction, corresponding to the positive movement of the dual-motor drive shaft (such as the crossbeam moving forward). Conversely, the decreasing value of the first target position indicates that the target position command value issued by the host computer gradually decreases over time, meaning the target position changes in the negative direction, corresponding to the reverse movement of the dual-motor drive shaft (such as the crossbeam moving backward).
[0064] Specifically, to address the inconsistency in determining the leading axis during forward and reverse motion, the FPGA can determine the target motor drive axis (i.e., the leading axis) based on the determined current motion direction. If the current motion direction is in the direction where the first target position value increases (i.e., forward motion), the FPGA compares the actual positions of the first and second motor drive axes and determines the motor drive axis corresponding to the larger value as the target motor drive axis. That is, during forward motion, a larger position value indicates that the axis moves faster and further forward, thus it is the leading axis. If the current motion direction is in the direction where the first target position value decreases (i.e., reverse motion), the FPGA can determine the drive axis corresponding to the smaller value of the two actual positions as the target motor drive axis. That is, during reverse motion, a smaller position value indicates that the axis moves faster and further forward, thus it is the leading axis.
[0065] Therefore, by adaptively selecting the larger or smaller actual position value as the leading axis based on the current direction of motion, the technical problem of inaccurate leading axis determination during reverse motion caused by the failure to consider the direction of motion in related technologies is solved. This ensures that the leading axis determination rule is consistent throughout the forward and reverse motion states, ensuring that the compensation direction is always correct, thereby avoiding the problem of synchronization error expansion due to incorrect compensation direction and effectively improving the accuracy of dual-axis synchronous control.
[0066] As one possible implementation, in some embodiments, determining the current movement direction of the dual-motor drive shaft based on a first difference between the first target position and the second target position includes: in response to the absolute value of the first difference being greater than a first preset dead zone threshold and the first difference being within a first preset interval, determining the current movement direction as the direction in which the value of the first target position increases; and in response to the absolute value of the first difference being greater than the first preset dead zone threshold and the first difference being within a second preset interval, determining the current movement direction as the direction in which the value of the first target position decreases.
[0067] The first preset dead zone threshold is a positive value (calibrable) used to determine whether the change in the target position between two adjacent control cycles is significant. The first preset interval refers to the interval greater than zero; the second preset interval refers to the interval less than zero.
[0068] Specifically, the FPGA calculates the first difference between the first target position and the second target position, and determines the current direction of motion based on the comparison between this first difference and a first preset dead zone threshold (i.e., the target step dead zone, such as 10, corresponding to the grating encoder counting unit). If the absolute value of the first difference is greater than the first preset dead zone threshold, it indicates that the target position has changed significantly between two adjacent control cycles. The FPGA further determines which interval the first difference falls into: if the first difference is in the first preset interval (i.e., the first difference is positive), it indicates that the target position in the current control cycle has increased compared to the previous control cycle, and the FPGA can determine the current direction of motion as the direction in which the first target position value increases (i.e., forward motion); if the first difference is in the second preset interval (i.e., the first difference is negative), it indicates that the target position in the current control cycle has decreased compared to the previous control cycle, and the FPGA can determine the current direction of motion as the direction in which the first target position value decreases (i.e., reverse motion).
[0069] Therefore, by setting a first preset dead zone threshold, the direction can be directly determined only when the change in the target position between adjacent cycles is significant enough. This avoids misjudgment of direction caused by minor fluctuations due to command pauses, constant speed segments, or signal noise, ensuring the stability and reliability of motion direction determination and laying the foundation for accurate identification of the leading axle.
[0070] In one possible implementation, in other embodiments, determining the current motion direction of the dual-motor drive shaft based on a first difference between the first target position and the second target position includes: in response to the absolute value of the first difference being less than or equal to a first preset dead zone threshold, calculating the average of the actual positions of the first and second motor drive shafts, and calculating a tracking error value between the average value and the first target position; in response to the absolute value of the tracking error value being greater than the second preset dead zone threshold and the tracking error value being within a first preset interval, determining the current motion direction as the direction in which the value of the first target position increases; in response to the absolute value of the tracking error value being greater than the second preset dead zone threshold and the tracking error value being within a second preset interval, determining the current motion direction as the direction in which the value of the first target position decreases; and in response to the absolute value of the tracking error value being less than or equal to the second preset dead zone threshold, determining the motion direction of the previous control cycle adjacent to the current control cycle as the current motion direction.
[0071] The tracking error value refers to the difference between the average value of the actual position of the dual-motor drive shaft and the first target position in the current control cycle. This value can reflect the degree of tracking deviation of the dual-motor drive shaft relative to the target position and is used to assist in judging the actual direction of motion when the target position does not change significantly.
[0072] Specifically, when the absolute value of the first difference is less than or equal to the first preset dead zone threshold, that is, when the target position does not change significantly between two adjacent control cycles (such as when the command is paused, the constant speed segment is reached, or the signal noise causes insufficient change), the FPGA no longer relies on the target position difference to determine the direction. Instead, it further calculates the average value of the actual positions of the two drive shafts, and then calculates the difference between the average value and the first target position in the current control cycle to obtain the tracking error value. The tracking error value is then used to assist in determining the current motion direction. The FPGA can compare the absolute value of the tracking error with a second preset dead zone threshold (i.e., position dead zone, such as 5, corresponding to the counting unit of the grating encoder): If the absolute value of the tracking error is greater than the second preset dead zone threshold and is within the first preset interval (i.e., the tracking error value is positive), it indicates that the average value of the actual position of the dual motor drive shaft is still ahead of the target position. That is, the system inertia causes the actual position to still catch up with the command value before the target position change. The FPGA determines the current motion direction as the direction in which the value of the first target position increases (i.e., forward motion); If the absolute value of the tracking error is greater than the second preset dead zone threshold and is within the second preset interval (i.e., the tracking error value is negative), it indicates that the average value of the actual position of the dual motor drive shaft is lagging behind the target position. The FPGA determines the current motion direction as the direction in which the value of the first target position decreases (i.e., reverse motion); If the absolute value of the tracking error is less than or equal to the second preset dead zone threshold, it indicates that the average value of the actual position of the dual motor drive shaft has basically followed the target position. The system is in a steady state or a state with an unclear motion direction. The FPGA can maintain the motion direction of the previous control cycle as the current motion direction to avoid frequent direction switching caused by jitter.
[0073] Therefore, through a two-level judgment mechanism consisting of comparing the first difference with the first preset dead zone threshold and comparing the tracking error with the second preset dead zone threshold, the direction is determined directly based on the target position change when the target position changes significantly. When the target position does not change significantly, the direction is determined with the help of the tracking error. When neither level of change is significant, the direction of the previous cycle is maintained. This ensures that the direction of motion can be correctly identified regardless of whether the command is in the acceleration, constant speed, or pause phase, providing a reliable basis for the leading axis judgment in over-limit processing. When the system enters the over-limit protection state, the FPGA locks the target position of the leading axis at its current actual position (i.e., stops moving forward) and sets the target position of the lagging axis as the current actual position of the leading axis, so that the lagging axis continues to catch up with the leading axis. At the same time, during the over-limit period, the PID integral term is cleared and the historical value of the derivative term is updated to avoid integral saturation and derivative shock when control is restored. This strategy avoids the mechanical stress caused by forced compensation and realizes the automatic convergence and recovery of synchronization error. The whole process does not require manual intervention to stop the machine.
[0074] It should be noted that, as alternatives to embodiments of the present invention, the direction determination stage can use the speed command symbol fed back by the servo driver instead of the determination method based on the target position difference, which is suitable for systems that can directly obtain speed commands; the over-limit handling stage can use a method of gradually reducing the speed of the lead axis command instead of the complete clamping strategy to achieve smoother error convergence, which is suitable for application scenarios with higher requirements for motion stability; in terms of control algorithms, the PID controller can be replaced with advanced control algorithms such as fuzzy PID and sliding mode control to enhance system robustness, but it should be noted that this will correspondingly increase the logic resource consumption of the FPGA; in terms of fixed-point number format, different bit width configurations such as Q24.8 or Q32.32 can be flexibly selected according to specific accuracy requirements to achieve a reasonable trade-off between computational accuracy and resource consumption. The above alternatives can be flexibly combined and selected according to actual application requirements, and all can achieve the core control objectives of embodiments of the present invention.
[0075] The synchronous control method for dual-motor drive shafts proposed in this invention obtains the current target position, the target position of the previous cycle, and the actual positions of the two drive shafts in response to the start pulse of the current control cycle. The motion direction is determined based on the difference between the current target position and the target position of the previous cycle, and a leading shaft is determined based on the motion direction. A synchronization error value is determined based on the difference between the actual positions of the two drive shafts. Based on the synchronization error value and the leading shaft, the current target position is corrected to bring the synchronization error value to convergence. Thus, by adaptively identifying the leading shaft through the trend of target position changes, and simultaneously performing correction based on the synchronization error value to reverse the target positions of the two shafts to achieve error convergence, this method solves the problem in related technologies where inaccurate determination of the leading shaft leads to incorrect compensation direction when the motion direction changes, effectively improving the synchronization accuracy of dual-motor drive shafts.
[0076] Next, a synchronous control device for a dual-motor drive shaft according to an embodiment of the present invention is described with reference to the accompanying drawings.
[0077] Figure 2 This is a block diagram of a synchronous control device for dual-motor drive shafts according to an embodiment of the present invention.
[0078] like Figure 2 As shown, the synchronous control device 10 for the dual-motor drive shaft includes: an acquisition module 100, a first determination module 200, a second determination module 300, and a correction module 400.
[0079] The acquisition module 100 is used to acquire, in response to the start pulse of the current control cycle, the first target position of the dual motor drive shaft in the current control cycle, the actual position of the first motor drive shaft, the actual position of the second motor drive shaft, and the second target position of the previous control cycle adjacent to the current control cycle. The first determining module 200 is used to determine the current movement direction of the dual-motor drive shaft based on the first difference between the first target position and the second target position, and to determine the target motor drive shaft in a preset leading state according to the current movement direction. The preset leading state is used to characterize the state in which one motor drive shaft is in a leading position relative to the other motor drive shaft. The second determining module 300 is used to determine the current synchronization error value based on the second difference between the actual position of the first motor drive shaft and the actual position of the second motor drive shaft. The correction module 400 is used to correct the first target position based on the current synchronization error value and the target motor drive shaft, so as to bring the current synchronization error value into convergence.
[0080] Optionally, in some embodiments, the correction module 400 is specifically used for: In response to the absolute value of the current synchronization error being less than or equal to a preset over-limit threshold, the output values of the proportional term, integral term, and derivative term are calculated based on the current synchronization error value. The output values of the proportional term, integral term, and derivative term are summed to generate the compensation quantity; The difference between the first target position and the compensation amount is determined as the corrected target position of the target motor drive shaft, and the sum of the first target position and the compensation amount is used as the corrected target position of the remaining motor drive shaft in the dual motor drive shaft.
[0081] Optionally, in some embodiments, the correction module 400 is specifically used for: In response to the absolute value of the current synchronization error being greater than the preset over-limit threshold, the corrected target position of the target motor drive shaft is locked at the current actual position of the target motor drive shaft, and the corrected target position of the remaining motor drive shaft in the dual motor drive shafts is determined as the current actual position of the target motor drive shaft.
[0082] Optionally, in some embodiments, a target motor drive shaft in a preset advanced state is determined based on the current direction of motion. The first determining module 200 is specifically used for: In response to the direction of increasing numerical value of the current direction of motion being the first target position, the motor drive shaft corresponding to the larger of the actual positions of the first motor drive shaft and the second motor drive shaft is determined as the target motor drive shaft; In response to the direction in which the value of the first target position decreases, the motor drive shaft corresponding to the smaller value of the actual position of the first motor drive shaft and the actual position of the second motor drive shaft is determined as the target motor drive shaft.
[0083] Optionally, in some embodiments, the current direction of motion of the dual-motor drive shaft is determined based on a first difference between the first target position and the second target position. The first determining module 200 is specifically used for: In response to the absolute value of the first difference being greater than the first preset dead zone threshold and the first difference being within the first preset interval, the current direction of motion is determined as the direction in which the value of the first target position increases; In response to the absolute value of the first difference being greater than the first preset dead zone threshold and the first difference being within the second preset interval, the current direction of motion is determined as the direction in which the value of the first target position decreases.
[0084] Optionally, in some embodiments, the current direction of motion of the dual-motor drive shaft is determined based on a first difference between the first target position and the second target position. The first determining module 200 is specifically used for: In response to the absolute value of the first difference being less than or equal to the first preset dead zone threshold, the average value of the actual position of the first motor drive shaft and the actual position of the second motor drive shaft is calculated, and the tracking error value between the average value and the first target position is calculated. In response to the absolute value of the tracking error being greater than the second preset dead zone threshold and the tracking error being within the first preset interval, the current direction of motion is determined as the direction in which the value of the first target position increases; In response to the absolute value of the tracking error being greater than the second preset dead zone threshold and the tracking error being within the second preset interval, the current direction of motion is determined as the direction in which the value of the first target position decreases. In response to the absolute value of the tracking error being less than or equal to the second preset dead zone threshold, the motion direction of the previous control cycle adjacent to the current control cycle is determined as the current motion direction.
[0085] Optionally, in some embodiments, after summing the output values of the proportional term, the integral term, and the derivative term to generate the compensation amount, the correction module 400 is further configured to: Determine whether the absolute value of the compensation amount is greater than the preset output limit value; If the absolute value of the compensation amount is greater than the preset output limit value, the preset output limit value is used as the new compensation amount, and the first target position is corrected based on the new compensation amount.
[0086] It should be noted that the foregoing explanation of the embodiment of the synchronous control method for dual-motor drive shafts also applies to the synchronous control device for dual-motor drive shafts in this embodiment, and will not be repeated here.
[0087] The synchronous control device for dual-motor drive shafts proposed in this embodiment of the invention acquires the current target position, the target position of the previous cycle, and the actual positions of the two drive shafts in response to the start pulse of the current control cycle; determines the motion direction based on the difference between the current target position and the target position of the previous cycle, and determines the leading shaft based on the motion direction; determines the synchronization error value based on the difference between the actual positions of the two drive shafts; and corrects the current target position based on the synchronization error value and the leading shaft to bring the synchronization error value to convergence. Thus, by adaptively identifying the leading shaft through the trend of target position change, and simultaneously performing correction based on the synchronization error value to cause the target positions of the two shafts to shift in opposite directions to achieve error convergence, this solves the problem in related technologies where inaccurate determination of the leading shaft leads to incorrect compensation direction when the motion direction changes, effectively improving the synchronization accuracy of dual-motor drive shafts.
[0088] Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. The electronic device may include: The memory 301, the processor 302, and the computer program stored on the memory 301 and capable of running on the processor 302.
[0089] When the processor 302 executes the program, it implements the synchronous control method for the dual-motor drive shaft provided in the above embodiments.
[0090] Furthermore, electronic devices also include: Communication interface 303 is used for communication between memory 301 and processor 302.
[0091] The memory 301 is used to store computer programs that can run on the processor 302.
[0092] The memory 301 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.
[0093] If the memory 301, processor 302, and communication interface 303 are implemented independently, then the communication interface 303, memory 301, and processor 302 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0094] Optionally, in a specific implementation, if the memory 301, processor 302, and communication interface 303 are integrated on a single chip, then the memory 301, processor 302, and communication interface 303 can communicate with each other through an internal interface.
[0095] Processor 302 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present invention.
[0096] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described synchronous control method for dual-motor drive shafts.
[0097] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described synchronous control method for dual-motor drive shafts.
[0098] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0099] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0100] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A synchronous control method for a dual-motor drive shaft, characterized in that, Includes the following steps: In response to the start pulse of the current control cycle, the first target position of the dual motor drive shaft in the current control cycle, the actual position of the first motor drive shaft, the actual position of the second motor drive shaft, and the second target position of the previous control cycle adjacent to the current control cycle are obtained. Based on the first difference between the first target position and the second target position, the current movement direction of the dual-motor drive shaft is determined, and the target motor drive shaft in a preset leading state is determined according to the current movement direction. The preset leading state is used to characterize the state in which one motor drive shaft is in a leading position relative to the other motor drive shaft. The current synchronization error value is determined based on the second difference between the actual position of the first motor drive shaft and the actual position of the second motor drive shaft. Based on the current synchronization error value and the target motor drive shaft, the first target position is corrected so that the current synchronization error value converges.
2. The synchronous control method for dual-motor drive shafts according to claim 1, characterized in that, The step of correcting the first target position based on the current synchronization error value and the target motor drive shaft includes: In response to the absolute value of the current synchronization error being less than or equal to a preset over-limit threshold, the output values of the proportional term, integral term, and derivative term are calculated based on the current synchronization error value, respectively. The output values of the proportional term, the integral term, and the derivative term are summed to generate a compensation amount; The difference between the first target position and the compensation amount is determined as the corrected target position of the target motor drive shaft, and the sum of the first target position and the compensation amount is taken as the corrected target position of the remaining motor drive shaft in the dual motor drive shaft.
3. The synchronous control method for dual-motor drive shafts according to claim 2, characterized in that, The step of correcting the first target position based on the current synchronization error value and the target motor drive shaft includes: In response to the absolute value of the current synchronization error being greater than the preset over-limit threshold, the corrected target position of the target motor drive shaft is locked at the current actual position of the target motor drive shaft, and the corrected target position of the remaining motor drive shaft in the dual motor drive shafts is determined as the current actual position of the target motor drive shaft.
4. The synchronous control method for dual-motor drive shafts according to claim 1, characterized in that, The step of determining the target motor drive shaft in a preset advanced state based on the current direction of motion includes: In response to the current direction of motion being the direction in which the value of the first target position increases, the motor drive shaft corresponding to the larger of the actual positions of the first motor drive shaft and the second motor drive shaft is determined as the target motor drive shaft; In response to the current direction of motion being the direction in which the value of the first target position decreases, the motor drive shaft corresponding to the smaller value between the actual position of the first motor drive shaft and the actual position of the second motor drive shaft is determined as the target motor drive shaft.
5. The synchronous control method for dual-motor drive shafts according to claim 1, characterized in that, Determining the current direction of motion of the dual-motor drive shaft based on the first difference between the first target position and the second target position includes: In response to the absolute value of the first difference being greater than a first preset dead zone threshold and the first difference being within a first preset interval, the current direction of motion is determined as the direction in which the value of the first target position increases; In response to the absolute value of the first difference being greater than the first preset dead zone threshold and the first difference being within the second preset interval, the current direction of motion is determined as the direction in which the value of the first target position decreases.
6. The synchronous control method for dual-motor drive shafts according to claim 5, characterized in that, Determining the current direction of motion of the dual-motor drive shaft based on the first difference between the first target position and the second target position includes: In response to the absolute value of the first difference being less than or equal to the first preset dead zone threshold, the average value of the actual position of the first motor drive shaft and the actual position of the second motor drive shaft is calculated, and the tracking error value between the average value and the first target position is calculated. In response to the absolute value of the tracking error being greater than a second preset dead zone threshold and the tracking error being within the first preset interval, the current direction of motion is determined as the direction in which the value of the first target position increases; In response to the absolute value of the tracking error being greater than the second preset dead zone threshold and the tracking error being within the second preset interval, the current direction of motion is determined to be the direction in which the value of the first target position decreases; In response to the absolute value of the tracking error being less than or equal to the second preset dead zone threshold, the motion direction of the previous control cycle adjacent to the current control cycle is determined as the current motion direction.
7. The synchronous control method for dual-motor drive shafts according to claim 2, characterized in that, After summing the output values of the proportional term, the integral term, and the derivative term to generate the compensation amount, the method further includes: Determine whether the absolute value of the compensation amount is greater than the preset output limit value; If the absolute value of the compensation amount is greater than the preset output limit value, the preset output limit value is used as the new compensation amount to correct the first target position based on the new compensation amount.
8. A synchronous control device for dual-motor drive shafts, characterized in that, include: The acquisition module is used to acquire, in response to the start pulse of the current control cycle, the first target position of the dual motor drive shaft in the current control cycle, the actual position of the first motor drive shaft, the actual position of the second motor drive shaft, and the second target position of the previous control cycle adjacent to the current control cycle. The first determining module is used to determine the current movement direction of the dual-motor drive shaft based on the first difference between the first target position and the second target position, and to determine the target motor drive shaft in a preset leading state according to the current movement direction. The preset leading state is used to characterize the state in which one motor drive shaft is in a leading position relative to the other motor drive shaft. The second determining module is used to determine the current synchronization error value based on the second difference between the actual position of the first motor drive shaft and the actual position of the second motor drive shaft. The correction module is used to correct the first target position based on the current synchronization error value and the target motor drive shaft, so as to make the current synchronization error value converge.
9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, the processor executing the program to implement the synchronous control method for a dual-motor drive shaft as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the synchronous control method for dual-motor drive shafts as described in any one of claims 1-7.
