MegaSquirt Fundamentals

advertisement
MegaMeet 2009
Atlanta GA
MegaSquirt and MegaSquirt Logo are trademarks of BG Soflex, LLC.
Engine Controls
FUN-da-mentals
Bowling & Grippo
MegaSquirt and MegaSquirt Logo are trademarks of BG Soflex, LLC.
BE A MAN!
Take control of your engine…
Use you MegaSquirt!
MegaSquirt and MegaSquirt Logo are trademarks of BG Soflex, LLC.
Take Control!

Lets say you have this engine…..

…and you want to
make it run…fast!
…but how do you
control it?
5
Take Control!

You will need the following three things:
Air
Fuel
Ignition
6
Take Control!

And you have to mix the Air and the Fuel in just the
right amount for best results.

Its like making the perfect Gin and Tonic:
Recipe:
3 Ounces Gin
4 Ounces Tonic
Note that Al Grippo prefers more of the Hydrocarbon
(Gin – CH3CH2OH) than Diluent (Tonic)… he’s just
that way….
7
Take Control – Its in the Ratios!
8

For fuel and air to form combustion there needs to be
specific ratios of each.

For a given Hydrocarbon (that’s gasoline) there
needs to be a proper amount of oxygen (in the air).

The most efficient form of combustion is when the
ratios are in Stoichiometric proportions… all this
means is that all of the hydrocarbon reacts with all of
the oxygen, producing water and carbon dioxide.

If you have too much air and not enough fuel, there
will be excess oxygen (lean)

If you have too much fuel and not enough oxygen
then there will be leftover hydrocarbons, CO, H2, etc.
(rich).
Take Control – Simpler is Better!

The AIR-FUEL ratio is just the ratio of the air to the
fuel:
MASS _ OF _ AIR
AFR 
MASS _ FOF _ FUEL

Another way to quantify is with Lambda:
AFR

AFRstoich

Still another way is the Equivalence Ratio (my
favorite):

9
1

10
Take Control of Your Hydrocarbon
11

OK – lets start with the fuel, this one is the easy
parameter to control!

An electromechanical valve known as a Fuel Injector
does the work for you…

If you apply 12 volts to the
terminals the internal valve
(pintle) opens and lets fuel
flow.

Take away the 12 volts and
the valve shuts down tight…
no fuel flows.

Extremely simple device!
Injector Guts and Glory
12
Take Control of Fuel

13
The fuel flow thru the injector is governed by the
following mechanical arrangement:
Take Control – Equations are cool!

The fuel flow thru the injector is governed by the
following equation:

m
 f  CInjector  fuel Pfuelrail  Pmanifold
Mass Rate
Of Fuel
14
Injector
Coefficient
Fuel
Density
Pressure Differential
Across Injector

Take Control – Simpler is Better!

Since we are dealing with one fuel type and one
injector, and since the fuel regulator keeps the
pressure differential the same for all operating
conditions, the previous equation can be reduced to:
Fuel_Flow = Inj_Flow_Rate * Pulsewidth
15

This means that the amount of fuel that flows depends
on the Injector Flow Rate and the Open Pulsewidth…
its really simple 

Note that for small pulsewidths the fuel injector open
time starts to dominate and fuel flow is no longer
linear – so keep out of this region (this means you)!
16
17
All About AIR

OK, we know all about fuel and how it is controlled. It’s
the easy part…

Determining the amount of air the engine is sucking in
is much, much harder.

Airflow characteristics change all of the time due to:

18

RPM

Temperature

Pressure

Composition
You gotta know how much air entered the engine in
order to match up the proper amount of fuel…..
Mass Air Estimation

So, how does the fuel controller determine the amount
of air that the engine breathes?

In other words, we need to know the Mass of the Air
flowing into the cylinders.

There are three predominant methods used to do this:

19

Speed Density (SD) – uses air density, volume, and engine
speed to infer the mass air.

Mass-Airflow Meter (MAF) – measures airflow directly with
dedicated sensor.

Alpha-N (A/N) – estimates mass air from throttle position and
engine speed.
No one method is perfect – we will address each
method, their strengths and weakness.
Mass Air Estimation - SD
20

Speed density infers (or makes an educated
estimation) on the amount of air that the engine
ingests for each cylinder.

It uses the following facts:
1.
Air has MASS – a “tin can”-full of air actually weighs
something. How much it weights depends on how much
volume you have trapped and its density.
2.
Air mass within a volume (like the tin can) can be estimated
if you know the pressure, volume, and temperature – this is
called the Ideal Gas Law (its not just the law… its ideal!)
3.
The engine cylinder, when its at the bottom of the stroke, is
just like an empty tin can – it has a volume.
4.
At certain conditions, the intake manifold pressure is darnnear the same as the cylinder pressure, and cylinder is max
volume. Good place to sample….
Volume of Tin Can
Vd = 3.14159*(bore/2)^2*Stroke
(It’s also the displacement divided by the number of cylinders…)
21
How do you know how
much the air weighs
(mass) in the tin can?
What if the can was
filled with ball
bearings?
Think of air molecules
as a bunch of ball
bearings... If we know
how much a ball weighs
and the number of balls
we can figure it out!
22
Lots of ball bearings in
a volume is Dense
Fewer ball bearings in a
volume is Less Dense…
23

Mass of air molecule is given
by its molecular weight.

Molecular mass is one
molecule of air relative to the
unified atomic mass u which
is equal to 1/12 of the mass
of one atom of Carbon-12

Mass of Air = 28.964 g/mole
Don’t worry about the “Mole” word above, this is just a unit
representing the amount of something – just like the word
“Dozen” means “12 of” something…..
24
Avagadro’s number = 6.022 x 1023
Mass Air Estimation - SD

Density is equal to the number of molecules divided
by the volume:
Number of Molecules
Density
25
n
D
V
Volume

Great! We know the volume V of the cylinder… but
how do we know the number of air molecules n that
are inside?

There is an ideal way to find out!
Mass Air Estimation - SD

The Ideal Gas Law:
Pressure
PV  nRT
Volume
26
Universal
Gas Constant
Temperature
Number
Of Moles

This says that the pressure in the cylinder multiplied
by the cylinder volume equals the number of
molecules of air multiplied by a constant and by the
temperature

We can re-arrange the equation and solve for the
number of moles “n”……
Mass Air Estimation - SD
PV
PV
n  nRT
RT
27

If you pick the right kind of R constant (Specific Gas
Constant), then this equation is the mass of air at a
given pressure, volume, and temperature.

R is .287 kJ/(kg*K) for dry air

P is Pressure in KPa

T is Temperature in deg Kelvin = Deg C + 273
Mass Air Estimation - SD

Lets use variables that represent what we measure on
a real engine:
Pressure in Manifold
Volume of Cylinder
At Bottom of Stroke
PmanVBTC
M
RTm
Temperature of
Intake Manifold
Mass of Air in Cylinder
Gas Constant
28
Mass Air Estimation - SD


29
We infer the pressure of the cylinder from measuring
the pressure in the manifold. The best point to
measure this is at the point where the intake valve
just closes. Here’s why:

The piston is at the bottom of its stroke. At this point the
volume is maximum and is the trapped volume when the
intake valve closes and seals off the chamber (a closed tin
can). This trapped volume of mass air is what we are trying
to match up with mass fuel.

At BTC the piston moves the slowest in its stroke compared
to crankshaft motion. This means the volume is not
changing as much. So gas flows slow down (and even
changes direction back and forth) to the point where the
pressure in the manifold (MAP) is very close to the pressure
in the cylinder - within 1KPa from tests done at M.I.T.
It is important to sample the MAP at the same point
in the engine cycle.
MAP Sample
Region
30
Data from MS Forum user MYK777 under SynchroMAP thread.
Single cylinder, MAP pressure curve vs. crankshaft
Mass Air Estimation - SD

But – there is a monkey wrench thrown at us in all of
this… its call Volumetric Efficiency, or VE.
What is VE??
ma
VE 
 Pman 


 RTman 
What the &*^% is this?
31
Mass Air Estimation - VE

The piston in the cylinder acts like a volumetric
pump – i.e. the piston causes a volume change and
hence a corresponding pressure change.

Due to various factors, the amount of fresh air that
enters the cylinder is not what the cylinder is capable
to actually suck in (i.e. gas transfer due to volume
change).

In simple terms, VE is:
VE =
Mass of gas that actually gets in
Mass of gas the cylinder is capable of holding
Denominator comes from the air density
based on manifold pressure and temperature
32
Mass Air Estimation - VE
33

The VE is an efficiency (usually in percent/100, or
unitless) this is an indicator on how well the cylinder
fills with new air every time the cylinder draws down.

Larger VE values means more air (mass) enters
cylinder compared to smaller VE values.

It is possible to have VE values greater than 100%,
this just means the air is more dense than what the
theoretical numbers on the denominator indicate.

There are different reference points for VE – for
example the use of ambient air
pressure/temperature instead of manifold.
MegaSquirt uses manifold-referenced values.

But … what drives the changes in VE?
Lets go to the tin can with ball
bearings analogy again….
What if part of the can
was filled with rocks
and gravel?
The gravel displaces the
amount of ball bearings
that get in – and gravel
does not burn…
The gravel is known as Residual Gas
34
Mass Air Estimation - VE
35

VE is largely influenced by residual gas left from the
previous combustion event. One would think that the
piston would expel all gas during the exhaust….
Think again…

Residual gas is the “leftover” exhaust gas that
displaces good fresh air.

However, during the valve overlap period the intake
manifold pressure is often less than the exhaust
pressure – and this causes a backwards flow of
exhaust gas.

Additionally, exhaust backpressure can affect
residual gas – and this can be altered by barometric
pressure, turbo wastegate, VVT changes, etc.
VE change from wastegate operation due to backpressure change
36
Per Andersson Thesis 934
37
Mass Air Estimation - VE

38
Other players in VE:

Fuel vapor pressure – remember that fuel also take up
space.

Charge heating in the manifold/cylinder can change the air
density – lower mass air flow rates give longer time for the
air to “heat up”.

Sonic flow thru throttle plates (isentropic).

“Induction ram effects”

All of this means that the amount of new air that gets
into the cylinder is scaled by VE.

VE can be mapped as a function of engine speed
and manifold pressure.
Mass Air Estimation - VE

The earlier equation is now modified with the VE
term:
PmanVBTC
M a  v
RTm
Volumetric Efficiency, as function of RPM and Pman
39
Mass Air Estimation - Rate

Note that in all of the above we have been viewing
the cylinder in terms of one engine fill cycle. This
view is simple to understand and visualize.

On a running engine there are lots of cylinders filling
up, and the faster the engine runs the more filling
that happens.

Here is a relation that converts mass air (Ma) into
terms of mass air flow (MAF):
M a N cylinders
MAF 
2 * 60
RPM
40
MegaSquirt Fueling
41

We now have all of the pieces required for determine
the amount of fuel required to match the air filling the
cylinder at a ratio we define.

A lot of the variables are constants, like cylinder
volume, injector flow rate, and the like. And –
everything is either multiplied or divided together, we
are dealing with scale factors and ratios.

What MegaSquirt does is define a variable called
REQ_FUEL that pulls all of the non-changing pieces
together into one number.

All of the previous equations are at work but simply
restructured in order to apply simple scale factors.
MegaSquirt Fueling

42
Definition of REQ_FUEL is the amount of time
(milliseconds) the injector needs to be open to
deliver the proper amount of fuel specified by the
given air-fuel ratio, at 70 DegF, MAP of 100KPa and
VE of 100%:
43
Transient Enrichments
44
Download