Jump to content

How would you implement a super precise clock with a board running Armbian?


gounthar

Recommended Posts

Hi there,

 

let's say I'd like to mimic this device because I'm filming events with several cameras and audio recorders, and that it's really time consuming to synchronize everything before the real editing.

So... I was thinking of starting with a GPS module on top of an Orange Pi Zero to get the initial UTC time fix, adding also a temperature compensated crystal to keep it running if we lose the GPS signal (which will happen for sure, as most of my recordings are inside buildings). The goal there is to generate an audio signal thanks to libltc and to add that to the original audio/video in real time.
How would you get the GPS+Crystal to set the time for the board?

Thanks.

Link to comment
Share on other sites

On a local network, NTP tends to have an offset/jitter of around 20-50 ms.

 

Distributing PPS to all your computers (may require signal buffering / EMI shielding) should get it down to <10 ms.

 

You can also consider Chrony w/ PTP support, but will require all your network switches to support it to get the best performance. I don't recall offhand if it requires driver/kernel support.

 

Link to comment
Share on other sites

Hi,

 

how long does the time have to stay within the 1/60th of a second requirement? Minutes? Hours?

 

I think there are tutorials out there on how to use common GPS modules (ebay search for raspi gps gives some), most of the ublox ones also have a rather precise timing output. From the website (ublox) it seems the also sell modules explicitly made for time synchro.

Depending on how long you want to keep the devices in sync it might be acceptable to only sync them before you start filming (?) and have the device clock continue when gps goes away. 

 

If a really precise clock is required I would maybe turn away from SBCs (boards with multithread, multiprocessors) have a tendency to have problems with jitter (obv. reasons).   If you need a precise time (as in your link) I'd suggest going for a simple microcontroller. There you can grab the GPS signal once, and then setup an internal timer - which are pretty precise considering the micro does only a thing at a time (if you go for cheap AVR ones). Afterwards just have the timer run out every 1/60th of a second and toggle a IO pin. Time reference done.

 

EDIT: Bonus: If you are in Europe (although other regions probably have similar services) you could also use DCF77 to do the initial sync.

Link to comment
Share on other sites

9 hours ago, tparys said:

On a local network, NTP tends to have an offset/jitter of around 20-50 ms.

 

Distributing PPS to all your computers (may require signal buffering / EMI shielding) should get it down to <10 ms.

 

You can also consider Chrony w/ PTP support, but will require all your network switches to support it to get the best performance. I don't recall offhand if it requires driver/kernel support.

 

The problem is it will be difficult to get access to the network where the devices will be. The security is more and more demanding regarding which devices can be plugged into the network (even the guest network), so using the local network is a big no-no for the near future. :(

43 minutes ago, Heisath said:

Hi,

 

how long does the time have to stay within the 1/60th of a second requirement? Minutes? Hours?

 

I think there are tutorials out there on how to use common GPS modules (ebay search for raspi gps gives some), most of the ublox ones also have a rather precise timing output. From the website (ublox) it seems the also sell modules explicitly made for time synchro.

Depending on how long you want to keep the devices in sync it might be acceptable to only sync them before you start filming (?) and have the device clock continue when gps goes away. 

 

If a really precise clock is required I would maybe turn away from SBCs (boards with multithread, multiprocessors) have a tendency to have problems with jitter (obv. reasons).   If you need a precise time (as in your link) I'd suggest going for a simple microcontroller. There you can grab the GPS signal once, and then setup an internal timer - which are pretty precise considering the micro does only a thing at a time (if you go for cheap AVR ones). Afterwards just have the timer run out every 1/60th of a second and toggle a IO pin. Time reference done.

 

EDIT: Bonus: If you are in Europe (although other regions probably have similar services) you could also use DCF77 to do the initial sync.

The requirement for the 1/60th of second precision would be 4 hours or so, so that we can record until the lunch break. We could get another GPS fix during the lunch break.

I was thinking of using an ESP32 or RP2040 for that task, but I really know nothing about them, that's why I was thinking of using a SBC running Armbian... which could get input from a microcontroller, as you suggest.
Thanks.

Link to comment
Share on other sites

Back in the day we would take a Rubidium source like an SA.22c (can be found on ebay ~$100 - $150) and make a GPS Disciplined Oscillator. The rubidium was accurate for the short period (hours) and the GPS held it really accurate for long time (years).

 

https://www.microsemi.com/document-portal/doc_view/136649-sa22c-user-guide-2017

 

can't find the project we used, but this one makes the point -

https://hackerstuebchen.de/making-a-rubidium-gpsdo

 

Sounds like fun!

Link to comment
Share on other sites

On 7/19/2021 at 8:35 AM, Technicavolous said:

 

For what it's worth, Microsemi sells lots of stuff designed by Jackson Labs Technologies, which might open up the market options.

 

Also, if you're looking for accurate clocks you can disconnect and take indoors, the term you're looking for is GPS Holdover. Just fair warning that the more accurate the clock, the longer it might take with view of the sky before it hits full accuracy (though Microsemi won't advertise that). FYI, double oven temperature compensated oscillators can get better accuracy than the some commercial grade atomic clock options, but may take up to 3 days of warmup to get to full spec..

 

But if you're going to procure a couple and take them inside, consider a battery backup to avoid the initial training time, and make sure they get lots of sunlight before you need them.

Link to comment
Share on other sites

I think that's the plan, getting the time fix with the GPS module, and then use the RTC to keep it vaguely accurate until we get the next GPS time fix.

I understood the concept of GPS Holdover and GPS disciplined oscillator, and hope to implement something approaching one of these days.

Link to comment
Share on other sites

Hi gounthar,
Sorry that I'm way to late to this party.  But if you are still interested.... 

I've built a GPS disciplined time server using ESP8266.  Jitter is way too high, the onboard oscillator is jittery and the WiFi module has variable latency.

I'll link you to a tutorial that I wrote for GPS discipline on OrangePi zero (should work for other boards to)
I get jitter of less than +- 20 microseconds with temperature control at 57 degrees C  about +-60 microseconds without temperature control.

EDIT: I read my tutorial again and note that you already responded to it. 
I'll leave this here in case it's useful to others finding your thread.

 

Link to comment
Share on other sites

Your GPS module may contain a well disciplined temperature compensated RTC and oscillator (most do), and there is a possibility that it may be able to provide accurate PPS output and NMEA time messages for a period even if there is no GPS signal, if programmed to do it.  (This is called holdover mode and some modules can do it, although the affordable ones may not offer this).

Many years ago I made PPS generator with a quartz xtal in an oven composed of a large TO220 transistor clamped to the xtal and surrounded by polystyrene.  The transistor was it's own temperature sensor, and the simple circuit maintained a steady temperature.  An 8048 programmed in assembler divided the oscillator down to 1Hz and added an extra unit to the division every now and then to compensate for the quantization error to get a final drift of about 4 parts per million.

The oven used the same principal as the link below, but the bigger transistor gave a better thermal coupling.  Something like this could provide stable temperature for any RTC.  https://www.romanblack.com/xoven.htm

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines