Low-voltage integrated servo motor switching control method and system based on dual communication protocols

By establishing an instruction set mapping table and kinematic relationships, the problem of instruction inconsistency when switching between different communication protocols for low-voltage integrated servo motors was solved, achieving continuity of motor motion and smoothness of control, and ensuring the stability of the switching process.

CN121967553APending Publication Date: 2026-05-01SHENQI HENGKONG (SHENZHEN) ELECTRICAL & MECHANICAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENQI HENGKONG (SHENZHEN) ELECTRICAL & MECHANICAL CO LTD
Filing Date
2026-01-15
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing low-voltage integrated servo motors suffer from issues such as inconsistent command semantics, discontinuous control, and inappropriate switching timing when switching between different communication protocols, leading to decreased control accuracy and system instability.

Method used

By establishing a mapping table for the instruction sets of the first and second communication protocols, the missing instruction semantic types are converted into equivalent instruction combinations through kinematic relationships. The set of switchable time windows is identified, and the predicted state is calculated based on the kinematic relationship within the target switching window as the switching starting point. The deviation of the actual state after switching is then superimposed on the subsequent control instructions to achieve continuity and smoothness of protocol switching.

Benefits of technology

It achieves a unified representation of different communication protocol instruction sets, ensuring that protocol switching is performed at the optimal time, avoiding unstable states during the switching process, and guaranteeing the continuity of motor movement and the smoothness of control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967553A_ABST
    Figure CN121967553A_ABST
Patent Text Reader

Abstract

The invention provides a low-voltage integrated servo motor switching control method and system based on double communication protocols, and relates to the technical field of communication protocols, comprising the following steps: establishing a double-protocol instruction set contrast mapping table, identifying a switchable time window set, inputting a unified instruction set into a double-protocol control channel at the same time, and realizing pre-alignment; and executing protocol switching in the target switching window based on the kinematics relational expression prediction state, and compensating the switching deviation. According to the invention, smooth switching among different communication protocols is realized, and the operation stability and the control precision of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

A Low-Voltage Integrated Servo Motor Switching Control Method and System Based on Dual Communication Protocols Technical Field

[0001] This invention relates to communication protocol technology, and more particularly to a low-voltage integrated servo motor switching control method and system based on dual communication protocols. Background Technology

[0002] With the rapid development of industrial automation, low-voltage integrated servo motors are widely used in industrial robots, CNC machine tools, intelligent manufacturing and other fields due to their advantages such as high integration, small size and high energy efficiency.

[0003] In practical industrial applications, servo motors often need to switch between different working environments and control systems. Traditional low-voltage integrated servo motors typically only support a single communication protocol, which limits their application scenarios and flexibility. Although low-voltage integrated servo motors supporting dual communication protocols have emerged on the market, several technical challenges remain when switching between different communication protocols.

[0004] Different communication protocols have different instruction sets and control mechanisms, leading to inconsistencies in instruction semantics during protocol switching. Some instructions may exist in one protocol but be missing in another, causing discontinuity in control instructions during switching and ultimately resulting in abrupt changes or jitter in the motor's motion trajectory.

[0005] There is a time window selection issue during protocol switching. Inappropriate switching timing may result in the motor operating at high speed or under high load. Switching the communication protocol under these conditions can lead to a decrease in control accuracy, and may even cause system instability or safety accidents. Summary of the Invention

[0006] The present invention provides a low-voltage integrated servo motor switching control method and system based on dual communication protocols, which can solve the problems in the prior art.

[0007] A first aspect of this invention provides a switching control method for a low-voltage integrated servo motor based on dual communication protocols, comprising: acquiring a motion control command sequence and a communication protocol switching request signal for a low-voltage integrated servo motor, wherein the low-voltage integrated servo motor supports a first communication protocol and a second communication protocol; establishing a mapping table for the instruction sets of the first and second communication protocols, converting missing instruction semantic types between the two protocols into equivalent instruction combinations through kinematic relationships to obtain a unified instruction set representation; identifying a set of switchable time windows based on the motion control command sequence; upon receiving the communication protocol switching request signal, before reaching the target switching window, simultaneously inputting the unified instruction set representation into the dual protocol control channel, applying the control output of the first communication protocol to the low-voltage integrated servo motor, injecting the deviation between the control output of the second communication protocol and the actual state into the second communication protocol control channel to achieve pre-alignment, calculating a predicted state based on kinematic relationships within the target switching window as the switching starting point to execute protocol switching; and superimposing the deviation between the actual state after switching and the predicted state into subsequent motion control commands of the second communication protocol.

[0008] The steps of establishing an instruction set mapping table for the first and second communication protocols, and converting missing instruction semantic types between the two protocols into equivalent instruction combinations through kinematic relationships to obtain a unified instruction set representation, include: traversing the native instruction types supported by the first and second communication protocols, classifying them according to the control dimension into position control instructions, speed control instructions, and torque control instructions; identifying common instruction semantics supported by both protocols, the first missing instruction semantics unique to the first communication protocol, and the second missing instruction semantics unique to the second communication protocol, and recording them in the instruction set mapping table; establishing kinematic relationships based on the rotational inertia parameters, damping coefficients, and transmission ratio parameters of the low-voltage integrated servo motor; substituting the first missing instruction semantics into the kinematic relationships to solve for the equivalent control sequence represented by the common instruction semantic combination of the second communication protocol, and recording the corresponding relationship in the instruction set mapping table; processing the second missing instruction semantics in the same way and recording it in the instruction set mapping table; and converting the motion control instruction sequence into a unified instruction set representation based on the instruction set mapping table.

[0009] The steps for identifying a set of switchable time windows based on the motion control command sequence include: interpolating the target position sequence in the motion control command sequence to generate a set of discrete trajectory points containing motion state parameters; for each discrete trajectory point in the set of discrete trajectory points, calculating the theoretical control output of the first communication protocol and the second communication protocol based on the unified instruction set representation, and defining the difference between the two as the protocol response deviation; marking a protocol compatible interval when the protocol response deviation of multiple consecutive discrete trajectory points is lower than the protocol response deviation threshold; calculating the change in motion state between adjacent discrete trajectory points, and marking a motion stable interval when the change in motion state of multiple consecutive discrete trajectory points is lower than the threshold; identifying time periods that simultaneously belong to the protocol compatible interval and the motion stable interval as candidate switching windows; calculating the window switching cost based on the weighted sum of the protocol response deviation and the change in motion state; and selecting candidate switching windows whose window switching cost is lower than the cost threshold to form a set of switchable time windows.

[0010] The steps of simultaneously inputting the unified instruction set representation into the dual-protocol control channel, applying the control output of the first communication protocol to the low-voltage integrated servo motor, and injecting the deviation between the control output of the second communication protocol and the actual state into the second communication protocol control channel to achieve pre-alignment, and performing protocol switching based on the predicted state calculated according to the kinematic relationship within the target switching window as the switching starting point, include: after receiving the communication protocol switching request signal, obtaining the switchable time window closest to the current time from the set of switchable time windows as the target switching window; within the pre-alignment period between the current time and the starting time of the target switching window, simultaneously parsing the unified instruction set representation into the first control instruction sequence of the first communication protocol and the second control instruction sequence of the second communication protocol. A control command sequence is used to apply the control output of the first control command sequence to the low-voltage integrated servo motor drive motor. The actual motion state of the low-voltage integrated servo motor is collected in real time, and the state deviation between the control output of the second control command sequence and the actual motion state is calculated. The state deviation is injected as a correction amount into the internal state variable of the second communication protocol control channel, so that the internal state variable converges to an aligned state consistent with the actual motion state. At the beginning of the target switching window, a predicted state is calculated based on the kinematic relationship according to the aligned state as the switching start point. The control output of the first communication protocol control channel is stopped, and the control output of the second communication protocol control channel is applied to the low-voltage integrated servo motor to complete the protocol switching.

[0011] The step of injecting the state deviation as a correction into the internal state variables of the second communication protocol control channel, so that the internal state variables converge to an aligned state consistent with the actual motion state, includes: identifying the internal state variables of the second communication protocol control channel, the internal state variables including a position error integral term, a velocity feedforward state, and an observer state; in each control cycle of the pre-alignment period, integrating the position deviation component of the state deviation and taking the negative value, then adding it to the position error integral term; multiplying the velocity deviation component of the state deviation by the velocity feedforward gain coefficient and taking the negative value, then adding it to the velocity feedforward state; constructing an observer correction vector based on the position deviation component and the velocity deviation component; setting the observer gain coefficient according to the desired convergence speed; multiplying the observer correction vector by the observer gain coefficient and then injecting it into the observer state; when the number of cycles in which the consistency index between the internal state variables and the actual motion state continuously meets the convergence condition reaches a preset value, confirming that the internal state variables have converged to the aligned state.

[0012] The step of superimposing the deviation between the actual state after switching and the predicted state into the subsequent motion control commands of the second communication protocol includes: after completing the protocol switch, acquiring the state of the low-voltage integrated servo motor at the moment of switch completion; calculating the difference between the state after switching and the predicted state to obtain the residual deviation, which is caused by system dynamic response delay, sensor sampling delay, and control cycle asynchrony; decomposing the residual deviation into position deviation component, velocity deviation component, and acceleration deviation component based on kinematic relationships; for each motion control command in the subsequent motion control command sequence of the second communication protocol, calculating the attenuation coefficient according to the time interval between the motion control command and the moment of switch completion, multiplying the position deviation component, velocity deviation component, and acceleration deviation component by the attenuation coefficient respectively, and superimposing them into the target motion parameters of the motion control command to obtain the corrected motion control command; inputting the corrected motion control command into the control channel of the second communication protocol to drive the low-voltage integrated servo motor to execute the corrected motion trajectory.

[0013] The steps of decomposing the residual deviation into position deviation, velocity deviation, and acceleration deviation components based on kinematic relationships include: extracting the predicted position, predicted velocity, and predicted acceleration in the predicted state at the time of switching completion, and the actual position, actual velocity, and actual acceleration in the state after switching; calculating the difference between the actual position and the predicted position to obtain the initial value of position deviation, calculating the difference between the actual velocity and the predicted velocity to obtain the initial value of velocity deviation, and calculating the difference between the actual acceleration and the predicted acceleration to obtain the initial value of acceleration deviation; and decoupling the initial values ​​of position deviation, velocity deviation, and acceleration deviation based on the asynchronous characteristics of sensor sampling delay and control cycle, eliminating the coupling influence of higher-order state variables on the measured values ​​of lower-order state variables, and obtaining the decoupled position deviation, velocity deviation, and acceleration deviation components.

[0014] A second aspect of this invention provides a low-voltage integrated servo motor switching control system based on dual communication protocols, comprising: an instruction acquisition module for acquiring a motion control instruction sequence and a communication protocol switching request signal of a low-voltage integrated servo motor, wherein the low-voltage integrated servo motor supports a first communication protocol and a second communication protocol; an instruction mapping module for establishing an instruction set mapping table for the first communication protocol and the second communication protocol, converting missing instruction semantic types between the two protocols into equivalent instruction combinations through kinematic relationships to obtain a unified instruction set representation; a window identification module for identifying a set of switchable time windows based on the motion control instruction sequence; a pre-alignment and switching module for, upon receiving the communication protocol switching request signal, inputting the unified instruction set representation into the dual protocol control channel simultaneously before reaching the target switching window, applying the control output of the first communication protocol to the low-voltage integrated servo motor, injecting the deviation between the control output of the second communication protocol and the actual state into the second communication protocol control channel to achieve pre-alignment, calculating a predicted state based on kinematic relationships within the target switching window as the switching starting point to execute protocol switching; and a deviation compensation module for superimposing the deviation between the actual state after switching and the predicted state into subsequent motion control instructions of the second communication protocol.

[0015] A third aspect of the present invention provides an electronic device, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the aforementioned method.

[0016] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0017] This invention establishes a mapping table between the instruction sets of the first and second communication protocols, and converts the missing instruction semantic types between the two protocols into equivalent instruction combinations using kinematic relationships, thus achieving a unified representation of instructions from different protocols and solving the problem of asymmetric instruction sets between the two protocols. Based on motion control instruction sequence identification of switchable time window sets, it ensures that protocol switching occurs at the optimal time, avoiding unstable states during the switching process. By calculating the predicted state based on kinematic relationships within the target switching window as the switching starting point, and combining this with a compensation mechanism that superimposes the deviation between the actual and predicted states into subsequent control instructions after switching, the continuity and smoothness of the protocol switching process are effectively guaranteed. Attached Figure Description

[0018] Figure 1 is a schematic flowchart of the low-voltage integrated servo motor switching control method based on dual communication protocols according to an embodiment of the present invention; Figure 2 is a flowchart of protocol switching. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0021] Figure 1 is a flowchart illustrating the low-voltage integrated servo motor switching control method based on dual communication protocols according to an embodiment of the present invention. As shown in Figure 1, the method includes: acquiring a motion control command sequence and a communication protocol switching request signal for the low-voltage integrated servo motor, wherein the low-voltage integrated servo motor supports a first communication protocol and a second communication protocol; establishing a mapping table for the instruction sets of the first and second communication protocols, converting the missing instruction semantic types between the two protocols into equivalent instruction combinations through kinematic relationships to obtain a unified instruction set representation; identifying a set of switchable time windows based on the motion control command sequence; upon receiving the communication protocol switching request signal, before reaching the target switching window, simultaneously inputting the unified instruction set representation into the dual protocol control channel, applying the control output of the first communication protocol to the low-voltage integrated servo motor, injecting the deviation between the control output of the second communication protocol and the actual state into the second communication protocol control channel to achieve pre-alignment, calculating the predicted state based on kinematic relationships within the target switching window as the switching starting point to execute protocol switching; and superimposing the deviation between the actual state after switching and the predicted state into subsequent motion control commands of the second communication protocol.

[0022] In one optional implementation, the steps of establishing an instruction set mapping table for the first and second communication protocols, and converting the missing instruction semantic types between the two protocols into equivalent instruction combinations through kinematic relationships to obtain a unified instruction set representation include: traversing the native instruction types supported by the first and second communication protocols, classifying them according to the control dimension into position control instructions, speed control instructions, and torque control instructions, identifying common instruction semantics supported by both protocols, the first missing instruction semantics unique to the first communication protocol, and the second missing instruction semantics unique to the second communication protocol, and recording them in the instruction set mapping table; establishing kinematic relationships based on the rotational inertia parameters, damping coefficients, and transmission ratio parameters of the low-voltage integrated servo motor, substituting the first missing instruction semantics into the kinematic relationships to solve for the equivalent control sequence represented by the combination of common instruction semantics of the second communication protocol, and recording the corresponding relationship in the instruction set mapping table; processing the second missing instruction semantics in the same way and recording it in the instruction set mapping table; and converting the motion control instruction sequence into a unified instruction set representation based on the instruction set mapping table.

[0023] For example, during the control system initialization phase, the communication protocol types supported by the low-voltage integrated servo motor are first identified. In this embodiment, the low-voltage integrated servo motor is equipped with a dual-protocol communication module, supporting the first communication protocol Modbus-RTU and the second communication protocol CANopen. The Modbus-RTU protocol is connected via an RS-485 physical interface, with a baud rate set to 115200bps and a slave address set to 01H; the CANopen protocol is connected via a CAN bus interface, with a communication rate set to 1Mbps and a node ID set to 0x02. The motion control command sequence is obtained in two ways: the first is through a host computer software. The host computer software runs on an industrial control computer, and the operator configures motion tasks, including parameters such as target position, speed, and acceleration, through a graphical interface. The host computer software encapsulates these parameters into command frames conforming to the Modbus-RTU or CANopen protocol format and sends them to the controller of the low-voltage integrated servo motor via a serial port or CAN bus. After receiving the command frame, the controller verifies the frame format, extracts the command type and parameter values, forms a motion control command sequence, and stores it in the command buffer. The second method involves issuing commands via a PLC (Programmable Logic Controller). The PLC generates motion control instructions based on a pre-written control program at specific time points or trigger conditions. For example, when a workpiece arrival signal is detected, the PLC generates an absolute position control instruction with instruction code 0x06 (corresponding to Modbus function code), a target position register address of 0x2000, and a target position value of 10,000 encoder pulses. The PLC sends this instruction to the low-voltage integrated servo motor via the Modbus-RTU protocol, and the controller parses it and adds it to the motion control instruction sequence. The communication protocol switching request signal is obtained as follows: the host computer software or PLC can trigger a protocol switching request by writing to a specific register. In this embodiment, the controller reserves a protocol switching control register with address 0x3000. When the register value is written to 0x01, it indicates a request to switch from the first communication protocol (Modbus-RTU) to the second communication protocol (CANopen); when written to 0x02, it indicates a request to switch from the second communication protocol to the first communication protocol. The controller monitors the value of this register in real time. Once a change in value is detected, it is identified as a communication protocol switching request signal, and the switching request time and target protocol type are recorded. Alternatively, a protocol switching request can be triggered via a hardware input signal. The controller for the low-voltage integrated servo motor is equipped with a digital input port DI1. When this port detects a rising edge signal, the controller reads the pre-configured target protocol type (stored in non-volatile memory) and generates a protocol switching request signal.After acquiring the motion control command sequence and communication protocol switching request signal, the controller passes this information to the subsequent command mapping module, window recognition module, etc. for processing.

[0024] The algorithm iterates through the native instruction types supported by the first and second communication protocols. Taking an industrial application scenario as an example, the first communication protocol uses Modbus-RTU, and the second communication protocol uses CANopen. Both protocols are commonly used in industrial control, but they differ in instruction support. During the iteration, instructions are divided into three categories according to the control dimension: position control instructions, speed control instructions, and torque control instructions. For position control instructions, the Modbus-RTU protocol supports absolute position control instructions (POSITION_ABS), relative position control instructions (POSITION_REL), and origin return instructions (HOME); the CANopen protocol supports absolute position control instructions (POSITION_ABS), relative position control instructions (POSITION_REL), origin return instructions (HOME), and position interpolation control instructions (POSITION_INTERPOLATE). For speed control commands, the Modbus-RTU protocol supports the speed closed-loop control command (VELOCITY) and the speed ramp control command (VELOCITY_RAMP); the CANopen protocol supports the speed closed-loop control command (VELOCITY), the speed ramp control command (VELOCITY_RAMP), and the maximum speed limit command (VELOCITY_LIMIT). For torque control commands, the Modbus-RTU protocol supports the torque closed-loop control command (TORQUE) and the torque ramp control command (TORQUE_RAMP); the CANopen protocol only supports the torque closed-loop control command (TORQUE). Through comparison, the common command semantics supported by both protocols are identified as follows: absolute position control command (POSITION_ABS), relative position control command (POSITION_REL), origin return command (HOME), speed closed-loop control command (VELOCITY), speed ramp control command (VELOCITY_RAMP), and torque closed-loop control command (TORQUE). The first missing instruction semantics unique to the Modbus-RTU protocol include: the torque ramp control instruction (TORQUE_RAMP). The second missing instruction semantics unique to the CANopen protocol include: the position interpolation control instruction (POSITION_INTERPOLATE) and the maximum speed limit instruction (VELOCITY_LIMIT). These instruction types and their relationships are recorded in the instruction set mapping table.

[0025] Kinematic relationships are established based on the parameters of a low-voltage integrated servo motor. Assuming the moment of inertia of the low-voltage integrated servo motor is J = 0.0001 kg·m², the damping coefficient is B = 0.002 N·m·s / rad, and the transmission ratio is N = 10, these parameters are substituted into the kinematic relationships for solution. The specific kinematic relationships are as follows: Based on Newton's second law, the relationship between motor torque and motion state is established: T = J·dω / dt + B·ω + T L Where T is the motor output torque (N·m), ω is the motor angular velocity (rad / s), and T L Let θ be the load torque (N·m). The relationship between position, velocity, and acceleration is: θ = ∫ωdt, α = dω / dt, where θ is the motor angular position (rad) and α is the motor angular acceleration (rad / s²). Considering the transmission ratio, the relationship between position, velocity, and acceleration on the load side is: θ_load = θ / N, ω_load = ω / N, α_load = α / N. The torque conversion relationship is: T_load = T·N. Based on the above kinematic relationships, conversions between different control dimensions (position, velocity, torque) and the conversion between motor-side and load-side parameters can be achieved.

[0026] For the Modbus-RTU-specific torque ramp control command (TORQUE_RAMP), it needs to be converted to a combination of commands supported by CANopen. Torque ramp control refers to linearly increasing the torque from an initial value to a target value within a certain time. In the CANopen protocol, a similar effect can be achieved through a combination of the torque closed-loop control command (TORQUE) and a timer. The specific implementation method is as follows: Assuming the initial torque T_init = 0.5 N·m, the target torque T_target = 2.0 N·m, and the ramp time t_ramp = 1000 ms, first calculate the torque change rate, i.e., the preset ramp k = (T_target - T_init) / t_ramp = (2.0 - 0.5) / 1.0 = 1.5 N·m / s. Set the time interval Δt = 10 ms (i.e., the control cycle), then the number of steps required for the ramp process is n = t_ramp / Δt = 1000 / 10 = 100 steps. The torque increment at each step is ΔT = k·Δt = 1.5 × 0.01 = 0.015 N·m. In the CANopen protocol, 100 torque closed-loop control commands (TORQUE) are continuously sent at 10 ms intervals, and the torque value of the i-th command is T. i=T_init+i·ΔT=0.5+i×0.015 N·m (i=0,1,2,...,99), and finally the torque value reaches the target value of 2.0 N·m on the 100th transmission. This equivalent control sequence and its parameter mapping relationship (including initial torque, target torque, ramp time, control cycle, torque increment) are recorded in the instruction set mapping table.

[0027] For CANopen's unique position interpolation control command (POSITION_INTERPOLATE), it needs to be converted to a command combination supported by Modbus-RTU. Position interpolation control refers to a control method that achieves a smooth transition between multiple position points. In the Modbus-RTU protocol, a similar effect can be achieved by sending the absolute position control command (POSITION_ABS) multiple times with an appropriate time delay. The specific implementation method is as follows: Assume that interpolation needs to be performed between three position points, with the starting point θ0=0°, the intermediate point θ1=90°, and the ending point θ2=180°, and each interpolation segment has a time interval of 500 ms. Using a linear interpolation algorithm, in the first segment (θ0 to θ1), the intermediate position point is calculated at a time interval Δt=10 ms. The i-th intermediate position is θ1, i=θ0+(i·Δt / 500)·(θ1-θ0)=0+(i×10 / 500)×90=1.8i degrees (i=0,1,2,...,50). Similarly, in the second segment (θ1 to θ2), the j-th intermediate position is θ2, j = θ1 + (j·Δt / 500)·(θ2 - θ1) = 90 + (j × 10 / 500) × 90 = 90 + 1.8j degrees (j = 0, 1, 2, ..., 50). In the Modbus-RTU protocol, absolute position control commands (POSITION_ABS) corresponding to these intermediate positions are sent sequentially at 10 ms intervals to achieve smooth position interpolation. This equivalent control sequence and its parameter mapping relationship (including interpolation path points, interpolation time, control cycle, and interpolation algorithm type) are recorded in the instruction set mapping table.

[0028] For CANopen's unique maximum speed limit command (VELOCITY_LIMIT), it needs to be converted to a command combination supported by Modbus-RTU. The maximum speed limit refers to setting the upper limit of the motor's operating speed. In the Modbus-RTU protocol, a speed ramp control command (VELOCITY_RAMP) can be sent before sending position control or speed control commands, setting the target speed to the limit value to achieve a similar effect. Specifically, assuming the maximum motor speed needs to be limited to 1000 rpm, a speed ramp control command (VELOCITY_RAMP) is sent in the Modbus-RTU protocol, setting the target speed to 1000 rpm and the ramp time to a small value (e.g., 50 ms), allowing the motor to quickly reach this speed limit. Subsequently, when executing position control or speed control commands, the controller will automatically limit the speed during movement to within 1000 rpm. This equivalent control sequence and its parameter mapping relationship are recorded in the command set lookup table.

[0029] After establishing the instruction set mapping table, when controlling a low-voltage integrated servo motor, regardless of the communication protocol used, the motion control command sequence can be converted into a unified instruction set representation based on this mapping table. The conversion process is as follows: The motion control command sequence from the controller is received, and the command type and parameters are parsed out. Then, the instruction set mapping table is queried to confirm whether the command type has common command semantics. If it does, the original command type and parameters are directly retained; if it is a missing command semantic, it is replaced according to the equivalent control sequence recorded in the mapping table. Finally, the converted command sequence is output as a unified instruction set representation. For example, when a CANopen protocol position interpolation control command (POSITION_INTERPOLATE) is received, if the target device only supports the Modbus-RTU protocol, the instruction set mapping table will be queried to find the corresponding absolute position control command (POSITION_ABS) sequence, and these commands will be sent sequentially at preset time intervals to achieve the effect of position interpolation control.

[0030] The instruction set mapping table established by this invention can effectively solve the problem of instruction set incompatibility between different communication protocols, and realize unified control of low-voltage integrated servo motors in multi-protocol environments.

[0031] In an optional implementation, the step of identifying a set of switchable time windows based on the motion control command sequence includes: interpolating the target position sequence in the motion control command sequence to generate a set of discrete trajectory points containing motion state parameters; for each discrete trajectory point in the set of discrete trajectory points, calculating the theoretical control output of the first communication protocol and the second communication protocol based on the unified instruction set representation, and defining the difference between the two as the protocol response deviation; marking a protocol compatible interval when the protocol response deviation of multiple consecutive discrete trajectory points is lower than the protocol response deviation threshold; calculating the change in motion state between adjacent discrete trajectory points; marking a motion stable interval when the change in motion state of multiple consecutive discrete trajectory points is lower than the threshold; identifying time periods that simultaneously belong to the protocol compatible interval and the motion stable interval as candidate switching windows; calculating the window switching cost based on the weighted sum of the protocol response deviation and the change in motion state; and selecting candidate switching windows whose window switching cost is lower than the cost threshold to form a set of switchable time windows.

[0032] For example, suppose the motion control command sequence contains five target position points: θ1=0 degrees, θ2=45 degrees, θ3=90 degrees, θ4=135 degrees, and θ5=180 degrees, with corresponding timestamps of t1=0 milliseconds, t2=100 milliseconds, t3=200 milliseconds, t4=300 milliseconds, and t5=400 milliseconds, respectively. A cubic spline interpolation algorithm is used to refine the intervals between adjacent target position points, with an interpolation time interval set to 10 milliseconds. In the first trajectory segment (from θ1 to θ2), the time range is from 0 milliseconds to 100 milliseconds, requiring the generation of 10 discrete trajectory points. The boundary condition for cubic spline interpolation is set so that the velocities at the start and end points are both zero, i.e., the first derivative of the boundary is zero.

[0033] In constructing the cubic polynomial coefficient matrix, the position function expression for each trajectory segment is obtained as: Position value = Starting position + First-order coefficient × Time variable + Second-order coefficient × Time variable 2 + Cubic term coefficient × time variable 3 Interpolating the first trajectory segment at time 10 milliseconds, substituting the time variable value of 10 milliseconds, yields a position value of approximately 4.5 degrees. Taking the first derivative of the interpolated position value gives the velocity value, and the second derivative gives the acceleration value. At 10 milliseconds, the velocity is approximately 0.45 degrees / millisecond (27 degrees / second), and the acceleration is approximately 0.09 degrees / millisecond² (5400 degrees / second²).

[0034] Calculate the position, velocity, and acceleration parameters of all 10 discrete trajectory points in the first segment of the trajectory in sequence, as follows: Time 0 milliseconds, position 0 degrees, velocity 0 degrees / second, acceleration 0 degrees / second²; Time 10 milliseconds, position 4.5 degrees, velocity 27 degrees / second, acceleration 5400 degrees / second²; Time 20 milliseconds, position 9.2 degrees, velocity 54 degrees / second, acceleration 5200 degrees / second²; Time 30 milliseconds, position 14.1 degrees, velocity 81 degrees / second, acceleration 4900 degrees / second²; Time 40 milliseconds, position 18.8 degrees, velocity 90 degrees / second, acceleration 4800 degrees / second²; Time 5... At 0 milliseconds, the position is 23.5 degrees, the velocity is 92 degrees / second, and the acceleration is 4500 degrees / second². At 60 milliseconds, the position is 28.3 degrees, the velocity is 91 degrees / second, and the acceleration is 4000 degrees / second². At 70 milliseconds, the position is 33.2 degrees, the velocity is 89 degrees / second, and the acceleration is 3500 degrees / second². At 80 milliseconds, the position is 37.8 degrees, the velocity is 88 degrees / second, and the acceleration is 3300 degrees / second². At 90 milliseconds, the position is 40.5 degrees, the velocity is 88 degrees / second, and the acceleration is 3200 degrees / second². At 100 milliseconds, the position is 45.0 degrees, the velocity is 90 degrees / second, and the acceleration is 3000 degrees / second². The above interpolation calculation process is repeated for the remaining four trajectory segments, ultimately generating a set of 50 discrete trajectory points. Each discrete trajectory point contains four motion state parameters: timestamp, position, velocity, and acceleration.

[0035] The first communication protocol uses pulse width modulation (PWM) control with a control period of 1 millisecond, a position loop gain of 100, a velocity loop gain of 0.5, and a torque constant of 0.1 N·m / A. The second communication protocol uses current vector control with a control period of 0.5 milliseconds, a position loop gain of 120, a velocity loop gain of 0.6, and a torque constant of 0.1 N·m / A. For the fifth discrete trajectory point (time 40 milliseconds, position 18.8 degrees, velocity 90 degrees / second, acceleration 4800 degrees / second²), the theoretical control output of the first communication protocol is calculated. First, the position error is calculated as: Target position - Current position = 18.8 degrees - 18.0 degrees = 0.8 degrees, where the current feedback position is assumed to be 18.0 degrees. The position controller outputs a velocity command: Position error × Position loop gain = 0.8 degrees × 100 = 80 degrees / second. Speed ​​error = Speed ​​command - Current speed = 80 degrees / second - 75 degrees / second = 5 degrees / second, where the current feedback speed is assumed to be 75 degrees / second. Speed ​​controller output torque command = Speed ​​error × Speed ​​loop gain = 5 degrees / second × 0.5 = 2.5 N·m. Current command = Torque command ÷ Torque constant = 2.5 N·m ÷ (0.1 N·m / Ampere) = 25 Amperes. The theoretical control output of the first communication protocol is 25 Amperes.

[0036] Using the same discrete trajectory point parameters, the theoretical control output of the second communication protocol is calculated. With a position error maintained at 0.8 degrees, the position controller outputs a speed command of 0.8 degrees × 120 = 96 degrees / second. The speed error is 96 degrees / second - 75 degrees / second = 21 degrees / second. The speed controller outputs a torque command of 21 degrees / second × 0.6 = 12.6 N·m. The current command is 12.6 N·m ÷ (0.1 N·m / Ampere) = 126 Amperes. The theoretical control output of the second communication protocol is 126 Amperes. The protocol response deviation is |theoretical control output of the second communication protocol - theoretical control output of the first communication protocol| = |126 Amperes - 25 Amperes| = 101 Amperes. Setting the protocol response deviation threshold to 20 Amperes, the protocol response deviation of this discrete trajectory point, 101 Amperes, exceeds the threshold of 20 Amperes, thus failing to meet the protocol compatibility conditions.

[0037] The protocol response deviations of the remaining 49 discrete trajectory points were calculated sequentially. It was found that the protocol response deviations of the 10th to 15th discrete trajectory points were 8 amps, 9 amps, 7 amps, 6 amps, 8 amps, and 9 amps, respectively, all below the threshold of 20 amps. When the protocol response deviations of six consecutive discrete trajectory points (the 10th to 15th) are below the protocol response deviation threshold, the time range of 90 milliseconds to 140 milliseconds is marked as the protocol compatibility interval. The change in motion state between adjacent discrete trajectory points includes three components: position change, velocity change, and acceleration change. For the 10th and 11th discrete trajectory points, the motion state parameters of the 10th discrete trajectory point are: time 90 milliseconds, position 40.5 degrees, velocity 88 degrees / second, acceleration 3200 degrees / second²; and the motion state parameters of the 11th discrete trajectory point are: time 100 milliseconds, position 45.0 degrees, velocity 90 degrees / second, acceleration 3000 degrees / second². Position change = Position of the 11th discrete trajectory point - Position of the 10th discrete trajectory point = 45.0 degrees - 40.5 degrees = 4.5 degrees. Velocity change = Velocity of the 11th discrete trajectory point - Velocity of the 10th discrete trajectory point = 90 degrees / second - 88 degrees / second = 2 degrees / second. Acceleration change = Acceleration of the 11th discrete trajectory point - Acceleration of the 10th discrete trajectory point = 3000 degrees / second² - 3200 degrees / second² = -200 degrees / second².

[0038] The overall change in motion state is calculated using the square root of the weighted sum of squares, with weighting coefficients set as follows: position change 0.5, velocity change 0.3, and acceleration change 0.2. Overall change in motion state = The calculated value is approximately 28.5 degrees equivalent. Setting the threshold for motion state change to 30 degrees equivalent, the combined motion state change of the adjacent discrete trajectory points (28.5 degrees equivalent) is lower than the threshold of 30 degrees equivalent, satisfying the motion stability condition. The combined motion state change of 10 groups of adjacent discrete trajectory points between the 10th and 20th points is calculated sequentially, yielding values ​​of 28.5, 27.8, 26.2, 25.5, 24.8, 25.1, 26.0, 27.3, 28.8, and 29.2 degrees equivalent, all lower than the threshold of 30 degrees equivalent. When the motion state change of 10 consecutive groups of adjacent discrete trajectory points is lower than the threshold, the time range of 90 milliseconds to 200 milliseconds is marked as the motion stability interval.

[0039] The protocol compatibility interval is 90 to 140 milliseconds, and the motion stability interval is 90 to 200 milliseconds. The intersection of these two intervals is 90 to 140 milliseconds, which is designated as the first candidate switching window. The switching cost is calculated by adding the weighted average of the protocol response deviations of all discrete trajectory points within the candidate switching window to the weighted average of the overall motion state changes. The weighting coefficient for the protocol response deviation is set to 0.6, and the weighting coefficient for the overall motion state changes is set to 0.4. For the first candidate switching window (90 to 140 milliseconds), this window includes the 10th to 15th discrete trajectory points, a total of 6 points. The weighted average of the protocol response deviations = (8 + 9 + 7 + 6 + 8 + 9) Ampers ÷ 6 = 7.83 Ampers. The weighted average of the overall motion state changes = (28.5 + 27.8 + 26.2 + 25.5 + 24.8 + 25.1) degrees equivalent units ÷ 6 = 26.32 degrees equivalent units. The window switching cost is calculated as 0.6 × 7.83 amperes + 0.4 × 26.32 degrees (equivalent units) = 15.23 comprehensive cost units. Setting the cost threshold to 20 comprehensive cost units, the first candidate switching window's window switching cost of 15.23 comprehensive cost units is lower than the cost threshold of 20 comprehensive cost units, thus meeting the switching condition. The first candidate switching window is added to the set of switchable time windows. The above calculation process is repeated for the remaining candidate switching windows, ultimately resulting in a set containing three switchable time windows: 90 milliseconds to 140 milliseconds, 210 milliseconds to 250 milliseconds, and 320 milliseconds to 370 milliseconds.

[0040] This invention achieves accurate determination of the timing of communication protocol switching by identifying the intersection of the protocol compatibility interval and the motion stability interval and calculating the window switching cost, thereby reducing control disturbances during the switching process and improving the motion continuity and control stability of the low-voltage integrated servo motor in protocol switching scenarios.

[0041] In one optional implementation, the unified instruction set representation is simultaneously input into the dual-protocol control channel, the control output of the first communication protocol is applied to the low-voltage integrated servo motor, and the deviation between the control output of the second communication protocol and the actual state is injected into the second communication protocol control channel to achieve pre-alignment. The step of calculating the predicted state based on kinematic relationships within the target switching window and executing protocol switching as the switching starting point includes: after receiving the communication protocol switching request signal, obtaining the switchable time window closest to the current time from the set of switchable time windows as the target switching window; within the pre-alignment period between the current time and the start time of the target switching window, simultaneously parsing the unified instruction set representation into a first control instruction sequence of the first communication protocol and a second control instruction sequence of the second communication protocol. The second control command sequence of the communication protocol applies the control output of the first control command sequence to the low-voltage integrated servo motor drive motor; the actual motion state of the low-voltage integrated servo motor is collected in real time, and the state deviation between the control output of the second control command sequence and the actual motion state is calculated; the state deviation is injected as a correction amount into the internal state variable of the second communication protocol control channel, so that the internal state variable converges to an aligned state consistent with the actual motion state; at the beginning of the target switching window, based on the kinematic relationship, a predicted state is calculated according to the aligned state as the switching start point, the control output of the first communication protocol control channel is stopped, and the control output of the second communication protocol control channel is applied to the low-voltage integrated servo motor to complete the protocol switching.

[0042] Referring to the protocol switching flowchart in Figure 2, for example, upon receiving a communication protocol switching request signal, the system immediately retrieves the nearest switchable time window from the set of switchable time windows as the target switching window. Assuming the current time is 150 milliseconds, the set of switchable time windows contains three windows: 90 milliseconds to 140 milliseconds, 210 milliseconds to 250 milliseconds, and 320 milliseconds to 370 milliseconds. Since the first window's end time of 140 milliseconds is earlier than the current time of 150 milliseconds, this window is unavailable. The second window starts at 210 milliseconds, with a time difference of 210 milliseconds - 150 milliseconds = 60 milliseconds from the current time of 150 milliseconds. The third window starts at 320 milliseconds, with a time difference of 320 milliseconds - 150 milliseconds = 170 milliseconds from the current time of 150 milliseconds. Comparing the time differences between the two available windows and the current time, the window with the smallest time difference is selected as the target switching window; that is, the second window (210 milliseconds to 250 milliseconds) is selected as the target switching window. Record the start time of the target switching window as 210 milliseconds and the end time as 250 milliseconds. Define the pre-alignment period as the time between the current time of 150 milliseconds and the start time of the target switching window as 210 milliseconds. The length of the pre-alignment period is 210 milliseconds - 150 milliseconds = 60 milliseconds.

[0043] During the pre-alignment period, the unified instruction set representation is simultaneously input into the dual-protocol control channels for parsing. The unified instruction set representation contains a series of motion control commands, each including parameters such as command type, target position, target velocity, and target acceleration. The first communication protocol control channel parses the unified instruction set representation into a first control command sequence, and the second communication protocol control channel parses it into a second control command sequence. Assume that during the pre-alignment period, the unified instruction set representation contains a position control command with a target position of 90 degrees, a target velocity of 100 degrees / second, and a target acceleration of 5000 degrees / second². The first communication protocol uses pulse width modulation (PWM) control to parse this command into a first control command sequence. The command format is function code 0x06, position register address 0x2000, and the encoder pulse count corresponding to a position value of 90 degrees is 20,000 pulses (assuming an encoder resolution of 1 degree corresponds to 222.22 pulses). The second communication protocol uses current vector control to parse the instruction into a second control instruction sequence. The instruction format is object dictionary index 0x607A, sub-index 0x00, and 20,000 encoder pulses corresponding to the position value of 90 degrees. The control output of the first control instruction sequence is applied to the low-voltage integrated servo motor to drive the motor, which moves from the current position of 45 degrees to the target position of 90 degrees.

[0044] During the pre-alignment period, the actual motion state of the low-voltage integrated servo motor is acquired in real time. The low-voltage integrated servo motor is equipped with an absolute encoder and a speed sensor. The encoder sampling period is 1 millisecond, and the speed sensor sampling period is 1 millisecond. At the 160-millisecond pre-alignment period, the encoder acquires an actual position of 50 degrees, and the speed sensor acquires an actual speed of 98 degrees / second. The actual acceleration is calculated through speed difference: actual acceleration = (current speed - previous cycle speed) ÷ sampling period = (98 degrees / second - 96 degrees / second) ÷ 1 millisecond = 2000 degrees / second². The actual motion state is recorded as position 50 degrees, speed 98 degrees / second, and acceleration 2000 degrees / second². The second control command sequence calculates the theoretical control output based on the target position of 90 degrees, target speed of 100 degrees / second, and target acceleration of 5000 degrees / second². The second communication protocol control channel adopts a three-loop control structure, including a position loop, a speed loop, and a current loop. The position loop gain is set to 120, the speed loop gain to 0.6, and the torque constant to 0.1 N·m / A. Position error = target position - actual position = 90 degrees - 50 degrees = 40 degrees. The position controller outputs a speed command = position error × position loop gain = 40 degrees × 120 = 4800 degrees / second. The speed loop limits the speed command, with the upper limit set to the target speed of 100 degrees / second. The speed command is limited to 100 degrees / second. Speed ​​error = speed command - actual speed = 100 degrees / second - 98 degrees / second = 2 degrees / second. The speed controller outputs a torque command = speed error × speed loop gain = 2 degrees / second × 0.6 = 1.2 N·m. The current command = torque command ÷ torque constant = 1.2 N·m ÷ (0.1 N·m / A) = 12 A. The theoretical control output of the second control command sequence is 12 A.

[0045] The state deviation is calculated based on the difference between the theoretical control output of the second control command sequence and the actual motion state. At time 160 milliseconds, the theoretical control output of the second control command sequence is 12 amps, and the actual control output applied to the motor is assumed to be 10 amps, which is the control output of the first control command sequence. State deviation = Theoretical control output - Actual control output = 12 amps - 10 amps = 2 amps. This state deviation is corrected by injecting internal state variables into the second communication protocol control channel. The internal state variables of the second communication protocol control channel include position integral term, velocity integral term, and current integral term. Correction amount for position integral term = State deviation × Position integral gain = 2 amps × 0.05 = 0.1 degrees. Correction amount for velocity integral term = State deviation × Velocity integral gain = 2 amps × 0.02 = 0.04 degrees / second. Correction amount for current integral term = State deviation × Current integral gain = 2 amps × 0.1 = 0.2 amps. Corrected position integral term = Original position integral term + Correction amount = 0 degrees + 0.1 degrees = 0.1 degrees. The corrected velocity integral term = original velocity integral term + correction = 0 degrees / second + 0.04 degrees / second = 0.04 degrees / second. The corrected current integral term = original current integral term + correction = 0 amperes + 0.2 amperes = 0.2 amperes. In the subsequent moments of the pre-alignment period, the actual motion state is continuously acquired and the state deviation is calculated. The state deviation is injected into the internal state variables of the second communication protocol control channel for correction, so that the internal state variables gradually converge to an aligned state consistent with the actual motion state. At the last moment of the pre-alignment period, 209 milliseconds, the internal state variables have converged, the position integral term is 1.5 degrees, the velocity integral term is 0.8 degrees / second, and the current integral term is 1.0 amperes. At this point, the internal state of the second communication protocol control channel is aligned with the actual motion state.

[0046] At the start of the target switching window, 210 milliseconds, the predicted state is calculated based on the alignment state using kinematic equations as the switching starting point. The kinematic equations include the relationship between position, velocity, and acceleration. At 210 milliseconds, the alignment state includes a position integral term of 1.5 degrees, a velocity integral term of 0.8 degrees / second, and a current integral term of 1.0 amperes. The actual acquired motion state is a position of 88 degrees, a velocity of 99 degrees / second, and an acceleration of 4500 degrees / second². The predicted state's position = actual position + position integral term = 88 degrees + 1.5 degrees = 89.5 degrees. The predicted state's velocity = actual velocity + velocity integral term = 99 degrees / second + 0.8 degrees / second = 99.8 degrees / second. The predicted acceleration = actual acceleration + (current integral term × torque constant ÷ moment of inertia) = 4500 degrees / second² + (1.0 ampere × 0.1 N·m / ampere ÷ 0.0001 kg·m²) = 4500 degrees / second² + 1000 degrees / second² = 5500 degrees / second². Using the predicted state as the switching starting point, the control output of the first communication protocol control channel is stopped, and the control output of the second communication protocol control channel is applied to the low-voltage integrated servo motor. The second communication protocol control channel calculates the control output based on the predicted state: Position error = target position - predicted position = 90 degrees - 89.5 degrees = 0.5 degrees. Speed ​​command = 0.5 degrees × 120 = 60 degrees / second. Speed ​​error = 60 degrees / second - 99.8 degrees / second = -39.8 degrees / second. Torque command = -39.8 degrees / second × 0.6 = -23.88 N·m. The current command is -23.88 N·m ÷ (0.1 N·m / Ampere) = -238.8 Amperes. The second communication protocol control channel applies the current command -238.8 Amperes to the low-voltage integrated servo motor, completing the protocol switch.

[0047] This invention achieves a smooth transition of control state during communication protocol switching by injecting state deviation during pre-alignment periods and calculating the predicted state at the switching start point, thus eliminating abrupt changes in control output caused by protocol switching and ensuring the continuity of motion of the low-voltage integrated servo motor.

[0048] In an optional implementation, the step of injecting the state deviation as a correction quantity into the internal state variables of the second communication protocol control channel, so that the internal state variables converge to an aligned state consistent with the actual motion state, includes: identifying the internal state variables of the second communication protocol control channel, the internal state variables including a position error integral term, a velocity feedforward state, and an observer state; in each control cycle of the pre-alignment period, integrating the position deviation component of the state deviation and taking the negative value, then adding it to the position error integral term; multiplying the velocity deviation component of the state deviation by the velocity feedforward gain coefficient and taking the negative value, then adding it to the velocity feedforward state; constructing an observer correction vector based on the position deviation component and the velocity deviation component; setting the observer gain coefficient according to the desired convergence speed; multiplying the observer correction vector by the observer gain coefficient and then injecting it into the observer state; when the number of cycles in which the consistency index between the internal state variables and the actual motion state continuously meets the convergence condition reaches a preset value, confirming that the internal state variables have converged to the aligned state.

[0049] For example, the internal state variables of the second communication protocol control channel include three components: a position error integral term, a speed feedforward state, and an observer state. The position error integral term is used to eliminate steady-state errors in position control. Its data structure is defined as a double-precision floating-point number, with a value range of -10000 degrees to 10000 degrees, and an initial value set to 0 degrees. The speed feedforward state is used to compensate for the dynamic response delay of the speed loop. Its data structure is defined as a double-precision floating-point number, with a value range of -5000 degrees / second to 5000 degrees / second, and an initial value set to 0 degrees / second. The observer state is used to estimate the actual motion state of the motor and load disturbances. It is represented by a three-dimensional vector and includes a position estimation component, a speed estimation component, and a load torque estimation component. All three components are data types of double-precision floating-point numbers, with value ranges of -360 degrees to 360 degrees, -3000 degrees / second to 3000 degrees / second, and -50 N·m to 50 N·m, respectively, and their initial values ​​are all set to 0. Internal state variables are stored in the controller’s non-volatile memory, with an address range of 0x4000 to 0x4100. They are stored in little-endian byte order, and each variable occupies 8 bytes of space.

[0050] Within each control cycle of the pre-alignment period, the state deviation is decomposed into two components: position deviation and velocity deviation. Assuming the pre-alignment period is 160 milliseconds, the theoretical position output of the second control command sequence is 90 degrees, and the actual position is 50 degrees. The position deviation component = theoretical position output - actual position = 90 degrees - 50 degrees = 40 degrees. The theoretical velocity output of the second control command sequence is 100 degrees / second, and the actual velocity is 98 degrees / second. The velocity deviation component = theoretical velocity output - actual velocity = 100 degrees / second - 98 degrees / second = 2 degrees / second. The position deviation component is calculated using the trapezoidal integration method, with an integration step size equal to the control cycle of 1 millisecond. The position deviation integral value at 160 milliseconds = position deviation integral value of the previous cycle + (current cycle position deviation component + previous cycle position deviation component) ÷ 2 × control cycle.

[0051] Assuming the position deviation component at 159 milliseconds in the previous cycle is 38 degrees, and the integral value of the position deviation in the previous cycle is 2 degrees per second, the integral value of the position deviation in the current cycle = 2 degrees per second + (40 degrees + 38 degrees) ÷ 2 × 0.001 seconds = 2 degrees per second + 0.039 degrees per second = 2.039 degrees per second. The negative value of the position deviation integral is added to the position error integral term, and the updated position error integral term = original position error integral term + (-position deviation integral value) = 0 degrees + (-2.039 degrees) = -2.039 degrees. The speed deviation component is multiplied by the speed feedforward gain coefficient, the negative value is added to the speed feedforward state. The speed feedforward gain coefficient is set to 0.8, based on the ratio of the motor's speed loop response bandwidth to the control cycle, and is suitable for low-voltage integrated servo motors with a response bandwidth in the range of 50 Hz to 200 Hz. Velocity feedforward correction = Velocity deviation component × Velocity feedforward gain coefficient = 2 degrees / second × 0.8 = 1.6 degrees / second. Updated velocity feedforward state = Original velocity feedforward state + (-velocity feedforward correction) = 0 degrees / second + (-1.6 degrees / second) = -1.6 degrees / second.

[0052] The observer correction vector is constructed based on a combination of position and velocity deviation components. The observer employs a Luneburger observer structure, with a two-dimensional correction vector. The first component is the position deviation component, and the second component is the velocity deviation component. At time 160 milliseconds, the first component of the observer correction vector is 40 degrees, and the second component is 2 degrees / second. The observer gain coefficient is set according to the desired convergence rate, defined as the time required for the observer state error to decay to 1 / e of its initial value, which is set to 20 milliseconds.

[0053] The observer gain coefficient matrix is ​​a 2×2 square matrix, calculated using the pole placement method, with desired pole positions set at -50 radians / second and -100 radians / second. The calculated first row of the observer gain coefficient matrix is ​​[150, 2500], and the second row is [7500, 5000]. The correction amount for the position estimation component of the observer state = element of the first row and first column of the observer gain coefficient matrix × first component of the observer correction vector + element of the first row and second column of the observer gain coefficient matrix × second component of the observer correction vector = 150 × 40 degrees + 2500 × 2 degrees / second = 6000 degrees + 5000 degrees = 11000 degrees. The correction amount for the velocity estimation component of the observer state = element in the second row and first column of the observer gain coefficient matrix × first component of the observer correction vector + element in the second row and second column of the observer gain coefficient matrix × second component of the observer correction vector = 7500 × 40 degrees + 5000 × 2 degrees / second = 300000 degrees + 10000 degrees / second = 310000 degrees / second. Due to the large value of the correction amount, saturation limiting is used to prevent observer state divergence. The limiting range for the position estimation component correction is -100 degrees to 100 degrees, and the limiting range for the velocity estimation component correction is -500 degrees / second to 500 degrees / second. After limiting, the position estimation component correction is 100 degrees, and the velocity estimation component correction is 500 degrees / second. The updated observer state position estimation component = original position estimation component + limited position estimation component correction × control period = 0 degrees + 100 degrees × 0.001 seconds = 0.1 degrees. The updated observer state velocity estimation component = original velocity estimation component + correction amount of the velocity estimation component after limiting × control period = 0 degrees / second + 500 degrees / second × 0.001 seconds = 0.5 degrees / second.

[0054] The consistency index between the internal state variables and the actual motion state is defined as the weighted sum of the absolute values ​​of the position error integral term and the deviation from the actual position, the absolute values ​​of the velocity feedforward state and the deviation from the actual velocity, and the absolute difference between the observer's state position estimation component and the actual position. The weighting coefficient for the position error integral term is set to 0.5, the weighting coefficient for the velocity feedforward state is set to 0.3, and the weighting coefficient for the observer's state position estimation component is set to 0.2. At time 160 milliseconds, the position error integral term is -2.039 degrees, and the actual position deviation is 40 degrees. The first index = |position error integral term - actual position deviation| × weighting coefficient = |-2.039 degrees - 40 degrees| × 0.5 = 21.0195 degrees. The velocity feedforward state is -1.6 degrees / second, and the actual velocity deviation is 2 degrees / second. The second index = |velocity feedforward state - actual velocity deviation| × weighting coefficient = |-1.6 degrees / second - 2 degrees / second| × 0.3 = 1.08 degrees / second. The observer's state position estimate is 0.1 degrees, and the actual position is 50 degrees. The third index = |Observer state position estimate - Actual position| × weighting coefficient = |0.1 degrees - 50 degrees| × 0.2 = 9.98 degrees. The consistency index = First index + Second index + Third index = 21.0195 degrees + 1.08 degrees / second + 9.98 degrees = 32.0795 degrees equivalent units. The convergence condition is set at a consistency index less than 5 degrees equivalent units. The consistency index of 32.0795 degrees equivalent units in the current period does not meet the convergence condition.

[0055] In subsequent control cycles during the pre-alignment period, the state deviation injection process is continuously executed, and the consistency index gradually decreases. At time 205 milliseconds, the consistency index decreases to 4.8 equivalent units, satisfying the convergence condition. The threshold for the number of consecutive control cycles satisfying the convergence condition is set to 5 control cycles (5 milliseconds). In the 5 control cycles from time 205 milliseconds to time 209 milliseconds, the consistency index is 4.8 equivalent units, 4.5 equivalent units, 4.2 equivalent units, 4.0 equivalent units, and 3.8 equivalent units, respectively, all satisfying the convergence condition. When the number of consecutive control cycles satisfying the convergence condition reaches the preset value of 5 control cycles, it is confirmed that the internal state variables have converged to the aligned state.

[0056] This invention enables rapid alignment of the internal state variables of the second communication protocol control channel with the actual motion state, providing an accurate initial state for protocol switching and ensuring the smoothness of the switching process.

[0057] In one optional implementation, the step of superimposing the deviation between the actual state after switching and the predicted state into subsequent motion control commands of the second communication protocol includes: after completing the protocol switching, acquiring the state of the low-voltage integrated servo motor at the moment of switching completion; calculating the difference between the state after switching and the predicted state to obtain a residual deviation, wherein the residual deviation is caused by system dynamic response delay, sensor sampling delay, and control cycle asynchrony; decomposing the residual deviation into position deviation component, velocity deviation component, and acceleration deviation component based on kinematic relationships; for each motion control command in the subsequent motion control command sequence of the second communication protocol, calculating an attenuation coefficient based on the time interval between the motion control command and the moment of switching completion, multiplying the position deviation component, velocity deviation component, and acceleration deviation component by the attenuation coefficient respectively, and superimposing them into the target motion parameters of the motion control command to obtain a corrected motion control command; inputting the corrected motion control command into the second communication protocol control channel to drive the low-voltage integrated servo motor to execute the corrected motion trajectory.

[0058] For example, immediately after the protocol switch is completed, the post-switch state of the low-voltage integrated servo motor is acquired at the moment of switch completion. The switch completion moment is defined as the moment when the control output of the second communication protocol control channel begins to be applied to the low-voltage integrated servo motor, assumed to be 210 milliseconds. The absolute encoder and speed sensor configured on the low-voltage integrated servo motor perform a synchronous sampling once at the moment of switch completion, with an encoder sampling delay of 0.5 milliseconds and a speed sensor sampling delay of 0.3 milliseconds. At time 210.5 milliseconds, the actual position acquired by the encoder is 89.2 degrees, and at time 210.3 milliseconds, the actual speed acquired by the speed sensor is 99.5 degrees / second. The acceleration is calculated through speed difference: actual acceleration = (current speed - previous cycle speed) ÷ control cycle = (99.5 degrees / second - 99.0 degrees / second) ÷ 1 millisecond = 500 degrees / second². Sampling delay compensation uses a first-order extrapolation method. The compensated position = acquisition position + actual velocity × sampling delay = 89.2 degrees + 99.5 degrees / second × 0.5 milliseconds = 89.2 degrees + 0.04975 degrees = 89.24975 degrees. The compensated velocity = acquisition velocity + actual acceleration × sampling delay = 99.5 degrees / second + 500 degrees / second² × 0.3 milliseconds = 99.65 degrees / second. After the switch, the status is recorded as: position 89.24975 degrees, velocity 99.65 degrees / second, acceleration 500 degrees / second².

[0059] The predicted state is calculated 210 milliseconds at the start of the target switching window, including a position of 89.5 degrees, a velocity of 99.8 degrees / second, and an acceleration of 5500 degrees / second². The residual deviation is calculated based on the difference between the switched state and the predicted state. Residual position deviation = Switched state position - Predicted state position = 89.24975 degrees - 89.5 degrees = -0.25025 degrees. Residual velocity deviation = Switched state velocity - Predicted state velocity = 99.65 degrees / second - 99.8 degrees / second = -0.15 degrees / second. Residual acceleration deviation = Switched state acceleration - Predicted state acceleration = 500 degrees / second² - 5500 degrees / second² = -5000 degrees / second². The residual deviation arises from three factors. The dynamic response delay stems from the influence of the motor's mechanical inertia and electromagnetic time constant, causing the actual motion state to lag behind the theoretically predicted state, with a lag time of approximately 2 to 5 milliseconds. The sensor sampling delay originates from the signal processing circuit delays of the encoder and speed sensor, as well as the analog-to-digital conversion delay, with a cumulative delay time of 0.3 to 0.8 milliseconds. The control cycle asynchrony stems from the difference between the control cycle of the first communication protocol (1 millisecond) and the control cycle of the second communication protocol (0.5 milliseconds), and the phase difference between the two control cycles can reach 0.5 milliseconds at the moment of switching.

[0060] The residual error is decomposed into three independent components based on the kinematic equation: position error, velocity error, and acceleration error. The kinematic equation describes the differential relationship between position, velocity, and acceleration, where velocity is the first derivative of position with respect to time, and acceleration is either the first derivative of velocity with respect to time or the second derivative of position with respect to time. The initial values ​​for the residual error are calculated as follows: position residual error = -0.25025 degrees, velocity residual error = -0.15 degrees / second, and acceleration residual error = -5000 degrees / second². Considering the coupling effect caused by sensor sampling delay and control cycle asynchrony, the initial error values ​​are decoupled to eliminate the coupling effect of higher-order state variables on the measured values ​​of lower-order state variables, resulting in the position error, velocity error, and acceleration error components. The typical range for the position error component is -1 degree to 1 degree, the typical range for the velocity error component is -5 degrees / second to 5 degrees / second, and the typical range for the acceleration error component is -10000 degrees / second² to 10000 degrees / second².

[0061] The subsequent motion control command sequence of the second communication protocol includes all motion control commands from 210 milliseconds after the switching completion time. Assume the subsequent motion control command sequence contains 5 commands with timestamps of 220 milliseconds, 230 milliseconds, 240 milliseconds, 250 milliseconds, and 260 milliseconds, corresponding to target positions of 95 degrees, 100 degrees, 105 degrees, 110 degrees, and 115 degrees, respectively. The target speed for each command is 100 degrees / second, and the target acceleration is 5000 degrees / second². For the motion control command with a timestamp of 220 milliseconds, the time interval = command timestamp - switching completion time = 220 milliseconds - 210 milliseconds = 10 milliseconds. The attenuation coefficient is calculated using an exponential decay function: attenuation coefficient = e^(-time interval ÷ attenuation time constant). The attenuation time constant is set to 30 milliseconds. This value is determined based on the sum of the mechanical and electrical time constants of the low-voltage integrated servo motor and is applicable to motors with a rotational inertia in the range of 0.00005 kg·m² to 0.0005 kg·m². The attenuation coefficient at a time interval of 10 milliseconds = e^(-10 milliseconds ÷ 30 milliseconds) = e^(-0.333) ≈ 0.717. Position deviation correction = Position deviation component × Attenuation coefficient = -0.25025 degrees × 0.717 = -0.179 degrees. Velocity deviation correction = Velocity deviation component × Attenuation coefficient = -0.15 degrees / second × 0.717 = -0.108 degrees / second. Acceleration deviation correction = Acceleration deviation component × Attenuation coefficient = -5000 degrees / second² × 0.717 = -3585 degrees / second². Corrected target position = Original target position + Position deviation correction = 95 degrees + (-0.179 degrees) = 94.821 degrees. Corrected target velocity = Original target velocity + Velocity deviation correction = 100 degrees / second + (-0.108 degrees / second) = 99.892 degrees / second. The corrected target acceleration = original target acceleration + acceleration deviation correction = 5000 degrees / second² + (-3585 degrees / second²) = 1415 degrees / second². The corrected motion control command with a timestamp of 220 milliseconds includes a target position of 94.821 degrees, a target velocity of 99.892 degrees / second, and a target acceleration of 1415 degrees / second².

[0062] For a motion control command with a timestamp of 230 milliseconds, the time interval = 230 milliseconds - 210 milliseconds = 20 milliseconds, and the attenuation coefficient = e^(-20 milliseconds ÷ 30 milliseconds) ≈ 0.513. Position deviation correction = -0.25025 degrees × 0.513 = -0.128 degrees. Velocity deviation correction = -0.15 degrees / second × 0.513 = -0.077 degrees / second. Acceleration deviation correction = -5000 degrees / second² × 0.513 = -2565 degrees / second². The corrected target position = 100 degrees + (-0.128 degrees) = 99.872 degrees. The corrected target velocity = 100 degrees / second + (-0.077 degrees / second) = 99.923 degrees / second. The corrected target acceleration = 5000 degrees / second² + (-2565 degrees / second²) = 2435 degrees / second². Motion control commands with timestamps of 240 ms, 250 ms, and 260 ms were calculated sequentially, with attenuation coefficients of 0.368, 0.264, and 0.189, respectively. The corrected target positions were 104.908 degrees, 109.934 degrees, and 114.953 degrees, respectively; the corrected target velocities were 99.945 degrees / second, 99.960 degrees / second, and 99.972 degrees / second, respectively; and the corrected target accelerations were 1840 degrees / second², 1320 degrees / second², and 945 degrees / second², respectively. The corrected motion control command sequence was input into the second communication protocol control channel. The control channel calculated the control output based on the corrected target motion parameters, driving the low-voltage integrated servo motor to execute the corrected motion trajectory, thus gradually eliminating residual deviations. Unlike the convergence correction of state variables within the pre-alignment period, residual deviation compensation targets the motion trajectory execution stage after the switch is completed, eliminating the residual impact of state abrupt changes at the moment of switch through exponential decay superposition.

[0063] This invention achieves smooth correction of motion trajectory after protocol switching by decomposing residual deviation and compensating for exponential decay, eliminating the impact of sudden state changes at the moment of switching on subsequent motion accuracy, and ensuring the continuity and consistency of motion control of low-voltage integrated servo motor.

[0064] In one optional implementation, the step of decomposing the residual deviation into position deviation components, velocity deviation components, and acceleration deviation components based on kinematic relationships includes: extracting the predicted position, predicted velocity, and predicted acceleration in the predicted state at the time of switching completion, and the actual position, actual velocity, and actual acceleration in the state after switching; calculating the difference between the actual position and the predicted position to obtain an initial value of position deviation, calculating the difference between the actual velocity and the predicted velocity to obtain an initial value of velocity deviation, and calculating the difference between the actual acceleration and the predicted acceleration to obtain an initial value of acceleration deviation; and decoupling the initial values ​​of position deviation, velocity deviation, and acceleration deviation based on the asynchronous characteristics of sensor sampling delay and control cycle, eliminating the coupling influence of higher-order state variables on the measured values ​​of lower-order state variables, and obtaining the decoupled position deviation components, velocity deviation components, and acceleration deviation components.

[0065] For example, the predicted state is calculated using kinematic relationships at the start of the target switching window, 210 milliseconds in advance. This includes a predicted position of 89.5 degrees, a predicted velocity of 99.8 degrees / second, and a predicted acceleration of 5500 degrees / second². The predicted state is stored in the controller's state register, with register addresses from 0x5000 to 0x5018, using the IEEE 754 double-precision floating-point format. Each state variable occupies 8 bytes. The predicted position is a double-precision floating-point number with a range of -360 degrees to 360 degrees and a precision of 0.001 degrees. The predicted velocity is a double-precision floating-point number with a range of -3000 degrees / second to 3000 degrees / second and a precision of 0.01 degrees / second. The predicted acceleration is a double-precision floating-point number with a range of -100000 degrees / second² to 100000 degrees / second² and a precision of 1 degree / second². The post-switching state is acquired by an absolute encoder and a speed sensor at the moment of switching completion. After sampling delay compensation, it includes the actual position of 89.24975 degrees, the actual speed of 99.65 degrees / second, and the actual acceleration of 500 degrees / second². The post-switching state is stored in the controller's measurement buffer, with buffer addresses from 0x5100 to 0x5118. The data format and accuracy requirements are the same as those for the predicted state.

[0066] The initial value of position deviation is calculated based on the difference between the actual position and the predicted position. Initial position deviation = Actual position - Predicted position = 89.24975 degrees - 89.5 degrees = -0.25025 degrees. This value reflects the degree of deviation of the actual position from the predicted position at the time of handover completion; a negative value indicates that the actual position lags behind the predicted position. The initial value of position deviation typically ranges from -2 degrees to 2 degrees. Values ​​exceeding this range indicate a large error in the predicted state calculation or a sensor malfunction, triggering an anomaly handling process. The initial value of velocity deviation is calculated based on the difference between the actual velocity and the predicted velocity. Initial velocity deviation = Actual velocity - Predicted velocity = 99.65 degrees / second - 99.8 degrees / second = -0.15 degrees / second. This value reflects the degree of deviation of the actual velocity from the predicted velocity at the time of handover completion; a negative value indicates that the actual velocity is lower than the predicted velocity. The initial value of velocity deviation typically ranges from -10 degrees / second to 10 degrees / second; values ​​exceeding this range trigger velocity anomaly protection. The initial value of acceleration deviation is calculated based on the difference between the actual acceleration and the predicted acceleration. Initial acceleration deviation = Actual acceleration - Predicted acceleration = 500° / s² - 5500° / s² = -5000° / s². This value reflects the degree of deviation between the actual acceleration and the predicted acceleration at the moment of switching completion. A negative value indicates that the actual acceleration is significantly lower than the predicted acceleration. The initial acceleration deviation value is usually between -20000° / s² and 20000° / s². Exceeding this range triggers acceleration limit protection.

[0067] The asynchronous characteristics of sensor sampling delay and control cycle cause higher-order state variables to couple with the measured values ​​of lower-order state variables. The encoder sampling delay is 0.5 milliseconds. During this delay, the motor continues to move, and the actual position measurement includes additional displacement caused by velocity and acceleration. Additional displacement caused by velocity = actual velocity × encoder sampling delay = 99.65 degrees / second × 0.5 milliseconds = 0.049825 degrees. Additional displacement caused by acceleration = 0.5 × actual acceleration × encoder sampling delay² = 0.5 × 500 degrees / second² × (0.5 milliseconds)² = 0.0000625 degrees. The total coupling error of the position measurement = additional displacement caused by velocity + additional displacement caused by acceleration = 0.049825 degrees + 0.0000625 degrees = 0.0498875 degrees. Decoupling is achieved by subtracting the coupling error from the initial position deviation value. The decoupled position deviation component = initial position deviation - total coupling error of position measurement = -0.25025 degrees - 0.0498875 degrees = -0.3001375 degrees. The velocity sensor sampling delay is 0.3 milliseconds. During this delay, acceleration changes cause the velocity measurement to include an additional velocity component. The additional velocity caused by acceleration = actual acceleration × velocity sensor sampling delay = 500 degrees / second² × 0.3 milliseconds = 0.15 degrees / second. The coupling error of the velocity measurement is equal to the additional velocity caused by acceleration. The decoupled velocity deviation component = initial velocity deviation - coupling error of velocity measurement = -0.15 degrees / second - 0.15 degrees / second = -0.3 degrees / second.

[0068] The asynchronous control cycle characteristic stems from the difference between the control cycle of the first communication protocol (1 millisecond) and the control cycle of the second communication protocol (0.5 milliseconds). The switching completion time of 210 milliseconds corresponds to the end of the 210th control cycle of the first communication protocol and the start of the 420th control cycle of the second communication protocol; the phase difference between the two control cycles is 0 milliseconds. If the switching completion time is 210.5 milliseconds, it corresponds to the midpoint of the 210th control cycle of the first communication protocol and the start of the 421st control cycle of the second communication protocol; the phase difference between the two control cycles is 0.5 milliseconds. This phase difference causes a time offset between the calculation time of the predicted state and the sampling time of the state after the switch, introducing additional coupling error in the acceleration measurement. Assuming a phase difference of 0.5 milliseconds, the change in the acceleration measurement during this time period = the rate of change of acceleration × the phase difference. The rate of change of acceleration is obtained through acceleration differential estimation: Rate of change of acceleration = (Current acceleration - Previous cycle acceleration) ÷ Control cycle = (500 degrees / second² - 400 degrees / second²) ÷ 0.5 milliseconds = 200 degrees / second³. The acceleration coupling error caused by the phase difference = Rate of change of acceleration × Phase difference = 200 degrees / second³ × 0.5 milliseconds = 100 degrees / second². The decoupled acceleration deviation component = Initial acceleration deviation - Acceleration coupling error caused by the phase difference = -5000 degrees / second² - 100 degrees / second² = -5100 degrees / second². When the phase difference is 0 milliseconds at the 210 milliseconds after the switching completion time, the acceleration coupling error caused by the phase difference is 0 degrees / second², and the decoupled acceleration deviation component = -5000 degrees / second² - 0 degrees / second² = -5000 degrees / second².

[0069] The iterative correction strategy for decoupling is used to address the circular dependency problem in the calculation of coupling error. Decoupling the position deviation component requires the values ​​of actual velocity and actual acceleration, which are themselves affected by coupling. The iterative correction employs three iterations, with each iteration using the decoupled velocity and acceleration obtained from the previous iteration to recalculate the position coupling error. The first iteration uses the initial measurements: position coupling error = 99.65 degrees / second × 0.5 milliseconds + 0.5 × 500 degrees / second² × (0.5 milliseconds)² = 0.0498875 degrees; the decoupled position deviation component = -0.25025 degrees - 0.0498875 degrees = -0.3001375 degrees. The second iteration uses the decoupled velocity (-0.3 degrees / second) and decoupled acceleration (-5000 degrees / second²) obtained from the first iteration. The position coupling error is calculated as -0.3 degrees / second × 0.5 milliseconds + 0.5 × (-5000 degrees / second²) × (0.5 milliseconds)² = -0.00015 degrees - 0.000625 degrees = -0.000775 degrees. The decoupled position deviation component is calculated as -0.25025 degrees - (-0.000775 degrees) = -0.249475 degrees. The third iteration uses the results of the second iteration. The position coupling error calculation converges, and the decoupled position deviation component stabilizes at -0.249 degrees. The iteration termination condition is set when the absolute value of the difference between two adjacent iteration results is less than 0.001 degrees, or when the number of iterations reaches 3. The final decoupled position deviation component is -0.249 degrees, velocity deviation component is -0.3 degrees / second, and acceleration deviation component is -5000 degrees / second².

[0070] This invention eliminates the coupling effect of higher-order state variables on lower-order state variables by compensating for sensor sampling delay and correcting the phase difference of the control cycle, thereby obtaining accurate position, velocity and acceleration deviation components and providing reliable input data for subsequent residual deviation compensation.

[0071] A second aspect of this invention provides a low-voltage integrated servo motor switching control system based on dual communication protocols, comprising: an instruction acquisition module for acquiring a motion control instruction sequence and a communication protocol switching request signal of a low-voltage integrated servo motor, wherein the low-voltage integrated servo motor supports a first communication protocol and a second communication protocol; an instruction mapping module for establishing an instruction set mapping table for the first communication protocol and the second communication protocol, converting missing instruction semantic types between the two protocols into equivalent instruction combinations through kinematic relationships to obtain a unified instruction set representation; a window identification module for identifying a set of switchable time windows based on the motion control instruction sequence; a pre-alignment and switching module for, upon receiving the communication protocol switching request signal, inputting the unified instruction set representation into the dual protocol control channel simultaneously before reaching the target switching window, applying the control output of the first communication protocol to the low-voltage integrated servo motor, injecting the deviation between the control output of the second communication protocol and the actual state into the second communication protocol control channel to achieve pre-alignment, calculating a predicted state based on kinematic relationships within the target switching window as the switching starting point to execute protocol switching; and a deviation compensation module for superimposing the deviation between the actual state after switching and the predicted state into subsequent motion control instructions of the second communication protocol.

[0072] A third aspect of the present invention provides an electronic device, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the aforementioned method.

[0073] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0074] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0075] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A low-voltage integrated servo motor switching control method based on dual communication protocols, characterized in that, include: The process involves acquiring a motion control command sequence and a communication protocol switching request signal for a low-voltage integrated servo motor, which supports a first communication protocol and a second communication protocol. A mapping table is established between the first and second communication protocols, and missing instruction semantic types between the two protocols are converted into equivalent instruction combinations using kinematic relationships to obtain a unified instruction set representation. A set of switchable time windows is identified based on the motion control command sequence. Upon receiving the communication protocol switching request signal, before reaching the target switching window, the unified instruction set representation is simultaneously input into the dual-protocol control channel. The control output of the first communication protocol is applied to the low-voltage integrated servo motor, and the deviation between the control output of the second communication protocol and the actual state is injected into the second communication protocol control channel for pre-alignment. Within the target switching window, a predicted state is calculated based on kinematic relationships as the switching starting point for protocol switching. The deviation between the actual state after switching and the predicted state is superimposed onto subsequent motion control commands of the second communication protocol.

2. The method according to claim 1, characterized in that, The steps of establishing an instruction set mapping table for the first and second communication protocols, and converting missing instruction semantic types between the two protocols into equivalent instruction combinations through kinematic relationships to obtain a unified instruction set representation, include: traversing the native instruction types supported by the first and second communication protocols, classifying them according to the control dimension into position control instructions, speed control instructions, and torque control instructions; identifying common instruction semantics supported by both protocols, the first missing instruction semantics unique to the first communication protocol, and the second missing instruction semantics unique to the second communication protocol, and recording them in the instruction set mapping table; establishing kinematic relationships based on the rotational inertia parameters, damping coefficients, and transmission ratio parameters of the low-voltage integrated servo motor; substituting the first missing instruction semantics into the kinematic relationships to solve for the equivalent control sequence represented by the common instruction semantic combination of the second communication protocol, and recording the corresponding relationship in the instruction set mapping table; processing the second missing instruction semantics in the same way and recording it in the instruction set mapping table; and converting the motion control instruction sequence into a unified instruction set representation based on the instruction set mapping table.

3. The method according to claim 1, characterized in that, The steps for identifying a set of switchable time windows based on the motion control command sequence include: interpolating the target position sequence in the motion control command sequence to generate a set of discrete trajectory points containing motion state parameters; for each discrete trajectory point in the set of discrete trajectory points, calculating the theoretical control output of the first communication protocol and the second communication protocol based on the unified instruction set representation, and defining the difference between the two as the protocol response deviation; marking a protocol compatible interval when the protocol response deviation of multiple consecutive discrete trajectory points is lower than the protocol response deviation threshold; calculating the change in motion state between adjacent discrete trajectory points, and marking a motion stable interval when the change in motion state of multiple consecutive discrete trajectory points is lower than the threshold; identifying time periods that simultaneously belong to the protocol compatible interval and the motion stable interval as candidate switching windows; calculating the window switching cost based on the weighted sum of the protocol response deviation and the change in motion state; and selecting candidate switching windows whose window switching cost is lower than the cost threshold to form a set of switchable time windows.

4. The method according to claim 1, characterized in that, The steps of simultaneously inputting the unified instruction set representation into the dual-protocol control channel, applying the control output of the first communication protocol to the low-voltage integrated servo motor, and injecting the deviation between the control output of the second communication protocol and the actual state into the second communication protocol control channel to achieve pre-alignment, and performing protocol switching based on the predicted state calculated according to the kinematic relationship within the target switching window as the switching starting point, include: after receiving the communication protocol switching request signal, obtaining the switchable time window closest to the current time from the set of switchable time windows as the target switching window; within the pre-alignment period between the current time and the starting time of the target switching window, simultaneously parsing the unified instruction set representation into the first control instruction sequence of the first communication protocol and the second control instruction sequence of the second communication protocol. A control command sequence is used to apply the control output of the first control command sequence to the low-voltage integrated servo motor drive motor. The actual motion state of the low-voltage integrated servo motor is collected in real time, and the state deviation between the control output of the second control command sequence and the actual motion state is calculated. The state deviation is injected as a correction amount into the internal state variable of the second communication protocol control channel, so that the internal state variable converges to an aligned state consistent with the actual motion state. At the beginning of the target switching window, a predicted state is calculated based on the kinematic relationship according to the aligned state as the switching start point. The control output of the first communication protocol control channel is stopped, and the control output of the second communication protocol control channel is applied to the low-voltage integrated servo motor to complete the protocol switching.

5. The method according to claim 4, characterized in that, The step of injecting the state deviation as a correction into the internal state variables of the second communication protocol control channel, so that the internal state variables converge to an aligned state consistent with the actual motion state, includes: identifying the internal state variables of the second communication protocol control channel, the internal state variables including a position error integral term, a velocity feedforward state, and an observer state; in each control cycle of the pre-alignment period, integrating the position deviation component of the state deviation and taking the negative value, then adding it to the position error integral term; multiplying the velocity deviation component of the state deviation by the velocity feedforward gain coefficient and taking the negative value, then adding it to the velocity feedforward state; constructing an observer correction vector based on the position deviation component and the velocity deviation component; setting the observer gain coefficient according to the desired convergence speed; multiplying the observer correction vector by the observer gain coefficient and then injecting it into the observer state; when the number of cycles in which the consistency index between the internal state variables and the actual motion state continuously meets the convergence condition reaches a preset value, confirming that the internal state variables have converged to the aligned state.

6. The method according to claim 1, characterized in that, The step of superimposing the deviation between the actual state after switching and the predicted state into the subsequent motion control commands of the second communication protocol includes: after completing the protocol switch, acquiring the state of the low-voltage integrated servo motor at the moment of switch completion; calculating the difference between the state after switching and the predicted state to obtain the residual deviation; decomposing the residual deviation into position deviation components, velocity deviation components, and acceleration deviation components based on kinematic relationships; for each motion control command in the subsequent motion control command sequence of the second communication protocol, calculating an attenuation coefficient based on the time interval between the motion control command and the moment of switch completion, multiplying the position deviation components, velocity deviation components, and acceleration deviation components by the attenuation coefficient respectively, and superimposing them into the target motion parameters of the motion control command to obtain the corrected motion control command; inputting the corrected motion control command into the control channel of the second communication protocol to drive the low-voltage integrated servo motor to execute the corrected motion trajectory.

7. The method according to claim 6, characterized in that, The steps of decomposing the residual deviation into position deviation, velocity deviation, and acceleration deviation components based on kinematic relationships include: extracting the predicted position, predicted velocity, and predicted acceleration in the predicted state at the time of switching completion, and the actual position, actual velocity, and actual acceleration in the state after switching; calculating the difference between the actual position and the predicted position to obtain the initial value of position deviation, calculating the difference between the actual velocity and the predicted velocity to obtain the initial value of velocity deviation, and calculating the difference between the actual acceleration and the predicted acceleration to obtain the initial value of acceleration deviation; and decoupling the initial values ​​of position deviation, velocity deviation, and acceleration deviation based on the asynchronous characteristics of sensor sampling delay and control cycle to obtain the decoupled position deviation, velocity deviation, and acceleration deviation components.

8. A low-voltage integrated servo motor switching control system based on dual communication protocols, used to implement the method of any one of claims 1-7, characterized in that, include: The instruction acquisition module is used to acquire the motion control instruction sequence and communication protocol switching request signal of the low-voltage integrated servo motor, wherein the low-voltage integrated servo motor supports a first communication protocol and a second communication protocol. The instruction mapping module is used to establish an instruction set mapping table between the first communication protocol and the second communication protocol, and to convert the missing instruction semantic types between the two protocols into equivalent instruction combinations through kinematic relations to obtain a unified instruction set representation; the window recognition module is used to identify a set of switchable time windows based on the motion control instruction sequence. The pre-alignment and switching module is used to, after receiving the communication protocol switching request signal, input the unified instruction set representation into the dual protocol control channel simultaneously before reaching the target switching window, apply the control output of the first communication protocol to the low-voltage integrated servo motor, inject the deviation between the control output of the second communication protocol and the actual state into the second communication protocol control channel to achieve pre-alignment, and calculate the predicted state based on the kinematic relationship within the target switching window as the switching starting point to execute the protocol switching. The deviation compensation module is used to superimpose the deviation between the actual state after switching and the predicted state into the subsequent motion control commands of the second communication protocol.

9. An electronic device, characterized in that, include: processor; A memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to perform the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.