Using Simulink and Stateflow in Automotive Applicationsl

pdf
Số trang Using Simulink and Stateflow in Automotive Applicationsl 92 Cỡ tệp Using Simulink and Stateflow in Automotive Applicationsl 736 KB Lượt tải Using Simulink and Stateflow in Automotive Applicationsl 0 Lượt đọc Using Simulink and Stateflow in Automotive Applicationsl 59
Đánh giá Using Simulink and Stateflow in Automotive Applicationsl
4.4 ( 17 lượt)
Nhấn vào bên dưới để tải tài liệu
Đang xem trước 10 trên tổng 92 trang, để tải xuống xem đầy đủ hãy nhấn vào bên trên
Chủ đề liên quan

Nội dung

S IMULINK -S TATEFLOW T ECHNICAL E XAMPLES Using Simulink and Stateflow in Automotive Applications ® Abstract TM 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, facilitate TM the design of automotive control systems. Each example explains the principles of the physical situation, 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. TABLE OF C ONTENTS 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 USING S IMULINK AND S TATEFLOW IN A UTOMOTIVE A PPLICATIONS 3 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 Description The examples cited in this booklet consist of application design tasks typically encountered in 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 4 S IMULINK -S TATEFLOW T ECHNICAL EXAMPLES 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 Model Files The models used in this book are available via ftp at 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 Information The MathWorks technical personnel specializing in automotive solutions can be reached via e-mail 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 USING S IMULINK AND S TATEFLOW IN A UTOMOTIVE A PPLICATIONS 5 Or contact any of our international distributors and resellers directly. See the back page for additional contact information. Both Modular Systems and Cambridge Control Ltd. offer consulting services in automotive modeling. They can be reached as follows: Attention: Robert W. Weeks Modular Systems 714 Sheridan Road Evanston, IL 60202-2502 USA Tel: 708-869-2023 E-mail: bobweeks@ix.netcom.com Attention: Sham Ahmed Cambridge Control Ltd. Newton House Cambridge Business Park Cowley Road Cambridge, DB4 4WZ UK 011/44-1223-423-2 E-mail: Sham@camcontrol.co.uk 6 S IMULINK -S TATEFLOW T ECHNICAL EXAMPLES System Models in Simulink USING S IMULINK AND S TATEFLOW IN A UTOMOTIVE A PPLICATIONS 7 I. ENGINE MODEL Summary This example presents a model of a four-cylinder spark ignition engine and demonstrates Simulink’s capabilities to model an internal combustion engine from the throttle to the crankshaft output. We used well-defined physical principles supplemented, where appropriate, with empirical relationships that describe the system’s dynamic behavior without introducing unnecessary complexity. Overview This example describes the concepts and details surrounding the creation of engine models with emphasis on important Simulink modeling techniques. The basic model uses the enhanced capabilities of Simulink 2 to capture time-based events with high fidelity. Within this simulation, a triggered subsystem models the transfer of the air-fuel mixture from the intake manifold to the cylinders via discrete valve events. This takes place concurrently with the continuous-time processes of intake flow, torque generation and acceleration. A second model adds an additional triggered subsystem that provides closed-loop engine speed control via a throttle actuator. These models can be used as standalone engine simulations. Or, they can be used within a larger system model, such as an integrated vehicle and powertrain simulation, in the development of a traction control system. Model Description This model, based on published results by Crossley and Cook (1991), describes the simulation of a fourcylinder spark ignition internal combustion engine. The Crossley and Cook work also shows how a simulation based on this model was validated against dynamometer test data. The ensuing sections (listed below) analyze the key elements of the engine model that were identified by Crossley and Cook: • Throttle • Intake manifold • Mass flow rate • Compression stroke • Torque generation and acceleration Note: Additional components can be added to the model to provide greater accuracy in simulation and to more closely replicate the behavior of the system. Analysis and Physics THROTTLE The first element of the simulation is the throttle body. Here, the control input is the angle of the throttle plate. The rate at which the model introduces air into the intake manifold can be expressed as the product of two functions—one, an empirical function of the throttle plate angle only; and the other, a function of the atmospheric and manifold pressures. In cases of lower manifold pressure (greater vacuum), the flow rate through the throttle body is sonic and is only a function of the throttle angle. This model accounts for 8 S IMULINK -S TATEFLOW T ECHNICAL EXAMPLES this low pressure behavior with a switching condition in the compressibility equations shown in Equation 1.1. m˙ ai = f (θ )g (Pm ) = mass flow rate into manifold (g/s) where, f (θ ) = 2.821 − 0.05231θ + 0.10299θ 2 − 0.00063θ 3 θ = throttle angle (deg) Equation 1.1  P Pm ≤ amb 1, 2  P 2 2 amb  Pm Pamb − Pm , ≤ Pm ≤ Pamb  2 g (Pm ) =  Pamb  2 2 Pm Pamb − Pamb , Pamb ≤ Pm ≤ 2Pamb − P  m −1, Pm ≥ 2Pamb  Pm = manifold pressure (bar) Pamb = ambient (atmospheric) pressure (bar) Intake Manifold The simulation models the intake manifold as a differential equation for the manifold pressure. The difference in the incoming and outgoing mass flow rates represents the net rate of change of air mass with respect to time. This quantity, according to the ideal gas law, is proportional to the time derivative of the manifold pressure. Note that, unlike the model of Crossley and Cook, 1991(1) (see also references 3 through 5), this model doesn’t incorporate exhaust gas recirculation (EGR), although this can easily be added. RT P˙ m = (m˙ ai − m˙ ao ) Vm Equation 1.2 where, R = specific gas constant T = temerature (˚K) Vm = manifold volume (m 3 ) m˙ ao = mass flow rate of air out of the manifold (g/s) P˙ m = rate of change of manifold pressure (bar/s) Intake Mass Flow Rate The mass flow rate of air that the model pumps into the cylinders from the manifold is described in Equation 1.3 by an empirically derived equation. This mass rate is a function of the manifold pressure and the engine speed. 2 m˙ ao = −0.366 + 0.08979 NPm − 0.0337NPm + 0.0001N 2P m USING S IMULINK AND S TATEFLOW IN A UTOMOTIVE A PPLICATIONS Equation 1.3 9 where, N = engine speed (rad/s) Pm = manifold pressure (bar) To determine the total air charge pumped into the cylinders, the simulation integrates the mass flow rate from the intake manifold and samples it at the end of each intake stroke event. This determines the total air mass that is present in each cylinder after the intake stroke and before compression. Compression Stroke In an inline four-cylinder four-stroke engine, 180° of crankshaft revolution separate the ignition of each successive cylinder. This results in each cylinder firing on every other crank revolution. In this model, the intake, compression, combustion, and exhaust strokes occur simultaneously (at any given time, one cylinder is in each phase). To account for compression, the combustion of each intake charge is delayed by 180° of crank rotation from the end of the intake stroke. Torque Generation and Acceleration The final element of the simulation describes the torque developed by the engine. An empirical relationship dependent upon the mass of the air charge, the air/fuel mixture ratio, the spark advance, and the engine speed is used for the torque computation. Torque eng = −181.3 + 379.36 m a + 21.91( A / F ) − 0.85( A / F ) 2 + 0.26σ − 0.0028σ 2 +0.027N − 0.000107N 2 + 0.00048Nσ + 2.55σm a − 0.05σ 2 m a Equation 1.4 where, ma = mass of air in cylinder for combustion (g) A / F = air to fuel ratio σ = spark advance (degrees before top - dead - center Torqueeng = torque produced by the engine (Nm) The engine torque less the net load torque results in acceleration. JN˙ = Torqueeng − Torqueload Equation 1.5 where, J = Engine rotational moment of inertia (kg-m2) Ṅ = Engine acceleration (rad/s2) 10 S IMULINK -S TATEFLOW T ECHNICAL EXAMPLES
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.