Self-balancing wheelbarrow control system and method based on cascade PID and multi-sensor fusion

By adopting a method of fusion of cascade PID control and multi-sensors in self-balancing unicycle vehicles, combining inertial balanced flywheel and multi-sensor modules, the limitations of unicycle vehicles in sensor dependence, control parameter fixation, fault handling and data credibility are solved, and higher balanced control performance and environmental adaptability are achieved.

CN120065701AActive Publication Date: 2025-05-30HUAQIAO UNIVERSITY

Patent Information

Application Number
CN202510542496.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-05-30
Estimated Expiration
2045-04-28

AI Technical Summary

Technical Problem

Existing self-balancing unicycle vehicles have limitations in sensor dependence, control parameter fixation, fault handling and data credibility, making it difficult to maintain balance and environmental adaptability in multiple scenarios.

Method used

The self-balancing unicycle control system based on cascade PID control and multi-sensor fusion is adopted. The main controller performs data fusion, cascade PID control, adaptive parameter adjustment, fault detection and data recording and verification in real time, and combines the inertial balance flywheel and multi-sensor module to realize the self-balancing and motion control of the vehicle.

Benefits of technology

It improves the balance control performance, environmental adaptability and system safety and reliability of wheelbarrows in multiple scenarios, and can maintain stable operation in complex terrain and special environments, reducing the risk of control instability and imbalance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120065701A_ABST
    Figure CN120065701A_ABST
Patent Text Reader

Abstract

The invention discloses a self-balancing wheelbarrow control system and method based on cascade PID and multi-sensor fusion, and the system employs various sensors such as an IMU, an encoder, a magnetometer and the like, and achieves the high-precision estimation of the real-time attitude (longitudinal inclination angle, lateral inclination angle and course angle) and speed of a vehicle through Kalman filtering. The target longitudinal inclination angle is adjusted through the outer ring PID, the inner ring PID controls the driving motor to generate the needed torque, and meanwhile the lateral control module is used for driving the inertia flywheel to achieve auxiliary steering and left-right balance. The stability of the system is guaranteed by a self-adaptive participation fault detection mechanism, and the communication module records and verifies key operation data in combination with a block chain technology. The system is suitable for complex scenes such as logistics distribution and dangerous environment inspection, and has the advantages of compact structure, high control precision and safe and reliable data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of self-balancing electric vehicles and robot control, and in particular to a self-balancing unicycle control system and method based on cascade PID and multi-sensor fusion. Background Art

[0002] A self-balancing vehicle is a transport or mobile robot that can automatically maintain balance by relying on its own control system, including classic two-wheeled balancing vehicles and unicycle balancing vehicles. Among them, two-wheeled self-balancing robots have been widely studied and applied. Since this type of two-wheeled balancing vehicle has two support points, the control is relatively simple. However, a unicycle self-balancing vehicle (i.e., a balancing vehicle with only a single wheel) has the advantages of simpler structure, lighter weight, and higher flexibility because only one wheel is in contact with the ground, but its dynamic characteristics are more complex and the control difficulty is significantly increased.

[0003] First, most existing self-balancing unicycles only use a single attitude sensor (such as a simple gyroscope / accelerometer combination) and a fixed-parameter PID control algorithm to maintain balance. When the environment changes (such as changes in road slope, wind disturbance) or the load changes (such as changes in the center of gravity caused by carrying cargo), the fixed-parameter controller is difficult to adapt in a timely and effective manner, and is prone to unstable control, overshoot, or even unbalanced falling. Secondly, when the unicycle is running in complex terrain (such as rugged roads, ramps) or special environments (such as inspections in dangerous areas), the requirements for sensor accuracy and robustness are higher, but the existing technology often lacks multi-sensor fusion means, and the reliance on a single sensor leads to insufficient anti-interference ability. Once the sensor drifts or fails, the vehicle may not be able to maintain balance, posing a safety hazard. In addition, the existing unicycle balancing system rarely considers fault redundancy and data trustworthiness. For example, when multiple autonomous mobile devices work together or are remotely monitored, there is a lack of effective mechanisms to ensure the reliability and security of control instructions and sensor data. With the development of emerging technologies such as artificial intelligence and blockchain, the introduction of these cross-domain technologies into unicycle control is expected to significantly improve its intelligence and operational reliability. However, there is currently no mature solution to effectively integrate the above technologies into a unicycle self-balancing control system. Summary of the invention

[0004] Technical purpose: In view of the limitations of the prior art unicycle self-balancing vehicles in terms of sensor dependence, fixed control parameters, fault handling and data credibility, the present invention discloses a self-balancing unicycle control system and a control method based on cascade PID control and multi-sensor fusion, which improves the balance control performance, environmental adaptability and system safety and reliability of the unicycle in multiple scenarios.

[0005] Technical solution: To achieve the above technical objectives, the present invention adopts the following technical solution: A self-balancing unicycle control system based on cascade PID and multi-sensor fusion, comprising: A main drive module for driving the single wheel provided on the vehicle to achieve forward and backward movements; An inertial balance flywheel module, which includes an inertial balance flywheel and its drive mechanism, for generating a lateral reaction torque through the rotation of the inertial balance flywheel to adjust the lateral inclination angle of the vehicle; A multi-sensor module, including an inertial measurement unit, a magnetometer, a wheel encoder, and an environmental sensor, for collecting the inclination angle, angular velocity, heading, speed, and environmental information of the vehicle; A main controller, electrically connected to the multi-sensor module, the main drive module, the inertial balance flywheel module, and the communication module, for performing real-time data fusion, cascade PID control, adaptive parameter tuning, fault detection, and data recording and verification; A lateral control module, which is provided in or cooperates with the main controller. The lateral control module is used to calculate the target lateral inclination angle according to the lateral state and steering requirements of the vehicle, and convert the target lateral inclination angle into a control command for the inertial balance flywheel; A communication module for realizing wireless data communication between the vehicle and an external monitoring platform or other vehicles, and recording and verifying the real-time attitude and motion control data of the vehicle through blockchain technology; A power supply module for providing a stable DC power supply for each module of the system.

[0006] Preferably, in the multi-sensor module, the inertial measurement unit includes a three-axis gyroscope and a three-axis accelerometer, and the collected data is used to estimate the longitudinal inclination angle, lateral inclination angle, and heading angle of the vehicle in real time after data fusion.

[0007] Preferably, the data fusion implemented by the main controller adopts an adaptive complementary filtering algorithm, and its filtering formula is: , where, is the estimated longitudinal inclination angle of the vehicle at the k-th moment, is the angular velocity of the three-axis gyroscope on the lateral axis, is the sampling period, is the inclination angle calculated according to the measurement of the three-axis accelerometer, is the filtering gain adaptively adjusted according to the vehicle motion state.

[0008] Preferably, the cascade PID control implemented by the main controller includes an outer loop and an inner loop. The outer loop PID control takes the error ev = vref - v between the vehicle target speed vref and the actual speed v as the input, and outputs the target longitudinal inclination angle. Its control law is: , where, , and are the proportional, integral, and derivative control gains of the outer - loop PID respectively; The inner - loop PID control takes the error between the actual longitudinal inclination angle obtained by fusing with the sensor as the input, and outputs the torque command for driving the wheel motor, and its control law is: , wherein, , and are the proportional, integral, and derivative control gains of the inner - loop PID respectively.

[0009] Preferably, the main controller further includes an adaptive parameter - tuning module for monitoring the control performance index and automatically adjusting the PID control gains according to this index to achieve the purpose of optimizing control response and stability, where is the change rate of the wheel output torque, and w1, w2, w3 are preset weight coefficients.

[0010] Preferably, the main controller further includes a fault - detection module for real - time monitoring of the data of each sensor and the output state of the driver. When data anomalies or deviations from the predetermined range are detected, redundant or backup control strategies are automatically enabled to ensure the continuous and stable operation of the system.

[0011] Preferably, the communication module uses blockchain technology to generate a data digest of the key data during the vehicle operation process, and combines the timestamp and hash verification to record the data chain, ensuring the immutability and traceability of the data during the transmission and storage processes.

[0012] Preferably, the lateral - control module calculates the target lateral inclination angle φref by combining the vehicle driving state and the steering command, and converts the target lateral inclination angle into the control command τf of the inertial balance flywheel to drive the inertial balance flywheel module to adjust the vehicle lateral balance and assist in steering.

[0013] A self - balancing unicycle control method based on cascade PID and multi - sensor fusion, which is applied to a self - balancing unicycle control system based on cascade PID and multi - sensor fusion as described above, includes the following steps: S1. After the vehicle is powered on, the main controller calibrates the multi - sensor module to determine the initial attitude of the vehicle; S2. Periodically collect the original data of each sensor, and fuse the data through the adaptive complementary filtering or extended Kalman filtering method to obtain the actual longitudinal inclination angle θ, lateral inclination angle φ, heading angle ψ, and actual speed v of the vehicle;​ S3. Calculate the target longitudinal inclination angle according to the error ev between the target vehicle speed vref and the actual speed v , with the error between and the actual longitudinal inclination angle θ as the input, calculate the torque command of the drive motor . At the same time, according to the lateral state and steering requirements of the vehicle, the lateral control module calculates the target lateral inclination angle φref and converts it into the control command of the inertial balance flywheel; S4. Output the calculated torque command and control command to the main drive module and the inertial balance flywheel module respectively to achieve vehicle attitude adjustment and motion control; S5. Through the feedback of the real-time monitoring system, adaptively adjust the PID parameters, and enable redundant or backup control strategies when anomalies are detected; S6. Upload the real-time attitude and motion control data of the vehicle through the communication module, and use blockchain technology to record the data in an immutable manner; S7. Repeat steps S2 to S6 to achieve closed-loop control of vehicle self-balancing and motion.

[0014] Beneficial effects: A self-balancing unicycle control system and method based on cascade PID and multi-sensor fusion provided by the present invention have the following beneficial effects: By fusing the information of multiple sensors such as gyroscopes, accelerometers, magnetometers, and encoders, the present invention greatly improves the accuracy and reliability of perceiving the vehicle attitude and motion state. In particular, the attitude calculation algorithm and the adaptive complementary filtering strategy are adopted, so that the longitudinal and lateral inclination angle estimations can still remain stable during dynamic motion without obvious drift. Compared with the prior art that only relies on a single IMU, the multi-sensor fusion mechanism of the present invention can achieve mutual correction when the sensors have noise or deviation. Even if individual sensors fail, the attitude estimation can still be maintained relying on redundant information to ensure the continuous balance of the vehicle.

[0015] The present invention designs an innovative cascade PID dual-loop control structure for unicycle attitude and translational control, decoupling and coordinating high-speed inclination stabilization and low-speed speed control. At the same time, an artificial intelligence algorithm is introduced to adaptively optimize the PID parameters, enabling the controller to automatically adjust the control gain according to load changes and terrain conditions. Compared with traditional fixed-parameter control, the recovery time, larger stable domain, and tracking accuracy of this system under disturbances are all improved. For example, when starting on a steep slope or under heavy load, the AI-optimized controller can dynamically enhance the output, thereby maintaining balance and smooth acceleration, avoiding the common hysteresis or oscillation problems in the prior art.

[0016] Different from most of the self-balancing scooter solutions that only control the pitch angle, the present invention realizes the active balance control in the left-right direction of a unicycle by integrating an inertial balance flywheel inside the vehicle body. This structure provides a means of adjusting the lateral torque independent of the ground, enabling the vehicle not only to stand and balance itself at rest, but also to safely turn by tilting during high-speed driving. Compared with the existing lateral stability methods that require the cooperation of passengers or rely on simple mechanical supports, the lateral balance control of the present invention has a faster response and higher precision, and can achieve stable steering in the case of driverless. When the vehicle is driving on complex terrains, even if it is disturbed by lateral winds or the like, it can adjust its attitude in time through the inertial flywheel, significantly improving the safety of the unicycle operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art.

[0018] Figure 1 Schematic diagram of the control system structure of the self-balancing unicycle vehicle of the present invention; Figure 2 Schematic diagram of the control method flow of the self-balancing unicycle vehicle of the present invention; Figure 3 Schematic diagram of the closed-loop structure of sensor fusion and state estimation. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0019] The following will more clearly and completely illustrate the present invention by way of a preferred embodiment in conjunction with the drawings, but the present invention is not limited thereto within the scope of the described embodiments.

[0020] As Figure 1 shown, a self-balancing unicycle vehicle control system based on cascade PID and multi-sensor fusion includes: A main drive module for driving the single wheel provided on the vehicle to achieve forward and backward movement; An inertial balance flywheel module, which includes an inertial balance flywheel and its drive mechanism, for adjusting the lateral tilt angle of the vehicle by generating a lateral reaction torque through the rotation of the inertial balance flywheel; The vehicle body of the self-balancing unicycle is supported by a rigid frame, and includes a main driving wheel and a main driving module coaxially connected to the main driving wheel. In one embodiment, the main driving module is a main driving motor. The main driving motor is used to drive the wheel to rotate forward and backward, so as to realize the forward, backward and dynamic balance control of the vehicle. An inertial balance flywheel is also installed on the vehicle body, and the inertial balance flywheel is controlled to rotate by an independent balance driving motor. The rotation axis of the inertial balance flywheel is arranged along the forward direction of the vehicle (i.e., horizontally pointing forward and backward). By adjusting the rotation angular velocity and acceleration of the inertial balance flywheel, a reaction torque around the forward direction axis can be generated, which is used to adjust the lateral tilt attitude of the vehicle and maintain the balance in the left and right directions or realize controlled steering. Necessary mechanical connection structures are provided on the vehicle body to fix the above motors and wheel sets, and shock absorption components can be installed according to needs to buffer ground impacts.

[0021] A multi-sensor module, including an inertial measurement unit, a magnetometer, a wheel encoder, and an environmental sensor, is used to collect the inclination angle, angular velocity, heading, speed, and environmental information of the vehicle; This module includes, but is not limited to: an inertial measurement unit IMU, a magnetometer, a wheel encoder, and an optional environmental perception sensor. The inertial measurement unit IMU includes a three-axis gyroscope and a three-axis accelerometer, which are used to measure the angular velocity and acceleration of the vehicle body; the magnetometer is used to measure the heading angle, that is, the orientation of the vehicle relative to the geomagnetic field; the wheel encoder is used to measure the rotation angle and speed of the main wheel, so as to calculate the forward speed and mileage of the vehicle; the environmental perception sensor can be selected such as an ultrasonic / laser rangefinder, which is used to detect terrain obstacles in front, and a camera is used for visual-assisted balance or path tracking, etc.

[0022] The above sensors are connected to the main controller through a data bus to realize real-time data acquisition. Among them, the IMU provides the original measurement of the vehicle attitude, the magnetometer provides the heading reference, and the wheel encoder provides the speed feedback. The data of each sensor will be time-synchronized and fused in the main controller to obtain a high-precision and anti-interference attitude and motion state estimation.

[0023] The main controller is electrically connected to the multi-sensor module, the main driving module, the inertial balance flywheel module, and the communication module, and is used to perform data fusion, cascade PID control, adaptive parameter adjustment, fault detection, and data recording and verification in real time; The main controller is the brain part for executing the control algorithm, usually composed of a high-performance microprocessor or an FPGA / DSP control board. The main controller communicates with the above-mentioned multi-sensor module and the motor, and runs the control software of the present invention. The control software includes an attitude solution and state estimation module, a cascade PID control module, an adaptive parameter adjustment module, a fault detection and data recording module, etc. The main controller calculates the current attitude angles (including longitudinal inclination angle and lateral inclination angle), angular velocity, speed and other state variables of the vehicle according to the result of sensor fusion, and then calculates the target outputs of the main drive motor and the balance drive motor according to the set control strategy, so as to achieve closed-loop control. An artificial intelligence algorithm module is also integrated inside the main controller, which is used to optimize and adjust the parameters of the PID controller and intelligently discriminate and process abnormal situations; at the same time, the main controller has data encryption and communication interfaces, which are used to implement functions such as blockchain data verification and remote monitoring.

[0024] In one embodiment, the main controller further includes an adaptive parameter adjustment module for monitoring control performance indicators and automatically adjusting the PID control gain according to this indicator to achieve the purpose of optimizing control response and stability, where is the change rate of the wheel output torque, and w1, w2, and w3 are preset weight coefficients.

[0025] In one embodiment, the main controller further includes a fault detection module for real-time monitoring of the data of each sensor and the output state of the driver. When data anomalies or deviations from the predetermined range are detected, redundant or backup control strategies are automatically enabled to ensure the continuous and stable operation of the system.

[0026] The lateral control module is arranged inside the main controller or works in cooperation with it. The lateral control module is used to calculate the target lateral inclination angle according to the lateral state of the vehicle and the steering requirement, and convert the target lateral inclination angle into a control command for the balance flywheel; The lateral control module is a part of the unicycle control system for coordinating the left and right stability and steering control of the vehicle. Specifically, the functions of this module include: Collect lateral state data: Use the lateral inclination angle φ obtained from the inertial measurement unit IMU installed on the vehicle and the heading data from the magnetometer or additional sensors to judge the lateral stability of the vehicle in real time; Calculate the lateral target inclination angle: According to the predetermined steering requirement or path planning instruction during the operation of the vehicle, calculate the desired lateral target inclination angle φref. When the vehicle needs to turn or correct the lateral balance, this module generates a target inclination angle signal according to the deviation between the current lateral state of the vehicle and the expected trajectory; Output balance flywheel control command: Convert the calculated target inclination signal into a control signal, that is, the control command of the inertial balance flywheel (such as the corresponding torque command τf). This control command is sent to the inertial balance flywheel drive module through a digital signal to adjust the flywheel rotation speed, so that the vehicle can achieve lateral balance and steering adjustment through the flywheel reaction force.

[0027] Communication module, used to realize wireless data communication between the vehicle and an external monitoring platform or other vehicles, and record and verify the vehicle's real-time attitude and motion control data through blockchain technology; The communication module provides wireless data communication interfaces such as Wi-Fi, Bluetooth, cellular network or a dedicated Internet of Things communication module. On the one hand, it is used for data interaction between multiple single-wheel vehicles or between the vehicle and the background control center, supporting collaborative work or remote control; on the other hand, it cooperates with the blockchain network to upload the vehicle's key status data or events to the blockchain for evidence storage. The key control data is the vehicle's real-time attitude and motion control data, including but not limited to the vehicle's longitudinal inclination angle, lateral inclination angle, heading angle, forward speed, torque command of the main drive module, control torque command of the balance flywheel module, adaptive parameter adjustment record, fault detection log, real-time position information and power status data. The communication module is connected to the main controller, and the main controller obtains the data to be sent and provides the received remote instructions to the main controller for processing. In the blockchain application, the main controller of each vehicle can act as a node, generate data blocks from the key information of the sensor, calculate the verification value through an encryption algorithm and broadcast it to the network to achieve data consistency and credibility among multiple devices.

[0028] Power supply module, used to provide a stable DC power supply for each module of the system.

[0029] The power supply module includes a power battery pack and a power management circuit, which provides the required electrical energy for the entire vehicle system. The power supply module can output a stable DC voltage, which is supplied to the main drive motor, balance drive motor, main controller, and each sensor and communication module respectively. The power management circuit includes overcurrent and overvoltage protection, power monitoring, and an emergency power-off device when necessary, ensuring the safe and reliable power supply of the system. When the battery power is insufficient, the main controller can receive the power information to make corresponding control strategy adjustments (such as limiting the maximum speed to extend the battery life, etc.).

[0030] As Figure 2 shown, the present invention also provides a self-balancing unicycle control method based on cascade PID and multi-sensor fusion, which is applied to a self-balancing unicycle control system based on cascade PID and multi-sensor fusion as described above, and includes the following steps: S1. After the vehicle is powered on, the main controller calibrates the multi-sensor module to determine the initial attitude of the vehicle; After the system is powered on, the main controller first performs initialization, including calibration of each sensor and zero setting, and establishing the alignment between the vehicle coordinate system and the sensor coordinate system. The initial inclination offset is obtained by stationary the vehicle, and the attitude quaternion or direction cosine matrix is initialized using the inertial navigation attitude solution method to ensure the accuracy of the initial attitude estimation. The blockchain node initializes the local ledger and records a data block of a system startup event (with timestamp).

[0031] S2. Periodically collect the raw data of each sensor, and fuse the data through an adaptive complementary filtering or extended Kalman filtering method to obtain the actual longitudinal inclination angle θ, lateral inclination angle φ, heading angle ψ and actual speed v of the vehicle; The main controller collects the data of each sensor at a fixed frequency: the IMU outputs the angular velocity (p, q, r) and acceleration (ax, ay, az) of the vehicle on the three axes, the magnetometer outputs the heading angle reference value, and the encoder outputs the wheel speed etc. Input these raw data into the attitude solution and state estimation module, and calculate the state quantities such as the longitudinal inclination angle θ (front-back tilt angle), lateral inclination angle φ (left-right tilt angle), heading angle ψ, and forward speed v of the vehicle through a fusion algorithm. The present invention adopts an improved sensor fusion algorithm: mainly relying on gyroscope integration to obtain attitude changes during high-speed dynamic motion, adding accelerometer signals to correct drift in a static state, and combining with a magnetometer to eliminate heading drift. Specifically, the controller uses an adaptive complementary filtering or extended Kalman filtering method to give adaptive weights to different sensor data. For example, for the estimation of the longitudinal inclination angle φ, a weighted fusion formula is defined: , where, is the estimated longitudinal inclination angle of the vehicle at the kth moment, is the angular velocity of the three-axis gyroscope on the lateral axis, is the sampling period, is the inclination angle calculated according to the measurement of the three-axis accelerometer, is the filtering gain adaptively adjusted according to the vehicle motion state. When the vehicle acceleration changes violently, appropriately increase to rely more on gyro integration prediction; when the vehicle tends to be stationary or in uniform linear motion, reduce to use accelerometer feedback to eliminate zero drift. Similarly, the estimation of the lateral inclination angle φ is calculated complementarily by combining the angular velocity of the gyroscope around the x-axis and the lateral reading of the accelerometer. Through the above fusion, accurate and smooth attitude angle signals and system states such as angular velocity and speed are obtained.

[0032] Such as Figure 3As shown, it mainly shows how the vehicle collects data using different sensors and how to obtain an accurate state estimate through data fusion. The arrows indicate the path of data flowing from each sensor to the Kalman filter and then from the filter to the state estimation module, demonstrating the process of closed-loop data fusion.

[0033] S3. Calculate the target longitudinal tilt angle according to the error ev between the target speed vref of the vehicle and the actual speed v , taking the error between and the actual longitudinal tilt angle θ as the input, calculate the torque command of the drive motor . At the same time, according to the lateral state and steering requirements of the vehicle, the lateral control module calculates the target lateral tilt angle φref and converts it into the control command of the balance flywheel; The main controller calculates the control output according to the desired motion command and the current estimated state in each control cycle. The present invention adopts an innovative cascade PID control structure to achieve the attitude and speed control of the unicycle vehicle, including the double-loop control in the longitudinal direction (front and back direction) and the balance control in the lateral direction (left and right direction).

[0034] The longitudinal control adopts a cascade double-loop PID structure. The outer loop is a speed / displacement control loop, and the inner loop is an attitude angle control loop. The outer-loop PID takes the error ev = vref - v between the desired forward speed vref (or position command) of the vehicle and the current actual speed v as the input, and outputs the set value of the desired longitudinal tilt angle . For example, the outer-loop control law can be expressed as: , where , and are the proportional, integral, and differential control gains of the outer-loop PID respectively, and their values can be pre-tuned according to the vehicle dynamics parameters or adjusted online by the adaptive module described later; The inner-loop PID takes the error between the target longitudinal tilt angle and the current actual longitudinal tilt angle θ obtained by sensor fusion as the input, and calculates the torque command required to be output by the main drive motor. Its control law is, for example: , where , and are the proportional, integral, and differential control gains of the inner-loop PID respectively. The main controller is based on Calculate appropriate motor control signals (such as PWM duty cycle), and drive the main drive motor through the motor drive module to accelerate or decelerate the rotation of the wheels, so as to adjust the front and rear tilt angles of the vehicle, maintain longitudinal balance or generate the required front and rear motion accelerations.

[0035] Under the cascade control structure, the outer loop is responsible for slower speed dynamics and long-period error correction, and the inner loop is responsible for quickly correcting the attitude tilt angle error. By reasonably designing the two-stage PID parameters, the vehicle can balance fast response and steady-state accuracy: the inner loop provides rapid suppression of tilt disturbances, and the outer loop ensures that the vehicle follows the desired speed without long-term deviation. The cascade PID control scheme of the present invention draws on the double-loop regulation idea in flexible robot control, decoupling the motor-body elastic inverted pendulum system into tilt control and speed control parts, greatly simplifying the controller design difficulty and improving the robustness.

[0036] S4. Output the calculated torque command and control command to the main drive module and the inertial balance flywheel module respectively to achieve vehicle attitude adjustment and motion control; Lateral control mainly targets the balance of the vehicle's left and right tilts (i.e., φ) and steering motion control. When driving straight normally, the desired lateral tilt angle is 0, that is, the vehicle maintains a vertical balance perpendicular to the ground; when turning is required, give the vehicle an appropriate lateral tilt angle command φref to make the vehicle tilt and turn (similar to the body tilt of a bicycle when turning to obtain lateral centripetal force). The present invention realizes lateral tilt angle control through an inertial balance flywheel and its balance drive motor. The main controller collects and fuses the estimated current lateral tilt angle φ and possible steering commands (turning radius or desired heading change), and calculates the control command τf that the inertial balance flywheel needs to provide through a simple PID or other control algorithms. An implementation example of lateral control is: using proportional-derivative control to stabilize the roll, , where Kpr and Kdr are the gains of lateral balance control, is the target lateral tilt angle, is the desired change rate of the target lateral tilt angle, is the change rate of the current actual lateral tilt angle. When = 0, this controller will stably control the lateral tilt angle φ near 0; when turning is required, for example, when turning left, set >0 A proper tilt angle. The controller drives the inertial balance flywheel to accelerate or decelerate so as to tilt the vehicle body to the right (generating the tilt required for a left turn), so that the vehicle naturally turns along a curve during forward movement. The high-speed rotation of the inertial balance flywheel adjusts the tilt of the vehicle body while not directly contacting the ground, does not affect the forward speed, and only provides an internal torque. Therefore, by coordinating the acceleration and deceleration of the main wheels and the angular velocity change of the inertial balance flywheel, the unicycle of the present invention can simultaneously achieve stable balance control and steering motion control in both the front-rear and left-right directions.

[0037] S5. Through the feedback of the real-time monitoring system, adaptively adjust the PID parameters, and enable redundant or backup control strategies when anomalies are detected; The present invention designs a real-time fault detection and redundancy correction mechanism in the control system to improve the reliability of the system. When the multi-sensor fusion module detects that the data of a certain sensor deviates from the reasonable range or has not been updated for a long time, the main controller will determine that the sensor may be faulty, and immediately initiate an emergency strategy: for example, if the gyroscope fails, temporarily increase the weight of the accelerometer signal in attitude calculation, and enable the backup gyroscope (if there is a redundant IMU in the system); if an abnormality occurs in the main drive motor or its drive circuit, the controller immediately limits the output and notifies the upper management system, and at the same time tries to assist the vehicle to decelerate and stop stably by adjusting the rotation of the inertial balance flywheel to prevent sudden imbalance. The system also provides redundant designs for key components, such as optionally installing dual gyroscopes / accelerometers, dual power switching devices, etc., to tolerate single-point failures. The fault detection module timely discovers anomalies by analyzing the consistency of sensor data (such as comparing the differences in readings of dual-channel sensors), monitoring the response of the control loop (such as whether the expected attitude change matches the actual one), etc., and adopts a predetermined fault-tolerant control strategy to ensure the safety of the vehicle. Moreover, with the help of the communication module, the vehicle can also upload the fault information to the blockchain network in real time for broadcasting, inform other cooperating nodes to avoid or request support, and write the sensor data before and after the fault occurs into the blockchain for post-event analysis to ensure that these data cannot be tampered with.

[0038] S6. Upload the real-time attitude and motion control data of the vehicle through the communication module, and use blockchain technology to record the data in an immutable manner; In the background of the control process, the main controller continuously records the operation data of the vehicle, including the time series of sensor readings, control instruction outputs, key events (such as sudden acceleration, sudden stop, collision, fall, etc.). Different from traditional vehicles that only store data locally, the present invention introduces blockchain technology into the data recording link: the controller submits the selected important data digest to a preset blockchain network through the communication module. The blockchain node records the timestamp and performs hash verification on the data, such as generating a hash value for the state data at each moment. And form a chained record, so that any subsequent data tampering will damage the hash chain and be detected, where represents the hash value generated at the previous moment, represents the state data at the current moment, and the symbol represents the concatenation operation, that is, and are concatenated and used as input for hash calculation. This mechanism ensures that when multiple machines work together, the data reported by each unicycle vehicle is credible, facilitating remote supervisors or upper-level systems to review and trace the task execution. In addition, through smart contracts, automatic monitoring of the behavior of unicycle vehicles can be achieved. For example, when a vehicle has multiple events of excessive abnormal inclination, a maintenance warning is triggered. The data verification and sharing mechanism of the blockchain improves the transparency and security of the system operation, providing a guarantee for the application of self-balancing unicycle vehicles in fields with high safety requirements such as intelligent security patrol and unmanned delivery.

[0039] S7. Repeat steps S2 to S6 to achieve closed-loop control of vehicle self-balancing and movement.

[0040] Embodiment 1

[0041] A self-balancing unicycle vehicle provided in this embodiment includes a unicycle body and its control system. The unicycle body is supported by a frame made of strong and lightweight materials. A main driving wheel is installed at the lower part of the frame through bearings. The main driving wheel is directly driven by a brushless DC motor as the main driving motor. The motor shaft is fixedly connected to the wheel axle and can output bidirectional torque to drive the wheel to rotate forward or backward. The tire of the wheel can use an inflated tire or a solid tire to balance shock absorption and durability. An inertial balance flywheel is installed at the central position inside the vehicle body near the wheel axle. Its axis is horizontally arranged along the front and back directions of the vehicle body and is installed on the frame through bearings. The inertial balance flywheel is driven by a balance driving motor, and its shaft is fixedly connected to the inertial balance flywheel. The inertial balance flywheel itself is made of high-density materials to increase the moment of inertia and is designed with an appropriate aerodynamic shape to reduce resistance and noise during high-speed rotation. The balance driving motor selects a high-speed motor with fast response. By precisely controlling its acceleration and deceleration, the angular velocity of the inertial balance flywheel can be changed within a short time, thereby applying a roll moment to the vehicle body.

[0042] In terms of sensors, the vehicle in this embodiment is equipped with a high-performance six-axis inertial measurement unit as part of the multi-sensor module. The gyroscope has a range of ±500° / s, the accelerometer has a range of ±4g, and the sampling frequency can reach 1kHz, enabling fine capture of the vehicle's angular motion and acceleration / deceleration changes. In addition, a three-axis magnetometer is integrated to provide an absolute heading reference. An optical encoder is installed on the axle of the main wheel, which is another part of the multi-sensor module used to measure the wheel speed and the angle turned, realizing odometer and speed calculations. The resolution of this encoder is 500 pulses per revolution, and the speed measurement accuracy can reach ±0.1m / s when combined with the wheel diameter calculation. To enhance the environmental adaptability, this embodiment also installs a pair of ultrasonic ranging sensors at the front of the vehicle body (regarded as part of the expansion of the multi-sensor module) to detect the distance to obstacles on the front road and the height change of the ground. If necessary, a wide-angle camera can also be installed on the top to cooperate with the image processing algorithm to identify terrain landmarks or road driving trajectories. In the vehicle electronic control part, an embedded ARM Cortex-M7 microcontroller is used as the core processor of the main controller, with a main frequency of 300MHz and a built-in floating-point operation unit to meet the requirements of real-time filtering and control calculations. Necessary AD conversion interfaces for sensor signal acquisition, PWM and DAC interfaces for motor control, and CAN / serial ports for communication module connection are integrated on the controller board. In this embodiment, a 4G cellular communication module is used for the communication module to ensure that the vehicle can maintain data communication with the remote server or other vehicles in the outdoor wide-area environment; at the same time, it also supports the local Wi-Fi network for easy debugging and short-distance vehicle group collaboration. The power module uses a set of high-rate lithium-ion batteries to provide 24V direct current with a rated capacity of 5000mAh, which can support the vehicle to run for more than 2 hours. The battery management system monitors the voltage, current, and temperature in real time and reports the battery power status through the interface provided by the main controller. When the battery power is low, the control algorithm automatically enters the energy-saving mode or notifies the operator to replace the battery.

[0043] Embodiment 2

[0044] This embodiment details the implementation steps and parameter selection of the control algorithm.

[0045] In the system power-on initialization stage, the main controller reads the stored sensor calibration parameters and compensates for the gyroscope zero bias and accelerometer static bias. Subsequently, the main controller runs the attitude initialization program: assuming the vehicle is initially stationary, the gravity direction is determined through the accelerometer readings, thereby calculating the initial longitudinal tilt angle and lateral tilt angle , and the heading angle of the vehicle Set as the reference direction of the magnetometer reading. Then, by combining the integration of the gyroscope angular velocity and the direction of the accelerometer gravity vector, the quaternion attitude update algorithm is used to quickly establish an initial estimate of the vehicle attitude. After initialization, the main controller enters the main loop control.

[0046] In each control loop (in this embodiment, the period △t = 5ms is adopted, corresponding to a control frequency of 200Hz), the main controller first obtains the latest angular velocity (p, q, r) and acceleration (ax, ay, az) data from the IMU, obtains the wheel angular increment from the encoder and calculates the current speed v, and reads the heading change from the magnetometer. . After these data are aligned by timestamp, they are input into the Kalman filter. The state vector of the filter includes , where θ is the longitudinal inclination angle of the vehicle, is its change rate, φ is the lateral inclination angle, is the change rate of the lateral inclination angle, v is the forward speed, and ψ is the heading angle. The state equation is constructed based on the simplified dynamic model of the unicycle. To improve the model accuracy, the filter considers the influence of wheel rotation on the longitudinal inclination angle and the influence of the rotation of the inertial balance flywheel on the lateral inclination angle, and assumes that the kinematic relationship is approximately linear within a small inclination range. The measurement equation consists of the inclination measurement of the accelerometer, the angular velocity of the gyroscope, the speed of the encoder, etc. Through Kalman filter iteration, the main controller obtains an optimized estimate of the above states , and etc. At the same time, the system compares the data of the dual-redundant IMU (if installed) to detect whether the sensor drift exceeds the threshold. If so, the corresponding sensor is marked as abnormal.

[0047] Subsequently, the main controller determines the target motion parameters according to the high-level instructions. For example, in this embodiment, the target forward speed vref and the target heading (or turning radius) ψref are set. Assuming that the vehicle is currently desired to maintain static in-place balance, then vref = 0 and ψref is equal to the current orientation. In this case, the outer-loop speed PID will drive the vehicle speed error to zero. If the vehicle is desired to move forward or backward, the corresponding vref value is set; if a turn is required, the required lateral inclination angle (for example, according to a simple balanced turning model , where R is the turning radius and g is the acceleration due to gravity). In each cycle, the outer-loop PID calculates according to vref and , and the inner-loop PID calculates the torque command of the main drive motor according to and . At the same time, the lateral control module calculates according to φref and Calculate the control command τf of the inertial balance flywheel motor. The main controller will It is converted into the required motor current or PWM, and the motor model is used to estimate the actual acceleration obtained, and the motor lag is compensated by feedforward. For the inertial balancing flywheel control, τf is also converted into a command to accelerate or decelerate the inertial balancing flywheel, and then output to the main motor and the balancing motor through the drive circuit.

[0048] After the control is executed, the main controller updates the adaptive adjustment module. This module reads the control effect of this cycle, such as Is the tracking stable? And the speed error convergence. If it is found that some error terms are too large for several consecutive cycles, or the system shows an oscillation trend, the parameter adjustment algorithm is triggered. For example, in this embodiment, when under-damped oscillation is detected in the inner loop tilt control, the system calls the tuning rule to slightly increase Kd2 (tilt PID differential gain) to increase damping; when it is found that the vehicle responds slowly to the outer loop speed command and there is no overshoot, Kp1 can be appropriately increased to enhance the speed following performance. This adjustment amplitude is set small and the frequency is limited to ensure that parameter changes do not undermine system stability. At the same time, all parameter adjustments and corresponding environmental conditions will be recorded as data for improving the control strategy in the future. After a period of operation, the parameters will gradually approach the optimal value, thereby improving the control performance globally.

[0049] In this embodiment, the vehicle control achieved by the above method is as follows: when a new forward speed command is given, the vehicle will slightly tilt forward to accelerate, and then return to the upright position after reaching the target speed; when braking or backing up is required, the vehicle will tilt backward to generate braking torque; regardless of acceleration or deceleration, the vehicle body always swings around the vertical posture in a small range, and the riding platform remains stable. Laterally, when the vehicle is moving straight, any slight roll deviation is corrected by fine-tuning the inertial balance flywheel. When turning is required, the vehicle body tilts smoothly according to the calculated inclination angle, and returns to upright position after the turn is completed. When the load changes suddenly (for example, adding a heavy object on the top), the controller's adaptive module will automatically adjust the inclination zero point and PID gain, and the driver will hardly notice obvious imbalance or control hysteresis. When multiple vehicles are running in coordination, the controller of each vehicle shares its own status and position through the communication module. When another vehicle is found approaching, it will automatically slow down and deflect to avoid it. The relevant data is synchronously recorded on the blockchain to ensure traceability afterwards.

[0050] Example 3

[0051] This embodiment describes an application scenario of the present invention in autonomous inspection in a hazardous environment. The inspection unicycle robot needs to move autonomously in industrial facilities with narrow passages and obstacles and regularly upload inspection data. After adopting the control system of the present invention, the robot can give full play to its advantages of being small and flexible, while ensuring stability and data security. During the inspection route, the robot needs to start and stop frequently and bypass obstacles. This poses high requirements for balance control: every time it stops, it means a rapid transition from the driving state to the static balance state; bypassing obstacles requires turning around within a limited space. The cascade PID control of the present invention, combined with the flywheel balance mechanism, ensures that the robot will not fall forward or backward when making an emergency stop, but will stop steadily. When turning, the robot calculates an appropriate lateral tilt angle φref and cooperates with the forward speed to smoothly turn within a very small radius. The flywheel reaction torque is used to quickly adjust the attitude to avoid hitting the wall. During the whole process, the multi-sensor fusion module maintains an accurate estimation of the attitude. Even when the magnetometer fails due to the metal environment, the gyroscope and accelerometer can still be relied on to maintain heading calculation for a short time. After detecting an abnormality in one ultrasonic sensor, the fault detection module immediately notifies the controller to switch to the single-probe mode and reduces the vehicle speed to compensate for the halved field of view. All inspection data (including driving trajectories, environmental measurement values, abnormal alarms, etc.) are uploaded in real time through the blockchain network, ensuring that the data cannot be tampered with and can be immediately viewed by remote monitoring personnel. When the inspection is completed and the robot returns to the base, the system generates a blockchain data report for this mission, including the driving mileage, balance state log, number of alarms occurred, etc., providing a basis for equipment maintenance. It can be seen that the control system of the present invention improves the reliability, safety and data credibility of the unicycle robot in the application of hazardous environment inspection.

[0052] The above are only the preferred embodiments of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. A self-balancing unicycle control system based on cascade PID and multi-sensor fusion, characterized in that: include: The main drive module is used to drive the single wheel of the vehicle to realize forward and backward movement; An inertial balancing flywheel module, the module comprising an inertial balancing flywheel and a driving mechanism thereof, for adjusting the lateral tilt angle of the vehicle by generating a lateral reaction torque through the rotation of the inertial balancing flywheel; Multi-sensor module, including inertial measurement unit, magnetometer, wheel encoder and environmental sensor, used to collect vehicle inclination, angular velocity, heading, speed and environmental information; A main controller, electrically connected to the multi-sensor module, the main drive module, the inertial balance flywheel module and the communication module, for real-time execution of data fusion, cascade PID control, adaptive parameter adjustment, fault detection, and data recording and verification; A lateral control module is disposed in the main controller or cooperates with the main controller, and is used to calculate a target lateral tilt angle according to the lateral state of the vehicle and the steering requirement, and convert the target lateral tilt angle into a control instruction for the balancing flywheel; The communication module is used to realize wireless data communication between the vehicle and the external monitoring platform or other vehicles, and to record and verify the real-time posture and motion control data of the vehicle through blockchain technology; The power module is used to provide stable DC power to each module of the system.

2. A self-balancing unicycle control system based on cascade PID and multi-sensor fusion according to claim 1, characterized in that: In the multi-sensor module, the inertial measurement unit includes a three-axis gyroscope and a three-axis accelerometer, and the collected data is used to estimate the longitudinal inclination, lateral inclination and heading angle of the vehicle in real time after data fusion.

3. A self-balancing unicycle control system based on cascade PID and multi-sensor fusion according to claim 2, characterized in that: The data fusion implemented by the main controller adopts an adaptive complementary filtering algorithm, and its filtering formula is: , in, is the estimated vehicle longitudinal inclination angle at the kth moment, is the angular velocity of the three-axis gyroscope on the lateral axis, is the sampling period, is the inclination angle calculated from the triaxial accelerometer measurement, It is the filter gain that is adaptively adjusted according to the vehicle motion state.

4. The self-balancing unicycle control system based on cascade PID and multi-sensor fusion according to claim 1 is characterized in that: The cascade PID control implemented by the main controller includes an outer loop and an inner loop. The outer loop PID control takes the error ev=vref-v between the vehicle target speed vref and the actual speed v as input and outputs the target longitudinal inclination angle. Its control law is: , in, , and They are the proportional, integral and differential control gains of the outer loop PID respectively; The inner loop PID control is based on The actual longitudinal inclination angle obtained by sensor fusion The error between is the input and outputs the torque command for driving the wheel motor , its control law is: , in, , and They are the proportional, integral and differential control gains of the inner loop PID respectively.

5. A self-balancing unicycle control system based on cascade PID and multi-sensor fusion according to claim 4, characterized in that: The main controller also includes an adaptive parameter adjustment module for monitoring control performance indicators , and automatically adjust the PID control gain according to the index to achieve the purpose of optimizing control response and stability. is the rate of change of wheel output torque, w1, w2, w3 are preset weight coefficients.

6. The self-balancing unicycle control system based on cascade PID and multi-sensor fusion according to claim 1 is characterized in that: The main controller also includes a fault detection module for real-time monitoring of sensor data and driver output status. When data abnormality or deviation from a predetermined range is detected, redundant or backup control strategies are automatically enabled to ensure continuous and stable operation of the system.

7. The self-balancing unicycle control system based on cascade PID and multi-sensor fusion according to claim 1 is characterized in that: The communication module adopts blockchain technology to generate data summaries of key data during vehicle operation, and combines timestamps and hash verification to record data chains to ensure that data cannot be tampered with and is traceable during transmission and storage.

8. The self-balancing unicycle control system based on cascade PID and multi-sensor fusion according to claim 1 is characterized in that: The lateral control module calculates the target lateral tilt angle φref in combination with the vehicle driving state and the steering command, and converts the target lateral tilt angle into a control command τf of the inertial balancing flywheel to drive the inertial balancing flywheel module to adjust the vehicle lateral balance and assist steering.

9. A self-balancing unicycle control method based on cascade PID and multi-sensor fusion, characterized in that: A self-balancing unicycle control system based on cascade PID and multi-sensor fusion as described in any one of claims 1 to 8, comprising the following steps: S1. After the vehicle is powered on, the main controller calibrates the multi-sensor module to determine the initial posture of the vehicle; S2, periodically collect the raw data of each sensor, and fuse the data through adaptive complementary filtering or extended Kalman filtering method to obtain the actual longitudinal tilt angle θ, lateral tilt angle φ, heading angle ψ and actual speed v of the vehicle; S3, calculate the target longitudinal inclination angle according to the error ev between the vehicle target speed vref and the actual speed v ,by The error between the actual longitudinal inclination angle θ As input, calculate the torque command of the drive motor ,At the same time, according to the lateral state of the vehicle and the steering requirement, the lateral control module calculates the target lateral tilt angle φref and converts it into a control command for the inertial balance flywheel; S4, outputting the calculated torque command and control command to the main drive module and the inertial balance flywheel module respectively, to achieve vehicle posture adjustment and motion control; S5, adaptively adjust PID parameters through real-time monitoring system feedback, and enable redundant or backup control strategies when abnormalities are detected; S6. Upload the real-time posture and motion control data of the vehicle through the communication module, and use blockchain technology to record the data in an unalterable manner; S7, repeat steps S2 to S6 to achieve closed-loop control of the vehicle's self-balancing and movement.

Citation Information

Patent Citations

  • Balance car system measurement and control method based on camera pavement detection

    CN107340298A

  • Visual navigation self-balancing vehicle and balancing method

    CN110554706A

  • Monocycle balance control method and system based on PID (Proportion Integration Differentiation) controller

    CN118112921A

  • Unmanned bicycle self-balancing control method based on LQR and Kalman filtering

    CN118131633A

  • Orchard inspection robot navigation method based on multi-sensor fusion

    CN118936480A

Cited By

  • Multi-mode semantic perception and reinforcement learning self-balancing monocycle control system and method

    CN120428541A

  • Hot-line work vehicle anti-roll stability control system based on PID (Proportion Integration Differentiation) algorithm

    CN120669518A

  • Photoelectric tracking feedforward control method for compensating translational disturbance of carrier

    CN121349170A

  • Monocycle bending steering control method and system based on dynamic zero point and MLP prediction

    CN122072478A