Still slogging away at this, with a major delay caused by uBlox introducing a two layer security check that stops me activating their uCenter application (used to set the GNSS), reading their documentation, or contacting support to be let in manually. A smart phone is needed, which I don’t have. Can’t think why ublox have introduced extra tough security – seems OTT for protecting an ordinary account.
Not having access to ublox meant wasted time looking at modifying available code for earlier GNSS modules, before finding an Arduino library that does the job. Unfortunately, too big to fit on the AT-Mega 2560 that’s in my clock. So I switched to a Teesny4.1, which is new-to-me, and ported the code. Many differences: Teensy is a 32-bit computer, and the 2560 is 8-bit, resulting in many changes. Then I struggled with the code needed to capture timestamps due to a 3-way bug. Had to write a simplified timestamp program to pin down the causes, which were simple fixes – just had to do all of them at the same time.
The Teensy is by far the most powerful microcontroller I’ve worked with, but has disadvantages. Quite expensive and being physically long and thin makes it hard to fit inside the clock with the GPS module and other electronics. So, having got the code straight on a Teensy, I ported it to a raspberry Pi Pico, which is much cheaper and, being shorter, will be easier to fit into the clock.
The pico port was straightforward except I typed a 1 instead of 4, causing a strange timing error I assumed was interrupt related. I painfully investigated several obscure possibilities, before noticing a simple typo had throttled the GPS.
Results good. Fed the Pulse Per Second output of a Optronics M8Q GPS module into a pi Pico and Sparkfun MAX10S arranged to timestamp every other second.
_ Min Mean Max Range STDDEV
GPS Period: 1.999999969 2.000000000026845 2.000000025 56.0ns 11.4111ns
I.e. timestamping measures a 2 second GPS period correct ±28nanoseconds with a standard deviation of 11.41ns. The numbers aren’t entirely trustworthy because they’re pushing the limits of floating point representation. Most calculators and spreadsheets think 0.000000000026845 is zero.
Also prepared for the clock’s physical rebuild. Obtained another vacuum pump, bought soft-iron rod to make a new bob that won’t have magnetic remanence, replaced broken EnderPro 3D printer with a Bambu A1, and I think I have everything needed to tackle the vacuum chamber, apart from replacing the PVC pipe, and that’s in hand. First have to build the new electronics, 3D CAD a holder, and print it.
Progress painfully slow. When not off-colour, I have many outstanding domestic duties. Wish I was a boy of 60 again!
As Michael said: the really clever stuff is at the other end. All that’s needed is 75 years of high-tech development, 99.999% of it done by someone else!
🙂
Dave