Two-wheeled vehicle balance control method and system with adaptive center of gravity adjustment
By setting up an active center of gravity control unit and an adaptive sliding mode controller on the two-wheeler to adjust the inclination angle of the counterweight structure, the problem of balancing in a traditional two-wheeler in an unstructured environment is solved, and self-balancing control with high robustness and low energy consumption is achieved.
Patent Information
- Application Number
- CN202510732877.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-06-04
AI Technical Summary
Traditional two-wheelers are difficult to maintain balance in unstructured environments. The existing control methods are poorly robust, easy to roll over, high energy consumption, and the traditional momentum wheel and torque gyroscope balance methods have vibration and energy consumption problems.
Adaptive center of gravity adjustment method is adopted, by setting up an active center of gravity control unit on the two-wheeled vehicle, using an adaptive sliding mode controller and affine nonlinear dynamic model, the inclination angle of the counterweight structure is adjusted to generate a positive moment to maintain balance.
It achieves autonomous balance in complex terrain and unstructured environments, improves robustness and energy utilization, reduces energy consumption, and can drive stably under rugged terrain.
Smart Images

Figure CN120255561B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of two-wheeled vehicle control, and in particular to a two-wheeled vehicle balance control method and system with adaptive center of gravity adjustment. Background Art
[0002] Two-wheeled robots have been the subject of extensive research due to their simple structure, small turning radius, maneuverability, and low energy consumption. Two-wheeled vehicles are a typical example of two-wheeled robots, offering a natural advantage in operating in confined spaces such as jungles, mountains, and streets. Unmanned two-wheeled vehicles can be used not only for automated tasks within cities, such as express delivery, transportation, and patrols, but also for intelligent operations in the wild, such as rescue operations, patrols, surveillance, and data collection.
[0003] A non-coaxial two-wheeled vehicle is inherently a nonholonomic system, characterized by nonlinearity, underactuation, and strong coupling. This creates lateral instability, making it difficult to maintain stability in environments with high terrain fluctuations, such as mountains, deserts, and jungles. When disturbed, the vehicle cannot maintain balance solely relying on the front fork system and its own inertia, and can easily lose balance and tip over.
[0004] Most current conventional structural designs use momentum wheels or control torque gyros to provide lateral restoring torque, or balance the system through the inertial torque generated by the first wheel's steering and speed. Momentum wheels only generate restoring torque during acceleration and deceleration, and their high-speed rotation produces significant vibration, which can easily cause system instability. Relying on moment gyros for balancing requires maintaining high-speed gyro rotation, which not only consumes a lot of energy but also reduces safety. Relying solely on first-wheel steering makes it difficult to maintain balance at rest and at low speeds. Current control algorithms, such as proportional-integral-derivative control and linear quadratic regulator control, have poor control effectiveness and robustness, are prone to rollover in unstructured environments and on undulating terrain, and have limited balancing capabilities. Summary of the Invention
[0005] In view of the shortcomings of the existing technology, the purpose of the present invention is to provide a two-wheeled vehicle balance control method and system with adaptive center of gravity adjustment, which is equipped with an adaptive sliding mode controller. It uses the weight of the two-wheeled vehicle to autonomously adjust the center of gravity of the two-wheeled vehicle according to the change of the two-wheeled vehicle's inclination angle, thereby achieving self-balancing of the two-wheeled vehicle under static and interference conditions.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0007] A two-wheeled vehicle balance control method with adaptive center of gravity adjustment, comprising:
[0008] An active center of gravity control unit is provided on the two-wheeled vehicle, wherein the active center of gravity control unit includes a counterweight structure and an adjustment motor for driving the counterweight structure to tilt;
[0009] Construct an affine nonlinear dynamic model based on a two-wheeled vehicle and a counterweight structure;
[0010] An adaptive sliding mode controller is established based on the affine nonlinear dynamic model and disturbance, and the affine nonlinear dynamic model is solved by the adaptive sliding mode controller to output the input torque of the counterweight structure;
[0011] The regulating motor drives the counterweight structure to tilt at a certain angle based on the input torque, so as to generate a return torque to restore the two-wheeled vehicle to a balanced state.
[0012] Furthermore, the affine nonlinear dynamic model is:
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022] in, denote the masses of the two-wheeled vehicle and the counterweight structure respectively, denote the lengths of the two-wheeled vehicle and the counterweight structure, represents the distance from the two-wheeled vehicle to the underactuated joint, Indicates the distance from the center of gravity of the counterweight structure to the driving joint, denote the moments of inertia of the two-wheeled vehicle and the counterweight structure, is the acceleration due to gravity, is the roll angle of the two-wheeled vehicle, is the angle at which the counterweight structure rotates relative to the two-wheeled vehicle, To adjust the output torque of the motor, is the model uncertainty disturbance, is an external disturbance, Indicates the roll angle of a two-wheeled vehicle The equivalent inertia term of Indicates the roll angle of a two-wheeled vehicle The angle of rotation of the counterweight structure relative to the two-wheeled vehicle The inertial coupling term between Indicates the angle at which the counterweight structure rotates relative to the two-wheeled vehicle The equivalent inertia term of is the roll angle of the two-wheeled vehicle The gravitational moment, The angle at which the counterweight structure rotates relative to the two-wheeled vehicle The gravitational moment, are the Coriolis force and centrifugal force terms of the vehicle body, are the Coriolis force and centrifugal force terms of the counterweight structure, is the roll angular velocity of the vehicle body, is the angular velocity of the counterweight structure, is the roll acceleration of the vehicle body, is the angular acceleration of the counterweight structure, 、 、 are intermediate variables of the function respectively.
[0023] Furthermore, the disturbance includes model uncertainty and external disturbance, wherein the absolute value of the model uncertainty is less than or equal to the model uncertainty threshold, and the absolute value of the external disturbance is less than or equal to the external disturbance threshold.
[0024] Furthermore, the method of establishing an adaptive sliding mode controller is:
[0025] Performing global coordinate transformation to transform the original state system corresponding to the affine nonlinear dynamic model into a new cascade form system through differential homeomorphism transformation, and obtaining the dynamic equation of the new cascade form system;
[0026] A balance controller is designed for the dynamic equations of the new cascade system, a sliding surface is set, and an adaptive sliding mode controller is established based on the balance controller.
[0027] Furthermore, a global coordinate transformation is performed to transform the original state system corresponding to the affine nonlinear dynamic model into a new system state through differential homeomorphism transformation. The method for establishing the dynamic equation of the new cascade formal system is as follows:
[0028] Get the new system status, specifically:
[0029]
[0030]
[0031]
[0032]
[0033] in, is the original system state, is the new cascade formal system state, It is a coupled state. is the generalized momentum, and are the angle and speed of the counterweight structure, is the core transformation function, is the Lagrangian function, which is used to describe the energy characteristics of the system and obtain the dynamic characteristics of the system through partial derivative operations;
[0034] The dynamic equations of the new cascade formal system are obtained as follows:
[0035]
[0036] in, represents generalized momentum The negative value of the gravitational moment, Indicates the speed of the counterweight structure The comprehensive dynamic coupling term, is the total disturbance of coupled model uncertainty disturbance and external disturbance;
[0037]
[0038] in, is the equivalent mass coupling term.
[0039] Furthermore, a method for designing a balance controller for the dynamic equations of the new cascade system, setting a sliding mode surface, and establishing an adaptive sliding mode controller based on the balance controller is as follows:
[0040] The balance controller is represented by the balance point, which is
[0041]
[0042] Then the equilibrium point of the new system state after the differential homeomorphism mapping is:
[0043]
[0044] The new system dynamics equation satisfies reversible, and Bounded conditions;
[0045] Design the sliding hyperplane:
[0046]
[0047]
[0048] in, Indicates the deviation of the current roll state of the two-wheeled vehicle from the vertical position, Indicates the dynamic characteristic deviation of the two-wheeled vehicle in the current roll direction, The nonlinear characteristics represented by express The dynamic rate of change, They are Weight coefficients in the sliding hyperplane;
[0049] According to the sliding mode controller design method of underactuated system, a sliding mode controller is designed. The input torque of the system is:
[0050]
[0051]
[0052] in, For model-based feedforward compensation, Used to offset the errors caused by model uncertainty and external disturbances, is a constant, Represents model uncertainty disturbance The maximum amplitude, Represents external disturbance or the maximum amplitude of the coupled perturbation, is the sliding mode gain, is the sliding surface.
[0053] An adaptive center of gravity adjustment two-wheeled vehicle balance control system, comprising:
[0054] A two-wheeled vehicle balancing module is used to set an active center of gravity control unit on the two-wheeled vehicle, wherein the active center of gravity control unit includes a counterweight structure and an adjustment motor for driving the counterweight structure to tilt;
[0055] Affine nonlinear dynamics model module, used to build an affine nonlinear dynamics model based on a two-wheeled vehicle and a counterweight structure;
[0056] An adaptive sliding mode controller module is used to establish an adaptive sliding mode controller based on an affine nonlinear dynamic model and disturbances, and solve the affine nonlinear dynamic model through the adaptive sliding mode controller to output an input torque of the counterweight structure;
[0057] The regulating module is used to regulate the motor to drive the counterweight structure to tilt at a certain angle based on the input torque, so as to generate a return torque to restore the two-wheeled vehicle to a balanced state.
[0058] Furthermore, in the two-wheeled vehicle balancing module, the two-wheeled vehicle includes a first wheel, a second wheel, and a vehicle body, the first wheel is arranged at the front side of the vehicle body, the second wheel is arranged at the rear side of the vehicle body, the first wheel is steered by a first drive mechanism, and the second wheel is driven straight by a second drive mechanism, and the counterweight structure and the adjustment motor are arranged on the vehicle body and between the first wheel and the second wheel;
[0059] The affine nonlinear dynamic model module is used to construct an affine nonlinear dynamic model based on the vehicle body and counterweight structure.
[0060] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the above-mentioned adaptive center of gravity adjustment two-wheeled vehicle balance control method is implemented.
[0061] Furthermore, the processor selects an STM32 main control board and is equipped with an IMU sensor to perform posture recognition of the two-wheeled vehicle. The IMU sensor communicates with the STM32 main control board through a USART serial port, and the STM32 main control board sends control signals to the adjustment motor of the active center of gravity control unit and the two-wheeled vehicle.
[0062] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned adaptive center of gravity adjustment two-wheeled vehicle balance control method.
[0063] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0064] The adaptive center of gravity adjustment two-wheeled vehicle balance control method provided by this invention utilizes active center of gravity adjustment technology. This dynamically adjusts the center of gravity position through the vehicle's own weight, automatically adjusting the center of gravity based on the vehicle's tilt, generating a restoring torque to maintain the vehicle's balance. Compared to traditional passive balancing methods, this active center of gravity adjustment technology significantly improves the vehicle's self-balancing ability, allowing it to adapt to more complex terrain. It also requires no additional weight, offers strong robustness, and high energy efficiency.
[0065] The adaptive center-of-gravity balance control method for two-wheeled vehicles provided by this invention can adjust control parameters in real time according to different operating conditions and is highly robust to model uncertainty and external disturbances. Traditional PID control and LQR control methods are difficult to adapt to highly nonlinear and tightly coupled two-wheeled vehicle systems. Sliding mode control, however, introduces a sliding surface to constrain the system's trajectory near the surface, effectively suppressing the effects of model uncertainty and external disturbances. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The accompanying drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:
[0067] Figure 1 This is a flow chart of a two-wheeled vehicle balance control method for adaptive center of gravity adjustment according to the present invention;
[0068] Figure 2 This is a control principle diagram of a two-wheeled vehicle balance control method for adaptive center of gravity adjustment according to the present invention;
[0069] FIG3 (a) shows the roll angle variation data of the two-wheeled vehicle return-to-centering experiment of the present invention;
[0070] FIG3( b ) is the data result of the turning angle change of the active center of gravity adjustment unit in the two-wheeled vehicle self-centering experiment of the present invention;
[0071] FIG4 (a) shows the roll angle variation data of the two-wheeled vehicle in the off-road test of the present invention;
[0072] FIG4( b ) is the data result of the turning angle change of the active center of gravity adjustment unit of the two-wheeled vehicle off-road test of the present invention;
[0073] Figure 5 A schematic diagram of a two-wheeled vehicle balance control system with adaptive center of gravity adjustment according to the present invention;
[0074] Figure 6 is a schematic diagram of a two-wheeled vehicle of the present invention;
[0075] Figure 7 Schematic diagram of the balance state of the two-wheeled vehicle of the present invention;
[0076] Figure 8 A schematic diagram of the two-wheeled vehicle of the present invention restoring balance in a tilted state in a first direction;
[0077] Figure 9 Schematic diagram of the two-wheeled vehicle of the present invention restoring balance in the second direction tilt state.
[0078] Among them, 1. Car body; 2. Counterweight structure; 3. First wheel; 4. Second wheel; 5. Synchronous belt; 6. Main control board; 7. Steering servo; 8. Brushless motor; 9. First transmission wheel; 10. Second transmission wheel; 11. Front fork; 12. Battery; 13. Attitude sensor; 14. Adjustment motor. DETAILED DESCRIPTION
[0079] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention.
[0080] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0081] Example 1
[0082] Example 1 provides a method for controlling the balance of a two-wheeled vehicle by adaptively adjusting the center of gravity. Figure 1 、 Figure 2 and Figure 6 Shown, including:
[0083] Step S1: An active center of gravity control unit is provided on the two-wheeled vehicle, wherein the active center of gravity control unit includes a counterweight structure 2 and an adjustment motor 14 for driving the counterweight structure 2 to tilt;
[0084] Step S2: constructing an affine nonlinear dynamic model based on the two-wheeled vehicle and the counterweight structure 2;
[0085] Step S3: establishing an adaptive sliding mode controller based on the affine nonlinear dynamic model and the disturbance, and solving the affine nonlinear dynamic model through the adaptive sliding mode controller to output the input torque of the counterweight structure 2;
[0086] Step S4: The motor 14 is adjusted to drive the counterweight structure 2 to tilt at a certain angle based on the input torque, so as to generate a return torque to restore the two-wheeled vehicle to a balanced state.
[0087] This embodiment provides a method for balancing a two-wheeled vehicle with adaptive center of gravity adjustment. An adaptive sliding mode controller is used to control the vehicle's self-balancing in unstructured terrain. This method effectively suppresses the effects of unstructured terrain disturbances and exhibits excellent robustness. The two-wheeled vehicle designed in this embodiment has the advantages of high energy efficiency, long endurance, and strong robustness. It also possesses excellent maneuverability in complex terrain, such as rugged mountains and deserts. It has broad application prospects in rescue, logistics, inspection, and surveying.
[0088] This embodiment provides an active center of gravity adjustment unit that can achieve balance control for a two-wheeled robot in both stationary and all-terrain conditions. By adjusting the position of the active center of gravity control unit, the center of gravity of the two-wheeled vehicle is changed, thereby generating the lateral restoring torque provided by this embodiment, which in turn adjusts the roll angle provided by this embodiment. When the two-wheeled vehicle tips over to either side, the adaptive center of gravity adjustment two-wheeled vehicle balance control method provided by this embodiment controls the active center of gravity adjustment unit of the two-wheeled vehicle, causing it to quickly rotate to a specific angle in the opposite direction of the tipping, thereby generating a torque in the roll direction to counteract gravity and adjust the two-wheeled vehicle to the desired position.
[0089] In step S2 of this embodiment, an affine nonlinear dynamic model based on the two-wheeled vehicle and the counterweight structure 2 is constructed:
[0090]
[0091]
[0092]
[0093]
[0094]
[0095]
[0096]
[0097]
[0098]
[0099] in, denote the masses of the two-wheeled vehicle and the counterweight structure 2, respectively, denote the lengths of the two-wheeled vehicle and the counterweight structure 2, respectively, represents the distance from the two-wheeled vehicle to the underactuated joint, Indicates the distance from the center of gravity of the counterweight structure 2 to the driving joint, denote the moments of inertia of the two-wheeled vehicle and the counterweight structure 2, respectively, is the acceleration due to gravity, is the roll angle of the two-wheeled vehicle, is the angle at which the counterweight structure 2 rotates relative to the two-wheeled vehicle, To adjust the output torque of the motor 14, is the model uncertainty disturbance, is an external disturbance, Indicates the roll angle of a two-wheeled vehicle The equivalent inertia term of Indicates the roll angle of a two-wheeled vehicle The angle of rotation of the counterweight structure 2 relative to the two-wheeled vehicle The inertial coupling term between Indicates the angle at which the counterweight structure 2 rotates relative to the two-wheeled vehicle The equivalent inertia term of is the roll angle of the two-wheeled vehicle The gravitational moment, is the rotation angle of the counterweight structure 2 relative to the two-wheeled vehicle The gravitational moment, are the Coriolis force and centrifugal force terms of the vehicle body, are the Coriolis force and centrifugal force terms of the counterweight structure, is the roll angular velocity of the vehicle body, is the angular velocity of the counterweight structure, is the roll acceleration of the vehicle body, is the angular acceleration of the counterweight structure, 、 、 are intermediate variables of the function respectively.
[0100] In step S3 of this embodiment, the disturbance includes model uncertainty and external disturbances , external disturbances include random lateral wind disturbances, errors between the model and the real system, friction caused by the rotation of the regulating motor 14, and vibration caused by rotation. Assuming that the disturbances are within a certain range, then The disturbance satisfies:
[0101]
[0102] in, is the model uncertainty threshold, is the external disturbance threshold.
[0103] In this embodiment, the nonlinear coupling of the affine nonlinear dynamic model is serious. Therefore, through differential homeomorphism transformation, the original state system is mapped to another global coordinate system, becoming a cascade system with better control. An adaptive sliding mode controller is designed to control it. In this embodiment S4, the method for establishing the adaptive sliding mode controller is:
[0104] Step S401: performing a global coordinate transformation to transform the original state system corresponding to the affine nonlinear dynamic model into a new cascade form system through a differential homeomorphism transformation, and obtaining the dynamic equation of the new cascade form system;
[0105] Step S402: designing a balance controller for the dynamic equations of the new cascade system, setting a sliding mode surface, and establishing an adaptive sliding mode controller based on the balance controller.
[0106] Perform global coordinate transformation to transform the original state system corresponding to the affine nonlinear dynamic model into a new system state through differential homeomorphism transformation. The method of establishing the dynamic equation of the new cascade form system is as follows:
[0107] In step S401 of this embodiment, a new cascade formal system is obtained, specifically:
[0108]
[0109]
[0110]
[0111]
[0112] in, is the original system state, is the new cascade formal system state, It is a coupled state. is the generalized momentum, and are the angle and speed of the counterweight structure, is the core transformation function, is the Lagrangian function, which is used to describe the energy characteristics of the system and obtain the dynamic characteristics of the system through partial derivative operations;
[0113] The dynamic equations of the new cascade formal system are obtained as follows:
[0114]
[0115] in, represents generalized momentum The negative value of the gravitational moment, Indicates the speed of the counterweight structure The comprehensive dynamic coupling term, is the total disturbance of coupled model uncertainty disturbance and external disturbance;
[0116]
[0117] in, is the equivalent mass coupling term.
[0118] In step S402 of this embodiment, the method of designing a balance controller for the dynamic equation of the new cascade system, setting a sliding mode surface, and establishing an adaptive sliding mode controller based on the balance controller is as follows:
[0119] The balancing controller is represented by the balancing point, specifically:
[0120]
[0121] Then the equilibrium point of the new system state after the differential homeomorphism mapping is:
[0122]
[0123] The new system dynamics equation satisfies reversible, and Bounded conditions;
[0124] Design the sliding hyperplane:
[0125]
[0126]
[0127] in, Indicates the deviation of the current roll state of the two-wheeled vehicle from the vertical position, Indicates the dynamic characteristic deviation of the two-wheeled vehicle in the current roll direction, The nonlinear characteristics represented by express The dynamic rate of change, They are Weight coefficients in the sliding hyperplane;
[0128] According to the sliding mode controller design method of underactuated system, a sliding mode controller is designed. The input torque of the system is:
[0129]
[0130]
[0131] in, For model-based feedforward compensation, Used to offset the errors caused by model uncertainty and external disturbances, is a constant, Represents model uncertainty disturbance The maximum amplitude, Represents external disturbance or the maximum amplitude of the coupled perturbation, is the sliding mode gain, is the sliding surface.
[0132] In summary, the underactuated two-wheeled vehicle configuration designed by the present invention exhibits severe nonlinear coupling and underactuation characteristics. Traditional linearization methods can only achieve approximate linearization within a very small range near the equilibrium point. Due to the nonlinear coupling characteristics of the system itself, strict global linearization is impossible. To address this difficulty, the present invention designs a global coordinate transformation, converting the affine nonlinear dynamic model corresponding to the proposed configuration into a strict feedback cascade standard form. A sliding mode controller is designed to enable the system's driving portion to reach sliding mode conditions. Through the coupling relationship between the driving and underactuated parts of the system, self-stabilization of the underactuated part is ultimately achieved.
[0133] The counterweight structure 2 designed in the present invention utilizes the vehicle's own weight without the addition of additional weight. It autonomously adjusts the vehicle's center of gravity according to changes in the vehicle's inclination angle, achieving self-balancing of the vehicle both at rest and under interference. The maximum rotation angle of the vehicle can reach ±12°, with strong anti-interference capability, high energy utilization, and stable control.
[0134] The present invention designs an adaptive sliding mode controller to achieve optimal balance control; cooperates with an active center of gravity control unit and the two-wheeled vehicle to achieve self-balancing of the two-wheeled vehicle under driving and interference; has better performance in unstructured and undulating terrain, has good robustness against external random disturbances and state fluctuations caused by terrain, and can smoothly pass ramps with a height exceeding four times the wheel diameter of the two wheels; when passing continuous ramps such as blind paths and speed bumps, the two-wheeled vehicle's roll angle never exceeds 5.7°.
[0135] According to the above technical solution, a two-wheeled vehicle prototype was designed and its functions were experimentally verified and analyzed.
[0136] First, a return-to-center test was conducted. A two-wheeled vehicle prototype equipped with an active center of gravity control unit, coupled with an adaptive sliding mode controller, was able to maintain its balance while stationary. Return-to-center tests were conducted on the two-wheeled vehicle prototype at various roll angles, including 3°, 6°, 9°, and 12°. The experimental results, shown in Figures 3(a) and 3(b), demonstrate that the two-wheeled vehicle prototype can quickly return to the equilibrium point within 1 second, with a maximum return angle of 12°. The counterweight structure 2 exhibits a rapid response within a rotation angle range of -85° to 57°.
[0137] To further verify the balance of the two-wheeled vehicle prototype, off-road tests were conducted on different terrains, including speed bumps, sidewalks, and undulating ramps. The speed bumps were 4 cm and 5 cm high, and the ramp was 20 cm high. The wheel diameter of the two-wheeled vehicle prototype was 4.62 cm. The experimental results are shown in Figures 4(a) and 4(b). For the continuously undulating sidewalks and speed bumps, the active center of gravity control unit's roll angle continuously changed, with the roll angle variation not exceeding 5.7°, ensuring the two-wheeled vehicle prototype's balance. The two-wheeled vehicle prototype was also able to quickly and smoothly negotiate ramps up to 20 cm high.
[0138] Example 2
[0139] Example 2 provides an adaptive center of gravity adjustment two-wheeled vehicle balance control system, which is applied to the above-mentioned adaptive center of gravity adjustment two-wheeled vehicle balance control method, such as Figure 5 Shown, including:
[0140] A two-wheeled vehicle balancing module is used to set an active center of gravity control unit on the two-wheeled vehicle. The active center of gravity control unit includes a counterweight structure 2 and an adjustment motor 14 for driving the counterweight structure 2 to tilt;
[0141] An affine nonlinear dynamics model module is used to construct an affine nonlinear dynamics model based on a two-wheeled vehicle and a counterweight structure 2;
[0142] A disturbance acquisition module is used to acquire disturbances;
[0143] An adaptive sliding mode controller module is used to set a sliding mode surface and establish an adaptive sliding mode controller based on an affine nonlinear dynamic model and a disturbance, and solve the affine nonlinear dynamic model through the adaptive sliding mode controller to output an input torque of the counterweight structure 2;
[0144] The regulating module is used to regulate the motor to drive the counterweight structure to tilt at a certain angle based on the input torque, so as to generate a return torque to restore the two-wheeled vehicle to a balanced state.
[0145] In this embodiment, the two-wheeled vehicle includes a first wheel 3, a second wheel 4, and a body 1. The first wheel 3 is disposed at the front of the body 1, and the second wheel 4 is disposed at the rear of the body 1. The first wheel 3 is steered by a first drive mechanism, while the second wheel 4 is driven straight by a second drive mechanism. A counterweight structure 2 and an adjustment motor 14 are disposed on the body 1 between the first wheel 3 and the second wheel 4, and are used to control the self-balancing of the two-wheeled vehicle on unstructured terrain.
[0146] The affine nonlinear dynamic model module is used to construct an affine nonlinear dynamic model based on the vehicle body 1 and the counterweight structure 2.
[0147] Specifically, the first driving mechanism includes a steering servo 7 and a front fork 11. The steering servo 7 is fixed on the vehicle body 1. The output shaft of the steering servo 7 is fixedly connected to the front fork 11. The first wheel 3 is fixedly connected to the front fork 11 via a rotating shaft, and the steering servo 7 drives the first wheel 3 to steer.
[0148] The second driving mechanism includes a brushless motor 8, a first transmission wheel 9, a second transmission wheel 10 and a synchronous belt 5. The brushless motor 8 is fixed on the vehicle body 1, the first transmission wheel 9 is fixedly connected to the output shaft of the brushless motor 8, the second transmission wheel 10 is fixedly connected to the second wheel 4, and the synchronous belt 5 is sleeved on the first transmission wheel 9 and the second transmission wheel 10. The brushless motor 8 drives the first transmission wheel 9 to rotate, and then drives the second transmission wheel 10 and the second wheel 4 to rotate, so that the second wheel 4 generates forward and backward straight motion.
[0149] The vehicle body 1 features a hollowed-out center section to house the brushless motor 8 that drives the second wheel 4 and the adjustment motor 14 that drives the counterweight structure 2. These components are connected by bolts, with the second wheel 4 and vehicle body 1 connected via a cross key to ensure a secure connection during transmission. This embodiment eliminates the seat and chain structure. The brushless motor 8 is connected to the second wheel 4 via a timing belt 5, a first transmission pulley 9, and a second transmission pulley 10, converting the rotation of the brushless motor 8 into linear motion of the second wheel 4.
[0150] In this embodiment, the weight of the two-wheeled vehicle itself is used to change the center of gravity, thereby improving energy utilization and endurance.
[0151] In this embodiment, the active center of gravity control unit also includes a main control board 6 and a posture sensor 13. The main control board 6 is an STM32 control board equipped with an adaptive sliding mode controller. The posture sensor 13 is an IMU sensor for receiving posture sensor data. The adaptive center of gravity adjustment two-wheeled vehicle balance control method is used to calculate the torque required to balance the two-wheeled vehicle. This torque is used as the control target of the center of gravity adjustment actuator to drive the counterweight structure 2 to move, changing the center of gravity position of the two-wheeled vehicle. When the two-wheeled vehicle tilts, the counterweight structure 2 moves in the opposite direction to generate a restoring torque to return the two-wheeled vehicle to a balanced position. The counterweight structure 2 is provided with a battery 12 and / or other goods to be transported, which not only balances the two-wheeled vehicle but also provides power. This fully utilizes the weight of the two-wheeled vehicle itself to change the center of gravity, resulting in high energy utilization and long battery life. By adjusting the relative position of the counterweight structure 2 and the two-wheeled vehicle, the center of gravity position of the two-wheeled vehicle is changed, generating a lateral restoring torque for the two-wheeled vehicle, thereby adjusting the roll angle of the two-wheeled vehicle. When a two-wheeled vehicle tips over to either side, the adaptive center of gravity adjustment two-wheeled vehicle balance control method proposed in the present invention is used to control the active center of gravity control unit, causing it to quickly rotate to a specific angle in the opposite direction of the tipping direction, thereby obtaining a torque to counteract gravity in the roll direction, adjusting the two-wheeled vehicle to a desired position, and making full use of the weight of the two-wheeled vehicle to change the center of gravity, thereby achieving high energy utilization, long endurance, strong robustness, and stable driving.
[0152] In this implementation, the adaptive sliding mode controller uses the vehicle's posture and the position of the active center of gravity control unit's counterweight structure 2 as inputs, outputs center of gravity adjustment commands, and controls the adjustment process to achieve balance control of the two-wheeled vehicle. The adaptive sliding mode controller is designed based on the vehicle dynamics model, compensating for model uncertainty and the influence of external disturbances, and exhibits strong robustness.
[0153] In this embodiment, a host computer and a receiving module are further included. The receiving module is provided on the two-wheeled vehicle and is used to receive instructions from the host computer to make the first wheel 3 turn and / or the second wheel 4 move straight through the second driving mechanism. The receiving module is a Bluetooth receiver or a WIFI receiver.
[0154] In this embodiment, the specific method of adjusting the vehicle body 1 is:
[0155] The posture information of the two-wheeled vehicle is obtained through the posture sensor 13, and the adaptive center of gravity adjustment two-wheeled vehicle balance control method is started to calculate the torque required to balance the two-wheeled vehicle;
[0156] According to the torque, the motor 14 is adjusted to drive the counterweight structure 2 to move, thereby changing the center of gravity of the two-wheeled vehicle and making the two-wheeled vehicle balanced;
[0157] The receiving module receives the forward and turning instructions from the host computer, and the main control board 6 executes the commands;
[0158] The main control board 6 controls the second driving mechanism to drive the first wheel 3 to rotate and controls the second driving mechanism to drive the second wheel 4 to move straight, thereby controlling the operation of the two-wheeled vehicle.
[0159] like Figure 7 , is a schematic diagram of the balance state of the two-wheeled vehicle of the present invention; Figure 8 As shown in FIG, it is a schematic diagram of restoring balance of the two-wheeled vehicle of the present invention in the first direction tilt state. When the two-wheeled vehicle tilts to the left at a certain angle, the counterweight structure 2 tilts to the right at a certain angle to balance the two-wheeled vehicle. Figure 9 , which is a schematic diagram of restoring balance of the two-wheeled vehicle of the present invention in the second tilted state. When the two-wheeled vehicle tilts to the right at a certain angle, the counterweight structure 2 tilts to the left at a certain angle to balance the two-wheeled vehicle.
[0160] In this embodiment, an STM32 main control board 6 is used as the main control module, equipped with an IMU sensor for two-wheeled vehicle posture recognition. The IMU sensor communicates with the main control board 6 via a USART serial port. The main control board 6 is equipped with an RS485 serial port to send control signals to the adjustment motor 14 of the active center of gravity control unit. The main control board 6 drives the brushless motor 8 through a PWM interface to provide control signals. The main control board 6 communicates with the steering control board of the steering servo 7 via the USART serial port. The main control board 6 is connected to the receiving module via the USART serial port to communicate with the host computer.
[0161] In this embodiment, the IMU sensor uses the six-axis inertial measurement unit (BMI088). It uses an accelerometer and gyroscope to measure three-axis acceleration and three-axis angular velocity, and then calculates the attitude angle of the two-wheeled vehicle body 1 using algorithms such as Kalman filtering. The attitude calculation frequency is no less than 200Hz, and the attitude accuracy is better than 0.5°, meeting the requirements of self-balancing control. The IMU sensor is connected to the main control board 6 via an RS485 interface, with a transmission rate of no less than 115200bps, ensuring real-time and reliable data transmission.
[0162] In this embodiment, the main control board 6 uses a high-performance STM32H743 microcontroller with a main frequency of no less than 168MHz and a Flash storage capacity of no less than 512KB. It also features a rich set of peripheral interfaces, such as UART, CAN, SPI, and IIC, to meet the computational requirements of multi-sensor data fusion and complex control algorithms. The main control board 6 operates from a 12V supply voltage, which is stepped down to 3.3V and 5V using a DC-DC module to power various modules. It also features reverse polarity protection and a TVS suppression circuit, enhancing the reliability of the control system.
[0163] In the specific implementation of this embodiment, the adjustment motor 14 in the active center of gravity control unit uses the XM540-W270-T / R motor of ROBOTIS, which has a built-in absolute encoder and provides a maximum torque of 10.6 N·m under 12V power supply; it can achieve high-precision position and speed control.
[0164] In the specific implementation manner of this embodiment, the steering control module of the steering servo 7 uses Fashion Star's 50KG dual-axis servo RP8-U50H-M, which is equipped with an absolute encoder and has an effective rotation angle of 0-360°.
[0165] In this embodiment, the brushless motor 8 uses the Langyu X2216-KV880, which supports CAN bus and PWM signal control, enabling efficient, smooth, and low-noise drive control. The synchronous belt 5 is 20 mm wide and 400 mm long, made of high-strength polyurethane material. It is resistant to stretching, wear, and corrosion, ensuring a long service life. The synchronous belt 5 connects to the first and second transmission pulleys 9 and 10, providing sufficient drive torque to ensure power output to the wheels.
[0166] In this embodiment, the battery 12 is connected in series and in parallel, with multiple lithium batteries 12 forming a battery pack 12 to provide power for the entire system. The battery pack 12 is housed in a waterproof and dustproof compartment and is equipped with an intelligent power management system that monitors parameters such as the voltage, current, and temperature of the battery 12 in real time. It also provides overcharge and over-discharge protection, short-circuit protection, and balanced charging, ensuring the reliability and safety of the power system. It is connected to the main control board 6 via a plug for easy replacement and maintenance.
[0167] In the specific implementation of this embodiment, the receiving module uses a Bluetooth receiver, and the Bluetooth receiver uses a Bluetooth serial port transparent transmission module of model HC06 to receive signals transmitted from the host computer.
[0168] In summary, the adaptive center of gravity adjustment two-wheeled vehicle balance control system provided in this embodiment specifically includes:
[0169] After the main control board 6 is powered on, it establishes communication with the IMU sensor through the RS485 serial port to obtain the attitude information of the body 1 of the two-wheeled vehicle, such as the pitch angle, roll angle, and heading angle, in real time. It also establishes communication with the host computer through the onboard UART serial port to receive control instructions and parameter settings sent by the host computer.
[0170] After receiving the attitude data sent by the IMU sensor, the main control board 6 starts the adaptive center of gravity adjustment two-wheeled vehicle balance control method, and calculates the balance torque required by the two-wheeled vehicle in real time according to the attitude angle of the two-wheeled vehicle. This torque is used as the control target of the active center of gravity control unit and is sent to the adjustment motor 14 through the RS485 serial port. The adaptive center of gravity adjustment two-wheeled vehicle balance control method is based on the two-wheeled vehicle dynamics model and designs an adaptive sliding mode control law. It can adjust the control parameters in real time according to different working conditions, has strong robustness, and can effectively suppress the influence of model uncertainty and external disturbances;
[0171] After receiving the torque command from the main control board 6, the regulating motor 14 precisely controls the rotation angle and speed of the motor shaft through a servo control algorithm, driving the counterweight structure 2 to slide longitudinally along the two-wheeled vehicle, thereby changing the center of gravity of the two-wheeled vehicle. The mass block uses a battery 12 as the counterweight structure 2, which has a large mass and can significantly change the center of gravity. When the two-wheeled vehicle tilts to the left (right), the counterweight structure 2 will move to the right (left), generating a restoring torque that pushes the two-wheeled vehicle back to the right (left), ultimately maintaining the two-wheeled vehicle in a balanced position.
[0172] The main control board 6 controls the drive electronic regulator of the brushless motor 8 via a PWM interface, thereby controlling the motor's speed. The brushless motor 8 transmits power to the second wheel 4 via a timing belt 5, driving the vehicle straight ahead. The motor's speed is adjusted in real time using a PID control algorithm based on the difference between the vehicle's target speed and actual speed, ensuring smooth and accurate travel. The speed feedback signal is provided by a Hall effect encoder on the second wheel 4. The encoder measures speed using the Hall effect and transmits speed pulse signals to the main control board 6 for closed-loop speed control.
[0173] The main control board 6 communicates with the steering servo 7's steering control board via the UART serial port. Upon receiving a steering control command from the host computer, the main control board 6 calculates the target turning angle of the first wheel 3 based on the error between the vehicle's current position and the desired trajectory. This angle is then sent to the steering control board via the UART serial port. Based on the received target turning angle, the steering control board controls the rotation of the steering servo 7, driving the front fork 11 and first wheel 3 to steer the vehicle along the desired trajectory.
[0174] Example 3
[0175] Example 3 provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the above-mentioned adaptive center of gravity adjustment two-wheeled vehicle balance control method is implemented.
[0176] The processor uses an STM32 main control board 6 and is equipped with an IMU sensor for two-wheeled vehicle posture recognition. The IMU sensor communicates with the STM32 main control board 6 through a USART serial port, and the STM32 main control board 6 sends control signals to the adjustment motor 14 of the active center of gravity control unit and the two-wheeled vehicle.
[0177] Example 4
[0178] Embodiment 4 provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the above-mentioned adaptive center of gravity adjustment two-wheeled vehicle balance control method is implemented.
[0179] The above embodiments are merely illustrative of the technical solutions of the present invention. The methods of the present invention are not limited solely to those described in the above embodiments, but are subject to the scope defined by the claims. Any modifications, supplements, or equivalent substitutions made by those skilled in the art based on these embodiments are within the scope of protection claimed in the claims.
Claims
1. A method for controlling the balance of a two-wheeled vehicle by adaptively adjusting the center of gravity, characterized in that: include: An active center of gravity control unit is provided on the two-wheeled vehicle, wherein the active center of gravity control unit includes a counterweight structure and an adjustment motor for driving the counterweight structure to tilt; Construct an affine nonlinear dynamic model based on a two-wheeled vehicle and a counterweight structure; An adaptive sliding mode controller is established based on the affine nonlinear dynamic model and disturbance, and the affine nonlinear dynamic model is solved by the adaptive sliding mode controller to output the input torque of the counterweight structure; The regulating motor drives the counterweight structure to tilt at a certain angle based on the input torque, so as to generate a return torque to restore the two-wheeled vehicle to a balanced state; The affine nonlinear dynamic model is: in, denote the masses of the two-wheeled vehicle and the counterweight structure, denote the lengths of the two-wheeled vehicle and the counterweight structure, represents the distance from the two-wheeled vehicle to the underactuated joint, Indicates the distance from the center of gravity of the counterweight structure to the driving joint, denote the moments of inertia of the two-wheeled vehicle and the counterweight structure, is the acceleration due to gravity, is the roll angle of the two-wheeled vehicle, is the angle at which the counterweight structure rotates relative to the two-wheeled vehicle, To adjust the output torque of the motor, is the model uncertainty disturbance, is an external disturbance, Indicates the roll angle of a two-wheeled vehicle The equivalent inertia term of Indicates the roll angle of a two-wheeled vehicle The angle of rotation of the counterweight structure relative to the two-wheeled vehicle The inertial coupling term between Indicates the angle at which the counterweight structure rotates relative to the two-wheeled vehicle The equivalent inertia term of is the roll angle of the two-wheeled vehicle The gravitational moment, The angle at which the counterweight structure rotates relative to the two-wheeled vehicle The gravitational moment, are the Coriolis force and centrifugal force terms of the vehicle body, are the Coriolis force and centrifugal force terms of the counterweight structure, is the roll angular velocity of the vehicle body, is the angular velocity of the counterweight structure, is the roll angular acceleration of the vehicle body, is the angular acceleration of the counterweight structure, 、 、 They are the intermediate variables of the function; The method to establish an adaptive sliding mode controller is: Performing global coordinate transformation to transform the original state system corresponding to the affine nonlinear dynamic model into a new cascade form system through differential homeomorphism transformation, and obtaining the dynamic equation of the new cascade form system; Design a balance controller for the dynamic equations of the new cascade system, set the sliding surface and establish an adaptive sliding mode controller based on the balance controller; Perform global coordinate transformation to transform the original state system corresponding to the affine nonlinear dynamic model into a new system state through differential homeomorphism transformation. The method of establishing the dynamic equation of the new cascade form system is as follows: Get the new system status, specifically: in, is the original system state, is the new cascade formal system state, It is a coupled state. is the generalized momentum, and are the angle and speed of the counterweight structure, is the core transformation function, is the Lagrangian function, which is used to describe the energy characteristics of the system and obtain the dynamic characteristics of the system through partial derivative operations; The dynamic equations of the new cascade formal system are obtained as follows: in, represents generalized momentum The negative value of the gravitational moment, Indicates the speed of the counterweight structure The comprehensive dynamic coupling term, is the total disturbance of coupled model uncertainty disturbance and external disturbance; in, is the equivalent mass coupling term.
2. The adaptive center of gravity adjustment two-wheeled vehicle balance control method according to claim 1, characterized in that: The method of designing a balance controller for the dynamic equations of the new cascade system, setting the sliding surface, and establishing an adaptive sliding mode controller based on the balance controller is as follows: The balance controller is represented by the balance point, specifically Then the equilibrium point of the new system state after the differential homeomorphism mapping is: The new system dynamics equation satisfies reversible, and Bounded conditions; Design the sliding hyperplane: in, Indicates the deviation of the current roll state of the two-wheeled vehicle from the vertical position, Indicates the dynamic characteristic deviation of the two-wheeled vehicle in the current roll direction, The nonlinear characteristics represented by express The dynamic rate of change, They are Weight coefficients in the sliding hyperplane; According to the sliding mode controller design method of underactuated system, a sliding mode controller is designed. The input torque of the system is: in, For model-based feedforward compensation, Used to offset the errors caused by model uncertainty and external disturbances, is a constant, Represents model uncertainty disturbance The maximum amplitude, Represents external disturbance or the maximum amplitude of the coupled perturbation, is the sliding mode gain, is the sliding surface.
3. An adaptive center of gravity adjustment two-wheeled vehicle balance control system, based on the adaptive center of gravity adjustment two-wheeled vehicle balance control method according to claim 1 or 2, characterized in that: include: A two-wheeled vehicle balancing module is used to set an active center of gravity control unit on the two-wheeled vehicle, wherein the active center of gravity control unit includes a counterweight structure and an adjustment motor for driving the counterweight structure to tilt; Affine nonlinear dynamics model module, used to build an affine nonlinear dynamics model based on a two-wheeled vehicle and a counterweight structure; An adaptive sliding mode controller module is used to establish an adaptive sliding mode controller based on an affine nonlinear dynamic model and disturbances, and solve the affine nonlinear dynamic model through the adaptive sliding mode controller to output an input torque of the counterweight structure; The adjustment module is used to adjust the motor to drive the counterweight structure to tilt to a certain angle based on the input torque to generate a return torque to restore the two-wheeled vehicle to a balanced state.
4. The adaptive center of gravity adjustment two-wheeled vehicle balance control system according to claim 3, characterized in that: In the two-wheeled vehicle balancing module, the two-wheeled vehicle includes a first wheel, a second wheel, and a vehicle body, the first wheel is arranged at the front side of the vehicle body, the second wheel is arranged at the rear side of the vehicle body, the first wheel is steered by a first drive mechanism, and the second wheel is driven straight by a second drive mechanism, and the counterweight structure and the adjustment motor are arranged on the vehicle body and between the first wheel and the second wheel; The affine nonlinear dynamic model module is used to construct an affine nonlinear dynamic model based on the vehicle body and counterweight structure.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the adaptive center of gravity adjustment two-wheeled vehicle balance control method as claimed in claim 1 or 2 is implemented.
6. The electronic device according to claim 5, wherein: The processor uses an STM32 main control board and is equipped with an IMU sensor to perform posture recognition of the two-wheeled vehicle. The IMU sensor communicates with the STM32 main control board through the USART serial port, and the STM32 main control board sends control signals to the adjustment motor of the active center of gravity control unit and the two-wheeled vehicle.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the adaptive center of gravity adjustment two-wheeled vehicle balance control method according to claim 1 or 2 is implemented.
Citation Information
Patent Citations
Balance bicycle sliding mode control method based on observer and self-adaption combination
CN114019825A