[Gllug] Data sampling problems

Tethys sta296 at astradyne.co.uk
Fri Sep 16 23:48:36 UTC 2005


In my spare time, I'm part of the crew for a top fuel dragster[1].
Lacking the money to buy an off the shelf model, I built us a
datalogger, so that we can analyze information from the car after
each run to try and work out what went right and what went wrong.
(it's an embedded system based around an ARM CPU running Linux --
naturally :-)

Amongst other things, I'm trying to measure the crankshaft RPM,
using a sensor and some magnets embedded into the flywheel, with
the time between pulses being used to calculate the RPM. The
problem I'm having is that the results aren't consistent. Instead
of the expected RPM, my results are showing oscillating values
above and below the expected figure:

	http://www.astradyne.co.uk/ref/crankrpm.png

We're expecting somewhere around 5000 RPM at that point, so taking
an average of the values recorded gives approximately the right figure.

Any ideas what could be causing that? My initial thought is that my
sample frequency is too close to the pulse frequency, and that upping
the sample rate might help, but before I go off on a wild goose chase,
I just wondered if there might be other explanations.

Incidentally, I'm using a software loop for the delay between samples.
I initially tried nanosleep(2), but I don't know if it's just the syscall
overhead or something else, but it was sleeping for too long (I only need
around 10ms delay, so I'd have thought it should handle that with ease,
but apparently not).

Tet

[1] This one: http://www.pbase.com/slimboyfat/image/49107232/original
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list