Main Content

Engine Timing Model with Closed Loop Control

This example shows how to develop and implement a closed loop control algorithm for the open loop engine model described in Model Engine Timing Using Triggered Subsystems. In this example, the model sldemo_enginewc contains a controller that regulates engine speed using a fast throttle actuator such that changes in load torque have minimal effect. The controller is implemented using a discrete PI controller.

Closed Loop Model

Controller Equations

This example uses a Proportional-Integral (PI) controller as described by the following equations.

$$ \theta = K_{\rho}(N_{set}-N) + K_I \int (N_{set}-N) dt $$

$$ N_{set} = \mbox{ speed set point (rpm) } $$

$$ K_{\rho} = \mbox{ proportional gain } $$

$$ K_I = \mbox{ integral gain } $$

The integral term adjusts the steady-state throttle as the set point changes and the proportional term compensates for the phase lag introduced by the integrator. The integral term in the equation is realized with a discrete-time approximation. As is typical in industry, the controller execution is synchronized with the crankshaft rotation of the engine. The Controller subsystem in the sldemo_enginewc model uses a Discrete PID controller block that implements the PI controller in discrete time, which is suitable for microprocessor implementation. The controller executes each time the subsystem is triggered.

Simulate the Model and Visualize the Results

The model logs output data to the base workspace in a data set named sldemo_enginewc_output. Alternatively, you can visualize the logged signal using Simulink® Data Inspector. For more information, see Simulation Data Inspector. The speed set point steps up from 2000 rpm to 3000 rpm at t = 5 s. The torque disturbances are identical to those used in the open-loop model sldemo_engine. The controller parameters are tuned to achieve a quick transient response with zero steady-state error. The steady state response is displayed using three different sets of Ki and Kp values, which helps to understand the relative effects of Proportional (Kp) and Integral (Ki) gain on the steady state response of the engine model. You can tune the PI controller at the MATLAB® command line.

See Also

| | | |

Related Topics

References

[1] Crossley, P. R., and J. A. Cook. “A Nonlinear Engine Model for Drivetrain System Development.” International Conference on Control 1991. Control ’91 1991, pp. 921–25 vol.2. IEEE Xplore, DOI.org (Crossref), https://ieeexplore.ieee.org/abstract/document/98573.

[2] The Simulink Model. Developed by Ken Butts, Ford Motor Company. Modified by Paul Barnard, Ted Liefeld and Stan Quinn, MathWorks®, 1994–7."

[3] Moskwa, John J., and J. Karl Hedrick. “Automotive Engine Modeling for Real Time Control Application.” 1987 American Control Conference, 1987, pp. 341–46. IEEE Xplore, DOIː 10.23919/ACC.1987.4789343.

[4] Powell, B. K., and J. A. Cook. “Nonlinear Low Frequency Phenomenological Engine Modeling and Analysis.” 1987 American control conference, 1987, pp. 332–40. IEEE Xplore, DOIː 10.23919/ACC.1987.4789342.

[5] Weeks, Robert W., and John J. Moskwa. “Automotive Engine Modeling for Real-Time Control Using MATLAB/SIMULINK.” SAE transactions, vol. 104, 1995, pp. 295–309. JSTOR, https://www.jstor.org/stable/44473229.