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


 Share

3 3

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 post
Share on other sites

Donate and support the project!

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 post
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 post
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 post
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 post
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 post
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 post
Share on other sites

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...
 Share

3 3