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: PGA450Q1EVM-S wrong distance sensing

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

Hi everyone,
    I recently bought a PGA450Q1EVM-S sensor and I'm doing some preliminary tests to understand how it works and how to configure it.

I kept all EEPROM with default values, and i want to measure the distance from a 60cm wide and 80cm high object.

Using the  PGA450Q1 command 2, I triggered a long distance burst (command 00 55 11 02 00) and a short distance burst  (command 00 55 11 01 00) and I read the corresponding Time Of Flight (TOF).
My experiment runs as follows: I trigger a long distance burst, read the TOF and save the corresponding FIFO data, then i repeat the same procedure with the short distance burst.

Afterwards, I used your 8780.PGA450-Q1 THRESHOLD CALC for UART OTP EXAMPLE.xlsx to plot all the FIFO data.

In the attached Excel file you will find all the FIFO readings of all the experiments (Excel sheets with corresponding distances), together with the measured distance vs the true distance (Excel sheet EXPERIMENTAL DATA).

Here comes my problems:

1) Very rarely the measured data corresponds to real data, both in the Long and in the Short mode

2) I fail in finding any correspondence between the calculated FIFO and the ones on the plot in the Excel.

To check in the plot I look for the first threshold crossing. All the formulas I used come from the YouTube video here https://www.youtube.com/watch?v=SV1X6o9sgS4

Am I missing something? I know the crossing depends on the threshold tuning, but before doing that at least i should have reliable readings from the sensor.

Every help is much appreciated.

Thanks in advance,

GD

8780.PGA450-Q1 THRESHOLD CALC ENOVIA.xlsx

  • Hi GD,
    Yes, you should be able to read back the FIFO data before optimizing the threshold times and levels. Reading back the FIFO will help you to set the EEPROM based threshold values. Based on the results shown in your spreadsheet, the long range measurement command appears to be working well for >70cm measurement. The blanking time is maximized in the hard-coded long range command, and prevents <70cm object detection. The short range measurement will suffice for the purpose of sub-70cm ranging.

    I recommend that you re-purpose the EEPROM space to use command 5, which refers to the driver and receive setting set in EEPROM (which are copied to the ESFR when run). This will enable you to use a single command to cover both the short (30cm) and long (1.5m) range.

    I suspect your inconsistent results are currently likely due to an un-optimized threshold configuration. I recommend that you continue adjusting the thresholds to check and improve performance. Configuring the thresholds is typically the most time consuming process of the PGA450 development since the values are based on the system's required range and object type (which vary from customer to customer).
  • 8780.PGA450-Q1 THRESHOLD CALC 150cm.xlsxHi Akeem,

    Thanks for the quick response.

    I still have some questions for you:

    1) from my understanding of the way distance reading works, the sensor reports the TOF of the first point in which the FIFO data crosses the threshold. Looking at my 150cm experiment, for example, the FIFO location should be around 175 (calculated as FIFO_location = TOF/downsample), but when I plot the data on the Excel file it seems that the FIFO location should be in between 111 and 116 for Long Range Reading.  This is my main source of confusion: apart from un-optimized threshold configuration, when the reading is correct then I should see the correct FIFO location in the plot. Am I missing something important in the way the sensor works? I attached a new spreadsheet with the 150cm data plotted in the graph. 

    2) In addition, when I run the command 6 to read threshold values stored in the sensor, it returns 

          09 ff 20 84 40 74 60 54 80 4c a0 3c e0 34 19 1e

    Starting from your THRESHOLD CALC for UART OTP EXAMPLE.xlsx, I expect thresholds equal to (hex values): 84 74 54 4C 3C 3C 34 1e. If I analyze the values returned by the sensor, I can find a correspondence: 09 ff 20 84 40 74 60 54 80 4c a0 3c e0 34 19 1e. I notice that a 3c is missing. Am I analyzing data in the correct way? Is problem 1 related to this fact? 

    3) why did you advice the use of command 5 instead of command 1?

    Thanks in advance,

    GD

  • Hi GD,

    1) Are you accounting for the blanking time offset? The full equation to convert the FIFO Time of Flight to Distance is:
    Distance (m) = [BlankingTime(us) + (FIFOSampleNumber * Downsample * ADCSampleRate)] * SpeedOfSound/2

    2) Command 6 reports the threshold values, and is decoded as follows using your return as an example:
    (Note: there are seven threshold values. Command 6 identifies the range across the FIFO's 768 points where the threshold level changes. The level is an 8-bit value from 0-255.)
    For example:
    "09 FF 20 84 40 74 60 54 80 4C A0 3C E0 34 19 1E"
    Byte1 = x09 = from FIFO 0 to 9, the threshold levelInit is Byte2 (255) (based on EEPROM addr 0x09 as initial ignore count defaulted to 9. Ignore count means threshold level is set to 255)
    Byte2 = xFF = 255d level
    Byte3 = x20 = from FIFO 10 to 32, the threshold level0 is Byte4 (132)
    Byte4 = x84 = 132d level
    Byte5 = x40 = from FIFO 33 to 64, the threshold level1 is Byte6 (116)
    Byte6 = x74 = 64d level
    Byte7 = x60 = from FIFO 65 to 96, the threshold level2 is Byte8 (84)
    Byte8 = x54 = 84d level
    Byte9 = x80 = from FIFO 97 to 128, the threshold level3 is Byte10 (76)
    Byte10 = x4C = 76d level
    Byte11 = xA0 = from FIFO 129 to 160, the threshold level4 is Byte12 (60)
    Byte12 = x3C = 60d
    Byte13 = xE0 = from FIFO 161 to 224, the threshold level5 and level6 is Byte14 (52) (in this example, level5 and level6 are the same values, lumped into a single return value, not the double interval of 224-160=64, which is twich the typical interval of 32)
    Byte14 = x34 = 52d
    Byte15 = x19 = from FIFO 225 to the end of the FIFO, the threshold level7 is Byte16 (30)
    Byte16 = x1E = 30d
    This explanation will be added to the user's guide in the next revision.

    3) Command 5 is a fully configurable version of the burst/listen command. The EVM-S User's Guide ( www.ti.com/.../sldu019b.pdf ) Table 3. " EERPOM Register Map Values" shows how the EEPROM is re-purposed as an ESFR reserve. This allows you to update the EEPROM with the ESFR values for customizing the transducer frequency, burst strength, and receive filtering/coefficients on the fly. When command 5 is run, it first reads the EEPROM, loads these values into the actual ESFR register space, and then runs a burst/listen command. This fully configurable burst/listen profile allows you to optimize your performance based on a custom range, while commands 1 and 2 are fixed / hardcoded to only work at one frequency with permanent settings for short and long only modes respectively.

    I should also note that the PGA450-Q1 is an older device. I highly recommend the PGA460-Q1 and its small form factor equivalents (Design files: www.ti.com/.../technicaldocuments ) for improved performance and reduced software complexity. We will be selling the PGA460 small form factor equivalent on the TI eStore before the end of this year. In the meanwhile, the PGA460 EVM is already available ( www.ti.com/.../boostxl-pga460 ) for you to begin evaluation.
  • Hi Akeem,
    thanks for the exhaustive answers.
    I am taking into account the Blanking Time offset, but the FIFO location is still wrong (the blanking time being very small, there are no substantial changes in the final result of the calculations).
    Is there some specific and detailed documentation that I can read to finally understand how the sensor works?
    I can't wrap my head around the calculations for FIFO location and threshold trespassing, my numbers does not make any sense when plotted together with the thresholds and I don't understand what I am missing .
    If you can not share such document here in the forum, please fell free to contact me via private message.

    Thanks in advance

    EDIT 10/09/2018: I found where was my mistake; in the FIFO location formula I considered the BLANKING_TIMER as it was the Blanking time. The BLANKING_TIMER reported in EEPROM 0x0C must be multiplied by 16 us which is the resolution for the Blanking time. Now all seems fine.   

    GD