[Gllug] Data sampling problems

Ken Smith kens at kensnet.org
Sat Sep 17 12:41:47 UTC 2005


Tethys wrote:

>Kens writes:
>
>  
>
>>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.
>
>  
>
>
> 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'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
>  
>

OK. I understand. I have a couple of ideas:-

May be the some of the short pulses from the crank sensor are being 
missed by the ripple counter. Or is the diode in the opto being properly 
lit by the crank sensor pulse? So the divided down frequency becomes 
erattic. If you have an oscilloscope available you could quickly check 
that.

Is the frequency after the ripple counter comparable to the output shaft 
speed? Would it be possible to swap the two sensors over to see if the 
ripple counter works with the other sensor?

May be the processor can't keep up with the frequency coming from the 
ripple counter and is missing pulses. Is it possible to add some more 
stages to the ripple counter.

If you stop the processor doing other things, like taking data from the 
output shaft sensor does the reading from the crank sensor become more 
reasonable?

Let me know what happens

:-)

Ken



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




More information about the GLLUG mailing list