Re: [chrony-users] a const time offset ahead

[ Thread Index | Date Index | More Archives ]

On Wed, 9 Mar 2022, Lin Zhao wrote:

[CAUTION: Non-UBC Email]
      It would help if you gave a complete list for example of the sources command

What do you mean of "sources command"? if you mean chrony configuration: 

Run chronyc as root
then type
This will list all of your sources and statistics of them.

      ## Internet server
pool iburst maxsources 4

You have access to the network and can use the pool command? Why are you using
nmea then?

driftfile /var/lib/chrony/drift

## Used for NTP time sync for other system (e.g. DVL, Topside, Pi...)

      ## Used for time sync Jetson from Arduino using gps NMEA string and PPS
makestep 1.0 3
maxupdateskew 100.0
refclock SHM 0 poll 0 refid NMEA precision 1e-1 offset 0.0 trust
refclock PPS /dev/pps1 poll 0 lock NMEA refid PPS precision 1e-6 prefer
initstepslew 30

      How do you hook up the microcontroller, how does it send out the PPS to make

      sure it is on the UTC second, How is the NMEA generated, etc.?

1) The computer is connected to the Internet, so it's originally time synchronized UTC.
2) The computer and microcontroller have two part connections: 1) USB cable: used for data transmission. 2) PPS connection and UART (for pure NMEA)

PPS from what? How does the pps operate on the arduio. I presume it is the
machine that is sending the PPS to the computer. Is it run by gps?

3) Then I will send UTC time at the beginning of one second to microcontroller through the USB serial. So the microcontroller time is aligned with
UTC. Obviously, serial transmission will take some time. but it should be very small.

No that is not obvious. nmea is very very slow. Thus it is probably off by
many milliseconds.

2) After microcontroller time is aligned with UTC, microcontroller will start to count time using hardware timer, and each one second send PPS and
NMEA. NMEA is saved from a real GPS, but I will replace the time information that counts inside the microcontroller. 
3) Right now, I can compare computer time and microcontroller time, they are the same.
4) Now, I start gpsd and chrony, computer start time synchronized with microcontroller. After synchronization, computer time is ahead of the
microcontroller. For example, microcontroller time is 1646779996, computer time is 1646779997. 

On Tue, Mar 8, 2022 at 11:46 PM Bill Unruh <unruh@xxxxxxxxxxxxxx> wrote:
      PPS has no "seconds" associated with it. It just blips exactly ( to withing a
      few ns) on the second. It gets its "seconds" from nmea.
      It would help if you gave a complete list for example of the
      command. It looks to me like you told it that PPS is off time (ie tried to
      correct the PPS time rather than the NMEA time) It is the NMEA time that will
      be off, but .2-.5 seconds usually (late) because the nmea sentence are sent
      out after the second, are sent out when the gps is not busy, and take a long
      time to get to the computer( it takes a while for the nmea sentence to be
      transmitted). But you have a home grown setup, so the problem could well be in

      How do you hook up the microcontroller, how does it send out the PPS to make
      sure it is on the UTC second, How is the NMEA generated, etc.?

      Are you telling chrony that teh PPS is late?

      William G. Unruh __| Canadian Institute for|____ Tel: +1(604)822-3273
      Physics&Astronomy _|___ Advanced Research _|____ Fax: +1(604)822-5324
      UBC, Vancouver,BC _|_ Program in Cosmology |____ unruh@xxxxxxxxxxxxxx
      Canada V6T 1Z1 ____|____ and Gravity ______|_

      On Tue, 8 Mar 2022, Lin Zhao wrote:

      > [CAUTION: Non-UBC Email]Hi,
      > I am using a microcontroller to generate PPS and NMEA string to time sync an Nvidia Jetson
      > computer using gpsd and chrony for the GPS-denied environment.  PPS and NMEA are verified
      > as good. 
      > When I started time synchronization process, chrony always like:
      > #* PPS                           0   0   1     0    -894ms[  -894ms] +/- 1000ns
      > I tried a lot of times, chrony always considers PPS time is ahead around 890 ms. But I
      > checked the NMEA time data is right. When the computer is synchronized,  system time is
      > ahead of NMEA time. Before the time synchronization, both of them are verified the same.
      > After the 1 hour test, time is synchronized, but with this const offset.
      > Could you tell me how to debug this? Thanks for your help.
      > Best regards,
      > -------------------------------------------------Lin Zhao
      > Research Assistant @ Graduate School of Oceanography 
      > Ph.D. Student @ Department of Ocean Engineering
      > University of Rhode Island
      > Room 2, Horn Lab
      > 215 South Ferry Road
      > Narragansett RI 02882
      > Phone: 401-771-4661
      > E-mail: linzhao@xxxxxxx
      > Personal: crazymumu0804@xxxxxxxxx
      > Lab:

Mail converted by MHonArc 2.6.19+