Tool/software:
Hello Team
i have been trying to measure tof for liquid identification using TDC1000 and TDC72000 couple.
The dimension of my liquid container is 74x74mm.
Time1, Time2 and ClockCount registers show me correct value when i change position of the transducer.
I can get 100 microseconds calculated TOF result from TDC7200.
This shows me there is no any fault or communication issue.
But calibration1 and calibration2 registers are 0.
I get the calibration register values from the same function that i used for the time1, time2 and clockCount registers.
These 5 variables are 32 bit unsigned integer.
I checked the addresses many times.
CalCount=(calibration2-calibration1) / (10-1)
in this caseCalCount result is always 0.
i can't calculate under microsecond.
My gui show all values please check that.
My custom GUI;
My container setup;
My Pcb
thanks..
Murat
Hello Murat,
Are you reading the calibration registers after receiving a STOP signal? Do you see the same results if you change the CALIBRATION2_PERIODS register?
The calibration registers are 24 bits, so I assume you are throwing away the extra data in your read. I would expect this should be fine.
Hello Eddie,
Thanks for your reply.
On every 500ms, tdc7200 is triggered for a new measurement, firstly i wait an interrupt when the measurement is completed, then i read cal1, cal2,time1,time2 and clockcount registers.
as i mentioned first message, there is no any issue on time1, time2 and clock count registers.
thanks
Murat
Murat,
All of our team will be out of office for the next several days until next Monday due to holiday schedules. When we return to office we will be able to look at this further. We apologize for the delay and thank you for your patience.
Scott
Hello Murat,
Thanks for the patience on this, I will be taking over the thread while Eddie is out of office.
Typically we see this occur because there is SPI communication when the device is not ready to be communicated to but typically this results in other registers also being 0 like the TIME_x registers and not just the CAL_x registers. Have you been able to read the calibration registers successfully in the past or have they always been 0?
Best,
Isaac
Hello Isaac,
I haven't had success yet. I keep trying but my calibration values are still 0. I don't think I have a communication problem like you said. Because i can read all registers without both calibrations.
Hi Murat,
Isaac is currently out of office, but should be able to look into this further when he gets back on Monday.
Best,
~Alicia
Thanks Alicia, i've been waiting here until the problem is solved....
UPDATE....
I added another sensor to the bottom of the container to measure liquid level.
As seen in the picture below, the cal2 value started to be read when the container was empty.
TOF : 29us
CAL1 : 0
CAL2 : 22046
TIME1: 2040
TIME2: 1914
CLOCKCOUNT : 236
Second picture below, when I filled the container with water about 5 cm high, the calibration registers became 0 again.
TOF : 67us
CAL1 : 0
CAL2 : 0
TIME1: 2045
TIME2: 2050
CLOCKCOUNT : 539
As a result, i noticed i could read cal2 register without cal1 when the container was empty.
and the problem still persists...
Murat
Hello Murat,
Thanks for the patience on this while we have been out of office.
Based on your result for 5cm of water, Distance = (67us*1480m/s)/2 = .04958m = 4.958cm. This seems to be very close to what you actually set.
For no water, Distance = (29us*343m/s)/2 = .004974 = 4.97mm. This could be triggering on noise from the ultrasonic pulse transmission or reflection from the actual tank since there is no water present so this would be more of a debug effort to identify why we are getting a return echo here.
Have you tried a larger quantity of water to see if it still seems to track appropriately? Do you mind clarifying which mode of measurement you are using on the TDC7200?
In the instances that you are able to collect a CAL2 value the cal1 value is typically a multiple value that is dependent the programmed value for calibration periods (CALIBRATION2_PERIODS). CALIBRATION2 ~= CALIBRATION1 * CALIBRATION2_PERIODS. With this assumption we are able to get an estimate for the CAL1 value. It would be interested to test if you use this number for the CAL1 value does your TOF result still make sense?
Essentially the calibration is supposed to take into consideration the small differences in the clock, it is not expected to for these values to be zero because that would indicate that there is no variation in the clock which is extremely unlikely.
Best,
Isaac
Hello Isaac,
Thank you for your reply,
I have been using TDC7200 on Mode 2.
In the instances that you are able to collect a CAL2 value the cal1 value is typically a multiple value that is dependent the programmed value for calibration periods (CALIBRATION2_PERIODS). CALIBRATION2 ~= CALIBRATION1 * CALIBRATION2_PERIODS. With this assumption we are able to get an estimate for the CAL1 value. It would be interested to test if you use this number for the CAL1 value does your TOF result still make sense?
But the huge trouble is that i read always 0 from both calibration registers on every level of water.
Hello Murat,
Thanks for that piece of information.
I dont think the calculation of the CAL1 value is a replacement I just wanted to see if the results made sense or if the numbers you were getting made sense. So empty is the only time you were able to get a CAL2 value but other than that other levels were not able to generate a CALx values.
Have you tried what I mentioned before, to see if the rest of the values made sense for other liquid levels? I want to see if the rest of the values track with the actual level.
Have you also tried replacing the TDC72000 to see if perhaps there is an issue with the one you are using?
Best,
Isaac
Hi Isaac,
i took a video, I hope every detail was visible.
www.youtube.com/.../hWtZZ74bAME
Finally i will change the TDC7200 as you said...
Thanks.
Murat.
Hello Murat,
Thanks for the video, it is very clear to see the issue this way.
I just find it interesting that you are not getting CALx values after a certain point. Like I mentioned this is not common so my concern is that there could be something wrong with the TDC7200 device that you are using. Do you have another board that you can use to see if it also shows this same issue?
If you don't have another board then maybe we can focus on getting some logic analyzer captures when you read the CALx registers to ensure that its not some sort of firmware issue that is clearing the value.
Best,
Isaac
Hello Isaac,
It's been exactly 45 days today.
Today, i changed TDC7200 with new one and it finally worked.
I can't believe, I have encountered such a situation for the first time in my professional life.
I never thought about changing it with new one because every function was working.
Thank you very much for your interest. It was a costly experience for me, now I plan to enjoy it.
Regards.
Murat
Hello Murat,
I am glad and also not glad to hear that worked!
I am not sure what could have been the issue with the old unit but perhaps it got damaged during installation somehow. Please let me know if there is anything else I can help out with and please enjoy!
Best,
Isaac
Hello Isaac;
i’ve been working on my project for 5 days without any issue.
But i don’t like tof results for fluid identification.
for instance;
99265728
99272428
99321574
99313521
99245711
etc….
as you can see it’s not stable after second digit.
it’s acceptable for liquid level but not fluid identification.
where should i focus on my project?
thanks.
Murat
Hello Murat,
Just trying to get a little more background here to see what could be done here:
Are these measurements done consecutively without moving the sensor in any way?
Is there any averaging being applied to the data collection?
Do you mind sharing what units the results are in above? and what frequency are you using for a transducer?
Best,
Isaac
Oh, right..
Are these measurements done consecutively without moving the sensor in any way?
There is no any moving of sensor or liquid.
Is there any averaging being applied to the data collection?
I take an average after 50 measurements.
Do you mind sharing what units the results are in above? and what frequency are you using for a transducer?
my measurements are in nanoseconds at 1 Mhz.
99265728 nS
99272428 nS
99321574 nS
99313521 nS
99245711 nS
Thanks.
Murat.
Hello Murat,
Thanks for the information here, are you sure that this is in terms for nanoseconds?
If I compute the distance it seems quite large and your test setup didn't look that large. Essentially in nanoseconds the size of your tank would be ~73.45m if they were in picoseconds then the tank size would be ~7.345cm which seems like it would make more sense to me.
Please let me know if this is correct.
Best,
Isaac
Hello Isaac,
You are right, i’m confused because i focused on the first 5 digits.
99265.728 nS
Edit : I just realized it while writing a dataset to you. I think there is a mistake in my embedded codes, when I transfer my values to excel I see stable results. I will check and share the result again.
My measurements in the 400ms range;
Note :
1) These are unaveraged values.
2) Tank width is 71 mm (inside to inside)
time |
cal2_period |
clockPeriod |
Cal1 |
Cal2 |
Time1 |
Time2 |
ClockCount |
calCount |
normLsb |
Tof |
C_medium |
0.4 s |
10 |
125000000 |
2235 |
22337 |
2074 |
1601 |
794 |
2233,55555555556 |
55964,5806387423 |
99276471246,6421 |
1430,34898618844 |
0.8 s |
10 |
125000000 |
2235 |
22329 |
2075 |
1582 |
794 |
2232,66666666667 |
55986,861749776 |
99277601522,8426 |
1430,33270165504 |
1.2 s |
10 |
125000000 |
2233 |
22319 |
2074 |
1606 |
794 |
2231,77777777778 |
56009,1606093796 |
99276212287,1652 |
1430,35271721742 |
1.6 s |
10 |
125000000 |
2234 |
22325 |
2074 |
1601 |
794 |
2232,33333333333 |
55995,2217410782 |
99276485739,8835 |
1430,3487773737 |
2.0 s |
10 |
125000000 |
2233 |
22317 |
2076 |
1601 |
794 |
2231,55555555556 |
56014,73809998 |
99276607000,5975 |
1430,34703028424 |
2.4 s |
10 |
125000000 |
2233 |
22318 |
2075 |
1583 |
794 |
2231,66666666667 |
56011,9492158326 |
99277557879,0142 |
1430,33333044967 |
2.8 s |
10 |
125000000 |
2235 |
22330 |
2076 |
1599 |
794 |
2232,77777777778 |
55984,0756407066 |
99276704404,0806 |
1430,34562692598 |
3.2 s |
10 |
125000000 |
2235 |
22334 |
2075 |
1601 |
794 |
2233,22222222222 |
55972,9339768148 |
99276531170,705 |
1430,348122819 |
3.6 s |
10 |
125000000 |
2234 |
22325 |
2076 |
1607 |
794 |
2232,33333333333 |
55995,2217410782 |
99276261758,9966 |
1430,35200443707 |
4.0 s |
10 |
125000000 |
2234 |
22324 |
2076 |
1611 |
794 |
2232,22222222222 |
55998,0089596815 |
99276039074,1663 |
1430,3552128416 |
thanks
Murat
Hello Murat,
Got it thanks for the clarification here. These values definitely look more stable than what you provided above.
Let me know if there are any other questions I need to look into here.
Best,
Isaac