A balance car control method based on non-singular terminal sliding mode active disturbance rejection technology
By using non-singular terminal sliding mode active disturbance rejection technology, a self-balancing vehicle system model and observer are constructed, and a sliding mode controller is designed. This solves the steady-state problem of traditional control algorithms under model uncertainty and realizes stable control of the two-wheeled self-balancing vehicle under disturbance.
Patent Information
- Application Number
- CN202311036424.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-15
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2043-08-15
AI Technical Summary
Traditional control algorithms struggle to maintain steady-state operation when faced with model uncertainties in two-wheeled self-balancing vehicles, especially when the load changes dynamically, resulting in poor control performance or even an inability to maintain stability.
By employing non-singular terminal sliding mode active disturbance rejection technology, a non-singular terminal sliding mode controller is designed by constructing a self-balancing vehicle system model and a nonlinear extended state observer. Combined with a PID controller and an extended state observer, a closed-loop control system is formed to achieve real-time compensation for disturbances.
It achieves steady-state control of the self-balancing vehicle under various disturbances, improves the system's stability and response speed, and enables it to quickly recover and maintain stability.
Smart Images

Figure CN116954059B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of balance car control, and particularly relates to a balance car control method based on a non-singular terminal sliding mode active disturbance rejection technology. BACKGROUND
[0002] The double-wheel balance car is a highly unstable system and a complex dynamic system, and needs to be balanced through an accurate control algorithm. Research on the double-wheel balance car faces technical challenges such as nonlinearity, multivariable, strong coupling, and the like, and innovative control strategies need to be designed to solve these problems.
[0003] The double-wheel balance car has very wide application prospects, and its commercial value is unlimited. In the field of personal travel, the double-wheel balance car can be regarded as an efficient urban transportation tool, providing people with sustainable and green travel options. In the field of warehouse logistics, the double-wheel balance car can realize intelligent navigation and goods carrying, and improve work efficiency. In the field of robot navigation, the double-wheel balance car can be used for autonomous navigation and environment perception, and has the characteristics of intelligent robots.
[0004] Due to the advantages of the double-wheel balance car, many companies have developed and sold the double-wheel balance car. In general, the double-wheel balance car can not only be used for theoretical research, but also be sold as a commodity, thereby creating certain economic benefits. Therefore, the research on the double-wheel balance car is very meaningful. However, the balance car is a strong disturbance system, and has high requirements for stability and regulation time. The traditional control method has poor suppression effect on disturbance. For example, the balance car is difficult to maintain a steady state when encountering uncertain ground friction, uncertain slope, uncertain wind direction, uncertain balance car load, uncertain motor aging model, and uncertain mechanical median change. Especially when the load is dynamically changing, i.e., the model is dynamically changing, the traditional control algorithm has limitations, the control effect is not good, and even the steady state cannot be maintained, which may cause serious consequences. SUMMARY
[0005] In order to solve the technical problem that the traditional control algorithm has poor control effect and cannot maintain a steady state, the present application provides a balance car control method based on a non-singular terminal sliding mode active disturbance rejection technology, which comprises the following steps:
[0006] S1, constructing a balance car system model;
[0007] S2, based on the balance car system model, constructing a corresponding nonlinear extended state observer;
[0008] S3, designing a control rate of a non-singular terminal sliding mode controller NTSM;
[0009] S4, the target position v1 of the balance car is subtracted from the displacement output y1 of the balance car system model, and then input to a PID controller to obtain a target angle v2;
[0010] S5, the angle output y2 of the balance car system model is observed by using a nonlinear extended state observer to obtain observed states Z1, Z2 and Z3;
[0011] S6, the target angle v2, the state Z1 and the state Z2 are input to a non-singular terminal sliding mode controller NTSM to obtain an output signal u0;
[0012] S7, the output signal u0 is subtracted from the state Z3, and then subjected to a linearization processing to obtain a control signal u;
[0013] S8, the control signal u is used to control the displacement output y1 and the angle output y2 of the balance car system model, and is input to the nonlinear extended state observer to form a closed loop control.
[0014] A storage device stores instructions and data for implementing a balance car control method based on a non-singular terminal sliding mode active disturbance rejection technology.
[0015] A balance car control device based on a non-singular terminal sliding mode active disturbance rejection technology comprises a processor and the storage device; the processor loads and executes the instructions and data in the storage device to implement a balance car control method based on a non-singular terminal sliding mode active disturbance rejection technology.
[0016] The application has the beneficial effect of precise control and keeping the balance car in a steady state under various disturbances. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 is a method flowchart of the application;
[0018] Figure 2 is a control block diagram of the application;
[0019] Figure 3 is an inverted pendulum model;
[0020] Figure 4 is a non-singular terminal sliding mode active disturbance rejection balance car angle control simulation diagram;
[0021] Figure 5 is a cascade non-singular terminal sliding mode active disturbance rejection balance car position control simulation diagram;
[0022] Figure 6 is a balance car angle control disturbance suppression simulation comparison diagram;
[0023] Figure 7This is a diagram illustrating the upright control effect of a self-balancing scooter;
[0024] Figure 8 This is a schematic diagram illustrating the self-balancing scooter's ability to control external disturbances.
[0025] Figure 9 This is a schematic diagram of the hardware device of the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0027] Please refer to Figures 1-2 , Figure 1 This is a schematic diagram of the method flow of the present invention. Figure 2 This is the control block diagram in this invention.
[0028] This invention provides a self-balancing vehicle control method based on non-singular terminal sliding mode active disturbance rejection technology, comprising:
[0029] S1. Construct a model of the self-balancing scooter system;
[0030] It should be noted that a two-wheeled self-balancing scooter can generally be compared to an inverted pendulum model; please refer to [the relevant documentation / reference]. Figure 3 , Figure 3 This is an inverted pendulum model. The physical quantities in the model are: cart mass M, pendulum mass m, distance from the pendulum's center of gravity to the joint L, pendulum moment of inertia I, damping coefficient b, force on the cart F, cart position x, angle θ between the pendulum and the vertically downward direction, P is the vertical component of the force exerted by the pendulum on the joint, and N is the horizontal component.
[0031] The force analysis of the trolley in the horizontal direction is as follows:
[0032]
[0033] The force analysis of the pendulum in the horizontal direction is as follows:
[0034]
[0035] Right now
[0036]
[0037] The force analysis of the pendulum in the vertical direction is as follows:
[0038]
[0039] That is to say:
[0040]
[0041] For joint moments, the following moment balance equation holds.
[0042]
[0043] Linearizing locally at θ=0 gives sinθ≈0, cosθ≈1, In general we want the pendulum to be upright in the system, so let φ=π+θ, then we have
[0044]
[0045]
[0046] Taking Laplace transform of the above two equations gives
[0047] (I+ml 2 )Φ(s)s 2 -mglΦ(s)=mlX(s)s 2
[0048] (M+m)X(s)s 2 +bX(s)s-mlΦ(s)s 2 =U(s)
[0049] The transfer function of the pendulum angle to the input is then
[0050]
[0051] The transfer function of the cart position to the input is
[0052]
[0053] where q=(M+m)(I+ml 2 )-(ml) 2
[0054] Substitute the tentative simulation parameters: cart mass 0.5 kg; pendulum mass 0.2 kg; damping coefficient 0.1%; pendulum moment of inertia 0.018; gravitational acceleration 9.8; pendulum length 0.6 m. We have
[0055]
[0056]
[0057] Convert to state space description and let p=I(M+m)+MmL 2 , then
[0058]
[0059]
[0060] with the parameters brought in
[0061]
[0062]
[0063] The states x1, x2, x3, x4 are respectively: trolley position, trolley acceleration, pendulum angle, pendulum angular velocity.
[0064] S2, based on the balance car system model, construct its corresponding nonlinear extended state observer;
[0065] As an embodiment, according to the above balance car system model:
[0066]
[0067] It can be rewritten as the relationship between angle and control input as follows,
[0068]
[0069] Simplifying the above formula can obtain:
[0070]
[0071] That is
[0072]
[0073] So there is
[0074]
[0075] According to the idea of extended state observer, the affine nonlinear model of the angle system is written as follows:
[0076]
[0077] Where ω is the external disturbance and unmodeled dynamic set, b0 is the input extended state observer input coefficient.
[0078] There is
[0079]
[0080] The following nonlinear extended state observer is designed
[0081]
[0082] Where the source of fal is to avoid the emergence of high-frequency chatter phenomenon, and the function |e| α sign(e) is changed into a continuous power function with a linear segment near the origin. That is
[0083]
[0084] The angle and the state error of the observer itself are taken as inputs in the extended state observer, where z1, z2, f φ respectively refer to the angle observation value, the angular velocity observation value, the angle disturbance observation value, i.e. the observation value of
[0085] S3, design the control rate of the non-singular terminal sliding mode controller NTSM;
[0086] It should be noted that according to the affine nonlinear model of the angle system derived above, we have the observed integral concatenation system as follows
[0087]
[0088] Where u0 is the output of the nonlinear feedback controller.
[0089] For the rewritten integral concatenation system, consider the unobserved disturbance error, denoted as g(φ, d), which satisfies |g(φ, d)| < l, l is a known upper bound, then we have the following integral concatenation system
[0090]
[0091] Design the following non-singular terminal sliding surface
[0092]
[0093] The control rate is designed as
[0094]
[0095] S4, the target position v1 of the balance car is subtracted from the displacement output y1 of the balance car system model, and then input to the PID controller to obtain the target angle v2;
[0096] S5, the angle output y2 of the balance car system model is observed by using the nonlinear extended state observer to obtain the observed states Z1, Z2 and Z3;
[0097] S6, the target angle v2, the state Z1 and the state Z2 are input to the non-singular terminal sliding mode controller NTSM to obtain the output signal u0;
[0098] S7, the output signal u0 is subtracted from the state Z3, and then after a linearization processing, the control signal u is obtained.
[0099] S8, the control signal u acts on the balance car system model on one hand, controls the displacement output y1 and the angle output y2; on the other hand, input to the nonlinear extended state observer, finally forms a closed loop control.
[0100] As an embodiment, the parameters of the control method designed by the application are shown in Table 1.
[0101] Table 1 Simulation parameters of control method
[0102]
[0103] The simulation of the non-singular terminal sliding mode active disturbance balancing car angle control is as shown in the figure. Figure 4 The total simulation time is 4 seconds, and the initial angle is The target angle is a step signal, and after 2 seconds, it changes from 0 to The simulation results show that the controller can make the balance car stabilize at the target angle within 1 second.
[0104] The simulation of the non-singular terminal sliding mode active disturbance balancing car position control is as shown in the figure. Figure 5 The total simulation time is 60 seconds, and the initial state is 0, and the target position control is a step signal, which changes from 6 to 0 to-6 at 20 seconds and 40 seconds. The target angle signal is the control output of the PID outer position loop. The simulation results show that the balance car displacement can stabilize at the target position within 10 seconds, and the angle loop tracking effect is good.
[0105] The disturbance suppression comparison is as shown in the figure. Figure 6 PID, LADRC and NTSM-ESO are selected, and the PID parameters are selected as
[0106] k p =60, k i =100, k d =10, the LADRC parameters are selected as ω c =6, ω o =55, b0=2.6, and the controller output is limited within 100, that is, the actuator output will not exceed 10 Newton, the initial angle state is set to-20°, the target is 0°, and after reaching the steady state at the third second, a disturbance tension of 2.5 Newton is applied, and the time for the balance car to recover to steady state and the disturbance suppression ability are observed.
[0107] We can clearly see that NTSM-ESO has the fastest convergence speed and the strongest disturbance suppression ability, followed by traditional LADRC, and PID has the slowest convergence speed and the weakest disturbance suppression ability.
[0108] After the design and simulation of the controller is completed, the NTSM-ESO algorithm is designed and implemented on a double-wheel balance car based on STM32, the speed of the motor is changed by controlling the pwm value of the two-wheel motor of the car, so as to control the acceleration of the car to change the driving force of the car, so as to realize the control of the balance car. In the double-wheel balance car, the core controller is STM32F103C8T6 development board. In addition, there are many external devices, including MPU6050 six-axis sensor, Bluetooth module, ultrasonic module, OLED display and motor.
[0109] In the data measured by the sensor, there is a large amount of uncertainty, including a large amount of noise conforming to normal distribution, which has a great influence on the accuracy and reliability of the data. For the double-wheel balance car system, if the uncertainty conforms to the normal distribution, we can use Kalman filtering algorithm to realize angle estimation.
[0110] Subtract the car angle Angle obtained after Kalman filtering from the target angle Middle_angle to obtain the deviation angle Angle_bias of the car, that is, the angle deviation of the system, observe the angle deviation by using the extended state observer to obtain the total disturbance z3 of the whole system, and then subtract the total disturbance estimation to obtain the upright control amount, that is, the PWM value required by the angle control motor. Figure 7 For the car angle waveform read by the host computer, the car is fixed at about 65 degrees, and the angle difference with the upright state is 35 degrees. The car is started at t=30, and the car returns to the upright state at t=40, and then remains, realizing the control of the angle.
[0111] The suppression effect of the car on the load and external disturbance is simulated by adding weight to the car and suddenly applying a force to the car. Whether the load is suddenly increased or disturbed externally, the car can quickly return to normal. As shown in Figure 8 The angle of the car can quickly return to normal when the external disturbance is applied to the car at three different times.
[0112] Please refer to Figure 9 , Figure 9 is a hardware device working schematic diagram of the application;
[0113] The hardware device specifically comprises a balance car control device 401 based on a non-singular terminal sliding mode active disturbance rejection technology, a processor 402 and a storage device 403.
[0114] The balance car control device 401 based on the non-singular terminal sliding mode active disturbance rejection technology: the balance car control device 401 based on the non-singular terminal sliding mode active disturbance rejection technology realizes the balance car control method based on the non-singular terminal sliding mode active disturbance rejection technology.
[0115] The processor 402 loads and executes instructions and data in the storage device 403 for implementing the balance car control method based on the non-singular terminal sliding mode active disturbance rejection technology.
[0116] The storage device 403 stores instructions and data; the storage device 403 is used for implementing the balance car control method based on the non-singular terminal sliding mode active disturbance rejection technology.
[0117] The application has the beneficial effect that precise control can be achieved, and the balance car is kept in a steady state under various disturbances.
[0118] The above description is only the preferred embodiment of the application, and is not intended to limit the application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the application shall be included in the protection scope of the application.
Claims
1. A balance car control method based on a non-singular terminal sliding mode active disturbance rejection technology, characterized in that: The method comprises the following steps: S1, constructing a balance car system model; S2, constructing a corresponding nonlinear extended state observer based on the balance car system model; Step S2 is specifically as follows: S21, rewriting the balance car system model into a relationship model between angle and control input; S22, according to the extended state observer idea, expressing the relationship model between angle and control input as an affine nonlinear model; S23, designing a nonlinear extended state observer according to the affine nonlinear model; S3, designing a control rate of a non-singular terminal sliding mode controller NTSM; S4, inputting the difference between the target position v1 of the balance car and the displacement output y1 of the balance car system model into a PID controller to obtain a target angle v2; S5, observing the angle output y2 of the balance car system model by using the nonlinear extended state observer to obtain observed states Z1, Z2 and Z3; S6, inputting the target angle v2, the state Z1 and the state Z2 into the non-singular terminal sliding mode controller NTSM to obtain an output signal u0; S7, inputting the output signal u0 into the state Z3, and then performing linearization processing to obtain a control signal u; S8, the control signal u is used to control the displacement output y1 and the angle output y2 of the balance car system model, and is also input into the nonlinear extended state observer to finally form a closed-loop control; In step S3, the control rate of the non-singular terminal sliding mode controller NTSM is designed as follows: S31, the integral cascade system of the observed affine nonlinear model is as follows: wherein, u 0 is the output signal of the non-singular terminal sliding mode controller NTSM, i.e. the control rate; S32. For the integral cascade system described in step S31, introduce an incompletely observed disturbance error. The resulting integral cascade system with introduced error is shown in the following equation: S33, according to the integral cascade system after introducing the error, a non-singular terminal sliding surface is designed as follows: wherein, 0 is a constant to be designed, p and q is a positive odd integer, the control rate is designed as: 。 2. The balance car control method based on the non-singular terminal sliding mode active disturbance rejection technology according to claim 1, characterized in that: In step S1, the balance car system model adopts an inverted pendulum model, which is specifically as follows: Wherein, the balance car mass is M; the pendulum mass is m, the pendulum rotational inertia is I, and the damping coefficient is b; x represents the balance car position; F is the force received by the balance car; ; θ is the angle between the pendulum and the vertical downward direction; g is the acceleration of gravity; and u is the control input of the balance car system model.
3. The balance car control method based on the non-singular terminal sliding mode active disturbance rejection technology according to claim 1, characterized in that: The relationship model between angle and control input is as follows: 。 4. The balance car control method based on the non-singular terminal sliding mode active disturbance rejection technology according to claim 3, characterized in that: The affine nonlinear model is as follows: wherein, is a set of external disturbances and unmodeled dynamics, is an input augmented state observer input coefficient; 。 5. The balance car control method based on the non-singular terminal sliding mode active disturbance rejection technology according to claim 4, characterized in that: The nonlinear extended state observer is specifically as follows: wherein fal is the function transformed into a continuous power function with a linear segment in the vicinity of the origin, as follows: ; respectively refer to the angle observation, the angular velocity observation, and the angle disturbance observation output by the balance car system model; β 01 , β 02 , β 03 are parameters of the nonlinear extended state observer.
6. A storage device, characterized by: The storage device stores instructions and data for realizing the balance car control method based on the non-singular terminal sliding mode active disturbance rejection technology according to any one of claims 1-5.
7. A balance car control device based on a non-singular terminal sliding mode active disturbance rejection technology, characterized in that: It comprises: A processor and a storage device; the processor loads and executes the instructions and data in the storage device to realize the balance car control method based on the non-singular terminal sliding mode active disturbance rejection technology according to any one of claims 1-5.
Citation Information
Patent Citations
Path tracking control method of intelligent vehicle
CN107831761A
Balance car control method based on enhanced error model
CN112486191A