Subject: Computer EFI
From: Rotary Engine
Date: 7/12/2011, 9:32 AM
To: AAA Put this in the To box



There seems to be more interest in this for aircraft use.
Some people I know are trying to implement Megasquirt
(I think) on some experimental aircraft using the traditional
air cooled aircraft engine.

It can be done but I am not comfortable with Megasquirt.
Currently it seems  it has evolved to be all things to all
car engines while the aircraft engine needs are more limited.

It also relies on feedback from an O2 sensor which does
not work well on 100LL. Yes I know there is a move afoot to
replace 100LL but that has been talked about for the last
ten years with no real movement. The lead emitted is a phony
issue and not a real problem.

The aircraft application needs more display of engine parameter
and historical data acquisition. In other words what is the engine
doing now and what was the engine doing for the entire flight.
In other words it needs to be combined with an engine monitoring
system.

Also Megasquirt is not well documented IMHO.
For example here is a so called flow chart of the main program.
What is missing in most cases is how, when and why.


    Set up Phase-Lock Loop, RTC, Serial, Interupts
    Initialization of Ports / Variables
    Sample MAP sensor and save as Barometer
    Copy Configuration and VE variables from Flash to RAM
    Copy Flash Burn Routine from Flash to RAM
Main Loop:
    Perform Table Lookup for Barometer and Air Density Correction
    Perform Table Lookup for Coolant and MAP Linearization
    Determine if in Fast-Idle Mode
    Compute RPM, Determine if Engine is Cranking or Running and Flood-Clear
    Calculate Warmup and After-start Enrichment
    Calculate Acceleration Enrichment/Enleanment
    Calculate EGO Enrichment
    Calculate VE from 2-D Table Interpolation
    Compute Total Enrichment Value (Accel, Baro, Air Density, EGO, and Warmup)
    Compute VE Contribution
    Compute MAP/Baro
    Calculate REQ_FUEL
    Calculate Battery Voltage Compensation
    Calculate Final Pulse Width
Goto [back to] Main Loop


Yes the info is there in the C source code but C is the fundamental problem.
One must be an accomplished C programmer to really understand what
is going on. I am not. There is a lot of controversy about this but IMHO
C is a terse and cryptic language. C was invented back in the days when one
used a teletype machine to talk to and program computers. That was 40 years ago.
Computers are a million times smarter than they were in those days.
You should be able to tell the computer in plain English what you want it
to do. I am not saying voice recognition here. Just be able to type it in.

What do you think about this?

Paul Lamar


Megasquirt runs happily open loop - no O2 sensor..

There's a learning curve with C. And then some people write crappy C code, that
can be very obfuscated. It's very powerful and efficient, and if well written,
not too bad to understand.  I like that the C compiler is so old and well
developed. New languages might not be as well debugged.


Matt-

"There's a learning curve with C." No kidding :)
There is a version of BASIC that is evolving into a standard
for machine control. Depends on how you define efficient.

http://en.wikipedia.org/wiki/BASIC_Stamp

"The BASIC Stamp is a microcontroller with a small, specialized BASIC
interpreter (PBASIC) built into ROM. It is made by Parallax, Inc. and has been
popular with electronics hobbyists since the early 1990s due to its low
threshold of learning and ease of use (due to its simple BASIC language)."


Paul Lamar

Paul,

Megasquirt is well documented for it's purpose. I suspect well over a 1000 vehicles are running the megasquirt, so pretty large acceptance.

What you are missing with the megasquirt code is Al Gippo's comments.  Al did the math (who, what, where, when), and Bruce
did the coding (How) that you listed out.  A lot of the original material is no longer posted (there was a ton of questions on how the formula's were derived... but the goal was to just get a simple, easy to tune fuel only system, out to enthusiast). Some of the simple explanations are still here:
http://www.megamanual.com/v22manual/mfuel.htm

The original project was John Gwynne's efi332.  We used a 68332 system for fuel and spark, and a bunch of control. Bruce Bowling felt that system was way too complicated, and felt the 6808 was easier to implement for a fuel only system that became the mega-squirt.
Lot of the documentation is still on the web here:
http://www.diy-efi.org/efi332/faq.htm
http://www.diy-efi.org/efi332/equations/algorith.htm -- Section by Al Grippo

Tom W


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