UWB Follow Car Solution: The Perfect Fusion of Precise Positioning and Intelligent Following

2025-06-10 6

2. Design of UWB Follow Car System  


(1) Overall System Architecture  

The UWB follow car system mainly consists of three parts: the UWB positioning module, the car motion control module, and the power management module. The UWB positioning module is responsible for real-time obtaining the distance and relative position information between the target and the car; the car motion control module controls the car's movement through motor drive and other means according to the positioning information to achieve the following function; the power management module provides stable power supply for the entire system and monitors and manages the battery power to ensure the continuous and stable operation of the system.  


(2) Hardware Design  

UWB module: Select high-performance UWB modules, such as Decawave's DWM1000 module. This module integrates functions such as UWB radio frequency front-end and baseband processor, which can easily realize the transmission and processing of UWB signals. Install multiple UWB modules as base stations on the car, generally at least three, fixed on the top of the car according to a certain geometric layout (such as an equilateral triangle), so that the target's position can be more accurately determined by triangulation. At the same time, the user carries a UWB module as a tag. When the tag enters the signal coverage of the base station, the base station and the tag interact signals to achieve distance measurement and positioning.  

Microcontroller: Choose a high-performance and low-power microcontroller as the main control chip of the car, such as the STM32 series single-chip microcomputer. STM32 has rich peripheral resources, strong computing power, and low power consumption, which can meet the needs of UWB data processing, motor control, and coordination and management of other functional modules. It communicates with the UWB module through communication interfaces such as serial port or SPI, receives the distance information measured by the UWB module, calculates the target's position coordinates according to the preset algorithm, and then generates corresponding motion control commands.  

Motor drive module: In order to drive the car's motor to realize actions such as forward, backward, and turning, a special motor drive module is needed. Common motor drive chips such as L298N can provide sufficient current to drive DC motors. The microcontroller controls the input pin levels of the motor drive module to control the forward and reverse rotation and speed of the motor, thereby realizing the precise control of the car's motion state.  

Power module: Use rechargeable lithium batteries to power the car to provide a stable power source. At the same time, equip with a power management chip to perform functions such as charging management, overcharge and over-discharge protection, and voltage conversion for the battery. For example, convert the voltage of the lithium battery into voltages suitable for each module through a DC-DC step-down chip, such as providing 3.3V voltage for the microcontroller and suitable working voltage for the motor drive module. In addition, the power module can also real-time monitor the battery power and feedback the power information to the microcontroller, so as to timely remind the user to charge or take corresponding energy-saving measures when the power is low.  

Other auxiliary modules:  

  Obstacle avoidance sensor: In order to prevent the car from colliding with obstacles during the following process, install obstacle avoidance sensors such as diffuse reflection photoelectric sensors or ultrasonic sensors. Diffuse reflection photoelectric sensors are cheap and simple to control. Installed in front of the car, when an obstacle is detected in front, the sensor will output a signal to the microcontroller, which will adjust the car's movement direction or speed according to the situation to achieve the obstacle avoidance function. However, the detection distance of diffuse reflection photoelectric sensors is relatively short. In some scenarios with high obstacle avoidance requirements, ultrasonic sensors can be combined to obtain longer-distance and more comprehensive obstacle avoidance detection effects.  

  OLED display module: Install an OLED display module on the car to display some operating status information of the car, such as battery power, current speed, distance from the target, etc. This allows users to intuitively understand the car's working conditions, facilitating monitoring and debugging of the car. The OLED display module has the advantages of low power consumption, clear display, small size, etc., and is very suitable for applications in small intelligent devices.  


(3) Software Design  

UWB data processing algorithm:  

  TOF algorithm implementation: Implement the TOF algorithm in the software, and accurately calculate the distance between the tag and each base station according to the timestamps of signal transmission and reception by the UWB module. By filtering multiple distance measurement values, such as using the Kalman filter algorithm, noise interference can be effectively removed, and the accuracy and stability of distance measurement can be improved.  

  Positioning solution algorithm: Based on triangulation or (multilateration), use the distance information between multiple base stations and the tag to calculate the position coordinates of the tag (i.e., the target) in the car's coordinate system. Take triangulation as an example, assuming that the position coordinates of the three base stations on the car are known, the coordinates of the tag can be calculated by solving the system of equations according to the geometric relationship of the triangle through measuring the distances from the tag to these three base stations. In practical applications, in order to improve the accuracy and reliability of positioning solutions, optimization algorithms such as weighted least squares can be used to further process the solution results.  

Motion control algorithm:  

  Path planning algorithm: Plan the car's motion path according to the target's position coordinates and the car's current position and attitude. Common path planning algorithms include A* algorithm and Dijkstra algorithm. In simple following scenarios, a direct following algorithm based on distance and angle can be used, that is, calculate the car's required forward speed and turning angle according to the distance and angle deviation between the target and the car, so that the car can follow the target along the shortest path or optimal path. For example, if the target is in front of the car and deviates from the car's current driving direction by a certain angle, the car will adjust the steering motor according to this angle deviation and adjust the forward speed according to the distance to gradually approach the target and maintain the following state.  

  PID control algorithm: In order to achieve precise control of the car's movement, the PID (Proportional-Integral-Derivative) control algorithm is used to adjust the motor's speed and steering. The PID controller calculates the appropriate control amount according to the deviation between the car's current actual position and the target position by adjusting the proportional coefficient, integral coefficient, and differential coefficient, and outputs it to the motor drive module, so that the car can quickly and stably track the change of the target position and reduce the oscillation and error in the movement process. In practical applications, the PID parameters need to be debugged and optimized according to the car's specific performance and operating environment to achieve the best control effect.  

System software process:  

  System initialization: When the car starts, initialize each hardware module, including the UWB module, microcontroller, motor drive module, obstacle avoidance sensor, OLED display module, etc. During the initialization process, configure the working parameters of each module, such as the communication frequency of the UWB module, the clock frequency of the microcontroller, the control mode of the motor drive module, etc., to ensure that each module can work normally.  

  UWB data collection: The UWB module continuously sends and receives signals, collects the distance data between the tag and the base station, and transmits these data to the microcontroller through the communication interface. The microcontroller preprocesses the received data, such as removing abnormal values and filtering, to improve the reliability of the data.  

  Positioning solution and path planning: The microcontroller calculates the target's position coordinates using the positioning solution algorithm according to the preprocessed UWB distance data. Then, combined with the car's current position and attitude information, use the path planning algorithm to plan the car's motion path and generate corresponding motion control commands, including forward speed and turning angle.  

  Motion control and obstacle avoidance: The motor drive module drives the motor to operate according to the motion control commands sent by the microcontroller, making the car move along the planned path. During the car's movement, the obstacle avoidance sensor real-time detects whether there are obstacles in front. Once an obstacle is detected, the obstacle avoidance sensor immediately sends a signal to the microcontroller, which pauses the current motion control commands, starts the obstacle avoidance program, and adjusts the car's movement direction or speed to make the car avoid the obstacle and then resume the original following path.