Clock circuit design idea - Page 1
Forum section: electronics / general

author: Connecteur
author_rank: Frequent Contributor
timestamp: July 25, 2020, 05:03:35 pm
content: A lot of our clocks nowadays achieve accuracy by referencing a signal from the internet or from a shortwave broadcast. Quartz clocks are quite accurate and atomic clocks are nearly perfect, but most of the everyday clocks we use have the annoying habit of drifting off accurate time long before we notice it. But what about a much simpler solution designed into the clock circuitry itself?A simple clock such as one in a stove could learn how to keep more accurate time by taking note of two numbers: 1, the amount of time elapsed since the clock was last set, and 2, the amount of time lost or gained since the last reset. From this valuable data, it's simple math to correct the clock speed, making it much more accurate each time it's set. The circuitry should be designed to adjust it's own rate based on the actions of adjusting the clock.I once saw this feature built into a mechanical clock that was built in the Soviet Union. The instructions were that the clock should be adjusted once a day to correct the time until it kept excellent time. For example, if you set the time correctly on Monday at 8 AM, and by Tuesday at 8 AM it had lost 10 minutes, setting the clock caused the mechanism to automatically adjust the mechanism to be 10 seconds faster per day. After a few adjustments, this mechanical clock provided almost flawless timekeeping.I'm surprised that no one has incorporated this simple principle into digital clock design in all the years that they have been used.

author: m98
author_rank: Frequent Contributor
timestamp: July 25, 2020, 05:33:02 pm
content: That's just not how this works. Clocks don't only drift from a constant frequency offset.

author: Connecteur
author_rank: Frequent Contributor
timestamp: July 25, 2020, 06:34:44 pm
content: Quote from: m98 on July 25, 2020, 05:33:02 pmSeems to me whatever the cause, it could be mitigated by this simple time-correcting solution.

author: TimFox
author_rank: Super Contributor
timestamp: July 25, 2020, 06:52:01 pm
content: Back in the day, clocks at railroad stations ran freely (with pendulum mechanism) and would receive a synchronizing pulse (telegraphed from an observatory) on the hour that pushed the minute hand back to top center (12). So long as the pendulum was reasonably accurate, each correction was small and the clock would stay synchronized to the observatory over the long run.

author: Benta
author_rank: Super Contributor
timestamp: July 25, 2020, 07:10:58 pm
content: I have lots of clocks in my house. The only one I need to think about is my oven clock. All the others are synchronized either by DVB, Web or DCF-77.To me it's a non-issue.

author: rdl
author_rank: Super Contributor
timestamp: July 25, 2020, 07:31:22 pm
content: That's similar to how a lot of clocks in school rooms worked when I was growing up.Quote from: TimFox on July 25, 2020, 06:52:01 pm

author: Connecteur
author_rank: Frequent Contributor
timestamp: July 25, 2020, 08:15:19 pm
content: I'm sure the clocks in my school were regulated by the 60 Hz line signal. Power stations back in those days had revolution counters, and they were sped up or slowed down to maintain an accurate revolution count.

author: greenpossum
author_rank: Frequent Contributor
timestamp: July 25, 2020, 08:27:56 pm
content: Clocks in mains power appliances like microwave ovens are driven from the mains frequency which is kept in sync over the long term in many countries. Even cheapo clock radios still use the mains. Whereas pretty much anything that has a connection to the Internet uses that to keep time in sync.

author: Zero999
author_rank: Super Contributor
timestamp: July 25, 2020, 08:30:59 pm
content: Quote from: Connecteur on July 25, 2020, 06:34:44 pmIt will work to some degree, but there are inherent fluctuations in any system, look up1⁄fnoise.https://www.google.com/search?client=firefox-b-d&q=1%2Ff+noise.

author: tooki
author_rank: Super Contributor
timestamp: July 25, 2020, 08:40:03 pm
content: Quote from: TimFox on July 25, 2020, 06:52:01 pmSwiss railway clocks, even today, are synchronized every minute with a pulse. The seconds hand orbits in 58.5 seconds, then sits at 12 o’clock for 1.5 seconds until the sync pulse comes, at which point the minutes hand advances a minute and the seconds hand begins its next lap.

author: tooki
author_rank: Super Contributor
timestamp: July 25, 2020, 08:48:02 pm
content: Not the best quality video, but the newest, showing that behavior next to the newest-generation departure signs (big TFTs) (where they easily could have integrated the clock into the flat panel)https://youtu.be/SKPgZj1vb8o

author: Gyro
author_rank: Super Contributor
timestamp: July 25, 2020, 09:18:40 pm
content: Quote from: Connecteur on July 25, 2020, 06:34:44 pmI have an alarm clock program on my Palm TX PDA (yes I know, ancient) that does exactly this. It applies a time correction in terms of fractional seconds per day to the crystal derived clock. The drift compensation actually works very well.

author: David Hess
author_rank: Super Contributor
timestamp: July 26, 2020, 01:55:33 am
content: There is no reason that a quartz clock cannot learn to correct its drift and temperature compensation, but typically it is not done because they are close enough. If you did want a better one, then a much more accurate TCXO could be used which some high end clocks do.

author: Connecteur
author_rank: Frequent Contributor
timestamp: July 26, 2020, 03:09:20 am
content: I'm sure "close enough" is the reason we don't see it incorporated into most clock circuits today, but why couldn't it just be part of normal electronic clock design?

author: David Hess
author_rank: Super Contributor
timestamp: July 26, 2020, 03:13:16 am
content: Quote from: Connecteur on July 26, 2020, 03:09:20 amThe first thing which occurs to me is that it requires state to be saved unless it is acceptable that the calibration be lost if power is removed. Saving state will mean some floating gate memory and nobody is going to build a cheap clock IC on a process which provides that, or add a second IC.

author: langwadt
author_rank: Super Contributor
timestamp: July 26, 2020, 03:27:26 am
content: https://man7.org/linux/man-pages/man8/hwclock.8.htmlsection on adjust function

author: Connecteur
author_rank: Frequent Contributor
timestamp: July 26, 2020, 12:49:08 pm
content: Good point, but I think non-volatile RAM has advanced to the point where data could be stored for up to 10 years or more.

author: ebastler
author_rank: Super Contributor
timestamp: July 26, 2020, 01:12:02 pm
content: I am not sure where this incremental correction scheme would have its application niche these days. External time references are so easy to come by -- be it mains cycle counts, time broadcast stations, or NTP servers available via a fixed or wireless network.Those clocks which might benefit, namely "off the grid" portable ones, will get carried around, exposed to fluctuating temperatures, run on batteries of varying voltage... In which case I would expect the effect of those external fluctuations to dominate the inaccuracy of the clock, such that a correction of constant errors or long-term drifts doesn't cut it anymore.

author: greenpossum
author_rank: Frequent Contributor
timestamp: July 26, 2020, 02:17:00 pm
content: I know of one project which implemented this kind of idea:https://hackaday.io/project/169509-a-very-accurate-led-clockIt may not work so well if the temperatures range is wider.I suspect the real reason it isn't implemented in cheapo clocks is 1. there is already some other source of time, and 2. even if such a scheme is used, it will cost to calibrate each unit, and if the drift is too much in the field, people will get annoyed anyway and the scheme isn't doing any good.

author: Tom45
author_rank: Frequent Contributor
timestamp: July 26, 2020, 02:31:15 pm
content: I once worked with a guy that had that feature in his car's clock. This was decades ago and the implementation left something to be desired. Think mechanical clock movement with no electronics involved.He said that it would overcompensate when he made a time correction. So each time he corrected the time it would overshoot in the other direction. It took quite a few iterations to get it close.No, I don't remember the manufacturer of the car.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 26, 2020, 04:21:35 pm
content: Quote from: Connecteur on July 25, 2020, 06:34:44 pmIf it's kept in relatively constant conditions (temperature, RH...), that would sort of be OK I guess. But in real life conditions, that's rarely the case.I don't really see a point these days though - even a good modern, but still not expensive TCXO, which is not boutique stuff at all, can get you less than 0.5 ppm drift over a large range of conditions, which would equate to approx. 1.3 s drift over a month, without any adjustement needed. I kind of doubt the scheme you suggest could get anything close to that, and it would require more "maintenance".Of course you can get better than this yet, but that's quickly much more expensive (OCXOs, atomic clocks, etc.) and draws a lot more power.Overall, the idea of a "learning" process is right only 1/ if the conditions that can influence the clock freq. are stable, or at least vary in a predictable, more or less constant way, or 2/ if your learning "algorithm" can actually take into account A LOT of parameters and compensate accordingly: that would mean using temperature, probably RH (depending on the clock generator), maybe pressure, vibrations... then also take into account how the clock generator reacts to these parameters... then feed it to some kind of neural network maybe. Eek. And even with that amount of sophistication, I still doubt you could get better than even a cheap TCXO. I'd be curious to see something like this implemented though, as an exercise.

author: Connecteur
author_rank: Frequent Contributor
timestamp: July 26, 2020, 06:44:29 pm
content: I don't know if I'm the only one, but my expectations for accuracy for clocks have been raised, especially when things like phones and smart TVs provide accuracy to the second all the time. When I set my AV equipment to turn on a program at a certain time, it's disappointing to miss the first minutes sometimes because the clock has lost time. It's not only that, but it's a bit annoying to be late for an appointment because your car clock is 10 minutes off because you never paid attention to it until that time you forgot your phone at home. No one is asking for the moon, but I think it would be great if some of the cheap clocks that seem to be everywhere nowadays could be more accurate, or at least self-adjusting with a simple program algorithm.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 26, 2020, 07:02:51 pm
content: Quote from: Connecteur on July 26, 2020, 06:44:29 pmThat's because most cheap clocks use crappy oscillators. You wouldn't need anything really fancy. I gave some figures - you can expect a few seconds drift a year with a decent TCXO, but many cheap clocks have more like 100 ppm oscillators, and it can get worse than this in cars due to large temperature variations. And why is it so? Cost mainly. Even though a TCXO is not expensive these days, it'd still add a few bucks in the BOM, in a world where we shave off every cent. Secondly, because manufacturers likely don't even care - probably because in turn customers have been used to get crap clocks in common devices including cars, so they are not expecting any better.A related thought regarding the market - what manufacturers sell, what consumers expect and buy: the clock ("watch") industry has followed this trend for a long time. Very accurate clocks with low drift have been considered luxury items for a long time, and often come at a premium. So in a car for instance, you're more likely to find an accurate clock in a luxury car.Of course, as with mobile phones, as soon as some given device has GPS or an internet connection, it can get very accurate time. More and more recent cars come with some kind of internet connection, and it will likely increase in the future. Likewise, AV gear increasingly gets internet access. So I guess everyone will definitely consider this a solved issue, which may worsen the situation further as to getting low-drift, but fully autonomous clocks in the future.

author: duckduck
author_rank: Frequent Contributor
timestamp: July 30, 2020, 06:10:02 am
content: Quote from: David Hess on July 26, 2020, 03:13:16 amAmazon will sell me an "Atomic wall clock" delivered to my front door for US$20. When the shortwave time-keeping stations are shut down, your idea may find a place in non-internet-connected locations if dedicated GPS-set clocks are still fairly expensive, as they are now.There's at least one utility that does time trimming via software for the built-in clocks in personal computers. The software doesn't actually modify the hardware, but uses software to modify the time based off of comparisons with NTP. I remember using this around the year 2005 or so. Nowadays I can't be bothered and everything is internet-connected anyways, right?Speaking of, the head of IT Security at my company has a friend with one of those stupid internet-connected refrigerators. Every time security guy visits his friend's house, he makes sure to browse to a certain popular NSFW video website and leave the browser displaying it when he leaves.

author: Connecteur
author_rank: Frequent Contributor
timestamp: July 30, 2020, 02:55:41 pm
content: From my point of view, in the year 2020 there should be no excuse for clocks that don't keep time. It's fine if the device is already connected to the internet or shortwave; those may be the simplest solution, but for independent devices, self-correcting circuitry should be standard. Who can remember how to set the time on a device you got 6 months ago?

author: David Hess
author_rank: Super Contributor
timestamp: July 30, 2020, 05:29:38 pm
content: Quote from: SiliconWizard on July 26, 2020, 07:02:51 pmPower limited clocks like wristwatches are more limited in their selection of clock source because they are restricted to 32kHz sources which are not ideal for temperature compensation.Quote from: duckduck on July 30, 2020, 06:10:02 amI think it more likely that better TCXOs will be used in applications where power is not a limiting factor.QuoteWould that be Tardis? I still run it on my systems.https://www.mingham-smith.com/tardis.htm