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 - 151 through 175 (of 307 total)
  • Author
    Posts
  • #500578
    John Haine
    Participant
      @johnhaine32865

      Update to that – it's much easier if you turn off autoscroll on the window, you can select/copy at leisure.

      Advert
      #500580
      Peter Bell
      Participant
        @peterbell11509

        Many thanks for the replies. Before I can do anythingI need to do is move my clock from the workshop near to where the pc lives, easier said than done, working on it but other things are to do first!

        What I was hoping was extract the timings from the bdc sensor negative going pulse in the blue trace and see the speeding up and slowing down of the pendulum as the actuating coil switches. I've got a Microset and sensors, nice bit of kit but never had much success with it.

        Peter

        missing pulse.jpg

        #500626
        John Haine
        Participant
          @johnhaine32865

          Another approach is to log the time on a Pi next to the clock, and VNC into the Pi over WiFi from the PC to extract the data.

          When you say "speeding up and slowing down", do you mean the increase in amplitude? It may be hard to resolve the negative going pulse amplitude well enough to see the amplitude change with a Microset which has a resolution of 10 us I think (i.e. 100 kHz clock). I measure the opto pulse length using a "picPET" witha 10 MHz clock and you can easily see the amplitude and phase change when the clock is impulsed. You may have better luck using the "offset sensor" method of amplitude measurement with the Microset (described on Mumford's website I think).

          #500661
          Michael Gilligan
          Participant
            @michaelgilligan61133

            I have just found a fascinating paper about Galileo’s pendulum experinents: **LINK**

            http://www.pitt.edu/~pap7/A%20Phenomenology%20of%20Galileos%20Experiments%20with%20Pendulums%20with%20Supporting%20Document.pdf

            Fig. 7 and the discussion about latent modes might be relevant to the behaviour of Dave’s flexing carbon rod.

            MichaelG.

            #500664
            Michael Gilligan
            Participant
              @michaelgilligan61133

              Also found this little gem : **LINK**

              http://articles.adsabs.harvard.edu/cgi-bin/nph-iarticle_query?1957SvA…..1..637F&classic=YES

              Button at bottom left should download all eleven pages as a PDF

              MichaelG.

              #500725
              SillyOldDuffer
              Moderator
                @sillyoldduffer
                Posted by Peter Bell on 10/10/2020 17:40:30:

                What I was hoping was extract the timings from the bdc sensor negative going pulse in the blue trace and see the speeding up and slowing down of the pendulum as the actuating coil switches. I've got a Microset and sensors, nice bit of kit but never had much success with it.

                Peter

                Should be possible, the manual says 'Both versions of MicroSet can be plugged into a personal computer to capture beat times for later analysis and study. This allows you to see how a clock’s rate varies over time, and to evaluate trends in these fluctuations that can help you diagnose problems and understand erratic behavior. You can also use the computer to create graphs of rate changes, or collect many periods and calculate an average rate over hours or days.'

                Sadly the manual is coy about exactly what data format is sent to the computer and the detail of their optional software's features. (Traditional measuring functions are explained, which is probably enough for most users.)

                Probably easier to modify the software on your clock's Arduino to output periods to the USB, and then use Termite and Excel (or similar) to analyse it.

                Dave

                #500982
                SillyOldDuffer
                Moderator
                  @sillyoldduffer

                  Today's graphs show the improvement made by moving the electromagnet further away from the bob. The bob isn't swinging ever more wildly and Standard Deviation has dropped from 637 to 39.4, much better. Might be some correlation between period and barometric pressure too, though 0.34 is far from convincing.

                  magnetmoved49.jpg

                  Not known what caused the odd bump at about tick 95750 (approx 12:45am) where the period suddenly increases. It doesn't correspond to temperature, pressure or humidity. Possibly a heavy lorry passing outside or a gust of wind got past the loose fitting garage door. Zooming in doesn't help:

                  zoom49.jpg

                  Bugs detected: 450 records of 200,000 were deleted manually from the log because the relative humidity sensor occasionally returns NaN (not a number), which upsets loading data from the log file.

                  Improvements: better for the log file to record real time as well as tick times.

                  Next steps. Test code changes to log real time and fix humidity sensor misreads. Add code to measure Q. Upgrade the mechanics so the shield can be fitted, and an amplitude detector so impulses can be reduced further.

                  Dave

                  #501007
                  Michael Gilligan
                  Participant
                    @michaelgilligan61133
                    Posted by SillyOldDuffer on 12/10/2020 14:12:56:

                    .

                    […] Zooming in doesn't help:

                    zoom49.jpg

                     

                     

                    .

                    Have you read that Galileo reference that I linked, Dave ?

                    MichaelG.

                    Edited By Michael Gilligan on 12/10/2020 16:33:53

                    #501109
                    SillyOldDuffer
                    Moderator
                      @sillyoldduffer
                      Posted by Michael Gilligan on 12/10/2020 16:18:35:

                      Posted by SillyOldDuffer on 12/10/2020 14:12:56:

                      .

                      […] Zooming in doesn't help:

                      zoom49.jpg

                      .

                      Have you read that Galileo reference that I linked, Dave ?

                      MichaelG.

                      I have, and very interesting it is too. I don't recall seeing a description of how Galileo got results before, and recreating the conditions was revealing. Galileo was clever!

                      Whether I understood it is another question. Far more to pendulums than I remember from School Physics.

                      Reading Fedchenko too, another cracker. Trouble is I have to read anything remotely difficult at least twice and take notes. Takes ages.

                      Dave

                      #501126
                      Michael Gilligan
                      Participant
                        @michaelgilligan61133

                        Posted by SillyOldDuffer on 13/10/2020 10:58:50:

                        […]

                        Far more to pendulums than I remember from School Physics.

                        […]

                        .

                        Not trying to nudge you into little-charted territory, Dave .. [ O.K. perhaps I am ] angel

                        but I do think the discussion about latent modes might be directly relevant to the behaviour you are seeing.
                        … the frequencies will be much higher in your short carbon ‘rope’ but the underlying concept is there.

                        MichaelG.

                        #501164
                        duncan webster 1
                        Participant
                          @duncanwebster1

                          Way back in the mists of time JARadford (I think) had an article in ME about an electrically impulsed clock where instead of impulsing the bob he moved the top pivot from side to side, when the bob got to extreme left, the pivot flicked to the right and vice versa. I can see how this would work, but I wonder what effect it had on time keeping. Unfortunately I can't find the article

                          #501166
                          SillyOldDuffer
                          Moderator
                            @sillyoldduffer
                            Posted by Michael Gilligan on 13/10/2020 11:52:16:

                            Posted by SillyOldDuffer on 13/10/2020 10:58:50:

                            but I do think the discussion about latent modes might be directly relevant to the behaviour you are seeing.
                            … the frequencies will be much higher in your short carbon ‘rope’ but the underlying concept is there.

                            And as if by magic latent modes may well explain this graph, taken last night after reassembling the clock on my dining table to upload & test the software upgrade:

                            latents.jpg

                            Just flung together to make the clock run with no attempt to level it or adjust the electromagnet. Had to replace the pendulum rod again due to clumsiness. Red line is the average and the orange line is the rolling average. Pendulum in blue, and not only are the spikes fairly regularly spaced, they trace a wave along the top. Zooming in on one of the humps confirms symmetry:

                            latentsymmetry.jpg

                            My guess is the electromagnet was twanging the pendulum rod and the bob was swinging elliptically. I was concentrating on the computer upgrade and didn't look, shame.

                            Clock in bits while I redesign the magnet holder. Could take a while because I can't run the 3D printer without tidying up first.

                            Dave

                            #502133
                            SillyOldDuffer
                            Moderator
                              @sillyoldduffer

                              Latest report, I've not been idle. Mk2 upgrade now operational and been the target of much experimentation. Physically the clock has a new electromagnet holder, with the magnet fixed to one side and the wiring has been routed to allow the shield to be mounted, but not evacuated yet.

                              dsc06326.jpg

                              Software upgrades include a general tidy-up, auto start, determination of amplitude and a primitive amplitude regulator.

                              Experimentation focussed on when best to trigger the impulse. The idea was to minimise the amount of disturbance by minimally pulsing the magnet close to top of swing. Although the software allows me to impulse the bob at any time, working out exactly when is a little difficult. Thanks to Michael, Duncan and John I put this diagram together. (First attempt at this involved extrapolating a sine wave from the circle, but this is clumsy and unnecessary. Woodward's "My Own Right Time" describes the method in the chapter on Disturbed Harmonic Motion, which I read after painfully re-inventing the wheel. Woodward calls it a Phase Diagram.)

                              mk2timing.jpg

                              The time taken by the pendulum to move between any two points can be found. It takes about 0.883mS for the pendulum to swing from one side to the other in back, which is 360° around the circle. The horizontal line represents the distance travelled by the pendulum; mine swings about 4°. Could be graduated in millimetres. Anyway, my beam break sensor is mounted about 1.5° off swing centre. This corresponds to an angle of about 112° from extreme right so:

                              time from right to sensor = 112/360 * 0.883 = 0.27mS

                              So if I decide to fire the impulse when the pendulum is at -3.5°, the Phase Diagram shows this to be 39° past sensor, or 39/360 * 0.883 = 0.096mS. The analysis reveals a problem: the maximum pulse must fit into the time between 'fire' and 'left'. Fussy to set-up.

                              By analogy I expected the pendulum to behave like a child's swing. There would be a resonance. However, impulsing at various times between 'sensor' and 'left', failed to find a sweet spot. I believe the analogy is false: the amount of energy needed to overcome losses and keep the bob swinging is constant. Further, provided the bob is travelling towards the magnet, it doesn't matter when the impulse is applied. As theory suggests the bob should be impulsed when it's travelling at maximum speed (centre), it's best to pulse at sensor as soon as the beam is broken. Doing this also eliminates any need for complicated timing calculations.

                              Although the magnet holder could be modified to hold the beam breaker sensor at 'centre', I decided to leave it offset. This is based on another unproven notion, which is that changes in amplitude can be detected by comparing the time spent by the bob on each side of the sensor. I believe time spent left of my offset sensor decays faster than time spent right of it. So the mark space ratio can be used to detect if amplitude is increasing or decreasing, and used to regulate impulse strength. A high-amplitude pendulum is closer to 50:50 than this example:

                              amplitude.jpg

                              Last night's test run is promising, and has spawned some new ideas. The clock is on the dining table in my south facing radiator about 1m away from the window and central heating radiator. Shield off.

                              mk2firstrun.jpg

                               

                              Weakish correlations are detected between period and both humidity and temperature. There's a major disturbance just after 7am. My first thought was it's due to temperature resulting from my central heating firing up. However, as I've had bother with the beam breaker sensor, I think it's more likely to be daylight. The vertical blue and red lines show civil twilight and sunrise respectively. I suspect increasing light falling on the sensor alters the impulse trigger point.

                              My simple amplitude regulator is akin to the hit and miss device used on old single cylinder oil engines, and amplitude gradually decaying overnight shows it's not quite set right. A more linear algorithm would help, but I need to re-test with the shield in place first. Also, an IR level sensor should be added to log ambient brightness.

                              Dave

                              Edited By SillyOldDuffer on 19/10/2020 12:22:17

                              #502158
                              John Haine
                              Participant
                                @johnhaine32865

                                Good progress Dave.

                                I assume your time units are seconds, not ms? To be pedantic, the "phase diagram" plots velocity vertically, the units being scaled so it is a circle, and normally rotation is taken to be anticlockwise.

                                You can measure amplitude using an offset sensor as you suggest – this link describes how but refers also to a copy of HSN where the method was first described. I do something slightly similar though my main reason for using an offset is so the Arduino "knows" which side the pendulum is.

                                #502163
                                Michael Gilligan
                                Participant
                                  @michaelgilligan61133

                                  Keep up the good work, Dave

                                  … Meanwhile: I have been trying [and inevitably failing] to tidy-up the Toy Room

                                  blush

                                  MichaelG.

                                  #502303
                                  SillyOldDuffer
                                  Moderator
                                    @sillyoldduffer

                                    More progress. Running the clock shielded eliminated nastiness caused by the rising sun, and improved amplitude control much reduces bob jitter. (The algorithm allows amplitude to settle naturally at whatever level requires least change: the bob isn't forced to maintain a particular amplitude.)

                                    shielded.jpg

                                    Although the graphs show turbulence when the heating comes on and people crash about in the morning, the effect on period is much lower than when the IR sensor was being lit up by the sun too.

                                    Sunshine eliminated, there is detectable negative correlation between air pressure and period, and a much stronger negative correlation between temperature and period. Temperature correlation was a disappointment until I realised the link may be due to the Arduino's uncompensated crystal oscillator rather than the carbon fibre pendulum rod. Another point to be proved.

                                    Looking at the stats:

                                    shieldedtext.jpg

                                    The pendulum is 6.7 seconds fast over 15 hours compared with a DS3621 Real Time Clock, which claims ±2ppm accuracy over my test temperature range.

                                    The Arduino reports ticks averaging 865248µS, whereas to match the RTC they should be 865144µS. This error could be due to the uncalibrated Arduino. (Another proof required!)

                                    The spikes at tick 9000 and those after tick 58000 are due to me wobbling the dining table. The pendulum's sensitivity to vibration is a serious flaw.

                                    Now the clock is running reliably next job is to measure Q. At last. Bet it's low.

                                    Dave

                                    #502308
                                    John Haine
                                    Participant
                                      @johnhaine32865

                                      One way to get a more precise calibration is to get the Arduino to do a println(something) on each swing and log this with the serial monitor on a PC which has its internal clock slaved to NTP. For example my Ubuntu laptop (which I don't mind dedicating to the task) gives a high resolution timestamp on each record, which you can copy/paste into Excel (or other) for analysis. (This is easier if you switch off autoscroll.)

                                      #503044
                                      SillyOldDuffer
                                      Moderator
                                        @sillyoldduffer
                                        Posted by John Haine on 20/10/2020 17:07:30:

                                        One way to get a more precise calibration is to get the Arduino to do a println(something) on each swing and log this with the serial monitor on a PC which has its internal clock slaved to NTP. …

                                        I'll give that a try thanks.

                                        Latest report. I measured Q. Between 80 and 140, which is dreadful! The implication is my carbon fibre pendulum is a spring, and not a good one either. As the problem is almost certainly the matrix rather than the fibre, I experimented with removing it. No luck with chemicals but a blowlamp does the job. Although carbon might be expected to catch fire, it glows white hot in a reducing flame and survives.

                                        dsc06327.jpg

                                        The Mk3 clock will suspend the rod by clamping the fibres at one end, allowing the pendulum to swing on a short length of them. Fingers crossed, removing spring from the rod at the suspension point should improve Q.

                                        I was able to get a feel for the stability of the Arduino's clock relative to accurate seconds from a GPS module by using micros() to measure the time taken between the rising edges of GPS second pulses. One Arduino Nano measures the second as about 1001400 microseconds, the Nano in my pendulum clock is closer – it averages 1 second as 1000090.4 microseconds. Nanos are clocked by Ceramic Resonators, only about ±0.5% accurate and temperature sensitive.

                                        The rig makes it easy to test for correlation between frequency and temperature. The graphs clearly show the relationship with mirror image curves and the Pearson Correlation is -0.962, where 1 is identical.

                                        xtaltempstability.jpg

                                        Would be a result except there's no correlation between Period and Temperature!

                                        Also been looking into Allan Deviation and Variation. Thick fog ahead!

                                        Dave

                                         

                                         

                                        Edited By SillyOldDuffer on 23/10/2020 21:28:38

                                        #503065
                                        Sam Stones
                                        Participant
                                          @samstones42903

                                          Apologies if this is old hat Dave (SOD).

                                          I haven't been taking much notice of your thread, but I spotted this from Big Clive.

                                          **LINK**

                                          I trust it has some relevance.

                                          Regards,

                                          Sam

                                          #503068
                                          Michael Gilligan
                                          Participant
                                            @michaelgilligan61133
                                            Posted by SillyOldDuffer on 23/10/2020 21:26:53:

                                            Latest report. I measured Q. Between 80 and 140, which is dreadful! The implication is my carbon fibre pendulum is a spring […]
                                            Fingers crossed, removing spring from the rod at the suspension point should improve Q.

                                            .

                                            Learning has been seen to take place

                                            MichaelG.

                                            #503074
                                            duncan webster 1
                                            Participant
                                              @duncanwebster1

                                              According to bob shape best shape for a bob is like a pointed rugby ball. Difficult to keep the point going in the direction of swing with SOD's rod, next best is spherical. Dense is good, so tungsten or copper/tungsten alloy, which is machine-able. According to wikipedia tungsten is magnetic, not sure about the alloy

                                              I suggest the best approach to the stranded rod is to cut away a lot of the fibres then splay the remainder out like a ribbon. This will prevent fibres rubbing on each other and dissipating energy, I think a well known French clock (Bulle?) had a silk ribbon suspension

                                              Edited By duncan webster on 23/10/2020 23:52:32

                                              Edited By duncan webster on 24/10/2020 00:12:40

                                              Edited By duncan webster on 24/10/2020 00:14:25

                                              #503081
                                              Werner Schleidt
                                              Participant
                                                @wernerschleidt45161

                                                Hello Dave,

                                                is your arduino cristal temperature compensated ? I have an electronic watch programmed for switch purpose of my central heating and i noticed time differences over temperature.

                                                Werner

                                                #503082
                                                Mike Poole
                                                Participant
                                                  @mikepoole82104

                                                  That must be annoying having your central heating come on few microseconds off target timelaugh

                                                  Mike

                                                  #503102
                                                  Joseph Noci 1
                                                  Participant
                                                    @josephnoci1
                                                    Posted by SillyOldDuffer on 23/10/2020 21:26:53:

                                                    Posted by John Haine on 20/10/2020 17:07:30:

                                                    Also been looking into Allan Deviation and Variation. Thick fog ahead!

                                                    Dave

                                                    Been there, still there, and the more I learn the more I realise that mostly I learn how little I know…

                                                    My GPSDO, which was to be an 'accurate' 10MHz reference for my frequency counter and signal generator, has since taken over my life and become the prime focus…Accuracy of 10-9 was easy to achieve, 10-12 took more effort and 10-13 has been seen…But all in the confines of my own mind, so how to measure and prove. Google a lot, read lot, and join the TimeNuts forums, and then you are done for…Allen Deviation becomes the Holy Grail, and when you go down that road, you end up being a collector of all things that oscillate..As in all things, to measure accurately , the ruler ( or reference oscillator) has to be better than the thing being measured. So now I am collecting Expensive surplus OCXO's, trying to find 'reasonable' Rubidium references, and have contracted the TimeNuts disease..the subsequent cure for which seems to be a whole room dedicated to housing shelves filled with oscillators, frequency counters, Rubidium, Cesium and Hydrogen Maser references…

                                                    And it does not stop just with the oscillator – now it degenerates to wrestling with the air conditioning and climate control of the study ambient, studies into ambient temp control within a chamber that I could fit the oven controlled oscillator into, etc. And all this time, I still cannot use the GPSDO as a reference for my counter, cause the GPSDO is always in bits for some or other refinement..I need a Hobby..

                                                    The one major discovery has been where the 'Nuts' comes from in the Forum name..

                                                    Sorry, nothing to add that helps you Dave, but beware of the road ahead!!!

                                                    Joe

                                                    #503108
                                                    John Haine
                                                    Participant
                                                      @johnhaine32865
                                                      Posted by SillyOldDuffer on 23/10/2020 21:26:53:

                                                      Posted by John Haine on 20/10/2020 17:07:30:

                                                      One way to get a more precise calibration is to get the Arduino to do a println(something) on each swing and log this with the serial monitor on a PC which has its internal clock slaved to NTP. …

                                                      I'll give that a try thanks.

                                                      Having made the suggestion, I find that I can get strange results! I thought I had an odd phenomenon where every few seconds the period was significantly slower, but I think this is actually because at the time I had a couple of extra apps open on the Linux PC, one being a web browser (for uploading files to Google Drive) – I thing this was inserting occasional delays into the reported timestamp. Just monitoring time on the dial and comparing with "real" time there's no trace of this. I've used the technique before and found it fine (including on a Pi) so the lesson is to have the only the bare minimum running concurrently.

                                                      Latest report. I measured Q. Between 80 and 140, which is dreadful! The implication is my carbon fibre pendulum is a spring, and not a good one either. As the problem is almost certainly the matrix rather than the fibre, I experimented with removing it. No luck with chemicals but a blowlamp does the job. Although carbon might be expected to catch fire, it glows white hot in a reducing flame and survives.

                                                      I think you need a lot more bob mass! Q is omega x M / k where k is the resistance factor. k goes up as bob size squared roughly, M as size cubed.

                                                      The Mk3 clock will suspend the rod by clamping the fibres at one end, allowing the pendulum to swing on a short length of them. Fingers crossed, removing spring from the rod at the suspension point should improve Q.

                                                      Carbon fibres look like an interesting suspension material provided they don't fracture where they are clamped, since I think most of the bending will be close to the clamp because of their very low bending modulus. Intereesting to see your results.

                                                      …………..

                                                      Also been looking into Allan Deviation and Variation. Thick fog ahead!

                                                      Dave

                                                      Allan Deviation / Variance are useful once you have the clock going pretty stably I think. If you want to assess sensitivity to temperature etc then multivariate linear regression is the best tool. Excel has linear regression, and will do multivariate though it's badly documented, but you can soon run out of rows. Best tool by far is R Studio. For Allan Variance have you come across TimeLab ?

                                                      Edited By SillyOldDuffer on 23/10/2020 21:28:38

                                                      Sorry for the unconventional reply format above!

                                                      Werner, the Arduino as Dave says doesn't even use a crystal let alone a temperature compensated one!

                                                    Viewing 25 posts - 151 through 175 (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