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 - 126 through 150 (of 307 total)
  • Author
    Posts
  • #499908
    SillyOldDuffer
    Moderator
      @sillyoldduffer

      Moved electromagnet last night from directly under the bob (bottom dead centre) to pull it sideways instead:

      bobsideunder.jpg

      Positioning the electromagnet at BDC minimises any disturbance of the bob when impulse is applied because the bob is travelling at maximum velocity at that point. Sadly my design makes the timing and strength of the impulse critical; why is still under investigation.

      Got frustrated last night and moved the electromagnet back to the side position, and got it running in a few minutes. This morning wouldn't run at all. Causes: solar energy on the sensor, even though it's wrapped in silver foil, and the magnet base had moved about 2mm overnight. My suspicion BluTack is a rotten adhesive confirmed!

      Anyway, got it going reliably and was able to log how well the pendulum performs over time.

      ardclockdriftsidemagnet.jpg

      The period of each full swing (in microseconds) is compared with a running average.

      When the clock is first started, the pendulum bounces badly for about 3 minutes and then gradually settles down with each swing gradually getting closer to the average. Promising. Or is it?

      ardclocksidew8000.jpg

      With a longer sample deviation from average is rising again. Could it be temperature or air pressure? Not convinced: I'll add a sensor to see if either curve matches, but I think the effect is too big.

      The comparison may be dodgy – statistics aren't my strong suit.

      Time for a brisk walk and think in the fresh air.

      Dave

      Edited By SillyOldDuffer on 06/10/2020 15:37:53

      Advert
      #500028
      Michael Gilligan
      Participant
        @michaelgilligan61133
        Posted by SillyOldDuffer on 04/10/2020 19:14:35:

        […]

        It's deflection characteristic is:

        cf0pt5deflection.jpg

        This data enables the springiness of the rod to be calculated.

        Dave

        .

        This **LINK** appears to be an excellent description of the calculation process

        https://youtu.be/QNQ5qzXII58 : Cantilever Depression – Young's modulus determination

        But, I am embarrassed to admit that his accent and speed of delivery make it difficult for me to follow.

        … Can anyone suggest an alternative, please ?
        … I feel the need to understand this better

        MichaelG.

        #500035
        John Haine
        Participant
          @johnhaine32865

          Surely the best way is to fix a known mass at the end of a known length, suspend it vertically, measure the period of oscillation, and back-calculate the YM using Duncan's formula?

          #500038
          Michael Gilligan
          Participant
            @michaelgilligan61133
            Posted by John Haine on 07/10/2020 10:41:20:

            Surely the best way is to fix a known mass at the end of a known length, suspend it vertically, measure the period of oscillation, and back-calculate the YM using Duncan's formula?

            .

            Perhaps it is, John

            But I am trying to understand Dave’s experimental results

            MichaelG.

            #500042
            John Haine
            Participant
              @johnhaine32865

              Update on my own experiments: with some software tweaks my prototype clock is now running reasonably well on my desk so next step is to transfer it somewhere it can run undisturbed for a few days and have its timekeeping monitored. It has been running for the last 17 hours and has gained 19 seconds quite steadily so obviously needs some tweaking to the pendulum and a readjustment of the compensation counter. To do that I need a better time standard so will acquire the data with timestamps from NTP.

              #500045
              Michael Gilligan
              Participant
                @michaelgilligan61133

                Note: Aside from the range of potential matrix materials … there are many versions of the carbon fibre filament.

                https://en.wikipedia.org/wiki/Carbon_fibers#Structure_and_properties

                Predicting the properties of a particular pultruded rod could be ‘interesting’ to say the least !

                MichaelG.

                Edited By Michael Gilligan on 07/10/2020 11:36:42

                #500049
                duncan webster 1
                Participant
                  @duncanwebster1

                  The effect of stiffness is very small even for Dave's lightweight pendulum bob, so John's suggestion is open to lots of uncertainty. Dave's experiment gives a value of 66GPa for Young's modulus in CF, which is lower than I'd expect. One supplier quotes 28-40MPa which is very low indeed (and I think must be wrong), another quotes 181GPa for a 70%fibre/30%resin mix. This is much more what I'd expect. Steel is 207GPa for comparison

                  Small variation in diameter will have large effect on rod stiffness, it goes as the fourth power

                  I can't work out how to attach a png to this, so I'll sent some sums to Michael via email, if he can work out how to make it public that's fine. I couldn't understand Michael's link either, is he speaking English?

                   

                  Edited By duncan webster on 07/10/2020 11:42:59

                  #500069
                  duncan webster 1
                  Participant
                    @duncanwebster1

                    Easy Composites got back to me. Their figure of 28-40MPa should be GPA, much more sensible, but egg on face all round at EC I should think

                    #500095
                    Michael Gilligan
                    Participant
                      @michaelgilligan61133

                      This appears to cover it nicely: **LINK**

                      https://www.doitpoms.ac.uk/tlplib/thermal-expansion/expt1.php

                      … despite the reference to thermal-expansion dont know

                      Derivation of the formula is linked from that page.

                      MichaelG.

                      .

                      and second moments of area for various shapes are listed here:

                      https://en.wikipedia.org/wiki/List_of_second_moments_of_area

                      Edited By Michael Gilligan on 07/10/2020 17:43:25

                      #500099
                      Michael Gilligan
                      Participant
                        @michaelgilligan61133

                        and, with thanks to Duncan:

                        9e97c0ed-7f97-47ef-ade5-1c35e504fec1.jpeg

                        .

                        MichaelG.

                        #500140
                        SillyOldDuffer
                        Moderator
                          @sillyoldduffer

                          Out today, but was able to leave the clock running unattended while logging.

                          Yesterday, tested logging while typing on the same table. The graph of tick periods shows serious wobbling:

                          ondiningtable.jpg

                          My pendulum is exceptionally sensitive to vibration, probably because the rod is unconstrained. Easy to tell from the graph when I wasn't at the table. Don't know what caused the spike while I was out for a walk; I blame the cat.

                          Left it running undisturbed again whilst I was out today:

                          quietrun.jpg

                          Far fewer big deviations, but the magnified scale shows wobble between swings of about ±250uS. (Eyeball guess, number crunched stats when I get home tomorrow.) Not good.

                          I added a BME280 pressure/temperature/humidity detector and arranged the Arduino to log to a RaspberryPi 3b rather than a PC. A compact low-power setup means I can leave the clock on test for months if necessary. Log files can easily be copied off the Pi at any time because it's wifi networked.

                          Next steps, measure Q, 3d print the redesigned magnet holder, and reduce the impulse to see if bob wobble can be reduced. Then back to the electromagnet under the bob.

                          Philosophical question. Although the period of each swing varies wildly, the inaccuracies appear to average out. If I accurately determine the pendulum's average period over several days, and then use average period to drive the mathematical gear train to get HH:MMS, can I claim the clock is accurate? Even in it's rough state, could be OK within 0.5mS. (Assuming I get Bressenham or Duncan's interpolation method to interpolate properly.)

                          Dave

                          #500150
                          Michael Gilligan
                          Participant
                            @michaelgilligan61133
                            Posted by SillyOldDuffer on 07/10/2020 22:25:20:

                            […]

                            Philosophical question. Although the period of each swing varies wildly, the inaccuracies appear to average out. If I accurately determine the pendulum's average period over several days, and then use average period to drive the mathematical gear train to get HH:MMS, can I claim the clock is accurate?
                            […]

                            .

                            Philosophical answer:
                            I guess that would depend upon what you are intending to time with it

                            You might like to look at the Royal Observatory Chronometer Trials: **LINK**

                            http://www.royalobservatorygreenwich.org/articles.php?article=1040

                            But also consider the performance of Hipp’s Chronoscope: **LINK**

                            https://onlinelibrary.wiley.com/doi/epdf/10.1111/j.2044-8295.1906.tb00173.x

                            MichaelG.

                            #500170
                            John Haine
                            Participant
                              @johnhaine32865

                              It depends on the source of the variations and their statistics, but basically if the period changes randomly from swing to swing then their integral, which is indicated time, will probably not average out. The error typically grows as the square root of the number of periods summed. If you took your average over one time interval, say a day; then over the next day; comparing the two you would see a difference. I did some work on this a while back and for variations resulting from "escapement noise" – i.e. random changes in impulse from period to period – the variation decreases as the bob mass increases.

                              Woodward also covers this (but I can't remember if he mentions it in MORT, may be only in WOT) – the situation for errors induced by support noise is worse as they always generate on average a losing rate because of circular deviation.

                              #500232
                              SillyOldDuffer
                              Moderator
                                @sillyoldduffer
                                Posted by John Haine on 08/10/2020 10:15:29:

                                It depends on the source of the variations and their statistics, but basically if the period changes randomly from swing to swing then their integral, which is indicated time, will probably not average out. The error typically grows as the square root of the number of periods summed. If you took your average over one time interval, say a day; then over the next day; comparing the two you would see a difference. I did some work on this a while back and for variations resulting from "escapement noise" – i.e. random changes in impulse from period to period – the variation decreases as the bob mass increases.

                                Woodward also covers this (but I can't remember if he mentions it in MORT, may be only in WOT) – the situation for errors induced by support noise is worse as they always generate on average a losing rate because of circular deviation.

                                The following graphs are experimental but I think they both support John's statement that the error won't average out. The rolling average changes.

                                First graph set is of an overnight run, on dining table, started mid-afternoon, and finished at breakfast. The Arduino logs period, temperature, relative humidity, barometric pressure and calculates the period's running average.

                                overnightdiningtable.jpg

                                During the night the pendulum grew wilder. Average period over the run was 878225µS.

                                The spikes in temperature and humidity and disturbed pendulum at about 16000 ticks coincide with cooking the evening meal. Lots of crashing in the adjacent kitchen.

                                Temperature drops overnight, and rises suddenly at about 48000 ticks when the central heating fired up. It's timed to stay on for two hours, after that the workers depart and I put on a jumper. Presumably humidity responds to the central heating. Condensation aficionados will note the burst of warmth caused humidity to rise, which will deposit water onto any handy cold surfaces.

                                There's a hint the rolling average period may be following barometric pressure. Unconvincing.

                                The gradually worsening turbulence starting at about 18000 ticks is the most obvious defect. My guess is it's due to the pendulum being over-impulsed.

                                Back home after today's outing, I moved the pendulum, Arduino, and Raspberry onto my garage workbench. Much sturdier than my dining table, no sunlight, cat-proof, and I kept my distance. Result after first 5 hours:

                                garage1210.jpg

                                Points of interest:

                                • The average period changed! 878225µS up to 879965µS (about 1.4mS)
                                • Rolling average in the first graph-set falls, while that in the second rises. (I think a much longer run is needed.)
                                • Standard Deviation is much better in the garage: 144.6 vs 922.3 in the house.

                                The bounce at the end (22000 ticks) is due to me disturbing the clock whilst reinserting the Wifi Dongle; the signal isn't too good in the garage.

                                Dave

                                #500234
                                John Haine
                                Participant
                                  @johnhaine32865

                                  Interesting! Just to note that the sensitivity to barometric pressure is usually pretty low. The Arduinome at the moment is showing about 0.4 microseconds/mbar over several months logging covering a wide pressure range. The value is mainly a function of the bob density.

                                  #500381
                                  SillyOldDuffer
                                  Moderator
                                    @sillyoldduffer
                                    Posted by John Haine on 08/10/2020 18:28:29:

                                    Interesting! Just to note that the sensitivity to barometric pressure is usually pretty low. The Arduinome at the moment is showing about 0.4 microseconds/mbar over several months logging covering a wide pressure range. The value is mainly a function of the bob density.

                                    Agreed, and also not sensitive to temperature and humidity. I've added correlations to the data analysis and whatever my pendulum is reacting too, it's not the obvious. (I think the matrices below mean almost no correlation between period and the sensor data.

                                    Latest graphs:

                                    duff1932.jpg

                                    The glitch at 57511 ticks in the rolling average was due to me entering the garage, turning the light on, and finding a screwdriver.

                                    Statistics:

                                    Period Statistics from ardlog1932.dta with 83957 samples
                                    Median 879952.0
                                    Average 879941.7
                                    STDEV 459.97
                                    Minimum 878484.0
                                    Maximum 881400.0
                                    Correlations (Pearson)
                                    Period and Temperature
                                    [[1. 0.00202627]
                                    [0.00202627 1. ]]

                                    Period and Air Pressure
                                    [[1. 0.10235348]
                                    [0.10235348 1. ]]

                                    Period and Relative Humidity
                                    [[ 1. -0.08289992]
                                    [-0.08289992 1. ]]

                                    Again the outstanding feature is the pendulum running wild, I assume because it's getting closer to the electromagnet. I'll experiment tomorrow with reducing the impulse, but an amplitude sensor is probably needed.

                                    Misleading the public is always an option. In this version of the graphs, Rolling Average is on the same scale as Variation. Now the data looks much better!

                                    duff1932scaled.jpg

                                    Have I invented a wonderful new clock? The evidence suggests I'm on a sticky wicket unless I can stop the bob going mad. It's sensitive to light and vibration and I still haven't measured 'Q', which is expected to be low. Apart from that, it's marvellous!

                                    One good thing; carbon fibre is standing up well as a rod material.

                                    What I'd like to achieve is a much more stable pendulum where period does correlate to atmospheric pressure. Still lot's to do.

                                    Dave

                                    #500387
                                    John Haine
                                    Participant
                                      @johnhaine32865

                                      "Misleading the public is always an option. " Verging on the political, Dave!

                                      As a matter of interest, what software do you use for that analysis? I'm using R Studio, which is free and wonderful but tricky to drive. I used to use Excel but ran out of rows…. (Oops, I'm getting political now!)

                                      #500403
                                      SillyOldDuffer
                                      Moderator
                                        @sillyoldduffer
                                        Posted by John Haine on 09/10/2020 17:22:17:

                                        "Misleading the public is always an option. " Verging on the political, Dave!

                                         

                                        As a matter of interest, what software do you use for that analysis? I'm using R Studio, which is free and wonderful but tricky to drive. I used to use Excel but ran out of rows…. (Oops, I'm getting political now!)

                                        Very embarrassing to run out of rows whilst using Excel!

                                        I'm using python3 with numpy to do the analysis and matplotlib to draw the graphs. All available free for Windows, Mac & Linux. The program is:

                                        clockpy.jpg

                                        (Source can be emailed if it's useful.)

                                        Most of the complexity is drawing the graphs, hiding axes and so on.

                                        The number crunching is more straightforward with numpy, for example

                                        1. period, actual, avg, temp, rHum, pressure = 0, 1, 2, 3, 4, 5 # column numbers
                                        2. data = np.loadtxt( fileName, delimiter=' ' )
                                        3. average = np.average( data[:,period] )

                                        Line 1 allocates meaningful names to the array columns

                                        Line 2 loads a 2D-array called data from the filename, which is a text file. Line contains data as per line 1, each value separated by a space. By default double precision floats are used, many other options.

                                        All my calculations are done with this one array, but I could have several.

                                        Line 3 does the heavy lifting. The array is addressed [row:column] so data[ : period] means 'all the rows in the period column'. np.average() does what it says on the tin, in this case averaging the column.

                                        The other unusual syntax is python3 format strings, for example:

                                        f"Average {average:.1f}" It creates a formatted string from whatever is between the quote marks.

                                        {average:.1f} means "insert the value of the variable average and display it as floating point to one decimal place."

                                        Dave

                                         

                                        Edited By SillyOldDuffer on 09/10/2020 18:52:16

                                        #500456
                                        Joseph Noci 1
                                        Participant
                                          @josephnoci1

                                          Dave, Perhaps you have seen this already – if not, it may be of interest?

                                          VE2ZAZ Pendulum control

                                          Joe

                                          #500507
                                          SillyOldDuffer
                                          Moderator
                                            @sillyoldduffer
                                            Posted by Joseph Noci 1 on 10/10/2020 06:44:17:

                                            Dave, Perhaps you have seen this already – if not, it may be of interest?

                                            VE2ZAZ Pendulum control

                                            Joe

                                            Thanks Joe, I hadn't seen Bertrand's work. It is interesting, though not directly – I'm exploring a springy carbon fibre whereas he used wood and a hard drive bearing. Re-purposing a hard-drive hadn't occurred to me, but they're a super source of high-tech mechanics.

                                            Have to admit I'm awash with new information and having trouble taking it all in. Three books, plus a couple of John Haine papers on the relationship between Q and pendulum frequency stability. To say the maths is a challenge is an understatement!

                                            Keep it coming though, all contributions are grist to the mill,

                                            Ta

                                            Dave

                                            #500510
                                            SillyOldDuffer
                                            Moderator
                                              @sillyoldduffer

                                              Today's graphs are more of the same – the pendulum is swinging ever more wildly. Whether that's the sole cause of the average period shifting is unknown. It's not right.

                                              garage38hrs.jpg

                                              Rather than stop the experiment, I'm going to move the magnet about 1mm further away – my lash-up makes this easy. Then see what effect that has on the period. I predict it will settle, less wild, but anything could happen…

                                              Dave

                                              #500513
                                              SillyOldDuffer
                                              Moderator
                                                @sillyoldduffer

                                                Disaster! Moving the electromagnet fouled the IR wires enough to pop the sender LED out of it's socket. Reseating the LED, my sleeve caught the clamp stand and moved the electromagnet about 10mm so I had to guess where it came from. As the adjustment isn't from a known base the experiment has to be repeated. Maybe I should take up knitting.

                                                crying

                                                Dave

                                                #500525
                                                Peter Bell
                                                Participant
                                                  @peterbell11509

                                                  At least you didnt knock it over Dave, thats my normal trick!

                                                  Dont want to detract you but perhaps someone can help?

                                                  I would like to do some analysis on my simple clock (posted 9/9/20 doesnt time fly!) but your setup is way beyond me, is there any easy software I could use to plot my 1/2 sec pulses to give something like period variations?

                                                  Thanks Peter

                                                  #500541
                                                  SillyOldDuffer
                                                  Moderator
                                                    @sillyoldduffer

                                                    Posted by Peter Bell on 10/10/2020 12:55:34:.

                                                    …is there any easy software I could use to plot my 1/2 sec pulses to give something like period variations?

                                                    Thanks Peter

                                                    What operating system do you have Peter? If period is already being calculated by your Arduino, no problem Serial.println()ing it.

                                                    Unfortunately the Arduino IDE's serial monitor doesn't allow data to be saved to a file, but many other terminal emulators can do the needful. I use GtkTerm on Ubuntu, Hyperterm was free on Windows but you have to buy it now. YAT should do the job – I've not tried it. Others available.

                                                    Once the data is in a file, almost any spreadsheet should be able to import the numbers and draw the period variation graph. LibreOffice is free. Have a go, shout if you get stuck.

                                                    Dave

                                                    #500549
                                                    John Haine
                                                    Participant
                                                      @johnhaine32865

                                                      You can select all / copy the contents of the Arduino serial monitor window. Place your cursor in the window and click; then do a very rapid ctrl+A / ctrl+C – then you'll see the text briefly highlighted – then switch to a text window and paste the data into it. If you just do a print of anything each time a swing is detected the monitor timestamp will provide the time. The only problem is that the each record is a text string, and you have to parse the string to extract the actual numbers. I can provide some Excel for that.

                                                      For Windows there is an excellent serial terminal program called Termite which is particularly easy to use.

                                                    Viewing 25 posts - 126 through 150 (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