Sparkignition engine controller that uses the driver torque request
Powertrain Blockset / Propulsion / Combustion Engine Controllers
The SI Controller block implements a sparkignition (SI) controller that uses the driver torque request to calculate the openloop air, fuel, and spark actuator commands that are required to meet the driver demand.
You can use the SI Controller block in engine control design or performance, fuel economy, and emission tradeoff studies. The core engine, throttle, and turbocharger wastegate subsystems require the commands that are output from the SI Controller block.
The block uses the commanded torque and engine speed to determine these openloop actuator commands:
Throttle position percent
Wastegate area percent
Injector pulsewidth
Spark advance
Intake cam phaser angle
Exhaust cam phaser angle
Exhaust gas recirculation (EGR) valve area percent
The SI Controller block has two subsystems:
The Controller
subsystem —
Determines the commands based on the commanded torque, measured engine
speed, and estimated cylinder air mass.
The Estimator
subsystem —
Determines the estimated air mass flow, torque, and exhaust gas temperature
from intake manifold gas pressure, intake manifold gas temperature,
engine speed, and cam phaser positions.
The figure illustrates the signal flow.
The figure uses these variables.
N  Engine speed 
MAP  Cycle average intake manifold pressure 
IAT 
Intake air temperature 
T_{in,EGR} 
Temperature at EGR valve inlet 
MAT  Cycle average intake manifold gas absolute temperature 
${\phi}_{ICP}$, ${\phi}_{ICPCMD}$ 
Intake cam phaser angle and intake cam phaser angle command, respectively 
${\phi}_{ECP}$, ${\phi}_{ECPCMD}$ 
Exhaust cam phaser angle and exhaust cam phaser angle command, respectively 
EGRap, EGRap_{cmd} 
EGR valve area percent and EGR valve area percent command, respectively 
ΔP_{EGR} 
Pressure difference at EGR valve inlet and outlet 
WAP_{cmd} 
Turbocharger wastegate area percent command 
SA 
Spark advance 
$P{w}_{inj}$ 
Fuel injector pulsewidth 
TPP_{cmd} 
Throttle position percent command 
The ModelBased Calibration Toolbox™ was used to develop the tables that are available with the Powertrain Blockset™.
The block determines the commanded engine load (that is, normalized cylinder air mass) from a lookup table that is a function of commanded torque and measured engine speed.
${L}_{cmd}={f}_{Lcmd}\left({T}_{cmd},N\right)$
To achieve the commanded load, the controller sets the throttle position percent and turbocharger wastegate area percent using feed forward lookup tables. The lookup tables are functions of the commanded load and measured engine speed.
$TA{P}_{cmd}={f}_{TAPcmd}\left({L}_{cmd},N\right)$
$TP{P}_{cmd}={f}_{TPPcmd}\left(TA{P}_{cmd}\right)$
$WA{P}_{cmd}={f}_{WAPcmd}\left({L}_{cmd},N\right)$
To determine the cam phaser angle commands, the block uses lookup tables that are functions of estimated engine load and measured engine speed.
${\phi}_{ICPCMD}={f}_{ICPCMD}\left({L}_{est},N\right)$
${\phi}_{ECPCMD}={f}_{ECPCMD}\left({L}_{est},N\right)$
The block calculates the desired engine load using this equation.
$${L}_{est}=\frac{Cps{R}_{air}{T}_{std}{\dot{m}}_{air,est}}{{P}_{std}{V}_{d}N}$$
The equations use these variables.
L_{est}  Estimated engine load 
L_{cmd}  Commanded engine load 
N  Engine speed 
T_{cmd}  Commanded engine torque 
TAP_{cmd}  Throttle area percent command 
TPP_{cmd}  Throttle position percent command 
WAP_{cmd}  Turbocharger wastegate area percent command 
$$Cps$$  Crankshaft revolutions per power stroke 
${P}_{std}$  Standard pressure 
${T}_{std}$  Standard temperature 
${R}_{air}$  Ideal gas constant for air and burned gas mixture 
${V}_{d}$  Displaced volume 
${\dot{m}}_{air,est}$  Estimated engine air mass flow 
The controller subsystem uses these lookup tables for the air calculations.
The throttle area percent command lookup table, ${f}_{TAPcmd}$, is a function of commanded load and engine speed
$TA{P}_{cmd}={f}_{TAPcmd}\left({L}_{cmd},N\right)$
where:
TAP_{cmd} is throttle area percentage command, in percent.
L_{cmd}=L is commanded engine load, dimensionless.
N is engine speed, in rpm.
To account for the nonlinearity of the throttle position to throttle area, the throttle position percent lookup table linearizes the openloop air mass flow control.
The throttle position percent command lookup table, ${f}_{TPPcmd}$, is a function of the throttle area percentage command
$TP{P}_{cmd}={f}_{TPPcmd}\left(TA{P}_{cmd}\right)$
where:
TPP_{cmd} is throttle position percentage command, in percent.
TAP_{cmd} is throttle area percentage command, in percent.
The wastegate area percent command lookup table, ${f}_{WAPcmd}$, is a function of the commanded engine load and engine speed
$WA{P}_{cmd}={f}_{WAPcmd}\left({L}_{cmd},N\right)$
where:
WAP_{cmd} is wastegate area percentage command, in percent.
L_{cmd}=L is commanded engine load, dimensionless.
N is engine speed, in rpm.
The commanded engine load lookup table, ${f}_{Lcmd}$, is a function of the commanded torque and engine speed
${L}_{cmd}={f}_{Lcmd}\left({T}_{cmd},N\right)$
where:
L_{cmd}=L is commanded engine load, dimensionless.
T_{cmd} is commanded torque, in N·m.
N is engine speed, in rpm.
The intake cam phaser angle command lookup table, ${f}_{ICPCMD}$, is a function of the engine load and engine speed
${\phi}_{ICPCMD}={f}_{ICPCMD}\left({L}_{est},N\right)$
where:
${\phi}_{ICPCMD}$ is commanded intake cam phaser angle, in degrees crank advance.
L_{est}=L is estimated engine load, dimensionless.
N is engine speed, in rpm.
The exhaust cam phaser angle command lookup table, ${f}_{ECPCMD}$, is a function of the engine load and engine speed
${\phi}_{ECPCMD}={f}_{ECPCMD}\left({L}_{est},N\right)$
where:
${\phi}_{ECPCMD}$ is commanded exhaust cam phaser angle, in degrees crank retard.
L_{est}=L is estimated engine load, dimensionless.
N is engine speed, in rpm.
EGR is typically expressed as a percent of total intake port flow.
$$EG{R}_{pct}=100\frac{{\dot{m}}_{EGR}}{{\dot{m}}_{EGR}+{\dot{m}}_{air}}$$
To calculate the EGR area percent command, the block uses equations and a lookup table.
Equations 
$$\begin{array}{l}{\dot{m}}_{EGRstd,cmd}={\dot{m}}_{EGR,cmd}\frac{{P}_{std}}{{P}_{in,EGR}}\sqrt{\frac{{T}_{in,EGR}}{{T}_{std}}}\\ \\ {\dot{m}}_{EGRstd,max}={f}_{EGRstd,max}\left(\frac{{P}_{out,EGR}}{{P}_{in,EGR}}\right)\\ \\ {\dot{m}}_{EGR,cmd}=EG{R}_{pct,cmd}{\dot{m}}_{intk,est}\end{array}$$

Lookup table 
The EGR area percent command, EGRap_{cmd}, lookup table is a function of the normalized mass flow and pressure ratio $$EGRa{p}_{cmd}={f}_{EGRap,cmd}\left(\frac{{\dot{m}}_{EGRstd,cmd}}{{\dot{m}}_{EGRstd,max}},\frac{{P}_{out,EGR}}{{P}_{in,EGR}}\right)$$ where:

The equations and table use these variables.
EGRap, EGRap_{cmd} 
EGR valve area percent and EGR valve area percent command, respectively 
EGR_{pct,cmd} 
EGR percent command 
$${\dot{m}}_{EGRstd,cmd}$$ 
Commanded standard mass flow 
$${\dot{m}}_{EGRstd,max}$$ 
Maximum standard mass flow 
$${\dot{m}}_{EGR,cmd}$$ 
Commanded mass flow 
$${\dot{m}}_{intk,est}$$ 
Estimated intake port mass flow 
T_{std}, P_{std} 
Standard temperature and pressure 
T_{in,EGR} 
Temperature at EGR valve inlet 
P_{out,EGR}, P_{in,EGR} 
Pressure at EGR valve inlet and outlet, respectively 
The airfuel ratio (AFR) impacts threewaycatalyst (TWC) conversion efficiency, torque production, and combustion temperature. The engine controller manages AFR by commanding injector pulsewidth from a desired relative AFR. The relative AFR, $${\lambda}_{cmd}$$, is the ratio between the commanded AFR and the stoichiometric AFR of the fuel.
${\lambda}_{cmd}=\frac{AF{R}_{cmd}}{AF{R}_{stoich}}$
$$AF{R}_{cmd}=\frac{{\dot{m}}_{air,est}}{{\dot{m}}_{fuel,cmd}}$$
The SI Controller block accounts for the extra fuel delivered to the SI engine during startup. If the engine speed is greater than the startup engine cranking speed, the SI Controller block enriches the optimal AFR, lambda, with an exponentially decaying delta lambda. To initialize the delta lambda, the block uses the engine coolant temperature at startup. The delta lambda exponentially decays to zero based on a time constant that is a function of the engine coolant temperature.
You can configure the block for openloop and closedloop AFR control.
To  Use  Controls > Fuel > Closedloop feedback Parameter Setting 

 (default) Openloop control 

 Closedloop control 

OpenLoop Control
To create an input port for the commanded AFR (lambda), on the Controls > Fuel > Openloop fuel pane, select Input lambda.
You can manually tune the catalyst for maximum efficiency during openloop AFR control with or without dither. If you want to implement dither during openloop control, on the Fuel tab, on the Closedloop fuel pane, select Dither.
By default, the block is configured to use a lookup table for the commanded AFR.
The commanded lambda, $${\lambda}_{cmd}$$, lookup table is a function of estimated engine load and measured engine speed
${\lambda}_{cmd}={f}_{\lambda cmd}\left({L}_{est},N\right)$
where:
$${\lambda}_{cmd}$$ is commanded relative AFR, dimensionless.
L_{est}=L is estimated engine load, dimensionless.
N is engine speed, in rpm.
The block calculates the estimated fuel mass flow rate using the commanded lambda, $${\lambda}_{cmd}$$, stoichiometric AFR, and estimated air mass flow rate.
$${\dot{m}}_{fuel,cmd}=\frac{{\dot{m}}_{air,est}}{AF{R}_{cmd}}=\frac{{\dot{m}}_{air,est}}{{\lambda}_{cmd}AF{R}_{stoich}}$$
The block assumes that the battery voltage and fuel pressure are at nominal settings where pulsewidth correction is not necessary. The commanded fuel injector pulsewidth is proportional to the fuel mass per injection. The fuel mass per injection is calculated from the commanded fuel mass flow rate, engine speed, and the number of cylinders.
$P{w}_{inj}=\{\begin{array}{cc}\frac{{\dot{m}}_{fuel,cmd}Cps(\frac{60s}{min})\left(\frac{1000mg}{g}\right)\left(\frac{1000g}{kg}\right)}{N{S}_{inj}{N}_{cyl}}& \text{when}Tr{q}_{cmd}0\\ 0& \text{when}Tr{q}_{cmd}\le 0\end{array}$
ClosedLoop Control
TWC converters are most efficient when the exhaust AFR is near the stoichiometric AFR, where the air and fuel burn most completely. Around this ideal point, the AFR is within the catalyst window in which the catalyst is most efficient at converting carbon monoxide, hydrocarbons, and nitrogen oxides to nonharmful exhaust products. Empirical studies show that oscillating the AFR around stoichiometry at an optimized AFR frequency, amplitude, and bias widens the TWC window, increasing catalyst conversion efficiency in the presence of unavoidable disturbances.
To keep production hardware costs down, AFR control systems include inexpensive switching oxygen sensors positioned in the engine exhaust stream upstream and downstream of the catalyst. The oxygen sensors have a narrow range. Essentially, they switch between too lean (i.e., more air is available than is required to burn the available fuel) and too rich (i.e., more air is available than is required to burn the available fuel).
The block implements a periodbased method to control the average AFR at a value within the catalyst window for maximum conversion efficiency. Periodbased AFR control is independent of the transport delay across the engine from the fuel injection point to the sensor measurement point. For more information about the method, see Developing a PeriodBased AirFuel Ratio Controller Using a LowCost Switching Sensor.
Spark advance is the crank angle before top dead center (BTDC) of the power stroke when the spark is delivered. The spark advance has an impact on engine efficiency, torque, exhaust temperature, knock, and emissions.
The spark advance lookup table is a function of estimated load and engine speed.
$SA={f}_{SA}\left({L}_{est},N\right)$
where:
SA is spark advance, in crank advance degrees.
L_{est}=L is estimated engine load, dimensionless.
N is engine speed, in rpm.
The equations use these variables.
L_{est}  Estimated engine load, based on normalized cylinder air mass 
N  Engine speed 
${f}_{SA}$  Lookup table for spark advance 
N  Spark advance 
When the commanded torque is below a threshold value, the idle speed controller regulates the engine speed.
If  Idle Speed Controller 

Trq_{cmd,input} < Trq_{idlecmd,enable}  Enabled 
Trq_{idlecmd,enable} ≤ Trq_{cmd,input}  Not enabled 
The idle speed controller uses a discrete PI controller to regulate the target idle speed by commanding a torque.
The PI controller uses this transfer function:
${C}_{idle}\left(z\right)={K}_{p,idle}+{K}_{i,idle}\frac{{t}_{s}}{z1}$
The idle speed commanded torque must be less than the maximum commanded torque:
0 ≤ Trq_{idlecomd} ≤Trq_{idlecmd,max}
Idle speed control is active under these conditions. If the commanded input torque drops below the threshold for enabling the idle speed controller (Trq_{cmd,input} < Trq_{idlecmd,enable}), the commanded engine torque is given by:
Trq_{cmd} = max(Trq_{cmd,input},Trq_{idlecmd}).
The equations use these variables.
Trq_{cmd}  Commanded engine torque 
Trq_{cmd,input}  Input commanded engine torque 
Trq_{idlecmd,enable}  Threshold for enabling idle speed controller 
Trq_{idlecmd}  Idle speed controller commanded torque 
Trq_{idlecmd,max}  Maximum commanded torque 
N_{idle}  Base idle speed 
K_{p,idle}  Idle speed controller proportional gain 
K_{i,idle}  Idle speed controller integral gain 
To prevent over revving the engine, the block implements an engine speed limit controller that limits the engine speed to the value specified by the Revlimiter speed threshold parameter on the Controls > Idle Speed tab.
If the engine speed, N, exceeds the engine speed limit, N_{lim}, the block sets the commanded engine torque to 0.
To smoothly transition the torque command to 0 as the engine speed approaches the speed limit, the block implements a lookup table multiplier. The lookup table multiplies the torque command by a value that ranges from 0 (engine speed exceeds limit) to 1 (engine speed does not exceed the limit).
The estimator subsystem determines the estimated air mass flow, torque, EGR mass flow, and exhaust temperature based on sensor feedback and calibration parameters.
${\dot{m}}_{air,est}$ 
Estimated engine air mass flow 
Trq_{est} 
Estimated engine torque 
T_{exh,est} 
Estimated engine exhaust temperature 
$${\dot{m}}_{EGR,est}$$ 
Estimated lowpressure EGR mass flow 
To calculate engine air mass flow, configure the SI engine to use either of these air mass flow models.
Air Mass Flow Model  Description 

SI Engine SpeedDensity Air Mass Flow Model 
Uses the speeddensity equation to calculate the engine air mass flow, relating the engine air mass flow to the intake manifold pressure and engine speed. Consider using this air mass flow model in engines with fixed valvetrain designs. 
SI Engine DualIndependent Cam Phaser Air Mass Flow Model 
To calculate the engine air mass flow, the dualindependent cam phaser model uses:
In contrast to typical embedded air mass flow calculations based on direct air mass flow measurement with an air mass flow (MAF) sensor, this air mass flow model offers:

To determine the estimated air mass flow, the block uses the intake air mass fraction. The EGR mass fraction at the intake port lags the mass fraction near the EGR valve outlet. To model the lag, the block uses a first order system with a time constant.
$${y}_{intk,EGR,est}=\frac{{\dot{m}}_{EGR,est}}{{\dot{m}}_{intk,est}}\frac{{t}_{s}z}{{\tau}_{EGR}z+{t}_{s}{\tau}_{EGR}}$$
The remainder of the gas is air.
$${y}_{intk,air,est}=1{y}_{intk,EGR,est}$$
The equations use these variables.
y_{intk,EGR,est} 
Estimated intake manifold EGR mass fraction 
y_{intk,air,est} 
Estimated intake manifold air mass fraction 
$${\dot{m}}_{EGR,est}$$ 
Estimated lowpressure EGR mass flow 
$${\dot{m}}_{intk,est}$$ 
Estimated intake port mass flow 
τ_{EGR}  EGR time constant 
To calculate the brake torque, configure the SI engine to use either of these torque models.
Brake Torque Model  Description 

SI Engine Torque Structure Model 
For the structured brake torque calculation, the SI engine uses tables for the inner torque, friction torque, optimal spark, spark efficiency, and lambda efficiency. 
SI Engine Simple Torque Model 
For the simple brake torque calculation, the SI engine block uses a torque lookup table map that is a function of engine speed and load. 
The controller estimates lowpressure mass flow, EGR valve inlet pressure, and EGR valve outlet pressure using an algorithm developed by F. Liu and J. Pfeiffer. The estimator requires measured EGR valve differential pressure, EGR valve area percent, intake air temperature, and EGR valve inlet temperature.
To estimate the EGR valve commands, the block uses:
Equations
$$\begin{array}{l}{\dot{m}}_{air,std}={\dot{m}}_{air,est}\frac{{P}_{std}}{{P}_{amb}}\sqrt{\frac{IAT}{{T}_{std}}}\\ \\ {P}_{in,EGR}={P}_{out,EGR}+\Delta {P}_{EGR}\\ \\ {\dot{m}}_{EGR,est}={\dot{m}}_{EGR,std}\frac{{P}_{in,EGR}}{{P}_{std}}\sqrt{\frac{{T}_{std}}{{T}_{in,EGR}}}\end{array}$$
Tables
The EGR valve standard mass flow lookup table is a function of EGR valve area percent and the pressure ratio
$${\dot{m}}_{EGR,std}={f}_{EGR,std}\left(EGRap,\frac{{P}_{out,EGR}}{{P}_{in,EGR}}\right)$$
where:
$${\dot{m}}_{EGR,std}$$ is EGR valve standard mass flow, dimensionless.
EGRap is EGR valve flow area percent, in percent.
$$\frac{{P}_{out,EGR}}{{P}_{in,EGR}}$$ is the pressure ratio, dimensionless.
The pressure ratio is a function of the standard mass flow
$$\frac{{P}_{out,EGR}}{{P}_{amb}}={f}_{intksys,pr}({\dot{m}}_{air,std})$$
where:
$${\dot{m}}_{air,std}$$ is standard mass flow, in g/s.
$$\frac{{P}_{out,EGR}}{{P}_{amb}}$$ is pressure ratio, dimensionless.
The equations use these variables.
EGRap 
EGR valve area percent command 
IAT 
Intake air temperature 
$${\dot{m}}_{air,std}$$, $${\dot{m}}_{EGR,std}$$ 
Standard air and EGR valve mass flow, respectively 
${\dot{m}}_{air,est}$,$${\dot{m}}_{EGR,est}$$ 
Estimated air and EGR valve mass flow, respectively 
T_{std}, P_{std} 
Standard temperature and pressure 
T_{amb}, P_{amb} 
Ambient temperature and pressure 
ΔP_{EGR} 
Pressure difference at EGR valve inlet and outlet 
T_{in,EGR}, T_{out,EGR} 
Temperature at EGR valve inlet and outlet, respectively 
P_{in,EGR}, P_{out,EGR} 
Pressure at EGR valve inlet and outlet, respectively 
The exhaust temperature lookup table, ${f}_{Texh}$, is a function of engine load and engine speed
${T}_{exh}={f}_{Texh}(L,N)$
where:
T_{exh} is engine exhaust temperature, in K.
L is normalized cylinder air mass or engine load, dimensionless.
N is engine speed, in rpm.
[1] Gerhardt, J., Hönninger, H., and Bischof, H., A New Approach to Functional and Software Structure for Engine Management Systems — BOSCH ME7. SAE Technical Paper 980801, 1998.
[2] Heywood, John B. Internal Combustion Engine Fundamentals. New York: McGrawHill, 1988.
[3] Leone, T. Christenson, E., Stein, R., Comparison of Variable Camshaft Timing Strategies at Part Load. SAE Technical Paper 960584, 1996, doi:10.4271/960584.
[4] Liu, F. and Pfeiffer, J., Estimation Algorithms for Low Pressure Cooled EGR in SparkIgnition Engines. SAE Int. J. Engines 8(4):2015, doi:10.4271/2015011620.