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.

MSP430FR6047: Bad temperatrue estimation

Part Number: MSP430FR6047


Hi experts,
we are trying to calibrate a meter with flow and temeperature and following the instruction in the documentation we got this

we are in testing stage so the fig above is only for 3 meters in the future we will use at least 20 and more temperatures and flows, we also have the individual quadrilaterals.

meter #1

meter #2 

meter #3 

values.

The issue is when we try to use the function USS_computeTemperature(config, &fixedResults) to estimate the temperature, we got values below -60 °C

date, -> calibrated flow(l/s), non calibrated flow(l/s), estimated temperature(°C), code error.

 

As reference the reference meter shows 0.630 l/s at 6 °C

the dimensions of our meter are: 

pipe diameter (2 * r) : 1/2 ''

distance between reflectors (L) : 6.505 cm

 any suggestions? 

  • Hi,

    Are you using the calculating the temperature using TOF function in the software?

    If so, you might need to calibrate the temperature before using this function. The calibration routine can be found in this link. https://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/USSSWLib/USSSWLibWater/latest/exports/USSLib_02_40_00_00/docs/UserGuide/UserGuide/ch_calibration.html?highlight=temperature

    Best regards,

    Cash Hao

  •  thanks for answer. 

    we used the GUI to generate the header files following the insturctions in  flow + temperature VFR Calibration section (results in values fig.), we also noticed that when the velocity is computed this gave us 960 m/s that is under the range defined by Bilaniuk and Wrong equation, is that related with the acusting length or with the volume scale factor?, is there another parameter that is not defined in the GUI that affect the mesurement?

  • Hi,

    The GUI should contain all the parameters you need for temperature calibration. Could you send out the generated header files from the GUI in here?

    Best regards,

    Cash Hao

  • Hi,
    These are the headers that were generated with the GUI, we have modified USS_userConfig.h (mod_USS_userConfig.h ) some parameters to try to solve the problem.
    Also we don't understand what is the distance we have to use for the transducers using the reflective morphology (as shown in the last image), do we have to use the distance between the reflectors (6.505 cm)? or do we have to add also 2 times the distance between the reflector and the transducer (8.07142 cm)?

    is the USS_ACOUSTIC_LENGTH the time the sound needs to travel the 6.505 cm or the 8.07142 cm?

    headers.zip

    thank you!

  • Hi,

    I am going to do some tests with these configuration files. It is gonna take some time. 

    You should use 8.07142cm for the USS_ACOUSTIC_LENGTH. 

    Best regards,

    Cash Hao

  • Hi, 

    We appreciate this, we will be watching for your results.
    best regards

  • Hi,

    There are something I could not understand in your configuration. 

    It seems like you are testing on a DN15 pipe. And the absTOF should be around based on your data. 8.07142cm / (1500m/s) which is around 56.5us. You may set the start capture configuration to around 40us. However, in your mod_USS_userConfig.h. The USS_START_CAPTURE_SEC is set as 3.0E-4 which is 300us. You are not capturing the right signal in this configuration. Why do you set the USS_START_CAPTURE_SEC as 300us? Could you share a screen snip of the ADC capture data here?

    Best regards,

    Cash Hao

  • Hello, 
    Yes, that was a problem because we didn't have the EVM, we recently acquired one and we were able to adjust all those parameters solving that problem (which was exactly what you mention), although the generation of the temperature calibration LUTs have been generated strangely, having quadrants that intersect and others that cross with themselves. are we missing something?

    I also attach the ADCD capture and the new headers. 


    USS_meterVFRCalibFlowTemperature.hUSS_temperatureLUT.h1563.USS_userConfig.hUSS_intrplCorrLUT.h

    regards!

  • Hi,

    The ADC capture look weird to me. I found your gain setting is 27.7db. It is not a normal configuration in water meter. Are you working on a clamp-on meter? Could you take a picture of your test setups? 

    This ADC data looks like you are testing on a clamp-on meter. You start USS_START_CAPTURE_SEC is 10us.And based on your ADC capture, the absTOF should be around 13us. The ultrasound looks like transfer through the pipe not the water. So that causes the weird temperature calibration data.

    Best regards,

    Cash Hao

  • Hello, it is something like a clamp-on meter, in our design the sensors are not in contact with the water, this because in the region it is most likely that the water freezes and the pressure generated damage the sensors integrity .

    between the water and the sensor is a plastic (nylon PA66) gap of 2mm width as shown in the following picture.

    how much do you think that would affect the temperature estimation and so on the temperature + flow calibration?

    any suggestion?
    regards!

  • Hi,

    I do not think you are getting the right ultrasonic sound signal now. 

    We have tested on a clamp on meter years ago. The transducer is a special made for this application. And the pipe is made of CPVC plastic. We also tested on some copper made pipe. However, other material will absorb most of the ultrasonic signal and make it hard to receive. It also needs to put ultrasonic coupling agent between the transducer and the pipe to lower the loss of ultrasound.

    Best regards,

    Cash Hao

  • Hi,

    unfortunately we are not allowed to change the meter design for the moment, is there a way to improve the signal adquisition besides using ultrasonic coupling agent

    we also have been thinking to generate a velocity vs temperature curve in an experimental way in order to improve the temperature estimation for this specific meter, do you think is this factible? 

    just for reference all this measures are using the EVM just as HID, we use our custom borard  could it be a problem with impedance matching?

  • Hi,

    is there a way to improve the signal adquisition besides using ultrasonic coupling agent

    Place the transducer face to face and remove the reflectors. It might be helpful. But it is also a modification on the meter design.  

    we also have been thinking to generate a velocity vs temperature curve in an experimental way in order to improve the temperature estimation for this specific meter, do you think is this factible? 

    Why not make the things simply, just add a temperature sensor attached on the pipe. 

    could it be a problem with impedance matching?

    It depends on what else you add on your circuit. However, I do not think your biggest issue is the impedance matching now. You have to get the right signal first. 

    Bet regards,

    Cash Hao

  • Hi, following your recommendations we have made some modifications in the meter body to try to improve the ADC signal like changing the body material, making holes of different diameters in the sensor holders, and we have done an experiment to compare one with the other, basically, with the same configuration we took images of the ADC capture and took data such average measurement, reference meter measurement, standard deviation, upstream and downstream amplitudes with flow rate and at zero flow rate, we want your opinion to know which ADC capture is better.
    we attach the document, where we present experiment's results, we also made some remarks about all our interpretentions of the results. any suggestion or doubt we are at your will,

    regards.

    Results.pdf

  • Hi,

    I added some comments on the result. Please check. Results_Cash.pdf

    Best regards,

    Cash Hao

  • Hi,

    We checked your comments, so we attempt to answer them in the following PDF

    1007.Replies.pdf

    We also tested changing sample frequency from 4000KHz to 3600KHz but waveform looks worse for us:

    4000kHz

                      3600kHz

  • Hi,

    Using 3600kHz can avoid the harmonic noise at 4000kHz. The ADC looks "worse", however, it would not affect the results. 

    I prefer the Nylon body full complete machining and the Nylon body full complete machining with full drill. The sound velocity in Acetal is too close to the speed in water. It is hard for us to identify whether the receive signal goes through the water or the Acetal. 

    And since a drill hole on the pipe might cause unexpected air gap. I would try to avoid the air gap. So, either there is no drill or there is a full drill. Next step will be solve the repeatability issue on the Nylon body full complete machining with no drill. Try to find out what are the reasons causes the different result each time. 

    Best regards,

    Cash Hao

  • Hi,Thank you for your reply. We´ve changed the HSPLL to 8MHz, so we kept the sampling frequency in 4000kHz, as we found in: 

    We are now working on find the repeatability issue. While that, we continue with experiments on Nylon body full machining with no drilling.

    Finally, we are starting some proof on temperature changes. We configured the temperature estimation, and we got these results:

    • Temperatures from 5-16°C we got an error around 4°C.
    • Temperatures from 16-30°C we got an error lower than 1°C .
    • Temperatures from 30-35°C we got an error lower than 2°C.
    • Temperatures from 35°C-45°C we got an error of 2.5°C.
    • Temperatures from 45°C-55°C we got an error of 6°C.

    What's the error tolerance of temperature estimation? Are we in this tolerance value?


    We found that, in high temperatures (higher than 40°C) we got some cycle slips, so we had to adjust gain value and threshold too.

    Once we've set the path length and acoustic path,we are ready to generate the VFR+Temperature calibration, aren't we?


    Regards :)

  • Hi,

    What's the error tolerance of temperature estimation? Are we in this tolerance value?

    It depends on your accuracy requirement on the volume flow rate. 

    Once we've set the path length and acoustic path,we are ready to generate the VFR+Temperature calibration, aren't we?

    Yes. But first I would suggest you to do a VFR calibration without temperature first. And then test this calibration under different temperatures. If the results can meet the accuracy requirement, then you do not need a VFR+Temperature calibration. If the results fails to meet the accuracy requirement at some temperatures, then we can work on adding a temperature calibration. 

    Even though, you will need a temperature calibration in the end. I would suggest you to use a temperature sensor to get the temperature data instead of using the estimate method we provided in the software. What we provided in the software might not perfectly suitable for the clamp-on meter. The ultrasound will goes through both the Nylon and water, and temperature will affect the sound velocity in both materials. Our temperature estimate method might be failed. 

    We´ve changed the HSPLL to 8MHz,

    I would suggest the HSPLL as 72MHz and OSR as 20. 

    Best regards,

    Cash Hao

  • Thanks for your reply.

    We ventured into testing de VFR+TEMPERATURE calibration, just to experiment on results.

    For now we are not able too add a temperature sensor on meter´s body, so the only way is to implement a temperature calibration by estimation, or keep only the flow calibration. We are now testing the calibration, so, as soon as we finish it, we'll let you know.


    We are,also, trying to configure AGC, is there a specific value to configure for water meter?

    Whats represents each unit in USS_AGC_CONSTANT?

    I find these definitions on the APP firmware:


    Enable in USS_App_userConfig.h

    /* Enables Periodic AGC Calibration */

    //#define USS_APP_AGC_CALIBRATE_ENABLE

    Set interval in USS_App_userConfig.h

    /*! Defines the Interval for calibration of the gain amplifier constant */

    #define USS_APP_AGC_CALIBRATE_INTERVAL (0)

    Set AGC Constant in USS_userconfig.h (Value details available in FAQ)

    #define USS_AGC_CONSTANT 60


    But only the last one is in the UUS_userConfig.h file.


    Regards

  • Hi,

    Whats represents each unit in USS_AGC_CONSTANT?

    USS_AGC_CONSTANT = 20*log(ADC Count)

    For a 1000 ADC count, USS_AGC_CONSTANT = 20*log(1000) = 60

    Best regards,

    Cash Hao

  • Hi.

    I've not posted in a while 'cause I've been finishing some testing.

    I've been testing my meter under different flow and temperature conditions, and I've noted something. I'm getting some cycle slips, even though it measures constantly right, in unperiodic time I got cycle slips, but not only spikes, it locks when I abruptly change the flow, from 0 to 1.62 m3/h (for example), or viceversa, this calculates big ABSToF values, so the calculated flow shows a big value. The main issue here is that it locks on that condition, and even when I change flow it stays the same. The only way I've figured out that can take the measurement out of this, is restarting the USS module. When I do this, the measurement backs to a good and normal measurement. It doesn´t happend so frequently, but when it happens, it locks the measurement. Weird thing is, that I have to restart the whole module. Any idea of how solvig this issue?

    I have already set a gain value to assure a 900 units of ADC signal, a good ADC timing, and constant meter value. I've implemented a gain change on execution time, in order to take de measurement out of that lock, but sometimes work, and some time doesn´t. The only trusted method is restarting the USS module on execution time.


    I also have a question about AGC, What else should I set in order to enable the AGC on a custom board (besides USS_AGC_CONSTANT value)?

    regards.

  • Hi,

    Any idea of how solvig this issue?

    Restart the USS module should solve the lock issue. Are you asking why it needs to restart the module to solve the issue?

    When you change the flow rate abruptly, is there any error codes reported? If so, what is the error code? 

    What else should I set in order to enable the AGC on a custom board

    You might also need to set the invoke interval for the AGC function. 

    Best regards,

    Cash Hao

  • Hi expert.

    Restarting it solves the lock issue. I´ld like to know why is it? And if there any way to solve it and avoid restarting the module.

    When I change the flow rate abruptly there no other constant error reported.


    Regards.

  • Hi,

    Restart the module would be the best way to solve the lock issue. 

    In the library, the algorithm stores some feature data for the next calculation to save energy consumption. If it saves the wrong data for reference, in your case the flow rate abruptly changes. It might cause the lock issue. 

    You can try to set USS_ALG_DTOF_WINDOWING_MODE as USS_ALG_DTOF_EST_WINDOW_OPTION_DISABLED. And check if it can help on the lock issue. If it is not helping, restart the module.

    Best regards,

    Cash Hao

  • Hi ,

    Thank you so much for all your help.

    We've proved some technics to solve this problem, but reseting the module has given us best results.

    We really appretiate your help and time. We are going to close this thread and mark it as solved.


    Best regards.

**Attention** This is a public forum