This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PGA450-Q1: distance measurement offset

Part Number: PGA450-Q1
Other Parts Discussed in Thread: PGA460

Hi,

Im trying to understand why I get an offset for short range measurements using PGA450Q1.
Im using the demo firmware supplied by TI. settings are as follows:

register value
0x00 0xFF
0x01 0xF7
0x02 0xF5
0x03 0xF5
0x04 0xF4
0x05 0xD3
0x06 0xA2
0x07 0x76
0x08 0x64
0x09 0x00
0x0A 0x44
0x0B 0x02
0x0C 0x00
0x0D 0x05
0x0E 0x19
0x0F 0x01
0x10 0x00
0x11 0x8A
0x12 0x8A
0x13 0x01
0x14 0x01
0x15 0x03
0x16 0x2D
0x17 0xEC
0x18 0x3D
0x19 0xF9
0x1A 0xA5
0x1B 0x1F
0x1C 0x64
0x1D 0x14
0x1E 0x46
0x1F 0x01

I calculate the distance according to the TOF returned by command(5) and it seems that for less then 40cm  measurements, the error is about +5cm.
I printed the fifo and defined thresholds, drew the graphs in excel and compared to the extracted fifo location from TOF (fifo location = TOF / down sample value / 1us). 

 when I look and the excel graph and look for a cross point according to the thresholds, I can see the correct fifo location (according to actual measured distance) but from returned TOF I get the an offset of about 10 fifo locations.

using the same setup but measuring a distance of 100cm, I can see about 2cm error.

do I need to reduce anything from TOF to get a more accurate result?

from the demo code, I see a recording time before decay is done. perhaps I need to log the time after decay to get a better accuracy? 

Thanks,

Eyal

  • Hi Eyal,

    The most accurate readings are made possible when the threshold is drawn as close to the noise floor so that the base of the echo is intercepted for the TOF readout. If the top/peak of the echo is intercepted instead, which is more likely to be the case when the object is detected within the decay profile, then there will be a positive-offset to the time-of-flight readout. This is because the peak representation of the echo indicates where the transducer's generated sound pressure level saturates, which may be after 16 pulses. For example, if the peak is at 16 pulses for a 58kHz transducer, then the TOF offset equivalent is [(16/58kHz)*343m/s]/2 = 4.7cm.

    Positive-offset readings within the decay ramp-down should be precise, but less accurate. Are your short range readings fluctuating? You can use the PGA450-Q1 Threshold Mapper for EVM-S Example ( e2e.ti.com/.../PGA450_2D00_Q1-THRESHOLD-CALC-for-UART-OTP-EXAMPLE.xlsx ) to help optimize your threshold settings to improve the TOF readout accuracy. You could also create a function to extrapolate the full echo profile partially masked within the decay to estimate where the base of the echo begins to more closely capture the real TOF.

    Unless the demo code was modified to reset the free running timer after the saturation decay time was logged, the TOF readout should not have to be offset. Can you send a copy of your FIFO readout and the TOF equivalent for your short range object?
  • 7536.PGA450-Q1 THRESHOLD CALC for UART OTP EXAMPLE.xlsxHi Akeem,

    Thanks for the quick response!

    Please see attached excel file with a test I performed.

    I’ve placed an object exactly 21cm from the transducer and recorded a short distance measurement.

    Results are:

    • Response for short distance  measurement - TOF == 1562.

    - Response Printed in HEX value:

    - Byte[0] = 0x06

    - Byte[1] =  0x1A

    - Byte[2] = 0xDF (checksum)

    I’ve also printed the thresholds to make sure the configurations are OK (command (6) in demo firmware):

    • Threshold– short distance

    0 255

    8 116

    16 84

    32 68

    40 52

    48 36

    49 8

    • threshold– long distance

    0 255

    32 132

    192 116

    224 92

    25 30

    Distance calculation and offset:

    • Distance according to returned TOF = (TOF/1000000) * 343/2 = 100*( (1562/1000000) * 343/2) = 26.78cm

    • Fifo location according to returned TOF  (TOF/1us)/(DOWN_SAMPLE/1us) = (1562/1000000) / (25/1000000) =  0.001562 / 0.000025 ~= 62

    • Fifo cross point according to excel graph is 52. According to distance equation  dist(cm) = 100* ((fifo_index * DOWN_SAMPLE * 1us)*343/2) = 100*((52*25*1us)*343/2 ) ~= 22cm

    Any idea why do I see this offset? Are my calculation correct or do I need to consider any other paraments?

    Thanks,

    Eyal

  • Hi Eyal,

    Thank you for the detailed summary of this error.

    You mentioned that objects less than 40cm show +5cm of offset. Is the amount of offset a fixed +5cm when the object is within 40cm, or does the offset gradually reduce as the object is placed further from the sensor? Based on your spot check of 20+5cm, 40~+5cm, and 100cm+2cm, the offset seems to be reducing at longer ranges? I'd be curious to see if the offset drops to +1cm at 2m or beyond. If the offset is reducing over time, I suspect the free running timer to be at fault, though I'd need to investigate further for the reason why.

    One culprit would be a lack of coherency when the timer value is transferred to the FRT register, though the code should already be handling this when EN_CTRL=0x8C. Another culprit is that the process of comparing the FIFO value to the threshold involves too much math for the free-running timer to be logged on time. Keep in mind that the demo is attempting to provide the TOF equivalent in real-time. To optimize the code, the math to compute the threshold times and levels could be predetermined before the burst+listen command is issued (I may consider this approach for the next code update). A completely different approach could be to remove this real-time check, and check the FIFO values against the threshold after the FIFO has completely filled to eliminate the need for the free-running timer, and instead use the following equation to compute distance per FIFO sample:

    Distance (m) = [BlankingTime(us) + (FIFOSampleNumber * Downsample * ADCSampleRate)] * SpeedOfSound/2

    5cm is approximately 300us of delay. To your earlier suggestion, if you can log the time after the VREG ready check and saturation/decay check to compare the offset time, then this may indicate the decay feature is being considered in the TOF capture.

    Which communication mode are you using: UART or LIN? I've mostly performed my testing with this code using UART, so if you are using LIN, I may need to debug if any communication based latency is being introduced. 

  • 0513.7536.PGA450-Q1 THRESHOLD CALC for UART OTP EXAMPLE.xlsx

    Hi Akeem,

    I'm using UART connection.

    I've measured the distance to an object at 2[m] and as you assumed, the offset does reduce to ~1cm.

    Calculated fifo location was 237 and actual fifo location according to fifo graph was 235 (see attached file).

    At ~1m the offset is about 2cm so it seems that the offset gradually reduces as the object is further away from the sensor and very small when the distance is above 2m.

    if I understood correctly, the problem is somewhere in the free running timer logged time or because the demo is trying to calc the TOF in real-time.

    If this is the case, I will try to calculate the distance after the fifo has been filled using the distance equation.

    Thanks,

    Eyal

  • Hi Akeem,

    If possible, I would like to consult with you on another issue,

    We are working on an application for tanks fill level monitoring and tested our solution using the attached Murata transducer.

    since Murata are working strictly with the automotive industry, we are looking for a transducer that will best fit our application.

    distance measurements should be for a range of at least 4m using the shortest possible beam angel to avoid reflections of the tank walls.

    Any suggestions?

    Thanks,

    Eyal

  • Hi Eyal,

    I have had much success using the Prowave 400EP250 for long-range narrow field-of-view detection. This will be most ideal for your tank-level application to avoid false positives from the walls.

    If you notify Murata that you are using TI's PGA450 or PGA460 ultrasonic reference design as your working solution for a non-automotive application, they usually make an exception to their automotive-only transducer supply rule.

    You can find a full listing of transducers which you can filter and sort by parameter at:
    e2e.ti.com/.../620399
  • Hi Eyal,
    An additional note about reducing/focusing the field-of-view of a transducer:
    You can also use a mechanical horn to enclose any transducer to focus its ultrasonic echo propagation in the forward facing direction only.
    The concept of the horn is explained / depicted on the PGA460 FAQ #4.4.9: www.ti.com/.../slaa733.pdf
  • Hi Akeem,

    Thanks a lot for the information and your support!!

    Guy