Motion control method and system for autonomous mobile device, autonomous mobile device, and medium
Patent Information
- Application Number
- PCT/CN2025/103373
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-04-14
- Filing Date
- 2025-06-25
- Publication Date
- 2026-10-22
Smart Images

Figure CN2025103373_22102026_PF_FP_ABST
Abstract
Description
Motion control methods, systems, self-moving devices, and media for self-moving devices.
[0001] This application claims priority to Chinese Patent Application No. 202510458972.3, filed on April 14, 2025, entitled "Motion Control Method, System, Self-Moving Equipment and Medium for Self-Moving Equipment", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to self-moving devices and their motion control methods and systems, specifically to a motion control method, system, self-moving device, and medium applicable to a self-moving device with a dual-wheel independent drive structure. Background Technology
[0003] With the popularization of artificial intelligence and robotics, self-moving devices with automatic navigation and obstacle avoidance capabilities are widely used in scenarios such as home gardening, security patrols, and industrial logistics. Among them, the dual-wheel independent drive structure has become the mainstream configuration due to its simple structure and low manufacturing cost. However, when these devices operate in complex environments, they face core challenges such as drastic load changes, strong motor protection requirements, and high motion stability requirements, necessitating more refined control strategies.
[0004] First, most current dual-wheel independent drive control systems lack real-time limiting and protection mechanisms for motor operation. When one motor continuously exceeds its output due to a sudden surge in load, power limiting adjustment is not triggered in time, leading to severe motor overheating and shortened lifespan. Second, when one motor reaches its power limit, existing dual-wheel independent drive control systems often cannot coordinate the other motor to compensate for its posture, resulting in abnormal equipment movement, such as deviation and instability. Finally, acceleration and deceleration processes generally use static acceleration curves or linear control, ignoring factors such as overall machine mass, wheel friction, and gradient changes, which can easily lead to sudden shaking or slippage, reducing the operational stability and safety of self-moving equipment. Technical issues
[0005] The purpose of this application is to address the core challenges faced by self-moving devices with dual-wheel independent drive structures when operating in complex environments, such as drastic load changes, strong motor protection requirements, and high motion stability requirements, and to provide a motion control method, system, self-moving device, and medium for such devices. Technical solutions
[0006] To address the shortcomings of the existing technology, this application provides the following technical solution:
[0007] A motion control method for a self-moving device, wherein the self-moving device adopts a dual-wheel independent drive structure, is characterized by comprising the following steps:
[0008] Convert the expected linear velocity and expected angular velocity of the whole machine into the expected rotational speeds on both sides;
[0009] For each motor, the desired speed is smoothed by constant acceleration to obtain the desired speed per unit time. Then, the desired current is calculated based on the error between the desired speed per unit time and the current speed. Finally, the desired duty cycle is calculated based on the error between the desired current and the current current. The unit time is the cycle length for updating the motor speed.
[0010] When the current duty cycle and current of the two motors are greater than or equal to the corresponding rated values, the desired speed of the other motor per unit time is dynamically adjusted based on one motor to achieve synchronization of the two motors.
[0011] The final outputs the desired speed and desired duty cycle of the two motors per unit time, which are used to control the corresponding motors to complete the motion control of this control cycle.
[0012] Meanwhile, this application also provides a motion control system for a self-moving device, comprising two control groups, each control group including a motor and a motor controller, characterized in that:
[0013] Each of the control groups controls the motor to implement the steps of the motion control method for the self-moving device described above.
[0014] This application also provides a self-moving device, which is characterized in that it includes a whole machine controller and a motion control system for the self-moving device, wherein the whole machine controller is communicatively connected to the motor controllers of two control groups in the motion control system of the self-moving device.
[0015] This application also provides a computer-readable storage medium storing a computer program, characterized in that:
[0016] When the computer program is executed by the processor, it implements the steps of the motion control method for the self-moving device described above. Beneficial effects
[0017] (1) This application provides a motion control method for a self-moving device. By monitoring the current speed and current of the motors on both sides in real time, the speed of the motors on both sides is dynamically adjusted, the maximum output power is limited, and constant acceleration smoothing is used to calculate the expected speed per unit time to ensure smooth speed change. In addition, when the power of a single motor is limited, the speed ratio adjustment strategy is used to dynamically coordinate the speed of the motors on both sides to maintain the motion posture. This application achieves three control objectives: protecting the motor, maintaining the overall machine's operating posture when a single motor reaches its rated power, and smooth acceleration and deceleration of the whole machine.
[0018] (2) In this application, by updating the desired speed to the desired speed per unit time output in the previous control cycle, the continuity and stability of the control command are ensured, and speed jumps caused by control cycle switching are effectively prevented, thereby further improving the stability and tracking performance of the self-moving device.
[0019] (3) This application introduces dynamic Jerk adjustment into the T-shaped acceleration and deceleration curve to make the acceleration change gradually, thereby greatly reducing the sudden phenomenon in motion control and making the acceleration and deceleration process smoother and more natural; and Jerk is dynamically adjusted according to the current current of the motor on this side, so that the system can adaptively adjust the acceleration and deceleration intensity according to the actual load of the motor, which improves the flexibility and safety of the control system and protects the motor from overload damage.
[0020] (4) This application introduces an integral limit value in the speed loop PID to prevent the integral term from overshooting after long-term error accumulation, which would cause the control system to overshoot or oscillate. It also introduces a proportional gain adjustment factor and an integral gain adjustment factor. When the error is large, the proportional gain is dynamically increased to shorten the adjustment time. When the speed changes drastically, the derivative gain is reduced to prevent instability caused by noise amplification. In addition, the anti-impact coefficient is used to alleviate control jitter and mechanical shock during speed change or acceleration / deceleration switching. The preset power limit is used to limit the expected current to prevent the motor power from exceeding the limit, thereby achieving efficient and stable motion control in complex motion environments.
[0021] (5) This application introduces proportional gain adjustment factor and integral gain adjustment factor in the current loop PID to accelerate error convergence and improve response speed, and introduces differential gain adjustment factor and anti-impact coefficient to suppress noise and current impact and maintain stable control; adopts integral limit value to prevent excessive accumulation of integral term and reduce integral saturation phenomenon; after calculating the desired current and desired duty cycle, power limiting is performed to avoid the motor power from exceeding the rated value, thereby achieving a good balance in dynamic response, stability, noise suppression and motor protection, and is suitable for a variety of complex motion control tasks.
[0022] (6) When the current duty cycle and current current of both motors reach or exceed the rated value, this application dynamically adjusts the other motor based on the motor with the smaller ratio of the expected speed per unit time to the current speed, so as to protect the motor and maintain the movement posture of the self-moving device. Even if the power of a single motor is limited, the self-moving device can still maintain normal straight-line driving or turning movement. In addition, this application adopts multi-layer control logic, first judging the current duty cycle, and then judging the current current in order to respond quickly and protect in advance, avoiding the control lag caused by current detection delay, and taking into account both real-time performance and protection. Attached Figure Description
[0023] Figure 1 is a flowchart of step 2 in one embodiment of a motion control method for a self-moving device according to this application;
[0024] Figure 2 is a flowchart of step 2.3.2 in one embodiment of this application;
[0025] Figure 3 is a flowchart of step 3 in one embodiment of this application. Embodiments of the present invention
[0026] The present application will be further described below with reference to the accompanying drawings and exemplary embodiments.
[0027] A motion control method for a self-moving device, the self-moving device adopting a dual-wheel independent drive structure, includes the following steps:
[0028] Step 1: Convert the desired linear velocity and desired angular velocity of the whole machine into desired rotational speeds on both sides;
[0029] It should be noted that the aforementioned self-moving device conforms to the definition of "robot" in GB / T 39405-2020, and can be a personal / household service robot depending on the application field; the dual-wheel independent drive structure means that the two drive wheels are driven and controlled by independent motors respectively; the aforementioned expected linear velocity and expected angular velocity of the whole machine refer to the expected moving speed of the self-moving device in the straight line and the expected rotational speed of the self-moving device, respectively.
[0030] Step 2: For each motor, the desired speed per unit time is calculated by smoothing the desired speed with constant acceleration. Then, the desired current is calculated based on the error between the desired speed per unit time and the current speed. Finally, the desired duty cycle is calculated based on the error between the desired current and the current current.
[0031] It should be noted that the above-mentioned smoothing of the desired rotational speed by constant acceleration refers to discretizing the desired rotational speed over time by setting a preset acceleration limit value to generate a velocity trajectory that conforms to the constant acceleration constraint. This embodiment uses a T-shaped acceleration / deceleration curve to smooth the rotational speed change, but an S-shaped curve can also be used in other embodiments.
[0032] The aforementioned unit time refers to the cycle length of the motor speed update; the current speed can be measured in real time by a sensor (such as an encoder); the desired current is the current required to achieve the desired speed per unit time; calculating the desired current based on the error between the desired speed per unit time and the current speed means adjusting the error using PID or other control algorithms, thereby adjusting the current speed to achieve the desired speed per unit time; calculating the desired duty cycle based on the error between the desired current and the current current means adjusting the error using PID or other control algorithms, thereby adjusting the current current to achieve the desired current; in order to control each motor in the dual-wheel independent drive structure, this embodiment adopts a PID-based dual-loop control, that is, firstly, the speed loop PID is used to calculate the desired current based on the error between the desired speed per unit time and the current speed, and then the current loop PID is used to calculate the desired duty cycle based on the error between the desired current and the current current; in other embodiments, sliding mode variable structure control or fuzzy PID control, etc., can also be used;
[0033] Step 3: When the current duty cycle and current current of the two motors are greater than or equal to the corresponding rated values, take one motor as the reference and dynamically adjust the desired speed of the other motor per unit time to achieve synchronization of the two motors.
[0034] The above-mentioned method of dynamically adjusting the expected speed of the other motor per unit time based on one side of the motor to achieve synchronization of the two motors refers to adjusting the expected speed of the other motor per unit time based on the speed ratio of one side of the motor, where the speed ratio is the ratio of the current speed to the expected speed per unit time. Specifically, this can be done by adjusting in stages based on the difference in the speed ratios of the two sides, adjusting by a fixed increment each time, or by updating the expected speed of the other motor per unit time to the expected speed of the other motor per unit time multiplied by the speed ratio of one side of the motor.
[0035] Step 4: Output the desired speed and desired duty cycle of the motors on both sides per unit time, which are used to control the corresponding motors to complete the motion control of this control cycle.
[0036] In some embodiments, step 1 above includes: obtaining the expected linear velocity and the expected angular velocity of the whole machine, and converting them into the expected rotational speeds on both sides based on the wheel track and wheel radius;
[0037] The desired rotational speeds on both sides can be expressed as: ;in, The desired rotational speed on one side, The desired linear velocity of the entire machine. The desired angular velocity of the entire machine. The wheelbase is the distance between the wheels. The radius is the wheel radius.
[0038] In some embodiments, referring to FIG1, step 2 above includes:
[0039] Step 2.1: For each motor, determine if there is a previous control cycle. If so, update the desired speed to the desired speed per unit time output in the previous control cycle, and then execute step 2.2; otherwise, directly execute step 2.2.
[0040] Step 2.2: For each motor, smooth the desired speed using a T-shaped acceleration / deceleration curve to obtain the desired speed per unit time;
[0041] Step 2.3: For each motor, collect the current speed and use a speed loop PID to calculate the expected current based on the error between the expected speed per unit time and the current speed;
[0042] Step 2.4: For each motor, collect the current current and use a current loop PID to calculate the desired duty cycle based on the error between the desired current and the current current.
[0043] In some embodiments, step 2.2 above includes:
[0044] Step 2.2.1: For each motor, compare the speed difference between the current speed and the expected speed per unit time with the corresponding threshold to determine the stage of entering the T-shaped acceleration / deceleration curve. Then, update the acceleration using jerk (rate of change of acceleration, i.e., jerk). The jerk mentioned above is a fixed value, or it can be dynamically adjusted according to the current current of the motor on that side to protect the motor in real time and achieve smooth speed changes. Specifically:
[0045] If the absolute value of the speed difference does not exceed the corresponding threshold, then the system enters a constant speed state and the acceleration is set to 0.
[0046] If the speed difference is greater than the corresponding threshold, the acceleration state is entered, the acceleration is updated to the current acceleration plus the jerk of the current control cycle, and compared with the maximum acceleration, and the smaller value is taken as the acceleration.
[0047] If the speed difference is less than the negative value of the corresponding threshold, the system enters a deceleration state. The acceleration is updated to the current acceleration minus the jerk value of the current control cycle, and compared with the negative value of the maximum acceleration; the larger value is taken as the acceleration. This can be expressed as:
[0048] like Then it enters a state of uniform velocity, let =0;
[0049] like Then it enters an acceleration state, making ;
[0050] like Then it enters a deceleration state, making ;
[0051] in, This is the speed difference. The threshold value for the speed difference can be dynamically set according to the system control accuracy (such as encoder resolution); These are acceleration and current acceleration, respectively. This is the maximum linear acceleration; For this control cycle, jerk The duration of the update cycle for speed;
[0052] Step 2.2.2: For each motor, using the current speed, acceleration, jerk, and speed update cycle time, calculate the theoretical speed at the next moment. The speed at the next moment is obtained by weighted summing the theoretical speed at the next moment and the current speed, as follows:
[0053] ;
[0054] ;
[0055] Where ξ is a smoothing factor, with a value of 0 to 1. When the speed error is large, ξ tends to 1, indicating that the system responds quickly. When the speed error is small, ξ tends to 0, indicating that the system adjusts smoothly and reduces drastic changes. γ is an adjustment coefficient used to control the response sensitivity to changes in speed error.
[0056] The rotational speed at the next moment is taken as the expected rotational speed per unit time.
[0057] This embodiment integrates the theoretical rotational speed at the next moment with the current rotational speed, and achieves a smooth transition through weighting coefficients, thus avoiding the overshoot problem that may be caused by traditional error integration.
[0058] In other embodiments, step 2.2.2 may also be adopted as follows:
[0059] The rotational speed at the next moment is calculated using acceleration, current rotational speed, and the speed update cycle duration, as follows:
[0060] ;
[0061] in, These are the engine speed at the next moment and the current engine speed, respectively.
[0062] The rotational speed at the next moment is taken as the expected rotational speed per unit time.
[0063] In some embodiments, step 2.2.1, where the jerk is dynamically adjusted based on the current current of the motor on that side, includes: ;
[0064] ;
[0065] in, These are jerks for the acceleration and deceleration phases, respectively. The minimum jerk resolution is not less than the jerk resolution. The theoretical jerks are for the acceleration phase and the deceleration phase, respectively. This represents the current current of the motor on that side. This is the maximum current, determined based on the actual limits of different motors or drives. To suppress the proportionality factor, the value is taken from 0 to 1, and the larger the value, the more sensitive the response.
[0066] This application directly links the current parameter to the jerk adjustment, achieves proportional suppression by suppressing the scaling factor, avoids overshoot or response delay caused by traditional fixed thresholds, and sets a minimum jerk to prevent jerk oscillation caused by current fluctuations, thereby enhancing system stability.
[0067] In some embodiments, step 2.3 above includes:
[0068] Step 2.3.1: Collect the current speed of each motor.
[0069] Step 2.3.2: For each motor, use a speed loop PID to calculate the expected current based on the error between the expected speed per unit time and the current speed;
[0070] Specifically, referring to Figure 2, an integral limit value is introduced into the speed loop PID to limit the integral term. The proportional gain and derivative gain are dynamically adjusted according to the magnitude and rate of change of the error between the expected speed and the current speed per unit time. The derivative gain is further adjusted according to the direction of acceleration. Finally, the error between the expected speed and the current speed per unit time is substituted into the speed loop PID to output the expected current.
[0071] Specifically, the desired current mentioned above can be expressed as: ;
[0072] ;
[0073] in, For the desired current, These are the proportional gain, integral gain, and derivative gain of the speed loop PID controller. This represents the difference between the expected rotational speed and the current rotational speed per unit time. This is the proportional gain adjustment factor for the speed loop PID controller, used to increase the proportional gain and improve the response speed when the error is large; This is the differential gain adjustment factor for the speed loop PID controller, used to reduce the differential gain and suppress noise interference when the error rate of change is large. This is the impact resistance coefficient of the speed loop PID, with a value ranging from 0.2 to 0.5; The symbols represent trends, with positive and negative indicating acceleration or deceleration, respectively. This is the integral term of the speed loop PID controller. This is the integral limit value for the speed loop PID controller;
[0074] Step 2.3.3: For each motor, use the preset expected power to limit the expected current, and update the expected current to the limited expected current; it should be noted that the above-mentioned preset expected power refers to a power upper limit value set in advance in the motion control of the self-moving device in order to protect the motor and drive circuit;
[0075] Specifically, for each motor, the limiting current is calculated using the preset expected power, actual voltage, and redundancy protection factor, as follows:
[0076] ;in, To limit the current, This is the redundancy protection factor. , To preset the desired power, This is the actual voltage;
[0077] The desired current is limited by the current limiting function, and the desired current is updated to the limited desired current.
[0078] In some embodiments, step 2.4 above includes:
[0079] Step 2.4.1: Collect the current current for each motor.
[0080] Step 2.4.2: For each motor, introduce an integral limit value to limit the integral term in the current loop PID, and dynamically adjust the proportional gain, integral gain and derivative gain according to the magnitude and rate of change of the error between the desired current and the current current. Then, further adjust the derivative gain according to the direction of the current change. Finally, substitute the error between the desired current and the current current into the current loop PID to obtain the output of the current loop PID.
[0081] After limiting the output of the current loop PID using the maximum duty cycle, the desired duty cycle is output.
[0082] The expected duty cycle mentioned above can be expressed as: ;
[0083] ;
[0084] ;
[0085] in, The expected duty cycle; This is a limiting function, formatted as follows: ,if Exceeding If so, then return the boundary value; This is the output of the current loop PID controller. For maximum duty cycle, These are the proportional gain, integral gain, and derivative gain of the current loop PID controller. This is the difference between the desired current and the current current. These are the proportional gain adjustment factor and integral gain adjustment factor for the current loop PID, respectively, used to increase the proportional gain and integral gain when the error is large; This is the differential gain adjustment factor for the current loop PID controller, used to reduce the differential gain when the error rate of change is large; This is the impact resistance coefficient of the current loop PID controller, with a value between 0.2 and 0.5. It is a trend symbol used to determine the direction of a sudden change in current; This is the integral term of the current loop PID controller. This is the integral limit value for the current loop PID controller; The duration of the current update cycle.
[0086] In some embodiments, referring to FIG3, step 3 above includes:
[0087] Step 3.1: For both motors, determine whether the current duty cycle is ≥ the rated value;
[0088] If yes, proceed to step 3.2; otherwise, determine whether the current duty cycle is less than the rated value.
[0089] If yes, proceed to step 3.5; otherwise, determine whether the current duty cycle of the left motor is greater than or equal to the rated value.
[0090] If yes, proceed to step 3.3; otherwise, proceed to step 3.4.
[0091] Step 3.2, Determine if , , ,in These represent the current speed and the expected speed per unit time of the left motor, respectively. , These represent the current speed and the expected speed per unit time of the motor on the right, respectively.
[0092] If yes, proceed to step 3.3; otherwise, proceed to step 3.4.
[0093] Step 3.3, let Then proceed to step 4;
[0094] Step 3.4, let Then proceed to step 4;
[0095] Step 3.5: For both motors, determine whether the current current is greater than or equal to the rated value.
[0096] If yes, proceed to step 3.2; otherwise, determine whether the current current is less than the rated value.
[0097] If yes, proceed to step 4; otherwise, determine whether the current current of the left motor is greater than or equal to the rated value.
[0098] If yes, proceed to step 3.3; otherwise, proceed to step 3.4.
[0099] Step 3: By comparing the speed ratio of the two motors, find the side with the smaller deviation and use it to correct the other side to ensure motion symmetry and balance.
[0100] It employs multi-layer control logic, first determining the current duty cycle and then the current to ensure rapid response and early protection, avoiding control lag caused by current detection delay, thus balancing real-time performance and protection.
[0101] It should be noted that the rated value refers to the maximum permissible value of the equipment under normal and safe operating conditions.
[0102] The motion control system for a self-moving device provided in this application includes two control groups, each control group including a motor controller, a motor drive circuit, a motor, a current sampling unit, and a speed sampling unit;
[0103] The motor controller uses an MCU (Microcontroller Unit), which is interconnected with the motor drive circuit and the motor. The speed sampling unit uses an encoder to detect the position, speed and direction of the motor rotor in real time through mechanical coupling, and the output is connected to the interface of the motor controller. The current sampling unit uses a current sampling circuit, and its sampling method can be the shunt resistor method, the Hall sensor method, the current transformer method, or a combination of Hall sensor and amplifier, etc.
[0104] It should be noted that the motor controller can also use DSP (Digital Signal Processor) or FPGA (Field-Programmable Gate Array), etc.; the motor drive circuit can use H-bridge circuit or full-bridge drive chip, etc.
[0105] This application provides a self-moving device, including a motion control system and a whole machine controller. The motor controllers of the two control groups interact with the whole machine controller via a CAN bus to obtain the desired linear velocity and desired angular velocity of the whole machine.
[0106] This application provides a computer-readable storage medium storing a computer program. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium. The readable storage medium stores computer-readable instructions, which, when executed by one or more processors, cause one or more processors to implement the steps of the motion control method of the self-moving device described in the above embodiment.
[0107] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0108] Those skilled in the art will clearly understand that, in practical applications, the above functions can be assigned to different functional units or modules as needed, that is, the internal structure of the self-moving device can be divided into different functional units or modules to complete all or part of the functions described above.
[0109] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application 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 of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A motion control method for a self-moving device, wherein the self-moving device adopts a dual-wheel independent drive structure, wherein, Includes the following steps: Convert the expected linear velocity and expected angular velocity of the whole machine into the expected rotational speeds on both sides; For each motor, the desired speed is smoothed by constant acceleration to obtain the desired speed per unit time. Then, the desired current is calculated based on the error between the desired speed per unit time and the current speed. Finally, the desired duty cycle is calculated based on the error between the desired current and the current current. The unit time is the cycle length for updating the motor speed. When the current duty cycle and current of the two motors are greater than or equal to the corresponding rated values, the desired speed of the other motor per unit time is dynamically adjusted based on one motor to achieve synchronization of the two motors. The final outputs the desired speed and desired duty cycle of the two motors per unit time, which are used to control the corresponding motors to complete the motion control of this control cycle.
2. The motion control method for a self-moving device according to claim 1, wherein, The step of converting the expected linear velocity and expected angular velocity of the whole machine into the expected rotational speeds on both sides includes: obtaining the expected linear velocity and expected angular velocity of the whole machine, and converting them into the expected rotational speeds on both sides based on the wheel track and wheel radius.
3. The motion control method for a self-moving device according to claim 2, wherein, The desired rotational speeds on both sides are expressed as: ; in, The desired rotational speed on one side, The desired linear velocity of the entire machine. The desired angular velocity of the entire machine. The wheelbase is the distance between the wheels. The radius is the wheel radius.
4. The motion control method for a self-moving device according to claim 1, wherein, Before the step of smoothing the desired rotational speed with constant acceleration begins, the method further includes: For each motor, if there is a previous control cycle, update the desired speed to the desired speed per unit time output in the previous control cycle.
5. A motion control method for a self-moving device according to any one of claims 1 to 4, wherein, The process of smoothing the desired rotational speed with constant acceleration to obtain the desired rotational speed per unit time includes: For each motor, compare the speed difference between the current speed and the expected speed per unit time with the corresponding threshold to determine the stage of entering the T-shaped acceleration / deceleration curve, and use jerk to update the acceleration; then use the acceleration to calculate the speed at the next moment based on the current speed, as the expected speed per unit time. The jerk is the rate of change of acceleration. The jerk can be a fixed value or dynamically adjusted according to the current current of the motor on that side.
6. A motion control method for a self-moving device according to claim 5, wherein, The jerk is dynamically adjusted based on the current current of the motor on that side, as follows: ; ; in, These are jerks for the acceleration and deceleration phases, respectively. The minimum jerk resolution is not less than the jerk resolution. These are the theoretical jerks for the acceleration and deceleration phases, respectively. This represents the current current of the motor on that side. This is the maximum current; To suppress the scaling factor.
7. A motion control method for a self-moving device according to claim 5, wherein: For each motor, the speed difference between the current speed and the expected speed per unit time is compared with the corresponding threshold to determine the stage of entering the T-shaped acceleration / deceleration curve. The acceleration is updated using jerk, including: If the absolute value of the speed difference does not exceed the corresponding threshold, then the system enters a constant speed state and the acceleration is set to 0. If the speed difference is greater than the corresponding threshold, the acceleration state is entered, the acceleration is updated to the current acceleration plus the jerk of the current control cycle, and compared with the maximum acceleration, and the smaller value is taken as the acceleration. If the speed difference is less than the negative number of the corresponding threshold, the system enters a deceleration state, updates the acceleration to the current acceleration minus the jerk of the current control cycle, and compares it with the negative number of the maximum acceleration, taking the larger value as the acceleration.
8. A motion control method for a self-moving device according to claim 5, wherein, The method of using acceleration to calculate the rotational speed at the next moment based on the current rotational speed, as the expected rotational speed per unit time, includes: For each motor, the theoretical speed at the next moment is weighted and summed with the current speed, acceleration, jerk, and speed update cycle duration to obtain the speed at the next moment, which is used as the expected speed per unit time.
9. A motion control method for a self-moving device according to claim 8, wherein, The theoretical rotational speed at the next moment is ; The rotational speed at the next moment is as follows: ; ; in, It is a smoothing factor; This is an adjustment coefficient used to control the response sensitivity to changes in speed error.
10. A motion control method for a self-moving device according to claim 9, wherein, The calculation of the desired current based on the error between the desired rotational speed per unit time and the current rotational speed includes: For each motor, collect the current speed; In the speed loop PID, an integral limit value is introduced to limit the integral term. The proportional gain and derivative gain are dynamically adjusted according to the magnitude and rate of change of the error between the expected speed and the current speed per unit time. The derivative gain is further adjusted according to the direction of acceleration. Then, the error between the expected speed and the current speed per unit time is substituted into the speed loop PID to output the expected current. The desired current is limited by a preset desired power, and the desired current is updated to the limited desired current.
11. A motion control method for a self-moving device according to claim 10, wherein, The desired current is: ; ; in, For the desired current, These are the proportional gain, integral gain, and derivative gain of the speed loop PID controller. This represents the difference between the expected rotational speed and the current rotational speed per unit time. This is the proportional gain adjustment factor for the speed loop PID controller, used to increase the proportional gain and improve the response speed when the error is large; This is the differential gain adjustment factor for the speed loop PID controller, used to reduce the differential gain and suppress noise interference when the error rate of change is large. This is the impact resistance coefficient of the speed loop PID controller; The symbols represent trends, with positive and negative indicating acceleration or deceleration, respectively. This is the integral term of the speed loop PID controller. This is the integral limit value for the speed loop PID controller.
12. A motion control method for a self-moving device according to claim 11, wherein: The The value is between 0.2 and 0.
5.
13. The motion control method for a self-moving device according to claim 10, wherein, The step of using a preset expected power to limit the expected current, and updating the expected current to the limited expected current, includes: For each motor, the limiting current is calculated using the preset expected power, actual voltage, and redundancy protection factor, as follows: ;in, To limit the current, This is the redundancy protection factor. To preset the desired power, This is the actual voltage; The desired current is limited by the current limiting function, and the desired current is updated to the limited desired current.
14. A motion control method for a self-moving device according to claim 13, wherein: The 。 15. A motion control method for a self-moving device according to claim 10, wherein, The calculation of the desired duty cycle based on the error between the desired current and the current includes: For each motor, collect the current. In the current loop PID, an integral limit value is introduced to limit the integral term. The proportional gain, integral gain and derivative gain are dynamically adjusted according to the magnitude and rate of change of the error between the desired current and the current current. The derivative gain is further adjusted according to the direction of the current change. Then, the error between the desired current and the current current is substituted into the current loop PID to obtain the output of the current loop PID. After limiting the output of the current loop PID using the maximum duty cycle, the desired duty cycle is output.
16. A motion control method for a self-moving device according to claim 15, wherein, The desired duty cycle is expressed as: ; ; ; in, The expected duty cycle; This is a limiting function, formatted as follows: ,if Exceeding If so, then return the boundary value; This is the output of the current loop PID controller. For maximum duty cycle, These are the proportional gain, integral gain, and derivative gain of the current loop PID controller. This is the difference between the desired current and the current current. These are the proportional gain adjustment factor and integral gain adjustment factor for the current loop PID, respectively, used to increase the proportional gain and integral gain when the error is large; This is the differential gain adjustment factor for the current loop PID controller, used to reduce the differential gain when the error rate of change is large; This is the impact resistance coefficient of the current loop PID controller, with a value between 0.2 and 0.
5. This is a trend symbol used to determine the direction of a sudden change in current. This is the integral term of the current loop PID controller. This is the integral limit value for the current loop PID controller; The duration of the current update cycle.
17. A motion control method for a self-moving device according to claim 5, wherein, When the current duty cycle and current of both motors are greater than or equal to their corresponding rated values, the method of dynamically adjusting the desired speed of the other motor per unit time based on one motor to achieve synchronization of both motors includes: Step A1: For both motors, determine whether the current duty cycle is ≥ the rated value; If yes, proceed to step A2; otherwise, determine whether the current duty cycle is less than the rated value. If yes, proceed to step A5; otherwise, determine whether the current duty cycle of the left motor is greater than or equal to the rated value. If yes, proceed to step A3; otherwise, proceed to step A4. Step A2: Determine if , , ,in These represent the current speed and the expected speed per unit time of the left motor, respectively. 、 These are the current speed and the expected speed per unit time of the motor on the right, respectively. If yes, proceed to step A3; otherwise, proceed to step A4. Step A3, let Then, the desired speed and desired duty cycle of the motors on both sides of the output are executed to control the corresponding motors and complete the motion control of this control cycle. Step A4, let Then, the desired speed and desired duty cycle of the motors on both sides of the output are executed to control the corresponding motors and complete the motion control of this control cycle. Step A5: For both motors, determine whether the current current is greater than or equal to the rated value. If yes, proceed to step A2; otherwise, determine whether the current current is less than the rated value. If so, the desired speed and desired duty cycle of the motors on both sides of the output are executed to control the corresponding motors and complete the motion control of this control cycle; otherwise, it is determined whether the current current of the left motor is greater than or equal to the rated value. If yes, proceed to step A3; otherwise, proceed to step A4.
18. A motion control system for a self-moving device, comprising two control groups, each control group including a motor and a motor controller, wherein: Each of the control groups controls the motor to implement the steps of the motion control method for the self-moving device as described in any one of claims 1 to 17.
19. A self-moving device, wherein: The device includes a whole machine controller and a motion control system for the self-moving device as described in claim 18, wherein the whole machine controller is communicatively connected to the motor controllers of two control groups in the motion control system of the self-moving device.
20. A computer-readable storage medium storing a computer program, wherein: When the computer program is executed by a processor, it implements the steps of the motion control method for a self-moving device as described in any one of claims 1 to 17.