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: accurate time of flight

Part Number: MSP430FR6047

Thoughts about why the MSP430fr6047 works for flow rate and the problem we are having:

We have found that the routine USS_runAlgorithmsFixedPoint does not return an accurate time of flight, TOF. I believe that the system works as a flow rate meter because the inaccuracy in the upstream measurement is the same as the inaccuracy in the down stream measurement and the subtraction to get the difference has the same inaccuracy in both number so it is irrelevant.

We are wanting to get the accurate TOF for various fluid in various containers. The inaccuracies are a problem.

What we have tried to eliminate or compensate for the inaccuracies:

We have tried the following two setups. Both of them are on a pipe.

1.       There is one transmitter transducer and two receiver transducers. One of the receivers is directly across from the transmitter and the other is some distance down the pipe on the same side as the first receiver. We alternately set the receivers to be input to ch1 on the MSP430FR6047 and process the USS_startLowPowerUltrasonicCapture and USS_runAlgorithmsFixedPoint. We get two times of flight one from the directly-across transducer TD and one form the transducer at angle TA. We subtract TA - TD To get the difference in time along the two paths. The result should be the time to travel the distance equal to the difference in the lengths of the two paths. The idea is that whatever inaccuracy there is in the TOF returned by USS_ runAlgorithmsFixedPoint will be the same in both paths and will subtract out. It doesn’t work. That is, the computed TOF for the difference in length is what is should be.

2.       There is one transmitter transducer and one receiver transducer directly across from it. We alternately measure the TOF of the signal first received by the receiver TD and the signal received as an echo TE. The signal from the transmitter travels through pipe wall, across the fluid, and upon hitting the far side pipe wall both echoes toward the transmitter and proceeds through the pipe wall. The signal that goes through the pipe wall is received for determining TD. The signal that is echoed hits the transmitter-side wall and is echoed again back toward the receiver-side wall. When it hit the receiver-side wall again a portion passes through the all to be received for determining TE. The time for TE is exactly the time TD plus the time for the signal to travel twice across the pipe. The idea is that whatever inaccuracies there are in the values from USS_ runAlgorithmsFixedPoint will subtract out.

To make this work we reset the GAP (Gap between pulse start and ADC capture) between each transmission. More on this below.

The procedure doesn’t work. The times returned by USS_ runAlgorithmsFixedPointare not the times that we can see with an oscilloscope or that we can calculate from known properties of water which we are using as a test fluid. The error in the times is different for the direct TOF and the echo TOF.

How we reset the GAP:

Before starting the loop that alternately measures TD and TE, we do a calibration to determine a good value for the GAP and for the Capture Duration. We do this both because we want to capture the two different signals and because we want the procedure to work for various diameter containers (can, pipe, tanks, etc.). The procedure is the following.

·         Set the GAP to a relatively small value and increment it until USS_ runAlgorithmsFixedPoint returns a nonzero TOF.

·         Change to a tiny decrement instead of a small increment and repeatedly decrement the GAP until USS_ runAlgorithmsFixedPoint fails to return a nonzero TOF.

·         Use the last GAP that returned a nonzero value.

·         Multiply the GAP by 2.5. this will make sure that the time is passed the first signal for TD and before the time the echo will be received.

·         Repeat the first two steps to set the GAP for the echo signal.

In an attempt to deal with the TOF dependence on the number of pulses, we have tried various number of pulses. We had the idea that the smallest number would provide the best results because the received signal would have the fewest oscillations and thus the narrowest range for the peak to occur.

With the 12” pipe and μs we are using we expect TD to be in the range of 210 and TE to be in the range of 620. If there were a constant error and the numbers were 230 and 640 everything would be fine.  What we get is TD ranging from 218 to 235 depending on the number of pulses. The value of TE is around 684 independent of the number of pulses.

What do you think of the approach? What can we do to get accurate values?

 

  • Hi Marty,

    I'm consulting with my colleagues and will get back to you.

    BR,

    Leo

  • Hi Marty,

    The AbsToF reported by the USS SW can vary depending on the # of pulses. This is because the peak value of the signal will vary depending on whether you used 4 pulses to excite the transducer or if you used 20 pulses. You can look at the explanation in section 2.2 "Absolute Time-of-Flight (AbsTOF) Measurement (Tup and Tdn)" of the application note at http://www.ti.com/lit/pdf/slaa889. The AbsToF is reported based on the threshold setting with reference to the signal peak.

    Srinivas

  • I don't know what to say. The reply states a fact that is a problem. We already knew the fact. We are trying to find a way to get the actual ToF.

    I will mark this as resolved because I don't expect to get an answer that does resolve the question and I want you to be able to close the inquiry.

    Thanks

  • Hello Marty,

    Maybe I don't understand the problem you are trying to solve.

    Are you expecting to get the same Td independent of the # of pulses you are using? What is the reason for using different pulses? Why are you not using a specific # of pulses to obtain Td.

    The algorithm that is implemented by the USS SW Library is based on a fixed threshold relative to the peak of the received signal.

    Are you looking for a different algorithm that obtains the timing information of the 1st lobe of the received signal and NOT based on the threshold of the received signal?

    Srinivas

  • We did try varying the number of pulses within a single experiment but we are not doing that now. When we did it, it was because the received signal is stronger when there are more pulses. We would send a small number of pulses for the first transmission to the receiver directly across from the transmitter and more pulses when we were trying to receive either a signal on a second receiver that is down the pipe or when we are trying to receive the echo. We stopped using a different number of pulses for the different receptions.

    The mention of various number of pulses in the question I posed was meant that we had tried the procedure with different number of pulses and determined that smallest number gave the best results. This is because the peak in the reception is closest to the start of the reception.

    The question I tried to pose had to do with the following. We know that the ToF returned by the algorithm is not the proper ToF. The very fact that it varies with the number of pulses demonstrates the problem. We have tried to compensate for this by getting two different ToFs for two different setups. The idea is that the difference D between the real ToF and the ToF returned by the algorithm would be constant and if we subtracted the one of the returned values from the other, than the difference D would be in both values and would subtract out. What we found was that the difference was not constant.

    In addition to getting the two different ToF's we started with a calibration routine that determined what the GAP should be.

    The questions were: 1, is the concept for determining the GAP good? 2, why isn't the difference between the real ToF and the value returned by the subroutine constant? 3, what can we do to get a real time of flight?

    This third question is the really important one.

    I have concluded that the reason the difference between the real ToF for the direct reception and the echo reception is that the echoing increases the number of pulses and thus shifts the peak point further away in the echo.

    I don't know why the difference isn't constant when using two receivers, one directly across and on down the pipe.

    I hope this explains the question.

  • Hi,

    We think the best way for us to get the ToF accurately as we need is to have access to the lower level routines instead of the ones in the standard USS documentation and which are used in the water demo evaluation. Can you direct us to those routines?

    Thanks, Marty

  • Hi,

    We think that we are currently getting accurate ToF and can close this thread.

    We still think that we would like to get the lower level routine because we want do do things that are inconsistent with USS_runAlgorithmsFixedPoint. In particular, we want to get the raw signal from the reflection where the signal hits the fluid. That is, we are processing the echoing in the pipe wall at the transmitter transducer and not looking at the transmission through the fluid at all.

    We do need to do this immediately but will want to do it soon.

    Thanks

**Attention** This is a public forum