A self-balancing vehicle control method, system, storage medium and electronic device

The kinetic energy and potential energy functions of the self-balancing bike are estimated through neural networks, combined with the Euler-Lagrangian equation for state estimation, and a damped PD controller is designed to solve the problem of dependence on precise mechanical models and data quantity requirements in the existing technology, and achieve more efficient self-balancing bike control.

CN116300465BActive Publication Date: 2025-06-10ZHEJIANG TAOTAO VEHICLES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310310932.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-28
Publication Date
2025-06-10
Estimated Expiration
2043-03-28

AI Technical Summary

Technical Problem

The existing self-balancing vehicle control technology relies on accurate mechanical models, and deep learning and reinforcement learning methods have shortcomings in data volume and interpretability, making it difficult to effectively adapt to the dynamic environment.

Method used

By building a neural network to estimate the kinetic energy function and potential energy function of the self-balancing bike, calculate the Lagrangian quantity, and use the Euler-Lagrangian equation to perform vector field and state estimation, adjust the neural network parameters to design a damped PD controller to achieve stable equilibrium of the system state.

Benefits of technology

Reliance on precise mechanical models is reduced, the robustness and adaptability of the control algorithm is improved, the requirements for data sample size are reduced, and the training efficiency of neural networks and controller design are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116300465B_ABST
    Figure CN116300465B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of self-balancing vehicle control, and discloses a self-balancing vehicle control method, system, storage medium and electronic device, including: collecting actual operation state data of the self-balancing vehicle; estimating the Lagrangian of the system by using a neural network learning system; obtaining an estimated vector field of the system and calculating an estimated system state by using the Euler-Lagrange equation; updating the neural network parameters by using the backpropagation algorithm to obtain an accurate estimate of the Lagrangian; designing a damped PD controller according to the accurate Lagrangian to achieve accurate control of the self-balancing vehicle. This method reduces the dependence of controller design on an accurate model of the system, improves the robustness of the controller to an uncertain model and the adaptability to a dynamic model; the learning framework of the Lagrangian neural network is based on physical information, improves the interpretability of controller design, and reduces the requirement for the amount of data in the learning process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of self-balancing vehicle control, and in particular to a self-balancing vehicle control method, system, storage medium and electronic device. Background Art

[0002] As a short-distance transportation tool, the self-balancing vehicle is of great significance for alleviating urban traffic congestion and promoting the low-carbon transformation and green upgrading of the transportation field. Due to its advantages of light weight, compact structure and flexibility, the self-balancing vehicle is suitable for use in environments with restricted roads and is gradually becoming a popular means of transportation among urban youths.

[0003] The model of the self-balancing vehicle is an inverted pendulum model, which is a typical controlled object in the field of nonlinear control. Classical control algorithms such as PID control, LQR control, observer control and sliding mode control have been used for the control of self-balancing vehicles and have achieved certain effects; through robust control and adaptive control, the controller has been significantly improved in terms of uncertainty, robustness and adaptability to dynamic environments; the above control and analysis methods rely on the accurate model of the system model. With the development of deep learning methods and neural network technologies, the learning modeling and control of self-balancing vehicles have received attention, and algorithms for deep learning modeling and reinforcement learning control have been proposed; the learning control method reduces the dependence of the control algorithm on the model; however, the deep learning method has high requirements for the amount of data and insufficient interpretability, and the reinforcement learning has low efficiency and insufficient generalization ability. Summary of the Invention

[0004] The purpose of this application is to overcome the deficiencies of the prior art and provide a self-balancing vehicle control method, system, storage medium and electronic device.

[0005] In a first aspect, a self-balancing vehicle control method is provided, including:

[0006] S101. Obtain the historical data Data during the operation of the self-balancing vehicle;

[0007] S102. Build a neural network to obtain the estimated kinetic energy function T θ and the estimated potential energy function V θ ;

[0008] S103. Calculate the estimated Lagrangian L of the system according to the estimated kinetic energy function T θ and the estimated potential energy function V θ ; θ ;

[0009] S104. Calculate the estimated vector field X of the system according to the historical data Data using the Euler-Lagrange equation, and obtain the estimated state Φ of the system through integration θ , θ, and calculate the estimation error ΔΦ of the system state;

[0010] S105. Adjust the parameters θ of the neural network according to the estimation error;

[0011] S106. Repeat steps S102 - S105, and execute step S107 in response to the parameters θ converging to a stable value;

[0012] S107. Design a damped PD controller according to the accurate estimation of the Lagrangian;

[0013] S108. Make the system state converge to a stable equilibrium point through the damped PD controller.

[0014] Furthermore, the historical data Data includes the tilt angle φ, tilt angular velocity translation speed and the control input u of the system during the operation process of the controlled self - balancing vehicle under the action of the control input.

[0015] Furthermore, the neural network includes an input layer, a hidden layer, and an output layer. The input layer is the historical data The output layer is the estimated system kinetic energy function T θ and the estimated potential energy function V θ , and by performing a difference operation on the output layer, the estimated Lagrangian L of the system is obtained θ , where L θ = T θ - V θ , and the optimal parameters θ of the neural network are obtained through dynamic learning by the backpropagation algorithm.

[0016] Furthermore, the Euler - Lagrange equation is specifically formulated as the formula of the controlled self - balancing vehicle model:

[0017]

[0018]

[0019] Expand formula (1) to:

[0020]

[0021]

[0022] Solve formula (2) to obtain the vector field estimation:

[0023]

[0024] Furthermore, the state estimation Φ of the system is obtained by integration θ The process of the integration described in is:

[0025]

[0026] Furthermore, the formula for calculating the estimation error ΔΦ of the system state is:

[0027]

[0028] Furthermore, in adjusting the parameters θ of the neural network according to the estimation error, the adjustment formula of the neural network is:

[0029]

[0030] where E = ||ΔΦ|| 2 is the error function, and η is the step size of parameter adjustment.

[0031] Furthermore, the judgment basis for the parameter θ to converge to a stable value is: E ≤ ε.

[0032] Furthermore, the conditions satisfied by the damped PD controller are:

[0033]

[0034] The conditions are achieved by designing the control input u PD as follows:

[0035]

[0036] wherein, the solution process of the damped PD controller is: obtained by formula (3) the expression of u PD and substituting into the expression so that the Euler-Lagrange equation with respect to φ satisfies formula (7), and then inversely solving the damped PD controller u PD .

[0037] Furthermore, in making the system state converge to a stable equilibrium point through the damped PD controller, the process of the system state convergence is: under the action of the damped PD controller, the tilt angle of the self-balancing vehicle shows a damped oscillation process, so that the tilt angle and angular velocity of the self-balancing vehicle converge to a stable equilibrium point Under this condition, the PD control input of the system is zero. According to formula (3), it can be known that the translational acceleration of the self-balancing vehicle with the speed of the self-balancing vehicle remaining constant

[0038] In the second aspect, a self-balancing vehicle control system is provided, including:

[0039] A sensor module for collecting data during the operation of a self-balancing vehicle, where the data includes the tilt angle φ, tilt angular velocity translation speed and the control input u of the system;

[0040] A drive module for driving the self-balancing vehicle;

[0041] A data storage module for storing historical data during the operation of the self-balancing vehicle

[0042] A data processing module for implementing the method described in any one of the implementation manners in the first aspect, and controlling the operation of the drive module based on the designed PD controller with damping.

[0043] In a third aspect, a computer-readable storage medium is provided, where the computer-readable medium stores program code for a device to execute, and the program code includes steps for executing the method in any one of the implementation manners in the first aspect.

[0044] In a fourth aspect, an electronic device is provided, where the electronic device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor, and when the program or instruction is executed by the processor, the method in any one of the implementation manners in the first aspect is implemented.

[0045] This application has the following beneficial effects:

[0046] 1. The present invention estimates the model of the self-balancing vehicle through a neural network, reducing the dependence on an accurate mechanical model, and improving the robustness of the control algorithm to model uncertainties and the self-adaptability of the dynamic model;

[0047] 2. The present invention realizes vector field estimation and state estimation through the Lagrangian, reducing the requirement for the amount of data samples and improving the training efficiency of the neural network;

[0048] 3. In the present invention, the PD controller is designed according to the accurate Lagrangian, improving the efficiency of controller design. Description of the Drawings

[0049] The drawings constituting a part of this application are used to provide a further understanding of this application. The schematic embodiments of this application and their descriptions are used to explain this application and do not constitute an improper limitation of this application.

[0050] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.

[0051] Figure 1 is a flowchart of the self-balancing vehicle control method according to Embodiment 1 of the present application;

[0052] Figure 2 is a model structure diagram for describing the mechanical structure of the self-balancing vehicle in the self-balancing vehicle control method according to Embodiment 1 of the present application;

[0053] Figure 3 is a Lagrangian neural network framework diagram in the self-balancing vehicle control method according to Embodiment 1 of the present application;

[0054] Figure 4 is a structural block diagram of the self-balancing vehicle control system according to Embodiment 2 of the present application.

[0055] Reference numerals:

[0056] 1, sensor module; 2, drive module; 3, data storage module; 4, data processing module. Specific embodiments

[0057] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0058] Embodiment 1

[0059] A self-balancing vehicle control method according to Embodiment 1 of the present application includes: S101, obtaining historical data Data during the operation of the self-balancing vehicle; S102, building a neural network to obtain an estimate T of the kinetic energy function of the system θ and an estimate V of the potential energy function θ ; S103, calculating an estimate L of the Lagrangian of the system according to the estimate T of the kinetic energy function θ and the estimate V of the potential energy function θ ; S104, calculating an estimate X of the vector field of the system according to the historical data Data using the Euler-Lagrange equation θ ; and obtaining an estimate Φ of the state of the system through integration θ θ, and calculate the estimation error ΔΦ of the system state; S105. Adjust the parameters θ of the neural network according to the estimation error; S106. Repeat steps S102 - S105, and execute step S107 when the parameters θ converge to a stable value; S107. Design a damped PD controller according to the accurate estimation of the Lagrangian; S108. Make the system state converge to a stable equilibrium point through the damped PD controller. The present invention estimates the model of the self-balancing vehicle through a neural network, reduces the dependence on the accurate mechanical model, improves the robustness of the control algorithm to model uncertainty and the self-adaptability of the dynamic model; realizes vector field estimation and state estimation through the Lagrangian, reduces the requirement for the amount of data samples, and improves the training efficiency of the neural network; completes the design of the PD controller according to the accurate Lagrangian, and improves the design efficiency of the controller.

[0060] Specifically, Figure 1 FIG. shows the flowchart of the self-balancing vehicle control method in the first embodiment of the application, including:

[0061] S101. Obtain the historical data Data of the running process of the self-balancing vehicle;

[0062] Specifically, Figure 2 FIG. shows the model structure of the mechanical structure of the self-balancing vehicle, and the historical data Data includes the tilt angle φ, tilt angular velocity translation speed and the control input u of the system, that is,

[0063] S102. Build a neural network to obtain the estimated kinetic energy function T of the system θ and the potential energy function V θ ;

[0064] Specifically, please refer to Figure 3 , the neural network includes an input layer, a hidden layer and an output layer, the input layer is the historical data the output layer is the estimated kinetic energy function T of the system θ and the estimated potential energy function V θ .

[0065] S103. Calculate the estimated Lagrangian L of the system according to the estimated kinetic energy function T θ and the potential energy function V θ ; θ ;

[0066] Specifically, by taking the difference between the estimated kinetic energy function T θ and the potential energy function V θ to obtain the estimated Lagrangian L of the system θ , that is, Lθ = T θ - V θ The optimal parameters θ of the neural network are obtained through dynamic learning by the backpropagation algorithm.

[0067] S104. Calculate the vector field estimate X of the system according to the historical data Data using the Euler - Lagrange equation θ and obtain the state estimate Φ of the system by integration θ and calculate the estimated error ΔΦ of the system state;

[0068] Specifically, the Euler - Lagrange equation is concretized into a controlled self - balancing vehicle model, which can be expressed as:

[0069]

[0070]

[0071] Further expand formula (1) to:

[0072]

[0073]

[0074] Solve formula (2) to obtain the vector field estimate:

[0075]

[0076] In a further embodiment, the state estimate Φ of the system is obtained by integration θ The process of the integration described above is:

[0077]

[0078] In a further embodiment, the formula for calculating the estimated error ΔΦ of the system state is:

[0079]

[0080] S105. Adjust the parameters θ of the neural network according to the estimated error;

[0081] Specifically, in adjusting the parameters θ of the neural network according to the estimated error, the adjustment formula of the neural network is:

[0082]

[0083] where E = ||ΔΦ|| 2 is the error function, and η is the step size of parameter adjustment.

[0084] S106. Repeat steps S102 - S105, and execute step S107 in response to the parameter θ converging to a stable value;

[0085] Specifically, the end condition for the process of repeating steps S102 - S105 is: E ≤ ε. That is, when E ≤ ε, the parameter θ converges to a stable value. At this time, stop repeating steps S102 - S105 and execute step S107; when E > ε, the parameter θ is determined not to have converged to a stable value, and at this time, continue to repeat steps S102 - S105.

[0086] It should be noted that if the condition E ≤ ε is satisfied, the update and adjustment of the parameter are stopped. At this time, the parameter is the optimal estimated parameter, corresponding to the optimal estimate of the Lagrangian.

[0087] S107. Design a damped PD controller according to the accurate estimate of the Lagrangian;

[0088] Specifically, the damped control mentioned needs to satisfy:

[0089]

[0090] This goal can be achieved by designing the control input u PD as follows:

[0091]

[0092] The solution process of this controller is as follows: Obtain the expression for u PD through formula (3), and substitute into the expression, so that the Euler - Lagrange equation for φ satisfies formula (7), and then solve for the controller u PD inversely. This design and solution process is based on the estimated Lagrangian L θ and does not require prior knowledge of the system model.

[0093] S108. Use the damped PD controller to make the system state converge to a stable equilibrium point;

[0094] Specifically, in the process of making the system state converge to a stable equilibrium point by using the damped PD controller, the process of the system state convergence is as follows: Under the action of the damped PD controller, the tilt angle of the self - balancing vehicle shows a damped oscillation process, so that the tilt angle and angular velocity of the self - balancing vehicle converge to a stable equilibrium point Under this condition, the PD control input of the system is zero. According to formula (3), it can be known that the translational acceleration of the self - balancing vehicle with the speed of the self - balancing vehicle remaining constant

[0095] In summary, the present application adopts a learning control method combining neural network and Lagrangian mechanics, realizes the accurate estimation of the Lagrangian of the self-balancing vehicle, and based on this estimation, realizes the accurate control of the self-balancing vehicle. The data-driven control method ensures the robustness of the controller design against uncertainties and the self-adaptability to dynamic environments; the Lagrangian mechanics model reduces the cost of the learning process and improves the efficiency of the learning process. The present application provides a new idea for the modeling and control of self-balancing vehicles, and improves the flexibility and accuracy of the controller design process by using a learning control method integrating physical information.

[0096] Embodiment 2

[0097] As Figure 4 shown, a self-balancing vehicle control system involved in Embodiment 2 of the present application includes:

[0098] A sensor module 1 for collecting data during the operation of the self-balancing vehicle. The data includes the tilt angle φ, the tilt angular velocity the translational velocity and the control input u of the system. Specifically, the sensor module 1 includes a gyroscope for sensing the tilt angle and tilt angular velocity of the self-balancing vehicle and an encoder for measuring the translational velocity of the self-balancing vehicle;

[0099] A drive module 2 for driving the self-balancing vehicle. Exemplarily, the drive module 2 is the drive motor of the self-balancing vehicle and the controller of the drive motor;

[0100] A data storage module 3 for storing historical data during the operation of the self-balancing vehicle including: tilt angle, tilt angular velocity, translational velocity, and system control input, etc. The data storage module 3 also stores program code for device execution, and this program code includes steps for executing the method in any one of the implementation manners in Embodiment 1 of the present application;

[0101] A data processing module 4 for implementing the method described in any one of the implementation manners in Embodiment 1, and controlling the operation of the drive module 2 based on the designed PD controller with damping, so as to be able to control the rotational speed of the drive motor through the calculated PD controller.

[0102] Embodiment 3

[0103] A computer-readable storage medium involved in Embodiment 3 of the present application, the computer-readable medium stores program code for device execution, and this program code includes steps for executing the method in any one of the implementation manners in Embodiment 1 of the present application;

[0104] Among them, the computer-readable storage medium can be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM); the computer-readable storage medium can store program codes, and when the program stored in the computer-readable storage medium is executed by a processor, the processor is used to execute the steps of the method in any implementation manner in the first embodiment of the present application.

[0105] Embodiment 4

[0106] An electronic device involved in the fourth embodiment of the present application, the electronic device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor, and when the program or instruction is executed by the processor, it implements the method in any implementation manner in the first embodiment of the present application;

[0107] Among them, the processor can adopt a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), or one or more integrated circuits, and is used to execute relevant programs to implement the method in any implementation manner in the first embodiment of the present application.

[0108] The processor can also be an integrated circuit electronic device with signal processing capabilities. In the implementation process, each step of the method in any implementation manner in the first embodiment of the present application can be completed by the integrated logic circuit in the hardware of the processor or the instruction in the form of software.

[0109] The above-mentioned processor may also be a general-purpose processor, a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the methods disclosed in combination with the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or may be executed and completed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the functions required to be executed by the units included in the data processing device of the embodiments of the present application, or executes the methods in any one of the implementation manners in the first embodiment of the present application.

[0110] The above is only a preferred specific implementation manner of the present application; however, the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application, according to the technical solution of the present application and its improved concept, makes an equivalent replacement or change, and should be covered by the protection scope of the present application.

Claims

1. A self-balancing vehicle control method, characterized in that, comprising: S101. Obtain historical data Data during the operation of the self-balancing vehicle; S102. Build a neural network to obtain the estimated kinetic energy function T of the system θ and the potential energy function V θ ; S103. Estimate T according to the kinetic energy function θ and the potential energy function V θ to calculate the estimated Lagrangian L of the system θ ; S104. Calculate the vector field estimate X of the system according to the historical data Data using the Euler-Lagrange equation θ , and obtain the state estimate Φ of the system through integration θ , and calculate the estimated error ΔΦ of the system state; S105. Adjust the parameters θ of the neural network according to the estimation error; S106. Repeatedly execute steps S102 - S105, and execute step S107 in response to the parameters θ converging to a stable value; S107. Design a damped PD controller according to the accurate estimation of the Lagrangian; S108. Make the system state converge to a stable equilibrium point through the damped PD controller.

2. The self-balancing vehicle control method according to claim 1, characterized in that, The historical data Data includes the tilt angle φ, tilt angular velocity of the running process of the controlled self-balancing vehicle under the action of the control input translation speed and the control input u of the system.

3. The self-balancing vehicle control method according to claim 2, characterized in that, The neural network includes an input layer, a hidden layer, and an output layer. The input layer is historical data The output layer is the estimated system kinetic energy function T θ and the estimated potential energy function V θ , and by performing a difference operation on the output layer, the estimated Lagrangian L of the system is obtained θ , where L θ = T θ - V θ , and the optimal parameters θ of the neural network are obtained through dynamic learning by the backpropagation algorithm.

4. The self-balancing vehicle control method according to claim 2, characterized in that, The specific formula of the Euler-Lagrange equation for the controlled self-balancing vehicle model is: Expand formula (1) to: Solve formula (2) to obtain the vector field estimation:

5. The self-balancing vehicle control method according to claim 2, characterized in that, Obtain the state estimate Φ of the system through integration θ The process of the integration described in 6. The self-balancing vehicle control method according to claim 5, characterized in that, The formula for calculating the estimation error ΔΦ of the system state is:

7. The self-balancing vehicle control method according to claim 1, characterized in that, In adjusting the parameters θ of the neural network according to the estimation error, the adjustment formula of the neural network is: where E = ||ΔΦ|| 2 is the error function, and η is the step size for parameter adjustment.

8. The self-balancing vehicle control method according to claim 1, characterized in that, The judgment basis for the parameters θ to converge to a stable value is: E ≤ ε.

9. The self-balancing vehicle control method according to claim 2, characterized in that, The conditions satisfied by the damped PD controller are: The said conditions are achieved by designing the control input u PD as follows: Among them, the solution process of the PD controller with damping is as follows: Obtained through formula (3) the expression of u PD and substitute into the expression so that the Euler-Lagrange equation about φ satisfies formula (7), and then solve the PD controller u with damping by inversion PD .

10. The self-balancing vehicle control method according to claim 2, characterized in that, The process of the system state converging to a stable equilibrium point through a damped PD controller is as follows: Under the action of the damped PD controller, the tilt angle of the self-balancing vehicle exhibits a damped oscillation process, so that the tilt angle and angular velocity of the self-balancing vehicle converge to a stable equilibrium point Under this condition, the PD control input of the system is zero. According to formula (3), the translational acceleration of the self-balancing vehicle can be obtained With the speed of the self-balancing vehicle remaining constant 11. A self-balancing vehicle control system, characterized in that, comprising: A sensor module for collecting data during the operation of a self-balancing vehicle, where the data includes the tilt angle φ, the tilt angular velocity the translational velocity and the control input u of the system; A driving module for driving the self-balancing vehicle; A data storage module for storing historical data during the operation of the self-balancing vehicle A data processing module for implementing the method according to any one of claims 1 - 10 and controlling the operation of the driving module based on the designed damped PD controller.

12. A computer-readable storage medium, characterized in that, The computer-readable medium stores program code for device execution, and the program code includes steps for executing the method according to any one of claims 1 - 10.

13. An electronic device, characterized in that, The electronic device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor, and when the program or instruction is executed by the processor, the method according to any one of claims 1 - 10 is implemented.

Citation Information

Patent Citations

  • Balance car control method based on robust adaptive controller

    CN112230549A

  • Systems and methods for training neural networks based on concurrent use of current and recorded data

    US20110161267A1