technical documentation v1.0 - isy.liu.se · technical documentation [email protected] 2 project...

58
LiTH Reglering av Avgaser, Tomgång och Trottel 2008-05-15 Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 1 Technical documentation Niclas Lerede Version 1.0 Status Inspected 2008-05-14 PA, NL, TL Approved

Upload: others

Post on 23-Oct-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 1

    Technical documentation Niclas Lerede

    Version 1.0

    Status

    Inspected 2008-05-14 PA, NL, TL

    Approved

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 2

    PROJECT IDENTITY 2008, RATT

    Linköpings tekniska högskola, ISY- Fordonssystem

    Name Responsibility Telephone E-mail

    Daniel Ahlberg subsystem 1 070-2727992 [email protected]

    Patrik Axelsson 073-3840900 [email protected]

    Andreas Hall Delivery 070-5953327 [email protected]

    Niclas Lerede Documents 070-2988254 [email protected]

    Tobias Lindell 070-9306929 [email protected]

    Andreas Myklebust quality/tests 070-2926793 [email protected]

    Fredrik Petersson project leader (PL) 070-2579379 [email protected]

    Andreas Thomasson subsystem 2 070-3399804 [email protected]

    Peter Wallebäck subsystem 3 073-6720139 [email protected]

    Home page: http://www.isy.liu.se/edu/projekt/tsrt71/2008/ratt

    Customer: General Motors Powertrain Sweden AB

    Contact at the customer: Richard Backman

    Responsible for the course: Daniel Axehill

    Buyer: Lars Eriksson

    Instructor: Oskar Leufvén

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 3

    CONTENTS

    1. INTRODUCTION ....................................................................................................................................... 5

    1.1. PARTS ................................................................................................................................................... 5 1.2. PURPOSE AND AIMS ............................................................................................................................... 5 1.3. FUTURE USE .......................................................................................................................................... 5 1.4. BACKGROUND INFORMATION ............................................................................................................... 5

    2. OVERVIEW ................................................................................................................................................ 6

    2.1. THROTTLE SERVO CONTROLLER............................................................................................................ 6 2.1.1. Model ............................................................................................................................................. 7 2.1.2. Identification of parameters, model ............................................................................................. 11 2.1.3. The air momentum model ............................................................................................................ 14 2.1.4. Validation of the throttle servo- and air momentum models ........................................................ 15 2.1.5. The controller .............................................................................................................................. 17 2.1.6. Controller 1: Throttle servo controller ........................................................................................ 18 2.1.7. Parameter list: Throttle servo controller ..................................................................................... 20 2.1.8. Tuning of parameters: ................................................................................................................. 21 2.1.9. Validation Throttle Servo Controller ........................................................................................... 22 2.1.10. Controller 2: Throttle Air Controller .......................................................................................... 23 2.1.11. Parameter list, controller 2 ......................................................................................................... 24

    2.2. FUEL CONTROL ................................................................................................................................... 25 2.2.1. Models ......................................................................................................................................... 25 2.2.2. Model Parameter Estimation ....................................................................................................... 28 2.2.3. Controller .................................................................................................................................... 30

    2.3. DRIVER MODEL, VEHICLE MODEL AND ENGINE MODEL FOR STUDIES OF IDLE CONTROLLER ................ 35 2.3.1. Driver model ................................................................................................................................ 35 2.3.2. Vehicle model............................................................................................................................... 39 2.3.3. Model for studies of idle controller ............................................................................................. 46

    2.4. IDLE CONTROLLER .............................................................................................................................. 50 2.4.1. Testing of idle controller and selector with model ...................................................................... 55

    2.5. MODEL OF TURBOCHARGER ................................................................................................................ 55 2.5.1. Model ........................................................................................................................................... 56

    2.6. MODULARITY AND ABILITY TO UPGRADE THE SYSTEM ....................................................................... 57

    REFERENCES .................................................................................................................................................... 58

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 4

    Document history

    Version Date Changes Done by Inspected by

    1.0 2008-05-15 NL PA, NL, TL

    0.2 2008-05-13 Changes made in accordance with the buyer’s comments and

    further linguistic improvements

    NL, PA,

    TL, AT

    PA, NL, TL

    0.1 2008-05-09 First version all NL, PW

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 5

    1. Introduction

    1.1. Parts

    Richard Backman is our contact at the customer General Motors Powertrain Sweden. Lars

    Eriksson at ISY – Vehicular systems is responsible for the order and Oskar Leufvén is

    supervising the work. RATT is a group of students at LiTH and is the producer.

    1.2. Purpose and aims

    The purpose is to develop models and model based controllers for future use in turbo engines.

    Engines in test cells as well as advanced prototype vehicles are used during the development

    work. Safety aspects are of high importance since real engines and vehicles are used.

    The aim is to improve the present models and controllers so they can be used in future

    production vehicles. The functionality and performance of the controllers will be

    demonstrated in several stages: simulation, tests in motor cell and finally tests in a prototype

    vehicle.

    1.3. Future use

    The results will be used by GMPT-S in their continuous development of engine control

    systems.

    1.4. Background information

    The engine is a 2 litre direct injected petrol engine with a twin scroll turbo, intercooler and

    variable camshafts. The power in production versions is approximately 260 hp, but the

    potential is essentially higher.

    All vehicle producers are concerned with models and control systems for engines. The goal is

    to create a system that within given economical and production technical frames are as good

    as possible for the end user and the environment. Models and control algorithms must not

    only manage reference conditions but also various kinds of noises and disturbances.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 6

    2. Overview The system consists of a couple of subsystems

    Figure 2-1: System overview

    Figure 2-2: Controllers

    Figure 2-3: Different models

    2.1. Throttle servo controller

    The throttle uses a DC servo to control the position of the throttle valve. To construct a

    controller which controls the air mass flow with enough precision, a model of the throttle

    servo is needed.

    In the throttle servo there are nonlinearities which partly come from friction and partly from

    the limp-home state. The limp-home state is the angle of the throttle valve that will guarantee

    that the car will receive enough gas to be able to limp-home in the case of an electronic

    breakdown.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 7

    2.1.1. Model

    Overview

    What is referred to as “Throttle” in Figure 2-4 is the same as in the mean value engine model

    that was delivered by ISY – Vehicular systems. The model “Throttle servo” is a subsystem

    which among other things handle the limp-home functionality (see the throttle servo). Smaller

    subsystems exist for the calculation of angle to area as well as air mass flow to torque on the

    throttle valve caused by the air mass flow.

    Figure 2-4: Simulink implementation of the throttle model. The model consists of four major

    parts. The air momentum model, the throttle servo model which includes the limp-home

    model, the effective area estimation and the original MVEM throttle model.

    Inputs:

    • Voltage (u) [V]

    • Pressure in the intercooler (p up) [Pa]

    • Temperature in the intercooler (T up) [K]

    • Temperature in the intake manifold (T down) [K] • Pressure in the intake manifold (p down) [Pa]

    Outputs:

    • Air mass flow (m flow) [kg/s]

    • Temperature of the air mass flow (T flow) [K]

    Throttle servo model

    The throttle is modelled with a limp-home model. It consists of two linear parts where the

    back spring torque is linear with the throttle valve angle. At the limp-home angle (around

    30% open) there is a dead zone, where a voltage change gives a very small (or non-existent)

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 8

    change of the throttle valve angle. There is also considerable friction in the throttle, which is

    modelled as nonlinearity (see the model of the friction below).

    Figure 2-5: Simulink implementation of the throttle servo model. The voltage gain is the back

    voltage gain created when a momentum is generated by the DC servo.

    Signals:

    • mm – torque from the servo [N]

    • ms – torque correction from the model of the limp-home model [N] • mL – throttle valve torque caused by the air mass flow [N]

    • ωm – angular velocity of the servo [1/s]

    • uemf – return voltage caused by the servo torque build up [V]

    Parameters:

    • Kv – Voltage amplification caused by the engine torque build up • Ka – DC engine amplification

    • Ta – Time constant of the servo

    • Kl – 1/ Kl = gear ratio

    Input:

    • u – voltage to the servo [V]

    Output:

    • θ – throttle plate angle (% open; range [0-1])

    To allow parameter setting, Ka is moved to the friction and limp-home model, Kl is moved to

    the limp-home model, the friction model and the friction gain. uemf is replaced by memf in

    order to reduce simulation time. memf is having the same effect as a low pass filter reducing

    high frequent disturbances, which is not normally occurring in a throttle, see Figure 2-6.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 9

    Figure 2-6: Simulink implementation of a simplified throttle servo model. The voltage gain

    has the same effect as a low pass filter and decreases the simulation time.

    The throttle servo is described by the following equations [2].

    uKm

    dt

    dmT am

    m

    a =+ (1)

    vmemf Km *ω= (2)

    emfLsmapp mmmmm −−−= (3)

    m

    dt

    θ=

    (4)

    )(θss fm = where fs(θ) is given by the limp-home model (5)

    ≥+−

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 10

    Figure 2-7: Model of the friction in the throttle servo. Maximum friction is determined by Mf.

    Signals:

    • mf – friction torque [N]

    Parameters:

    • Mf – Coulomb friction • Kf – Depends on Mf, see below for the definition • Kj – KaKl/moment of inertia

    Input:

    • mapp – Applied torque [N]

    Output:

    • ωm – Angular velocity of the servo [rad/s]

    The friction is described by the equations (8) and (9).

    otherwise

    Mm

    Mmif

    Kdt

    dm

    ffm

    ffm

    mf

    f

    −≤≤

    ≥≥

    = I

    I

    0

    0,0

    ω

    ω

    ω

    (8)

    )( fappj

    m mmKdt

    d−=

    ω

    (9)

    ps

    f

    f

    MK

    θ= , where θps is the pre-slide coefficient.

    (10)

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 11

    2.1.2. Identification of parameters, model

    The time delay Ta is identified as the delay of a step in power to when the throttle valve reacts. Generally it is

    much smaller than the sample time and is identified as 0.014s.

    Ramp response analysis

    To identify the parameters of the limp-home mode, θLH1, θLH2, mLH1 and mLH2, a slow ramp

    response analysis is necessary. The DC engine input voltage u is ramped in both directions in

    order to see the effects of the friction. From the results a mean value can be plotted and then

    the parameters can be identified according to Figure 2-8.

    Figure 2-8: Illustration of the limp-home mode. In the limp-home interval (between θLH1 and

    θLH2) the return spring force is much stronger than outside the interval.

    From this graph kLH1 and kLH2 can be determined as the slope of each line.

    From a slow ramp θps, or the pre-slide coefficient, can be determined by plotting the angle

    versus time. Then θps is the angle where the throttle valve, from being stationary, starts to

    move. Mf is the torque where the breakpoint occurs.

    [N]

    [θ] θLH2 θLH1

    mLH2

    mLH1

    kLH2

    kLH1

    θLH 0

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 12

    Figure 2-9: Limp home identification process. The data is divided and a model is

    approximated.

    The limp-home model is identified by the automated Hall-Ahlberg algorithm, described

    below.

    1. Load ramped data where θ has increased from closed to open. 2. Find the limp-home angle θLH. 3. Adapt a line to data above and below θLH by using e.g. lms. 4. Load ramped data where θ has decreased from open to close. 5. Repeat steps two and three. 6. Identify KLH1 and KLH2 by taking the mean value of both lines. 7. Identify mLH1 and mLH2 as the mean value of the offsets of both lines. 8. Identify Mf as half the difference of the offsets of the lines.

    Linearization of a nonlinear model To be able to identify the parameters of the model, the model first needs to be simplified [2].

    [10] A linear model is achieved by replacing the friction model and limp-home model with

    the constants σ and Ks(θ), see Figure 2-10. But Ks(θ) is only valid when 1LHθθ ≤ or 2LHθθ ≥ .

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 13

    Figure 2-10: Simulink implementation of the linear throttle servo model

    The closed system is given by:

    ≤=

    22

    11)(

    LHLH

    LHLH

    sk

    kK

    θθ

    θθθ

    (11)

    sv

    j

    C

    KsKsK

    sG

    +++

    =

    )(1

    1)(

    2 σ

    (12)

    To simplify the model further, the following assumptions have been made:

    • The friction is much smaller than the damping of the DC servo (σ

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 14

    The parameters in Gp are identified with a step response of a second order system. This is

    done by using an lms algorithm. It is more important to make sure that the curve is fitted

    accurate close to the stationary value due to the dampening effect caused by the friction. This

    dampening effect increases the rise time.

    Figure 2-11: Fit of a 2nd

    order system’s step response to measured data. It is important that

    the curve has a good fit close to the stationary value.

    2.1.3. The air momentum model

    mL

    1

    ProductLookup Table

    theta

    2

    m_dot _air

    1

    Figure 2-12: Simulink implementation of the air momentum model

    The air momentum model is basically a function of θ and airm& . Unfortunately there wasn’t

    enough time to determine the nonlinearity, other then an approximation from measurements.

    If there is time in the future a more thorough analysis should be done on this part.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 15

    2.1.4. Validation of the throttle servo- and air momentum models

    The voltage data and the air mass flow data from the measurements were used as input to the

    throttle servo model. The simulation outputs were compared to the measured outputs in order

    to validate the model. The results can be seen in Figure 2-14. The model was tested in the

    range [700-3000] rpm, for different load. Due to limited time for testing, a complete analysis

    for the whole range of the engine has not been done. The air momentum model needs further

    testing to verify its validity.

    The limp-home angle is around 30%.

    Table 1: A summary of all tests

    Measurement type With air Fit Range (% open) Fit with 80% fric

    Ramp No 94.6% [0-100] 89.6%

    Ramp No 95.2% [0-100] 93.0%

    Step No 66.3% [30-100] 85.4%

    Step No 34.4% [0-30] 41.0%

    Step No 55.9% [30-60] 78.5%

    Step No 47.7% [0-30] 48.9%

    Step No 78.0% [0-100] 98.5%

    Ramp No 76.6% [0-50] 80.4%

    Step No 73.0% [30-100] 78.0%

    Step No 92.2% [0-30] 94.2%

    Step Yes 81.4% [10-50] 74.5%

    Step Yes 84.2% [0-100] 63.4%

    Ramp Yes 98.2% [0-30] 85.6%

    Ramp Yes 97.4% [0-30] 66.8%

    Ramp Yes 78.4% [30-70] 51.2%

    Ramp Yes 87.5% [30-90] 91.1%

    Step Yes 97.5% [0-30] 47.4%

    Step Yes 77.5% [30-70] 57.9%

    Table 1: A summary of all tests describes the different tests done on the real engine. The

    column “With air” specifies if the test was performed with or without air running through the

    throttle. The fit is defined as when data is within a threshold of 3% of measured data, and then

    it’s considered to be fitted, otherwise not. As you can see the fit is better if the friction is

    lowered to about 80% of the original friction if there is no air running through the throttle.

    However if there is air, the fit gets worse. One hypothesis is that when we have no air, there is

    no pressure on the throttle plate, which makes it easier to turn. The exceptions are when the

    throttle plate is turning slowly, as in the ramps, and then the friction still will affect the

    throttle plate.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 16

    Figure 2-13: Validation of the model for different air mass flows and θ with small load

    Figure 2-14: Validation of the model for different air mass flows and θ with high load

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 17

    2.1.5. The controller

    The controller converts requested air mass flow into a requested angle of the throttle valve to

    be able to control the voltage to the throttle model. The controller must handle the

    nonlinearity that is modelled in the throttle model and make sure that the overshoot from the

    controller is not too large. The implementation of the controller must also make sure that the

    end states are not reached with too large velocity to make sure that the throttle valve is not

    harmed. With that taken into account the throttle still needs to have good enough

    performance.

    Inputs:

    • Requested air mass flow [kg/s] • Air pressure before and after the throttle [Pa] • Air temperature before and after the throttle [K] • Throttle angle [rad] • Measured air mass flow [kg/s]

    Output:

    • Guiding voltage [V]

    Figure 2-15: Throttle controller model

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 18

    Controller structure

    The throttle controller can be split into two main parts. The first part inputs the requested

    angle as well as the actual angle and from that calculates a guiding voltage to the throttle

    servo as output. The second part inputs pressure and temperature before and after the throttle

    valve as well as the requested and measured air mass flow and from that calculates a

    requested throttle valve angle as output. To make sure that the end states are not reached with

    too high velocity the second controller will not be allowed to request angles that are

    physically impossible to achieve. Controller 1 must also make sure that there is no overshoot

    in throttle angle when a step in reference signal is made.

    1

    Aeffu

    Aef f

    theta

    Throttle platem_dot_air_refp_upT_upm_dot_airp_down

    theta_ref

    Throttle controller 2

    theta_ref

    thetau

    Throttle control ler 1

    5

    p_down

    4

    m_dot_air

    3

    T_up1

    2

    p_up

    1

    m_dot_air_req

    Figure 2-16: The controller structure is divided into the air throttle controller and the throttle

    servo controller

    2.1.6. Controller 1: Throttle servo controller

    The structure of this controller can be seen below. It consists of a nonlinear compensation to

    remove as much as possible of the nonlinear behaviour and on top of that a modified PID-

    controller described below.

    Figure 2-17: Simulink implementation of Controller 1, seen in Figure 2-16

    A slightly simplified throttle model is used for the synthesis of this controller. To start with

    the dynamics in equation (1) is considerable faster than the rest of the dynamics and it can be

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 19

    approximated by the static relation )( vmm Kum ω−= . Combine this with the equations (3) and

    (9) to get:

    ummmK

    tKfLSmv

    m

    j

    +−−−−=∂

    ∂ω

    ω1

    (17)

    Where )(θSS mm = , ),( atLL mmm &θ= are static nonlinearities, and fm is given by equation

    (8). The nonlinear controller is supposed to compensate for as much as possible of the

    nonlinearities. Ideally we want to choose u as:

    )( rmmmu fLS +++= (18)

    The limp-home compensation is taken from the throttle model with the desired throttle angle

    as input argument i.e. )( refSS mm θ= . The friction compensation is simplified to basically

    adding slightly more then the maximum friction, Mf, if the throttle angle is below the

    reference value and subtracting slightly more then the maximum friction if the throttle angle

    is above the reference value. To avoid the friction compensation oscillating from max to min

    value when the throttle angle is close to the reference value a small dead zone, given by the

    parameter frdz, and a smooth transition, given by the parameter frdz_slope, is implemented.

    Because of the difficulty in modelling the effect of the air-flow correctly mL is not

    compensated for and is left to the PID-Controller to handle. Finally the output is saturated so

    the maximum voltage to the throttle is not exceeded. The structure of the nonlinear

    compensation can be seen below.

    Figure 2-18: The nonlinear compensation block. It contains a compensation for limp-home

    and friction torque.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 20

    If the models for the nonlinearities are good and the effect of the air mass flow is small the

    open system is approximated by the linear differential equation:

    rK

    tKmv

    m

    j

    +−=∂

    ∂ω

    ω1

    (19)

    For controlling this approximately linear system the modified PID-controller is used. The

    anti-windup block disables the integration if the controller output is greater then a value,

    given by the parameter I_umax, or if the reference differs from the measured throttle angle

    more than what is given by the parameter I_ctrl. The integrator block also resets when a step

    in reference greater than I_reset_ref_step is made. This is to avoid overshoot in the throttle

    position when a step in reference is made as a result of a possibly large I-part before the step

    is made. When a step in reference is made the main controller output is generated from the

    limp-home and friction compensation and the P-part of the controller, only when the throttle

    angle is within a certain interval of the reference the I-part steps in to eliminate stationary

    error.

    Figure 2-19: Simulink implementation of the PID-controller

    2.1.7. Parameter list: Throttle servo controller

    The following parameters are used for controller 1:

    • Kp1, Kd1, Ki1 – PID-parameters.

    • D_max – saturation of D-part

    • I_max – saturation of I-part

    • I_ctrl – The size of the interval around the throttle reference value for which the I-part is active

    • I_umax – I_part will not integrate when the controller output is greater than this value

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 21

    • I_reset_ref_step – A step in reference greater then this will reset the I_part of the PID-controller

    • Frcomp_gain – Gain value for the friction compensation based on the maximum friction Mf given by the throttle model.

    • frdz – The size of the dead zone around the given reference angle for which the friction compensation is zero.

    • frdz_slope – The size of the interval where the friction compensation goes from maximum to zero.

    • Safe – Distance from the end states of the throttle where the reference value saturates and the MinMax limit in the throttle controller reacts to prevent damaging the throttle

    plate.

    • Parameters in the limp_home compensation are taken directly from the limp_home model of the throttle.

    2.1.8. Tuning of parameters:

    The friction compensation should work as a very strong P-controller which saturates slightly

    above maximum friction. The frcomp_gain is therefore chosen slightly above one to make

    sure that the throttle plate starts moving immediately if a small change in throttle reference is

    made. The dead zone and the size of the region where the friction compensation goes from

    maximum to zero was gradually made smaller to get the best performance without causing

    oscillations in the throttle valve.

    Parameter values: frcomp_gain = 1.2, frdz = 0.001, frdz_slope = 0.004

    PID-Parameters The PID parameters are tuned manually with the throttle model to work well in simulation.

    Kd1 is chosen so that the derivative part of the controller doesn’t reach values which are

    greater then about 25 per cent of maximum controller output. Preferably Kd1 is set to about

    1/100 and increased if needed as a result of overshoot in the throttle angle. Kp1 and Ki1 are

    made as large as possible without giving a significant overshoot in the throttle angle. Original

    settings where Kp1=0.5 and Ki1=10. The throttle behaviour where simulated and the

    parameters gradually increased to give satisfying controller performance.

    Parameter values: Kp1 = 1, Kd1 = 1/60, Ki1 = 20

    The I_ctrl parameter should be chosen so that it doesn’t start to wind up unnecessarily but

    larger than the stationary error with the I-part set to zero. I_umax is chosen as slightly greater

    than the stationary controller output for maximum throttle. A greater output will for sure

    make the throttle move in the right direction anyway and increasing the I-part will only lead

    to greater overshoot. The I_reset_ref_step parameter, which causes the integration part to

    reset when steps in reference are made, was implemented due to problems with

    overshoot/undershoot in step responses with an already large I-part.

    I_ctrl = 0.1, I_umax = 0.45, I_reset_ref_step=0.05

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 22

    The MinMax limit is implemented for safety reasons and should not be reached in normal

    operation. The safe limit sets the controller output to zero when the throttle plate reaches

    within the safe limit from the endpoints to avoid the throttle plate taking damage. The D_max

    and I_max parameters which limits the output of the D-part and I-part was set to a slightly

    higher value than what was reached during simulation.

    Safe limit = 0.005, D_max = 0.5, I_max = 0.2

    2.1.9. Validation Throttle Servo Controller

    To evaluate the performance of the throttle servo controller a comparison between the old

    controller and the one described above has been made. Several steps in reference angle were

    made during a one hundred second long run and the results can be seen below.

    Figure 2-20: Comparison between reference tracking for the old controller and the new

    controller

    It can bee seen that the new controller eliminates the steady state error quicker than the old

    controller and has less overshoot in the step responses. Overshoot still exists in the new

    controller but mainly when doing steps through the limp home angle of the throttle (which is

    between 28 and 29 per cent opening angle).

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 23

    2.1.10. Controller 2: Throttle Air Controller

    To achieve a fast response to changes in air mass flow a PI-controller with a feed forward is

    used. The structure of the controller can be seen below.

    Figure 2-21: Controller from requested air mass flow to requested throttle valve angle

    The transformation block from mdot,at,u to θref makes use of the equations (22)-(24) to calculate

    the desired throttle angle.

    )()(

    us

    ds

    eff

    us

    us

    atp

    pA

    RT

    pm ψθ=&

    (20)

    +−

    +−

    +>

    =−

    +

    −+

    else

    ppp

    p

    rrr

    r

    1

    1

    1

    2

    112

    1

    2

    1

    2

    1

    2

    1

    2

    1

    2

    )(γ

    γ

    γ

    γ

    γ

    γ

    γ

    γ

    γγγ

    γ

    γγ

    γ

    ψ

    (21)

    ( ) )exp( 2210 θθθ cccAeff ++= (22)

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 24

    2.1.11. Parameter list, controller 2

    The following parameters are used for controller 2:

    • Kp2, Ki2 – PI-controller parameters • C0, C1, C2 – Parameters in Aeff estimation.

    The parameters in Aeff are estimated with the least square method from a map of the engine.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 25

    2.2. Fuel control

    The purpose of the fuel system is to match the amount of fuel with the amount of air in the

    cylinder and thereby keeping lambda at a desired level. The actuator is injection time and the

    measurement is lambda, airflow, engine speed and fuel pressure.

    lambda_ref

    set points

    m_air_dot_cy l

    Lambda_req

    Lambda

    m_dot_f uel_req

    lambda controller

    p_f uel

    p_cy l

    n_engine

    m_dot_f uel

    t_inj

    inverted injector model

    p_f uel

    p_cy l

    n_engine

    t_inj

    m_dot_f uel

    injector model

    p_cy l

    p_f uelrail

    m_dot_air_cy l

    n_engine

    Virtual sensors

    m_dot_f uel lambda

    MVEM

    Figure 2-22: Overview of fuel system. Controllers are blue and models yellow.

    2.2.1. Models

    Injector model

    Inputs:

    • Injection time injt [ms]

    • Fuel rail pressure fuelrailp [Bar]

    Outputs:

    • Injected fuel mass flow fim& [mg/c]

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 26

    Figure 2-23: Injector model inputs and output

    As the injector is nonlinear for small injection times the injection is handled as two separate

    cases.

    when critinj tt ≥ (23)

    where P is a custom made polynomial of injt

    when critinj tt <

    (24)

    Parameters:

    • injc = injector constant

    • fρ = density of the fuel

    • 0t = time constant for the response time of the injector

    • pcyl = the pressure inside the cylinder at injection time (constant in the model)

    Because the injector is nonlinear at small injection times the nonlinear part of the model has

    been defined as a polynomial, however the pressure still affects the injection time the same

    way. This polynomial has been custom made for the specific injector, and has been fitted to

    the nonlinear curve of injected fuel mass flow against injection time by MATLAB's polyfit

    function. The degree of the polynomial is increased until a good fit is acquired. A

    corresponding critical time, when the model seizes to be linear and becomes nonlinear, has

    also been identified by looking at plots of injected fuel mass flow over injection time, see

    Figure 2-24.

    Injector model

    injt

    fuelrailp

    fim&

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 27

    Figure 2-24: Injected fuel mass flow from simulated linear model, simulated nonlinear model,

    Ezionic’s estimation and measurements from air flow and lambda

    m_dot _fuel

    1

    timedelay

    t0

    t_inj _min

    0

    p_cyl

    p_cyl

    fueldensity

    rho_f

    Switch

    Subtract

    Product 2

    Product 1

    Polynomial

    P(u)

    O(P) = 7

    MinMax

    max

    Math

    Function

    sqrt

    Injectorconstant

    C

    Gain

    2

    Divide 1

    Add

    t_inj

    2

    p_fuel

    1

    Figure 2-25: Simulink implementation of the injector model

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 28

    Lambda Time Delay Model

    Inputs:

    • Engine speed N [rpm] • λ

    Outputs:

    • Measured λ

    The measured lambda is a time delay of the real lambda. The time delay mainly originates

    from the time the exhaust gas is trapped in the cylinder. Therefore the time delay is modelled

    as proportional against the inversed engine speed.

    (25)

    (26)

    2.2.2. Model Parameter Estimation

    Injector model The parameters of the injector are determined through least square approximation of

    stationary measurements of pfuelrail, acm&̂ and λ for different N, tinj, and pfuelrail.

    (27)

    (28)

    Equation (27) is used to estimate the fuel mass flow and equation (23) can be rewritten to

    (28) which MATLAB uses for a least square approximation of the parameters. This method

    estimates the parameters very good as can be seen in Figure 2-26.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 29

    Figure 2-26: Simulated fuel mass flow compared with Ezionic´s fuel mass flow and measured

    fuel mass flow via air mass flow and lambda

    Lambda time delay model Step response of lambda measured for a change in injection time, with all other variables

    constant, has been used to give the time delay of the lambda at a given engine speed. The

    experiment was repeated for different engine speeds and the result was used to get the lambda

    delay as a function of engine speed by applying a linear least square approximation. The

    result can be seen in Figure 2-27.

    Figure 2-27: Simulated lambda versus measured

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 30

    2.2.3. Controller

    Lambda controller

    Inputs:

    • Estimated air mass flow to cylinder acm&̂ [mg/combustion]

    • Reference lambda value refλ

    • Measured lambda value mesλ

    • Engine speed N [rpm]

    Outputs:

    • Requested lambda reqλ , which is later transformed to reqfim ,& [mg/combustion]

    m_dot _fuel

    1

    lambda regulator

    lambda_ref

    lambda

    N

    lambda_req

    lambda -> m_dot _fuel

    m_dot_air_cyl

    Lambda_req

    m_dot_fuel_req

    Engine speed

    4

    lambda _mes

    3

    lambda _ref

    2

    m_dot _air _cyl

    1

    (29)

    (30)

    Parameters:

    • TC = PI controller design variable, see below • K = PI controller gain • Ti = PI controller integral time constant • Ka = anti-wind up constant

    • sFA )/( = stochiometric air to fuel mixture

    Figure 2-28: Lambda controller

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 31

    Only the broadband lambda sensor is used for feedback through a PI controller to regulate the

    required lambda. To improve reference tracking performance feed forward is used. To refresh

    on feed forward theory see [7]. The transfer function, G, from λreq to λ is simply given by

    (34), since the inverted injector model cancels out the injectors. If the time delay is accepted

    in the reference model Gm it equals G. This leads to:

    (31)

    However, the variable time delay in Gm cannot be implemented with Rapid Pro. Therefore the

    feed forward has been removed. Both simulation and tests in motor test bench indicates that

    lambda is more stable without feed forward (Ff = 0, Gm = 1) compared to feed forward with

    incorrect Gm.

    The parameters in the PI(D) controller are chosen using IMC-theory, see [7]. The reason for

    this is that IMC controller uses the model and the lambda model is considered good. Our

    system, G, fits a three parameter model with unit gain, zero rise time and time delay, T,

    according to (35).

    (32)

    (33)

    (34)

    This results in a PI controller depending on the engine speed through the time delay. TC is the

    only design parameter in the controller. The wise way to choose TC is to let MATLAB try

    several different values and choose the value that result in the lowest square error. Which

    value of TC that will be favoured is dependent on the noise model.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 32

    Anti-windup

    1

    lambda_req

    500reset condition

    lambda_real

    w_elambda_mes

    lambda_delay

    1/2

    const

    Tc

    Tc

    SaturationProduct1

    Product

    w_e time_delay

    N -> lambda delay

    lambda delay

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 33

    Inverted injector model

    Inputs:

    • Requested fuel mass flow to cylinder reqfim ,& [mg/combustion]

    • Fuel pressure in fuel rail fuelrailp [bar]

    • Pressure in cylinder cylp (estimated constant) [bar]

    Output:

    • Injection time injt [s]

    t_inj

    1

    p_cyl

    p_cyl

    inv _injektormodell

    m_dot_fuel_req

    p_fuel

    p_cyl

    t_inj

    lambda _ref

    2

    m_dot _fuel _req

    1

    Equations:

    0

    ,

    )(2t

    ppC

    mt

    cylfuelrailfuelinj

    reqfi

    inj +−

    & when critinj tt ≥

    (35)

    First the pressure is compensated for then injt is decided by an inverse map of

    the polynomial in (24) when critinj tt <

    (36)

    Parameters:

    • injc = injector constant

    • fρ = fuel density

    • 0t = response time constant of the injector

    An inverted model of the fuel injectors has been implemented to convert a requested fuel

    mass flow into an injection time. Small injection times will be handled separately by using an

    inverted map of a polynomial from the normal injection model (see above). In production

    engines there are no sensors for the cylinder pressure and because of that that pressure will

    have to be estimated by a constant (it will be small compared to the fuel rail pressure).

    Figure 2-31: Inverted injector model

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 34

    t_inj

    1

    t_inj _min

    0

    Tidsfördröjning

    t0

    Switch

    Subtract

    Product 2

    MinMax

    max

    Math

    Function

    sqrt

    Inverterad olinjäritet .

    fuel_m_times_p t_inj

    Gain 1

    -K-

    Gain

    2

    Divide

    Densitet bränsle

    rho_f

    Add

    p_cyl

    3

    p_fuel

    2

    m_dot _fuel _req

    1

    Figure 2-32: Simulink implementation of the inverted injector model

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 35

    2.3. Driver model, vehicle model and engine model for studies of idle controller

    These models are implemented so that controllers and other models can be tested, both

    separately and as a complete system.

    2.3.1. Driver model

    The purpose of the driver model is to be able to simulate different driving scenarios and then

    analyse the system’s behaviour. The model is for example able to test “tip in tip out” and

    maximal acceleration.

    Inputs:

    • Speed reference [m/s] • Actual speed [m/s]

    Outputs:

    • Gas [%] • Brake • Clutch • Gear

    This model uses a predefined matrix to simulate the driver. Which type of controller the

    driver model should use is specified by changing some constants, this is described further

    down.

    Driver model

    Speed reference

    Actual speed

    Gas

    Brake

    Clutch

    Gear

    Figure 2-33: Driver model inputs and outputs

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 36

    Several MATLAB-scripts have been implemented that test different specific driving scenarios.

    They are defined as a matrix, consisting information of time, speed reference, clutch position,

    gear, gas pedal position and brake pedal position. The following scenarios are implemented:

    • ETC drive cycle • ”tip in tip out” • maximal gas • idle running • load drive cycle

    Common to all scenarios except standard drive cycle is that Acc. Pedal Switch and Brake

    Pedal Switch (see Figure 2-34) are set to the position in which they forward data from MATLAB

    Workspace. The driver model generates outputs for gear, gas pedal, brake pedal and clutch

    pedal. All these can either be defined directly in a driving scenario file or be generated by the

    controller (see Figure 2-34). If the gear signal from workspace is not used, the gear is chosen

    from a lookup table with vehicle speed as input and gear as output. This functionality imitates

    a simple automatic gear box. A problem is that the gear changes instantly without using the

    clutch when the lookup table is used, but for simulation purposes only the response is

    acceptable.

    Speed demand

    DriverOut

    1

    Transfer Fcn

    1

    0.01s+1

    Shift Gear Control

    sgc

    Product

    PI Driver

    PI

    inp

    ut

    PI

    r ese

    t

    PI

    ou

    t

    MinMax 1

    min

    MinMax

    max

    Lookup TableGear Control Switch

    Gas/Brake

    Mode Switch

    0

    From Workspace4

    Speed

    From Workspace3

    BrakePedal

    From Workspace2

    AccPedal

    From Workspace1Clutch

    From Workspace

    Gear

    Brake Pedal Control

    bpc

    Brake Gain

    -1 Acc. Pedal Switch 1

    Acc. Pedal Switch

    Acc. Pedal Control

    apc

    DriverIn

    1

    Gear

    Clutch

    AccPedal

    BrakePedal

    Figure 2-34: Simulink implementation of the driver model

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 37

    The PI-driver controller aims to minimize the error between actual speed and speed reference.

    The parameters Kp and Ki have been determined empirically. An anti wind-up functionality is

    implemented to make the controller not sensitive to integrate wind-up.

    PI out

    1

    Saturation

    Kp

    .03

    Ki

    .01

    Integrator

    1

    s

    0

    Anti -Windup Switch

    PI reset

    2

    PI input

    1

    Figure 2-35: Simulink implementation of the PI-driver controlling throttle and brake, with

    anti-windup functionality

    ETC

    This scenario tests the performance during a more normal drive. The first part of the cycle

    contains three transients simulating driving in an urban environment. Next part simulates

    driving in a rural environment and the last part simulates driving on a highway. The PI-driver

    is used to control speed and brake demand.

    Figure 2-36: Vehicle speed plotted when the European transient drive cycle is used

    Tip in tip out/tip out tip in In this driving scenario the gas pedal position is set to maximum during a short period of time

    and then released again. Then the opposite behaviour is tested, the gas is released from a

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 38

    steady state to zero during a short interval of time and then restored to its initial value. The

    purpose of the test is to analyse the behaviour in fast changes of gas demand. The behaviour

    of both “tip in tip out” and “tip out tip in” can be observed by doing several “tip in tip out”

    after each other.

    Figure 2-37: Vehicle speed plotted when the tip in tip out drive cycle is used

    Maximal gas This driving scenario aims to analyse how the vehicle responds to a protracted powerful

    acceleration with automatic gear shifting.

    Figure 2-38: Vehicle speed plotted when the max drive cycle is used

    Idle running

    In this driving scenario, the idle controller performance is evaluated. Activation and

    deactivation is of special interest since it should be done without discomfort for the driver.

    The test contains a rise in engine speed above the limit where the idle controller actuates i.e.

    the idle controller is not actuating. Then after a while the engine speed is decreased and the

    idle controller starts actuating again and keeps the engine speed at the reference (900 rpm).

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 39

    Figure 2-39: Vehicle speed plotted when the idle running drive cycle is used

    Load drive cycle

    In this driving scenario the idle controller is constantly active and after a while a sudden load

    is applied to test the reaction of the idle controller to a sudden change. The load applied is

    simulated by shifting from neutral to 1st gear and releasing the clutch in one second when the

    engine is running on idle.

    Figure 2-40: Vehicle speed plotted when the load drive cycle is used

    2.3.2. Vehicle model

    The purpose of this model is to be able to test how the engine model works in a simulated

    vehicle, in which driveline dynamics and air- and rolling resistance are regarded.

    Inputs:

    • Engine torque [Nm] • Clutch • Gear • Brake

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 40

    Outputs:

    • Engine speed [rps] • Vehicle speed [m/s]

    Figure 2-41: Vehicle model inputs and outputs

    Modelling Mechanical equations for rotational system are used in order to model the driveline. The

    equations take the engine torque and transform it to angular velocity of the engine and the

    wheels. The impact of the rolling resistance and the air resistance are also used. A sketch of

    the driveline with all variables is presented in Figure 2-42. Every part of the driveline is

    described in more detail below. The propeller shaft is not used because it is a front wheel

    drive vehicle.

    tθcθ

    wθpθ

    wMdMfM

    fMpMtMcM

    ww Fr

    mM

    mfrM : tfrM :

    ffrM : wfrM :

    Figure 2-42: A sketch of the driveline model

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 41

    Engine

    The torque depends on the engine friction and the load from the clutch. Newton’s second law

    gives equation (37).

    cmmmcmfrmmm MbMMMMJ −−=−−= θθ

    &&&:

    (37)

    Clutch The clutch is modelled with a loose, a wind up and a damping factor. The torque is thereby

    dependent on the difference between the angles and angle speeds before and after the clutch.

    There are no torque losses and the model is shown below:

    )()( cmccmctc ckMM θθθθ&& −+−== (38)

    Transmission There is a change of angle speed and torque in the transmission depending on which gear that

    is used. Friction losses are modelled as viscous damping and are dependent on the angular

    speed. Remaining torque loss is the load from the propeller shaft. By using Newton’s second

    law, the following equations can be derived:

    ttc i θθ = (39)

    pttttptfrtttt MbiMMMiMJ −−=−−= θθ

    &&&:

    (40)

    Propeller shaft The propeller shaft is modelled as the clutch with a wind up- and damping factor. There are

    no torque losses and the outgoing torque depends on the angles and angular speeds. The

    propeller shaft is not used in our application since the prototype vehicle is front-wheel driven.

    )()( ptpptpfp ckMM θθθθ&& −+−== (41)

    Final gear The final gear is modelled as the transmission, but with a constant conversion ratio between

    the incoming and outgoing torque and angular speed. The torque losses are modelled as a

    viscous damping and by applying Newton’s second law, the following equations can be

    derived.

    ffp i θθ = (42)

    dftffdffrffff MbiMMMiMJ −−=−−= θθ

    &&&:

    (43)

    Drive shaft The drive shaft is modelled as the clutch and propeller shaft. There are no torque losses and

    the outgoing torque depends on the angles and angular speeds.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 42

    )()( wfdwfdwd ckMM θθθθ&& −+−== (44)

    Wheel/Vehicle

    Equation (45) gives the torque from the wheel. The torque losses depend on friction in the

    suspension, modelled as a viscous damping factor and influence of the ambient environment.

    The force that drives the vehicle forward is given by Newton’s second law and shown in

    equation (46). α is defined as positive in an ascent. The forces that work counter to the propulsion are air- and roll resistance, described in equations (47) and (48). The vehicle speed

    is derived from the angular speed of the wheel and shown in equation (49).

    wwwwwwwwfrwww FrbMFrMMJ −−=−−= θθ

    &&&:

    (45)

    braw FmgFFvmF ++++= )sin(α& (46)

    2

    2

    1vAcF aawa ρ=

    (47)

    )( 221 vccmgF rrr += (48)

    wrv θ&= (49)

    Reference [8] is used to determine the parameters.

    Implementation of driveline in Simulink

    Figure 2-43: Simulink implementation of the driveline

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 43

    Figure 2-43 shows the implementation of the driveline. The inputs to the system are engine

    torque, gear, brake pedal and the slope of the road. Engine speed and the velocity of the

    vehicle are outputs. The blue blocks contain Newton’s second law, i.e. equation (37), (40) and

    (45). See the implementation in Figure 2-44. The green blocks contain the equation for

    torsion, i.e. equation (38) and (44). Figure 2-45 show the implementation of the green blocks.

    The block that is called Vehicle contains the forces acting on the vehicle, i.e. equations (47)

    and (48) and the implementation is demonstrated in Figure 2-46.

    Theta1

    Integrator 1

    1

    s

    Integrator

    1

    s

    Gain 1

    - K-

    Gain

    - K -

    Add

    Torque

    1

    t h e t a _ d o t _ m t h e t a _ mt h e t a _ d d o t _ m

    < M m >

    < M c >

    Figure 2-44: Simulink implementation of Newton’s second law

    The blue blocks take the torque before and after the mass as input and give angular

    acceleration, angular velocity and the angle of the mass as output.

    Torque

    1

    Gain 1

    - K-

    Gain

    - K-

    Add 2

    Add 1

    Add

    Theta

    1

    < t h e t a _ m >

    < t h e t a _ c >

    < t h e t a _ d o t _ m >

    < t h e t a _ d o t _ c >

    Figure 2-45: Simulink implementation of the torsion

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 44

    The green blocks take the angular velocity and the angle of the masses before and after the

    torsion as input and give the torque from the torsion as output.

    Fr

    Fa

    Fw

    1

    sin ( alpha )

    sin

    m * g

    - K-

    V ^2

    u2

    Gain 6

    - K -

    Gain 3

    - K -

    Gain 2

    - K-

    Gain 1

    m

    Fb _gain

    - K-

    Constant 2

    cr 1

    Add 3

    Add 1

    v_ dot

    4

    v

    3

    alpha

    2

    Fb

    1

    Figure 2-46: Simulink implementation of the forces acting on the vehicle

    When simulating the driveline together with the ETC the engine speed goes to infinity. This

    depends on the high stiffness in the differential equations used to model the driveline. Figure

    2-47 shows that this occurs around 55 s. Figure 2-47 also shows that the engine speed

    oscillates a lot. The vehicle speed is demonstrated in Figure 2-48 and shows that the vehicle

    follows the requested speed well until the speed goes to infinity. This driveline

    implementation is not used in the simulations because of this. A more simplified model is

    used instead.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 45

    Figure 2-47: Engine speed during a drive, using the driveline model described above

    Figure 2-48: Vehicle speed during a drive, using the driveline model described above

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 46

    2.3.3. Model for studies of idle controller

    This model has been used during the development of the idle controller. It calculates the

    engine speed, using demanded air mass flow and ignition angle.

    Inputs:

    • Air mass flow [kg/s] • Ignition angle [rad]

    Outputs:

    • Engine speed [rps]

    atm&

    N

    N

    ip

    ep

    acm&

    fcm&

    ignθ

    eM

    Figure 2-49: Engine model overview

    Intake manifold The air mass flow is calculated by the pressure build-up and volumetric efficiency. R is the

    ideal gas constant, iT is the temperature in the intake manifold, iV is the volume in the intake

    manifold, dV is the displaced volume and N is the engine speed. The volumetric efficiency is

    defined by a three parameter model shown in equation (52).

    ( )acat

    i

    ii mmV

    RT

    dt

    dp&& −=

    (50)

    ir

    idvolac

    RTn

    NpVm η=&

    (51)

    Ncpcc ivol 210 ++=η (52)

    The constants in (52) are determined using least square estimation, applied on measurements

    in which the engine is run in several steady states. At least three different states are required

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 47

    and then volη can be approximated with a polynomial. By using equation (51), volη is derived

    as follows:

    NnVp

    RTnm

    cyldi

    irat

    vol

    &=η

    This equation is only valid in steady states when acat mm && = .

    =

    =

    =

    =

    33,

    3,

    11,

    1,

    33,

    11,

    2

    1

    0

    1

    1

    NnVp

    RTnm

    NnVp

    RTnm

    B

    Np

    Np

    A

    c

    c

    c

    x

    BAx

    cyldi

    irat

    cyldi

    irat

    i

    i

    &M

    &

    MMM

    x = A\B

    Fuel injection

    The fuel flow into the cylinder is calculated with the following equation, where ( )sF

    A is the

    stochiometric air-to-fuel ratio. λ is assumed to be 1.

    ( ) λs

    ac

    fc

    FA

    mm

    && =

    (53)

    Exhaust manifold pressure estimation The pressure in the exhaust manifold is used to calculate pump losses in the cylinder. It is

    derived with the following equation:

    0pmcp acexhe += & (54)

    The constants exhc and 0p are determined using least square estimation, based on

    measurements in which the engine runs in steady states. The fuel mass flow is neglected

    since atfc mm &&

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 48

    ( )00 pmcpmmcp acexhfcacexhe +≈++= &&&

    [ ]

    =

    =

    =

    =

    acn

    en

    ac

    e

    exh

    m

    pp

    m

    pp

    B

    A

    cx

    BAx

    &

    M

    &

    M

    0

    1

    01

    1

    1

    x = A\B

    Cylinder

    The torque is derived by subtracting the pump- and friction losses from the net work. LHVq is

    the heating value, chig ,η are combustion chamber losses due to heat losses and cycle to cycle

    variations, ignθ is the ignition angle, optign,θ

    is the optimal ignition angle, cr

    is the

    compression ratio and γ is the ratio of specific heats. optign,θ is mapped by doing stationary

    measurements on the engine.

    r

    fpig

    mn

    WWWM

    −−=

    π2

    (55)

    igLHVfcig qmW η

    ~= (56)

    ( ) chigignc

    c

    igr

    ,1,1min

    11~ ηηλη

    γ

    −=

    (57)

    ( )( )2, ,,1 λωθθη feoptignignignign mC −−=

    (58)

    N

    nmm rfcfc &=

    (59)

    ( )ietotdp ppVW −= , (60) ( )2210, NcNccVW ffftotdf ++= (61)

    The friction loss fW is defined by the three parameter model shown in equation (61). The

    constants are determined using least square estimation, applied on measurements in which the

    engine runs in steady states. At least five measurements are necessary and during the

    calculations ( )cλ,1min is assumed to be 1.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 49

    ( ) ( )

    ( )( )( ) ( )

    ( )ietotdmr

    fffdoptignignignchig

    c

    LHV

    s

    rac

    ffftotdietotdigmr

    ppVMn

    NcNccVcr

    qN

    FA

    nm

    NcNccVppVWMn

    −+=

    =++−−−

    ⇔++−−−=

    ,

    2

    210

    2

    ,,1

    1,

    2

    210,,

    2

    11

    1

    2

    π

    θθηλ

    π

    γ

    &

    ( ) ( )( )

    ( ) ( )( )

    ( )

    ( )

    −+

    −+

    =

    −−−−−

    −−−−−

    =

    −=

    =

    =

    ninetotdnmr

    ietotdmr

    ntotdntotdtotdnoptignnignLHV

    ns

    rnac

    LHV

    ns

    rnac

    totdtotdtotdoptignignLHV

    s

    rac

    LHV

    s

    rac

    c

    f

    f

    f

    ignchig

    chig

    ppVMn

    ppVMn

    B

    NVNVVCqN

    FA

    nmCq

    NF

    A

    nm

    NVNVVCqN

    FA

    nmCq

    NF

    A

    nm

    A

    rC

    c

    c

    c

    c

    x

    BAx

    ,,,,

    11,1,

    2

    ,,,

    2

    ,,,

    ,,

    2

    1,1,,

    2

    1,,1,

    1

    1,

    1

    1

    2

    1

    0

    ,

    ,

    2

    2

    11

    π

    π

    θθλλ

    θθλλ

    η

    η

    γ

    M

    &&MMMMM

    &&

    x = A\B

    Vehicle model

    The engine speed is derived from the following simple model:

    τ

    πτθ

    πd

    J

    MdN

    m

    m

    m ∫∫ == 21

    2

    1 && (62)

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 50

    2.4. Idle controller

    The controller’s task is to keep the engine speed as close to a reference speed as possible

    during idle drive. To prevent that the engine stops if there is a sudden change of load, a torque

    reserve is created by letting the engine ignite at a non optimal ignition angle. This is

    compensated by an increase of the air mass flow. This reserve can then be used instantaneous

    by adjusting the ignition angle towards the optimal one. The controller consists of three

    sections, shown below. In the selector (see Figure 2-50) the requested ignition angles and the

    air mass flows from the idle controller are compared with those requested from the others

    controllers to achieve bump less transfer.

    Out idle controller

    1

    selector

    N_engine_speed [rps]

    mdot_idle_req [rad]

    theta_ign_req [rad]

    mdot_air_demand [kg/s]

    theta_throttle [rad]

    theta_ign [rad]

    mdot_ac [kg/s]

    idle_flag [-]

    Idle Controller

    Engine speed [rps]

    Air mass flow in [kg/s]

    Air mass flow out [kg/s]

    Theta ignition [rad]

    In idle controller

    1

    idle_flag

    theta_ign

    mdot_ac

    Figure 2-50: Idle controller with selector

    Inputs:

    • Engine speed ]/[ sradN

    • Engine speed reference ]/[ sradN ref

    Outputs:

    • Air mass flow ]/[ skgma&

    • Ignition angle ][radadjθ

    Map for adjusted ignition angle A map that delivers the optimal ignition angle based on the current air mass flow per

    combustion and engine speed is used by the idle controller. That angle is then adjusted by

    decreasing it closer to top dead centre and both angles are then sent as outputs to other blocks.

    Controller for requested ignition angle This controller should eliminate the error between the current measured engine speed from a

    sensor and the desired engine idle speed. This error is used as the input for a PI-controller. If

    there is an error, the controller adjusts the ignition angle to eliminate this error. A max-

    function makes it impossible for the ignition angle output to be smaller than the current

    optimal ignition angle. An anti-windup switch is implemented to eliminate the I-part from

    growing when the output is saturated. Both the requested and the desired angles are sent as

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 51

    outputs to the ignition control. The desired angle is the one that the PI-controller wants; this

    one will be used in the air mass flow controller described below.

    The constants Kii and Kpi should be trimmed using an engine model. They will be set in the

    initiation file.

    Theta ign controller [rad ]

    2

    Theta ign [rad ]

    1max

    Theta SaturationKpi

    Kpi

    Kii

    Kii

    Integrator

    1

    s

    Constant

    0

    Anti -windup Switch

    Engine speed [rps]

    4

    Theta optimal [rad ]

    3

    Theta adjusted [rad ]

    2

    Engine speed reference [rps]

    1

    Figure 2-51: Simulink implementation of the controller for requested ignition angle, with

    anti-windup functionality

    Inverted engine model and air mass flow controller This part takes as inputs the optimal ignition angle and the adjusted angle that we want to

    ignite with. The inverted engine model delivers an air mass flow that corresponds to a value

    close to the steady state idle run and also depending on the current engine speed. This air

    mass flow request is then combined with a request from a controller. The inverted engine

    model is described below. The engine model used in MATLAB is then simplified to decrease

    computer performance demands.

    The controller uses the error between the desired adjusted ignition angle and the current

    ignition angle that the ignition controller uses. If this error is non-zero a PID-controller

    eliminates this error. An anti-windup switch is implemented to eliminate the I-part from

    growing when the output is saturated. The constants Kpa, Kpi and Kpd are set in the initiation

    file.

    Using equation (57), where ),1min( cλ is made equal to one, the following is achieved.

    ignchig

    c

    igr

    ηηηγ ,1

    11~

    −=

    (63)

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 52

    Equations (63), (53), (56), (59) combined with 1=λ returns the following equation for the work created from fuel burning in the cylinder.

    ( ) igLHVr

    S

    ac

    ig qN

    n

    FA

    mW η~

    &=

    (64)

    The air mass flow is then calculated using equations (64), (55), (60), (61) and (62) and the

    following equation is achieved.

    ( ) ( ) ( )( )( )

    ( )( )

    −−

    +++−+=

    2

    ,,1

    2

    210,,

    2

    11

    1

    2

    optignignignchig

    c

    LHVr

    Sffftotdietotdmr

    ac

    Cr

    qn

    NF

    ANcNccVppVNJnm

    θθη

    π

    γ

    &

    &

    (65)

    When there is a sudden change of load, the actual air mass flow and engine speed are lowered.

    If equation (65) is used, an even lower air mass flow will be requested. To prevent this, a

    constant replaces the terms that are dependent on engine speed or air mass flow. The constant

    is derived by observing the values during steady state idle run, and the following final

    equation is achieved.

    ( )( )( )

    ( )( )

    rpmN

    NmC

    Cr

    qn

    NF

    ACNJnm

    ref

    W

    optignignignchig

    c

    LHVr

    refS

    Wmr

    ac

    900

    591,

    11

    1

    2

    2

    ,,1

    2

    =

    −−

    +=

    −θθη

    π

    γ

    &

    &

    (66)

    WC is now representing constant pumping and friction work for idle run.

    When implementing equation (66) in Simulink one thing that causes a problem is the

    derivation of engine speed ( N& ) which may result in very large values for short times. These

    spikes are reduced by using a low-pass filter before the signal is derived. The implementation

    of equation (66) can be found in Figure 2-52.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 53

    Modelled air mass flow [kg/s]

    1

    theta opt

    theta adjusted

    out

    Saturation Noise reduction filter 1

    1

    0.1s+1

    Noise reduction filter

    1

    0.1s+1

    Kda

    Integrator

    1

    s

    IdleSpeedWarm

    -C-

    Kia

    Kpa

    Gain

    -K-

    Divide

    Derivative 1

    du /dt

    Derivative

    du /dt

    C_W

    Constant 0

    Anti -windup

    Switch

    Add

    AFs

    -K-

    Theta adjusted [rad ]

    4

    Theta optimal [rad ]

    3

    Engine speed [rps]

    2

    Theta ign Controller [rad ]

    1

    Figure 2-52: Simulink implementation of the controller for requested air mass flow with anti-

    windup functionality

    Controller mode selector

    The controller mode selector handles the bump less transfer functionality when switching

    actuator between idle controller and other controllers actuating on throttle and ignition. It’s

    implemented in Simulink using an embedded MATLAB function block where the function is

    used to handle the switching between which signals should be actuated and which signals that

    should not. The function block works with the following cases:

    • The engine speed is falling and reaches 1100 rpm. If the requested air mass flow from the idle controller is greater than the requested air mass flow from some other throttle

    controller, the requested air mass flow and ignition angle from the idle controller are

    sent to actuate on the engine. Otherwise the request from the other controller continues

    to actuate.

    • The engine speed is above 1200 rpm. Some other controller actuates on the engine.

    • The engine speed is between 1100 and 1200 rpm. The controller that was actuating the last sample will be actuating until the engine speed reaches beyond the engine speed

    borders for this case.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 54

    Bump less transfer functionality

    This function block makes sure that the switching is done smoothly when switching from one

    ignition angle to another i.e. the controller mode switch is changing which controller that

    should actuate. It is only when a switch happens that the filtered ignition angle is sent to

    actuate, otherwise it is the exact non-filtered ignition request from the controller mode

    selector. As long as the difference between the requested angle and the actuated angle, after a

    switch in request, is greater than a small constant the actuated value is slowly adjusted

    towards the requested. When the difference is small enough the actuated angle is changed

    from the filtered one to the requested one from the controller mode selector.

    controller mode selector

    bumpless transfer functionality

    idle _flag [-]

    3

    mdot _ac [kg/s]

    2

    theta _ign [rad ]

    1

    thetaIdle

    thetaDemandFilt

    thetaDemand

    idleFlag

    idleFlagOld

    thetaThrottle

    idleFlagOldBeforeLastChangeMem

    thetaIgnOut

    idleFlagOldBeforeLastChange

    filterHandler

    mdot_idle

    mdot_throttle

    IdleUpperLimit

    N_engine

    theta_idle

    theta_throttle

    idle_old

    theta_dem

    mdot_ac

    idle_flag

    fcn

    Transfer Fcn

    1

    .01s+1

    Memory 2

    Memory

    IdleUpperLimit

    -C-

    theta _throttle [rad ]

    5

    mdot _air_demand [kg/s]

    4

    theta _ign _req [rad ]

    3

    mdot _idle _req [rad ]

    2

    N_engine _speed [rps]

    1

    idle_flag

    mdot_ac

    theta_dem

    Figure 2-53: Embedded MATLAB functions used in selector

    Theta ignition [rad ]

    2

    Air mass flow out [kg/s]

    1

    Map and ignition adjustment

    Engine speed [rps]

    Model air mass flow [kg/s]

    Theta adjusted [rad]

    Theta optimal [rad]

    Inverted engine model and air controller

    Theta ign Controller [rad]

    Engine speed [rps]

    Theta optimal [rad]

    Theta adjusted [rad]

    Modelled air mass flow [kg/s]

    Ignition Controller

    Engine speed reference [rps]

    Theta adjusted [rad]

    Theta optimal [rad]

    Engine speed [rps]

    Theta ign [rad]

    Theta ign controller [rad]

    Idle engine speed reference [rps]

    -C-

    Air mass flow in [kg/s]

    2

    Engine speed [rps]

    1

    Figure 2-54: Idle controller overview, consisting of three parts; ignition angle map with

    adjustment, ignition angle controller and air mass flow controller

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 55

    2.4.1. Testing of idle controller and selector with model

    Tests of the idle controller and selector are done by simulating them together with models of

    mean value engine, clutch and gearbox, vehicle and a driver that requests a specified air mass

    flow based on one of the driving scenarios. All these models are described in section 2.2.

    The inputs that should be connected to the controller from sensors are as follows: engine

    speed [rps], current air mass flow in intake manifold [kg/s], pressure in intake manifold [Pa],

    temperature in exhaust manifold [K]. The controller delivers the following outputs: ignition

    angle [rad] and air mass flow [kg/s] that will actuate on the engine.

    rps->rpm

    60

    exhaust temp 500

    Vehicle

    Wh

    eel S

    pe

    ed

    [ra

    d/s

    ]

    Bra

    ke P

    ed

    al

    Ve

    hic

    l e I

    nert

    ia

    Ve

    hic

    le T

    or q

    ue

    [Nm

    ]

    Ve

    hic

    le S

    pe

    ed[k

    m/h

    ]

    Idle Controller 1

    In idle controllerOut idle controller

    I_e

    Jm

    [N_engine _sens]

    [VehicleSpeed ]

    IdleControllerFlag

    [VehicleSpeed ]

    [N_engine _sens]

    [N_engine _sens]

    [VehicleSpeed ]

    IdleControllerFlag

    Engine model for testing of idle controller

    Ignition angle [rad]

    Air mass flow [kg/s]

    Engine Speed [rps]

    p_i [Pa]

    mdot_ac [kg /s]

    Engine Torque [Nm]

    Driver Model

    DriverIn DriverOut

    Displayo

    1.00

    44 .58

    798 .24

    Convert Pedal Pos

    to mDotAirDemand 1

    AccPedal

    N

    currentAirFlow

    mDotAirDemand

    thetaDemand

    Clutch and gearbox

    Engine Inertia [kg m 2̂]

    Engine Torque [Nm]

    Vehicle Torque [Nm]

    Vehicle Inertia [kg m 2̂]

    Gear

    Clutch Pedal

    Engine Speed [rps]

    Wheel Speed [rad/s]

    N_engine_sens

    mdot_at_sens

    p_i_sens

    T_e_sens

    thetaDemand

    vehicle speed

    mDotAirDemand

    Figure 2-55: System for simulation of different drive cycles, drivelines, and evaluation of the

    idle controller’s performance

    2.5. Model of turbocharger

    This model has been developed as a separate module, then integrated and tested in the

    complete engine model.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 56

    2.5.1. Model

    The compressor increases the pressure in the intake manifold and is powered mechanically

    from the turbine. The turbine is powered from the exhaust gas flow.

    Inputs:

    • Pressure before compressor ][, Pap usc

    • Temperature before compressor ][, KT usc

    • Air mass flow after compressor ]/[, skgm usc&

    • Temperature before turbine ][, KT ust

    • Pressure before turbine ][, Pap ust

    • Air mass flow after turbine ]/[, skgm ust&

    Outputs:

    • Air mass flow through compressor ]/[, skgm dsc&

    • Temperature after compressor ][, KT dsc

    • Pressure after compressor ][, Pap dsc

    • Temperature after turbine ][, KT dst

    • Pressure after turbine ][, Pap dst

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 57

    Compressor

    Turbine

    Power transfer

    uscp ,

    uscT ,

    dscm ,&

    dscT ,

    dscp ,

    dstT ,

    dstp ,

    ustT ,

    ustp ,

    dstm ,&

    tM

    cM

    tcω

    tcω

    Figure 2-56: Sketch over the turbo

    Compressor The compressor model derives the change in pressure and temperature. An already completed

    model of a compressor, taken from [4] is used in this application.

    Turbine The turbine is modelled with a part that determines which torque is generated and a part that

    derives the change in pressure and temperature. An already completed model of a turbine,

    taken from [4] is used in this application.

    Power transfer Based on the torque given by the compressor and turbine, the angular speed is derived. An

    already completed model of a power transfer, taken from [4] is used in this application.

    2.6. Modularity and ability to upgrade the system

    The system is modular and it is possible to upgrade every separate module without changing

    the other depending ones.

  • LiTH

    Reglering av Avgaser, Tomgång och Trottel 2008-05-15

    Reglerteknisk Projektkurs RATT LIPs Technical documentation [email protected] 58

    References

    [1] Projektmodellen LIPS version 1.3 (2007), Tomas Svensson, Christian Krysander

    [2] An electronic throttle control strategy including compensation of friction and limp-home effects (2004), Joško Deuer et al.

    [3] Vehicular Systems, (2007), Lars Eriksson, Lars Nielsen

    [4] Air Charge Estimation in Turbocharged SI Engines (2005), Per Andersson

    [5] Automotive control systems (2005), Uwe Kiencke, Lars Nielsen

    [6] www.engineeringtoolbox.com/pump-energy-equation-d_631.html 2007-02-25

    [7] Industriell reglerteknik Kurskompendium, (2008), Reglerteknik, Institutionen för systemteknik, Linköpings Universitet

    [8] Laborationskompendium Fordonssystem TSFS05, (2007), Linköpings tekniska högskola, ISY, Fordonssystem

    [9] User manual, version 1.0 (2008), Niclas Lerede

    [10] Automatic Tuning of Electronic Throttle Control Strategy (2003), Joško Deuer et al.

    [11] Constrained optimal control of an electronic throttle (2005), Mario Vašak et al.

    [12] Hybrid Theory-Based Time-Optimal Control of an Electronic Throttle (2007) , Mario Vašak et al.