Baker Steve
Member
I am impressed by what I've read on this forum. I have so many questions to ask, but I must resist the temptation to start new threads. But maybe I may be allowed this one, as it's foxing me at the design stage.
Here's the setup. An experimental electro-mechanical clock (a subject dear to my heart although maybe of interest to only a few hundred people on the entire planet) has a mechanical oscillator (a pendulum). It is driven by a Fedchenko drive. These work by placing a small permanent magnet at the bottom of the pendulum and detecting its swing using a sense coil and an ADC (in this case, in a PICAXE). At appropriate times, every n swings (typically 30), an impulse is delivered to the pendulum by means of a second drive coil. These work well and only take a few lines of PICAXE code: so far, so good. Assume one sense pulse per second/per swing, i.e. a pendulum with a two second period.
The problem I'm struggling with is a monitoring circuit that will reference the pendulum timing to a stable oscillator and display the pendulum's error in real time. In discrete logic one might do this by using the pendulum's one-second-ish pulses to gate a stable oscillator of a much higher frequency and look at the count of pulses received. So, for example, if the stable reference was 8192 Hz and the pendulum was bang on one second, a count of 8192 would be recorded. If a count of 8190 was recorded, the pendulum is 2/8192th of a second slow, etc. It would then be simple to generate a slow/on time/fast display updated each second, making adjustment a doddle. (Fine adjustment is by control of the drive coil's power, using a ten-turn pot connected to a variable constant-current source. This makes use of the fact that pendulums are not isochronous: their period changes slightly with the amplitude of their swing.)
Looking at the COUNT command, it seems to be dependent for its count period on the PICAXE's internal clock: it's not immediately apparent how it could be used for a 'gated' count of the sort described above. There is also the SETTIMER command, but both these seem to lend themselves to counting the one-second pulses based on the higher-frequency and accurate oscillator, i.e. the opposite of what I need. This would work, but would require a vastly longer time to generate a meaningful display, at the least many hours.
I would welcome any advice on how to use a PICAXE to measure deviations in the period of slow pulses. As long as I know it's doable, I don't need to worry about the details of the implementation at this stage. Elegance demands that I make a PICAXE do the work, but if it's not possible, a bit of external logic would do it.
Here's the setup. An experimental electro-mechanical clock (a subject dear to my heart although maybe of interest to only a few hundred people on the entire planet) has a mechanical oscillator (a pendulum). It is driven by a Fedchenko drive. These work by placing a small permanent magnet at the bottom of the pendulum and detecting its swing using a sense coil and an ADC (in this case, in a PICAXE). At appropriate times, every n swings (typically 30), an impulse is delivered to the pendulum by means of a second drive coil. These work well and only take a few lines of PICAXE code: so far, so good. Assume one sense pulse per second/per swing, i.e. a pendulum with a two second period.
The problem I'm struggling with is a monitoring circuit that will reference the pendulum timing to a stable oscillator and display the pendulum's error in real time. In discrete logic one might do this by using the pendulum's one-second-ish pulses to gate a stable oscillator of a much higher frequency and look at the count of pulses received. So, for example, if the stable reference was 8192 Hz and the pendulum was bang on one second, a count of 8192 would be recorded. If a count of 8190 was recorded, the pendulum is 2/8192th of a second slow, etc. It would then be simple to generate a slow/on time/fast display updated each second, making adjustment a doddle. (Fine adjustment is by control of the drive coil's power, using a ten-turn pot connected to a variable constant-current source. This makes use of the fact that pendulums are not isochronous: their period changes slightly with the amplitude of their swing.)
Looking at the COUNT command, it seems to be dependent for its count period on the PICAXE's internal clock: it's not immediately apparent how it could be used for a 'gated' count of the sort described above. There is also the SETTIMER command, but both these seem to lend themselves to counting the one-second pulses based on the higher-frequency and accurate oscillator, i.e. the opposite of what I need. This would work, but would require a vastly longer time to generate a meaningful display, at the least many hours.
I would welcome any advice on how to use a PICAXE to measure deviations in the period of slow pulses. As long as I know it's doable, I don't need to worry about the details of the implementation at this stage. Elegance demands that I make a PICAXE do the work, but if it's not possible, a bit of external logic would do it.