Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

[Phys-L] timestamping instrumentation



On 10/20/21 1:22 PM, Tom Van Baak wrote:

There's been mention of timestamping in this thread. Those of us that
work with GPS and precise clocks use it a lot. Time stamping,
sometimes called time tagging, has advantages over traditional period
/ frequency counters or time interval counters.

Yes. Tremendous advantages.

Most any microcontroller can be used to collect time stamps;
microprocessors with GPIO pins as well. It's easy to get resolution
ranging from 100 ns (10 MHz clock) to 1 ns (1 GHz clock).

Yes.

There are several laboratory-grade instruments that do timestamping
to tens of ps. Look for the Keysight 53230A, or the Stanford Research
FS740, or the Pendulum CNT-91. All of these are high-performance
universal counters, with lots of features, including timestamping [1]
[2] [3].

[1]
https://www.keysight.com/us/en/assets/7018-02959/technical-overviews/5990-7861.pdf

[2] https://www.thinksrs.com/products/fs740.html

[3]
https://pendulum-instruments.com/products/frequency-counters-analyzers/cnt-91-91r-advanced-frequency-time-interval-analyzer/

Those are nice, but they cost thousands of dollars.

There is a student-friendly, hobbyist-grade time stamping board that
grew out of ham radio circles [4]:

https://tapr.org/product/tapr-ticc/

This is based on an Arduino with the heavy lifting being done by a
wonderful timing chip originally designed by TI for time-of-flight
measurement. The TAPR TICC does timestamping to better than 100 ps
resolution.

Impressive.

On the other end of the performance spectrum you can do timestamping
using any old laptop and just a serial port. A win32 example is
here:

http://leapsecond.com/tools/pctsc.c

It has its limitations but it shows that a lowly serial port pin can
be used as a trigger for time stamp recording. I use this for quick
'n dirty low rate Geiger measurements. For more precision and no
dead time I use dedicated hardware for the counting & timing and the
PC just for data logging.

1) The corresponding linux program is here:
https://www.av8n.com/cgit/poissfit/tree/timestamp.c

2) However.... I don't recommend any of the serial-port solutions for
the radioactivity application. (Other applications maybe.)

-- Here's one of the many, many issues: Each click of the Geiger counter
is a very narrow spike. A son of a glitch. That's very unlike anything
a serial port was designed to handle. If you have 1000 events per second
with a nice 50/50 duty cycle, the serial port can handle it fine, but
if you have even a few events per second consisting of spiky clicks
you're gonna lose events.

-- You're gonna need a level shifter if you want to drive the serial port
pins reliably. The hardware cost for that is not large, but it's comparable
to the entire system-on-chip solution.

-- Laptops generally don't have serial ports. They haven't for many years,
unless you spring for the "docking station / port expander". This is not
a major issue, because colleges often have ten-year-old /desktop/ machines
being used as doorstops. You can't run up-to-date windoze software on them,
but you can run linux. It's easy to install and runs fine. So there is some
value in having the aforementioned linux timestamping program.

-- Don't even think about using a DB9-to-usb conversion dongle. Those don't
work reliably even for routine applications, and pulse collecting is far
from routine. You'd be better off buying a PCI-e serial card for your
desktop box ... but again, the hardware cost of that is comparable to the
system-on-chip solution.

-- Recent linux kernels (at long last) have some usable real-time features,
which are used (in a rudimentary way) in the program mentioned above.
Trying to get real-time performance out of a windoze box is masochism.
It was not designed for that.

-- Every minute you spend working on a custom solution is two minutes wasted.
You're much better off finding something that already has a fan base, i.e.
a user community that has already solved (or at least identified) the problems.
Something like the tapr-ticc or perhaps the Raspberry teensy solution that
was mentioned a while back:
https://www.raspberrypi.org/forums/viewtopic.php?t=300464
https://github.com/PaulStoffregen/FreqMeasureMulti
https://www.pjrc.com/teensy/td_libs_FreqMeasure.html