gounthar Posted July 15, 2021 Share Posted July 15, 2021 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. 0 Quote Link to comment Share on other sites More sharing options...
TRS-80 Posted July 15, 2021 Share Posted July 15, 2021 Network time is not accurate enough? 0 Quote Link to comment Share on other sites More sharing options...
gounthar Posted July 15, 2021 Author Share Posted July 15, 2021 I "need" it to be 1/60th of a second precise on several devices not on the same network... 0 Quote Link to comment Share on other sites More sharing options...
tparys Posted July 15, 2021 Share Posted July 15, 2021 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. 2 Quote Link to comment Share on other sites More sharing options...
Heisath Posted July 16, 2021 Share Posted July 16, 2021 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. 1 Quote Link to comment Share on other sites More sharing options...
gounthar Posted July 16, 2021 Author Share Posted July 16, 2021 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. 0 Quote Link to comment Share on other sites More sharing options...
Technicavolous Posted July 19, 2021 Share Posted July 19, 2021 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! 1 Quote Link to comment Share on other sites More sharing options...
gounthar Posted July 19, 2021 Author Share Posted July 19, 2021 Really interesting, I didn't know I could afford an atomic clock. Thanks. 0 Quote Link to comment Share on other sites More sharing options...
Heisath Posted July 20, 2021 Share Posted July 20, 2021 Its interesting whats possible, isn't it? 0 Quote Link to comment Share on other sites More sharing options...
tparys Posted July 21, 2021 Share Posted July 21, 2021 On 7/19/2021 at 8:35 AM, Technicavolous said: https://www.microsemi.com/document-portal/doc_view/136649-sa22c-user-guide-2017 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. 1 Quote Link to comment Share on other sites More sharing options...
gounthar Posted July 22, 2021 Author Share Posted July 22, 2021 Thanks a lot for these hints, tparys, I do appreciate. 0 Quote Link to comment Share on other sites More sharing options...
guidol Posted July 26, 2021 Share Posted July 26, 2021 this here could be an idea for accurate time https://hackaday.com/2021/07/25/portable-gps-time-server-powered-by-the-esp8266/ 0 Quote Link to comment Share on other sites More sharing options...
gounthar Posted July 26, 2021 Author Share Posted July 26, 2021 Thank you @guidol, I will have a look at it. 0 Quote Link to comment Share on other sites More sharing options...
guidol Posted August 17, 2021 Share Posted August 17, 2021 @gounthar also maybe here some other idea? https://hackaday.com/2021/08/16/new-part-day-raspberry-pi-hat-for-ieee1588-precision-time-protocol/ 1 Quote Link to comment Share on other sites More sharing options...
gounthar Posted August 17, 2021 Author Share Posted August 17, 2021 Interesting, thank you @guidol! 0 Quote Link to comment Share on other sites More sharing options...
xwiggen Posted August 19, 2021 Share Posted August 19, 2021 Just curious, why wouldn't a RTC fit the bill once synced? (not the H2 but e.g. ds3231) 0 Quote Link to comment Share on other sites More sharing options...
gounthar Posted August 19, 2021 Author Share Posted August 19, 2021 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. 0 Quote Link to comment Share on other sites More sharing options...
gounthar Posted August 20, 2021 Author Share Posted August 20, 2021 Interesting, but not affordable: https://www.cnet.com/tech/computing/facebook-shares-its-time-card-atomic-clock-tech-to-speed-internet-services/ 1 Quote Link to comment Share on other sites More sharing options...
xwiggen Posted August 20, 2021 Share Posted August 20, 2021 Well, you could set up LoRa network and sync 0 Quote Link to comment Share on other sites More sharing options...
schwar3kat Posted December 14, 2021 Share Posted December 14, 2021 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. 1 Quote Link to comment Share on other sites More sharing options...
gounthar Posted December 14, 2021 Author Share Posted December 14, 2021 Thanks a bunch! 0 Quote Link to comment Share on other sites More sharing options...
schwar3kat Posted December 14, 2021 Share Posted December 14, 2021 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 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.