A Localization Algorithm of Double Radars Based on Two Moments

This paper proposes an algorithm of localization based on FPGA and PC. It calculates the position of the target based on the geometrical relationship between the radars and the target through the speeds of the target and the peak-to-peak values measured by two radars at two moments. Currently, almost all the Doppler radars work with frequency modulated continuous wave(FMCW) and finish the frequency measurement by singlechip machine(SCM). This method only need radars work with continuous wave(CW) and finish the frequency measurement and localization on FPGA and PC. It can achieve the least error localization at the lowest cost. This system can alert the drivers to a vehicle in the blind area and remind the position and the speed of the vehicle relative to their vehicles. It can improve the safety of vehicles when changing lanes and turning, and effectively decrease the incidence of traffic accidents.


Introduction
As the growth of China's economy, the number of cars is growing obviously. While giving us convenient, comfortable and efficient travel and working methods, this situation has also caused more traffic accidents [1][2][3][4]. According to the current driving style, the judgment of the safety condition of car basically only depends on the driver with eyes. Therefore, drivers are more likely to cause traffic accidents in the case of fatigue and poor visibility. As the key technology of intelligent vehicle, anti-collision radar is absolutely important [5][6]. It has also become the research focus and new research hotspot and direction of traditional vehicles and intelligent vehicle research institutions at home and abroad.
By obtaining the speed of the vehicle in the blind area, the anti-collision radar can alert the driver to the rear vehicle and effectively reduce the traffic accident. At the same time, localization can provide more accurate information for drivers. Thus, adding localization system in the anti-collision radar system can help drivers to determine the specific position of vehicle in the blind area. Millimetre wave radar can effectively avoid the influence of environmental factors such as weather, which is better than infrared and sonar radar [7].
24GHz anti-collision radar waves usually have two types which are frequency modulated continuous wave(FMCW) and continuous wave(CW) [8][9]. The FMCW radar is costly manufacture and has a complex modulation method while CW radar can easily obtain the speed and fuzzy distance of the target [10]. And the combined processing of FPGA and PC can greatly improve the speed of signal processing.

Localization system
24GHz anti-collision radar includes an RF front end and a digital signal processor. The differential frequency analog signal generated by the Doppler radar is converted into digital signal by the analog to digital converter(ADC). The speed of the vehicle can be obtained in the FPGA through the frequency discrimination. Sending data of frequency and amplitude of the signal from two radars to the PC, position of the target can be got. As shown in the Figure 1

Frequency discrimination system
Frequency counting and FFT are the two main methods of frequency discrimination. Frequency counting is usually used to calculate the frequency of square wave with low frequency. This method can get the frequency of the signal immediately when a full period of square wave goes through the counter. However, it will be influenced by noise and keystroke jitter especially in high frequency area. The FFT can get the frequency after a frame of data passes through the IP core without being influenced by noise and jitter [11]. Particularly, it can obtain more than one vehicles' speeds simultaneously.
Consequently, FFT can be widely used to frequency discriminate. It also has some disadvantages such as frequency precision which is limited by the number of FFT points. As for the FFT function minimization, this module uses a single output engine which is called butterfly processor. It is encapsulated into an IP core in the FPGA produced by Altera. Users only need to call the IP core directly and control the interface through the wires to get output data.
Many signal wires control the start, end, system clock, input and output such as sink_sop, sink_eop, clk and sink_real. As for the output interfaces, users just take source_real and source_imag into account which indicate the real and imaginary part of the complex signal. After obtaining the absolute value of the complex signal, the result of FFT will be got, that is the discrete spectrum of the original signal. Obviously, the maximum value in the spectrum refers to the main frequency of the signal. The frequency to be requested can be expressed as where s f refers to the sampling frequency of the signal and N ′ indicates the transverse coordinate of the maximum value. According the Doppler formula, speed of the target can be expressed as RF 2 where c is the speed that electromagnetic waves propagate in vacuum and RF f is the frequency of radar. In order to get digital signals for FPGA and PC processing, the system needs ADC to convert the analog signal received by antenna to digital signal. To satisfy Nyquist sampling law, the sampling rate of the ADC chip should be two times the frequency of the signals.

Amplitude measurement
The amplitude of signal can indicate the distance between the target and the radar fuzzily. The way of expressing the distance is not an exact value, so it cannot be used alone. But as a ratio, it can represent the ratio of the distance of the same target at two positions to the radar. In FPGA, the amplitude which is called pp V can be obtained by calculating the average of the peak-topeak values of the signals in each frame of data. But when the distance is too close or the RCS of target is too large, the signal overloading will cause the amplitude of the signal is unmeasurable.

Localization equation establishment
The key technology of this system is to use the speed of the target at two moments measured by the two radars and the amplitude value of the signal to set up equations for obtaining the position. Before establishing the equations, the following assumptions need to be proposed.
(1) Since the time interval is short, it is assumed that the direction of velocity and vehicle's speed remain unchanging.
(2) Since the distance the vehicle moves a short time, it is assumed that the antenna has the same receiving gain for both directions.
A simplified geometric relationship diagram is drawn based on the scene of the vehicle as shown in Figure 2. Where 1 T and 2 T refer to the target's positions at two moments and 1 r and 2 r refer to two radars installed at the rear of vehicle.
Discuss the geometric relationship with 1 r and build the equation. The ratio of the distance of the target to the radar at two moments can be expressed as the ratio of the amplitude of the signal. It is expressed as Where h is the height of The speed at the second moment can be also expressed as 2 2 cos a a v θ = v Then their ratio is  (6) Comprehensively consider formulas (3) and formulas (5) to establish an equation which is expressed as According to the angle between the velocity vector and the projection and the speed value measured by radar, the absolute value of the velocity vector can be obtained as Thus, adding the time t Δ between two moments, the distance travelled by the vehicle at this time can be expressed as Find the distance between 2 r and the start position of the target in the same way. Since the distance the radar installed on the vehicle is known, with the positions of the two radars as the centre, the circles with the radius of the two distances obtained have two intersections. While one intersection does not meet the actual situation, the other intersection is the position of the target to be requested.

Implementation of system
In order to meet the speed and resource requirements, this system needs to be implemented jointly on FPGA and PC. FFT module and amplitude measurement will be achieved on the FPGA and localization algorithm will run on PC.

Implementation of FFT IP core
Create FFT IP core in Quartus II. And set the number of FFT points to 5120. Under this situation, the frequency resolution is about 9.77Hz/point and the speed precision is 0.061m/(s point) ⋅ . The frequency of system clock is the same as ADC sampling frequency. As for sink_sop, it will get a pulse every 5120 clock cycles to indicate the start of the frame. Sink_eop will get a pulse if 5120 clock cycles delay after the rising edge of sink_sop. The sink_real wire can input data to the FFT IP core continuously and the core will distinguish every frame according to the signal wires sink_sop and sink_eop and calculate by the FFT engine. Find the maximum value from the results and obtain the speed of the target at this moment.
Finally, the speed and signal peak-to-peak value obtained by the two radars need to be transmitted to the computer through the Uart interface for the following processing.

Implementation of localization in Matlab
In order to facilitate the position information of the target, it is necessary to establish the following coordinate system for the radar in Figure 3.  v v x y . According to the first assumption, the direction of the target movement should be the same with the direction of the velocity vector.
Bring the coordinates into the equation of the geometric relationship and express it in the language of Matlab. If necessary, GUI can be used to display the real-time position of the target and to represent the track of it.
Data acquisition and output of results are completed on Matlab.

Steps of simulation
Complete the simulation according to the following algorithm steps.
Step 1. Set the start position of the target, the velocity vector, the time interval and the distance between two radars.
Step 2. Calculate Step 3. Bring each set of data into the function of the equation to find the distance between each radar and the target.
Step 4. According to the distance between the two radars and the target, the position coordinates of the target can be obtained.
Step 5. Compare the obtained position coordinates with the original position coordinates to verify the accuracy of the algorithm.
Especially, due to the precision of the FPGA, the data calculated in step 2 needs to be quantized according to the actual situation before it is used in calculation of the step 3.   From the table, the error is less than 0.1m, and it can be judged that the algorithm basically meets the requirements.

Conclusion
In this paper, an algorithm of localization based on FPGA and PC was proposed. It can refresh the position coordinates every 0.1s with an error of less than 0.1m. In order to allow the entire system to be assembled into the vehicle, the algorithm on PC can be implemented with a dedicated DSP chip or embedded system. This method can minimize the size and cost of the system. Driving a vehicle with this system, the driver can not only know that there is a vehicle in the rear, but also know the position and speed of the vehicle. The system helps the driver to make a position judgment and can effectively reduce traffic accidents.
Moreover, if the accuracy of localization needs to be improved, the number of FFT points should be increased. It will also take longer to update the data.