Re: [time-nuts] verifying synchronization with PPS

2019-07-11 Thread Gabs Ricalde
On Wed, Jul 10, 2019 at 8:00 PM folkert  wrote:
>
> > Folkert van Heusden has a driver for NTP which includes PPS output:
> >  https://vanheusden.com/time/rpi_gpio_ntp/
> > Perhaps this might help?
>
> Indeed I did! :-)
>
> But please note that the jitter is high, iirc around 18ms.
> Personally I would use https://github.com/mlichvar/pps-gpio-poll.git and
> then patch it toggle an other gpio-pin.
>

I did something similar using an early version of that PPS driver:
https://lists.febo.com/pipermail/time-nuts_lists.febo.com/2018-April/092234.html

___
time-nuts mailing list -- time-nuts@lists.febo.com
To unsubscribe, go to 
http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.


Re: [time-nuts] verifying synchronization with PPS

2019-07-10 Thread folkert
> > Folkert van Heusden has a driver for NTP which includes PPS output:
> >  https://vanheusden.com/time/rpi_gpio_ntp/
> > Perhaps this might help?
> 
> Indeed I did! :-)
> 
> But please note that the jitter is high, iirc around 18ms.
> Personally I would use https://github.com/mlichvar/pps-gpio-poll.git and
> then patch it toggle an other gpio-pin.

It has this functionality, thus no real patching required.
You only need to remove the /* around #define GPIO_ECHO in
pps-gpio-poll.c and then make/install/reboot (well not literally reboot
of course).

___
time-nuts mailing list -- time-nuts@lists.febo.com
To unsubscribe, go to 
http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.


Re: [time-nuts] verifying synchronization with PPS

2019-07-10 Thread folkert
> Folkert van Heusden has a driver for NTP which includes PPS output:
>  https://vanheusden.com/time/rpi_gpio_ntp/
> Perhaps this might help?

Indeed I did! :-)

But please note that the jitter is high, iirc around 18ms.
Personally I would use https://github.com/mlichvar/pps-gpio-poll.git and
then patch it toggle an other gpio-pin.

___
time-nuts mailing list -- time-nuts@lists.febo.com
To unsubscribe, go to 
http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.


Re: [time-nuts] verifying synchronization with PPS

2019-07-09 Thread Steve Summit
I wrote:
> I'm guessing there are some time nuts here who might be able
> to give me some pointers.

And there were!  Thanks for the suggestions & comments.

Dana Whitlow wrote:
> in the absence of a PPS or other electrical output from your
> "computer", what is the nature of the time "output"?

It's collecting data and coordinating activities among several
other systems, each with their own clocks, some connected by
serial ports and some by ethernet, some on NTP and some not,
some with PPS feeds and some not, but obviously the goal is,
by hook or by crook, to keep all the clocks well synchronized
so that timestamped data is commensurate -- and then to
positively *demonstrate* that they're well synchronized.

> why not view the light output of the seconds digit with a photocell.

Because I had never thought of such a thing.  I could pretty
easily implement, in a diagnostic window somewhere, a nice fat
1 Hz spot that would be trivial for even a crude photocell to "see".
There'd be some latency, but it'd be much better than nothing.
Thanks very much for the suggestion!


Graham wrote:
> What level of accuracy do you mean by "synchronized"?

I think we'd be happy with 1 ms.

> Plotting a lightly loaded Linux box, which is extracting time from
> the network via timesyncd, against a GPS 1PPS signal, I observe...

So it sounds like you're already doing more or less what I want
to do!  I'd be curious to hear more about the setup you use to
make those plots.

> The owner of this list has designed an excellent dual input timing
> device called the TICC, which can compare two PPS signals...

Ha!  Thought so.  Thanks for the pointer.


David Taylor wrote:
> Folkert van Heusden has a driver for NTP which includes PPS output:
>   https://vanheusden.com/time/rpi_gpio_ntp/

Great!  I will read that.


Hal Murray wrote:
> There is code in the Linux kernel to generate a PPS output.

Huh!  I should have noticed that.  (I'd been thinking of adding it,
if I had to.)

> I think it uses the printer port...

But it shouldn't be too hard to modify it to use a GPIO pin.

> If I wanted to try something, I would write a user-level hack
> to flap a modem line and compare that to a PPS signal.

That would probably be fine for my current purposes.  The latent
time-nut in me worries about scheduling and latency and jitter,
of course, tempting me to chase an overkill solution which is not
only in the kernel, but implemented in a brute-force, special-
cased way, eschewing the extra function calls and indirections
(and hence latency) which a properly general-purpose solution
might involve.


Thanks again for all the replies; this has been very helpful.

___
time-nuts mailing list -- time-nuts@lists.febo.com
To unsubscribe, go to 
http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.


Re: [time-nuts] verifying synchronization with PPS

2019-07-08 Thread Hal Murray


s...@eskimo.com said:
> My specific question concerns the case that one of the boxes is a computer,
> for example, a Linux box with time kept using ntpd or chrony (perhaps also
> listening to a PPS signal coming in on a serial port).  But I've never seen a
> computer with a PPS *output*. 

There is code in the Linux kernel to generate a PPS output.  I've never tried 
it.  I think it uses the printer port which isn't available on modern systems. 
 You can probably get a PCI plugin card.  You will probably have to build your 
own kernel.

If I wanted to try something, I would write a user-level hack to flap a modem 
line and compare that to a PPS signal.

The code would look something like this:
  t1 = time()
  set line low
  t2 = time()
  set line high
  t3 = time()
  log t2 and t3
  wait 1/2 second
  set line low
  wait 1/2 second
  loop

The first time/set is to warm out the cache.


> (Perhaps PPS is overkill for this situation; perhaps it's the case that given
> the inherent inaccuracies of software-based timekeeping, a software-based
> query mechanism -- perhaps using ordinary NTP or PTP protocols -- would be
> sufficient for 

That just gets time from one computer to another.  Now you have the same "is 
it right?" question on another box.



-- 
These are my opinions.  I hate spam.




___
time-nuts mailing list -- time-nuts@lists.febo.com
To unsubscribe, go to 
http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.


Re: [time-nuts] verifying synchronization with PPS

2019-07-08 Thread David J Taylor via time-nuts
From: Steve Summit 
[]

My specific question concerns the case that one of the boxes is
a computer, for example, a Linux box with time kept using ntpd
or chrony (perhaps also listening to a PPS signal coming in on a
serial port).  But I've never seen a computer with a PPS *output*.
=


Steve,

Folkert van Heusden has a driver for NTP which includes PPS output:

 https://vanheusden.com/time/rpi_gpio_ntp/

Perhaps this might help?

Cheers,
David
--
SatSignal Software - Quality software for you
Web: http://www.satsignal.eu
Email: david-tay...@blueyonder.co.uk
Twitter: @gm8arv

___
time-nuts mailing list -- time-nuts@lists.febo.com
To unsubscribe, go to 
http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.


Re: [time-nuts] verifying synchronization with PPS

2019-07-08 Thread Graham / KE9H
Several comments:

What level of accuracy do you mean by "synchronized"?

Plotting a lightly loaded Linux box, which is extracting time from the
network via timesyncd, against a GPS 1PPS signal, I observe typical time
excursions within +/- 10 ms, and extreme excursions over a 24 hour period
of up to 20 ms.

So, I would not count on network based time on a Linux box to be better
than +/- 20 ms, probably worse with heavy loading of the OS.

A simple navigation GPS receiver PPS output, without any additional
corrections can provide accuracy of less than 0.1 microsecond.

The owner of this list has designed an excellent dual input timing device
called the TICC, which can compare two PPS signals with resolution of 8 or
9 decimal places, for projects like this.

https://tapr.org/kits_ticc.html

--- Graham

==

On Mon, Jul 8, 2019 at 9:03 AM Steve Summit  wrote:

> This is a different sort of question than what seems to be
> discussed here usually, and I apologize if it's wholly off-topic,
> but I'm guessing there are some time nuts here who might be able
> to give me some pointers.
>
> If I have two boxes with clocks that are supposed to be perfectly
> synchronized, and I need to verify this, and they're physically
> right next to each other, and they both have PPS outputs, one
> way to verify the synchronization would be to compare the two PPS
> outputs with a 'scope.  (I'm guessing there's probably a dedicated
> instrument out there specialized for the task of comparing two
> such PPS signals for frequency, phase and jitter, and if I were
> a proper time nut myself I guess I'd know that.)
>
> My specific question concerns the case that one of the boxes is
> a computer, for example, a Linux box with time kept using ntpd
> or chrony (perhaps also listening to a PPS signal coming in on a
> serial port).  But I've never seen a computer with a PPS *output*.
>
> Is this a reasonable thing to be thinking about, or am I going
> about it wrong?  How would *you* positively verify synchronization
> of such a system?  Me, I'm pursuing this idea because too much
> of the time (at least in my own, perhaps parochial experience)
> synchronization seems to be "verified" either by saying "Yes,
> we configured it properly", or by observing a status output
> from ntpd or chrony claiming the requisite synchronization
> has been achieved, but in neither case by making a definitive,
> independent, external, empirical determination.
>
> (Perhaps PPS is overkill for this situation; perhaps it's the
> case that given the inherent inaccuracies of software-based
> timekeeping, a software-based query mechanism -- perhaps using
> ordinary NTP or PTP protocols -- would be sufficient for
> externally assessing synchronization.)
>
> I guess it's not a *completely* unreasonable thing to be thinking
> about, because I've found a couple of web pages (for example
> https://www.raspberrypi.org/forums/viewtopic.php?t=115554 and
> https://github.com/jsln/pps-gen-gpio) describing how to implement
> a PPS output under Linux.  And I do realize that trying to
> minimize the jitter and latency in this situation (given that
> the principal drivers for the hypothetical output are inherently
> software-based) presents considerable difficulties.  But taking
> all of that into consideration, I'm wondering what others think
> of the approach.  Thanks for any comments.
>
> ___
> time-nuts mailing list -- time-nuts@lists.febo.com
> To unsubscribe, go to
> http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
> and follow the instructions there.
>
___
time-nuts mailing list -- time-nuts@lists.febo.com
To unsubscribe, go to 
http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.


Re: [time-nuts] verifying synchronization with PPS

2019-07-08 Thread Dana Whitlow
Steve,

I'm curious: in the absence of a PPS or other electrical output from your
"computer",
what is the nature of the time "output "?  If it's just visual via a
display, why not  view
the light output of the seconds digit with a photocell.  Most of the
transitions should
produce an easily-detectable step or glitch in the light.

Dana


On Mon, Jul 8, 2019 at 9:03 AM Steve Summit  wrote:

> This is a different sort of question than what seems to be
> discussed here usually, and I apologize if it's wholly off-topic,
> but I'm guessing there are some time nuts here who might be able
> to give me some pointers.
>
> If I have two boxes with clocks that are supposed to be perfectly
> synchronized, and I need to verify this, and they're physically
> right next to each other, and they both have PPS outputs, one
> way to verify the synchronization would be to compare the two PPS
> outputs with a 'scope.  (I'm guessing there's probably a dedicated
> instrument out there specialized for the task of comparing two
> such PPS signals for frequency, phase and jitter, and if I were
> a proper time nut myself I guess I'd know that.)
>
> My specific question concerns the case that one of the boxes is
> a computer, for example, a Linux box with time kept using ntpd
> or chrony (perhaps also listening to a PPS signal coming in on a
> serial port).  But I've never seen a computer with a PPS *output*.
>
> Is this a reasonable thing to be thinking about, or am I going
> about it wrong?  How would *you* positively verify synchronization
> of such a system?  Me, I'm pursuing this idea because too much
> of the time (at least in my own, perhaps parochial experience)
> synchronization seems to be "verified" either by saying "Yes,
> we configured it properly", or by observing a status output
> from ntpd or chrony claiming the requisite synchronization
> has been achieved, but in neither case by making a definitive,
> independent, external, empirical determination.
>
> (Perhaps PPS is overkill for this situation; perhaps it's the
> case that given the inherent inaccuracies of software-based
> timekeeping, a software-based query mechanism -- perhaps using
> ordinary NTP or PTP protocols -- would be sufficient for
> externally assessing synchronization.)
>
> I guess it's not a *completely* unreasonable thing to be thinking
> about, because I've found a couple of web pages (for example
> https://www.raspberrypi.org/forums/viewtopic.php?t=115554 and
> https://github.com/jsln/pps-gen-gpio) describing how to implement
> a PPS output under Linux.  And I do realize that trying to
> minimize the jitter and latency in this situation (given that
> the principal drivers for the hypothetical output are inherently
> software-based) presents considerable difficulties.  But taking
> all of that into consideration, I'm wondering what others think
> of the approach.  Thanks for any comments.
>
> ___
> time-nuts mailing list -- time-nuts@lists.febo.com
> To unsubscribe, go to
> http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
> and follow the instructions there.
>
___
time-nuts mailing list -- time-nuts@lists.febo.com
To unsubscribe, go to 
http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.