Subject: DOS power basic fuel injection software Floating Point
From: Rotary Engine
Date: 1/1/2010, 2:06 PM
To: AAA Put this in the To box



 Thanks for the tips Victor. Yes I have to get some leaning provisions
 in there. It is such a modular design I am thinking of doing a
 mass air flow module or a MAP sensor module in place of the
 slide throttle sensor. Just unplug it and plug in something else.

 Another huge advantage of this approach is the math coprocessors
 built into these chips that do floating point math in no time :)

 Something you don't find in most EFI single chip computers.

 ---------------------------------------------------------

 One use of the floating point math capabilities is to display
 Gallons Per Second or GPM or GPH or all three on the LCD.
 Handy when you get low on gas.

 The computer knows the RPM and it knows the pules width.
 fuel burn is therefor: RPM X pulse width X constant.

 With another A to D connected to the air speed pito
 tube pressure sensor MPG could be displayed. Also total fuel burned.

 The possibilities are endless when one can make floating point
 calculations
 in 5 microseconds. It is only limited by the number of sensors you want
 to install.

 The additional programing is trivial:

 PRINT "Gallons per Hour ="; RPM * Pulse-Width * xxxxx

 xxxxx is a constant that gives GPH.

 Paul Lamar

Even better would be ground speed off a GPS. It must be possible for someone
bright like you.

John
PS Hey maybe feed it back to the GPS and have it plot a range circle.

----------------------------------------------------------------------

No problem o. We have an RS232 and many GPS's output position once a second
in NEMA 0183 format through an RS2332. Here is a BASIC program I wrote back in the late 1980's showing the position of all visible satellites. Straight out of the screen
is straight up. The top of the screen is due north. They plot their position on
the screen as they move.

Paul Lamar

'Takes in RS232 NEMA 0183 formated data from most GPS's and displays sat pos.
'
'
CLS
LOCATE 12, 1: INPUT "                   Do want a playback y/n "; yn$

yn$ = RTRIM$(LTRIM$(UCASE$(yn$)))

IF yn$ = "Y" GOTO playback

OPEN "sat.dat" FOR APPEND AS #4
OPEN "COM1:4800,N,8,2,ASC,LF,OP0,RS,RB32000,TB1,CD0,DS0,CS0" FOR RANDOM AS #1
ON TIMER(120) GOSUB doit2
TIMER ON

CLS
SCREEN 12

CIRCLE (230, 230), 230
CIRCLE (230, 230), 2

LOCATE 4, 62
PRINT "Waiting for data.";
LOCATE 6, 62
PRINT " Please wait for"
LOCATE 8, 62
PRINT " 2 minutes."

LOCATE 30, 1: PRINT " Press Esc to Quit.        SOUTH          Lamar Instruments (310) 374 1673";


start2:
TIMER STOP
LOCATE 2, 65: PRINT TIME$;
TIMER ON
IF INKEY$ = CHR$(27) THEN GOTO enditall    'esc key
GOTO start2

playback:

CLS
SCREEN 12

CIRCLE (230, 230), 230
CIRCLE (230, 230), 2
LOCATE 30, 1: PRINT " Press Esc to Quit         SOUTH          Lamar Instruments (310) 374 1673";

OPEN "sat.dat" FOR INPUT AS #3 LEN = 18000
DO WHILE NOT EOF(3)
LINE INPUT #3, temp$
IF MID$(temp$, 1, 6) = "$PLWRB" THEN GOSUB dob:
IF MID$(temp$, 1, 6) = "$PLWRC" THEN GOSUB doc:
IF INKEY$ = CHR$(27) THEN GOTO enditall    'esc key

LOOP
CLOSE #3

enditall:
LOCATE 2, 50
INPUT " Press any key to end "; z$
CLS 0
LOCATE 5, 1: PRINT "                 SAT-DISPL.EXE Copyright 1993 Paul Lamar"
             PRINT
             PRINT "                     Lamar Instruments"
             PRINT "                     1715 Dixon St."
             PRINT "                     Redondo Beach CA"
             PRINT "                     90278  (310) 374 1673"
LOCATE 18, 1: PRINT "                      HAVE A NICE DAY"
LOCATE 30, 1: PRINT " Press Esc to Quit.";
FOR z = 1 TO 50000
IF INKEY$ = CHR$(27) THEN GOTO enditall2    'esc key
NEXT
enditall2:
CLS 0
CLOSE
END


doit2:

TIMER STOP
x = x + 1
ON ERROR GOTO errorhand1
temp$ = INPUT$(LOC(1), #1)       'LOC(1) gives the number of char in the buff

OPEN "temp2.bas" FOR OUTPUT AS #2 LEN = 18000
PRINT #2, temp$
CLOSE 2
OPEN "temp2.bas" FOR INPUT AS #3 LEN = 18000
DO WHILE NOT EOF(3)
LINE INPUT #3, temp$
IF MID$(temp$, 1, 6) = "$PLWRB" THEN GOSUB dob:
IF MID$(temp$, 1, 6) = "$PLWRC" THEN GOSUB doc:
LOOP
CLOSE #3
TIMER ON
RETURN

errorhand1:
RESUME NEXT



dob:
IF yn$ = "Y" THEN GOTO skipdob1
PRINT #4, temp$;
PRINT #4, ",";
PRINT #4, TIME$;
PRINT #4, ",";
PRINT #4, DATE$

skipdob1:


'         1         2         3         4         5         6         7
'123456789012345678901234567890123456789012345678901234567890123456789012
'$PLWRB,M,06,24,77,174,12,71,275,09,51,240,13,39,029,20,15,312,07,14,067*1C

Prn01 = VAL(MID$(temp$, 13, 2))
elev1 = VAL(MID$(temp$, 16, 2))
azim1 = VAL(MID$(temp$, 19, 3))
Prnx = Prn01
azmith = elev1
angle = azim1
GOSUB plotit1
Linex = 4
GOSUB printit

Prn02 = VAL(MID$(temp$, 23, 2))
elev2 = VAL(MID$(temp$, 26, 2))
azim2 = VAL(MID$(temp$, 29, 3))
Prnx = Prn02
azmith = elev2
angle = azim2
GOSUB plotit2
Linex = 6
GOSUB printit

Prn03 = VAL(MID$(temp$, 33, 2))
elev3 = VAL(MID$(temp$, 36, 2))
azim3 = VAL(MID$(temp$, 39, 3))
Prnx = Prn03
azmith = elev3
angle = azim3
GOSUB plotit3
Linex = 8
GOSUB printit

'         1         2         3         4         5         6         7
'123456789012345678901234567890123456789012345678901234567890123456789012
'$PLWRB,M,06,24,77,174,12,71,275,09,51,240,13,39,029,20,15,312,07,14,067*1C

Prn04 = VAL(MID$(temp$, 43, 2))
elev4 = VAL(MID$(temp$, 46, 2))
azim4 = VAL(MID$(temp$, 49, 3))

Prnx = Prn04
azmith = elev4
angle = azim4
GOSUB plotit4
Linex = 10
GOSUB printit:

Prn05 = VAL(MID$(temp$, 53, 2))
elev5 = VAL(MID$(temp$, 56, 2))
azim5 = VAL(MID$(temp$, 59, 3))

Prnx = Prn05
azmith = elev5
angle = azim5
GOSUB plotit5
Linex = 12
GOSUB printit:

Prn06 = VAL(MID$(temp$, 63, 2))
elev6 = VAL(MID$(temp$, 66, 2))
azim6 = VAL(MID$(temp$, 69, 3))

Prnx = Prn06
azmith = elev6
angle = azim6
GOSUB plotit6
Linex = 14
GOSUB printit:

enddob:
RETURN



doc:
IF yn$ = "Y" THEN GOTO skipdoc1
PRINT #4, temp$;
PRINT #4, ",";
PRINT #4, TIME$;
PRINT #4, ",";
PRINT #4, DATE$
skipdoc1:

'         1         2         3         4         5         6         7
'123456789012345678901234567890123456789012345678901234567890123456789012
'$PLWRB,M,06,24,77,174,12,71,275,09,51,240,13,39,029,20,15,312,07,14,067*1C

numsat = VAL(MID$(temp$, 10, 2))

Prn07 = VAL(MID$(temp$, 13, 2))
elev7 = VAL(MID$(temp$, 16, 2))
azim7 = VAL(MID$(temp$, 19, 3))
Prnx = Prn07
azmith = elev7
angle = azim7
GOSUB plotit7
Linex = 16
GOSUB printit:

IF numsat < 2 THEN GOTO enddoc

Prn08 = VAL(MID$(temp$, 23, 2))
elev8 = VAL(MID$(temp$, 26, 2))
azim8 = VAL(MID$(temp$, 29, 3))
Prnx = Prn08
azmith = elev8
angle = azim8
GOSUB plotit8
Linex = 18
GOSUB printit:

IF numsat < 3 THEN GOTO enddoc

Prn09 = VAL(MID$(temp$, 33, 2))
elev9 = VAL(MID$(temp$, 36, 2))
azim9 = VAL(MID$(temp$, 39, 3))
Prnx = Prn09
azmith = elev9
angle = azim9
GOSUB plotit9
Linex = 20
GOSUB printit:

IF numsat < 4 THEN GOTO enddoc

'         1         2         3         4         5         6         7
'123456789012345678901234567890123456789012345678901234567890123456789012
'$PLWRB,M,06,24,77,174,12,71,275,09,51,240,13,39,029,20,15,312,07,14,067*1C

Prn010 = VAL(MID$(temp$, 43, 2))
elev10 = VAL(MID$(temp$, 46, 2))
azim10 = VAL(MID$(temp$, 49, 3))
Prnx = Prn010
azmith = elev10
angle = azim10
GOSUB plotit10
Linex = 22
GOSUB printit:

IF numsat < 5 THEN GOTO enddoc

Prn011 = VAL(MID$(temp$, 53, 2))
elev11 = VAL(MID$(temp$, 56, 2))
azim11 = VAL(MID$(temp$, 59, 3))
Prnx = Prn011
azmith = elev11
angle = azim11
GOSUB plotit11
Linex = 24
GOSUB printit:

IF numsat < 6 THEN GOTO enddoc

PRN012 = VAL(MID$(temp$, 63, 2))
elev12 = VAL(MID$(temp$, 66, 2))
azim12 = VAL(MID$(temp$, 69, 3))
Prnx = Prno12
azmith = elev12
angle = azim12
GOSUB plotit12
Linex = 26
GOSUB printit:

enddoc:
RETURN


printit:
LOCATE Linex, 62
PRINT "S"; Prnx;
LOCATE Linex, 67
PRINT " E"; azmith;
LOCATE Linex, 72
PRINT " A"; angle
RETURN

plotit1:
IF angle <= 90 THEN angle2 = 270 + angle   'Finally! this is because
IF angle  90 THEN angle2 = angle - 90     'the stupid basic starts due east.

CIRCLE (x11, y11), 5, 0       'r = 5 color = off
CIRCLE (x11, y11), 1
angr = angle2 / 57.295
hyp = 230 - (azmith * (230 / 90))
y11 = CINT(ABS(230 + (SIN(angr) * hyp)))   'ABS was big break through and ess.
x11 = CINT(ABS(230 + (COS(angr) * hyp)))

CIRCLE (x11, y11), 1
CIRCLE (x11, y11), 5

RETURN


plotit2:
IF angle <= 90 THEN angle2 = 270 + angle   'Finally! this is because
IF angle  90 THEN angle2 = angle - 90     'the stupid basic starts due east.

CIRCLE (x12, y12), 5, 0       'r = 5 color = off
CIRCLE (x12, y12), 1

angr = angle2 / 57.295
hyp = 230 - (azmith * (230 / 90))
y12 = CINT(ABS(230 + (SIN(angr) * hyp)))   'ABS was big break through and ess.
x12 = CINT(ABS(230 + (COS(angr) * hyp)))

CIRCLE (x12, y12), 1
CIRCLE (x12, y12), 5

RETURN

plotit3:

IF angle <= 90 THEN angle2 = 270 + angle   'Finally! this is because
IF angle  90 THEN angle2 = angle - 90     'the stupid basic starts due east.
CIRCLE (x13, y13), 5, 0       'r = 5 color = off
CIRCLE (x13, y13), 1

angr = angle2 / 57.295
hyp = 230 - (azmith * (230 / 90))
y13 = CINT(ABS(230 + (SIN(angr) * hyp)))   'ABS was big break through and ess.
x13 = CINT(ABS(230 + (COS(angr) * hyp)))

CIRCLE (x13, y13), 1
CIRCLE (x13, y13), 5

RETURN

plotit4:

IF angle <= 90 THEN angle2 = 270 + angle   'Finally! this is because
IF angle  90 THEN angle2 = angle - 90     'the stupid basic starts due east.

CIRCLE (x14, y14), 5, 0       'r = 5 color = off
CIRCLE (x14, y14), 1

angr = angle2 / 57.295
hyp = 230 - (azmith * (230 / 90))
y14 = CINT(ABS(230 + (SIN(angr) * hyp)))   'ABS was big break through and ess.
x14 = CINT(ABS(230 + (COS(angr) * hyp)))

CIRCLE (x14, y14), 1
CIRCLE (x14, y14), 5

RETURN

plotit5:

IF angle <= 90 THEN angle2 = 270 + angle   'Finally! this is because
IF angle  90 THEN angle2 = angle - 90     'the stupid basic starts due east.
CIRCLE (x15, y15), 5, 0       'r = 5 color = off
CIRCLE (x15, y15), 1

angr = angle2 / 57.295
hyp = 230 - (azmith * (230 / 90))
y15 = CINT(ABS(230 + (SIN(angr) * hyp)))   'ABS was big break through and ess.
x15 = CINT(ABS(230 + (COS(angr) * hyp)))

CIRCLE (x15, y15), 1
CIRCLE (x15, y15), 5

RETURN

plotit6:

IF angle <= 90 THEN angle2 = 270 + angle   'Finally! this is because
IF angle  90 THEN angle2 = angle - 90     'the stupid basic starts due east.
CIRCLE (x16, y16), 5, 0       'r = 5 color = off

CIRCLE (x16, y16), 1
angr = angle2 / 57.295
hyp = 230 - (azmith * (230 / 90))
y16 = CINT(ABS(230 + (SIN(angr) * hyp)))   'ABS was big break through and ess.
x16 = CINT(ABS(230 + (COS(angr) * hyp)))

CIRCLE (x16, y16), 1
CIRCLE (x16, y16), 5

RETURN

plotit7:
IF angle <= 90 THEN angle2 = 270 + angle   'Finally! this is because
IF angle  90 THEN angle2 = angle - 90     'the stupid basic starts due east.
CIRCLE (x211, y211), 5, 0       'r = 5 color = off
CIRCLE (x211, y211), 1
angr = angle2 / 57.295
hyp = 230 - (azmith * (230 / 90))
y211 = CINT(ABS(230 + (SIN(angr) * hyp)))   'ABS was big break through and ess.
x211 = CINT(ABS(230 + (COS(angr) * hyp)))
CIRCLE (x211, y211), 1
CIRCLE (x211, y211), 5
RETURN


plotit8:
IF angle <= 90 THEN angle2 = 270 + angle   'Finally! this is because
IF angle  90 THEN angle2 = angle - 90     'the stupid basic starts due east.
CIRCLE (x212, y212), 5, 0       'r = 5 color = off
CIRCLE (x212, y212), 1
angr = angle2 / 57.295
hyp = 230 - (azmith * (230 / 90))
y212 = CINT(ABS(230 + (SIN(angr) * hyp)))   'ABS was big break through and ess.
x212 = CINT(ABS(230 + (COS(angr) * hyp)))
CIRCLE (x212, y212), 1
CIRCLE (x212, y212), 5
RETURN

plotit9:
IF angle <= 90 THEN angle2 = 270 + angle   'Finally! this is because
IF angle  90 THEN angle2 = angle - 90     'the stupid basic starts due east.
CIRCLE (x213, y213), 5, 0       'r = 5 color = off
CIRCLE (x213, y213), 1
angr = angle2 / 57.295
hyp = 230 - (azmith * (230 / 90))
y213 = CINT(ABS(230 + (SIN(angr) * hyp)))   'ABS was big break through and ess.
x213 = CINT(ABS(230 + (COS(angr) * hyp)))
CIRCLE (x13, y13), 1
CIRCLE (x13, y13), 5
RETURN

plotit10:
IF angle <= 90 THEN angle2 = 270 + angle   'Finally! this is because
IF angle  90 THEN angle2 = angle - 90     'the stupid basic starts due east.
CIRCLE (x214, y214), 5, 0       'r = 5 color = off
CIRCLE (x214, y214), 1
angr = angle2 / 57.295
hyp = 230 - (azmith * (230 / 90))
y214 = CINT(ABS(230 + (SIN(angr) * hyp)))   'ABS was big break through and ess.
x214 = CINT(ABS(230 + (COS(angr) * hyp)))
CIRCLE (x214, y214), 1
CIRCLE (x214, y214), 5
RETURN

plotit11:
IF angle <= 90 THEN angle2 = 270 + angle   'Finally! this is because
IF angle  90 THEN angle2 = angle - 90     'the stupid basic starts due east.
CIRCLE (x215, y215), 5, 0       'r = 5 color = off
CIRCLE (x215, y215), 1
angr = angle2 / 57.295
hyp = 230 - (azmith * (230 / 90))
y215 = CINT(ABS(230 + (SIN(angr) * hyp)))   'ABS was big break through and ess.
x215 = CINT(ABS(230 + (COS(angr) * hyp)))
CIRCLE (x215, y215), 1
CIRCLE (x215, y215), 5
RETURN

plotit12:
IF angle <= 90 THEN angle2 = 270 + angle   'Finally! this is because
IF angle  90 THEN angle2 = angle - 90     'the stupid basic starts due east.
CIRCLE (x216, y216), 5, 0       'r = 5 color = off
CIRCLE (x216, y216), 1
angr = angle2 / 57.295
hyp = 230 - (azmith * (230 / 90))
y216 = CINT(ABS(230 + (SIN(angr) * hyp)))   'ABS was big break through and ess.
x216 = CINT(ABS(230 + (COS(angr) * hyp)))
CIRCLE (x216, y216), 1
CIRCLE (x216, y216), 5
RETURN



-- 
The Rotary Engine NewsLetter. Powered by Linux.
ACRE NL web site. http://www.rotaryeng.net
Youtube key word UTUBPLEASE
Copyright 1998-2009 All world wide rights reserved.