By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by Forum House Ad Zone

Improved Experimental Pendulum

All Topics | Latest Posts

Search for:  in Thread Title in  
duncan webster25/04/2023 17:36:31
5307 forum posts
83 photos

Grasshopper impulses every time, so it falls into my 'doesn't matter what you do as long as it's the same every time' category. I do realise this is a generalisation!

I used to have a copy of 'the science of clocks and watches', but I let it go. This explained very well best position of impulse.

duncan webster25/04/2023 17:39:42
5307 forum posts
83 photos
Posted by SillyOldDuffer on 25/04/2023 10:59:48:
............ Duncan Webster's no doubt pungent remarks on my approach to statistics! And there will be several other well-qualified engineers present. Should be fun.

Dave

I wouldn't presume to comment on statistics. I once proved beyond doubt hat the 2 test rigs we had for testing production machines were giving consistently different results. The boss of development took 2 machines and tested them on both rigs. No difference. Lies, damn lies and statistics!

duncan webster25/04/2023 17:39:42
5307 forum posts
83 photos
Posted by SillyOldDuffer on 25/04/2023 10:59:48:
............ Duncan Webster's no doubt pungent remarks on my approach to statistics! And there will be several other well-qualified engineers present. Should be fun.

Dave

I wouldn't presume to comment on statistics. I once proved beyond doubt hat the 2 test rigs we had for testing production machines were giving consistently different results. The boss of development took 2 machines and tested them on both rigs. No difference. Lies, damn lies and statistics!

SillyOldDuffer25/04/2023 18:43:33
10668 forum posts
2415 photos

Breaking news: the clock is running!

No celebrations because I made two silly mistakes with the in vacuo circuit board.

  • A connector plug rises vertically from the board, no problem until the female is attached and doesn't leave enough room to slide the soil pipe on. This can be fixed with a right-angled connector.
  • Worse, I completely forgot about the pressure/temperature sensor! Hope there's enough room for it on the existing board and I don't have to make another one from scratch. Doh.

Meanwhile I'm letting it run until there's enough period data in the log file to measure the standard deviation.

Dave

Joseph Noci 125/04/2023 22:36:14
1323 forum posts
1431 photos

So, how did you make it run? Give it a bash? tilt it? Or is it not in vacuum yet?

 

Edited By Joseph Noci 1 on 25/04/2023 22:36:45

Michael Gilligan25/04/2023 22:41:54
avatar
23121 forum posts
1360 photos
Posted by SillyOldDuffer on 25/04/2023 10:59:48:
Posted by Michael Gilligan on 25/04/2023 00:39:50:
Posted by SillyOldDuffer on 24/04/2023 20:31:51:

And I thought all I had to do was keep the amplitude constant....

.

At the risk of getting overly philosophical about it, Dave

… If you could do that, then the statement would be true

My understanding is that your system is working by a process of active adjustment, and therefore the amplitude cannot be kept constant.

MichaelG.

The system is experimental, and I've tried both. […]

.

Sorry, Dave … but I think you might have missed the ‘philosophical’ point I was trying to make:
If there is any form of feedback being usefully involved, then the pendulum is an ‘agile’ device in a constant state of jitter … ergo the amplitude cannot be constant.

MichaelG.

SillyOldDuffer28/04/2023 11:10:24
10668 forum posts
2415 photos
Posted by Joseph Noci 1 on 25/04/2023 22:36:14:

So, how did you make it run? Give it a bash? tilt it? Or is it not in vacuum yet?

Not in a vacuum yet. I altered the chariot (the 3D-print assembly that holds the magnet and IR sensors) to move the magnet closer to the bob. Not entirely happy with the geometry because it means the bob is impulsed later than I would like, so I'll have to print another one, which moves the sensors closer to BDC.

Ideally the chariot would allow the sensors and electromagnet to be adjusted independently relative to bob BDC, but I'm trying to keep the build simple.

I've ordered the pipe and fittings needed to exhaust the container, but I need to correct some silly physical mistakes on the veroboard before the soil-pipe can be installed. I forgot the BME280 and positioned a connector so the soil-pipe can't get past it to bed in the base.

Dave

SillyOldDuffer28/04/2023 11:49:51
10668 forum posts
2415 photos

Progress report. I'm running the clock without compensation to see how much impulse the revised pendulum needs - the bob is nearly 5 times heavier than the Mk 1.

A few problems:

  • Self-start isn't totally reliable (failed once)
  • Despite being mounted in a brass tube, the IR receiver was still sensitive to ambient light entering from the rear. Even though it shouldn't be necessary when the container is fitted I've added a shroud, which ensures good behaviour whilst testing the uncovered clock in daylight.
  • Software bug in my code, where compensation was applied even when told not too. As the temperature sensor isn't fitted yet, the compensated period was wrong.
  • Had to write new code to report on reduced data (no temperature etc.) Made more mistakes!

However, results are promising:

Nice straight line comparing my clock with NTP: it's consistently slow, which is easy to correct.

2804drift.jpeg

Dispersion is good (Q nearly 4000), but has two peaks, which is consistent with over-impulsing. I found balancing impulse so amplitude stays constant (approximately - see MichaelG's comment!), to be tricky. 18 is too low, 20 is too high, and the stats show 19 is slightly too high. The hardware timer's resolution is a little too coarse.

2804dispersion.jpeg

Something odd with the waveform, which displays a comb effect. Values that jump much further from the mean. The comb exaggerates the error - 88 times in 43153 is 0.2%, and it's not that big - standard deviation is 0.27uS

The wild jumping about at the end is due to me eating breakfast next to the clock and vibrating it.

2804waveform.jpeg

Annoyingly have to go out now, because I have several changes to make!

Dave

Michael Gilligan28/04/2023 18:44:52
avatar
23121 forum posts
1360 photos

That’s great progress, Dave yes

… good to see.

MichaelG.

duncan webster28/04/2023 22:59:10
5307 forum posts
83 photos

you could put some small variable resistance in line with your magnet coil, then fine tune the impulse with that

blowlamp28/04/2023 23:05:58
avatar
1885 forum posts
111 photos

" The wild jumping about at the end is due to me eating breakfast next to the clock and vibrating it. "

The size of the jump in the graph seems to indicate you had a 'Full English' for breakfast. smiley

Martin.

SillyOldDuffer29/04/2023 11:14:32
10668 forum posts
2415 photos
Posted by duncan webster on 28/04/2023 22:59:10:

you could put some small variable resistance in line with your magnet coil, then fine tune the impulse with that

Except the clock is remote controlled! What I actually did was go to the program and alter the counter/timer pre-scaler to provide 4x more precision. It's a single bit in TCCR2B:

TCCR2B |= (1<<CS22)|(1<<CS21)|(0<<CS20);

So instead of a choice of 3 impulse lengths between 0.001088 and 0.00128s I have 12, which should be good enough.

I intend to try a regulator where the bob is impulsed slightly too lightly on every beat, so it gradually loses amplitude, but is topped when it drops below a certain threshold. The topping up can be finely adjusted to minimise shocking the bob.

Next job is to check last nights run. I deliberately set the impulse high and now have to tune it down to find the minimum constant impulse that's not quite enough to keep the pendulum swinging permanently.

I've also implemented John Haine's self-start, which pulses a stopped bob 'n' times at the right frequency to get it swinging. Moving the electromagnet closer to the bob also worked, but I'm not quite close enough because it fails to grab the bob about 1 in 15. John's method is better for another reason - it swings the bob gently compared with a violent grab/release after which the pendulum takes at least 10 minutes to settle.

Today's worry is whether there will be enough room for the vacuum pipe work as well as an AT Mega under the base. Hoping to get a battery in there too!

Dave

 

Edited By SillyOldDuffer on 29/04/2023 11:16:47

duncan webster29/04/2023 11:31:20
5307 forum posts
83 photos
Finger trouble! 

 

Edited By duncan webster on 29/04/2023 11:32:52

SillyOldDuffer30/04/2023 11:37:52
10668 forum posts
2415 photos

More fun and games!

During the day, I connect the clock (which is on my dining table so I can fiddle with it), to my workstation computer, making it easy to change the software. At night, I connect it to a RaspberryPi 3b, which wastes much less electricity and can be left running all the time. The clock failed to self-start on the Pi, odd because it worked before. Turned out to be due to me using a different USB cable: presumably the wires inside it are too thin and the volts drop enough to prevent sufficient amps reaching the magnet. Swapping the cable fixed it.

Lesson learned. not only does the amount of power actually available from a USB socket vary, but not all USB cables are equal!

Good result from last night's run:

Periods (in 62.5nS ticks): min 14914516.0 mean=14949452.289 max=15017427.0
dev = 3586.463 ticks
Clock Mean Period = 0.934341s
Actual Mean Period = 0:00:00.934465
std = 0.224us
Q = 7048

clockStart = 2023-04-29 20:05:42
ClockEnd = 2023-04-30 09:18:22.578480
ActualEnd = 2023-04-30 09:27:20.791752
ClockRun = 13:12:40.578480 (47560.57848s)
ActualRun = 13:21:38.791752 (48098.791752s)
Difference = -538.213s (-1.118975% -11189.746ppm)
Drift Constant Correction = 10453.0

The uncompensated clock ran nearly ten minutes slow after 13 hours, but the drift is constant, trivial to compensate, this lovely straight line graph:

drift2904.jpeg

I've sussed out what's causing the comb on the waveform graph:

waveform290.jpeg

I noticed the comb peaks follow the true waveform and seem to be the same size. They are! The raw data shows they are close to 65536 above normal, 2^16, which happens to be the value added when the program tests for a near miss counter overflow:

// Correct if just missed an overflow
if (TIFR1 & bit(TOV1) && pendulumCountAtEventEnd < 128) {
pendulumOverFlowCount++;
}

I copied the code from my hero Nick Gammon, but have always been suspicious of it. I believe it's meant to deal with the counter overflowing at about the same time a pendulum event is received. I shall have to study the datasheet again. Although the comb looks bad, it doesn't matter much in practice. Determined to understand and fix it though.

Another potential cause of noise on the pendulum is under investigation. It's the delay between the microcontroller detecting the bob and firing the electromagnet. I wondered how big the delay is, and if it varies much. This is typical:

pulselag.jpg

Pendulum in yellow, magnet power in blue. The electromagnet is energised 60 microseconds after the bob breaks the IR beam. My test sample is very small, about 30 example, but the 60uS delay doesn't seem to vary. The main thing that would delay the magnet further is the clock receiving a command just before the beam is broken. Not likely because commands are sent at start of run to configure the clock and shouldn't be necessary after it's set.

Does anyone know how long a mechanical impulse takes between trigger and energy reaching the pendulum? It's not instantaneous.

I guess several tens of milliseconds in a Shortt Synchronome where the second pendulum operates a ratchet wheel, that releases a gravity lever dropping a small weight on the pendulum, operating a mechanical electric switch on the way. The switch releases another gravity lever that drops a weight on the first pendulum. Much slower than 60uS I suggest, plus variation due to the switch contacts, inertia and friction.

However I suppose the delay, whether mechanical or electronic, doesn't matter provided it's always the same-ish.

Dave

Michael Gilligan30/04/2023 12:38:20
avatar
23121 forum posts
1360 photos

Great progress [again] Dave, but I wouldn’t worry too much about trying to compare your impulse-delay with that of the Shortt/ Synchronome … because that one only occurs once every [nominal] 30seconds, and yours is more ‘agile’

MichaelG.

duncan webster30/04/2023 16:09:31
5307 forum posts
83 photos

My simple mind would use 2 processors, one to keep the pendulum swinging at a controlled amplitude, the second to do all the clever stuff

david bennett 801/05/2023 04:18:42
245 forum posts
19 photos

Dave, that lovely straight line graph must have been worth a "whoopee" or two!

dave8

Michael Gilligan01/05/2023 07:13:32
avatar
23121 forum posts
1360 photos
Posted by SillyOldDuffer on 30/04/2023 11:37:52:

More fun and games!

[…]

Lesson learned. not only does the amount of power actually available from a USB socket vary, but not all USB cables are equal!

[…]

.

Some useful notes about the history of USB power are included here: **LINK**

https://www.onlogic.com/company/io-hub/usb-type-c-and-usb-3-1-explained/

MichaelG.

SillyOldDuffer01/05/2023 13:51:05
10668 forum posts
2415 photos

Fixing the electronic mistakes took most of Sunday afternoon and didn't work when reconnected to the clock, so lashings of despair. Another silly mistake.

I'm not happy with the board - the layout was flawed, before I messed up! Had to mount the pressure/temperature module close to the switching transistor, not far from the cast-iron base, comparator chip, two LEDs, and the electromagnet coil. These the main sources of heat inside the vacuum containment, and may cause trouble.

A test run with the pressure/temperature module showed it works, but the log contains a high rate of false break readings, due to the beat counter occasionally triggering on both rising and falling edges. Not sure what causes this. As the input waveform is clean, it may be software: reading the pressure/temperature module, or maybe the extra time spent transmitting their numbers to the raspberryPi (which logs them).

Previously I was going to attach the electronics to the sensor chariot. It's easier to tie it to the pillars:

dsc06750.jpg

Didn't bother to tidy-up the wiring: saving that joy until I have a neat way of getting it through an airtight seal to the microcontroller under the base.

A few more changes:

  • Removed old code from previous experiments.
  • Pendulum now only impulsed when amplitude drops below a threshold. (The threshold is set experimentally and is probably too high. The impulse is also set experimentally, currently so an impulse is issued every other beat or two.
  • Reduced the number of self-start beats from 20 to 6. 20 crash the bob into the electromagnet.

Vacuum parts have started arriving, so I'm adding them to the model. Or would if I could remember how to do pipes in Solid Edge. Fitting the vacuum stuff is going to be fiddly - tight space.

Dave

Edited By SillyOldDuffer on 01/05/2023 13:51:37

SillyOldDuffer04/05/2023 15:30:51
10668 forum posts
2415 photos

Pleased to report, fingers crossed, that I've fixed an intermittent problem that's been annoying me for ages. It's that,rarely and apparently randomly, the clock registered a double beat. The false beat occurred on the FALLING edge of the beam break, when the microcontroller was programmed to repond only to RISING edges. Should be impossible, and I've been chasing all manner of esoteric and unlikely causes - many hours wasted.

Seems the actual cause was electrical noise on the input. Microcontroller inputs are vulnerable because they're high-impedance, making it possible for them to pick up glitches on long wires, or even from adjacent pins. The cure is to tie the input either HIGH or LOW with a resistor, about 10kΩ. It stops static and soaks up short spikes. Looking very good so far, zero false triggers in over 12 hours.

At the moment I'm running the pendulum uncompensated to determine it's characteristics. Nice straight line on the drift graph, and period only varies up to 80 microseconds per beat, much better than the Mk 1 clock, with a sharp evenly balanced distribution, hurrah!

histo0304.jpeg

combo0304.jpeg

Annoyingly, the good weather is failing to provide the variety of big temperature and air pressure changes needed to calibrate the pendulum: correlations are identified, but not strongly, meaning compensation values based on them won't cover winter and summer confidently.

The spiky green graph shows something is still wrong with the amplitude code or electronics. (I hoped the resistor would fix it, nope!) Even though the error rate is only 0.5%, and the affect of each error on the pendulum trivial, I want to fix it.

Comparing last night's run with actual time this morning showed the the clock should be set to an average period of 0.935266s rather than 0.924012s. Period was set to 0.935266s and the clock reset to UTC this morning. If that works, the clock should run close to UTC, but is still uncompensated. However, weather permitting, it will collect enough tempertature and pressure changes to enable compensation.

Progress is promising enough for me to tackle the vacuum containment problem, difficult enough for it to be worth it's own thread. The parts needed to plumb it have started to arrive.

First attempt at plumbing was this:

baseplumbing.jpg

Rubber hose from vacuum pump attaches to a nozzle connected to a valve, connected to T-coupler. Vacuum gauge on the end. Unfortunately, this configuration requires a ⌀ 6-8mm hole 100mm deep to be drilled accurately straight into the block. If it drifts, there's a high risk it will break out into the lower cavity.

Second attempt avoids the need for deep drilling, but more pipe and joints. The vacuum gauge can be upright at the front:

baseplumb2.jpg

The more I think about how to contain the vacuum, the more difficult is seems. I'm after a deep vacuum, and yonks ago Roger Atkinson said of my Edwardes EB3A pump "Specification seems to be 26" Hg / 133mB", about 86% vacuum. Not bad for a home clock, but ideally the vacuum has to be held steady for years. The container holds about 2 litres of nothing, so a leak of only 1cc air per day is cause for concern.

Leaks are less worrying if the pump is in poor condition and can't get that low a vacuum, but then the clock won't achieve it's best.

Dave

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

Sign up to our Newsletter

Sign up to our newsletter and get a free digital issue.

You can unsubscribe at anytime. View our privacy policy at www.mortons.co.uk/privacy

Latest Forum Posts
Support Our Partners
cowells
Sarik
MERIDIENNE EXHIBITIONS LTD
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

 

Donate

donate