1 Introduction
There is often a blind spot at the bend of a bend. The driver cannot see whether there are vehicles passing on the other side of the bend, which causes a large number of traffic accidents. Therefore, it is particularly important to eliminate traffic accidents caused by blind spots. For this reason, a mountain road bend warning system based on C8051F310 is designed. When the system detects a car on the other side of the bend, it can timely warn the driver in advance through traffic warning lights to pay attention to avoid it. Therefore, accurately judging whether there are vehicles passing is the key to the design of this system.
2 System Design
2.1 System design
The main purpose of the system design is to warn drivers to pay attention to safety while driving and prevent accidents. The system is placed on both sides of the mountain road bend, and each system controls a warning light. When one system detects a vehicle, it sends it to the other system through RF communication. After receiving the signal, the other system controls the warning light to flash to remind the driver.
Figure 1 is a block diagram of the system design. The vehicle detection sensor uses a sine wave oscillation circuit to detect the vehicle. In the detection circuit, the output signal frequency is collected by C8051F310, and then processed by a first-order filtering algorithm to filter out frequency interference caused by environmental factors, and further calculate and verify the acquisition accuracy of C8051F310.
2.2 System hardware circuit design
Figure 2 shows the main hardware circuit of the system. The input signal of the vehicle detection sensor is U(t). The sinusoidal signal is converted into a square wave signal by the comparator and then input into the microcontroller C8051F310. The microcontroller then collects the signal frequency through the counter.
2.3 First-order filtering algorithm
First-order filtering, that is, first-order inertial filtering. The first-order low-pass filtering algorithm formula is:
Where α is the filter coefficient, X(n) is the current sampling value, Y(n-1) is the previous filter output value, and Y(n) is the current filter output value.
The first-order low-pass filtering method uses the current sampling value and the last filtering output value to weight and obtain the effective filtering value, so that the output has a feedback effect on the input. The filtering coefficient is 0-1; this coefficient determines the weight of the new sampling value in the current filtering result. The first-order filtering coefficient can be fixed or automatically calculated according to a certain program algorithm. However, the first-order filtering algorithm cannot fully take into account sensitivity and stability. It can only find a balance point and select the best possible stability within the acceptable sensitivity range of the system design. That is, when the data changes rapidly, the filtering result can follow up in time (sensitivity priority); and when the data tends to be stable and oscillates up and down at a fixed point, the filtering result tends to be stable (stability priority).
2.4 Vehicle detection circuit
Figure 3 is a sine wave oscillation circuit. This circuit is used in vehicle detection circuit sensors and can sense the presence of metal objects. Using eddy current sensing, the buried detection wire is directly connected to the sine wave oscillation circuit.
When no metal objects such as vehicles are detected, the frequency of the oscillation circuit output signal u0(t) basically does not change much, but the value does not remain constant, but will drift within a certain range. When metal objects such as vehicles are detected, the frequency f0 of U0(t) will suddenly change to f. The frequency difference △f=f-f0, where the range of △f is generally several hundred hertz to several thousand hertz after a large number of experiments. The oscillation frequency of the circuit in Figure 3 is:
In the formula, f is related to L, C1, and C2 in the circuit.
When the value of the inductor L changes, f will also change accordingly. Similarly, when the capacitance value changes, f will also change. Generally speaking, the capacitance value changes with the ambient temperature, so the oscillation frequency f also changes with the temperature.
2.5 Detection Circuit Frequency Algorithm
Because the signal frequency in the detection circuit changes at any time, it brings certain difficulties to the detection of metal objects such as motor vehicles, especially when the ambient temperature changes sharply, the frequency value of the signal itself will change greatly. The analysis of the oscillation circuit data collected in the outdoor environment at high temperature shows that the f value changes by several hundred Hz with the temperature within 1 hour, and no metal objects are close during the measurement. Therefore, this design adopts the benchmark dynamic change method. The specific calculation method is as follows: set fz as the reference frequency; fc is the acquisition frequency involved in calculation and judgment; f is the actual acquisition frequency. m and n are filter factors. When the system is not powered on, the initial value of fz is 0; after power-on, the frequency f collected for the first time is used as the initial value of fz, and then the fz value is changed regularly.
First, the actual collected frequency f is subjected to first-order filtering according to formula (2), and then the value of fc is calculated:
The filter factors m and n in formula (3) and formula (4) are obtained through experiments. When the f value changes rapidly, the filter result is followed up in time and the faster the data changes, the higher the sensitivity. When detecting vehicles, fz needs to be changed regularly, and the change time should be based on the change of outdoor temperature.
When a metal object passes through the coil, the collected frequency value is f, and the reference frequency is fz. The algorithm for determining the vehicle is to obtain fc from equation (3), and then obtain from equation (5):
By judging whether △f is within a certain range, the vehicle passing situation is obtained. This range is obtained through a large number of experiments. The specific CPU algorithm flow is shown in Figure 4.
3 Experiments and results analysis
The algorithm was obtained through a large number of verification tests. Indoors, the test used a 45 cm × 45 cm coil (number of turns n = 12). The simulated motor vehicle was a metal cart with a length of 1.2 m and a width of 0.8 m. When the car passed the coil, the difference between the acquisition frequency fc and the reference frequency fz was about 400 Hz, and the CPU could accurately determine that a car had passed. In the outdoor test, the coil was buried under the road surface. When the car passed the coil, the difference between the acquisition frequency fc and the reference frequency fz was about 400 to 2,000 Hz. This difference changes with the different vehicle models and the height of the vehicle chassis, and the CPU can also accurately determine that a motor vehicle has passed. Through a large number of indoor and outdoor tests, the filter factor in the filtering algorithm was adjusted in time to improve the detection sensitivity so that it can meet the needs of different vehicles.
4 Conclusion
Adopting filtering algorithm and updating the reference frequency of oscillation circuit in real time can reduce the interference of circuit frequency change on vehicle detection. The mountain road turning prevention warning system designed by c8051F310 has been installed on the winding mountain road. The system can accurately detect vehicles and send warning information. At the same time, the design fully considers environmental factors and maintenance inconvenience, and designs a host computer monitoring system. Therefore, the system has a simple structure, reliable performance, and low price, which has attracted widespread attention from the transportation department.
Previous article:Design of Communication Module for Automatic Paving Machine Based on C164 Single Chip Microcomputer
Next article:Design of a high-power lead-acid battery charger controlled by a single-chip microcomputer
- 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
- How is this comparator with hysteresis implemented?
- Precautions for using chip ferrite beads
- Introduction to Electromagnetic Compatibility by Clayton R.Paul
- Stare at pictures to find inspiration
- Calculation of the ripple rate r of the second inductor of the SEPIC circuit
- Common problems in designing microcontroller peripheral circuits
- Smart connected lighting and the Internet of Things
- [Chuanglong TLA40i-EVM development board] +01. Unboxing (zmj)
- Can the 66AK2L06 SoC enable miniaturization of test and measurement equipment?
- Does ThreadX open source have a big impact on other RTOS?