Stateflow | ![]() ![]() |
Overview of the "fuel rate controller" Model
The mass flow rate of air pumped from the intake manifold, divided by the fuel rate, which is injected at the valves, gives the air/fuel ratio. The ideal mixture ratio provides a good compromise between power, fuel economy, and emissions. A target air/fuel ratio of 14.6 is assumed in this system.
A sensor (EGO) determines the amount of residual oxygen present in the exhaust gas. This gives a good indication of the air/fuel ratio and provides a feedback measurement for closed-loop control. If the sensor indicates a high oxygen level, the controller increases the fuel rate. If the sensor detects a fuel-rich mixture (corresponding to a very low level of residual oxygen), the controller decreases the fuel rate.
The following figure shows the top level of the Simulink model (fuelsys.mdl
). The model is modularized into a fuel rate controller and a subsystem to simulate engine gas dynamics.
The fuel rate controller uses signals from the system's sensors to determine the fuel rate that gives an ideal mixture. The fuel rate combines with the actual air flow in the engine gas dynamics model to determine the resulting mixture ratio as sensed at the exhaust.
To simulate failures in the system, the user can selectively disable each of the four sensors: throttle angle, speed, exhaust gas (EGO), and manifold absolute pressure (MAP). Simulink accomplishes this with Manual Switch blocks. The user can toggle the position of a switch by double-clicking its icon prior to or during a simulation. Similarly, the user can induce the failure condition of a high engine speed by toggling the switch on the far left.
The controller uses the sensor input and feedback signals to adjust the fuel rate to provide an ideal ratio. The model uses four subsystems to implement this strategy: control logic, sensor correction, airflow calculation, and fuel calculation. Under normal operation, the model estimates the airflow rate and multiplies the estimate by the reciprocal of the desired ratio to give the fuel rate. Feedback from the oxygen sensor provides a closed-loop adjustment of the rate estimation in order to maintain the ideal mixture ratio.
A detailed explanation of the Simulink part of the fault-tolerant control system is given in Using Simulink and Stateflow in Automotive Applications, a Simulink-Stateflow Technical Examples booklet published by The MathWorks. This section concentrates on the supervisory logic part of the system that is implemented in Stateflow, but the following points are crucial to the interaction between Simulink and Stateflow:
fail_state
.
The fueling mode can be one of the following modes:
The fueling mode and failure state are output from Stateflow as fuel_mode
and fail_state
respectively into the algorithmic part of the model, where they determine the fueling calculations.
![]() | Exploring a Real-World Stateflow Application | Control Logic of the "fuel rate controller" Model | ![]() |