TDR (Time-domain reflectometer) concept. On the right track?

Time for some rough and ready code. Currently the control and output are via the Serial monitor but I hope to eventually use an LCD & buttons/encoder to select and display options.
Attached is a chart image of 7 cables I measured and checked. They were all the same type (BD SD01) and as you can see the line fits quite well (R2 = 0.9988). I'm not sure about the averaging I do (3 levels) though and may need to devise a better system. Currently I do a rolling average of the spot reading that I then find the max/min of over 256 readings. After 256 reading the midpoint of the max/min readings is then used in another rolling average that I treat as the final result for the cable length.

TDC_A3.ino (6.77 KB)

TDC_Extra.h (16.2 KB)

They were all the same type (BD SD01) and as you can see the line fits quite well (R2 = 0.9988)

Impressive! Well done.

Ray

mrburnette:

They were all the same type (BD SD01) and as you can see the line fits quite well (R2 = 0.9988)

Impressive! Well done.

Thanks Ray, I'm hoping to improve on this a bit when I finally get the connector and components in a box. Currently the BNC cable connector is just hanging off a couple of unscreened breadboard wires and moving it about can alter the timings quite a bit. It's not boxed yet because I cannot decide if it's worth making it fully portable with battery and LCD or leaving it semi portable where it needs a PC.
Before I finalize the project I'm also tempted to invest in a laser, beam splitter and detectors to see if it would work for measuring distance.

Those results look great! I haven't got any further with my TDR due to getting distracted by other things (building a 3d printer).

distracted by other things (building a 3d printer).

:grin: envy!

I checked twice with wife and was informed with same response: Santa's Elves do not make 3D printers!

Ray

mrburnette:

distracted by other things (building a 3d printer).

:grin: envy!

I checked twice with wife and was informed with same response: Santa's Elves do not make 3D printers!

Santa's Elves don't need to make 3D printers they just need to deliver the kit for you to make.

The wife would have no problem with me getting a 3D printer, it's just the problem of where to put it. I'm not lucky enough to have a workshop so it's either the computer desk or kitchen worktop. I think I would buy a mini 3D mill in preference to the printer though as milling my own PCB's appeals.

Okay, I have managed to do a more thorough and controlled test using a 30 metre Draka TriFlex 11 cable and the fit is almost perfect. I am a bit disappointed with the potential accuracy though as it looks like I can only measure about +-5cm under controlled conditions and probably worse under normal use. I don't know what to tackle next to improve this. A better pulse with less slope would help but also improving the comparator speed would be nice. I have a ADCMP566 Voltage Comparator and will maybe see if it can be used in this design.
EDIT: I have since worked back all the calculations and it seems the general accuracy is nearer 2cm but goes a bit more off track at shorter lengths.

I am a bit disappointed with the potential accuracy though as it looks like I can only measure about +-5cm under controlled conditions and probably worse under normal use.

Depending on the use of the device, example for repair, a +- 2 inch section is probably adequate for locating a physical fault which is usually introduced by some external cable injury.

For other uses, +- 2 inches may be too large, but considering the cost of such a test instrument, I think these results are admirable! Essentially anyone could have a TDR for a very small investment. The same is true of production test equipment, you pay dearly to move from hobby to professional to lab-certified with traceable certification.

Ray

mrburnette:

I am a bit disappointed with the potential accuracy though as it looks like I can only measure about +-5cm under controlled conditions and probably worse under normal use.

Depending on the use of the device, example for repair, a +- 2 inch section is probably adequate for locating a physical fault which is usually introduced by some external cable injury.

For other uses, +- 2 inches may be too large, but considering the cost of such a test instrument, I think these results are admirable! Essentially anyone could have a TDR for a very small investment. The same is true of production test equipment, you pay dearly to move from hobby to professional to lab-certified with traceable certification.

I think I wrote to soon. :blush:
I have since revised my estimates as converting back the charts 'trend line' formula shows most results within 2cm (less than an inch). It's the short distance reading that comes back worst. Column 1 is the cable length in cm, column 2 is the tdr reading. Column 3 is the reading multiplied by 0.0457(y) and column 4 is column 3 plus -12.563(x). Compare columns 1 and 4 and most are quite good readings.
Total cost (less 3.3v arduino) is currently about £40 and could be made cheaper if built onto custom PCB as I use 3x SMD to DIP adaptor boards that cost about £6.

Total cost (less 3.3v arduino) is currently about £40 and could be made cheaper if built onto custom PCB as I use 3x SMD to DIP adaptor boards that cost about £6.

I have run 5V Pro Micro's (under $4 U.S. shipped from China) at 16MHz on 3.3V and never had a problem. Perhaps just integrating a naked 328 onto the board with the appropriate clock would be much less expensive in the long run.

Ray

mrburnette:

Total cost (less 3.3v arduino) is currently about £40 and could be made cheaper if built onto custom PCB as I use 3x SMD to DIP adaptor boards that cost about £6.

I have run 5V Pro Micro's (under $4 U.S. shipped from China) at 16MHz on 3.3V and never had a problem. Perhaps just integrating a naked 328 onto the board with the appropriate clock would be much less expensive in the long run.

Sounds good and cheap, I'm using a genuine UNO R2 the wife bought me for Xmas last year (my first Arduino) that I hacked to 3.3V and it runs fine at 16MHz.

Guys ,

can you share your experience with TDC GP22 chip.I want to measure multiple cable faults by measuring the time between reflections.
According to my understanding , I will use one stop channel with its multi hit capability assuming each hit will be converted to time which is stored in EEPROM to be read later by microcontroller ??

Please advise if above assumptions are correct...

Thanks

Nabeel

nibzy26:
can you share your experience with TDC GP22 chip.I want to measure multiple cable faults by measuring the time between reflections.
According to my understanding , I will use one stop channel with its multi hit capability assuming each hit will be converted to time which is stored in EEPROM to be read later by microcontroller ??

I have never attempted to measure more than 1 stop hit at a time though the chip can do up to 4. It may return the timings of the separate pulses in the 4 results registers if the ALU is disabled but once again I have never tried as it was nothing I needed to do.
I'm not sure how you could measure multiple cable faults at one time. An open circuit would prevent you reading beyond the break and a short circuit would probably limit the ability to read reflections beyond the first one. Alas I don't have a scope good/fast enough to confirm this.
The chip was about £9 (GBP) + £7 delivery from here so not to expensive to get one and try out.

Hi Riva,

Thanks for your response.I have tons of questions.Actually I wanted to detect impedance mismatches along a cable due to any faults or different dielectric strengths... Anyways I will discuss my challenge later , First I want to understand the use of this chip for TDR measurements. .. You managed to detect OPEN and SHORT cct right ?
SO I am assuming you used the fake start first and then your both transmitted and reflected pulses were tied to stop1 channel meaning first Hit of stop channel 1 was the transmitted pulse and second hit on same channel was the reflected pulse.?? and the chip calculated the time difference between hit1(Transmitted pulse) and hit2(The Reflected pulse) on stop channel 1 and stored the result in some status register which you read via SPI into your micro controller...
Please advise if this is how it works because in your TDR you have one cable and both the transmitted and reflected pulses are in one same cable so you cant use the transmit pulse to enable the START on the chip and use stop1 channel for reflected pulse ...

Thanks

Nabeel

Hi Nabeel,

I have a dual comparator connected on the cable and its outputs are fed to STOP1 & STOP2. For open circuit STOP1 & STOP2 are configured to fire on rising edge and the comparators voltage thresholds are set so STOP1 is fired on the initial rising edge and STOP2 is fired by the reflected signal (See photo 3 for scope output).
For short circuit STOP1 is configured to fire on rising edge and STOP2 on falling edge. The comparator voltage thresholds are altered to be the same so STOP1 fires on the initial rising edge and STOP2 fires on the falling edge caused by the short circuit (photo 4).
Both are using GP22 mode 1 so the maximum measurement time is about 2.5us. I initially did some tests using mode 2 where the pulse was used as the START and the reflection as the STOP and this would allow time measurements up to something like 4.7ms.
I would like to allow software mode switching at some point but as most of the cables I need to check are < 100 meters I have concentrated on MODE1 for now.

photo 3.JPG

photo 4.JPG

OK Looks like you alter comparator thresholds manually for each short and open cct case.
In my case I need to measure 2 or three reflections by sending a pulse down the line and this all will hapen in few nano seconds so I need one setting of the chip to do this...
My thinking so far is that I will use Stop1 channel for transmitted,first reflection and second reflection pulse and because stop1 channel is multi hit capable the chip will give me the time difference between transmited and reflected pulse.... simple... atleast I think so...

Surprisingly the manufacturer of chip doesnt say anything about using it for time domain reflection measurements for cables which is strange...

nibzy26:
OK Looks like you alter comparator thresholds manually for each short and open cct case.

I use a dual digital potentiometer to set the comparator thresholds in code. Also of note is the pulse I send out is longer than the measurement time. If you could generate a very short pulse then it may make reading multiple reflections easier. Best way to confirm this is to use a fast scope to see what the signals look like.

nibzy26:
Surprisingly the manufacturer of chip doesnt say anything about using it for time domain reflection measurements for cables which is strange...

The main purpose of the chip seems to be for ultrasonic flow measurement though I did come across a paper for using one in a laser range finder. I have most of the bits needed to try this as a range finder but detecting the reflected beam is the problem for me.

Hi Riva
Thankyou for sharing your TDR project which I've been studying with a view to building my own for soil moisture measurement. The schematic is not very high resolution so I've been unable to make out which devices you chose for the digital potentiometer and the cable driver. I'm particularly interested in the last since fast rise time should facilitate measurement of relatively short waveguides
Could you share device numbers or post a higher resolution jpg? (file ref TDR_V9_01.jpg)
Many thanks
Rob

Attached is a PDF version, just ignore the LCD and level shifter stuff added since the image was posted.

TDR_V9.pdf (18.4 KB)

@Riva :slight_smile: Many thanks for the hires schematic. It's an attractive design. Currently wishing I could find DIP versions of the chips!
BW
Rob