It is proving a bit harder than I imagined.
The problem is the trailing trigger and the leading trigger
come in at almost the same times on the 1985 dist. Most
microcomputers would have a problem with that. I think
my ARM is fast enough to over come that.
Here is a little program that measures the rpm based on
the leading trigger. The 85 dist is driven by a 1500 RPM
drill motor which is equivalent to3000 RPM e-shaft.
No igniters. Just the VR sensors.
It shows microseconds, msec, seconds and RPM.
It is wonderful to have almost instantaneous floating point math
at one's disposal.
'pin3 on connector is leading trig IO(33)
'pin 4 is trailing TOP trigger IO(32)
DIM RPM as single
DIM ms as single
DIM seconds as single
begin:
do while IO(33)= 0
loop 'drop out of the loop
'when it goes high
'rising edge
'goes high again in 180 degrees
'of the e-shaft
oldtime = timer
do while IO(33) = -1
loop 'don't do anything while still high
'roughly 100 usec
'it is now low
do while IO(33) = 0
loop 'don't do anything until it goes high
'again. AKA rising edge
timediff =(timer-oldtime) 'for 180 e-shaft deg
oldtime = 0
print timediff
timediffx2 = timediff * 2
print timediffx2
ms = timediffx2 /1000
print "ms per rev = "; ms
seconds = ms /1000
print "seconds = ";seconds
RPM = 1/seconds
RPM=RPM*60
print "RPM = ";RPM
goto begin
--------------------------------------------------------------------
Here is some output data
--------------------------------
11894
23788 'per eshaft rev
ms per rev = 23.78800
seconds = 2.378800E-02
RPM = 2522.280
11756
23512
ms per rev = 23.51200
seconds = 2.351200E-02
RPM = 2551.888
11652
23304
ms per rev = 23.30400
seconds = 2.330400E-02
RPM = 2574.665
11614
23228
ms per rev = 23.22800
seconds = 2.322800E-02
RPM = 2583.089
Paul Lamar
The Rotary Engine News Letter. Powered by Linux.
ACRE NL web site.
http://www.rotaryeng.net
You Tube
http://tinyurl.com/beqqxas
Copyright 1998-2014 All world wide rights reserved.