Design of radar speed monitoring system based on DSP[Copy link]
At present, the main methods of vehicle speed measurement include coil speed measurement, photoelectric speed measurement, radar speed measurement, video speed measurement, etc. Coil speed measurement is mostly buried. When a vehicle passes through the coil, it will cause the coil magnetic field to change, and the detector will calculate the vehicle speed based on this. The coil must be buried directly in the lane during installation or maintenance. The installation process will temporarily hinder traffic, and the road surface is easily damaged during maintenance. The coil is also easily affected by factors such as freezing and roadbed subsidence. When traffic is congested, the detection accuracy will be greatly reduced. Photoelectric speed measurement has high accuracy when measuring at low speeds, but there are accuracy problems when the speed reaches more than 150 kilometers per hour. Radar speed measurement is currently the main way to detect vehicle speeding, but the counting and frequency discrimination method used by most radar speed guns has low test accuracy, complex circuits, and single measurement functions, which limits its further promotion and application. The speed measurement method of video detection installs the camera above the lane, shoots the vehicle motion image sequence, uses image processing and pattern recognition methods to analyze the received image sequence, obtains the displacement of the vehicle between two frames in the image, and thus obtains the vehicle's driving speed. This method is based on accurate response time, but due to the limitation of the receiving device, it is impossible to accurately obtain the trigger time frame sequence, so it will cause a large error in the measured speed. This system uses DSP for digital signal processing and uses spectrum analysis technology to capture the Doppler frequency shift of the radar echo signal to calculate the speed of the car, which can greatly improve the speed measurement accuracy. The DSP-based radar speed measurement monitoring system designed in this paper improves the test accuracy, increases the video monitoring function, improves the reliability and practicality of the system, and has a high promotion value. 1 Design concept and system block diagram According to the principle of Doppler effect, that is, the moving object has a frequency shift effect on the received electromagnetic wave, and the speed of the measured object is calculated by the received reflected wave frequency shift. The relationship between the speed of an object and the Doppler frequency is [1]: Where, fD is the Doppler frequency (Hz); Vt is the speed of the moving target (m/s); c is the speed of light; f0 is the frequency of the transmitted wave (Hz). From formula (1), it can be seen that the other variables are known. As long as fD is measured, the speed of the measured vehicle can be calculated. Once the system detects a speeding vehicle, the camera begins to capture the speeding vehicle information and transmits the speeding vehicle information to the monitoring center through the RS-485 interface. The system structure block diagram is shown in Figure 1. 2 System Hardware Design 2.1 Radar Signal Processing Channel 2.1.1 Radar Sensor The speed radar sensor of this system adopts the working principle of the Doppler effect and uses a microwave radar with a transmission frequency of 24.15 GHz as the signal transceiver. Microwave radar has the advantages of good directionality and a speed equal to the speed of light. The emitted microwave is immediately reflected back when it encounters a vehicle. After being mixed by the receiving end, a difference frequency signal corresponding to the speed is generated, namely the beat intermediate frequency signal. The frequency range of this signal is 10~100 000 Hz (related to the moving speed of the object being measured). The faster the speed, the higher the frequency. The amplitude of the echo difference frequency signal varies between 1 mV and 100 mV with the distance of the target. The closer it is, the larger the amplitude. Figure 2(b) is the waveform when the moving target is close to the detection sensor, and Figure 2(c) is the waveform when the moving target is far away from the detection sensor. 2.1.2 Radar signal processing module The amplitude of the echo difference frequency signal varies between 1 mV and 100 mV with the distance of the target. The echo signal is relatively weak and easily interfered by external signals. The echo intermediate frequency signal needs to be amplified to between 30 mV and 3 V. After the mixed Doppler signal is amplified by the intermediate frequency, the signal is sampled by AD7274 at a frequency of 1.25 MHz, thus ensuring high conversion accuracy and fast sampling rate. The digital signal after A/D conversion is sent to DSP for spectrum analysis to estimate the Doppler frequency, and converted into km/h after DSP operation. 2.2 Video acquisition channel This part is mainly composed of SAA7111A video acquisition module, extended storage module and CPLD module. 2.2.1 SAA7111A video acquisition module In order to facilitate the acquisition of speeding vehicle information, the system has expanded the external camera interface. At present, most cameras support PAL/NTSC format output. PAL/NTSC analog video signals contain not only image signals, but also signals such as line synchronization, line blanking, field synchronization, and field blanking. Analog video signals are not convenient for long-distance transmission, so they need to be converted into digital signals and transmitted to the monitoring center through video compression algorithms. SAA7111A integrates A/D and decoding functions, supports both PAL and NTSC TV formats, and can well meet the design requirements of this article. The initial setting of SAA7111A in this system is one analog video signal input, automatic gain control, 625 lines 50 Hz PAL format, 720×576 resolution and 4:2:2YUV format (16 bit digital video signal output), and sets the default image brightness, contrast and saturation. Since the image of this topic is a black and white image, only 8 bits of brightness signal are needed to separate the status signal (horizontal synchronization signal HREF, odd and even field mark signal RTSO, pixel synchronization clock LLC, LLC's binary frequency division LLC2 and other signals) from the SAA7111A chip. 2.2.2 Extended storage module Since the RAM in the TMS320VC5502 chip is only 32 KB, the system needs a larger space to store video data. Therefore, this system has expanded the storage space and expanded the 64 KB dual-port RAM data space. The dual-port RAM is mainly used to store images. Since the dual-port RAM has two independent access interfaces, the writing (CPLD) and reading (DSP) of the image can be carried out at the same time, which is conducive to improving the speed and accuracy of system processing. In addition, a Flash (non-volatile rewritable memory) memory is also expanded. It is mainly for completing the initialization loader (Boot Loader) after the DSP is powered on, and reading the program solidified in the Flash into the on-chip RAM of the DSP or the storage space mapped by the off-chip RAM. 2.2.3 CPLD part design Since the interface circuit of this system is relatively complex, CPLD is used in the interface design of SAA7111A. CPLD drives and controls SAA7111A video image acquisition, and stores the acquired data in dual-port RAM. CPLD configures SAA7111A when the system is powered on and initialized. This system uses Altera's EPM7128SLC84 chip, which has 2,500 gate units, 128 logic macro units, and 84 I/O pins. In the design process of CPLD, Altera's programmable logic devices and development software Max+Plus Ⅱ were used. 2.3 Serial Communication Interface The system expands the video monitoring interface. After analog-to-digital conversion, the input video signal is packaged through the video compression algorithm and transmitted to the monitoring center through the serial port. Considering that the monitoring center is often far away from the test point, the serial port transmission of video data uses RS-485 transmission. This design uses the MAX3160 produced by MAXIM, which is a programmable multi-protocol transceiver that supports RS-232/RS-485/RS-422 transmission modes. Its data transmission rate can reach up to 10 Mb/s in RS-485/RS-422 mode, and the transmission distance can reach 1,200 m. The system uses the RS-485 transmission mode of MAX3160. The 8 and 16 pins of MAX3160 are connected to the SP3 (DSP pin 34) and SP1 (DSP pin 37) of TMS320VC5502 respectively [2]. 2.4 LCD display part design Since the display of this system is just a simple 4-bit vehicle speed, a two-wire serial interface LCD SMS0401 is selected. SMS0401 has four interfaces: VSS (power ground), CLK (serial port shift pulse input), DI (serial data input) and VDD (power positive). This system defines McBSP0 of TMS320VC5502 as a general I/O port, connects DX0 of McBSP0 to the DI port of the LCD, CLKX0 of McBSP0 to the CLK of the LCD, and connects the power supply VDD and VSS to the 3.3 V power supply and ground of the system respectively. Then use CLKX0 of McBSP0 to imitate the CLK signal, and then output data from DX0 of McBSP0 in sequence to complete the LCD display. 3 Software Design The main function of the system software is to sample the vehicle's speed in real time, collect the video signal of the speeding vehicle and transmit the image data to the host. The main program flow of the system is shown in Figure 3. The system software is divided into five main modules: system power-on reset initialization, speed sampling, video acquisition, compression encoding and data transmission. After the system is powered on and reset, the system initializes the DSP and CPLD. The initialization mainly includes: CPLD initializes SAA7111 and sets the working mode through the I2C bus; DSP space allocation, EMIF configuration to ensure normal access to the external memory; configure the RS485 serial port module, set the DMA channel and set the external interrupt, then the DSP waits for the interrupt of the CPLD, DMA reads the data, and encodes it. When the encoding is completed, the DSP delivers the data to the RS485 module. It is transmitted to the host computer through the RS485 bus, and at the same time, the DSP sends an idle signal to the CPLD to notify the CPLD to continue sending the next frame. 4 Experimental results and data analysis 4.1 Vehicle speed acquisition Taking a modern red car running on a highway as an example, according to the test requirements, the speed limit is set to 100 km/h, and the sampled data is stored in 2 048 RAM units of DSP. The output waveform after extracting the RAM unit data and processing it with MATLAB is shown in Figure 4. According to formula (1), if the vehicle speed needs to be calculated, the frequency of the speed radar echo difference frequency signal needs to be measured. At present, there are two methods for testing frequency: classical spectrum estimation method and modern spectrum estimation method. In general, the classical spectrum estimation method has poor variance performance and low resolution, and cannot meet the needs of high-resolution spectrum estimation. Modern spectrum estimation is roughly divided into parameter model estimation and non-parametric model estimation in terms of methods. The former includes AR model, MA model, ARMA model, PRONY index model, etc., and the latter includes minimum variance method, multi-component MUSIC method, etc. Among them, the canonical equation of the AR model is a set of linear equations, while the MA and ARMA models are nonlinear equations. Moreover, the AR model is easy to reflect the spectrum peak of the signal. The problem in this system is to extract the frequency at the maximum power, and the focus is on spectrum peak analysis, so the AR model is more in line with the actual needs of the system. The parameters of the AR model can be obtained by solving the following equations. The echo difference frequency signal received by the Doppler radar is input into TMS320VC5502 after A/D conversion and the power spectrum waveform calculated is shown in Figure 5. The maximum frequency displayed by the radar signal input spectrum analyzer is 6.3 kHz. The waveform estimated from Figure 5 can be obtained through spectrum peak search. The frequency value corresponding to the estimated spectrum maximum value (Doppler frequency) is 6.25 kHz. According to formula (1), the vehicle speed reaches 118.78 km/h at this time. The calculated error is (6.3-6.25)/6.3×100%≈0.79%. It can be seen that the Doppler frequency error estimated by the calculation of TMS320VC5502 is within 1%. 4.2 Experimental results of video images This system realizes real-time compression and high-speed transmission of still images. Using the standard JPEG compression algorithm, 5 frames of 512×512×8 grayscale images can be compressed and transmitted per second, which is very cost-effective. JPEG compression coding mainly consists of preprocessing, DCT transformation, quantization, Huffman coding and other processes. When JPEG compression coding, the original two-dimensional image in YCbCr space must be divided into 8×8 data blocks, and then each data block is subjected to DCT transformation, quantization, zigzag scanning and Huffman coding in order from left to right and from top to bottom (quantization and Huffman coding require the support of quantization table and Huffman table respectively) [3], which will not be described in detail here. The video image data is stored in the dual-port RAM, and the MATLAB display result of the extracted image data is shown in Figure 6. After the video image is compressed by JPEG, it is uploaded to the computer through the RS485 communication interface. The computer terminal restores the image through the decompression algorithm. The decompressed effect is shown in Figure 7. This paper introduces the design and implementation of a radar speed monitoring system based on the TMS320VC5502 DSP. The hardware design of the system adopts the DSP+CPLD solution, which gives full play to their respective advantages and has been verified to achieve good real-time results. Due to the application of DSP to analyze the Doppler spectrum, the frequency estimation is more accurate and reliable, and the speed measurement error is within 1%. The system is small in size, light in weight, and easy to operate. It can meet the current domestic requirements for speed detection and provides an important means for traffic management departments to monitor the speed of motor vehicles. The MA and ARMA models are nonlinear equations. Moreover, the AR model is easy to reflect the spectrum peak of the signal. The problem in this system is to extract the frequency at the maximum power. The focus is on spectrum peak analysis, so the AR model is more in line with the actual needs of the system. The parameters of the AR model can be obtained by solving the following equations. The echo difference frequency signal received by the Doppler radar is input into TMS320VC5502 after A/D conversion and the power spectrum waveform obtained is shown in Figure 5. The maximum frequency displayed by the radar signal input spectrum analyzer is 6.3 kHz. The waveform estimated from Figure 5 can be obtained through spectrum peak search. The frequency value corresponding to the estimated spectrum maximum value (Doppler frequency) is 6.25 kHz. According to formula (1), the vehicle speed reaches 118.78 km/h at this time. The calculated error is (6.3-6.25)/6.3×100%≈0.79%. It can be seen that the Doppler frequency error estimated by TMS320VC5502 is within 1%. 4.2 Experimental results of video images This system realizes real-time compression and high-speed transmission of still images. Using the standard JPEG compression algorithm, 5 frames of 512×512×8 grayscale images can be compressed and transmitted per second, which is very cost-effective. JPEG compression coding mainly consists of preprocessing, DCT transformation, quantization, Huffman coding and other processes. During JPEG compression coding, the original two-dimensional image in YCbCr space must be divided into 8×8 data blocks, and then each data block is subjected to DCT transformation, quantization, zigzag scanning and Huffman coding in order from left to right and from top to bottom (quantization and Huffman coding require the support of quantization table and Huffman table respectively) [3], which will not be described in detail here. The video image data is stored in the dual-port RAM, and the MATLAB display result of the extracted image data is shown in Figure 6. After the video image is compressed by JPEG, it is uploaded to the computer through the RS485 communication interface. The computer terminal restores the image through the decompression algorithm. The decompressed effect is shown in Figure 7. This paper introduces the design and implementation of a radar speed monitoring system based on the TMS320VC5502 DSP. The hardware design of the system adopts the DSP+CPLD solution, which gives full play to their respective advantages and has been verified to achieve good real-time results. Due to the application of DSP to analyze the Doppler spectrum, the frequency estimation is more accurate and reliable, and the speed measurement error is within 1%. The system is small in size, light in weight, and easy to operate. It can meet the current domestic requirements for speed detection and provides an important means for traffic management departments to monitor the speed of motor vehicles. The MA and ARMA models are nonlinear equations. Moreover, the AR model is easy to reflect the spectrum peak of the signal. The problem in this system is to extract the frequency at the maximum power. The focus is on spectrum peak analysis, so the AR model is more in line with the actual needs of the system. The parameters of the AR model can be obtained by solving the following equations. The echo difference frequency signal received by the Doppler radar is input into TMS320VC5502 after A/D conversion and the power spectrum waveform obtained is shown in Figure 5. The maximum frequency displayed by the radar signal input spectrum analyzer is 6.3 kHz. The waveform estimated from Figure 5 can be obtained through spectrum peak search. The frequency value corresponding to the estimated spectrum maximum value (Doppler frequency) is 6.25 kHz. According to formula (1), the vehicle speed reaches 118.78 km/h at this time. The calculated error is (6.3-6.25)/6.3×100%≈0.79%. It can be seen that the Doppler frequency error estimated by TMS320VC5502 is within 1%. 4.2 Experimental results of video images This system realizes real-time compression and high-speed transmission of still images. Using the standard JPEG compression algorithm, 5 frames of 512×512×8 grayscale images can be compressed and transmitted per second, which is very cost-effective. JPEG compression coding mainly consists of preprocessing, DCT transformation, quantization, Huffman coding and other processes. During JPEG compression coding, the original two-dimensional image in YCbCr space must be divided into 8×8 data blocks, and then each data block is subjected to DCT transformation, quantization, zigzag scanning and Huffman coding in order from left to right and from top to bottom (quantization and Huffman coding require the support of quantization table and Huffman table respectively) [3], which will not be described in detail here. The video image data is stored in the dual-port RAM, and the MATLAB display result of the extracted image data is shown in Figure 6. After the video image is compressed by JPEG, it is uploaded to the computer through the RS485 communication interface. The computer terminal restores the image through the decompression algorithm. The decompressed effect is shown in Figure 7. This paper introduces the design and implementation of a radar speed monitoring system based on the TMS320VC5502 DSP. The hardware design of the system adopts the DSP+CPLD solution, which gives full play to their respective advantages and has been verified to achieve good real-time results. Due to the application of DSP to analyze the Doppler spectrum, the frequency estimation is more accurate and reliable, and the speed measurement error is within 1%. The system is small in size, light in weight, and easy to operate. It can meet the current domestic requirements for speed detection and provides an important means for traffic management departments to monitor the speed of motor vehicles.