Balance car control method and device, balance car and storage medium

By establishing a preset relationship in the two-wheeled balance bike to calculate the target speed, the robustness problem when vehicle parameters change is solved, and balance control without re-adjusting the PID parameters is achieved.

CN120364030APending Publication Date: 2025-07-25HAOMO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410092713.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-23
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

When the vehicle parameters change, the existing two-wheeled balance bikes need to be readjusted to maintain balance, which is poorly robust.

Method used

By integrating the target state parameters of the balance bike, establishing a preset relationship to calculate the target speed, and directly adjusting the running speed of the balance bike to maintain balance without re-adjusting the PID parameters.

Benefits of technology

The robustness of the balance bike when the parameters change is improved, and the need to frequently adjust the PID parameters is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120364030A_ABST
    Figure CN120364030A_ABST
Patent Text Reader

Abstract

The invention provides a balance car control method and device, a balance car and a storage medium. The method comprises the steps that current target state parameters of the balance car are obtained; wherein the target state parameters comprise variable state parameters in the state parameters of the balance car; acquiring current actual control parameters and expected control parameters of the balance car; calculating according to the target state parameter, the actual control parameter, the expected control parameter and a preset relation to obtain a target rotating speed; wherein the preset relation is used for describing the relation among the target state parameter, the actual control parameter, the expected control parameter and the target rotating speed; and the balance car is controlled to run according to the target rotating speed, so that the balance car is kept balanced. According to the method, when the target state parameters of the vehicle change, the PID parameters do not need to be adjusted again, the balance state of the balance vehicle can be kept, and robustness can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicles, and more particularly, to a method, an apparatus, a self-balancing vehicle, and a storage medium for controlling a self-balancing vehicle in the field of vehicles. Background Art

[0002] Currently, two-wheeled self-balancing vehicles have been widely used in multiple fields such as transportation, exploration, and rescue, providing an effective solution to environmental pollution and energy crisis problems. For the balance control algorithm of two-wheeled self-balancing vehicles, the PID (Proportion Integral Differential) control algorithm is mostly adopted. However, in the PID control algorithm, usually only the deviation of the pitch angle of the self-balancing vehicle and the deviation ε of the wheel speed w are concerned, and the robustness is poor. When some parameters of the vehicle (such as the body mass) change, in order to ensure the balanced state of the self-balancing vehicle, the PID parameters need to be readjusted. Summary of the Invention

[0003] The present application provides a method, an apparatus, a self-balancing vehicle, and a storage medium for controlling a self-balancing vehicle. The method can maintain the balanced state of the self-balancing vehicle without readjusting the PID parameters when the target state parameters of the vehicle change, which is beneficial to improving the robustness.

[0004] In a first aspect, a method for controlling a self-balancing vehicle is provided. The method includes: obtaining the current target state parameters of the self-balancing vehicle; wherein the target state parameters include the variable state parameters among the state parameters of the self-balancing vehicle; obtaining the current actual control parameters and expected control parameters of the self-balancing vehicle; calculating according to the target state parameters, the actual control parameters, the expected control parameters, and a preset relationship to obtain a target speed; wherein the preset relationship is used to describe the relationship among the target state parameters, the actual control parameters, the expected control parameters, and the target speed; controlling the self-balancing vehicle to run at the target speed so as to keep the self-balancing vehicle in balance.

[0005] In the above technical solution, since the preset relationship is used to describe the relationship among the target state parameters, the actual control parameters, the expected control parameters, and the target speed, that is, the target state parameters are integrated in the preset relationship. And since the target state parameters include the variable state parameters among the state parameters of the self-balancing vehicle, therefore, when the target state parameters change, the target state parameters, the actual control parameters, and the expected control parameters can be directly substituted into the preset relationship to obtain the target speed of the self-balancing vehicle, and then control the self-balancing vehicle to run at the target speed so as to keep the self-balancing vehicle in balance, without readjusting the PID parameters in order to keep the self-balancing vehicle in balance when the target state parameters change, which is beneficial to improving the robustness.

[0006] Combined with the first aspect, in some possible implementation manners, the above actual control parameters include an actual pitch angle and an actual wheel speed, the above desired control parameters include a desired pitch angle and a desired wheel speed, the above preset relationships include a first preset relationship and a second preset relationship, the first preset relationship is used to describe the relationship between the above target state parameter, the above actual pitch angle, the above desired pitch angle, and the first derivative of the above desired wheel speed, and the second preset relationship is used to describe the relationship between the first derivative of the above desired wheel speed, the above actual wheel speed, the above desired wheel speed, and the above target speed; the calculation of the above target speed according to the above target state parameter, the above actual control parameter, the above desired control parameter, and the preset relationship includes: calculating the first derivative of the above desired wheel speed according to the above target state parameter, the above actual pitch angle, the above desired pitch angle, and the first preset relationship; and calculating the above target speed according to the first derivative of the above desired wheel speed, the above actual wheel speed, the above desired wheel speed, and the second preset relationship.

[0007] In the above technical solution, since the first preset relationship is used to describe the relationship between the target state parameter, the actual pitch angle, the desired pitch angle, and the first derivative of the desired wheel speed, that is, the target state parameter is integrated in the first preset relationship. Therefore, when the target state parameter changes, the target state parameter, the actual pitch angle, and the desired pitch angle can be directly substituted into the first preset relationship to obtain the first derivative of the desired wheel speed. Then, the first derivative of the desired wheel speed, the actual wheel speed, and the desired wheel speed are substituted into the second preset relationship to obtain the target speed of the balance bike. Then, controlling the balance bike to run at the target speed can maintain the balance state and the desired speed state of the balance bike, without repeatedly adjusting the PID parameters to maintain the balance state and the desired speed state of the balance bike when the target state parameter changes, which is beneficial to improving the robustness.

[0008] Combined with the first aspect and the above implementation manner, in some possible implementation manners, the first preset relationship is constructed in the following manner: establishing a mathematical model of the inverted pendulum of the body of the balance bike; establishing a first PID model for controlling the deviation between the actual pitch angle and the desired pitch angle to be zero; and constructing the first preset relationship according to the mathematical model of the inverted pendulum of the body and the first PID model.

[0009] Combined with the first aspect and the above implementation manners, in some possible implementation manners, constructing the first preset relationship according to the above vehicle body inverted pendulum mathematical model and the above first PID model includes: converting the above vehicle body inverted pendulum mathematical model into a state space equation; linearizing the above state space equation to obtain a linearized target state space equation; constructing the above first preset relationship by substituting the above target state space equation into the above first PID model.

[0010] Combined with the first aspect and the above implementation manners, in some possible implementation manners, the state parameters of the above balance vehicle include: the moment of inertia I of the vehicle body about the wheel axis, the vehicle body mass m p , the wheel mass m, the distance l from the centroid of the inverted pendulum to the center of the wheel axis, the wheel radius r, the moment of inertia J of the motor rotor and the load equivalent on the motor axis, the above target state parameter includes the above vehicle body mass, and the expression of the above vehicle body inverted pendulum mathematical model is as follows:

[0011]

[0012] where g is the acceleration due to gravity, is the above actual pitch angle, is the first derivative of the above actual pitch angle, is the second derivative of the above actual pitch angle, is the first derivative of the above actual wheel speed;

[0013] The expression of the above first PID model is as follows:

[0014]

[0015] where, is the deviation between the above actual pitch angle and the above desired pitch angle, is the above first derivative, is the above second derivative, is the above first proportionality coefficient, is the above first integral coefficient, is the above first differential coefficient, is the above second differential coefficient; the expression of the above first preset relationship is as follows:

[0016]

[0017] where, is the first derivative of the desired wheel speed, is the second derivative of the desired pitch angle.

[0018] Combined with the first aspect and the above implementation, in some possible implementations, the above second preset relationship is constructed as follows: establish a mathematical model of the motor speed of the above balance bike; establish a second PID model for controlling the deviation between the actual wheel speed and the desired wheel speed to zero; construct the above second preset relationship according to the above motor speed mathematical model and the above second PID model.

[0019] Combined with the first aspect and the above implementation, in some possible implementations, the expression of the above motor speed mathematical model is as follows:

[0020]

[0021] where, is the first derivative of the above actual wheel speed, w u is the above target speed, w is the above actual wheel speed, a, b, c are the inherent parameters of the above motor speed mathematical model;

[0022] The expression of the above second PID model is as follows:

[0023]

[0024] where, P w is the first-order proportional coefficient of the above (w int - w), I w is the first-order integral coefficient of the above (w int - w), D w is the first-order differential coefficient of the above w r is the above desired wheel speed, is the first derivative of the desired wheel speed calculated according to the above first preset relationship;

[0025] The expression of the above second preset relationship is as follows:

[0026]

[0027] In a second aspect, a control device for a self-balancing vehicle is provided. The device includes: a first acquisition module configured to acquire the current target state parameters of the self-balancing vehicle; wherein, the target state parameters include the variable state parameters among the various state parameters of the self-balancing vehicle; a second acquisition module configured to acquire the current actual control parameters and desired control parameters of the self-balancing vehicle; a calculation module configured to perform calculations based on the target state parameters, the actual control parameters, the desired control parameters, and a preset relationship to obtain a target rotational speed; wherein, the preset relationship is used to describe the relationship among the target state parameters, the actual control parameters, the desired control parameters, and the target rotational speed; a control module configured to control the self-balancing vehicle to operate at the target rotational speed so as to maintain the balance of the self-balancing vehicle.

[0028] In combination with the second aspect, in some possible implementation manners, the actual control parameters include an actual pitch angle and an actual wheel rotational speed, the desired control parameters include a desired pitch angle and a desired wheel rotational speed, the preset relationship includes a first preset relationship and a second preset relationship, the first preset relationship is used to describe the relationship among the target state parameters, the actual pitch angle, the desired pitch angle, and the first derivative of the desired wheel rotational speed, and the second preset relationship is used to describe the relationship among the first derivative of the desired wheel rotational speed, the actual wheel rotational speed, the desired wheel rotational speed, and the target rotational speed; the calculation module is specifically configured to: perform calculations based on the target state parameters, the actual pitch angle, the desired pitch angle, and the first preset relationship to obtain the first derivative of the desired wheel rotational speed; and perform calculations based on the first derivative of the desired wheel rotational speed, the actual wheel rotational speed, the desired wheel rotational speed, and the second preset relationship to obtain the target rotational speed.

[0029] In combination with the second aspect, in some possible implementation manners, the device further includes: a first preset relationship construction module configured to establish a mathematical model of the inverted pendulum of the body of the self-balancing vehicle; establish a first PID model for controlling the deviation between the actual pitch angle and the desired pitch angle to be zero; and construct the first preset relationship based on the mathematical model of the inverted pendulum of the body and the first PID model.

[0030] In combination with the second aspect, in some possible implementation manners, the first preset relationship construction module is specifically configured to: convert the mathematical model of the inverted pendulum of the body into a state space equation; linearize the state space equation to obtain a linearized target state space equation; and construct the first preset relationship by substituting the target state space equation into the first PID model.

[0031] In combination with the second aspect, in some possible implementation manners, the various state parameters of the self-balancing vehicle include: the moment of inertia I of the body about the wheel axis and the body mass m p, the mass of the wheel m, the distance l from the center of mass of the inverted pendulum to the center of the wheel axis, the radius r of the wheel, and the moment of inertia J of the motor rotor and the load equivalent on the motor shaft. The above target state parameters include the above vehicle body mass. The expression of the above vehicle body inverted pendulum mathematical model is as follows:

[0032]

[0033] Among them, g is the acceleration due to gravity, is the above actual pitch angle, is the first derivative of the above actual pitch angle, is the second derivative of the above actual pitch angle, is the first derivative of the above actual wheel speed;

[0034] The expression of the above first PID model is as follows:

[0035]

[0036] Among them, is the deviation between the above actual pitch angle and the above desired pitch angle, is the above first derivative, is the above second derivative, is the above first proportionality coefficient, is the above first integral coefficient, is the above first differential coefficient, is the above second differential coefficient;

[0037] The expression of the above first preset relationship is as follows:

[0038]

[0039] Among them, is the first derivative of the desired wheel speed, is the second derivative of the desired pitch angle.

[0040] Combined with the second aspect, in some possible implementation manners, the above device further includes: a second preset relationship construction module, configured to: establish a mathematical model of the motor speed of the above balance vehicle; establish a second PID model for controlling the deviation between the above actual wheel speed and the above desired wheel speed to be zero; construct the above second preset relationship according to the above mathematical model of the motor speed and the above second PID model.

[0041] In combination with the second aspect, in some possible implementation manners, the expression of the above motor speed mathematical model is as follows:

[0042]

[0043] Wherein, is the first-order derivative of the above actual wheel speed, w u is the above target speed, w is the above actual wheel speed, and a, b, and c are the inherent parameters of the above motor speed mathematical model;

[0044] The expression of the above second PID model is as follows:

[0045]

[0046] Wherein, P w is the first-order proportional coefficient of the above (w int - w), I w is the first-order integral coefficient of the above (w int - w), D w is the first-order differential coefficient of the above w r is the above expected wheel speed, is the first-order derivative of the expected wheel speed calculated according to the above first preset relationship;

[0047] The expression of the above second preset relationship is as follows:

[0048]

[0049] In a third aspect, a self-balancing vehicle is provided, including a memory and a processor. The memory is used to store executable program codes, and the processor is used to call and run the executable program codes from the memory, so that the self-balancing vehicle executes the method in the first aspect or any one of the possible implementation manners of the first aspect.

[0050] In a fourth aspect, a computer program product is provided, which includes: computer program codes. When the computer program codes are run on a computer, the computer is enabled to execute the method in the first aspect or any one of the possible implementation manners of the first aspect.

[0051] In a fifth aspect, a computer-readable storage medium is provided, which stores computer program codes. When the computer program codes are run on a computer, the computer is enabled to execute the method in the first aspect or any one of the possible implementation manners of the first aspect. Description of the Drawings

[0052] Figure 1It is a schematic principle diagram of a PID series control structure in the prior art;

[0053] Figure 2 It is a schematic flowchart of a control method for a self-balancing scooter provided by an embodiment of the present application;

[0054] Figure 3 It is a schematic flowchart of a construction method for a first preset relationship provided by an embodiment of the present application;

[0055] Figure 4 It is a schematic flowchart of a construction method for a second preset relationship provided by an embodiment of the present application;

[0056] Figure 5 It is a principle block diagram of a control method for a self-balancing scooter provided by an embodiment of the present application;

[0057] Figure 6 It is a structural schematic diagram of a control device for a self-balancing scooter provided by an embodiment of the present application;

[0058] Figure 7 It is a structural schematic diagram of a self-balancing scooter provided by an embodiment of the present application. Detailed implementation manners

[0059] Next, the technical solutions in the present application will be clearly and elaborately described in conjunction with the accompanying drawings. Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B. The "and / or" in the text is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality of" means two or more than two.

[0060] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as implying or suggesting relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features.

[0061] At present, two-wheeled self-balancing scooters have been widely used in many fields such as transportation, exploration, and rescue, providing an effective solution to environmental pollution and energy crisis problems. The operating principle of two-wheeled self-balancing scooters is mainly based on the basic principle of dynamic stabilization. By using the gyroscope and acceleration sensor inside the vehicle body, the change of the vehicle body posture is detected, and the servo control system is used to accurately drive the motor to make corresponding adjustments to maintain the balance of the system. Two-wheeled self-balancing scooters have characteristics such as high order, nonlinearity, strong coupling, instability, and underactuation, and uncertainties such as mechanism friction, ground friction, payload change, or road slope need to be considered. Currently, the commonly used balance control algorithm is the PID control algorithm.

[0062] See Figure 1 , Figure 1 for the PID cascade control structure relied on by the commonly used balance control algorithm at present, that is, by adjusting the desired pitch angle to make the self-balancing scooter reach the desired wheel speed. Figure 1 In , the upright closed-loop controller performs PID calculation on the deviation between the input desired pitch angle and the detected actual pitch angle to obtain the rotational speed Wu input to the motor. After Wu is input to the motor, the deviation between the desired pitch angle and the detected actual pitch angle becomes 0. The speed closed-loop controller performs PID calculation on the deviation between the input desired wheel speed and the detected actual wheel speed, making the deviation between the desired wheel speed and the detected actual wheel speed 0. Through the PID control of the upright closed-loop controller and the speed closed-loop controller, the balance of the whole vehicle is achieved.

[0063] Figure 1 The design of the speed closed-loop controller in is generally as follows:

[0064]

[0065] where ε w = w r - w, is the desired pitch angle, ε w is the deviation between the desired wheel speed w r and the actual wheel speed w, is the first derivative of ε w , and P w , I w , D w are the first-order proportional coefficient, first-order integral coefficient, and first-order differential coefficient of the wheel speed respectively.

[0066] Figure 1 The design of the upright closed-loop controller in is generally as follows:

[0067]

[0068] Among them, w u is the target rotational speed input to the self-balancing scooter, is the desired pitch angle and the deviation between the actual pitch angle ; is the first-order derivative of The first-order proportional coefficient, the first-order integral coefficient, and the first-order differential coefficient of the pitch angle are respectively.

[0069] However, the inventors of the present application found that: in the above PID control algorithm, only the deviation of the pitch angle of the self-balancing scooter and the deviation ε of the wheel rotational speed w are concerned, and the robustness is poor. When some parameters of the vehicle (such as the body mass) change, the PID parameters need to be readjusted. Here, the PID parameters include the PID parameters of the wheel rotational speed (P w , I w , D w ) and / or the PID parameters of the pitch angle

[0070] Based on this, the embodiments of the present application provide a control method for a self-balancing scooter, which is applied to a self-balancing scooter, and the self-balancing scooter can be a two-wheeled self-balancing scooter. By fusing the target state parameters (such as the body mass) of the self-balancing scooter, the embodiments of the present application adjust the target rotational speed input to the self-balancing scooter so as to maintain the balance state of the self-balancing scooter without repeatedly adjusting the PID parameters when the target state parameters change, which is beneficial to improving the robustness.

[0071] Figure 2 is a schematic flowchart of a control method for a self-balancing scooter provided by an embodiment of the present application.

[0072] Exemplarily, as Figure 2 shown, the method includes:

[0073] Step 201: Obtain the current target state parameters of the self-balancing scooter; among them, the above target state parameters include the variable state parameters among the state parameters of the self-balancing scooter.

[0074] Step 202: Obtain the current actual control parameters and desired control parameters of the self-balancing scooter.

[0075] Step 203: Calculate according to the target state parameters, the actual control parameters, the desired control parameters and a preset relationship to obtain the target rotational speed; where the preset relationship is used to describe the relationship between the target state parameters, the actual control parameters, the desired control parameters and the target rotational speed.

[0076] Step 204: Control the self-balancing scooter to run at the target rotational speed so as to keep the self-balancing scooter in balance.

[0077] In Figure 2 the illustrated embodiment, since the preset relationship is used to describe the relationship among the target state parameters, the actual control parameters, the desired control parameters, and the target rotational speed, that is, the target state parameters are incorporated into the preset relationship. And since the target state parameters include the variable state parameters among the various state parameters of the self-balancing scooter, when the target state parameters change, the target state parameters, the actual control parameters, and the desired control parameters can be directly substituted into the preset relationship to obtain the target rotational speed of the self-balancing scooter, and then the self-balancing scooter is controlled to operate at the target rotational speed so that the self-balancing scooter maintains balance, without having to readjust the PID parameters to keep the self-balancing scooter in balance when the target state parameters change, which is beneficial to improving the robustness.

[0078] Next, Figure 2 the specific implementation manners of the steps in the illustrated embodiment are described as follows:

[0079] In step 201, the various state parameters of the self-balancing scooter may include variable state parameters and fixed state parameters. The variable state parameters can be understood as the state parameters that may change compared with the default state parameters when the self-balancing scooter leaves the factory, and the fixed state parameters can be understood as the state parameters that do not change compared with the default state parameters when the self-balancing scooter leaves the factory. Since the fixed state parameters are the state parameters that have been fixed when the self-balancing scooter leaves the factory, it can be considered that the fixed state parameters of the self-balancing scooter are known. In this step, only the target state parameters that may change need to be obtained.

[0080] Exemplarily, the state parameters of the self-balancing scooter may include:

[0081] r: wheel radius, unit m;

[0082] m p : body mass, unit Kg;

[0083] l: distance from the centroid of the inverted pendulum to the center of the wheel axis, unit m;

[0084] m: wheel mass, unit Kg;

[0085] J: moment of inertia of the motor rotor and the load equivalent on the motor shaft, unit Kg*m^2;

[0086] I: moment of inertia of the body about the wheel axis, unit Kg*m^2;

[0087] g: gravitational acceleration, unit Kg / s^2;

[0088] Among them, the fixed state parameters may include the wheel radius r, the distance l from the center of mass of the inverted pendulum to the center of the wheel axis, the wheel mass m, the moment of inertia J of the motor rotor and the load equivalent on the motor axis, and the gravitational acceleration g as described above. The variable state parameters may include the body mass m as described above p and the moment of inertia I of the body about the wheel axis. That is to say, obtaining the current target state parameters of the scooter can specifically be obtaining the current body mass m of the scooter p and the moment of inertia I of the body about the wheel axis.

[0089] In an exemplary embodiment, the above-mentioned obtaining of the current target state parameters of the scooter includes: obtaining the current body mass of the scooter. Although, the body mass m p and the moment of inertia I of the body about the wheel axis are both parameters that may change during the use of the scooter, considering that the change in the moment of inertia I of the body about the wheel axis is usually small, the known moment of inertia I of the body about the wheel axis at the time of factory can be directly used without having to obtain I in real time during the subsequent use of the scooter, because even if I is obtained in real time, it may not be much different from I at the time of factory. Therefore, taking the current body mass of the scooter as the target state parameter to be obtained in this embodiment can more effectively obtain the body mass with a greater possibility of change, without having to obtain the moment of inertia of the body about the wheel axis with a smaller possibility of change, which is conducive to saving the computing power resources of the scooter to a certain extent.

[0090] Exemplarily, the body mass m can be obtained by a weight sensor provided on the scooter p , and as the items placed on the scooter change, the body mass detected by the weight sensor will also change accordingly.

[0091] In step 202, obtain the current actual control parameters and desired control parameters of the scooter. Among them, the actual control parameters can be the parameters detected by the sensors provided on the scooter, and the desired control parameters can be understood as the given control parameters. Ideally, it is desired to control the scooter so that the deviation between the actual control parameters and the desired control parameters is 0, that is, the actual control parameters are equal to the desired control parameters.

[0092] Exemplarily, the actual control parameters include the actual pitch angle and the actual wheel speed, and the desired control parameters include the desired pitch angle and the desired wheel speed.

[0093] Among them, the actual pitch angle can be the inclination angle of the vehicle body relative to the vertical direction, and this actual pitch angle can be detected by a gyroscope sensor provided on the balance vehicle. To ensure that the balance vehicle remains in a balanced state, the desired pitch angle is usually 0 on a flat road section, and the desired pitch angle can usually be determined based on the slope on an uphill or downhill road section. Whether it is a flat road section, an uphill road section, or a downhill road section, the desired pitch angle is the pitch angle set to ensure that the balance vehicle remains in a balanced state.

[0094] The above-mentioned actual wheel speed can be understood as the actual speed of the wheels of the balance vehicle, and this actual speed can be detected by a speed sensor provided on the balance vehicle. The desired wheel speed can be set according to actual needs. For example, it can be set by the user operating the balance vehicle according to actual needs, so that the actual speed of the wheels continuously approaches the desired wheel speed until it is equal to the desired wheel speed.

[0095] In step 203, the above-mentioned preset relationship can be constructed based on the mathematical model of the balance vehicle. The preset relationship is used to describe the relationship between the target state parameters, the actual control parameters, the desired control parameters, and the target speed. For example, the preset relationship can be a specific preset formula. By substituting the obtained target state parameters, actual control parameters, and desired control parameters into this preset formula, the target speed can be calculated. This target speed can be understood as the speed input to the motor of the balance vehicle, so that the motor can rotate at this target speed to drive the balance vehicle to travel. It can be understood that since there may be a certain process for the motor to actually reach the target speed after the target speed is input to the motor, the target speed usually does not directly equal the desired wheel speed. If the desired wheel speed is greater than the actual wheel speed, then in order to make the actual wheel speed increase as soon as possible to reach the desired wheel speed, the target speed may be greater than the desired wheel speed.

[0096] Exemplarily, the above-mentioned preset relationship includes a first preset relationship and a second preset relationship. The first preset relationship is used to describe the relationship between the target state parameters, the actual pitch angle, the desired pitch angle, and the first derivative of the desired wheel speed. The second preset relationship is used to describe the relationship between the first derivative of the desired wheel speed, the actual wheel speed, the desired wheel speed, and the target speed. Among them, the first derivative of the desired wheel speed can be understood as the desired wheel acceleration. Correspondingly, the implementation manner of the above-mentioned step 203 can include the following steps 2031 and 2032:

[0097] Step 2031: Calculate according to the target state parameters, the actual pitch angle, the desired pitch angle, and the first preset relationship to obtain the first derivative of the desired wheel speed.

[0098] Specifically, the first preset relationship can be specifically a first preset formula. By substituting the target state parameter, the actual pitch angle, and the desired pitch angle into the above first preset formula, the first derivative of the desired wheel speed can be calculated.

[0099] Exemplarily, for the flowchart of the construction method of the above first preset relationship, that is, the first preset formula, reference can be made to Figure 3 Steps 301 to 303 in, including:

[0100] Step 301: Establish a mathematical model of the body inverted pendulum of the self-balancing vehicle.

[0101] Specifically, the kinematic model and the dynamic model of the body inverted pendulum can be constructed separately first, and then the kinematic model and the dynamic model are fused to obtain the mathematical model of the body inverted pendulum. Among them, the kinematic model is the motion model in which the wheel speed and the pitch angle of the self-balancing vehicle reach the expected values during the movement process. This motion model describes how the self-balancing vehicle moves to reach the expected wheel speed and the expected pitch angle. The dynamic model is the dynamic model in which the forces are balanced during the process of the inverted pendulum being stressed. This dynamic model describes how the body inverted pendulum is stressed so that the self-balancing vehicle reaches the balanced state.

[0102] In an exemplary embodiment, the expression of the mathematical model of the body inverted pendulum is as follows:

[0103]

[0104] Wherein, I is the moment of inertia of the body about the wheel axis, m p is the body mass, m is the wheel mass, l is the distance from the centroid of the inverted pendulum to the center of the wheel axis, r is the wheel radius, g is the acceleration due to gravity, J is the moment of inertia of the motor rotor and the load equivalent on the motor axis, is the actual pitch angle, is the first derivative of the actual pitch angle, is the second derivative of the actual pitch angle, is the first derivative of the actual wheel speed.

[0105] Among them, can all be understood as functions of time. If at a time point, substituting this time point into the above functions of time can make the expression of the above mathematical model of the body inverted pendulum hold, that is, the sum is 0, it can be considered that the self-balancing vehicle is in a balanced state at this time point.

[0106] Step 302: Establish a first PID model for controlling the deviation between the actual pitch angle and the desired pitch angle to zero.

[0107] Exemplarily, the expression of the first PID model is as follows:

[0108]

[0109] Among them, is the actual pitch angle and the deviation from the desired pitch angle is is the first derivative of is the second derivative of is the first proportionality coefficient of is the first integral coefficient of is the first differential coefficient of is the second differential coefficient of, and t is the integration duration. The above These coefficients can all be pre-adjusted by technicians before the self-balancing vehicle leaves the factory. Thus, during the use of the self-balancing vehicle, if PID adjustment of the pitch angle is required, the above 4 pre-adjusted coefficients can be directly used. Even if the vehicle body mass changes within a certain range, the above first preset relationship and second preset relationship can be used to calculate the target rotational speed that can keep the self-balancing vehicle balanced, without the need to adjust and other PID parameters. The main reason for the appearance of this term in the above first PID model is that appears in the mathematical model of the vehicle body inverted pendulum, that is, the highest order of the pitch angle is the second order. To eliminate when constructing the first preset relationship by combining the first PID model with the above mathematical model of the vehicle body inverted pendulum, a second-order deviation term, that is,

[0110] Step 303: Construct the first preset relationship according to the mathematical model of the vehicle body inverted pendulum and the first PID model.

[0111] Specifically, the mathematical model of the vehicle body inverted pendulum and the first PID model can be fused to obtain the above first preset relationship.

[0112] Exemplarily, the implementation manner of the above step 303 may include the following steps 3031 to 3033:

[0113] Step 3031: Convert the mathematical model of the vehicle body inverted pendulum into a state space equation.

[0114] Specifically, the converted state space equation may be as follows:

[0115]

[0116]

[0117]

[0118] Step 3032: Linearize the state space equation to obtain the linearized target state space equation.

[0119] Specifically, the mathematical model of the body inverted pendulum can be linearized to obtain the following relationship:

[0120]

[0121] That is, let:

[0122]

[0123] Then the linearized target space state equation is as follows:

[0124]

[0125] Step 3033: Construct a first preset relationship by substituting the target state space equation into the first PID model.

[0126] Specifically, after substituting the target state space equation into the first PID model, the first preset relationship obtained can be as follows:

[0127]

[0128] Since Therefore, the above first preset relationship can be expressed as follows:

[0129]

[0130] In the above first preset relationship, the wheel radius r, the distance l from the center of mass of the inverted pendulum to the center of the wheel axle, the wheel mass m, the moment of inertia J of the motor rotor and the load equivalent on the motor shaft, the gravitational acceleration g, These parameters can all be understood as known quantities when the self-balancing vehicle leaves the factory. Considering that the change in the moment of inertia I of the body with respect to the wheel axle is usually small, I can also be understood as a known quantity. Then, if the body mass m obtained at the current time p , the actual pitch angle and the second derivative of the desired pitch angle are substituted into the above first preset relationship, then this that is

[0131] The calculated value is this as Enter the calculation in the following second preset relationship. Or it can be understood as: In the above first preset relationship, it can be understood as the first derivative of the actual wheel speed, but in the above second preset relationship, it can be understood as the first derivative of the desired wheel speed.

[0132] Since the first PID model is used to control the deviation between the actual pitch angle and the desired pitch angle to zero, the first preset relationship obtained based on the first PID model can enable the balance bike to maintain the deviation between the actual pitch angle and the desired pitch angle at 0 under the action of obtained based on the above first preset relationship. It can be understood as the differential of the desired wheel speed expected to control the pitch angle to reach the desired value.

[0133] Step 2032: Calculate according to the first derivative of the desired wheel speed, the actual wheel speed, the desired wheel speed and the second preset relationship to obtain the target speed.

[0134] Specifically, the first preset relationship can be specifically a second preset formula. Substituting the first derivative of the desired wheel speed, the actual wheel speed, and the desired wheel speed into the above second preset formula, the first derivative of the desired wheel speed can be calculated.

[0135] Exemplarily, the flowchart of the construction method of the above second preset relationship, that is, the second preset formula, can refer to Figure 4 Steps 401 to 403 in, including:

[0136] Step 401: Establish a mathematical model of the motor speed of the balance bike.

[0137] Specifically, since after inputting the target speed to the motor, the motor may still need a certain process to actually reach the target speed and will not necessarily immediately reach the desired target speed, the mathematical model of the motor speed established in this embodiment is mainly to show the instantaneous change after the motor is input with the target speed.

[0138] Exemplarily, a given speed, that is, the target speed, can be input to the motor of the balance bike, and the actual speed of the motor at different time points under the action of the given speed can be detected and recorded. Then, according to the recorded actual wheel speeds of the motor at different time points under the action of the given speed, a curve of time and actual wheel speed is fitted. Then, according to this curve, a mathematical model of the motor speed of the balance bike is established. For example, the expression of the curve can be constructed according to the above curve, and the expression of the curve can be used as the expression of the mathematical model of the motor speed.

[0139] Exemplarily, the expression of the above mathematical model of the motor speed is as follows:

[0140]

[0141] Among them, is the first derivative of the actual wheel speed, w u is the target speed, w is the actual wheel speed, and a, b, and c are the inherent parameters of the mathematical model of the motor speed. The a, b, and c can be determined based on the curve of the time and the actual wheel speed obtained by the above fitting. For example, the coefficients of the expression of the curve can be used as a, b, and c.

[0142] Step 402: Establish a second PID model for controlling the deviation between the actual wheel speed and the desired wheel speed to zero.

[0143] Exemplarily, the expression of the above second PID model is as follows:

[0144]

[0145] Among them, P w is the first proportional coefficient of (w int - w), I w is the first integral coefficient of (w int - w), D w is the first differential coefficient of , w r is the desired wheel speed, is the first derivative of the desired wheel speed calculated according to the first preset relationship, and t is the integration duration. The above P w , I w , D w These coefficients can all be pre-adjusted by technicians before the balance bike leaves the factory. Therefore, during the use of the balance bike, if PID adjustment of the wheel speed is required, the above three pre-adjusted coefficients can be directly used. Even if the body mass changes within a certain range, the above first preset relationship and second preset relationship can be used to calculate the target speed that can keep the balance bike balanced, without the need to adjust the P w , I w , D w and other PID parameters.

[0146] Step 403: Construct a second preset relationship according to the mathematical model of the motor speed and the second PID model.

[0147] Specifically, the mathematical model of the motor speed and the second PID model can be fused to obtain the above second preset relationship.

[0148] Exemplarily, the expression of the above second preset relationship is as follows:

[0149]

[0150] Since Therefore, the expression of the above second preset relationship can be as follows:

[0151]

[0152] In the above second preset relationship, P w , I w , D w , a, b, and c are all known quantities. When calculated based on the above first preset relationship to obtain , this along with the actually obtained current wheel speed w and the desired wheel speed w r are substituted into the above second preset relationship, and w u can be calculated.

[0153] In step 204, the target speed calculated according to the above first preset relationship and second preset relationship can be input into the motor of the self-balancing vehicle to control the self-balancing vehicle to run at the target speed, so that the self-balancing vehicle maintains balance.

[0154] Since the second PID model is used to control the deviation between the actual wheel speed and the desired wheel speed to be zero, therefore, the second preset relationship obtained based on the second PID model can enable the self-balancing vehicle to keep the deviation between the actual wheel speed and the desired wheel speed zero under the action of Wu calculated based on the above second preset relationship. And, since the second preset relationship incorporates calculated based on the above first preset relationship. And as can be known from the above description can keep the deviation between the actual pitch angle and the desired pitch angle at 0. Therefore, after inputting Wu calculated based on the second preset relationship into the motor of the self-balancing vehicle, it is beneficial to make both the deviation between the actual wheel speed and the desired wheel speed and the deviation between the actual pitch angle and the desired pitch angle zero, so that the self-balancing vehicle can maintain the balance state and reach the desired wheel speed.

[0155] In this embodiment, since the first preset relationship is used to describe the relationship among the target state parameter, the actual pitch angle, the desired pitch angle, and the first derivative of the desired wheel speed, that is, the target state parameter is integrated in the first preset relationship. Therefore, when the target state parameter changes, the target state parameter, the actual pitch angle, and the desired pitch angle can be directly substituted into the first preset relationship to obtain the first derivative of the desired wheel speed. Then, the first derivative of the desired wheel speed, the actual wheel speed, and the desired wheel speed are substituted into the second preset relationship to obtain the target speed of the balance bike. Then, controlling the balance bike to run at the target speed can maintain the balance state and the desired speed state of the balance bike, without repeatedly adjusting the PID parameters to maintain the balance state and the desired speed state of the balance bike when the target state parameter changes, which is beneficial to improving the robustness.

[0156] In an exemplary embodiment, the principle block diagram of the control method of the balance bike can be referred to Figure 5 , Figure 5 where the vehicle FH controller and the vehicle FL controller can be understood as different control logics. For example, the control logic corresponding to the vehicle FH controller is the above-mentioned first preset relationship, and the control logic corresponding to the vehicle FL controller is the above-mentioned second preset relationship. In a specific implementation, the above-mentioned vehicle FH controller and vehicle FL controller can be one chip or two chips in the balance bike. For example, the different control logics corresponding to the vehicle FH controller and the vehicle FL controller can be integrated in the same chip, or the control logic corresponding to the vehicle FH controller can be integrated in one chip, and the control logic corresponding to the vehicle FL controller can be integrated in another chip.

[0157] Specifically, the expression of the above-mentioned vehicle FH controller can be as follows:

[0158]

[0159] The expression of the above-mentioned vehicle FL controller is as follows:

[0160]

[0161] In a specific implementation, m p can be input into the vehicle FH controller, so as to calculate through the expression of the above-mentioned vehicle FH controller, and then is used as one of the inputs of the vehicle FL controller. Specifically, the desired wheel speed w r can be obtained, and through the integration module, w r and the output of the FH controller are calculated to obtain w int , and then w int and input the actual wheel speed w of the detected scooter (the actual wheel speed feedback by the scooter) into the vehicle FL controller, so as to calculate w through the expression of the above vehicle FL controller u , and input w u into the scooter to control the movement of the scooter, so as to ensure that the scooter can run according to the desired pitch angle and the desired wheel speed at the same time.

[0162] Figure 5 In the embodiment shown, when the vehicle body mass changes, the currently detected vehicle body mass m p can be directly substituted into the expression of the above FH controller for calculation and then further calculate w based on the expression of the FL controller u , so that the scooter can move according to the desired pitch angle and the desired wheel speed under the action of w u , without the need to adjust P w , I w , D w and other PID parameters, and the robustness is stronger.

[0163] Figure 6 FIG. is a schematic structural diagram of a control device for a scooter provided by an embodiment of the present application.

[0164] Exemplarily, as Figure 6 shown, the device includes:

[0165] A first acquisition module 601, configured to acquire the current target state parameters of the scooter; wherein, the above target state parameters include the variable state parameters among the various state parameters of the scooter; a second acquisition module 602, configured to acquire the current actual control parameters and the desired control parameters of the scooter; a calculation module 603, configured to perform calculations according to the above target state parameters, the above actual control parameters, the above desired control parameters and a preset relationship to obtain a target speed; wherein, the above preset relationship is used to describe the relationship between the above target state parameters, the above actual control parameters, the above desired control parameters and the above target speed; a control module 604, configured to control the scooter to run according to the above target speed, so as to keep the scooter in balance.

[0166] In a possible implementation, the above-mentioned actual control parameters include the actual pitch angle and the actual wheel speed, the above-mentioned desired control parameters include the desired pitch angle and the desired wheel speed, the above-mentioned preset relationships include a first preset relationship and a second preset relationship, the first preset relationship is used to describe the relationship between the above-mentioned target state parameters, the above-mentioned actual pitch angle, the above-mentioned desired pitch angle, and the first derivative of the above-mentioned desired wheel speed, and the second preset relationship is used to describe the relationship between the first derivative of the above-mentioned desired wheel speed, the above-mentioned actual wheel speed, the above-mentioned desired wheel speed, and the above-mentioned target speed; the calculation module is specifically configured to: calculate according to the above-mentioned target state parameters, the above-mentioned actual pitch angle, the above-mentioned desired pitch angle, and the first preset relationship to obtain the first derivative of the above-mentioned desired wheel speed; calculate according to the first derivative of the above-mentioned desired wheel speed, the above-mentioned actual wheel speed, the above-mentioned desired wheel speed, and the second preset relationship to obtain the above-mentioned target speed.

[0167] In a possible implementation, the above-mentioned device further includes: a first preset relationship construction module, configured to establish a mathematical model of the inverted pendulum of the body of the above-mentioned self-balancing vehicle; establish a first PID model for controlling the deviation between the actual pitch angle and the desired pitch angle to zero; construct the first preset relationship according to the above-mentioned mathematical model of the inverted pendulum of the body and the above-mentioned first PID model.

[0168] In a possible implementation, the first preset relationship construction module is specifically configured to: convert the above-mentioned mathematical model of the inverted pendulum of the body into a state space equation; linearize the above-mentioned state space equation to obtain a linearized target state space equation; construct the first preset relationship by substituting the above-mentioned target state space equation into the above-mentioned first PID model.

[0169] In a possible implementation, the state parameters of the above-mentioned self-balancing vehicle include: the moment of inertia I of the body about the wheel axis, the body mass m p , the wheel mass m, the distance l from the center of mass of the inverted pendulum to the center of the wheel axis, the wheel radius r, the gravitational acceleration g, and the moment of inertia J of the motor rotor and the load equivalent on the motor axis. The above-mentioned target state parameter includes the above-mentioned body mass, and the expression of the above-mentioned mathematical model of the inverted pendulum of the body is as follows:

[0170]

[0171] Among them, is the above-mentioned actual pitch angle, is the first derivative of the above-mentioned actual pitch angle, is the second derivative of the above-mentioned actual pitch angle, is the first derivative of the above-mentioned actual wheel speed;

[0172] The expression of the above-mentioned first PID model is as follows:

[0173]

[0174] Among them, is the deviation between the actual pitch angle and the expected pitch angle above, is the above first derivative, is the above second derivative, is the above first proportionality coefficient, is the above first integral coefficient, is the above first differential coefficient, is the above second differential coefficient, and t is the integration duration;

[0175] The expression of the above first preset relationship is as follows:

[0176]

[0177] Among them, is the first derivative of the expected wheel speed, is the second derivative of the expected pitch angle.

[0178] In a possible implementation, the above device further includes: a second preset relationship construction module, configured to: establish a mathematical model of the motor speed of the above balance scooter; establish a second PID model for controlling the deviation between the actual wheel speed and the expected wheel speed to zero; construct the above second preset relationship according to the above mathematical model of the motor speed and the above second PID model.

[0179] In a possible implementation, the expression of the above mathematical model of the motor speed is as follows:

[0180]

[0181] Among them, is the first derivative of the above actual wheel speed, w u is the above target speed, w is the above actual wheel speed, and a, b, and c are the inherent parameters of the above mathematical model of the motor speed;

[0182] The expression of the above second PID model is as follows:

[0183]

[0184] Among them, P w is the above (w intThe first-order proportional coefficient of (-w), I w For the above (w int The first-order integral coefficient of (-w), D w For the above The first-order differential coefficient of, w r For the above expected wheel speed, The first derivative of the above expected wheel speed;

[0185] The expression of the above second preset relationship is as follows:

[0186]

[0187] Figure 7 It is a schematic structural diagram of a self-balancing scooter provided by an embodiment of the present application.

[0188] Exemplarily, as Figure 7 shown, the self-balancing scooter includes: a memory 701 and a processor 702. Among them, the memory 701 stores executable program codes, and the processor 702 is used to call and execute the executable program codes to execute a control method of a self-balancing scooter.

[0189] In this embodiment, the self-balancing scooter can be divided into functional modules according to the above method examples. For example, it can correspond to each functional module, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is illustrative, only a logical function division, and there can be other division methods in actual implementation.

[0190] In the case of dividing each functional module corresponding to each function, the self-balancing scooter can include: a first acquisition module, a second acquisition module, a calculation module, a control module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be cited in the function description of the corresponding functional module, and will not be repeated here.

[0191] The self-balancing scooter provided by this embodiment is used to execute the above control method of a self-balancing scooter, so it can achieve the same effect as the above implementation method.

[0192] In the case of adopting an integrated unit, the self-balancing scooter can include a processing module and a storage module. Among them, the processing module can be used to control and manage the actions of the self-balancing scooter. The storage module can be used to support the self-balancing scooter to execute mutual program codes and data, etc.

[0193] Among them, the processing module can be a processor or a controller, which can implement or execute various exemplary logical blocks, modules, and circuits represented in combination with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory.

[0194] This embodiment also provides a computer-readable storage medium, in which computer program code is stored. When the computer program code runs on a computer, it causes the computer to execute the above-related method steps to implement a control method for a scooter in the above embodiment.

[0195] This embodiment also provides a computer program product. When the computer program product runs on a computer, it causes the computer to execute the above-related steps to implement a control method for a scooter in the above embodiment.

[0196] In addition, the scooter provided in the embodiment of this application can specifically be a chip, a component, or a module. The scooter can include a connected processor and a memory; among them, the memory is used to store instructions. When the scooter runs, the processor can call and execute the instructions to cause the chip to execute a control method for a scooter in the above embodiment.

[0197] Among them, the scooter, the computer-readable storage medium, the computer program product, or the chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be elaborated here.

[0198] Through the description of the above embodiments, those skilled in the art can understand that for the convenience and brevity of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0199] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.

[0200] The above content is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present application can easily think of changes or substitutions, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A control method for a self-balancing scooter, characterized in that The method includes: Obtaining the current target state parameters of the segway; wherein, the target state parameters include the variable state parameters among the state parameters of the segway; Obtaining the current actual control parameters and desired control parameters of the segway; Calculating according to the target state parameters, the actual control parameters, the desired control parameters and a preset relationship to obtain a target speed; wherein, the preset relationship is used to describe the relationship among the target state parameters, the actual control parameters, the desired control parameters and the target speed; Controlling the segway to run at the target speed so that the segway maintains balance.

2. The method according to claim 1, characterized in that, The actual control parameters include an actual pitch angle and an actual wheel speed, the desired control parameters include a desired pitch angle and a desired wheel speed, the preset relationship includes a first preset relationship and a second preset relationship, the first preset relationship is used to describe the relationship among the target state parameters, the actual pitch angle, the desired pitch angle and the first derivative of the desired wheel speed, and the second preset relationship is used to describe the relationship among the first derivative of the desired wheel speed, the actual wheel speed, the desired wheel speed and the target speed; The calculating according to the target state parameters, the actual control parameters, the desired control parameters and the preset relationship to obtain the target speed includes: Calculating according to the target state parameters, the actual pitch angle, the desired pitch angle and the first preset relationship to obtain the first derivative of the desired wheel speed; Calculating according to the first derivative of the desired wheel speed, the actual wheel speed, the desired wheel speed and the second preset relationship to obtain the target speed.

3. The method according to claim 2, wherein The first preset relationship is constructed in the following manner: Establishing a mathematical model of the body inverted pendulum of the segway; Establishing a first PID model for controlling the deviation between the actual pitch angle and the desired pitch angle to be zero; Constructing the first preset relationship according to the mathematical model of the body inverted pendulum and the first PID model.

4. The method according to claim 3, characterized in that, The constructing the first preset relationship according to the mathematical model of the body inverted pendulum and the first PID model includes: Converting the mathematical model of the body inverted pendulum into a state space equation; Linearizing the state space equation to obtain a linearized target state space equation; Constructing the first preset relationship by substituting the target state space equation into the first PID model.

5. The method according to claim 3 or 4, characterized in that The state parameters of the scooter include: the moment of inertia I of the vehicle body about the wheel axis, the vehicle body mass m p , the wheel mass m, the distance l from the center of mass of the inverted pendulum to the center of the wheel axis, the wheel radius r, the moment of inertia J of the motor rotor and the load equivalent on the motor axis. The target state parameter includes the vehicle body mass. The expression of the mathematical model of the vehicle body inverted pendulum is as follows: where g is the acceleration due to gravity, is the actual pitch angle, is the first derivative of the actual pitch angle, is the second derivative of the actual pitch angle, is the first derivative of the actual wheel speed; The expression of the first PID model is as follows: wherein, is the deviation between the actual pitch angle and the desired pitch angle, is the first derivative, is the second derivative, is the first proportionality coefficient, is the first integral coefficient, is the first differential coefficient, is the second differential coefficient, and t is the integration duration; The expression of the first preset relationship is as follows: wherein, is the first derivative of the desired wheel speed, is the second derivative of the desired pitch angle.

6. The method according to claim 2, wherein The second preset relationship is constructed in the following manner: Establishing a mathematical model of the motor speed of the segway; Establishing a second PID model for controlling the deviation between the actual wheel speed and the desired wheel speed to be zero; Constructing the second preset relationship according to the mathematical model of the motor speed and the second PID model.

7. The method according to claim 6, wherein The expression of the mathematical model of the motor speed is as follows: Among them, is the first derivative of the actual wheel speed, w u is the target speed, w is the actual wheel speed, and a, b, and c are the inherent parameters of the mathematical model of the motor speed; The expression of the second PID model is as follows: Among them, P w is the first-order proportional coefficient of the said (w int - w), I w is the first-order integral coefficient of the said (w int - w), D w is the first-order differential coefficient of the said , w r is the expected wheel speed, is the first derivative of the expected wheel speed calculated according to the said first preset relationship, and t is the integration duration; The expression of the second preset relationship is as follows:

8. A control device for a self-balancing scooter, characterized in that, The device includes: A first acquisition module, configured to acquire current target state parameters of the self-balancing vehicle; wherein, the target state parameters include variable state parameters among the state parameters of the self-balancing vehicle; A second acquisition module, configured to acquire current actual control parameters and desired control parameters of the self-balancing vehicle; A calculation module, configured to calculate a target rotation speed according to the target state parameters, the actual control parameters, the desired control parameters and a preset relationship; wherein, the preset relationship is used to describe the relationship among the target state parameters, the actual control parameters, the desired control parameters and the target rotation speed; A control module, configured to control the self-balancing vehicle to run at the target rotation speed so as to keep the self-balancing vehicle in balance.

9. A self-balancing scooter, characterized in that, The self-balancing vehicle includes: A memory, configured to store executable program codes; A processor, configured to call and run the executable program codes from the memory, so that the self-balancing vehicle executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which when executed, implements the method according to any one of claims 1 to 7.