Arduino Pendulum Clock Design – Comments Welcome

Advert

Arduino Pendulum Clock Design – Comments Welcome

Home Forums Clocks and Scientific Instruments Arduino Pendulum Clock Design – Comments Welcome

Viewing 25 posts - 276 through 300 (of 307 total)
  • Author
    Posts
  • #518219
    Michael Gilligan
    Participant
      @michaelgilligan61133
      Posted by SillyOldDuffer on 07/01/2021 15:14:59:

      […]

      A recurring theme in this endeavour is the fun caused when technology is pushed to the limit.

      […]

      .

      Dare I mention some similarity with the ‘direct drive’ lightweight record player turntables … which, despite all the clever technology, could never beat the performance of a heavy platter on good bearings ?

      MichaelG.

      Advert
      #519100
      SillyOldDuffer
      Moderator
        @sillyoldduffer

        Another lurch forward thanks to Michael Gilligan. One of the graphs I draw is of Allan Deviation, said to be the best way of expressing clock performance, except I didn't understand it,

        Given a stream of data representing period it's easy to number crunch minimum, maximum, average, median, standard deviation and to graph rate.

        Standard deviation and rate are the most interesting.

        Rate describes how much a clock drifts over time, a few seconds per day, or scientifically in parts per million, or parts per billion. If the rate is known it can be corrected.

        Standard deviation is a simple measure of stability – the range over which period varies. Although a clock can keep good time over days (low rate), might be because wild variations average out. OK over several hours but unreliable at seconds – not a good timekeeper.

        Thanks to Michael finding this description, I think I've got a handle on Allan Deviation. It graphs how much a clock's variance varies, i.e. a measure of stability covering short & long-term effects. Allan insn't easy to interpret. Rawlings (Science of Clocks and Watches) says: 'There are so many influences on a clock that the study of performance records and stability charts seems more akin to the science of meteorology than physics or engineering.' Curve shape is as important as the values, but the shape is influenced by many factors.

        Occurred to me Allan would be more obvious used to compare clocks. I have 6,

        • My pendulum clock
        • Same temperature compensated
        • A UNIX program outputting times triggered by a per second timer. This depends on a not very stable clock corrected by the Network Time Protocol every 10 seconds or so. NTP is never wrong by more than 0.1s
        • An SDG1062X Function Generator. This has a temperature compensated crystal oscillator; good rather than excellent.
        • A GPS Module producing second pulses, ±10nS, the best I can do without spending big money.
        • A 'Perfect' clock, i.e. a stream of computer generated numbers representing pure sensor readings. No noise, sensor errors, or drift. Mine is 64-bit precision floating point numbers.

        This graph compares all six clocks:

        allancompared.jpg

        Best at the bottom, worst at the top. Curves start top left with standard deviation and then how that varies. So standard deviation is a decent basic indicator of clock goodness, but not the whole story.

        As expected the perfect clock (Brown) massively outperforms real clocks. But Allan Deviation shows imperfections. A gentle down slope is good, indicating white noise, but there are kinks. These I suspect are rounding error due to the limitations of floating point arithmetic.

        My uncompensated pendulum (blue) is the worst clock. The middle dip is the lowest variation achieved and suggests this the best a compensated version can do. The rise out of the dip means rate drift. The orange line is from the same run, but temperature compensated. A considerable improvement, but the compensated clock now shows a distinct rate drift error. (Consistent with other data, and has me puzzled. Per-swing accuracy better, but long-term timing is worse, probably because other faults have emerged!)

        Green UNIX time is a mix of good and bad. The down slope suggests this a good clock influenced mainly by white noise – no drift, but variation is high – worse than my temperature compensated clock. Fits in with how NTP works. The computer's internal oscillator isn't special, so drift is likely between NTP time updates. The exact timing of a second is influenced by whatever else Linux is doing and so is the way my program measures it. Although NTP is Atomic Time, it resets iffy computer clocks with a bang, with variance due to network & processing delay. Atomic time, but up to 0.1s off. Although my computer is usually within 25mS, Allan Deviation detects the imperfection. Truly excellent in the long term, not so hot close in.

        Both electronic clocks do well. The purple and red curves track each other closely. GPS is better than the Function Generator. Short term both are better than UNIX but they drift off because they're never corrected. At this accuracy sensor error intrudes. GPS is significantly better than the Function Generator, but Allan doesn't highlight thst. Both curves are limited by the Arduino Pro-Micro's crystal oscillator. So the purple GPS line represents the best I can measure to, not the actual performance of the GPS module & I can't trust measurements below that line. On the plus side, the Arduino is good enough to detect how well or badly my pendulum does!

        Assuming the scale's right, my compensated clock is slightly inferior to a marine chronometer circa 1795. Not bad, but disappointing for a super-timepiece! On this graph Shortt No 48, Rieffler 'E' & Fedchenko would all be a tad inferior to the GPS. No surprise, – the best mechanical time-keepers can't compete with electronics and atoms!

        Very much feeling my way. Please say if it's wrong – I'm here to be educated.

        Dave

        #519112
        John Haine
        Participant
          @johnhaine32865

          Thanks Dave – that web page is a find, thanks Michael as well. I'm amazed to find that R can also calculate AVAR (though I shouldn't have been I suppose).

          #519145
          Michael Gilligan
          Participant
            @michaelgilligan61133

            Progress indeed, Dave

            The one thing that surprises me a little is that the best ones of your ‘real clock’ examples are not dipping down into the 10 exp -13 region. … That top group of lines all looks more closely grouped than I would have expected.

            This may be a condemnation of your measurement & analysis … I’m not sure.

            … If I can find any supporting evidence, I will be back.

            MichaelG.

            #519148
            Michael Gilligan
            Participant
              @michaelgilligan61133

              angel

              ere be evidence: **LINK**

              https://www.researchgate.net/figure/GPS-Receiver-versus-UTC-NIST-during-15-day-interval-after-SA-was-set-to-0_fig2_269280303

              [ Download full-text ] is available.

              MichaelG.

              Edited By Michael Gilligan on 11/01/2021 17:21:54

              #521526
              SillyOldDuffer
              Moderator
                @sillyoldduffer

                Not going well with the Duffer Clock and I'm pausing for thought.

                But first, re Michaels 'This may be a condemnation of your measurement & analysis … I’m not sure', I'm not sure either! One possibility is my sample time is too short, but I think Allan is telling the truth. With the exception of UNIX time (actually Network Protocol Time), all the real clocks are being measured by my imperfect Arduino. So Allan is seeing the Arduino drift, rather than GPS, and it's the Arduino that stops the result getting anywhere near 10E-13.   Left running long enough I think NTP would drop down much further.

                Part of my depression is due to failing to find the missing TXCO's needed to improve the Arduino. Salt rubbed into the wound because I experimented with a 'not needed and not lost TXCO' to test my SMD soldering skills. Fiddly! The TXCO is the small square mounted on the red motherboard below.  Wrong frequency for what I need, but OK for a trial run.

                dsc06385.jpg

                I seem to have damaged the TXCO because it oscillates at 38.4, not 12.8MHz. Should have read the spec before powering up because the TXCO is voltage sensitive. Main power is 3.1V max and I fed it 3.3 plus I didn't realise the control voltage on line 20 is also critical. Oh dear.

                Meanwhile the pendulum failed, and won't restart. Opening up showed debris:

                debris.jpg

                And the sprod's mounting sleeve has slipped – the 5mm thickness where the rod emerges from the brass disc in the next photo. The debris on the rod can only be due to physical damage further up.

                dsc06377.jpg

                Q dropped badly over the last for or 5 runs, and the above seems to explain why. At first the pendulum did over 30 swings per impulse, but it degraded over a week to just one swing per impulse, and now it doesn't run at all. Root cause was probably me jostling the pendulum whilst adjusting the magnet and IR sensor positions.

                Details are irritating but the big problem is persistent instability, which is obvious in almost all test runs. Worse than usual, but not untypical:

                ubst40p16e.jpg

                After starting the pendulum settles down to 0.9325s but then the variance gradually gets worse peaking at around midnight before gradually settling down at 5am. Although the most extreme variance is less than 0.1mS, this is hopeless in a precision clock. In a very long run, instability appears and disappears.

                The cause isn't related to time of day, humidity, temperature or air pressure. I think it's more likely a design fault. My pendulum rod relies on the principle of least energy to keep it swinging in a straight line – in theory it should take the most direct path towards the electromagnet. I guess the bob actually behaves more like a raindrop trickling down a window pane. Raindrops don't run down glass in straight lines, rather they are prone to deviate right and left for no apparent reason. I suspect my pendulum occasionally swings off the straight and narrow which causes the bob to trigger the impulse at slightly different times and makes it worse. The impulse alters both period and path so the disturbance grows and subsides almost by chance and for no obvious reason. The extremely light bob and rod don't help!

                Vibration could explain why my pendulum goes walkabout. Running the pendulum on a dining table showed variations due to people walking on the floor, which is hardwood parquet on concrete. My house clunks as the temperature varies – mainly the hot water pipes, but other things too. And there's a road not far away. Maybe the wooden windowsill the clock's sat on expands and contracts with a jolt. I planned to improve Q by removing resin so the bob would swing on Carbon Fibres only. Not sure that's a good idea now because it would allow the pendulum to deviate more easily.

                Although the clock can keep good time it's proving too sensitive and fickle to be practical. I'm inclined to build a clock like John's and test that. I feel a heavy bob suspended by a flat spring would solve a lot of problems…

                Dave

                 

                Edited By SillyOldDuffer on 21/01/2021 15:27:00

                #521670
                John Haine
                Participant
                  @johnhaine32865

                  Don't be too discouraged Dave! Your device is the first real bit of new thinking in pendulum clocks for quite a while. One thing you could consider, given the sensitivity to vibration, is to have more than one pendulum, coupled together. Swinging in antiphase, they can be immune (long term) to horizontal shifts of the clock in the plane of the pendulum. There's a clock at the BHI HQ at Upton Hall that has 3 pendulums set at 120 degrees, all swinging inwards and outwards in phase – that sort of configuration could work well with your tripod and tank. The BHI version has a complicated mechanical escapement, it could be easier using EM impulsing.

                  Another point about using coupled pendulums is that, designed right, the CoG of the clock doesn't move with the pendulums, so much less energy is lost to the support. To work best the coupling needs to be tight, which implies a less rigid frame. It's critical that the pendulums have the same period exactly and the same mass, otherwise the amplitudes become unbalanced.

                  #521757
                  Meunier
                  Participant
                    @meunier

                    How can I insert a link to an mp.4 file showing further pendulum options for SoD? (humorous )

                    DaveD

                    #521762
                    Michael Gilligan
                    Participant
                      @michaelgilligan61133
                      Posted by Meunier on 22/01/2021 14:28:19:

                      How can I insert a link to an mp.4 file showing further pendulum options for SoD? (humorous )

                      DaveD

                      .

                      Do you have a Dropbox account, Dave ?

                      … It’s easy to provide a ‘read only’ link to a folder there

                      MichaelG.

                      #521787
                      Meunier
                      Participant
                        @meunier

                        Sorry, no Dropbox acct Michael. Perhaps I should investigate.

                        Also, thank you for the continuation link on the 'bridge' story, have not had time to
                        pursue the link yet but look forward to following through.
                        DaveD

                        #521796
                        Michael Gilligan
                        Participant
                          @michaelgilligan61133
                          Posted by Meunier on 22/01/2021 16:01:22:

                          Sorry, no Dropbox acct Michael. Perhaps I should investigate.

                          .

                          .

                          Start here, Dave **LINK**

                          https://www.dropbox.com/en_GB/basic

                          … but you may need the French localisation

                          MichaelG.

                          #521797
                          John Haine
                          Participant
                            @johnhaine32865

                            Doesn't have to be Dropbox, can share files through Google Drive for example.

                            #521811
                            Michael Gilligan
                            Participant
                              @michaelgilligan61133
                              Posted by John Haine on 22/01/2021 16:28:39:

                              Doesn't have to be Dropbox, can share files through Google Drive for example.

                              .

                              True …

                              #521821
                              Meunier
                              Participant
                                @meunier

                                Dropbox link attempt

                                 

                                https://www.dropbox.com/s/1t8mqdgl84izll0/Le%20Maitre%20des%20Horloges-Genial1.mp4?dl=0

                                DaveD

                                 

                                Supper calls, check back later !

                                Edited By Meunier on 22/01/2021 17:39:36

                                #521836
                                Michael Gilligan
                                Participant
                                  @michaelgilligan61133

                                  It works for me, Dave

                                  … absolutely superb star

                                  MichaelG.

                                  #521847
                                  Meunier
                                  Participant
                                    @meunier
                                    Posted by Michael Gilligan on 22/01/2021 18:25:37:

                                    It works for me, Dave

                                    … absolutely superb star

                                    MichaelG.

                                    Now, how to make the link a 'linky' rather than a url. Thanks for the incentive Michael, now i will be able to add some bird photos, probably in tea-room, to avoid off-topic accusations. Japanese nightingales to be precise.
                                    DaveD

                                    #521869
                                    Michael Gilligan
                                    Participant
                                      @michaelgilligan61133

                                      Click this icon [affectionately known as the bubblecar, although of course it’s not]

                                      … and follow your nose, Dave

                                      bubblecar.jpg

                                      **LINK**

                                      https://www.dropbox.com/s/1t8mqdgl84izll0/Le%20Maitre%20des%20Horloges-Genial1.mp4?dl=0

                                      MichaelG.

                                      #521877
                                      Meunier
                                      Participant
                                        @meunier

                                        Thanks again Michael, every day is a good day when you learn/achieve something new !

                                        **Link**

                                        DaveD

                                        I only hope that after all the effort SOD/Dave and JohnH have a chuckle

                                        Edited By Meunier on 22/01/2021 20:32:39

                                        #521882
                                        SillyOldDuffer
                                        Moderator
                                          @sillyoldduffer
                                          Posted by Meunier on 22/01/2021 20:31:10:

                                          **Link**

                                          DaveD

                                          I only hope that after all the effort SOD/Dave and JohnH have a chuckle

                                          Certainly did! Excellent, thanks.

                                          laugh

                                          Dave

                                          #521884
                                          Meunier
                                          Participant
                                            @meunier

                                            yes

                                            DaveD

                                            #521893
                                            duncan webster 1
                                            Participant
                                              @duncanwebster1

                                              The man's got too much time on his hands.

                                              I'll get my coat

                                              #530677
                                              SillyOldDuffer
                                              Moderator
                                                @sillyoldduffer

                                                Arghh!

                                                Last month I decided to leave the clock running for 5 weeks to see how it behaved on a long run. Just checked and it stopped 3 weeks ago. Only then did I remember having to reset the cooker clock due to a power cut.

                                                The clock flashes an LED to show it's running and it looked OK from across the room. Wrong LED! The Pi flashes a LED to show network activity and I was watching that. Should have gone to Specsavers!

                                                Dave

                                                #591770
                                                Glenn Turner
                                                Participant
                                                  @glennturner80107

                                                  Wow.

                                                  I started a project a couple of years ago but only recently got it going (but still under development).

                                                  It involves an pendulum clock, an arduino, GPS signal and optical sensor to detect the pendulum. It appears I'm doing the same as you!

                                                  I was googling standard deviation of pendulum clocks as I'm not sure what is good or bad.

                                                  I know pendulum clocks have a poor oscillator (Q factor) to other clocks. However over a long enough time the average can be very good (with a good quality clock).

                                                  I'm currently at the stage of having to move the clock as walking around close to it is very clearly having an impact.

                                                  How are you getting on with your project?

                                                  #591821
                                                  SillyOldDuffer
                                                  Moderator
                                                    @sillyoldduffer

                                                    Posted by Glenn Turner on 28/03/2022 00:22:54:

                                                    … I started a project a couple of years ago but only recently got it going (but still under development).

                                                    It involves an pendulum clock, an arduino, GPS signal and optical sensor to detect the pendulum. It appears I'm doing the same as you!

                                                    I was googling standard deviation of pendulum clocks as I'm not sure what is good or bad.

                                                    I know pendulum clocks have a poor oscillator (Q factor) to other clocks. However over a long enough time the average can be very good (with a good quality clock).

                                                    I'm currently at the stage of having to move the clock as walking around close to it is very clearly having an impact.

                                                    How are you getting on with your project?

                                                    Hi Glenn, and welcome to the forum! If you fancy sharing some photos of your project with us, instructions are here.

                                                    The project's triple-headed: the pendulum clock itself; measuring and logging it's performance accurately, both long-term and per swing; and using statistics to determine the effect, if any, of external influences like temperature, air pressure, humidity, and the tide.

                                                    My clock project stalled last year after an attempt to improve Q by burning the matrix off the carbon fibre at the suspension point proved fiddly to do with disappointing results. Not only did the Q remain low, but the bob tended to swing in an ellipse rather than straight. I also realised that the carbon rod I'm using is humidity sensitive. An advantage of my design is it's small enough to fit inside a length of drainpipe, which can be be pumped out to reduce the effects of changing air-density (pressure and humidity), but this is only worth doing if I can improve the pendulum's Q. Pending a rethink on the suspension, I put the mechanics aside.

                                                    Then I put a about 4 months work into looking for a microcontroller capable of better time resolution than a 16MHz 8-bit Arduino or PIC. (An Arduino is fine for driving the pendulum, but I wanted better measurements. Many later microcontrollers have faster clocks, and I was hoping to find one that combined frequency stability with an easy to use hardware counter/timer. A lot of work, because programming them needs a reasonable understanding of each CPUs architecture and a decent development environment.

                                                    Various problems emerged:

                                                    • RaspberryPi 4 computers clock in the gigahertz range, but obtain the high frequency by multiplying up from an ordinary oscillator. And, even in real-time mode, the operating system causes glitches. So the although a Pi can measure nanosecond variations in individual swing times, they're inaccurate. A Pi is much better at measuring errors over long timescales because it can be synced to NTP, or – even better – a GPS. Pi has particular potential for measuring time because it runs a proper operating system AND provides access to hardware pins.
                                                    • Many fast microcontrollers control frequency with a wobbly ceramic resonator or uncompensated crystal, which limits the accuracy of nano-second measurements. Presumably doesn't matter to the CPU if clock pulses vary slightly because everything that has to be synchronised switches on the same edge.
                                                    • PIC and the basic Atmel microcontrollers have a simple relationship between clock accuracy and the counter-timer. Not necessarily so in more advanced chips, where designers seem to place more emphasis on flexible counter-timer features whilst sacrificing very precise timing. For accurately timing pulse lengths, upgrading to a sooper-dooper fast micro-controller usually doesn't help.
                                                    • Most microcontrollers drive their counter/timers with the internal oscillator, so I looked for controllers allowing the counter/timer to be driven by an external source. I found one, but then managed to lose an envelope full of expensive temperature compensated SMD crystal oscillators, at which point I wandered off, demoralised!

                                                    Despite disappointing results it's been an fascinating project, and I hope to restart soon. Got as far as putting the dismantled clock on the bench ready for rebuilding. Too many distractions! (3D printing at the moment.)

                                                    Interesting you've noticed walking near your clock disturbs it. Me too! My dining room / clock laboratory has a concrete floor with teak blocks, so pretty solid. Standing 3 metres away,landing from a 15cm high jump causes the pendulum time to vary by several tens of microseconds over several swings. Overnight logs often show similar events. I don't know what causes them: possibly something passing on the road 10 metres away; maybe the house moves as it cools down; or something seismic. Unlikely – SW England isn't noted for earthquakes! Old books advise mounting the pendulum on a thick masonry wall, more rigid the better, noting grand-father clocks often keep better time when the case is screwed firmly to a wall.

                                                    Several other chaps with good knowledge on this subject on the forum: I learned a lot from them.

                                                    Dave

                                                    #591925
                                                    Glenn Turner
                                                    Participant
                                                      @glennturner80107

                                                      My project is initially with a cheap Hermle pendulum clock. The plan is to see what causes pendulum variations and find the practical problems, then start to fix those problems. I imagine that will have to make a pendulum out of invar and seal the clock in a container to stop pressure changes. If things go well I would like to make a new clock. Ultimately the plan is to manufacturer a highly accurate mechanical pendulum clock that has a completely detachable electronic adjustment aid. But right now it is just a hobby.

                                                      I’m using an

                                                      • Arduino Due 84 MHz that has a basic RTC
                                                      • Adafruit AirLift (gives internet access)
                                                      • SparkFun GPS Breakout – NEO-M9N
                                                      • Adafruit BME680 (Temperature, Humidity, Pressure and Gas Sensor)
                                                      • 4×20 LCD panel to output real-time information

                                                      I’m using the Arduino Due to measure the period of the pendulum and calculate the average period each minute along with the standard deviation.

                                                      GPS PPS is going to be used for longer measurements. Such as every hour completely by-passing any timings by the microprocessor.

                                                      Images below (the elecontrics is still messy but I will tidy this up soon)

                                                      pxl_20220314_232528567._exported_stabilized_1647300377947.jpg

                                                      clock electronics

                                                    Viewing 25 posts - 276 through 300 (of 307 total)
                                                    • Please log in to reply to this topic. Registering is free and easy using the links on the menu at the top of this page.

                                                    Advert

                                                    Latest Replies

                                                    Viewing 25 topics - 1 through 25 (of 25 total)
                                                    Viewing 25 topics - 1 through 25 (of 25 total)

                                                    View full reply list.

                                                    Advert

                                                    Newsletter Sign-up