Another Arduino-controlled pendulum clock

Advert

Another Arduino-controlled pendulum clock

Home Forums Clocks and Scientific Instruments Another Arduino-controlled pendulum clock

Viewing 25 posts - 26 through 50 (of 63 total)
  • Author
    Posts
  • #512107
    John Haine
    Participant
      @johnhaine32865
      Posted by Michael Gilligan on 04/12/2020 17:38:50:

      Looking good, John

      … any idea what caused those two anomalous bumps ?

      MichaelG.

      Another cause I should have mentioned is the corrections applied by the Arduino, which nominally allow the clock to get a second ahead and then skip a second. The photos are taken asynchronously to this so it introduces another apparent observation error. My goal is to have the clock being within a second or two of real time without adjustments over a long period.

      Advert
      #517625
      Peter Bell
      Participant
        @peterbell11509

        Inspired by John's clock I eventually got round to trying the simple Arduino based driver which is described earlier in the other thread on a simple pendulum left hanging from a previous failed compound pendulum experiment. It has a an ironless wound core and the pendulum rod swinging over it has a small powerful magnet attached to the end. Pic below shows it swinging, nothing connected all as per the pic in the original article.

        jw-1 4-1-21.jpg

        I used the sketch intact from the link and the pendulum worked first time, swinging away nicley, very pleasing. However after leaving it for a while when I went passed I could hear knocking with the pendulum swinging wildly. The knocking turned out to be the top suspension rod hitting the suspension bracket, not good.

        Put the scope on again and I could see multiple actuations from the coil. The pulse width was set at 30ms but I could see 5 x 30ms = 150ms, no wonder it was going a bit wild.

        simple -3 5-1-21.jpg

        Tried various settings on the sketch also playing with the limiting resistor which improved things. I realised that the multiple pulses were caused by the threshold voltage being seen on the rising part of all the cycle so modified the sketch slightly and its now on got one 30ms pulse and seems very happy. The pendulum duration is around 3/4 secs.

        Peter

        simple -1 5-1-21.jpg

        #517647
        John Haine
        Participant
          @johnhaine32865

          Peter, in order to prevent spurious impulses, after the "proper" impulse I keep the driving output from the Arduino low until just before the next zero crossing, then switch it to an input. This means that all inputs from the coil are suppressed when there shouldn't be any. I also have amplitude control.

          #517658
          Peter Bell
          Participant
            @peterbell11509

            John, Yes I have a similar arrangement but also enabled pin 13 on and off to flash as the Arduino is remote from the pendulum, can see its working—very much work in progress! I thought of simple amplitude adjustment by using selective resistor if needed. The original sketch is a very neat arrangement, would have liked to sample something to give amplititude control as on my other clock but cannot think of a way at the moment without adding another sensor which I dont want to do.

            I deliberatly left the rod length short for a 1 sec beat as I was going to use the compound part to adjust it to 1 sec or more, think its about 0.75 secs now but needs reworking to make a double suspension spring arrangement to give it enough stability .

            #518342
            John Haine
            Participant
              @johnhaine32865

              Latest timekeeping results.

              clock_8january21.jpg

              This shows readings over the past 10 days since setting the two correction counters to 132 and 92. One odd thing I've seen is that every time I upload new software with changed counters, even though the clock doesn't actually stop swinging it takes quite a long time (days) to settle down. In the plot above the blue error curve was steadily increasing but the rate of increase seeming to flatten off, so 3 days ago I reset the seconds hand (just using the control switch which inhibits dial impulsing, removing 24 seconds of accumulated error. Since then the error has built up to 2 sec, but this includes some due to my accidentally jogging my desk (the clock sits on the desk in my study). The clock has a "half-second" pendulum so the SW divides by two to drive the dial, and normally you see the dial advance on the same half-swing each time, in this case it was L->R. But then I stood up yesterday and accidentally jogged the desk since when it has been incrementing on R->L, so I think there's been at least a half-second extra input to the displayed time and possibly more as the pendulum settled down. I also display the temperature at the time of the reading, I'm not convinced that there is any obvious correlation but haven't yet done a regression analysis. Ignore the grey line. Anyway, I think the regulation is getting there, and I already rely on the clock when I just want to quickly know the time.

              #518343
              John Haine
              Participant
                @johnhaine32865

                jh5_schematic.jpg

                In case anyone is interested here is the schematic.

                #518417
                SillyOldDuffer
                Moderator
                  @sillyoldduffer
                  Posted by John Haine on 08/01/2021 10:19:36:

                  Latest timekeeping results.

                  … One odd thing I've seen is that every time I upload new software with changed counters, even though the clock doesn't actually stop swinging it takes quite a long time (days) to settle down.

                  … this includes some due to my accidentally jogging my desk (the clock sits on the desk in my study). …

                  I've got both problems too. My pendulum is very sensitive to jogging, and, after a restart, it misbehaves for at least 4 hours. Some evidence in the longer runs that it becomes more stable after a couple of days but I've not had mine running long enough yet to prove the pendulum settles. Or gets worse! MichaelG suggests my carbon-fibre rod will develop fatigue cracks at the suspension point, and I think he's right.

                  Dave

                  #518430
                  Alan Wood 4
                  Participant
                    @alanwood4

                    I have converted my William Smith Gearless Gravity Arm clock from mechanical reset to electronic reset.

                    I have a HED clocked at mid swing from a small magnet on the pendulum. After a programmable number of swing counts a solenoid repels a second larger magnet on the pendulum (at right angles to the swing magnet) to give the pendulum a kick. If left to its own devices the swing amplitude would incrementally increase so a second HED detects an overswing situation and inhibits the swing counter until the swing diminishes. Control is battery powered via an Arduino Mini where I can program swing counts between resets and solenoid reset pulse duration and pulse / pendulum synchronisation.

                    Pendulum kicks occur around once per minute otherwise the pendulum is left to its own devices and free swings. Monitoring the timekeeping on my Microset Timer suggests a few seconds per day accuracy which is more than enough as a display device. It is also much quieter than the anti social clunk of the old mechanical gravity arm reset.

                    Bill would not have been impressed but even his wife said she hated the design because of the noise it made. As a result it was forever forbidden from running anywhere in the house but Bill's workshop wall. My wife echoed Judy's sentiments and the modifications have granted a reprieve.

                    #518476
                    John Haine
                    Participant
                      @johnhaine32865

                      Alan, that's very interesting that you're using the Mini – what batteries do you use and how long does it run please?

                      #518545
                      Alan Wood 4
                      Participant
                        @alanwood4

                        Hi John

                        I am using the Pro MIni on a 3V3 supply (it is a 3v3/8MHz version) which is derived from a MCP1703-3302 LDO regulator. The Mini on board LEDs have been disabled. The board overall is supplied with 12V from a Super Polymer Lithium 5AHr battery and this is stabilised at 10V in a LM29371 LDO to feed the solenoid. This stabilises the solenoid pulse and this is the main battery consumption. I am getting something like 6 months battery life.

                        I have LEDs to indicate swing, overswing, pulse delay and pulse status but these can all be disabled via the Mini to save current. The Mini provides a low battery signal via one of its analogue ports.

                        Since getting this modification to the clock up and running the Seeeduino Xiao has appeared on the scene which is smaller than the Mini and alleges less current consumption. It claims lots of ports but they are multi use so the net number of pins is limited. If I did away with my status LEDs I could probably use it instead.

                        The Xiao uses the Arduino IDE for programming but we have had problems talking to it with Win 7 but Win10 is fine. This related to the USB driver and we seem to have sorted this now. Seeed were not very supportive hiding behind the 'Win 7 is no longer supported' banner. This seemed a bit short sighted given that most experimenters use 'that old laptop under the bench' that is still on Win7.

                        The Xiao is very low cost ! Have a look at DroneBot's Youtube or his .COM blog site if you want a quick overview.

                        I can send you more details of my board if it is of interest.

                        Alan

                        #519183
                        Peter Bell
                        Participant
                          @peterbell11509

                          My pendulum seems to be happily running and its coming out at around 0.8 sec/ swing.

                          Not sure if I should be asking this but here goes! Its a mild steel rod and bob in free air.

                          If I wanted to get some simple data from it s rate would it need to beat seconds?

                          What would equipment would I need to do this?

                          Dont have a PC in the workshop.

                          Peter

                          #519356
                          John Haine
                          Participant
                            @johnhaine32865

                            Peter, you can get an approximate idea by using the Arduino itself. You can record the time of a "tick", for example when you detect the pulse from the coil using the "micros()" function and remember it until the next "tick" when you subtract the new time from the previous one and remember the new. The difference will give you the period (or semi period) measured in 4 us increments with an accuracy somewhat limited by small changes in software execution time and of course the Arduino clock. You'll have to output the data somehow, the easiest is to use the Arduino serial monitor. That needs a PC or at least something like a Pi in the workshop. One approach could be to use a Pi without a display of keyboard, running the Arduino IDE (version available for the Pi), and controlled using VNC from your PC via your Wi-Fi. The Pi comes with VNC server and the client is free from the web. No need for your pendulum to beat seconds.

                            #519385
                            SillyOldDuffer
                            Moderator
                              @sillyoldduffer

                              Posted by Peter Bell on 11/01/2021 19:19:03:

                              If I wanted to get some simple data from it s rate would it need to beat seconds?

                              What would equipment would I need to do this?

                              Dont have a PC in the workshop.

                              Peter

                              I do it with a Serial USB connection to a headless RaspberryPi as described by John, but I'm familiar with Linux which might be too much for just data collection.

                              An alternative would be an SD Card Reader module, many other examples available, about £6.

                              Easy to wire and there's a library. Rather than send character data to the Serial Port, or as well as, the Arduino opens a file on an SD Card and writes lines of data to it.

                              When needed, the card is ejected and plugged into a PC. It should be recognised automatically and can then be opened with a spreadsheet. Most spreadsheets will recognise each line as a row of numbers, and import them as rows and columns. Then the spreadsheet can do the usual maths and graphs etc.

                              Probably only necessary to capture one number per tick – the time in microseconds since the previous tick. But it's easy to add info from other sensors:

                              At tick:

                              • set tickTime = Now
                              • period = tickTime -previousTime
                              • previousTime = tickTime
                              • get temperature
                              • Serial.print( period )
                              • Serial.print( "," )
                              • Serial.println( temperature )

                              Very similar for the SD card.

                              In setup:

                              File dataFile = SD.open("datalog.txt", FILE_WRITE);

                              In loop():

                              String dataString = String(period) + "," + String( temperature);

                              if (dataFile) {
                              dataFile.println(dataString);
                              }

                              #519410
                              Peter Bell
                              Participant
                                @peterbell11509

                                Thanks for the advice.

                                Think it may be easier/quicker with my limited knowledge to go down the SD card route so I've ordered them also some extra nano's–seem to have run out

                                Any reccomendations on temp? Got some DS18B20 but think I remember reading they were very slow, also got some TC74 to hand?

                                Perhaps I can use the if statement where the pulse is generated as the tick after the threshold is reached?

                                Peter

                                #define THRESHOLD 10
                                #define PUSH_TIME 30
                                #define A_PIN A0

                                int led = 13;

                                void setup() {
                                pinMode(A_PIN,INPUT);
                                analogReference(INTERNAL);
                                pinMode (13,OUTPUT);

                                }

                                void loop() {
                                if (analogRead(A_PIN) > THRESHOLD) {
                                pinMode(A_PIN,OUTPUT);
                                digitalWrite(13, HIGH);
                                digitalWrite(A_PIN,HIGH);
                                delay(PUSH_TIME);
                                digitalWrite(13, LOW);
                                pinMode(A_PIN,INPUT);
                                delay (300);
                                }

                                }

                                #522600
                                duncan webster 1
                                Participant
                                  @duncanwebster1

                                  The time has come to replace the steel pendulum in my clock with carbon fibre. It occurs to me that the suspension spring and top pendulum fitting are metallic and so will still expand, so should I have the fixing of the bob below centre so that it expands upwards to compensate? I now it won't make a lot of difference s I'm only talking a handful of mm rather tan the full length of the pendulum, but it would be easy to arrange.

                                  #522684
                                  John Haine
                                  Participant
                                    @johnhaine32865

                                    Worth trying surely, if you have the necessary data. I must admit though that I haven't bothered!

                                    #523666
                                    John Haine
                                    Participant
                                      @johnhaine32865

                                      Just a quick update on timekeeping. 8 days ago based on the extension of the run reported above I changed the second modulus in the code from 92 to 134 as I finally worked out the correct algorithm to calculate it. Up to this morning the estimated rate of the displayed time was ~0.02 s/day. Here's a new plot.

                                      timekeeping_300121.jpg

                                      The wiggles look much bigger as the errors are less. The recording spreadsheet also calculates the "ideal" correction number based on the rate and it's giving 134.6 as of this morning.

                                      #523700
                                      duncan webster 1
                                      Participant
                                        @duncanwebster1

                                        I posted some pictures of my PIC controlled clock at steel pendulum

                                        As it's now got cold in my workshop it started to gain due to contraction of the steel pendulum, so I've finally got round to substituting carbon fibre. I shortened the suspension spring at the same time, as it was deemed too long. I was a bit worried that the joint at the bottom which is a 4mm dia spike 20mm long up the inside of the CF tube might not be strong enough, but according to the interweb shear strength of Araldite is 15 MPa so it should hold 384 kg. My bob is ~2 kg, mild steel inside stainless tube to make it look pretty

                                        Positioning the bob by measurement got it within 1 minute a day, now to regulate it, time it over a week next

                                         

                                         

                                        carbon fibre2.jpgcarbon fibre1.jpg

                                        Edited By duncan webster on 30/01/2021 14:33:29

                                        #523867
                                        John Haine
                                        Participant
                                          @johnhaine32865

                                          Duncan, is the rod actually a CF tube? On my "Arduinome" the rod is a 10mm CF tube with 8mm bore. I have a lot of 8mm aluminium rod which is a sliding fit in the bore. So I cut two slugs of this, probably 20mm – ish long, and araldited then in the ends. At the pendulum end the slug is tapped M4, originally for a rating nut but now there's just a nut that a step in the bore of the bob at its centre sits on. At the top the rod is cross drilled through after the slug was glued, with an M3 bolt holding it into the lower suspension chop. No sign of the araldite bond giving up yet (but only 18 months). That bob weighs 7 Kg. Rod length was originally found by calculation (using models for the MoI of all the components) and that gives a period near enough for easy digital compensation except for one M8 nut on top of the bob.

                                          On my second clock there is just an M3 screw through the lower chop and rod, no glued-in slug. The bob is held by a grub screw on the centre line clamping the rod. Again length set by calculation, and all regulation digital.

                                          Have you thought of doing the regulation in the PIC?

                                          #523911
                                          duncan webster 1
                                          Participant
                                            @duncanwebster1

                                            Yes it's 6mm OD 4mm ID CF tube. The top fitting was tapped 1/4 *40 for the steel rod, so I drilled it out 6mm leaving a scratch to key the glue, the bottom end has a 4mm dia spike on a bit of 1/4 steel threaded 1/4*40 (actually the end of the old rod) for the rating nut. The spike has small vee shaped grooves in it, and I poked an M4 tap up the tube, which roughed it up nicely. I then bored the bob at the top and made a split collet to fit round the CF tube so there is less chance of the bob wobbling on the nut. It's only split because i forgot to fit it to the CF before gluing the ends on

                                            I'm not messing with the PIC, I did think of replacing it with an Arduino, but it works, so leave it alone. If I did replace it I'd alter the opto switches to be in line vertically and have a second flag offset to one side of the rod to detect end of travel. Would look a lot neater and allow me to change the arc of travel. Aesthetics means you want use a lot more swing than you actually need, and less is more in the case of pendulums, although I'll repeat my mantra, it doesn't matter what you do to a pendulum as long as you always do the same.

                                            Having adjusted it once it's now within a second in 24 hours, I'll leave it for a week and have another calculate.

                                            Now for the next project, does anyone have any drawings to make a Lavet type stepper motor. These were used in a lot of silent slaves and in all the quartz clocks I've ever seen. Be nice to make one rather than buying a stepper motor. Lavet

                                            The slave I'm using now is Gents and needs 24v, be nice to run off <12, make the power supply simpler

                                            #523920
                                            John Haine
                                            Participant
                                              @johnhaine32865

                                              Ah, Lavet motors! I can't point you to drawings but you can get diametrical magnets that could potentially be used, though they might be embarrassingly strong for the job! I'd be interested too, having used a quartz movement by connecting to its stepper motor.

                                              I've also been looking into how these continuous sweep quartz movements work. As far as I've been able to find any useful information they use standard Lavet motors but drive them with trick waveforms to get continuous motion. I'd like to find out more because the dial on this clock (above results) is rather noisy. Any info anyone has would be very welcome.

                                              #523932
                                              Michael Gilligan
                                              Participant
                                                @michaelgilligan61133

                                                John & Duncan

                                                You might be interested in Bowell's patent : **LINK**

                                                https://worldwide.espacenet.com/patent/search?q=pn%3DUS882186A

                                                MichaelG.

                                                #542898
                                                duncan webster 1
                                                Participant
                                                  @duncanwebster1

                                                  My carbon fibre pendulum clock has now lost 1/2 minute in 36 days. Not yet in the precision league, but it will do for me. Losing is more convenient than gaining as I have a fast advance button.

                                                  #542913
                                                  John Haine
                                                  Participant
                                                    @johnhaine32865

                                                    0.833 s/day – that's good. I have had "another…" clock keeping 0.22 s/day at one stage but have recently "upgraded" it with a dedicated PSU rather than a USB from PC or wallwart. It seems quite sensitive to supply voltage so currently losing ~3 s per day but consistently so should be able to trim that out by adjusting the correction coefficients. Upgrade also added the ability to set hands + and – for convenience. Has been running for 8 days so soon time I think to adjust the trim.

                                                    #548648
                                                    Kitwn
                                                    Participant
                                                      @kitwn

                                                      This is my first post on this forum, having stumbled across this thread whilst looking for other people's ideas on driving a pendulum with the aid of an Arduino. I thought followers of the thread may be interested in how it works.

                                                      I have already made a prototype clock which can be seen at the link below. This one is wood but the same ideas can be applied to any design. The pendulum is driven by a solenoid and the movement is driven by a ratchet on the pendulum. This one does not use an Arduino but discrete electronics, however I want to modify it to be a simpler circuit board. The point of my design is that the period of the pendulum is locked to an external one pulse per second (1PPS) waveform derived either from a crystal oscillator or, for perfect accuracy, a GPS receiver.

                                                      The amplitude of the pendulum swing is larger than for a normal clock and because the period of any pendulum rises with amplitude, regulation of the clock is possible if you can control the amplitude. In my design the timing of the pendulum passing through it's centre position is compared to the 1PPS pulse time. If the delay between them is too large the solenoid stops pulsing, the pendulum amplitude and it's period fall so the clock speeds up until the two pulses, pendulum and 1PPS, are within the prescribed window. Solenoid pulses are large enough to drive the pendulum to an amplitude above that required for exact timing so simply cancelling some pulses is all that is needed to keep the pendulum in step with the 1PPS.

                                                      Obviously the pendulum must be adjusted to give the correct timing at around the middle of the acceptable range of amplitude. There is also a mechanism which measures the amplitude and prevents it going outside set limits. I will describe this in more detail if anyone is interested.

                                                    Viewing 25 posts - 26 through 50 (of 63 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