I ran into a bit of snag when I tried to determine the RPM.
I noticed a jitter in the ignition timing so I investigated
the problem further with this program.
That makes GetElapsedMicroTime from the RTC vary.
I also found an Interrupt bug in the ZBasic language.
That is being fixed as we speak. Not often do
you get to talk to the language programmer himself :)
The ZBasic real time clock
is the root of the problem so I will disable it
and build one in external hardware along with an RPM
counter that will be triggered off the starter
teeth of the flywheel. That is the quickest way of
determining the RPM of any engine anyway.
In the RX8 eng this is why the trigger wheel has all those
extra teeth. It is better and more reliable to use
another $15 CAS sensor on the flywheel teeth for RPM.
Here is the ZBasic code. Note the wide variation in the
RPM average read out in the data below. Should be
7500 RPM. The variation is unacceptable.
Paul Lamar
**************************************************************
Public x as long
Public RPMcnt as integer
Public RPMcnt2 as integer
Public RPMo as long
Public t0(1 to 5) as byte
Public delta as UnsignedLong
Public deltaTot as UnsignedLong
Public deltaTot2 as UnsignedLong
Sub Main()
for x = 0 to 3000000
'Call WaitForInterrupt(ZXpinRisingEdge, WaitINT0)
'This will be tried when it gets fixed.
'here is where it jitters.
If (GetPin(43)=1) then
Call rotor1
end if
next x
end sub 'main
sub rotor1()
RPMcnt = RPMcnt+1
if (RPMcnt > 22) then 'get 22 samples
Call RPM
end if
end sub
SUB RPM()
delta = GetElapsedMicroTime(t0) 'for 22 samples
Debug.Print " t" & CStr(delta); 'print the times
Call GetMicroTime(t0)
RPMcnt = 0
deltaTot = DeltaTot+ delta 'add them up
RPMcnt2 = RPMcnt2+1
if (RpMcnt2 >15) then '16 times are added
call RPM2
end if
End Sub
SUB RPM2()
deltaTot2=deltaTot\16 'average divide by 16
Debug.Print " avg = " & CStr(deltaTot2) 'print the avg
RPMcnt2 = 0
deltaTot = 0
End Sub
**************************************************************
Downloading file "C:\Documents and Settings\junk\Desktop\ZBasic\rpm3.zxb":
...............................
Download complete.
Verifying download:
...............................
Verification complete.
ZBasic v3.0.3
t6364 t7652 t6767 t8532 t6774 t7652 t6765 t8535 t7658 t6766 t8535 t8542 t7653 t8534 t6767
t7655 avg = 7571
t7654 t8535 t7652 t6770 t8532 t8540 t7655 t7650 t6770 t8535 t6768 t7652 t6765 t7652 t6769
t7653 avg = 7597
t7654 t7655 t6765 t8532 t7657 t6765 t7650 t8542 t7653 t7655 t6765 t7653 t6768 t7650 t6769
t7655 avg = 7486
t7649 t7655 t7655 t6767 t7653 t6765 t7655 t6765 t7652 t7653 t6768 t6762 t7652 t7655 t6768
t7653 avg = 7320
t7651 t7655 t6766 t7652 t8535 t6768 t7655 t6763 t7653 t6768 t7650 t6772 t7652 t6770 t7650
t7657 avg = 7376
t8531 t7655 t6765 t7655 t6768 t7652 t6768 t7652 t6765 t8534 t7655 t6767 t8532 t8540 t7655
t8537 avg = 7651
t7654 t8535 t7653 t6771 t8534 t8539 t8535 t8539 t8537 t7655 t6772 t8534 t7655 t6767 t8538
t6765 avg = 7873
t6769 t6766 t8537 t6766 t8535 t7660 t6765 t8537 t6765 t8537 t6768 t8535 t8537 t6768 t8534
t6770 avg = 7596
t6766 t6768 t8538 t8538 t6765 t9419 t8542 t8539 t8537 t6769 t9419 t7657 t7645 t8539 t6768
t8537 avg = 7984
t7656 t6763 t6765 t9420 t7660 t7645 t8537 t8543 t6765 t9419 t7658 t7650 t9419 t6771 t8542
t6765 avg = 7873
t8531 t7660 t7645 t9422 t8540 t9422 t8540 t6767 t9420 t8540 t6772 t9419 t8537 t6770 t9421
t6765 avg = 8260
t7651 t8542 t7645 t8539 t7650 t8539 t9419 t6774 t9419 t6767 t9422 t8542 t7645 t8542 t9419
t6768 avg = 8205
t7648 t6770 t6765 t6767 t6765 t6768 t7644 t8540 t7650 t9422 t6768 t9422 t9422 t6768 t6765
t7650 avg = 7595
t7654 t9419 t6774 t9422 t6765 t6765 t9422 t7650 t8542 t8537 t7650 t9422 t6770 t9417 t8540
t6771 avg = 8095
t7648 t6768 t9420 t7660 t7645 t8540 t6767 t8537 t8540 t6765 t8540 t6763 t8540 t8537 t6766
t8538 avg = 7873
t8536 t7655 t8538 t6768 t8537 t6766 t8538 t7655 t6768 t8535 t6766 t7657 t6766 t8534 t7655
t6767 avg = 7652
t7646 t8537 t7657 t7650 t6770 t7652 t6768 t8532 t6767 t7655 t8536 t7652 t7653 t6771 t7650
t6765 avg = 7541
t6769 t7652 t7655 t6765 t7650 t8537 t7652 t7655 t6767 t7650 t7655 t7652 t6770 t6767 t7650
t6768 avg = 7375
t6767 t7650 t7655 t7657 t7653 t6765 t6771 t6766 t6768 t6769 t6770 t6766 t6768 t7650 t6767
t7650 avg = 7099
t6768 t7653 t6773 t7653 t6765 t7653 t7653 t7649 t7660 t7650 t7650 t7658 t7653 t6765 t6771
t6763 avg = 7321
t7654 t7658 t7648 t7660 t7648 t7655 t7650 t6772 t6765 t6768 t8536 t6770 t7650 t7650 t7655
t6773 avg = 7432
t6767 t7650 t6773 t6762 t6770 t7650 t6773 t7650 t7652 t8540 t6768 t6770 t7648 t7655 t6773
t6768 avg = 7210
t6766 t6768 t7652 t7650 t8542 t7655 t7652 t6770 t7650 t6773 t6768 t6762 t7660 t7650 t6771
t7650 avg = 7321
t7656 t6770 t7647 t7655 t6773 t7648 t6773 t6768 t6771 t7648 t7657 t7655 t7652 t6770 t8540
t7650 avg = 7377
t7657 t7655 t6770 t7649 t7657 t7649 t6773 t7652 t7655 t7650 t6774 t6767 t6772 t6770 t7650
t7653 avg = 7322
t7658 t7652 t8537 t7652 t7660 t7655 t6768 t7655 t7652 t8537 t7653 t7663 t7650 t7655 t8542
t7650 avg = 7764
t6774 t7650 t7661 t7650 t7652 t7660 t6767 t7653 t7653 t8539 t6773 t6768 t6767 t8538 t6774
t7650 avg = 7433
t7659 t7652 t7657 t7650 t8540 t6774 t7653 t8540 t7652 t7658 t7650 t7663 t7648 t7660 t8540
t6770 avg = 7710
t7651 t7650 t7662 t7647 t7660 t8540 t7650 t7655 t7655 t7660 t7650 t6771 t6771 t6768 t6772
t6768 avg = 7433
t7651 t6772 t7650 t7655 t8545 t7650 t6771 t6768 t6770 t7647 t7660 t7655 t6768 t6768 t6768
t8537 avg = 7377
t6770 t7653 t7658 t7650 t6774 t6768 t6771 t6770 t7650 t6771 t7655 t7653 t7655 t6768 t8537
t7655 avg = 7322
t7654 t8542 t7650 t6773 t7648 t7660 t7655 t6768 t7653 t6770 t7650 t6770 t8540 t7653 t7652
t6770 avg = 7488
t7651 t7653 t6772 t7650 t6773 t7648 t6773 t8542 t7650 t6771 t7650 t6773 t6765 t7655 t8540
t6768 avg = 7377
t7649 t7655 t7655 t6770 t7647 t7652 t6775 t7648 t6773 t8540 t6765 t6770 t7647 t8545 t7653
t7650 avg = 7487
t7656 t7655 t7652 t7650 t7655 t6773 t6768 t6763 t8540 t6773 t7648 t7660 t6768 t7647 t6773
t7653 avg = 7377
t6770 t6768 t6762 t6773 t6767 t7650 t7659 t6770 t7647 t7655 t6772 t6763 t6771 t7648 t8544
t7652 avg = 7210
t6766 t6774 t6770 t7647 t7655 t9424 t7652 t6772 t7650 t7652 t6774 t7647 t7655 t6772 t7650
t6771 avg = 7376
t8538 t7652 t6770 t7653 t6771 t6765 t6768 t6770 t7647 t7652 t6772 t8542 t7647 t7653 t7655
t6773 avg = 7376
t7649 t7658 t7650 t7653 t7653 t6773 t7650 t6773 t7648 t7655 t6773 t7650 t6770 t8538 t6770
t6768 avg = 7376
t6764 t7653 t6773 t6765 t7655 t6770 t7647 t7655 t8544 t6765 t7655 t6765 t6771 t7648 t6770
t7658 avg = 7266
t7656 t7650 t7650 t8548 t6763 t7655 t6768 t6767 t7650 t6772 t8538 t6770 t6768 t6768 t6770
t7650 avg = 7321
t7651 t6770 t7653 t6771 t7648 t7655 t6773 t7650 t6770 t6770 t7648 t7653 t7655 t7653 t6773
t7647 avg = 7321
t6773 t6773 t7650 t7650 t8545 t7653 t7650 t7655 t7652 t6774 t7648 t7655 t6773 t7647 t7655
t7652 avg = 7487
t6769 t6771 t6763 t6770 t7650 t6773 t8537 t6770 t6768 t7650 t7655 t6770 t7647 t7653 t6775
t7650 avg = 7210
t6767 t7657 t6768 t6768 t7647 t8542 t7652 t6772 t7650 t6773 t7650 t6770 t7650 t6773 t7648
t6773 avg = 7266
t7656 t7652 t6768 t7648 t7655 t6774 t6767 t7657 t6770 t7649 t6770 t7653 t6771 t7650 t6768
t8543 avg = 7321
t6766 t6770 t7647 t8543 t6773 t6767 t6771 t7650 t7652 t6770 t8540 t7650 t6772 t7657 t7655
t7655 avg = 7377
t6764 t7658 t7653 t7653 t6771 t7657 t7650 t6771 t7655 t7655 t7652 t6768 t7657 t7650 t7650
t7655 avg = 7432
t7661 t7650 t6770 t8538 t6773 t8537 t7653 t6773 t6768 t6765 t6774 t6770 t7650 t7658 t8539
t7650 avg = 7433
t6774 t7650 t7655 t7658 t6767 t7653 t7657 t7650 t7658 t6770 t7647 t7660 t7650 t8540 t7655
t6773 avg = 7488
t7651 t6773 t7652 t7655 t7652 t7657 t6768 t7652 t7655 t7655 t7650 t7663 t7650 t7657 t7650
t7660 avg = 7543
t6769 t7648 t7663 t7647 t7660 t7648 t7663 t6767 t7650 t8545 t6770 t8535 t6773 t7658 t7650
t6770 avg = 7488
t7648 t7660 t7652 t7655 t7657 t7650 t7658 t7649 t7660 t6769 t7658 t7657 t7653 t8535 t6773
t7658 avg = 7599
t7649 t6772 t7657 t7652 t7657 t7652 t7658 t7650 t7657 t6770 t7653 t7658 t7652 t8540 t6773
t8534 avg = 7599
t7656 t6770 t6770 t7650 t7657 t7657 t7650 t7657 t8537 t6773 t7650 t8543 t7652 t7655 t6772
t8537 avg = 7599
t7657 t7653 t8542 t6773 t7652 t7655 t8537 t6772 t7653 t7653 t7660 t7653 t7655 t8538 t6773
t7652 avg = 7654
t6769 t7657 t7647 t7657 t7660 t7652 t7655 t7652 t8537 t6771 t7657 t8538 t6773 t8534 t6770
t7660 avg = 7599
t6767 t7652 t6770 t7658 t7653 t7655 t7658 t7653 t8535 t6772 t7658 t7648 t7661 t7656 t7650
t7657 avg = 7543
t6769 t7652 t6770 t7657 t7647 t7663 t7650 t7653 t7660 t6770 t7653 t7650 t7660 t6770 t7652
t7655 avg = 7433
t6771 t7650 t7653 t7657 t6773 t7652 t7650 t7661 t6768 t7653 t6776 t7655 t7655 t7652 t7658
t6770 avg = 7378
t6769 t7647 t7660 t6770 t7652 t7650 t7657 t6773 t7653 t7657 t7650 t7655 t6773 t7655 t7650
t7658 avg = 7433
t7661 t7647 t7657 t7650 t7657 t6773 t7655 t7647 t7663 t7650 t7653 t7660 t6771 t7653 t7650
t7663 avg = 7544
t6767 t7653 t6774 t8537 t7655 t7653 t7660 t7650 t7657 t7650 t7660 t7652 t7655 t7660 t7650
t7657 avg = 7599
t6767 t8537 t6774 t7652 t8542 t7650 t7660 t7650 t7660 t7654 t6768 t7653 t7655 t8537 t6772
t7650 avg = 7598
t7654 t6771
--
The Rotary Engine NewsLetter. Powered by Linux.
ACRE NL web site.
http://www.rotaryeng.net
Youtube key word PaulLamar2
Copyright 1998-2010 All world wide rights reserved.