Subject: Atmel and ZBasic EFI planing A bit of thinking out loud. 5th simple EFI program.
From: Rotary Engine
Date: 6/3/2010, 9:51 AM
To: AAA Put this in the To box


 I suggest if you are interested in this system you make
 a folder and drag over all the many future messages on this


After some extensive conversations with some people attempting
to tune their engines and based on what I have learned so
far about ZBasic I have decided to change course and do
away with timed fuel injection. I have decided it is unnecessary
for aircraft engines. There are lots of constant dribble aircraft fuel
injections out there working well.

What this does is relieve the severe timing constraints on the
program at 7500 RPM and allow it to focus on
auto tune. I am going to attempt to do this my measuring
the EGT and use that as the primary feedback parameter.
EGT is unaffected by the type of fuel burned.

There will be no look up table to change values in.
The mixture is self optimizing. This is a non traditional
approach to EFI.

Ignition triggering will be done in hard ware directly
off the two CAS's mounted on a simple one tit trigger wheel.
Three in the case of a 3 rotor. Ignition timing will be
fixed but adjustable  at 22 BTDC.

This will also allow the program to send critical data
 to a net book in real time.

Here is how auto tune could work based on the EGT.

 Pilot: Manually lean the mixture to lean of peak EGT.
 The computer then increases the mixture and see if the EGT
 goes up or down. Wait. If it goes up you are on the back
 side of the EGT curve. The computer then increases the
 mixture again. Wait and see if it still  goes up.  Keep
 doing it until it does not go up any more.  You are now
 at peak EGT.

You will still be able manually lean the mixture.

This is the preliminary basic program. More routines
and sub programs will be added later as we have no
time constraints. This program shown so far will record
injector pulse width, RPM and both EGT readings on the net book.
RPM read out will be accurate to the nearest one rev and
will be updated every .6 seconds. Staging can be done
if necessary at some RPM value.
snipss....


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

AUTO TUNE IS WORKING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I am so excited I can hardly think. Plug this
system in and it will tune itself.

Here is a movie and the current program.
The lower trace on the scope is the injector
pulse width. Watch closely as it gets wider
and narrower as the EGT changes.

The basic PW is 50% and it goes up
and down as the EGT goes up and down.
The top trace is a sin wave from Craig Smith's
function generator. That is simulating the EGT
voltage from the EGT analog to digital converter.

This is a classic feed back loop with total
digital control over gain, damping and response time.
The pulse repetition rate is
250 pulses per second or one injector
pulse every half revolution of the engine
at 7500 RPM.

In actual real life EGT changes much slower than this.

Final settings will be done on a running engine.

Here is the latest super simple program.
I am sending a lot of data to a file on the net
book for debugging purposes so a lot of this will go away.

***********************************************
Public EGT1 as integer
Public EGT2 as integer
Public EGTDif as integer
Public EGTDif2 as integer
Public WidthDif as single
Public width1 as single
Public x as long

Sub Main()
Width1 = 50.0 'set the start pulse width to 50%
 'do
for x = 1 to 100
  EGT1 = GetADC(82)
 Debug.Print " EGT1 = " & CStr(EGT1);
 delay (0.001)    'wait
 EGT2 = GetADC(82)
 Debug.Print " EGT2 = " & CStr(EGT2);
 delay (0.001)    'wait
 EGTDif = EGT1-EGT2
 EGTDif2 = ABS(EGT1-EGT2) 'integer must be converted t0 %
 WidthDif=CSng(EGTDif2)
 Debug.Print " EGTDif = " & CStr(EGTDif);
 Debug.Print " WidthDif = " & CStr(WidthDif);

If (EGTDif  0) then
WidenThePulse
end if

If (EGTDif < 0) then
 NarrowThePulse
end if
DetermineRPM
 Width1 = 50.0
next x
'loop  'go back to top
end sub

'************************************************
Sub WidenThePulse ()
 width1 = width1 + WidthDif                 'Widen the pulse
 Call OpenPWM(3, 250.0, zxFastPWM)   'Pulse rep rate 250 PPS
 Call PWM(3, width1)                 'channel 3 pin 26 port B bit 7
 Debug.Print " Width1  = " & CStr(width1);
 end sub 'WidenThePulse
' *****************************************************
Sub NarrowThePulse ()
width1 = width1 - WidthDif                'Narrow the pulse
 Call OpenPWM(3, 250.0, zxFastPWM)
 Call PWM(3, Width1)                 'channel 3 pin 26 port B bit 7
 Debug.Print " width1  = " & CStr(width1);
end sub 'NarrowThePulse
''****************************************
Sub DetermineRPM()
 ' RPM code goes here
 Debug.Print " RPM  = " & CStr(RPM)
end sub 'DetermineRPM()
' ******************************************


Paul Lamar



Paul,

That's really cool.  Will auto-tune run all the time, or only when told to
run?

I was curious... what would happen if an EGT probe fails?

Mark

That is still to be determined but all the time sounds doable.
I am confident enough in the software that I need to start
building one for testing on my P-port RX8 engine.

Depends on the mode of failure. If the wire breaks it will just
continue to send out the last pulse width. The problem
is obvious as the reading will be zero.

It is easy to build in a lot of self testing. The fundamental
way of determining what side of the EGT curve you are on
in and of itself is a self test.

The computer tells the mixture to change and watches the EGT to
see if it changes. If no EGT change either the engine is dead or
the EGT does not work. The computer knows the engine is running
from the RPM so it must be the EGT prob.

It can do this for each rotor and light a LED on the panel
like a check engine light in a car.

Also you have the EGT data displayed on the net book screen.
One could take the net book apart and mount it in the panel.
Since USB keyboards work the net book keyboard does not
have to be used. Just the display and the CPU with all
the USB ports.

The options are mind boggling.

With 16 channels of A to D to work with you could use
two EGT's per rotor. If you want to get ridiculous
you could have three per rotor and have them vote
like an F16 computer :)

You could also use a Hytech devoted to diagnostics
alone.

As I keep saying software is a very creative medium :)

Paul Lamar

-- 
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.