By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by Allendale Jan 24th

Arduino Pendulum Clock Design - Comments Welcome

All Topics | Latest Posts

Search for:  in Thread Title in  
John Haine09/10/2020 17:22:17
3543 forum posts
194 photos

"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!)

SillyOldDuffer09/10/2020 18:50:34
Moderator
6699 forum posts
1507 photos
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

Joseph Noci 110/10/2020 06:44:17
822 forum posts
1026 photos

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

VE2ZAZ Pendulum control

Joe

SillyOldDuffer10/10/2020 11:04:57
Moderator
6699 forum posts
1507 photos
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

SillyOldDuffer10/10/2020 11:15:56
Moderator
6699 forum posts
1507 photos

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

SillyOldDuffer10/10/2020 11:26:35
Moderator
6699 forum posts
1507 photos

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

Peter Bell10/10/2020 12:55:34
339 forum posts
155 photos

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

SillyOldDuffer10/10/2020 14:14:37
Moderator
6699 forum posts
1507 photos

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

John Haine10/10/2020 15:17:53
3543 forum posts
194 photos

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.

John Haine10/10/2020 17:36:39
3543 forum posts
194 photos

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

Peter Bell10/10/2020 17:40:30
339 forum posts
155 photos

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

John Haine10/10/2020 21:07:13
3543 forum posts
194 photos

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).

Michael Gilligan10/10/2020 23:44:16
avatar
17053 forum posts
757 photos

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.

Michael Gilligan11/10/2020 00:24:28
avatar
17053 forum posts
757 photos

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.

SillyOldDuffer11/10/2020 11:07:43
Moderator
6699 forum posts
1507 photos
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

SillyOldDuffer12/10/2020 14:12:56
Moderator
6699 forum posts
1507 photos

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

Michael Gilligan12/10/2020 16:18:35
avatar
17053 forum posts
757 photos
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

SillyOldDuffer13/10/2020 10:58:50
Moderator
6699 forum posts
1507 photos
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

Michael Gilligan13/10/2020 11:52:16
avatar
17053 forum posts
757 photos

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.

duncan webster13/10/2020 13:29:59
avatar
2956 forum posts
34 photos

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

All Topics | Latest Posts

Please login to post a reply.

Magazine Locator

Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!

Find Model Engineer & Model Engineers' Workshop

Latest Forum Posts
Support Our Partners
Warco
emcomachinetools
ChesterUK
Eccentric July 5 2018
EngineDIY
cowells
Eccentric Engineering
Subscription Offer

Latest "For Sale" Ads
Latest "Wanted" Ads
Get In Touch!

Do you want to contact the Model Engineer and Model Engineers' Workshop team?

You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.

Click THIS LINK for full contact details.

For subscription issues please see THIS LINK.

Digital Back Issues

Social Media online

'Like' us on Facebook
Follow us on Facebook

Follow us on Twitter
 Twitter Logo

Pin us on Pinterest