0 Introduction
In recent years, vehicle detectors, as an important front-end part of traffic information collection, have attracted more and more attention from industry insiders. In view of the development needs of modern highway traffic management and urban traffic management, the development of vehicle detectors, a dynamic detection technology for moving vehicles, has attracted great attention both at home and abroad. Vehicle detectors use motor vehicles as detection targets to detect the passage or existence of vehicles. Their function is to provide sufficient information for intelligent traffic control systems to achieve optimal control. At present, the commonly used moving vehicle detectors mainly include magnetic induction detectors, ultrasonic detectors, pressure switch detectors, radar detectors, photoelectric detectors, and video detectors. The toroidal coil electromagnetic induction vehicle detector has the advantages of stable performance, simple structure, easy detection circuit implementation, low cost, low maintenance, and wide adaptability. It has the widest market application range. At present, almost all vehicle detectors actually used on highways and urban roads in my country are imported from abroad. There are many problems with domestic vehicle detectors, such as high false detection rate, low sensitivity, and poor long-term working stability. [1-2]
Based on a large number of field experiments, this paper proposes a new solution that integrates stability, sensitivity and high speed to solve many of the problems mentioned above.
1 Working Principle
This system uses the method of combining MSP430F1121A microcontroller with a ring coil to detect moving vehicles. It is a detector based on the principle of electromagnetic induction. The sensor coil is a ring coil with a certain current. When the iron object to be detected passes through the coil and cuts the magnetic lines of force, it causes the change of the coil loop inductance. The detector can detect the existence of the object to be detected by detecting the change of the inductance. This paper uses the coupling circuit composed of a ring coil to detect its oscillation frequency. However, coil detection is easily affected by the external environment such as vehicle, humidity, temperature, etc., and the reference frequency will drift, thus affecting the detection effect. At the same time, due to the differences in vehicle models, vehicle bodies, and vehicle speeds, the accuracy of detection will also be affected. In response to these situations, this paper proposes a method of software dynamic refresh detection benchmark and an anti-interference software digital filtering method, which makes full use of the on-chip resources of the MSP430 series microcontroller to detect the coil frequency, effectively improving the accuracy and reliability of detection.
2 System Structure and Hardware Design
2.1 System Structure
The system is based on MSP430F1121A microcontroller, and consists of a ring coil sensor module, LC oscillation circuit, shaping circuit, frequency selection module, power supply module, voltage monitoring module, working mode setting module, signal output module and JTAG, etc. The system structure diagram is shown in Figure 1.
2.2 Principles and hardware implementation of each module
The ring coil sensor is a rectangular coil buried under the road surface, with leads at both ends connected to the vehicle detector. The ring coil acts as the inductor L in the LC oscillation circuit. When a metal object approaches, its inductance changes, causing the oscillation frequency to change. By detecting and comparing the frequency, it can be judged whether the vehicle is entering or leaving. The LC oscillation circuit composed of it and the shaping circuit together constitute the signal input circuit, as shown in Figure 2.
The toroidal coil and the moving vehicle are coupled through the electromagnetic field. When the vehicle passes through the toroidal coil and is at a certain position, the eddy current caused in the vehicle body is certain, and the influence of the eddy current on the toroidal coil is also certain. There is a certain mutual inductance between the vehicle and the toroidal coil. Therefore, we regard the vehicle as a short-circuit loop with inductance L1 and resistance R1, which is linked with the toroidal coil through mutual inductance M. The supply voltage of the toroidal coil is , provided by the oscillation circuit, the inductance is L2, and the resistance is R2. Then the equivalent inductance can be deduced to be:
(1)
The change amplitude of the first term L2 is related to the magnetic permeability of the vehicle, and the second term is related to the eddy current effect. If the operating frequency is selected appropriately, when a vehicle passes through the toroidal coil, the change of the first term in equation (1) will be smaller than the second term, that is, the equivalent inductance decreases. The oscillation frequency of the LC oscillator is:
(2)
Obviously, when a vehicle passes through the toroidal coil, L becomes smaller and f increases. The change in frequency is measured by the single-chip microcomputer detection circuit, so as to determine whether a vehicle passes.
The circuit is composed of transistors Q1 and Q2 to form a common emitter oscillator. Resistor R3 is the common emitter resistor of the two transistors and forms positive feedback. Tl is a magnetic tank transformer, which plays a dual role of impedance transformation and isolation from the external circuit. Its winding Ll is connected to an external ring coil through a lead wire. The inductive reactance of the ring coil is reflected to the winding L2 through Tl to form an equivalent inductance L. L and the parallel capacitor Cl form an oscillation loop. The LC value determines the oscillation frequency. When the switch Sl is closed, the capacitor C2 is connected in parallel with Cl, the capacitance increases, and the oscillation frequency decreases. The high and low oscillation frequencies are set in accordance with the different conditions on site to achieve better detection results. The LC oscillation circuit outputs a sine wave with glitches, which is not suitable for digital processing by a single-chip microcomputer. Therefore, a unidirectional voltage regulator diode and a single threshold voltage comparator are required to convert it into a square wave signal output.
Since the oscillation frequency of the LC oscillation circuit is not the same in different applications, the output square wave signal is divided by a counter and then sent to the P2.5 port of the microcontroller through the frequency selection interface, thereby avoiding the counting overflow of the microcontroller and enhancing the flexibility of the microcontroller in signal processing.
The MSP430F1121A microcontroller has a 16-bit RISC instruction structure; built-in 4kB Flash and 256B RAM; a 16-bit timer Timer-A and a watchdog timer; a comparator with 3 internal reference levels and an output with RC filtering, etc. [3-4]
This paper uses the external pin interrupt of the P2.5 port of MSP430F1121A and the Timer-A timing interrupt to collect data regularly to obtain the current frequency, and then compares it with the reference frequency according to the currently set sensitivity and working mode requirements to determine whether a vehicle is coming, and finally outputs a signal to the outside according to the set output method.
The power module uses the AS1117 chip to convert 5V to 3.3V, and provides power for the microcontroller, LC oscillation circuit, signal output module, JTAG and other modules.
The voltage monitoring module is used to monitor the 5V power supply voltage. Its principle is to divide the 5V voltage and connect it to the input pin of the Comparator-A of the P2.2 port of the MSP430 microcontroller. When the power supply voltage is lower than the set voltage, the power supply voltage undervoltage alarm function will be activated.
The working mode setting module sets the input level of the corresponding pins of the microcontroller representing sensitivity, working mode, output mode, etc. through the dial, and then the microcontroller performs key value query to complete the corresponding processing procedure.
3 System Software Design
3.1 Software Programming
The system software is designed with modular structure programming method, which gives full play to the rich peripheral modules of MSP430 microcontroller, greatly simplifying the hardware circuit of the instrument. All programs are written in C language, which is easy to debug and maintain, and has fast running speed, high execution efficiency and easy transplantation.
The system software consists of a main program, three initialization subroutines, and 10 functional subroutines. The three initialization subroutines are: MCU clock initialization subroutine, MCU I/O port initialization subroutine, and timer A initialization subroutine. The 10 functional subroutines are: initial base frequency measurement subroutine, vehicle detection subroutine, voltage undervoltage alarm subroutine, key judgment subroutine, key check subroutine, delay subroutine, dynamic refresh base frequency subroutine, P2.5 port interrupt subroutine, timer interrupt processing subroutine, and signal output subroutine. The main program flow chart is shown in Figure 3.
A timer is set in the main program. When no car passes, the timing interrupt service program is triggered after the power is turned on. The current P2.5 port interrupt count value is read multiple times and the average value is taken to obtain the current frequency value. This frequency value is set as the reference frequency, and the first frequency measurement flag is set. This flag can only be cleared when the system is reset. After that, the sensitivity value, working mode and output mode of the system at this time are determined through the key judgment subroutine and the key check subroutine.
Due to the differences in vehicle models, vehicle bodies, and vehicle speeds, the accuracy of detection will be affected to a certain extent. At the same time, the oscillation frequency of the coupling circuit varies greatly with external factors such as temperature and humidity. If a fixed reference value is set, it may cause misjudgment and affect the reliability and accuracy of the design. Therefore, this paper uses limiting filtering and mean filtering to collect the current frequency when judging whether a vehicle enters without affecting the detection speed. The program flow chart is shown in Figure 4.
Limiting filtering can overcome the interference of sharp pulses in the input. The basic idea is to compare the multiple current frequency values obtained with the current reference frequency value respectively, and set the maximum allowable deviation based on experience. If the difference between the current frequency value and the current reference frequency value exceeds the maximum allowable deviation, it is considered that interference has been introduced into the current sampling value, and the interference value is discarded, and then the average of the remaining multiple current frequency values is taken.
The collected frequency value is compared with the current reference frequency. If the difference is greater than the product of the current reference frequency and the sensitivity value, it is considered that a vehicle has entered, and the relevant signal is output. If it is judged that no vehicle has entered, the weighted average of the current collected frequency value and the current reference frequency is used as the reference frequency for the next measurement, thereby realizing the refresh of the reference frequency.
4 Conclusion
This vehicle detector has the characteristics of simple circuit, high precision, small size, short response time, stable performance, etc. It has been used at a highway checkpoint in Zhejiang with good results. This detector is universal and can be used to measure a series of traffic parameters in intelligent traffic control systems such as traffic flow, fleet length, occupancy rate, etc. through certain functional expansion, and has high practical value.
The author's innovation: The use of a new high-speed, low-power MSP430 microcontroller greatly improves the speed of moving vehicle detection. A detection can be completed in as little as 1.5ms. The application software dynamically refreshes the benchmark and anti-interference methods such as limiting filtering and averaging filtering improve the reliability and accuracy of detection.
Previous article:Design and simulation of remote meter reading system based on Proteus
Next article:Application of μPSD 32XX MCU in the Development of Tax Controller
Recommended ReadingLatest update time:2024-11-17 05:50
- Popular Resources
- Popular amplifiers
- MSP430 series single chip microcomputer system engineering design and practice
- Microcontroller Principles and Applications Tutorial (2nd Edition) (Zhang Yuanliang)
- Getting Started and Improving MSP430 Microcontrollers - National Undergraduate Electronic Design Competition Training Course
- Electronic competition thesis documents based on MSP430 microcontroller design + source code and some hardware PCB files
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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- 【micropython】NUCLEO_L073RZ and NUCLEO_L452RE have been added to the firmware library
- [NUCLEO-L552ZE Review] + Low Power Measurement Tool
- Lithium battery charging and discharging integrated chip
- Bluetooth module connection problem
- My company wants to design a smart lock and is looking for a chip that can ensure security. Is there anything you can recommend?
- Ethernet LED is not on
- AM57x Processors for Smart Grid Applications
- The pinout has changed, where should I modify?
- EMC signal integrity test 1---get out of the metaphysics
- Bluetooth protocol specifications (HCI, L2CAP, SDP, RFOCMM)