[Gllug] Data sampling problems

Tethys sta296 at astradyne.co.uk
Sat Sep 17 09:44:16 UTC 2005


Kens writes:

>If I'm understanding you correctly, assuming there is one magnet and the 
>engine is running at 5000 RPM, there will be a short pulse every 12mS. 
>That pulse could be quite short depending on the physical size of the 
>magnet and the coil (I assume a coil is detecting it).
>
>Exactly what happens then? How do you interface this with the computer?

The pulse goes into an opto isolator, then into a ripple counter to step
the frequency down to something managable. From there I take a feed into
one of the digital I/O ports on the computer. They're presented to me as
a file in /proc, which I read to get their current state.

>If the flywheel has a diameter of 12", therfore a circumference of 38", 
>at 5000 RPM a 1/4 inch magnet at the edge of the flywheel will take 80 
>microseconds to pass the coil. Being practical I wouldn't bank on a 
>pulse any longer than 40-50 microseconds. If the flywheel itself is 
>magnetised in any other way I'd also expect some interference on the 
>incomming signal as well as crosstalk from the ignition system which 
>can't be far away. You say there is more than one magnet so that will 
>just mean a series of short pulses every 12 mS. (Is capital S the SI 
>unit for Seconds?)

No, it's a lower case s :-) The flywheel is around 7" in diameter, and
has 4 magnets at 90 degree offsets. A crank trigger uses these to control
the timing of the spark, so I've just placed an additional sensor there
to read from the same magnets for my own use. Crosstalk from the ignition
system is possible, but IMHO unlikely, as it's not that close.

>It would be good if some external hardware interface then cleaned up the 
>pulses and interfaced them to the computer

See above.

>I don't know how fast an ARM processor is, but to be fairly          
>confident of finding the pulses it will need to sample the coil      
>every 25 microseconds or so.                                         

It's a 400MHz Intel XScale CPU. At maximum RPM (10000), with 4 pulses
per revolution, that comes to one pulse every 1.5ms. I then divide that
down using the ripple counter, to bring it down to a more sensible
sample rate.

One additional data point htat I forgot to mention is that I have two
sensors -- one reading the crank speed, and the other reading the
output shaft speed. The latter just has a single magnet, and gives me
a nice smooth curve as you'd expect. That leaves me to suspect the
problem is somehow related to sampling frequency -- the crank has
higher RPM than the output shaft, and 4 magnets instead of one, and
hence several times more pulses per second.

I guess I was just hoping for some validation that an insufficient
sampling frequency (or a too small a step down on the ripple counter,
which is in effect the same thing) would produce the sort of
oscillating results I'm seeing.

Tet
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list