An adaptive robot driving system based on RT-Thread

By using the RT-Thread adaptive robot drive system, which combines fuzzy rule reasoning and real-time thread operation, the challenges of ROS in terms of drive complexity and real-time performance are solved. It enables automatic chassis type identification and independent obstacle avoidance, thereby improving the efficiency and maintainability of the robot system.

CN118372245BActive Publication Date: 2026-05-29NANJING TECH UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING TECH UNIV
Filing Date
2024-05-16
Publication Date
2026-05-29

Smart Images

  • Figure CN118372245B_ABST
    Figure CN118372245B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of robot control, in particular to a self-adaptive robot driving system based on an RT-Thread, which comprises a power module, an integrated main control module, a motor driving module and a serial port transmission module; wherein the power module is used for providing power supply and monitoring the battery voltage in real time; the integrated main control module is used for carrying a real-time thread operating system and scheduling different function modules; the motor driving module is used for configuring the motor of a driving chassis and executing robot moving operation; and the serial port transmission module is used for reserving a serial port for communication connection and data transmission. The self-adaptive robot driver using the RT-Thread operating system is built by fusing the motor and sensor data accessed by the driving system, the special posture of the vehicle body can be detected in time and real-time control is carried out, and the convenience of robot software and hardware integration is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of robot control technology, and in particular relates to an adaptive robot drive system based on RT-Thread. Background Technology

[0002] The Robot Operating System (ROS) plays a crucial role in the field of robot development. ROS is undoubtedly a powerful tool, providing developers with rich sensor and actuator drive layers, greatly simplifying the complexity of robot software development.

[0003] However, with the diversification and increasing complexity of robot applications, relying solely on a ROS host to drive all devices may encounter some challenges. For example, while ROS simplifies hardware abstraction by providing rich sensor and actuator driver layers, many individual devices still need to be driven, such as various sensors, motors, and other local devices. Relying solely on a host running ROS for driving would result in an excessively large node network and a complex driving process. This complexity increases system maintenance and debugging costs and reduces development efficiency. Furthermore, ROS's communication mechanism is based on a publish-subscribe pattern, which, while effective in some applications, may not perform well for applications requiring real-time data transmission and low latency.

[0004] Another issue is ROS's limited real-time performance. While real-time plugins can improve ROS's performance, such solutions often increase system complexity and may not meet certain stringent real-time requirements, posing a serious problem for applications demanding high-precision control and rapid response. Furthermore, ROS has limited capabilities in handling heterogeneous hardware and communication protocols. Although ROS provides some general interfaces and drivers, additional custom development may be required for certain sensors and actuators, increasing development costs and time. Moreover, while some traditional real-time operating systems may be better suited to certain hardware platforms, integration with ROS may not be as straightforward, further increasing integration complexity.

[0005] No effective solutions have yet been proposed to address the problems in the relevant technologies. Summary of the Invention

[0006] Purpose of the invention: To provide a configuration method to overcome the aforementioned technical problems existing in the prior art.

[0007] Technical solution: An adaptive robot drive system based on RT-Thread, the system includes: a power supply module, an integrated main control module, a motor drive module and a serial port transmission module;

[0008] The power module is used to provide power and monitor the battery voltage in real time.

[0009] An integrated main control module is used to run a real-time thread operating system and schedule different functional modules;

[0010] The motor drive module is used to configure the motors driving the chassis and perform robot movement operations;

[0011] The serial port transmission module is used to reserve a serial port for communication connection and data transmission.

[0012] Furthermore, the integrated main control module includes: a local bus submodule, a wireless transmission submodule, a chassis control submodule, and a microprocessor submodule;

[0013] The local bus submodule is used to configure the local bus interface and realize data exchange between the microprocessor and external devices by transmitting parallel data and control signals.

[0014] The wireless transmission submodule is used to transmit signal data based on wireless communication technology.

[0015] The chassis control submodule is used to perform robot model judgment, real-time control and radar obstacle avoidance based on the motor signals, attitude signals and radar signals of the robot chassis.

[0016] The microprocessor submodule is used to configure the microprocessor and provide computing power.

[0017] Furthermore, the chassis control submodule includes a vehicle model determination unit, an attitude detection unit, a real-time control unit, and an automatic obstacle avoidance unit;

[0018] Among them, the vehicle model determination unit is used to determine the robot's drive type and its chassis model based on the feedback signals of all motors in the accessed chassis and in combination with fuzzy rule reasoning principles.

[0019] The attitude detection unit is used to determine the attitude scenario based on real-time monitoring of the robot's attitude information during its movement, and to automatically control the motor's drive strategy according to the attitude scenario.

[0020] Real-time control unit, used to adaptively adjust motor control parameters based on the robot's motion state;

[0021] The automatic obstacle avoidance unit is used to identify obstacles in the robot's path using radar data from the lidar and to control the robot to automatically avoid obstacles.

[0022] Furthermore, the drive types include four-wheel drive vehicles, two-wheel drive vehicles, and three-wheel drive vehicles, and the chassis types include four-wheel Mecanum wheel vehicles, four-wheel four-wheel drive vehicles, two-motor tracked vehicles, Ackerman vehicles, and three-wheel omnidirectional vehicles.

[0023] Furthermore, based on the feedback signals from all motors within the connected chassis, and combined with fuzzy rule reasoning principles, the robot's drive type and chassis model are determined, including:

[0024] Connect the various motors in the robot chassis to the local bus sub-module in a basic order;

[0025] The robot is placed in a suspended state, and the rotation of each motor in the chassis is driven. Feedback signals from each motor are obtained, and the number of motors is determined based on the number of feedback signals.

[0026] If the feedback signal conforms to the four-wheel fuzzy rule, the robot's drive type is determined to be a four-wheel drive vehicle, and the chassis model of the robot is determined based on the chassis motion analysis results of the four-wheel drive vehicle.

[0027] If the feedback signal conforms to the three-wheel fuzzy rule, the robot's drive type is determined to be a three-wheel drive vehicle, and the robot's chassis type is determined to be an omnidirectional wheeled vehicle.

[0028] If the feedback signal conforms to the two-wheel fuzzy rule, the robot's drive type is determined to be a two-wheel drive vehicle, and the chassis model of the robot is determined based on the bus servo detection results of the two-wheel drive vehicle.

[0029] Furthermore, based on the chassis motion analysis results of four-wheel drive vehicles, the chassis models of the robot are determined to include:

[0030] The robot independently controls four motors in its chassis, driving the motors corresponding to the left front wheel and the right rear wheel to rotate, and sets the motor speeds. Then, the speeds of the motors corresponding to the right front wheel and the left rear wheel are set to zero.

[0031] Set the rotation time of the motor, drive the robot to move at timed intervals according to the motor speed, and collect the forward acceleration and lateral acceleration values ​​of the robot during the rotation time;

[0032] If both the forward acceleration and the lateral acceleration are greater than the set threshold, the robot's chassis type is determined to be a four-wheeled Mecanum wheel vehicle. If the forward acceleration is greater than the set threshold and the lateral acceleration is less than the set threshold, the robot's chassis type is determined to be a four-wheeled four-wheel drive vehicle.

[0033] Furthermore, based on the bus servo detection results of the two-wheel drive vehicle, the chassis models of the robot are determined to include:

[0034] The microprocessor sends bus commands to the motor via a serial bus to check if the bus servo motor exists;

[0035] If a bus servo motor exists, serial port information is returned as a feedback signal, and the robot's chassis type is determined to be an Ackerman vehicle. If no bus servo motor exists, no feedback signal is returned, and the robot's chassis type is determined to be a two-motor tracked vehicle.

[0036] Furthermore, based on real-time monitoring of the robot's posture information during movement, the posture scenario is determined, and the automatic control strategy for the motor drive includes:

[0037] The robot's inertial measurement unit is connected via a serial port transmission module, and the robot's attitude information during motion is monitored in real time based on the inertial measurement unit.

[0038] The pitch and roll angles in the attitude information are calculated. Based on the values ​​of pitch and roll angles, the degree of robot tipping is evaluated. When either the pitch or roll angle is greater than 35°, the same-direction acceleration is read. If the rate of change of the same-direction acceleration is greater than the same-direction safety threshold, the driving of all motors is stopped and the motor driving signal is uploaded to the host computer.

[0039] Calculate the vertical acceleration in the attitude information. If the rate of change of the vertical acceleration is greater than the vertical safety threshold, stop the driving of all motors and upload the motor drive signal to the host computer.

[0040] The robot calculates the horizontal acceleration in the attitude information. When the horizontal acceleration is within the collision range, it is determined that the robot has collided and the collision information is uploaded to the host computer. If the number of collisions in the last minute is greater than the collision threshold, the drive of all motors is stopped and marked as an abnormal state, and the motor drive signal is uploaded to the host computer.

[0041] The system calculates the traveling acceleration and motor rotation parameters in the attitude information. When the motor rotation parameters do not match the traveling acceleration, it is determined to be a slippage phenomenon. The motor speed is limited to one-tenth of the current speed. If no movement occurs within one minute, the drive of all motors is stopped and the motor drive signal is uploaded to the host computer.

[0042] Furthermore, based on the robot's motion state, the control parameters of the motors are adaptively adjusted, and radar data from the LiDAR is used to control the robot's automatic obstacle avoidance, including:

[0043] The robot's motion status is detected. If the robot is on an uphill slope, the proportional parameters of the motors in the chassis are increased; if the robot is on a downhill slope, the proportional parameters of the motors are decreased.

[0044] If the robot's chassis type is an Ackerman vehicle, then the steering control parameters of the Ackerman vehicle are adjusted based on the chassis acceleration and direction of travel.

[0045] Furthermore, based on the chassis acceleration and direction of travel of the Ackerman vehicle, the steering control parameters of the Ackerman vehicle are adjusted as follows:

[0046] The Ackerman car's direction of travel is detected, and it is determined whether the target point and the current point are in a bend. If they are in a bend, the chassis acceleration is read when the car is turning.

[0047] If the chassis acceleration of the Ackerman car is greater than the turning threshold, the value of the chassis acceleration will be incorporated into the steering control by decreasing the proportional parameter and increasing the derivative parameter.

[0048] Beneficial effects:

[0049] 1. By fusing motor and sensor data from the drive system, an adaptive robot actuator using the RT-Thread operating system was built. This actuator can initially determine the chassis type based on the number of motors connected to the chassis, and automatically identify the specific chassis type by fusing data from sensors such as IMUs. Using the fused data, the robot's posture is detected, enabling timely detection and real-time control of special postures. Simultaneously, an unused LiDAR sensor from a traditional actuator was integrated, connecting the actuator to the radar data transmission path. This enabled independent obstacle avoidance without relying on the ROS, successfully achieving functions such as automatic chassis type identification. The actuator was able to drive various chassis types, and independent obstacle avoidance of the robot was demonstrated in a field test. This significantly simplified the ROS drive components and greatly improved the ease of robot hardware and software integration.

[0050] 2. By directly preprocessing sensor data through the drive system, the processing burden on the host computer is reduced. This enables the detection of special postures and the adjustment of predetermined control strategies based on special working conditions such as collisions, rollovers, overturns, and slippage. The PID parameters of the motors and servos mounted on the chassis are adaptively adjusted according to different situations, which particularly enhances the driving effect on road conditions such as slopes and curves. Compared with the method of relying solely on the host to run ROS, the lower-level drive strategy of this invention not only reduces the node network and simplifies the entire drive process, but also makes the robot system more efficient and easier to maintain. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a system principle block diagram of an adaptive robot drive system based on RT-Thread according to an embodiment of the present invention;

[0053] Figure 2 This is a schematic diagram of the BUCK circuit in a power module according to an embodiment of the present invention;

[0054] Figure 3 This is a schematic diagram of an LDO circuit in a power module according to an embodiment of the present invention;

[0055] Figure 4 This is a schematic diagram of the main control chip circuit in the integrated main control module according to an embodiment of the present invention;

[0056] Figure 5 This is a schematic diagram of the AT8236 application circuit in the motor drive module according to an embodiment of the present invention;

[0057] Figure 6 This is a schematic diagram of the serial communication chip and its peripheral circuit in the serial transmission module according to an embodiment of the present invention;

[0058] Figure 7 This is a flowchart of the automatic vehicle model determination process according to an embodiment of the present invention;

[0059] Figure 8 This is a schematic diagram of the motor interface on the drive wheel according to an embodiment of the present invention;

[0060] Figure 9 This is a kinematic analysis diagram of the chassis of a four-wheeled Mecanum wheel vehicle according to an embodiment of the present invention;

[0061] Figure 10 This is a kinematic analysis diagram of the chassis of a two-wheeled tracked vehicle according to an embodiment of the present invention;

[0062] Figure 11 This is a kinematic analysis diagram of the Ackerman vehicle chassis according to an embodiment of the present invention;

[0063] Figure 12 This is a kinematic analysis diagram of the chassis of an omnidirectional wheel trolley according to an embodiment of the present invention;

[0064] Figure 13 This is a schematic diagram of the forward acceleration of a four-wheeled Mecanum wheel vehicle according to an embodiment of the present invention;

[0065] Figure 14 This is a schematic diagram of the lateral acceleration of a four-wheeled Mecanum wheel vehicle according to an embodiment of the present invention;

[0066] Figure 15 This is a schematic diagram of the forward acceleration of a four-wheel drive vehicle according to an embodiment of the present invention;

[0067] Figure 16 This is a schematic diagram of the lateral acceleration of a four-wheel drive vehicle according to an embodiment of the present invention;

[0068] Figure 17 This is the fall acceleration value of the robot in the event of a fall according to an embodiment of the present invention;

[0069] Figure 18 This is a schematic diagram of an SN74LVC1G3157 analog switch according to an embodiment of the present invention.

[0070] In the picture:

[0071] 1. Power supply module; 2. Integrated main control module; 3. Motor drive module; 4. Serial port transmission module. Detailed Implementation

[0072] In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the invention. However, it will be apparent to those skilled in the art that the invention can be practiced without one or more of these details. In other instances, certain technical features well-known in the art have not been described in order to avoid obscuring the invention.

[0073] According to an embodiment of the present invention, an adaptive robot drive system based on RT-Thread is provided.

[0074] Please see Figure 1 An adaptive robot drive system based on RT-Thread is provided, which includes: a power supply module 1, an integrated main control module 2, a motor drive module 3, and a serial port transmission module 4.

[0075] Among them, power module 1 is used to provide power supply and monitor battery voltage in real time.

[0076] In the description of this invention, the power module 1 uses a 12V external battery, such as... Figures 2-3 As shown, the power supply circuit consists of an onboard 12V-5V BUCK circuit (onboard power supply circuit, which is also responsible for powering the Type-C port to the outside) and a 5V-3.3V LDO circuit.

[0077] Specifically, the device driven by this invention does not have special signal noise interference prevention requirements, and can use common BUCK circuits and LDO circuits to meet the system's 5V and 3.3V voltage requirements. Since this driver (the adaptive robot drive system designed in this invention, hereinafter referred to as the driver) needs to be able to power the host computer, a separate 5V power supply also needs to be designed.

[0078] To ensure relative stability of each power supply, when the 12V power supply is connected, the driver uses two RT8289GSPs to process and filter the input power, which is then used as the onboard power input and external power supply respectively. The external power supply will eventually power the host computer through the USB Type-C interface. Figure 2 The diagram shows the system's onboard power supply and external power supply schematic. The onboard power supply also requires a resistor and connection to the main chip's ADC to monitor the battery voltage in real time.

[0079] like Figure 3 As shown, a TPRT9013-33GB linear regulator (LDO) is used to convert 5V to 3.3V on the 5V board. It exhibits good stability, fast load response, and low output ripple. In the design, a capacitor is placed between the power input and ground for voltage regulation, and a voltage-regulating capacitor and a unidirectional current protection diode are configured at the output VOUT terminal.

[0080] The integrated main control module 2 is used to carry a real-time thread operating system and schedule different functional modules.

[0081] In the description of this invention, the integrated main control module 2 includes: a local bus submodule, a wireless transmission submodule, a chassis control submodule, and a microprocessor submodule.

[0082] The local bus submodule is used to configure the local bus interface and realize data exchange between the microprocessor and external devices by transmitting parallel data and control signals.

[0083] Specifically, it is equipped with bus interfaces such as CAN, I2C, SPI, and UART locally.

[0084] The wireless transmission submodule is used to transmit signal data based on wireless communication technology.

[0085] Specifically, wireless transmission uses a Bluetooth BT-04 slave module with a reserved interface. The driver board is connected to the host computer Jetson Nano or Raspberry Pi via a serial port, enabling network transmission functionality.

[0086] The chassis control submodule is used to perform robot model judgment, real-time control, and radar obstacle avoidance based on the motor signals, attitude signals, and radar signals of the robot chassis.

[0087] In the description of this invention, the chassis control submodule includes a vehicle model determination unit, a posture detection unit, a real-time control unit, and an automatic obstacle avoidance unit.

[0088] The vehicle model determination unit is used to determine the robot's drive type and chassis model based on the feedback signals from all motors in the accessed chassis and in accordance with fuzzy rule reasoning principles.

[0089] Specifically, when the drive unit is connected to the robot chassis, ordinary drives need to be programmed according to the corresponding chassis mode, such as Mecanum wheel / four-wheel drive / omnidirectional wheel / Ackerman / tracked type, etc. Even drives that integrate multiple chassis modes need to be manually selected. Relatively speaking, human-machine interaction is more cumbersome and prone to errors.

[0090] This driver takes this pain point into account and focuses on designing an automatic chassis model identification function, creating a more user-friendly chassis selection method. Even ordinary developers who are not very familiar with the various chassis modes of small cars can set the correct chassis type through simple interaction.

[0091] Furthermore, fuzzy logic is a logical system capable of handling uncertainty and fuzziness. Its core principle is an extension of traditional binary logic, aiming to better approximate human decision-making patterns. Fuzzy sets in fuzzy logic are a generalization of traditional sets. In traditional sets, an element either belongs to a set (truth value 1) or does not belong to that set (truth value 0). In fuzzy sets, the degree to which an element belongs to a set is represented by a number between 0 and 1, called the element's membership degree. The membership function quantifies the membership degree, representing the degree to which an element belongs to a fuzzy set. Simultaneously, it is necessary to determine the applicable fuzzy rules for the system, and on this basis, fuzzy inference and defuzzification can be implemented.

[0092] After determining the membership degrees, fuzzy rules need to be set for the system. Fuzzy logic uses fuzzy rules for reasoning. These rules are "if-then" statements that describe the relationship between inputs and outputs. Since the result of fuzzy reasoning is fuzzy, it needs to be converted into a specific output value for use. This process is called defuzzification. Common defuzzification methods include centroid and mean-maxima methods. Through defuzzification, a definite numerical value can be extracted from the fuzzy output to serve as the actual control parameter.

[0093] In the description of this invention, the drive type includes four-wheel drive vehicles, two-wheel drive vehicles and three-wheel drive vehicles, and the chassis vehicle type includes four-wheel Mecanum wheel vehicles, four-wheel four-wheel drive vehicles, two-motor tracked vehicles, Ackerman vehicles and three-wheel omnidirectional vehicles.

[0094] In the description of this invention, based on the feedback signals of all motors within the accessed chassis, and combined with fuzzy rule reasoning principles, the determination of the robot's drive type and chassis model includes:

[0095] Step S11: Connect each motor in the robot chassis to the local bus sub-module in a basic order.

[0096] Step S12: Place the robot in a suspended state, drive the rotation of each motor in the chassis, obtain the feedback signal of each motor, and determine the number of motors based on the number of feedback signals.

[0097] Step S13: If the feedback signal conforms to the four-wheel fuzzy rule, the robot's drive type is determined to be a four-wheel drive vehicle, and the chassis model of the robot is determined based on the chassis motion analysis results of the four-wheel drive vehicle.

[0098] In the description of this invention, based on the chassis motion analysis results of four-wheel drive vehicles, the chassis model of the robot is determined to include:

[0099] Step S131: Independently control the four motors in the robot chassis to drive the motors corresponding to the left front wheel and the right rear wheel to rotate, and set the motor speed. Then set the speed of the motors corresponding to the right front wheel and the left rear wheel to zero.

[0100] Step S132: Set the rotation time of the motor, drive the robot to move at a time according to the motor speed, and collect the forward acceleration value and lateral acceleration value of the robot during the rotation time.

[0101] Step S133: If both the forward acceleration and the lateral acceleration are greater than the set threshold, the chassis type of the robot is determined to be a four-wheeled Mecanum wheel vehicle. If the forward acceleration is greater than the set threshold and the lateral acceleration is less than the set threshold, the chassis type of the robot is determined to be a four-wheeled four-wheel drive vehicle.

[0102] Specifically, this invention combines fuzzy reasoning. The number of connected motors can be determined from the encoder's feedback data. If the driver connects four motors, the vehicle chassis has two possibilities: a four-wheeled Mecanum wheel vehicle or a four-wheeled four-wheel drive vehicle. By analyzing the kinematics of these two types of chassis, it can be seen that a four-Mecanum wheel chassis vehicle can move the chassis to the right front by driving the left front and right rear wheels forward, while a four-wheeled four-wheel drive vehicle can only move forward at most when performing the same wheel motor actions. This difference effectively utilizes the different kinematics of the chassis, and the simultaneous forward movement of both wheels avoids the stalling and dangerous problems that might occur if the motors rotate in reverse. Fuzzy rule 1 is established based on this.

[0103] Four-wheel fuzzy rule: Determining the type of four-wheel chassis

[0104] (1) Input variable 1: Number of motors;

[0105] Quantification: If the number of motors is 4, it may be a four-wheeled Mecanum car or a four-wheeled four-wheel drive car.

[0106] (2) Input variable 2: Acceleration data;

[0107] Forward acceleration: Both four-microphone and four-wheel drive will produce it;

[0108] Lateral acceleration: occurs in the Mecanum car, but is not noticeable in the four-wheel drive car;

[0109] Quantification: The Mecanum car exhibits significant lateral acceleration, while the four-wheel drive car shows no significant lateral acceleration.

[0110] Let A be the fuzzy set “four-wheel Mecanum wheel”, then the membership function is:

[0111]

[0112] Here, the universe of discourse is continuous, and the fuzzy set A can be represented using Zadeh notation as follows:

[0113]

[0114] If the maximum lateral acceleration is less than or equal to 0.2g, and there are four motors connected, then it must be a four-wheel drive car.

[0115] If the maximum lateral acceleration is in the range of [0.2g, 0.6g], it is more likely to be a four-wheeled Mecanum car. In this case, according to the defuzzification rule:

[0116] When the membership degree is greater than or equal to 0.5, it is determined to be a four-Mecanum wheel chassis;

[0117] When the membership degree is less than 0.5, it is determined to be a four-wheel drive chassis;

[0118] If the maximum lateral acceleration is greater than 0.6g, it is determined to be a four-wheeled Mecanum vehicle.

[0119] At this moment, the speed of the motors on each wheel of the chassis is: V A =V;V B =0; V C =V;V D =0.

[0120] Let v be 0.1 m / s, that is, V A =V C =0.1m / s.

[0121] For safety reasons, to minimize the range of chassis displacement, the drive motors for wheels A and C are set to move forward for only 0.5 seconds; this short drive time will not produce significant displacement. After testing on both chassis, the forward and lateral acceleration values ​​received by the IMU are as follows: Figures 13-16 As shown.

[0122] like Figures 13-16As shown, the Mecanum car chassis exhibits significant lateral and forward acceleration. The four-wheel drive chassis only has forward acceleration similar to the Mecanum car, while its lateral acceleration is generally no more than 0.1g. Based on the set fuzzy logic, the absolute maximum value of the Mecanum car chassis's lateral acceleration is close to 0.5g, with a membership value of 9 / 16, successfully identifying it as the Mecanum car.

[0123] Step S14: If the feedback signal conforms to the three-wheel fuzzy rule, then the robot's drive type is determined to be a three-wheel drive vehicle, and the robot's chassis type is determined to be an omnidirectional wheel vehicle.

[0124] Specifically, among the five vehicle types, only the omnidirectional wheel car is equipped with three drive wheel motors. If only three encoder motors are detected, the chassis model is directly determined to be an omnidirectional wheel car. This is used to set fuzzy rule 3.

[0125] Three-wheeled fuzzy rules: Three-wheeled vehicle type determination

[0126] Input variable: Number of motors;

[0127] Quantification: If the number of motors is 3, it is determined to be an omnidirectional wheel vehicle.

[0128] Step S15: If the feedback signal conforms to the two-wheel fuzzy rule, the robot's drive type is determined to be a two-wheel drive vehicle, and the chassis type of the robot is determined based on the bus servo detection result of the two-wheel drive vehicle.

[0129] In the description of this invention, the chassis model of the robot is determined based on the bus servo detection results of the two-wheel drive vehicle model, including:

[0130] Step S151: The microprocessor sends a bus command to the motor via the serial bus to check if the bus servo motor exists.

[0131] Step S152: If a bus servo motor exists, return serial port information as a feedback signal and determine that the robot's chassis type is an Ackerman vehicle. If no bus servo motor exists, do not return a feedback signal and determine that the robot's chassis type is a two-motor tracked vehicle.

[0132] Specifically, in this drive system design, the two-wheel drive models are only available on the Ackerman chassis and the tracked chassis. The main difference is that the Ackerman chassis model uses a front-wheel steering servo, which the tracked model does not have. The chassis steering servo used in this system is a bus-type servo, and its parameters are shown in Table 1.

[0133] Table 1: Bus Servo Parameters

[0134] parameter value weight 60g rotational speed 0.16 sec / 60° (6V) Power supply voltage 5-9V Rotation angle 270° MAX baud rate 115200

[0135] The bus servo has a single serial port with a baud rate of 115200, and servos can be connected in series via the bus. Each bus servo has its own ID number; therefore, in a chassis matched to this driver, a bus command can be sent via the serial port to determine the presence of the servo. This is used to establish fuzzy rule 2.

[0136] Two-wheel fuzzy rules: Two-wheel chassis type determination

[0137] (1) Input variable 1: Number of motors;

[0138] Quantification: If the number of motors is 2, it may be an Ackerman chassis or a tracked chassis.

[0139] (2) Input variable 2: Steering servo feedback;

[0140] Quantification: If the steering servo can be found via serial port commands, it is more likely to be an Ackerman chassis; if there is no feedback, it is more likely to be a tracked chassis.

[0141] The attitude detection unit is used to determine the attitude scenario based on real-time monitoring of the robot's attitude information during its movement, and to automatically control the motor's drive strategy according to the attitude scenario.

[0142] In the description of this invention, the drive strategy for automatically controlling the motors based on the attitude information of the robot during real-time monitoring of its movement, the determination of the attitude scenario, and the determination of the automatic control strategy for the motors based on the attitude scenario includes:

[0143] Step S21: Connect the robot's inertial measurement unit using the serial port transmission module 4, and monitor the robot's attitude information in real time based on the inertial measurement unit.

[0144] Specifically, after determining the chassis type, the actuator will drive the four wheels according to different strategies. However, the road conditions the robot encounters vary greatly in different scenarios. For example, in indoor spaces, the robot may slip, collide, fall off steps, or overturn due to the terrain. Different situations require different handling. This actuator has developed corresponding control strategies for these special situations to achieve real-time control.

[0145] Step S22: Calculate the pitch and roll angles in the attitude information. Based on the values ​​of the pitch and roll angles, assess the degree of robot tipping. When either the pitch or roll angle is greater than 35°, read the acceleration in the same direction. If the rate of change of the acceleration in the same direction is greater than the safety threshold in the same direction, stop the driving of all motors and upload the motor drive signal to the host computer.

[0146] Specifically, this driver implements pose detection and calculation on the lower-level computer based on the Real-Time Thread operating system (RT-Thread), preprocesses the data from the inertial measurement unit locally, thereby reducing the processing burden on the upper-level computer, enhancing the real-time performance of the control, and also knowing the current state of the vehicle.

[0147] In the design, the Motion Driver 2RTT function package of RT-Thread Studio is used to calculate the attitude angle using the Digital Motion Processor (DMP) program, and then the tilting degree is detected by the values ​​of pitch and roll.

[0148] Under normal operating conditions, if either the pitch or roll angle is greater than 35°, the driver will read the acceleration value simultaneously. If the acceleration value in the same direction increases abnormally, the driver will stop the motor rotation and upload the data to the ROS terminal via the serial port connected to the ROS host computer.

[0149] Step S23: Calculate the vertical acceleration in the attitude information. If the rate of change of the vertical acceleration is greater than the vertical safety threshold, stop the driving of all motors and upload the motor driving signal to the host computer.

[0150] Specifically, falls are a common occurrence for robots on indoor stairs. In such situations, the robot chassis must stop operating to prevent harm to people and property. Fall detection is primarily handled by accelerometers, which measure the fall acceleration as follows: Figure 17 As shown.

[0151] When a fall occurs, the vertical acceleration (Z-axis) will rapidly decrease from its previous stable value of around 1G. This acceleration value is short-lived but can still be detected. Therefore, when such a situation occurs, all motors will stop driving and the information will be uploaded to the host computer.

[0152] Step S24: Calculate the horizontal acceleration in the attitude information. If the horizontal acceleration is within the collision range, it is determined that the robot has collided, and the collision information is uploaded to the host computer. If the number of collisions in the last minute is greater than the collision threshold, all motor drives are stopped and marked as abnormal, and motor drive signals are uploaded to the host computer.

[0153] Specifically, collisions are divided into minor collisions and severe collisions, with different detectable acceleration values ​​and different response strategies after they occur.

[0154] Under normal circumstances, the combined horizontal acceleration value of a minor collision is in the range of [-1G, 1G]. In this case, even if a minor collision occurs, it will not affect the normal operation of the robot. Therefore, it is only necessary to upload the information to the host computer. However, if the number of minor collisions of the robot exceeds 5 times within one minute, it can be determined that the robot is in distress or has malfunctioned, and the actuator will stop driving the robot chassis.

[0155] However, if the horizontal acceleration value (forward Y-axis, lateral X-axis) exceeds the set 1G, it can be considered a serious collision. In this case, the robot will stop all movements, and the collision information also needs to be uploaded to the host computer.

[0156] Step S25: Calculate the traveling acceleration and motor rotation parameters in the attitude information. If the motor rotation parameters do not match the traveling acceleration, it is determined to be a slippage phenomenon. The motor speed is limited to one-tenth of the current speed. If no movement occurs within one minute, the drive of all motors is stopped and the motor drive signal is uploaded to the host computer.

[0157] Specifically, robots can be used in many places, such as muddy roads or slippery roads in the rain. Even indoors, slippery tiles can seriously affect the robot's normal movement.

[0158] When the robot chassis gets stuck in muddy terrain or slips severely, the observable phenomenon is that the driver has driven the motor to rotate the chassis wheels rapidly, but no large displacement is produced. This situation cannot be reflected in the feedback of the encoder motor because the encoder motor is indeed rotating. Therefore, it is necessary to combine the accelerometer to determine the situation.

[0159] When severe slippage occurs, the accelerometer readings accurately reflect the fact that the chassis can only move slightly; that is, only a small change in acceleration is detected, while the encoder motor experiences a very large rotational distance. In response, the driver will significantly reduce the output speed of the chassis motors, limiting the speed of the motors on the chassis wheels to 1 / 10 of the normal speed, thus slowly increasing the possibility of escaping the slippage. Simultaneously, the driver records the timestamp sent by the ROS host computer. If the chassis has not escaped the severe slippage after one minute, the driver will stop and upload road condition information.

[0160] The real-time control unit is used to adaptively adjust the motor control parameters based on the robot's motion state.

[0161] Since its inception, traditional PID control has been widely used in various fields due to its stable and simple structure, good control effect, high stability, and good compatibility. When the structure of the controlled object is known but the parameters have a certain degree of uncertainty, PID control is simple, convenient, and easy to implement.

[0162] For the control system of a car, the behavior characteristics will change due to the constantly changing road conditions and the actual situation of the car body. Using fixed PID parameters often cannot maintain good control performance throughout the entire operation. More flexible and adaptable control strategies are needed to ensure stability and performance throughout the entire operation.

[0163] This drive optimizes the incremental PID parameters of the wheel motors primarily by considering the forward undulations of the road surface (such as uphill and downhill slopes) and the corresponding degree of tilting.

[0164] In the description of this invention, the adaptive adjustment of motor control parameters based on the robot's motion state includes:

[0165] Step S31: Detect the robot's motion state. If the road surface where the robot is located is uphill, increase the proportional parameters of the motor in the chassis. If the road surface where the robot is located is downhill, decrease the proportional parameters of the motor.

[0166] Specifically, when the chassis is on an uphill slope, the increased resistance due to the uphill slope means increased system damping. Therefore, for an uphill chassis, the proportional parameter Kp of the motor output should be appropriately increased to accelerate the system response speed and appropriately reduce the integral action, which helps to reduce system oscillation. The same applies to a downhill slope.

[0167] At the same time, it is also necessary to pay attention to the possibility of tipping over when the posture is tilted laterally. In this case, it is necessary to handle it according to the special posture. According to the actual setting, if the tilt exceeds 35°, there is a risk of tipping over, and the action should be stopped immediately.

[0168] Step S32: If the robot's chassis type is an Ackerman vehicle, then adjust the steering control parameters of the Ackerman vehicle based on the chassis acceleration and direction of travel.

[0169] Most drive-wheel chassis do not require dedicated adjustment of the steering PID, such as four-wheel drive and omnidirectional chassis that use individual drive wheels instead of steering motors. However, for the Ackerman car, the bus servo is crucial for controlling its direction of travel. The Ackerman chassis, due to its stable steering performance, simple and reliable structure, good handling, and high space utilization, has become one of the most widely used car chassis today. Therefore, it is necessary to separately adjust the steering PID of the Ackerman car.

[0170] In this invention, the bus servo is controlled using PD control, where I is 0 (I is the integral of the deviation, i.e., the summation of the deviations. In practical use, PD control is sufficient to meet the requirements). Similar to the PID control of the wheel motor, the PID parameters used for steering also need to change according to the real-time situation, detecting the chassis acceleration value and its direction, and determining the strategy to deal with the chassis acceleration.

[0171] In the description of this invention, adjusting the steering control parameters of the Ackerman vehicle based on its chassis acceleration and direction of travel includes:

[0172] Step S321: Detect the direction of travel of the Ackerman car and determine whether the target point and the current point are in a bending state. If they are in a bending state, read the chassis acceleration when turning.

[0173] Step S322: If the chassis acceleration of the Ackerman vehicle is greater than the turning threshold, the value of the chassis acceleration is incorporated into the steering control by decreasing the proportional parameter and increasing the derivative parameter.

[0174] An automatic obstacle avoidance unit is used to identify obstacles in the robot's path using radar data from a LiDAR sensor, and to control the robot's automatic obstacle avoidance. In this invention, the robot's LiDAR sensor is connected via a serial port transmission module 4. Based on the radar data collected by the LiDAR sensor, obstacles in the path are identified, and automatic obstacle avoidance is performed while the robot is moving.

[0175] Specifically, in general, vehicles equipped with LiDAR connect the radar to a ROS (Resource Operating System) host computer. This allows the ROS host computer to access the LiDAR data while reducing the data burden on the chassis. However, sometimes the ROS doesn't access the LiDAR but only performs simple tasks. If the chassis only obeys the ROS, it will lose the ability to use the LiDAR for obstacle avoidance. Because ordinary chassis main controllers have weak processing capabilities for radar data, radar data is often only received by the ROS and cannot be used by the chassis. With the improvement of the main control unit processor performance, existing chassis main controllers are now able to process the incoming radar data.

[0176] The STM32F407VET6 main control unit in this driver has four built-in USART interfaces, supporting high-speed mode and achieving a transmission rate of 4.5 Mbit / s. To connect the LiDAR to the main control board and also control the transmission of LiDAR data to the ROS, this driver incorporates an SN74LVC1 G3157 analog switch. This analog switch, based on CMOS technology, features low power consumption, low transmission delay, and low output impedance, and also has overvoltage protection for high safety.

[0177] like Figure 18As shown, when connecting the lidar, the lidar's TX pin is connected to pin A, the main control serial port 2 receiver pin PA3 is connected to B0, and the lidar serial port data adapter board connected to the ROS host's USB port has its RX pin connected to B1. In the default state, the See ect pin is set low. Connecting pin A to the serial port 2 receiver pin PA3 will allow the chassis to receive data packets from the lidar.

[0178] After the STM32 is connected to the radar, the radar automatically sends back data packets upon power-up. Each data packet contains 108 bytes, including a frame header, frame length, rotation speed, starting angle, data from 32 points (each at 0.4°, along with the intensity of each point), ending angle, and CRC checksum. The LeiShen N10P radar on this driver chassis has a resolution of 0.4°. The radar outputs 900 data points per rotation, meaning the angle range of one data packet is approximately 12°. After each frame of data is sent back, it is simplified and stored in a 50-variable structure array. This array is refreshed whenever new data is received. Since obstacle avoidance for the vehicle generally only considers the front, to reduce the load while meeting sufficient obstacle avoidance requirements, data recording is set to 50° to the left and right, i.e., 100° in front. If the chassis moves forward normally, with an obstacle range set to 200mm, any obstacle less than 200mm in the stored array is considered an obstacle. Its angle value is then checked to distinguish left from right, and the vehicle turns in the opposite direction to complete obstacle avoidance.

[0179] If radar data is required in the data packet transmitted from the ROS terminal to the vehicle, the Seet terminal is set high, the analog switch disconnects the default path, and connects the B1 terminal and pin A. The two ends are connected, and the radar data will be directly input into the USB port of the ROS terminal through the radar's built-in serial port adapter board.

[0180] The microprocessor submodule is used to configure the microprocessor and provide computing power.

[0181] Specifically, integrated main control module 2 uses an STM32F407VET6 as its microprocessor (main control chip). The STM32F407VET6 is a high-performance STM32 microcontroller equipped with an ARM Cortex-M4 core, with a frequency up to 168MHz, suitable for applications with high processing power requirements. It integrates a rich set of peripherals, such as... Figure 4 As shown, it includes multiple serial ports, SPI, I2C, USB, timers, etc., suitable for various application scenarios. Meanwhile, the Real-Time Thread operating system (RT-Thread) is fully compatible with the STM32F407VET6, reducing development difficulty.

[0182] Motor drive module 3 is used to configure the motors driving the chassis and perform robot movement operations.

[0183] In the description of this invention, the motor drive of this driver mainly consists of a power supply, a driver chip, and a motor interface. Considering that the chassis of the driver has four wheels driven (i.e., four encoder motors) in its maximum state, the load capacity of the power supply line must be considered if simultaneous operation occurs. Therefore, the AT8236 is selected as the driver for each wheel motor. Figure 5 As shown, this DC brushed motor driver meets the requirements of the chassis motor matched in this system. It can control the motor bidirectionally with a peak current of up to 6A, and also has a low-power sleep mode, as well as overcurrent protection, short circuit protection, undervoltage lockout and over-temperature protection functions, which reduce the power consumption of this driver and improve safety redundancy.

[0184] Serial port transmission module 4 is used to reserve a serial port for communication connection and data transmission.

[0185] In this invention, the ROS and the robot chassis driver are connected via two USB Type-C interfaces, one of which is powered by 5V. Since data transmission from the host computer to the slave computer uses the ROSSerial function package, communication between the slave and host computers is required. For ease of establishing this communication connection, the other communication interface also uses a Type-C interface and integrates serial port functionality. The communication chip selected is the same CH9102F as serial port 1, enabling bidirectional data communication. The circuit construction of the CH9102F is as follows... Figure 6 As shown, this driver has two onboard communication interfaces, serial port 1 and serial port 3, and also reserves serial port 2 and serial port 6 (for communication of bus servo motors).

[0186] Furthermore, in specific embodiments, when the drive unit is connected to the chassis, ordinary drive units need to be programmed according to the corresponding chassis mode, such as Mecanum wheel / four-wheel drive / omnidirectional wheel / Ackerman / tracked type, etc. Even drive units that integrate multiple chassis modes need to manually select the chassis mode, which makes human-machine interaction more cumbersome and prone to errors.

[0187] This driver takes this pain point into account and focuses on designing an automatic chassis model identification function, creating a more user-friendly chassis selection method. Even ordinary developers who are not very familiar with the various chassis modes of small cars can set the correct chassis type through simple interaction.

[0188] like Figure 7As shown, the first step in setting the type of this driver is to connect each motor to the driver in the basic order, and then press the user button set by the driver. Lifting the vehicle and detecting the shaking of the chassis via the IMU (Inertial Measurement Unit) will enter the chassis type matching mode. For safety reasons and to prevent chassis motor stalling, the motor needs to be driven to rotate slightly while suspended. The chassis matched by the driver all use encoder motors. Under normal conditions, driving the chassis back and forth slightly will generate feedback from the corresponding encoder. Therefore, if there is no encoder feedback signal, it can be determined that the motor is not equipped with this interface, thus determining the number of wheel motors connected to the driver.

[0189] Even after determining the number of motors connected to the driver, it is still impossible to accurately determine the specific model of the chassis. In this system, there are five possible robot chassis models, categorized into three types:

[0190] Four-wheel drive models: two types, four-wheel Mecanum wheel cars and four-wheel drive cars;

[0191] Two-wheel drive models: two types, two-motor tracked vehicles and Ackerman vehicles;

[0192] Three-wheel drive vehicle: a type of three-wheeled omnidirectional vehicle.

[0193] The driver unit has four drive wheel motor interfaces, labeled A, B, C, and D. Two-wheeled, three-wheeled, and four-wheeled models are connected to interfaces AB, ABC, and ABCD respectively. Figure 8 As shown.

[0194] In order to determine the subcategories of each vehicle model and drive the chassis movement, the following kinematic analysis is performed on each chassis.

[0195] I. Kinematic Analysis of a Four-Wheel Mecanum Wheel Car

[0196] In practical applications, Mecanum wheels are generally used in pairs. A Mecanum wheel cart is usually equipped with two left-handed wheels and two right-handed wheels. When viewed from above, the rollers of the four Mecanum wheels are distributed in a star pattern, that is, the four wheels are chiral symmetrical, in order to enhance the practicality of the Mecanum wheels.

[0197] To determine whether a connected chassis is a four-wheeled Mecanum wheel vehicle, one must first understand the motion of the motors driving the Mecanum wheel vehicle. This involves converting the overall target speed of the actuator into the actual target speed of each motor, and finally controlling the motors based on their target speeds to drive the chassis. The kinematics for determining the overall x, y, and z-axis velocities of the chassis using the speeds of each wheel are called the forward kinematics, and the reverse is the inverse kinematics.

[0198] like Figure 9 As shown, the parameters used are as follows:

[0199] W: Wheelbase, the distance between the left and right wheels, in meters.

[0200] H: Wheelbase, the distance between the front and rear wheels, in meters.

[0201] V x Forward and backward movement speed, with forward movement being positive, unit: m / s.

[0202] V y : Left and right movement speed, with leftward movement being positive, unit: m / s.

[0203] V z : Chassis rotation speed around the origin (geometric center point of four wheels), counterclockwise is positive, unit: rad / s.

[0204] V A轮 V B轮 V C轮 V D轮 Linear velocities of wheels A, B, C, and D, with forward velocity being positive, in m / s.

[0205] After derivation, the four-wheel speeds (inverse kinematics solution) calculated from the target speeds of the three axes of the driver are:

[0206]

[0207]

[0208]

[0209]

[0210] Similarly, the target velocity (normal kinematics) of the drive shaft's three axes, obtained from the four wheel speeds, is:

[0211]

[0212]

[0213]

[0214] II. Kinematic Analysis of Four-Wheel Drive Vehicles

[0215] To correctly analyze the kinematics of a four-wheel drive vehicle, it is necessary to assume that the ground on which the robot is situated has sufficient friction to prevent the four wheels from slipping, and that the four wheels are evenly distributed on the robot's chassis and parallel to each other. Compared to a small car with four Mecanum wheels as the chassis's drive wheels, the kinematic analysis of a four-wheel drive vehicle is simpler and easier to understand. Let the robot's chassis track be D, the wheelbase be H, the axis of forward movement be the X-axis, and the axis perpendicular to the robot's plane be the Z-axis. The rotational speed along the Z-axis is ω.

[0216] When the robot chassis moves forward (in the positive X-axis direction),

[0217] When the chassis rotates (around the Z-axis),

[0218] V A = -ω(a+b)

[0219] V B = -ω(a+b)

[0220] V C = +ω(a+b)

[0221] V D = +ω(a+b)

[0222] From the above formula, we can obtain the speeds of each wheel as follows:

[0223] V A =V x -ω(a+b)

[0224] V B =V x -ω(a+b)

[0225] V C =V x +ω(a+b)

[0226] V D =V x +ω(a+b)

[0227] Where a = D / 2, b = H / 2.

[0228] III. Kinematic Analysis of Two-Wheel Tracked Vehicle

[0229] For a two-wheeled tracked vehicle, there are only two drive wheels, i.e., two-wheel differential speed. Rotation and zero-radius turning can be achieved simply by setting different speeds for the two wheels.

[0230] Kinematic analysis of a two-wheeled tracked vehicle as follows Figure 10 As shown, the parameters are represented as follows.

[0231] W: Track width, the distance between the two drive wheels, unit: m.

[0232] V x Forward movement speed, positive for forward, unit: m / s.

[0233] V z : The rotational speed of the chassis around the origin (the geometric center of the two wheels), with counterclockwise as positive, unit: rad / s.

[0234] R: Turning radius during travel, unit: m.

[0235] V A轮 V B轮 Linear velocity of wheels A and B, positive in the forward direction, unit: m / s.

[0236] The overall velocity V is known through simple derivation. x V z Find the speed V of the driving wheel. A轮 V B轮 (Inverse kinematics):

[0237]

[0238]

[0239] Given the current speed V of the driving wheel A轮 V B轮 Find the overall velocity V x V z (Correct kinematic interpretation):

[0240]

[0241]

[0242] IV. Kinematic Analysis of the Ackermann Car

[0243] The Ackerman robot uses the same structure as a regular car, where the rear two wheels are only for driving or load-bearing, while the front wheels are responsible for steering. This structure is increasingly being used in robotic systems.

[0244] For this small car, it has a total of V x V z The target speeds in two directions (the Ackerman car cannot move laterally) require the speeds V of both drive wheels simultaneously. A轮 V B轮 and the deflection angle θ of the two front wheels A θ B .

[0245] like Figure 11 As shown, the wheelbase is W, the track width is H, and the turning radius is R = V. x / V z Therefore, the correct kinematic solution is:

[0246]

[0247]

[0248] The inverse kinematic solution is:

[0249]

[0250]

[0251]

[0252]

[0253] V. Kinematic Analysis of a Three-Wheeled Omnidirectional Vehicle

[0254] A single omnidirectional wheel consists of a wheel body and rollers on the rim. In order to achieve three degrees of freedom of movement—forward, lateral, and rotation—three omnidirectional wheels need to be evenly distributed to drive the chassis. At the same time, the three wheels also ensure the stability of the chassis.

[0255] like Figure 12 As shown, to analyze the kinematics of the omnidirectional wheel vehicle, the parameters are set as follows:

[0256] R is the radius of rotation, which is the distance from the center of the single wheel to the center of the three wheels, in m / s.

[0257] V x Forward movement speed, positive for forward, unit: m / s.

[0258] V y : Lateral movement speed, positive for leftward movement, unit: m / s.

[0259] V z : Chassis rotation speed around the origin (geometric center point of the three wheels), counterclockwise is positive, unit: rad / s.

[0260] V A轮 V B轮 V C轮 These are the linear velocities of the three wheels, with wheel A at the top and wheels B and C in counter-clockwise order. The target velocities of each wheel are derived from the target velocities of the three axes (inverse kinematics):

[0261] V A轮 =V y +V z *R

[0262]

[0263]

[0264] Conversely, the correct kinematic solution is:

[0265]

[0266]

[0267]

[0268] In summary, by utilizing the technical solution described above, an adaptive robot actuator using the RT-Thread operating system is built by fusing motor and sensor data from the drive system. This actuator can initially determine the chassis type based on the number of motors connected to the chassis, and automatically identify the specific chassis type by fusing sensor data such as IMUs. The fused data is used to detect the vehicle's posture, enabling timely detection and real-time control of special vehicle postures. Simultaneously, by integrating a LiDAR system not used in traditional actuators and connecting the actuator to the radar data transmission path, independent obstacle avoidance by the actuator without relying on the ROS is achieved. This successfully enables functions such as automatic chassis type identification, completes the actuator's operation on various chassis types, and demonstrates independent obstacle avoidance for the vehicle in a real-world test. This significantly simplifies the ROS drive components and greatly improves the ease of robot hardware and software integration. By directly preprocessing sensor data through the drive system, the processing burden on the host computer is reduced. This enables the detection of special postures and the adjustment of predetermined control strategies based on special working conditions such as collisions, rollovers, overturns, and slippage. The PID parameters of the motors and servos mounted on the chassis are adaptively adjusted according to different situations, which particularly enhances the driving effect on road conditions such as slopes and curves. Compared with the method of relying solely on the host to run ROS, the lower-level drive strategy of this invention not only reduces the node network and simplifies the entire drive process, but also makes the robot system more efficient and easier to maintain.

[0269] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An adaptive robot drive system based on RT-Thread, characterized in that, The system includes: a power supply module, an integrated main control module, a motor drive module, and a serial port transmission module; The power module is used to provide power supply and monitor the battery voltage in real time. The integrated main control module is used to carry a real-time thread operating system and schedule different functional modules; The motor drive module is used to configure the motors driving the chassis and perform robot movement operations; The serial port transmission module is used to reserve a serial port for communication connection and data transmission; The integrated main control module includes: a local bus submodule, a wireless transmission submodule, a chassis control submodule, and a microprocessor submodule; The local bus submodule is used to configure the local bus interface and realize data exchange between the microprocessor and external devices by transmitting parallel data and control signals. The wireless transmission submodule is used to transmit signal data based on wireless communication technology; The chassis control submodule is used to perform robot vehicle type judgment, real-time control and radar obstacle avoidance based on the motor signals, attitude signals and radar signals of the robot chassis. The microprocessor submodule is used to configure the microprocessor and provide computing power; The chassis control submodule includes a vehicle model determination unit, an attitude detection unit, a real-time control unit, and an automatic obstacle avoidance unit; The vehicle model determination unit is used to determine the robot's drive type and chassis model based on the feedback signals of all motors in the accessed chassis and in combination with fuzzy rule reasoning principles. The posture detection unit is used to determine the posture scenario based on real-time monitoring of the robot's posture information during its movement, and to automatically control the motor's drive strategy according to the posture scenario. The real-time control unit is used to adaptively adjust the control parameters of the motor based on the robot's motion state; The automatic obstacle avoidance unit is used to identify obstacles in the robot's travel path using radar data from the lidar and control the robot to automatically avoid obstacles. The method of determining the robot's drive type and chassis model based on feedback signals from all motors within the accessed chassis, combined with fuzzy rule reasoning principles, includes: Connect the various motors in the robot chassis to the local bus sub-module in a basic order; The robot is placed in a suspended state, and the rotation of each motor in the chassis is driven. Feedback signals from each motor are obtained, and the number of motors is determined based on the number of feedback signals. If the feedback signal conforms to the four-wheel fuzzy rule, the robot's drive type is determined to be a four-wheel drive vehicle, and the chassis model of the robot is determined based on the chassis motion analysis results of the four-wheel drive vehicle. If the feedback signal conforms to the three-wheel fuzzy rule, the robot's drive type is determined to be a three-wheel drive vehicle, and the robot's chassis type is determined to be an omnidirectional wheeled vehicle. If the feedback signal conforms to the two-wheel fuzzy rule, the robot's drive type is determined to be a two-wheel drive vehicle, and the chassis model of the robot is determined based on the bus servo detection results of the two-wheel drive vehicle.

2. The adaptive robot drive system based on RT-Thread according to claim 1, characterized in that, The drive types include four-wheel drive vehicles, two-wheel drive vehicles, and three-wheel drive vehicles, and the chassis types include four-wheel Mecanum wheel vehicles, four-wheel four-wheel drive vehicles, two-motor tracked vehicles, Ackerman vehicles, and three-wheel omnidirectional vehicles.

3. The adaptive robot drive system based on RT-Thread according to claim 1, characterized in that, Based on the chassis motion analysis results of the four-wheel drive vehicle model, the chassis model of the robot is determined to include: The robot independently controls four motors in its chassis, driving the motors corresponding to the left front wheel and the right rear wheel to rotate, and sets the motor speeds. Then, the speeds of the motors corresponding to the right front wheel and the left rear wheel are set to zero. Set the rotation time of the motor, drive the robot to move at timed intervals according to the motor speed, and collect the forward acceleration and lateral acceleration values ​​of the robot during the rotation time; If both the forward acceleration and the lateral acceleration are greater than the set threshold, the robot's chassis type is determined to be a four-wheeled Mecanum wheel vehicle. If the forward acceleration is greater than the set threshold and the lateral acceleration is less than the set threshold, the robot's chassis type is determined to be a four-wheeled four-wheel drive vehicle.

4. The adaptive robot drive system based on RT-Thread according to claim 1, characterized in that, The chassis model of the robot is determined based on the bus servo detection results of the two-wheel drive vehicle type, including: The microprocessor sends bus commands to the motor via a serial bus to check if the bus servo motor exists; If a bus servo motor exists, serial port information is returned as a feedback signal, and the robot's chassis type is determined to be an Ackerman vehicle. If no bus servo motor exists, no feedback signal is returned, and the robot's chassis type is determined to be a two-motor tracked vehicle.

5. The adaptive robot drive system based on RT-Thread according to claim 1, characterized in that, The strategy of automatically controlling the motor drive based on the posture information of the robot during real-time monitoring, determining the posture scenario, and based on the posture scenario includes: The serial port transmission module is used to connect to the robot's inertial measurement unit, and the robot's attitude information during movement is monitored in real time based on the inertial measurement unit. The pitch and roll angles in the attitude information are calculated. Based on the values ​​of the pitch and roll angles, the degree of tipping of the robot is evaluated. When one of the pitch and roll angles is greater than 35°, the same-direction acceleration is read. If the rate of change of the same-direction acceleration is greater than the same-direction safety threshold, the driving of all motors is stopped and the motor driving signal is uploaded to the host computer. The vertical acceleration in the attitude information is calculated. If the rate of change of the vertical acceleration is greater than the vertical safety threshold, the driving of all motors is stopped and the motor driving signal is uploaded to the host computer. The horizontal acceleration in the posture information is calculated. When the horizontal acceleration is within the collision range, it is determined that the robot has collided and the collision information is uploaded to the host computer. If the number of collisions in the last minute is greater than the collision threshold, the drive of all motors is stopped and marked as an abnormal state, and the motor drive signal is uploaded to the host computer. The traveling acceleration and motor rotation parameters in the attitude information are calculated. When the motor rotation parameters and traveling acceleration do not match, it is determined to be a slippage phenomenon. The motor speed is limited to one-tenth of the current speed. If no movement occurs within one minute, the drive of all motors is stopped and the motor drive signal is uploaded to the host computer.

6. The adaptive robot drive system based on RT-Thread according to claim 5, characterized in that, The adaptive adjustment of motor control parameters based on the robot's motion state includes: The robot's motion status is detected. If the robot is on an uphill slope, the proportional parameters of the motors in the chassis are increased; if the robot is on a downhill slope, the proportional parameters of the motors are decreased. If the robot's chassis type is an Ackerman vehicle, then the steering control parameters of the Ackerman vehicle are adjusted based on the chassis acceleration and direction of travel.

7. The adaptive robot drive system based on RT-Thread according to claim 6, characterized in that, The adjustment of the steering control parameters of the Ackerman vehicle based on its chassis acceleration and direction of travel includes: The Ackerman car's direction of travel is detected, and it is determined whether the target point and the current point are in a bend. If they are in a bend, the chassis acceleration is read when the car is turning. If the chassis acceleration of the Ackerman car is greater than the turning threshold, the value of the chassis acceleration will be incorporated into the steering control by decreasing the proportional parameter and increasing the derivative parameter.