Bat like sonar sensor that can track multiple targets and estimate angle of arrival using chirps and cross correlation in near real time.
To make the experience fit your profile, pick a username and tell us what interests you.
This video shows the sensor in action. The left graph shows the identified targets. The size of the circles indicates the strength, and the location on the graph is their measured location. The graph on the right shows the cross correlation signal vs distance. The first step is pressing a switch on the board to calibrate and baseline the sensor. Then the video shows the sensor identifying various targets.
Using a counter and interrupt, the MCU generates a sequence of time periods that vary in period. At each time period, the ADC is used to output a voltage, alternating between (1.65-amplitude) and (1.65+amplitude) with 1.65 volt as the midpoint (1/2 of supply). The maximum frequency, minimum frequency, number of pulses, and amplitide can therefore be controlled in software. Note that this produces a square wave chirp. Typical ranges used are 60kHz to 30kHz and from 32 cycles to 256 cycles duration (where 1 cycle counts as a positive and negative pulse in the pulse train).
The output of the ADC is amplified by two op amps in a push pull fashion, resulting in a gain factor of 12, resulting in a maximum swing of 39.6v p-p output at the ultrasonic transmitter. The amplifier output drives the ultrasonic transducer in series with an inductor and resistor. These provide compensation to flatten the response of the transducer, which by itself is tuned at 40KHz. See this paper for details.
The chirp passes through the air and reflects off of one or more targets. It also gets transmitted directly to the micrphones, as well as bounces off the surface the sensor rig is on and produces false echos. We will get to how we deal with those later.
The MEMS microphones are within 2.8mm of each other, which is less than 1/2 the wavelength of the signals used, which results in unambiguous phase detection. Each microphone is sampled at 4MHz to capture signals with high time resolution.
The MCU has an I2S peripheral with 2 channels which is used to sample the microphones at 4MHz. A fifo buffer of 5 32-bit words is used on each channel with an interrupt on buffer full to write to RAM. No DMA was used since I could not get it to work and my napkin calcs showed it would not save a lot of processor time. For each microphone, a maximum buffer of 10,000 32-bit words are used to collect the PDM data. A 10,000 word buffer holds 80msec of data, which translates to 1060 inches of sound travel, a range of 530 inches. The size of the buffer is software controlled so that shorter range windows(and corresponding faster processing times) can be configured.
void I2S_Int(void)
//I2S interrupt routine called when buffer is full
//Loop unrolled for speed
{
if(memsbuffer_i < (sample_size-4)) //buffer of 5
{
memsbuffer0[memsbuffer_i]=I2S0_RDR0;
memsbuffer1[memsbuffer_i]=I2S0_RDR1;
memsbuffer_i = memsbuffer_i +1;
memsbuffer0[memsbuffer_i]=I2S0_RDR0;
memsbuffer1[memsbuffer_i]=I2S0_RDR1;
memsbuffer_i...
Read more »
sch - 447.78 kB - 08/19/2018 at 12:19
plain - 8.55 kB - 08/19/2018 at 12:19
brd - 208.26 kB - 08/19/2018 at 12:18
Portable Network Graphics (PNG) - 781.04 kB - 01/28/2018 at 19:57
sch - 337.04 kB - 01/07/2018 at 22:33
Since March I have been working on a dedicated board to contain the whole system. Here is the link to the OSH park board
https://oshpark.com/shared_projects/JiEvGsBk
Caution - the output stage produces 80 volt peak to peak which is dangerous, but also within specs for the sonar transducer.
Improvements
Issues
TI makes a combined boost converter and amplifier for piezo applications. Its called the DRV2700. Using this would reduce the parts count a bit, including reducing the resistors needed in the current opamp circuit. Will need to consider for future prototype.
Create an account to leave a comment. Already have an account? Log In.
to follow this project and never miss any updates