Milestone 3

Implementation

Radar PCB

Mithril is a distributed system of radar nodes which actively work together to detect objects. For the radar portion of our project, we will implement an FMCW and phased array radar system onto a printed circuit board to use for relatively close range object detection. The following includes important details about our radar implementation, architecture, and design decision:


Transmitter:

To implement the frequency modulation for FMCW radar, we are using a VCO for signal synthesis. We plan to use a microcontroller to create a sawtooth tuning voltage that will increase our VCO’s output frequency from 1.8 GHz to 1.82 GHz. This is then split through a four way power splitter to supply our LO signal to two phase shifters and two mixers. Two programmable phase shifters take in the LO signal and alter their phases to have a phase difference corresponding to a certain beam angle. These phases are calculated using the following equation assuming the transmitting antennas are spaced at half the wavelength of our base transmitting frequency:



These two phase shifters then output the shifted signals to two power amplifiers, which amplify our signal to have a gain of 19 dBm. Since our band is close to the 2.4 GHz WiFi range, we plan on using isotropic antennas meant for this band for transmitting.


Our chirp time and chirp bandwidth are influenced by our desired range and constraints on our ADC. Since the sampling frequency of our ADC dictates the maximum frequency we can detect in our FFT, this implicitly dictates the max range we can detect. Since our ADC can have a max sampling frequency of 100 KHz, the maximum beat frequency we can detect is 50 KHz. 


To achieve small frequency (and therefore range/velocity) bins from our FFT, we want to use a 1024 point FFT to have finer grain resolution. Therefore, by dividing our FFT point by our sampling frequency we see that we need 10.24 ms to sample 1024 points at a 100 KHz sampling frequency. Therefore, we decided on 11 ms as our sweep time to accommodate our FFT size.



Given a maximum beat frequency of 50 KHz and sweep time of 11 ms, we then used the above equations for maximum unambiguous range and range resolution to determine our chirp bandwidth. A higher bandwidth allows for finer grain range resolution so we would be able to distinguish between objects that are closer together, but decreases our maximum range. We decided on a 50 MHz chirp bandwidth, which yields a 1.65 km maximum unambiguous range, and a 3 m range resolution. 

Receiver:

For the receiver setup we have to be able to pick up the reflected wave to extrapolate range, velocity, and angle data. In our current configuration we have two antennas for receiving the transmitted signals. Each of these antennas is connected to the receiving portion of our RF PCB for processing the signal. The first step of the processing is carried out in an LNA (low noise amplifier) which amplifies the relatively weak signals which we pick up with the antennas. Each of these signals is then inputted into a mixer which combines the received frequency with the transmitted frequency. As we have a sawtooth transmission our mixed signal will correspond to the frequency difference between the transmitted and received signals which will in turn correspond to the distance between the object that we are detecting and the radar. When there are several targets the output signal is the sum of different frequencies and the distances to the targets can be recovered with Fourier transform. The transmitted signal corresponds to the following equation: 

The received signal being a time delayed copy of the transmitted frequency:

Our mixer then multiplies these signals, outputting two frequencies which are the sum and difference of the multiplied signals. These are represented by the following trigonometric identity:

The left cosine component represents the difference of the two signals while the right cosine component represents the addition of the two signals. It therefore follows that the right side component will be some frequency in the GHz range while the left component will be a relatively smaller frequency in the kHz range. This left component represents the beat frequency of our radar and it is what we will use to process our range, speed, and angle measurements. The right frequency component is filtered out by a low pass filter which leaves our desired beat frequency. Solving the trig equation we reach the following frequency difference term for our beat frequency:

Since we are working with electromagnetic waves which travel at the speed of light, the delay of the received signal is twice the distance to the target divided by the speed of light. Therefore the distance to the target in terms of the detector frequency can be solved to be:

With our chosen bandwidth of 50 MHz and chirp time of 11ms along with our maximum range of 1.65km, our frequency difference will be in the approximate range of 50 kHz, which is low enough to be detected by the ADC of our microcontroller which can sample frequencies over 100 kHz. After this mixing phase each of the respective frequencies is amplified by a variable gain amplifier which then feeds into an anti aliasing filter to remove noise and any signal above our maximum sampling frequency. The signals are then passed to an ADC which feeds the data to our microcontroller for FFT and angle measurements. Since we have two receiving antennas there will be a phase difference between the received signals if our target object is located at an angle. We can use this difference in phase to calculate the angle between the receiving antennas and the target object. FFT measurements allow us to calculate the range as well as adjusting for doppler shifting. As we are using a sawtooth wave to transmit our signal we cannot directly confirm whether the difference between our transmitted wave and received wave is directly caused by range shifting or the doppler shift as there is some ambiguity which cannot be resolved in a single range measurement. However, by taking multiple consecutive range measurements and taking another FFT over them we can resolve the ambiguity. This is because the movement of the target changes its distance from which we can recover the speed and correct the distance if the object is moving closer or further away from our radar.  Below you can find noise figures and calculations related to theoretical maximum range taking into account some of the components we are utilizing for our radar PCB and two different radar range equations.

Noise Calcs

Transmitter Schematic

Receiver Schematic

Layout PCB (Work in Progress)

Stack up for board

3D model for the moment

Digital & Networking

Microcontroller:

Our radar PCB will output a low beat frequency corresponding to the range and velocity of the target object. In order to make sense of this data, we use an STM32F7 to sample the beat frequencies of our two antennas using a multi-sample mode on their on-board ADC. The sampling rate is triggered by a timer for an easy way to toggle the sampling frequency to accommodate a wide range of possible beat frequencies. The ADC is launched in DMA-interrupt mode so that on completion of a sample, the sampled beat frequency is placed into an FFT buffer. We compute a 2048 floating point FFT, so after 2048 points are captured the timer is stopped hence stopping the ADC from sampling and overwriting the buffer. This discrete signal is then windowed because it is not continuous, helping the FFT represent the signal in terms of its frequency components. The FFT is then computed on both antenna buffers by using the CMSIS FFT function and their frequency domain representation is stored in another buffer. Now, the timer is turned back on and the ADC can fill up the time domain buffer while processing is done on the frequency domain representation to increase parallelism. The frequency domain buffer stores points in real-imaginary pairs, so we find the magnitude and phase of each point. Then these magnitudes and phases are sent over UART to the Raspberry Pi.

Raspberry Pi:

As part of the defense network of radar nodes we wanted to create a secure network through which the different nodes could communicate with each other for effective object detection. This achieved by having Raspberry Pi's communicate in a mesh network created with the BATMAN ADV framework. Implementation details can be found in the following GitHub. Actual data received from the radar PCB which has been processed by the microprocessor is transferred over UART to the Pi's. To facilitate communication between the Pi's we utilize the MQTT protocol for transferring our data as well as Eclipse Paho to facilitate coding in Python and implementing on the Pi's. Nodes connected to the mesh network can then use scripts which we have coded to subscribe to nodes transferring radar information. We can then take this information transferred from the radar nodes and display radar measurements in real-time on the Pi's as well as creating useful graphs and UI for the defense system. The video below is a sample networking application with our system where we have STM microprocessor dev boards collect data from an external frequency generator, apply an FFT, and transfer the FFT over UART to the Raspberry Pi board where it then publishes the FFT data to all subscriber nodes. The demo also shows how this data can be displayed in real time and how the network can be used to acquire sensor data. 

Test

For the analog portion of our project, we tested our baseband filtering stage in Simulink to see the response of our gain and filtering stages on our passband and stopband. Below is the Simulink model, where there is first a variable gain stage, and a second order butterworth filter with a cutoff frequency of 10 KHz.

Below you can see the simulation with different frequencies and their associated gain/attenuation:

Above is a simulation performed on a 2 KHz signal with a starting voltage of 3 mV. On the right you can see the final signal (blue) compared to the original signal (yellow). We can see that it has been amplified drastically to a level that can be sampled by an ADC. On the left you can see the final signal compared to the signal after the gain stage. They are virtually identical, meaning that the filtering stage did not attenuate our signal of interest.

Above is a simulation performed on a 20 KHz signal with a starting voltage of 3 mV. On the left you can see the final signal (blue) compared to the signal after the gain stage (yellow). The signal after the gain stage is massive, but the final signal being smaller means that our filtering stages are working at attenuating unwanted signals out of our passband. 

We wanted to test our digital and networking portion with an actual analog signal, so we resued an electret mic circuit from an old project to see the frequency components of our voice.

Team Work and COntribution

Team work was unilateral between the members. The collective efforts of each member was characterized with teamwork, transparent coordination and active engagement. Ajay, Juan and Tomas each played roles in configuring the phase shifters and mixers for the transmitter. Ajay took the lead demonstrating effective leadership when coordinating the RF design which was further reinforced through communal research. Juan also demonstrated exceptional ambition, taking the lead on the networking aspect of the distributed system. Tomas was able to reinforce these projects with research into microwave design.