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.

MSP430FR50431: USS library - AbsTOF calculation principle & parameters

Part Number: MSP430FR50431
Other Parts Discussed in Thread: TIDM-02005

Hello,
I've been running some performance tuning of our MSP430FR50431 based water flowmeter and I've discovered occasional issues with AbsTOF algorithm selecting wrong Lobe for time calculation.
After studying Design Guide TIDM-02005 I have a general understanding of the principle, but I still need to clarify a few details.

Question 1
Let's say that the ADC measures 5 lobes on the raising side with amplitudes 100,200,300,400 and 500 (maximum). I want the algorithm to lock onto the first lobe, so I configured USS_ALG_RATIO_OF_TRACK_LOBE = 0.2.
During standard operation the amplitude of all lobes will vary (although their mutual ratio should stay approximately the same).
If it is by 1% up or down, nothing will probably happen, but what if it attenuates for example by 50%? Therefore amplitudes would change to 50,100,150,200 and 250? Will the algorithm still lock onto the 1st lobe, or will it redo the search and lock onto the 2nd lobe? Is this recalculation condition connected to USS_ALG_MAX_RATIO_PEAK_2_PEAK_VAR parameter in any way?

I would also need further explanation of following parameters from USS_userConfig.h file:
USS_ALG_NUM_PULS_BEFORE_THRSH
USS_ALG_SEARCH_LOBE_SAMP
USS_ALG_MAX_RATIO_PEAK_2_PEAK_VAR
USS_ALG_CORR_VAL_THRSH_CHK_FACT
USS_ALG_SIGN_VAL_THRSH_CHK

Question 2
Ultrasonic Sensing Design Center, which can be used with development kits, contains a parameter called Gap between pulse start and ADC capture (us) (on Parameters tab). I used Generate headers function, but was unable to locate this parameter in generated header files.
Where is it located, so I can change it right in my firmware without the need to re-generate headers on my PC?

Question 3
Would it be possible to obtain source codes for the USS library? It would make our further development much faster, since I could have a direct look, how various parameters and functions work. Right now I must search for best configuration quite often using trial & error method, because some parameters have quite an ambiguous description or are part of a function too complex to be described in detail by any design guide.

Thank you for your help.
Best regards
Antonin

  • Hi,

    Question 1
    Let's say that the ADC measures 5 lobes on the raising side with amplitudes 100,200,300,400 and 500 (maximum). I want the algorithm to lock onto the first lobe, so I configured USS_ALG_RATIO_OF_TRACK_LOBE = 0.2.
    During standard operation the amplitude of all lobes will vary (although their mutual ratio should stay approximately the same).
    If it is by 1% up or down, nothing will probably happen, but what if it attenuates for example by 50%? Therefore amplitudes would change to 50,100,150,200 and 250? Will the algorithm still lock onto the 1st lobe, or will it redo the search and lock onto the 2nd lobe? Is this recalculation condition connected to USS_ALG_MAX_RATIO_PEAK_2_PEAK_VAR parameter in any way?

    It most likely keep locking at the 1st lobe when the signal change to 50, 100, 150, 200 and 250. Because the 1st lobe peak/maximum lobe peak = 50/250 = 0.2. It still equals to 0.2. However, I said most likely because when the signal is around below 100. The noise is big and could affect the algorithm to lock on the wrong lobe. 

    USS_ALG_NUM_PULS_BEFORE_THRSH: If you are locking at the 2nd lobe and you want the absTOF result for the 1st lobe. You can set this parameter to 1, and the absTOF result will minus 1 cycle of the signal to get the 1st lobe's absTOF result. 

    USS_ALG_SEARCH_LOBE_SAMP: default value is 1. It means it moves 1 sample data each time to search the lobe at tracking mode.

    USS_ALG_MAX_RATIO_PEAK_2_PEAK_VAR: The variation between the current lock lobe's peak value and the pervious lock lobe's peak value. It the difference is larger than this threshold, it will go back to the search mode for the next measurement. 

    USS_ALG_CORR_VAL_THRSH_CHK_FACT: The correlation result should bigger than this threshold. It is kind of signal energy check for my understanding. 

    USS_ALG_SIGN_VAL_THRSH_CHK: The maximum ADC capture data must bigger than this parameter. If not, it will report not receive valid signal. 

    Question 2
    Ultrasonic Sensing Design Center, which can be used with development kits, contains a parameter called Gap between pulse start and ADC capture (us) (on Parameters tab). I used Generate headers function, but was unable to locate this parameter in generated header files.
    Where is it located, so I can change it right in my firmware without the need to re-generate headers on my PC?

    You can find the USS_ADC_SAMP_COUNT in the project.

    Question 3
    Would it be possible to obtain source codes for the USS library? It would make our further development much faster, since I could have a direct look, how various parameters and functions work. Right now I must search for best configuration quite often using trial & error method, because some parameters have quite an ambiguous description or are part of a function too complex to be described in detail by any design guide.

    You may need to check with the TI sales team about it. 

    Best regards,

    Cash Hao

  • Hello,

    thank you for your answers, I have no more questions about points 1 & 2.

    As for my 3rd question, could you please point me to somebody in particular or an e-mail address I could contact?

    Thank you, best regards

    Antonin

  • Hi,

    Could you provide your company information? You can send it to cash-hao@ti.com. We can discuss it through email.

    Best regards,

    Cash Hao

  • Hello,

    thank you, I've given your e-mail address to our project manager, he'll contact you personally.

    Best regards

    Antonin

**Attention** This is a public forum