Using Simulink
®
and Stateflow
TM
in Automotive Applications
SIMULINK-STATEFLOW TECHNICAL EXAMPLES
This book includes nine examples that represent typical design tasks of an automotive engineer. It
shows how The MathWorks modeling and simulation tools, Simulink
®
and Stateflow,
TM
facilitate
the design of automotive control systems. Each example explains the principles of the physical sit-
uation, and presents the equations that represent the system. The examples show how to proceed
from the physical equations to the Simulink block diagram. Once the Simulink model has been
completed, we run the simulation, analyze the results, and draw conclusions from the study.
Abstract
USING SIMULINK AND STATEFLOW IN AUTOMOTIVE APPLICATIONS 3
TABLE OF CONTENTS
Introduction.......................................................................................................................4
System Models in Simulink................................................................................................7
I. Engine Model..............................................................................................................8
II. Anti-Lock Braking System........................................................................................18
III. Clutch Engagement Model.......................................................................................23
IV. Suspension System....................................................................................................31
V. Hydraulic Systems....................................................................................................35
System Models in Simulink with Stateflow Enhancements..........................................49
VI. Fault-Tolerant Fuel Control System........................................................................50
VII. Automatic Transmission Control.............................................................................61
VIII. Electrohydraulic Servo Control...............................................................................71
IX. Modeling Stick-Slip Friction....................................................................................84
4 SIMULINK-STATEFLOW T ECHNICAL EXAMPLES
INTRODUCTION
Summary Automotive engineers have found simulation to be a vital tool in the timely and cost-effective
development of advanced control systems. As a design tool, Simulink has become the standard for
excellence through its flexible and accurate modeling and simulation capabilities. As a result of its open
architecture, Simulink allows engineers to create custom block libraries so they can leverage each other’s
work. By sharing a common set of tools and libraries, engineers can work together effectively within
individual work groups and throughout the entire engineering department.
In addition to the efficiencies achieved by Simulink, the design process can also benefit from Stateflow, an
interactive design tool that enables the modeling and simulation of complex reactive systems. Tightly
integrated with Simulink, Stateflow allows engineers to design embedded control systems by giving them
an efficient graphical technique to incorporate complex control and supervisory logic within their
Simulink models.
This booklet describes nine automotive design examples that illustrate the strengths of Simulink and
Stateflow in accelerating and facilitating the design process.
Examples The examples cited in this booklet consist of application design tasks typically encountered in
Description the automotive industry. We present a variety of detailed models including the underlying
equations, block diagrams, and simulation results. The material may serve as a starting point for the
new Simulink user or as a reference for the more experienced user. In the models, we propose approaches
for model development, present solutions to challenging problems, and illustrate some of the most
common design uses of Simulink and Stateflow today.
The applications and models described in this booklet include the following examples using Simulink
alone:
I. Engine Model
engine.mdl — open-loop simulation
enginewc.mdl — closed-loop simulation
II. Anti-Lock Braking System
absbrake.mdl
III. Clutch Engagement Model
clutch.mdl
IV. Suspension System
suspn.mdl
V. Hydraulic Systems
hydcyl.mdl — Pump and actuator assembly
hydcyl4
.mdl — Four-cylinder model
hydrod
.mdl — Two-cylinder model with load constraints
USING SIMULINK AND STATEFLOW IN AUTOMOTIVE APPLICATIONS 5
The following applications and models use Simulink enhanced with Stateflow:
VI. Fault-Tolerant Fuel Control System
fuelsys.mdl
VII. Automatic Transmission Control
sf_car.mdl
VIII. Electrohydraulic Servo Control
sf_electrohydraulic.mdl
IX. Modeling Stick-Slip Friction
sf_stickslip.mdl
Simulink The models used in this book are available via ftp at
Model Files ftp://ftp.mathworks.com/pub/product-info/examples/autobook.zip. This zip file contains the set
of MDL, MAT, and M-files containing Simulink models that users can explore and build upon. The
included files require MATLAB® 5.1, Simulink 2.1, and Stateflow 1.0. Models for these applications can be
opened in Simulink by typing the name of the model at the MATLAB command prompt. MATLAB,
Simulink, and Stateflow are not included with this booklet. To obtain a copy of MATLAB, Simulink, and
Stateflow, or for a diskette containing the model files, please contact your representative at The
MathWorks.
Acknowledgments The engine model is based on published findings by Crossley and Cook (1991)(1). We’d like to thank
Ken Butts and Jeff Cook of the Ford Motor Company for permission to include this model and for
subsequent help in building the model in Simulink.
The clutch and hydraulic cylinder models are based on equations provided by General Motors. We’d like
to thank Eric Gassenfeit of General Motors for permission to include these models.
The vehicle suspension model was written by David MacClay of Cambridge Control Ltd.
The simple three-state engine model and the set of icons that are relevant for automotive modeling were
provided by Modular Systems. A far more detailed engine model may be purchased directly from Modular
Systems.
Contact The MathWorks technical personnel specializing in automotive solutions can be reached via e-mail
Information at the following addresses:
Stan Quinn squinn@mathworks.com
Andy Grace agrace@mathworks.com
Paul Barnard pbarnard@mathworks.com
Larry Michaels lmichaels@mathworks.com
Bill Aldrich baldrich@mathworks.com
评论0