International Carpathian Control Conference ICCC’ 2002 MALENOVICE, CZECH REPUBLIC May 27-30, 2002
TESTING OF A CAR ENGINE CONTROL UNIT USING THE HARDWARE-IN-THE-LOOP SIMULATION Michal JURÁK and Jiří TŮMA Department of Control Systems and Instrumentation, VSB - Technical University of Ostrava, Ostrava, Czech Republic,
[email protected] ,
[email protected] Abstract: The paper deals with a problem of prototyping the car engine control unit by using a method that is known as hardware-in-the-loop simulation. MATLAB toolboxes, namely Simulink, Real-Time Workshop and Real-Time Windows Target, are employed to prepare an engine model in a computer. The Simulink model communicates with the engine control unit via a multifunction card of the MF 604 type. Computer simulates sensors and behaviour of a real spark-ignition engine to prototype an attached control unit. An engine dynamic is based on the mass balance of air in the volume of the intake manifold and the rotational dynamic calculation of the crankshaft. Key words: control unit, engine, hardware-in-the-loop simulation, simulation, testing
1 Introduction Hardware-in-the-loop simulation is now a standard tool for the prototyping of electronic or mechanical automotive components. Traditional development of automotive electronic control unit (ECU) required extensive and expensive test with real vehicles, engines and components. The hardware-in-the-loop simulation (HWILS) is a technology, which replaces the real vehicle, engine or other components by simulation based on mathematical model. The simulation reads ECU output signal, which would normally go to actuator and in turn outputs those sensor signal which make the ECU ‘think’ it is controlling a real system. This technology can drastically reduce expensive field tests. Even failure situations, which would normally not be feasible for an experiment, can be tested. And they can be tested repeatedly under exactly the same conditions if it is desired.
347
2 Hardware-in-the-loop simulation HWILS is not always understood exactly in the way we use the term here. We must distinguish ‘Control prototyping’ from HWILS [Hanselmann 1993]. Some fast real-time computers (it may be DSP) with analog and digital I/O is connected to an object to be controlled (Figure 1). The computer is loaded with model of the desired controller for rapid proof-of-concept, parameter adjustments, etc. The control program for the later real ECU is then derived from the prototyped algorithm. controller +
_
DSP + I/O
plant
Figure 1. Control prototyping
plant
+ _
controller
DSP + I/O
Figure 2. Hardware-in-the-loop simulation With HWILS, the goal is typically just opposite (Figure 2). The controller or ECU is real, and the mechanical component is not.
3 Engine model A model is created in simulation program MATLAB/SIMULINK. The model is based on an engine analysis described in literature [Weeks, R.W. & Moskwa, J.J. 1995]. All dates employed in this model are from the ŠKODA Fabia. The engine model is physically based and captured the major dynamic (lag and delay) inherent in the spark ignition torquepredictive model. This model is derived from four state, lumped parameters model described in a SAE paper [Weeks, R.W. & Moskwa, J.J. 1995].
348
accelerator position sensor
temperature water sensor
radiator
injection
throttle position sensor
ignition
camshaft speed sensor
exhaust gas oxygen sensor sensors actuators
temperature air sensor manifold pressure sensor
crankshaft speed sensor
vibrate sensor
Figure 3. Sensor and actuator configuration in ŠKODA Fabia 1.4 50kW engine The Simulink graphical block diagram language allows that the models can be created in a modular, hierarchical format. The overall system model in Figure 4 simulates an engine and its control system consisting of an engine, engine sensors and actuators and an engine controller. The real engine control unit is connected in the loop. Skoda Fabia 1.4 MPI/44 kW Load vehicle s pecific data tem perature