Method for controlling the speed of a robot
By using the binary search method and cosine similarity to process command speed, the smooth control method for the sweeping robot approximates the motor response curve, solving the problem of mismatch in motor response capability and achieving more stable motion and simpler control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- AMICRO SEMICONDUCTOR CO LTD
- Filing Date
- 2024-11-26
- Publication Date
- 2026-06-02
AI Technical Summary
Existing speed control methods for robotic vacuum cleaners fail to effectively match the motor's response capabilities, leading to unstable movement and increased control complexity.
The command speed is processed using the bisection method and cosine similarity. By calculating the cosine similarity between the measured speed and the command speed, the motor response curve is approximated, and the optimal response limit parameters are configured to achieve smooth control.
It improves the smoothness of robot vacuum cleaner movement in various scenarios, reduces vibration and jerking in motor drive, and simplifies the complexity of speed control.
Smart Images

Figure CN122131834A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of mobile robot technology, and in particular to a method for robot speed control. Background Technology
[0002] Currently, robotic vacuum cleaners typically use acceleration to control speed, for example, increasing the speed by a certain increment over a short period of time. This smooths out the robot's speed control to some extent. However, because motors have a response time, the motor speed cannot perfectly match the motor's response capability, making it difficult for the robotic vacuum cleaner to maintain stable movement.
[0003] Chinese invention patent application number CN202011491533.6 discloses a method for adjusting the walking speed of a robot. The corresponding speed adjustment method is based on the magnitude change of the walking speed of the robot's drive wheels. It uses P-adjustment and incremental PI adjustment to periodically control the walking speed of the robot's drive wheels to transition to the final target speed. However, regardless of whether the robot switches to acceleration or deceleration, different accelerations need to be configured according to different needs, but the angular velocity factor is not introduced into the adjustment. Moreover, when the adjusted speed approaches the target speed under a predetermined period, P-adjustment, incremental PI adjustment or low-speed open-loop adjustment are repeatedly used, which increases the complexity of the speed control application. Summary of the Invention
[0004] This application aims to provide a robot speed control method, the specific technical solution of which is as follows: A robot speed control method includes: Step A, the robot calculates the command speed and the measured speed based on a kinematic model; then proceeds to Step B; Step B, the robot adjusts the command speed to fall within the measured speed disturbance range by performing a bisection method; then proceeds to Step C; Step C, the robot calculates the cosine similarity using the measured speed and the command speed falling within the measured speed disturbance range; then proceeds to Step D; Step D, when the cosine similarity falls within the fit range of the motor response curve, the disturbance parameter corresponding to the measured speed is configured as the optimal response limit parameter of the motor, and the command speed falling within the measured speed disturbance range is configured as the optimized motion speed, so that the robot walks according to the optimized motion speed. As can be seen from steps A to D, this application processes the command speed using the bisection method and cosine similarity, reducing the difference between the measured speed and the command speed to an allowable disturbance range. Thus, the speed curve represented by the command speed falling within the measured speed disturbance range approximates the actual motor response curve, achieving smooth robot speed control. This allows the robot to walk more smoothly and without jitter in various scenarios. Therefore, this application solves the problem that the previously configured command speed could not well match the motor's response capability, achieving the purpose of smooth control. Furthermore, steps A to D reduce the operation of configuring acceleration based on distance and time, so adjusting the robot's command speed no longer needs to consider the effects of acceleration and distance, reducing the complexity of robot speed control.
[0005] Furthermore, the process between steps C and D includes: determining whether the cosine similarity falls within the fit range of the motor response curve; if so, executing step D; otherwise, adjusting the disturbance parameter corresponding to the measured speed, updating the adjusted disturbance parameter to match the measured speed, and then executing step B. Steps B through D are then repeated to find the optimal motor response limiting parameter, i.e., searching for the optimal disturbance parameter corresponding to the measured speed by repeatedly determining whether it falls within the fit range of the motor response curve.
[0006] Furthermore, whenever it is determined that the cosine similarity does not fall within the range of the motor response curve, the disturbance parameter corresponding to the measured speed is controlled to change once, so that the absolute value of the difference between the cosine similarity calculated in the subsequent step C and the value 1 is reduced. Thus, the cosine similarity is repeatedly calculated based on the command speed falling within the measured speed disturbance range, and the corresponding disturbance parameter is adjusted according to whether it falls within the range of the motor response curve. This allows the corresponding disturbance parameter to become the optimal response constraint parameter for the motor in step D, approximating the parameter required for the actual motor response. This is considered as approximating the optimal motor response curve through the disturbance value of the measured speed. Finally, when the calculated cosine similarity falls within the range of the motor response curve, the disturbance parameter corresponding to the measured speed and the command speed have good smoothness in their interaction on the robot without sacrificing responsiveness.
[0007] Furthermore, the median value of the motor response curve's fit range is 1. When the cosine similarity equals 1, the disturbance parameter corresponding to the currently obtained measured speed is equal to the parameter required by the speed response of the motor installed inside the robot, thus forming the optimal motor response constraint parameter. Simultaneously, the command speed falling within the measured speed disturbance range is determined to be equal to the currently obtained measured speed. At this point, the command speed completely approximates the optimal motor response curve, smoothing the robot's speed control and allowing the robot to move more smoothly in various scenarios, reducing jitter and stuttering in motor drive.
[0008] Further, in step C, the method for calculating the cosine similarity includes: calculating the dot product between the measured speed and the optimized speed to obtain a first scalar; calculating the modulus of the measured speed and the optimized speed respectively, and then calculating the product between the modulus of the measured speed and the optimized speed to obtain a second scalar; calculating the ratio between the first scalar and the second scalar to obtain the cosine similarity, thereby determining the cosine value of the angle between the measured speed and the optimized speed; wherein, the optimized speed is the command speed falling within the perturbation range of the measured speed; the measured speed, the command speed, and the optimized speed are all vectors. Thus, this application utilizes cosine similarity to capture the directional similarity between the measured speed and the optimized speed, without being affected by the rate value.
[0009] Further, the method by which the robot adjusts the command speed to fall within the measured speed disturbance range by performing a dichotomy includes: Step B1, calculating the absolute value of the rate difference between the command speed and the measured speed to obtain a speed error value; then executing Step B2; Step B2, determining whether the speed error value is greater than the current disturbance parameter, if yes, executing Step B3, otherwise executing Step B4; wherein, the current disturbance parameter is the disturbance parameter corresponding to the measured speed; Step B3, calculating half of the sum of the command speed and the measured speed to obtain the expected speed, then updating the expected speed to the command speed, and then executing Step B1; Step B4, determining that the command speed mentioned in Step B1 falls within the measured speed disturbance range; wherein, when the rate value of the command speed is greater than or equal to the rate value of the measured speed, the range of rate values smaller than the sum of the rate value of the measured speed and the current disturbance parameter is the measured speed disturbance range; when the rate value of the command speed is less than the rate value of the measured speed, the range of rate values smaller than the difference between the rate value of the measured speed and the current disturbance parameter is the measured speed disturbance range. Therefore, based on the rate difference between the command speed and the measured speed and the disturbance parameters corresponding to the measured speed, the robot updates the command speed by calculating half of the sum of the command speed and the measured speed, so as to smooth the robot speed control with a binary method, eliminate jitter, and reduce acceleration configuration.
[0010] Furthermore, the commanded speed includes commanded linear velocity and commanded angular velocity, both of which are preset and adjustable in step B. The measured speed includes measured linear velocity and measured angular velocity, wherein, based on the measured linear velocity, the robot calculates the measured angular velocity from the measured linear velocity using a kinematic model. The perturbation parameters corresponding to the measured linear velocity and the measured angular velocity are both preset and adjustable between steps C and D. This improves the adaptability of the aforementioned perturbation parameters, bringing them closer to the optimal motor response limits, including those for optimal linear velocity and optimal angular velocity. This provides step B with a measured speed perturbation range that better meets the motor speed response requirements and provides step D with a cosine similarity that better matches the motor response curve, thereby achieving control over the robot's linear and angular velocities.
[0011] Further, in step C, the robot calculates cosine similarity using the measured velocity and the commanded velocity falling within the measured velocity disturbance range. This involves calculating the cosine similarity between the measured angular velocity and the commanded angular velocity falling within the measured velocity disturbance range to obtain the cosine value of the angle between the measured angular velocity and the commanded angular velocity; where both the measured angular velocity and the commanded angular velocity are vectors. Thus, this application utilizes cosine similarity to capture the directional similarity between the measured angular velocity and the commanded angular velocity, unaffected by the speed value.
[0012] Further, before executing step A, the robot measures the real-time linear velocity of the left wheel and the real-time linear velocity of the right wheel using encoders mounted on both sides, and configures preset linear velocities for the left and right wheels. Simultaneously, the distance between the wheels mounted on both sides of the robot is determined and denoted as the wheelbase. The method for calculating the command speed and measured speed based on the kinematic model includes: calculating half the sum of the real-time linear velocities of the left and right wheels to obtain the measured linear velocity, so that the real-time walking speed of the robot's body center is represented by the measured linear velocity; calculating the ratio between the difference between the real-time linear velocities of the left and right wheels and the wheelbase to obtain the measured angular velocity, thereby converting the measured linear velocity into the measured angular velocity based on the kinematic model; calculating half the sum of the preset linear velocities of the left and right wheels to obtain the command linear velocity; and calculating the ratio between the difference between the preset linear velocities of the left and right wheels and the wheelbase to obtain the command angular velocity. Therefore, this application allows the adjusted command linear velocity and command angular velocity to fluctuate within the corresponding disturbance range, thereby avoiding drastic changes in linear velocity and angular velocity, increasing the smoothness of robot control, ensuring smooth robot movement, and eliminating the need for acceleration control, thus ensuring the simplicity of robot motion control configuration.
[0013] Further, in step D, when configuring the command speed falling within the measured speed disturbance range as the optimized motion speed, the command linear velocity falling within the measured speed disturbance range is determined to be the optimized walking linear velocity, and the command angular velocity falling within the measured speed disturbance range is determined to be the optimized rotational angular velocity; half of the product of the optimized rotational angular velocity and the wheelbase is calculated to obtain the reference linear velocity difference; the sum of the optimized walking linear velocity and the reference linear velocity difference is calculated to obtain the first optimized speed; the difference between the optimized walking linear velocity and the reference linear velocity difference is calculated to obtain the second optimized speed; the motor for driving the robot's left wheel is configured according to the first optimized speed, and the motor for driving the robot's right wheel is configured according to the second optimized speed, causing the robot to rotate clockwise within the measured speed disturbance range; or, the motor for driving the robot's left wheel is configured according to the second optimized speed, and the motor for driving the robot's right wheel is configured according to the first optimized speed, causing the robot to rotate counterclockwise within the measured speed disturbance range. This reduces the need to configure acceleration based on distance and time in speed control applications, meaning that setting the robot's control speed no longer requires consideration of acceleration, distance, etc., reducing the complexity of robot speed control. Attached Figure Description
[0014] Figure 1 This is a flowchart illustrating a robot speed control method disclosed in one embodiment of this application.
[0015] Figure 2 This is another embodiment of the present application, which discloses a flowchart of a robot performing a binary search. Detailed Implementation
[0016] The technical solutions of the embodiments of this application will be described in detail below with reference to the accompanying drawings. To further illustrate the embodiments, this application provides accompanying drawings. These drawings are part of the disclosure of this application and are mainly used to illustrate the embodiments, and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of this application.
[0017] Current acceleration control methods for mobile robots, while reducing errors in automatic robot movement, still require configuring acceleration based on distance and time in various closed-loop or open-loop adjustments. In short, many accelerations are configured under various complex working conditions, and different accelerations are required for different applications, increasing the complexity of configuring and using accelerations. This places more stringent demands on solving the problem of ensuring smooth robot speed control that matches the motor's response capability.
[0018] As one embodiment, this application discloses a robot speed control method. The executing entity of the robot speed control method is a robot that walks by relying on left and right drive wheels, belonging to a type of wheeled mobile robot. The robot is also equipped with an encoder to measure the speed of the left and right wheels in real time, which is configured as the linear speed of the robot's movement. However, the linear speed measured by the encoder in real time has a perturbation value, which will cause drastic changes in linear speed and angular velocity, deviating from the response characteristics of the motor. Therefore, the robot speed control method is executed. Figure 1 As shown, the robot speed control method includes: Step A: The robot calculates the command speed and the measured speed based on the kinematic model; then, step B is executed. The kinematic model is a calculation equation model set according to the kinematic laws of the robot's left and right wheel sets in straight-line walking and rotational movements. This model allows the robot to calculate the command speed and the measured speed based on the real-time measured speeds of the left and right wheels. The measured speed is directly related to the real-time measured speeds of the left and right wheels. The command speed is a pre-set speed to be adjusted, and it is adjusted by comparing the command speed and the measured speed.
[0019] Step B: The robot adjusts the command speed to fall within the measured speed disturbance range by executing a bisection method. The measured speed disturbance range can be understood as the range of disturbance parameters corresponding to the measured speed. Step B adjusts the command speed to fall within the measured speed disturbance parameter range by increasing the disturbance parameter corresponding to the measured speed, thereby controlling the robot speed relatively smoothly; then, step C is executed. The difference between the bisection method disclosed in this application and the bisection / compromise method in common knowledge lies in the type and numerical range of the threshold required to adjust the command speed, and its smoothing effect in approximating the response curve of the actual motor. If calculated according to time, a measured speed is measured in each adjustment cycle, and each measured speed corresponds to a disturbance parameter and its perturbable range. Therefore, before falling within the measured speed disturbance range, each adjustment cycle uses the corresponding disturbance parameter to determine whether to adjust the command speed. Therefore, step B finds the optimal command speed within the measured speed disturbance range using the bisection method, which can improve the speed calculation efficiency.
[0020] Step C: The robot calculates the cosine similarity using the measured speed and the command speed that falls within the perturbation range of the measured speed; then Step D: The speeds involved in this application can all be regarded as vectors, and the specific values can be calculated from the rate values. Therefore, the corresponding cosine similarity can be obtained by directly calculating the angle between the measured speed and the command speed. Based on the cosine similarity calculated in Step C, it is determined whether the cosine similarity falls within the fitting range of the motor response curve, so as to find the optimal perturbation parameters within the fitting range of the motor response curve in the future.
[0021] Specifically, to find the optimal motor response curve, the disturbance parameters corresponding to different measured speeds can be combined / fitted. The disturbance parameters corresponding to the measured speed can then assist the measured speed and the command speed in constructing the optimal motor response curves along the time axis, respectively, thus obtaining the command speed curve and the measured speed curve. Then, the cosine value between the command speed curve and the measured speed curve is calculated as the cosine similarity. In this way, the closer the cosine value is to 1, the closer the angle between the currently adjusted command speed and the measured speed is to 0, that is, the currently adjusted command speed is close to the measured speed.
[0022] Step D: When the cosine similarity falls within the fit range of the motor response curve, the disturbance parameter corresponding to the measured speed is configured as the optimal motor response limit parameter, and the command speed falling within the disturbance range of the measured speed is configured as the optimized motion speed. Then, the duty cycle of the pulse width modulation signal can be configured according to the optimized motion speed so that the robot walks at the optimized motion speed. The fit range of the motor response curve is the range of cosine values used to determine whether the disturbance parameter corresponding to the measured speed meets the motor speed response requirements. When it is determined that the cosine similarity calculated in step C falls within the fit range of the motor response curve, the disturbance parameter corresponding to the measured speed assists the measured speed in constructing the optimal motor response curve along the time axis. This is understood as the angle between the currently adjusted command speed and the measured speed being close to 0. The duty cycle of the pulse width modulation signal can be configured according to the currently adjusted command speed and output to the motor to update the robot's current walking speed.
[0023] As can be seen from steps A to D, this application processes the command speed using the bisection method and cosine similarity, reducing the difference between the measured speed and the command speed to an allowable disturbance range. Thus, the speed curve represented by the command speed falling within the measured speed disturbance range approximates the actual motor response curve, achieving smooth robot speed control. This allows the robot to walk more smoothly and without jitter in various scenarios. Therefore, this application solves the problem that the previously configured command speed could not well match the motor's response capability, achieving the purpose of smooth control. Furthermore, steps A to D reduce the operation of configuring acceleration based on distance and time, so adjusting the robot's command speed no longer needs to consider the effects of acceleration and distance, reducing the complexity of robot speed control.
[0024] It should be noted that the command speed falling within the measured speed disturbance range is allowed to have a certain degree of disturbance. Specifically, linear velocity and angular velocity are allowed to fluctuate within a certain range, thereby avoiding drastic changes in the command speed and increasing the smoothness of robot control speed. The command speed can be used to configure the duty cycle of the pulse width modulation signal required for motor operation, ensuring smooth robot movement. At the same time, based on the response characteristics of the motor, acceleration control is not required, ensuring the simplicity of the machine motion control configuration.
[0025] To analyze the perturbation of the command speed within the measured speed perturbation range, the magnitude of the aforementioned cosine similarity will be determined, such as... Figure 1 As shown, between steps C and D, the method further includes: determining whether the cosine similarity falls within the range of the motor response curve; if so, executing step D; otherwise, adjusting the disturbance parameter corresponding to the measured speed, updating the adjusted disturbance parameter corresponding to the measured speed to the disturbance parameter corresponding to the measured speed, and then executing step B. Steps B to D are then repeated to find the optimal response limiting parameter of the motor, that is, by repeatedly determining whether it falls within the range of the motor response curve, the optimal disturbance parameter corresponding to the measured speed is searched.
[0026] As one embodiment, whenever it is determined that the cosine similarity does not fall within the fit range of the motor response curve, the disturbance parameter corresponding to the measured speed is controlled to change once, including each time the corresponding disturbance parameter is controlled to increase or decrease by half, causing the coverage area of the measured speed disturbance range to change. Then the disturbance parameter corresponding to the adjusted measured speed is updated to the disturbance parameter corresponding to the measured speed, and then step B is executed to change the command speed. Then the absolute value of the difference between the cosine similarity calculated in the subsequent step C and the value 1 decreases. This unidirectional change of the corresponding disturbance parameter is repeatedly controlled until it is determined that the cosine similarity does not fall within the fit range of the motor response curve, so that the cosine similarity is closer to or equal to the value 1. Therefore, the cosine similarity is repeatedly calculated based on the command speed falling within the measured speed disturbance range, and the corresponding disturbance parameters are adjusted according to whether it falls within the fit range of the motor response curve. In step D, the corresponding disturbance parameters become the optimal response constraint parameters of the motor, approximating the parameters required for the actual motor response. This is regarded as approximating the optimal motor response curve by the disturbance value of the measured speed. When the calculated cosine similarity falls within the fit range of the motor response curve, the disturbance parameters corresponding to the measured speed and the command speed have good smoothness in their effect on the robot without losing responsiveness.
[0027] Preferably, the median value of the motor response curve fitting range is 1. When the cosine similarity is equal to 1, the disturbance parameter corresponding to the currently obtained measured speed is equal to the parameter required by the speed response of the motor installed inside the robot, so as to form the optimal motor response constraint parameter. At the same time, it is determined that the command speed falling within the measured speed disturbance range is equal to the currently obtained measured speed. Thus, the command speed is completely close to the optimal motor response curve, which smooths the control of the robot speed, makes the robot walk more smoothly in various scenarios, and reduces the jitter and stuttering phenomena in motor drive.
[0028] As one embodiment, in step C, the method for calculating the cosine similarity includes: calculating the dot product between the measured speed and the optimized speed (the sum of the products of corresponding elements of the two vectors, measured speed and optimized speed), to obtain a first scalar; calculating the modulus of the measured speed and the optimized speed respectively, and then calculating the product between the modulus of the measured speed and the optimized speed, to obtain a second scalar; then calculating the ratio between the first scalar and the second scalar to obtain the cosine similarity, thereby determining the cosine value of the angle between the measured speed and the optimized speed, which represents the similarity between the measured speed and the optimized speed in the vector space. Thus, this embodiment utilizes cosine similarity to capture the directional similarity between the measured speed and the optimized speed, without being affected by the rate value.
[0029] In this embodiment, the optimized speed is the command speed that falls within the measured speed disturbance range. The measured speed, command speed, and optimized speed are all vectors, or can all be considered speed functions. Therefore, the cosine similarity is the cosine value between the speed function curve containing the measured speed and the speed function curve containing the optimized speed. When the cosine similarity is 1, it indicates that the measured speed and optimized speed are completely identical, with an angle of 0 degrees (maximum similarity). When the cosine similarity is 0, it indicates that the measured speed and optimized speed are orthogonal, with an angle of 90 degrees (completely unrelated). When the cosine similarity is -1, it indicates that the measured speed and optimized speed are completely opposite in direction, with an angle of 180 degrees (completely dissimilar or even anti-similar, or completely opposite). Therefore, the preferred range for the motor response curve to fit is greater than or equal to 0.99 and less than or equal to 1.
[0030] Furthermore, to find the optimal motor response curve, the disturbance parameters corresponding to the measured speed at different times can be combined for machine control, thus obtaining the command speed curve and the measured speed curve. Then, the cosine value of these two curves is calculated. When the cosine value of these two curves falls within the fitting range of the motor response curve, the optimal motor response limiting parameter is found.
[0031] As one embodiment, in step B above, the robot adjusts the commanded speed to fall within the measured speed disturbance range by performing a dichotomy method, such as... Figure 2 It can be seen that this includes: Step B1: Calculate the absolute value of the speed difference between the commanded speed and the measured speed to obtain the speed error value; then proceed to step B2. The commanded speed can be greater than or less than the measured speed. In this embodiment, the commanded speed needs to be adjusted to within the measured speed disturbance range.
[0032] If the bisection method is configured as a mathematical function model, then the command speed is input as the expected value into the mathematical function model, the measured speed is input as the actual value into the mathematical function model, and the perturbation value corresponding to the measured speed or the perturbation range of the measured speed is input as a judgment threshold into the mathematical function model, so as to allow the command speed to have a certain perturbation during the execution of the bisection method. The expected value calculated in each compromise is the output of the mathematical function model.
[0033] Step B2: Determine whether the speed error value is greater than the current disturbance parameter. If yes, proceed to step B3; otherwise, proceed to step B4. The current disturbance parameter is the disturbance parameter corresponding to the measured speed. When the measured speed changes, the disturbance parameter corresponding to the measured speed does not change within the current adjustment period. At least the current disturbance parameter mentioned in step B2 must remain constant.
[0034] Step B3: Calculate half the sum of the command speed and the measured speed to obtain the expected speed. Then update the expected speed to the command speed, and then execute step B1 again to continue calculating the absolute value of the rate difference between the command speed (expected speed) and the measured speed until the command speed mentioned in step B1 falls within the perturbation range of the measured speed. This updates the command speed according to the binary search principle to narrow the rate difference between the command speed and the measured speed, and also allows for a current perturbation parameter to make the expected speed approximate the measured speed.
[0035] Step B4: Determine that the command speed mentioned in step B1 falls within the range of the measured speed disturbance. A relatively smooth speed curve is obtained from the command speed, thus achieving good expected response characteristics.
[0036] It should be noted that when the command speed value is greater than or equal to the measured speed value, the range of speed values smaller than the sum of the measured speed value and the current disturbance parameter is the measured speed disturbance range; when the command speed value is less than the measured speed value, the range of speed values smaller than the difference between the measured speed value and the current disturbance parameter is the measured speed disturbance range.
[0037] Therefore, based on the rate difference between the command speed and the measured speed and the disturbance parameters corresponding to the measured speed, the robot updates the command speed by calculating half of the sum of the command speed and the measured speed, so as to smooth the robot speed control with a binary method, eliminate jitter, and reduce acceleration configuration.
[0038] In the foregoing embodiments, the commanded speed includes commanded linear velocity and commanded angular velocity, both of which are preset and adjustable in step B, allowing adjustment to begin from their preset initial values. The measured speed includes measured linear velocity and measured angular velocity, wherein, based on the measured linear velocity, the robot calculates the measured angular velocity using a kinematic model.
[0039] If the absolute value of the rate difference between the command linear velocity and the measured linear velocity is greater than the current disturbance parameter, the command linear velocity is updated by calculating half of the sum of the command linear velocity and the measured linear velocity. Similarly, if the absolute value of the rate difference between the command angular velocity and the measured angular velocity is greater than the current disturbance parameter, the command angular velocity is updated by calculating half of the sum of the command angular velocity and the measured angular velocity.
[0040] The perturbation parameters corresponding to the measured linear velocity and the measured angular velocity are both preset and adjustable between steps C and D. Preferably, the perturbation parameter corresponding to the measured linear velocity is set to 50 mm / s, and the perturbation parameter corresponding to the measured angular velocity is set to 0.25 radians / s. Both can remain unchanged in step B. The perturbation parameters are only adjusted when the cosine similarity does not fall within the fit range of the motor response curve. This improves the adaptability of the perturbation parameters, bringing them closer to the optimal motor response limit parameters, including the optimal linear velocity limit parameter and the optimal angular velocity limit. This provides step B with a measured velocity perturbation range that better meets the motor speed response requirements and provides step D with a cosine similarity that better fits the motor response curve, thereby achieving control over the robot's linear velocity and angular velocity.
[0041] The measured speed perturbation range includes the measured linear velocity perturbation range and the measured angular velocity perturbation range. By adding perturbation parameters to the linear velocity and angular velocity respectively, the optimized motion speed can be approximated, which can effectively reduce the adverse effects of the robot's physical parameters and external perturbations on speed control and improve the robustness of motor drive.
[0042] As one embodiment, in step C, the robot calculates a cosine similarity using the measured speed and the commanded speed falling within the measured speed disturbance range. This is essentially calculating the cosine similarity between the measured angular velocity and the commanded angular velocity within the measured speed disturbance range to obtain the cosine value of the angle between the measured and commanded angular velocities. Both the measured and commanded angular velocities are vectors. The measured speed disturbance range disclosed in this embodiment is the measured angular velocity disturbance range; therefore, there is no need to distinguish the disturbance parameter ranges corresponding to the linear velocities of the left and right wheels. Only the angular velocity is involved in the calculation and comparison. The final calculated cosine similarity represents the similarity between the measured speed and the commanded speed falling within the measured speed disturbance range in vector space. Thus, this embodiment uses cosine similarity to capture the directional similarity between the measured and commanded angular velocities, unaffected by the speed value.
[0043] The analysis of the mathematical characteristics of a two-wheeled differential wheeled mobile robot is particularly applicable to calculating the cosine similarity between the measured angular velocity and the command angular velocity within the measured velocity perturbation range. Furthermore, the application of the measured velocity perturbation range establishes a kinematic model with error perturbations. Specifically, by combining the perturbation parameters corresponding to the measured angular velocity and the command angular velocity at different times, the kinematic model sequentially calculates the measured and command angular velocities at different times, obtaining the measured angular velocity curve and the command angular velocity curve respectively. Then, the cosine values of these two curves are calculated. When the cosine values of these two curves fall within the fitting range of the motor response curve, the perturbation parameters corresponding to the measured angular velocity and the command angular velocity are updated to the optimal motor response constraint parameters.
[0044] As one embodiment, before executing step A, the robot measures the real-time linear velocity of the left wheel and the real-time linear velocity of the right wheel using encoders mounted on both sides, and configures preset linear velocities for the left and right wheels; simultaneously, it determines the distance between the wheels mounted on both sides of the robot, denoted as the wheelbase. When the robot is a sweeping robot, it can be modeled as a movable model with two wheels and a certain height, approaching a cylinder. The left and right wheels are driven by motors, and pulse width modulation signals with a certain duty cycle are configured to generate the real-time linear velocity of the left wheel and the real-time linear velocity of the right wheel.
[0045] Methods for calculating commanded velocity and measured velocity based on kinematic models include: The measured linear velocity is obtained by calculating half the sum of the real-time linear velocities of the left and right wheels, so that the real-time walking speed of the robot's body center is represented by the measured linear velocity. Two wheels are symmetrically installed on the left and right sides of the robot, and the robot's body center is set at the midpoint of the connection between the axles of the two wheels. The real-time walking speed of the robot's body center is the walking speed of the center of the wheel axis.
[0046] The ratio of the difference between the real-time linear velocities of the left and right wheels to the wheelbase is calculated to obtain the measured angular velocity, thus converting the measured linear velocity into the measured angular velocity based on the kinematic model. When the robot rotates, the measured angular velocity represents the angle rotated per unit time for both wheels on both sides. Because the angular velocity generated by the rotation of the left wheel is the same as that generated by the rotation of the right wheel during robot rotation, the angular velocities of the left and right wheels are not distinguished and are uniformly defined as the measured angular velocity.
[0047] Similarly, the command linear velocity is obtained by calculating half of the sum of the preset left wheel linear velocity and the preset right wheel linear velocity. Here, the preset left wheel linear velocity and the preset right wheel linear velocity are both preset linear velocities and are linear velocities to be adjusted so that the calculated command linear velocity falls within the corresponding measured speed disturbance range. At this time, there is no distinction between the disturbance parameters corresponding to the preset left wheel linear velocity and the disturbance parameters corresponding to the preset right wheel linear velocity. The corresponding measured speed disturbance range is the measured linear velocity disturbance range.
[0048] Similarly, the ratio between the difference between the preset left wheel linear velocity and the preset right wheel linear velocity and the wheel track is calculated to obtain the command angular velocity, so that the calculated command angular velocity falls within the corresponding measured speed disturbance range, wherein the corresponding measured speed disturbance range is the measured angular velocity disturbance range.
[0049] Therefore, this embodiment allows the adjusted command linear velocity and command angular velocity to fluctuate within the corresponding disturbance range, thereby avoiding drastic changes in linear velocity and angular velocity, increasing the smoothness of robot control, ensuring smooth robot movement, and eliminating the need for acceleration control, thus ensuring the simplicity of robot motion control configuration.
[0050] Based on the aforementioned embodiments, when controlling the robot to move from an initial position at a certain point at the measured speed, it is necessary to control the robot's linear velocity and angular velocity by executing steps A to D. The corresponding disturbance range is used to judge and adjust the speed, which can approximate the optimal motor response curve. The disturbance parameters corresponding to the measured speed are configured as the optimal response limit parameters of the motor, and the command speed falling within the measured speed disturbance range is configured as the optimized motion speed, thereby achieving smooth driving of the wheels. Since the robot's linear velocity and angular velocity can be calculated using the aforementioned kinematic model, and the robot can adjust its linear velocity and angular velocity and transmit them to the controller to obtain real-time pose coordinates, the robot's actual working position can be tracked and determined within a limited period of time, which facilitates a better description of the robot's motion characteristics.
[0051] As one embodiment, when step D configures the command speed falling within the measured speed disturbance range as the optimized motion speed, it determines that the command linear velocity falling within the measured speed disturbance range is the optimized walking linear velocity, and determines that the command angular velocity falling within the measured speed disturbance range is the optimized rotational angular velocity. To drive the left and right wheels to move according to the command linear velocity falling within the measured speed disturbance range, the speeds of the left and right wheels are calculated separately based on the kinematic model. The specific calculation method is as follows: Calculate half of the product of the optimized rotational angular velocity and the wheel track to obtain the reference linear velocity difference; then calculate the sum of the optimized walking linear velocity and the reference linear velocity difference to obtain the first optimized speed; and calculate the difference between the optimized walking linear velocity and the reference linear velocity difference to obtain the second optimized speed; when the optimized rotational angular velocity is a clockwise or counterclockwise angular velocity, the rate of the first optimized speed is greater than the rate of the second optimized speed.
[0052] The robot is configured with a first optimized speed to drive the motors on its left and right wheels, and a second optimized speed to drive the motors on its right and left wheels, causing the robot to rotate clockwise within the measured speed disturbance range. Alternatively, the robot can be configured with the second optimized speed to drive the motors on its left and right wheels to drive the motors on its right and left wheels, respectively, causing the robot to rotate counterclockwise within the measured speed disturbance range. This reduces the need to configure acceleration based on distance and time in speed control applications, meaning that setting the robot's control speed no longer requires consideration of acceleration and distance, thus reducing the complexity of robot speed control.
[0053] It should be noted that in this embodiment, the duty cycles of the pulse width modulation signals controlled by the two motors can be configured according to the first optimized speed and the second optimized speed, respectively, to drive the left and right wheels of the robot to rotate. This allows the first optimized speed and the second optimized speed to be further adjusted and optimized in a closed loop based on the duty cycle of the pulse width modulation signal, thus resisting interference from the external environment.
[0054] It should be noted that the real-time pulse counts within a unit sampling time of the encoders in the left and right wheels can yield the real-time linear velocities of the left and right wheels. The pulse counts of the left and right wheels, after real-time measurement by the encoders and calculation using the aforementioned kinematic model, yield the measured linear velocity of the robot under its current motion behavior. This measured linear velocity is the average of the real-time linear velocities of the left and right wheels. When the robot starts moving, matching pulse width modulation (PWM) signal duty cycles are configured for the left and right wheels of the robot, respectively. These PWM signal duty cycles are matched to the real-time linear velocities of the left and right wheels, respectively.
[0055] The above embodiments are only for illustrating the technical concept and features of this application, and are intended to enable those skilled in the art to understand the content of this application and implement it accordingly. They should not be used to limit the scope of protection of this application. All equivalent changes or modifications made in accordance with the spirit and essence of this application should be included within the scope of protection of this application.
Claims
1. A robot speed control method, characterized in that, include: Step A: The robot calculates the commanded speed and the measured speed based on the kinematic model; Then proceed to step B; Step B: The robot adjusts the commanded speed to fall within the measured speed disturbance range by executing the dichotomy method, and then executes step C; Step C: The robot calculates the cosine similarity using the measured speed and the command speed falling within the measured speed disturbance range; then step D; In step D, when the cosine similarity falls within the range of the motor response curve, the disturbance parameter corresponding to the measured speed is configured as the optimal response limit parameter of the motor, and the command speed falling within the range of the measured speed disturbance is configured as the optimized motion speed, so that the robot walks according to the optimized motion speed.
2. The robot speed control method according to claim 1, characterized in that, The steps between C and D also include: Determine whether the cosine similarity falls within the range of the motor response curve. If yes, proceed to step D; otherwise, adjust the disturbance parameter corresponding to the measured speed, update the adjusted disturbance parameter corresponding to the measured speed to the disturbance parameter corresponding to the measured speed, and then proceed to step B.
3. The robot speed control method according to claim 2, characterized in that, Whenever it is determined that the cosine similarity does not fall within the range of the motor response curve, the disturbance parameter corresponding to the measured speed is controlled to change once, so that the absolute value of the difference between the cosine similarity calculated in the subsequent step C and the value 1 is reduced.
4. The robot speed control method according to claim 3, characterized in that, The median value of the range of the motor response curve is 1. When the cosine similarity is equal to 1, the disturbance parameter corresponding to the currently obtained measured speed is equal to the parameter required by the speed response of the motor installed inside the robot, so as to form the optimal motor response constraint parameter; at the same time, the command speed that falls within the measured speed disturbance range is equal to the currently obtained measured speed.
5. The robot speed control method according to claim 4, characterized in that, In step C, the method for calculating the cosine similarity includes: Calculate the dot product between the measured velocity and the optimized velocity to obtain the first scalar; Calculate the modulus of the measured speed and the modulus of the optimized speed separately, and then calculate the product between the modulus of the measured speed and the modulus of the optimized speed to obtain the second scalar; Calculate the ratio between the first scalar and the second scalar to obtain the cosine similarity, and then determine the cosine value of the angle between the measured speed and the optimized speed. The optimized speed is the command speed that falls within the measured speed disturbance range; the measured speed, command speed, and optimized speed are all vectors.
6. The robot speed control method according to claim 1, characterized in that, The method by which the robot adjusts the commanded speed to fall within the measured speed disturbance range by executing a dichotomy method includes: Step B1: Calculate the absolute value of the speed difference between the commanded speed and the measured speed to obtain the speed error value; then proceed to step B2. Step B2: Determine whether the speed error value is greater than the current disturbance parameter. If yes, proceed to step B3; otherwise, proceed to step B4. Wherein, the current disturbance parameter is the disturbance parameter corresponding to the measured speed. Step B3: Calculate half of the sum of the command speed and the measured speed to obtain the expected speed, then update the expected speed to the command speed, and then execute step B1. Step B4: Determine that the commanded speed described in Step B1 falls within the measured speed disturbance range; Wherein, when the command speed value is greater than or equal to the measured speed value, the range of speed values smaller than the sum of the measured speed value and the current disturbance parameter is the measured speed disturbance range; when the command speed value is less than the measured speed value, the range of speed values smaller than the difference between the measured speed value and the current disturbance parameter is the measured speed disturbance range.
7. The robot speed control method according to claim 5 or 6, characterized in that, The command speed includes command linear velocity and command angular velocity, wherein both command linear velocity and command angular velocity are preset and can be adjusted in step B; The measured velocity includes measured linear velocity and measured angular velocity. Based on the measured linear velocity, the robot calculates the measured angular velocity from the measured linear velocity according to the kinematic model. The disturbance parameters corresponding to the measured linear velocity and the disturbance parameters corresponding to the measured angular velocity are both preset and can be adjusted between steps C and D.
8. The robot speed control method according to claim 7, characterized in that, In step C, the robot calculates the cosine similarity using the measured speed and the command speed that falls within the measured speed disturbance range. This involves calculating the cosine similarity between the measured angular velocity and the command angular velocity that falls within the measured speed disturbance range to obtain the cosine value of the angle between the measured angular velocity and the command angular velocity. Both the measured angular velocity and the commanded angular velocity are vectors.
9. The robot speed control method according to claim 7, characterized in that, Before performing step A, the robot measures the real-time linear velocity of the left wheel and the real-time linear velocity of the right wheel using the encoders installed on both sides, and configures the preset linear velocities of the left wheel and the right wheel; at the same time, it determines the distance between the wheels installed on both sides of the robot, which is recorded as the wheelbase. Methods for calculating commanded velocity and measured velocity based on kinematic models include: The measured linear velocity is obtained by calculating half of the sum of the real-time linear velocities of the left and right wheels, so that the real-time walking speed of the robot's body center is represented by the measured linear velocity. The ratio between the difference between the real-time linear velocity of the left wheel and the real-time linear velocity of the right wheel and the wheel track is calculated to obtain the measured angular velocity, so as to realize the conversion of the measured linear velocity into the measured angular velocity based on the kinematic model; The commanded linear velocity is obtained by calculating half the sum of the preset left wheel linear velocity and the preset right wheel linear velocity; The command angular velocity is obtained by calculating the ratio between the difference between the preset left wheel linear velocity and the preset right wheel linear velocity and the wheel track.
10. The robot speed control method according to claim 9, characterized in that, When configuring the command speed that falls within the measured speed disturbance range as the optimized motion speed in step D, it is determined that the command linear velocity that falls within the measured speed disturbance range is the optimized walking linear velocity, and the command angular velocity that falls within the measured speed disturbance range is the optimized rotational angular velocity. The reference linear velocity difference is obtained by calculating half of the product of the optimized rotational angular velocity and the wheel track. The first optimized speed is obtained by summing the differences between the optimized linear speed and the reference linear speed. The difference between the optimized linear velocity and the reference linear velocity is calculated to obtain the second optimized velocity; The motor driving the left wheel of the robot is configured according to the first optimized speed, and the motor driving the right wheel of the robot is configured according to the second optimized speed, so that the robot rotates clockwise within the measured speed disturbance range. Alternatively, the motor driving the robot's left wheel can be configured according to the second optimized speed, while the motor driving the robot's right wheel can be configured according to the first optimized speed, causing the robot to rotate counterclockwise within the measured speed disturbance range.