1 Introduction
Ultrasonic sensors have been widely used due to their high measurement accuracy, fast response and low price. The traditional application method is that one transmitter corresponds to one receiver, and there are also multiple transmitters corresponding to one receiver. However, we found in actual applications that if the obstacle is large (such as a wall), the ultrasonic sensor can be used to accurately measure the distance, but if it is used in the car anti-collision system, because the obstacle is columnar and the ultrasonic transmitter has a certain scattering angle (left and right), even if the obstacle is not directly in front of the car, the ultrasonic wave can still detect the oblique front echo, which brings difficulties and misleading to the intelligent control of the vehicle. In order to solve this problem, we proposed a solution using dual receivers and gave a set of specific control strategies from a practical perspective.
2 System structure and process design
Our entire system needs to complete the functions of distance measurement, speed measurement, positioning, and control of the car movement. The system includes the following six parts: ultrasonic transmitter circuit, ultrasonic receiver circuit, signal processor, temperature measurement, car control circuit and other five parts. The system structure block diagram is shown in
Figure 1: Figure 1: System structure block diagram
A 40k square wave is generated by a single-chip microcomputer, which is amplified to drive the ultrasonic sensor transmitter to emit ultrasonic waves. After encountering the object in front, it is captured by the receiving end. After calculating the capture time of the two receiving heads and adding temperature compensation, the final direction and distance of the car in front are determined, and then the speed relative to the car in front is calculated by differential with the previous data. Finally, intelligent control is performed through the three data of speed, distance and position to control the car to turn or slow down, etc.
The specific hardware components are as follows: MCU uses AT89S52 single-chip microcomputer, P1.0 port outputs the 40K square wave signal required by the ultrasonic transducer, and drives the sensor after passing through the inverter 7404. In order to make the ultrasonic wave transmit farther, we connected three transmitters in parallel, and used the external interrupt 0 port to monitor the return signal output by the ultrasonic receiving circuit. The echo detection uses the infrared detection integrated chip CX20106, and the display circuit uses a simple 4-bit common anode LED digital tube. The break code uses 74LS244 and the bit code is driven by 8550. The temperature measurement part uses 18B20 to measure the current ambient temperature to determine the speed of ultrasonic propagation.
3 MCU algorithm control
3.1 Distance calculation and direction judgment
The single-chip microcomputer can calculate the time between the emission and reception of the ultrasonic wave, find the sound speed at the corresponding temperature according to the actual temperature measurement of the temperature measurement system, and calculate the distance between the reflector and the two receiving ends. Theoretically, the spatial position of the object can be directly mathematically derived from the above two data (as shown in Figure 2 and formulas 1 and 2).
Figure 2 Spatial orientation of ultrasonic sensor
Where d is the distance between R1 and R2, z1 and z2 are the distances from the object to each receiving end. If the calculation is done directly, it will be too complicated and time-consuming for ordinary microcontrollers to process. Therefore, we propose a method to roughly determine the position of the object based on calculating the distance difference between the two. Generally speaking, the car only cares about the object in front of the car. We set a distance parameter l to represent the horizontal distance between the obstacle in front and the car, and then set a distance parameter h to represent the vertical distance between the obstacle in front and the car. We can deduce the relationship between h, l, d and z2-z1 from the following relationship (Formula 3-Formula 6).
It is not difficult to find that the first term is always greater than the second term by dividing the two terms in formula 6, so z2-z1 is an increasing function of l. At the same time, as h decreases, z2-z1 will also increase. That is to say, when an obstacle is close to the car, if it deviates from the center of the car (that is, it will not hit the car), there is an obvious feature that its z2-z1 value will be larger. We can take d=5cm h=30cm, let l vary between [10cm,30cm], and the resulting curve is shown in Figure 3. The geometric relationship of each physical quantity is shown in Figure 4. [page]
Figure 3 Relationship between z2-z1 and l
Figure 4 Geometric relationship of various physical quantities
It is not difficult to find that when the distance l is in the interval [10cm, 30cm] (h<30cm), the difference between z2-z1 will be >4cm. Based on this, we set a threshold of 4cm. When the difference is detected to be greater than 4cm, no braking control is required and the car can go straight through. Through such simple calculation and judgment, we can effectively avoid the z1 and z2 values being too small due to obstacles that deviate from the center of the car being too close to the car, thereby causing possible misjudgment of braking. When doing this project, the car model we used was not large, so the designed threshold was not very large. If it is applied to the actual car model, the size of the threshold can be changed according to the situation.
3.2 Calculation of speed
We take a simple approximate average to estimate the speed. We can calculate that the system distance measurement interval is about 120ms. By comparing the current distance measurement result with the last distance measurement result, the approximate value of the current speed can be estimated according to formula 7:
3.3 System flow (see Figure 5).
Figure 5 System flow
4 Partial test results
Table 1 is our test results for the distance measurement circuit alone: (unit: cm).
Table 1 Distance measurement results
From this table, we can see that our distance measurement circuit is very accurate.
Figure 6 is our test results for the dual receiving head solution:
Figure 6 Test results of the dual receiving head solution
In these six pictures, the upper three pictures are all distances calculated by the time the right receiving head receives the signal, while the lower three pictures are all distances calculated by the time the left receiving head receives the signal. It can also be seen that when the obstacle deviates from the center, the distances measured by the left and right receiving heads are obviously different, which can be used for positioning.
Finally, when we completed the debugging of the entire car system, we used it to test and found that no matter whether it is a moving or stationary obstacle, at any position in front of the car, the car can correctly judge and make a forward or stop action.
5 Conclusion
In summary, this system proposes a vehicle-mounted automatic speed and distance measurement control system based on dual ultrasonic receiving heads and 3 transmitting heads, which can effectively play the role of protecting the driver and prejudging and reminding the driver. When the driver takes wrong control measures when encountering an emergency, the system can also force correction or alarm to remind the driver to check. Because the system is simple, economical and stable, it has a very large market prospect.
Previous article:Design of infrared temperature monitoring system based on C8051F340 single chip microcomputer and CPLD
Next article:Interface Design between 16-bit Σ-Δ A/D Converter AD7705 and Microcontroller
Recommended ReadingLatest update time:2024-11-16 21:53
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- MicroPython Update: 2021.1
- Best Illusions of 2019
- What challenges do you face in powering handling and harvesting robots? Let’s talk with Vicor engineers!
- 2006 Germany World Cup Schedule
- Regarding millimeter wave transceiver chips,
- MOS tube leakage current
- 【Repost】Everything you want to know about rectifier diodes is here
- Enhanced performance 100-bit gate driver improves efficiency of advanced communications power modules
- How to implement interruption of USB virtual serial port
- The rapid entry of UWB centimeter-level positioning solutions has brought strong momentum to indoor positioning