Teske Ms Thesis

  • Upload
    wamit

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

  • 8/8/2019 Teske Ms Thesis

    1/61

    Nonlinear EGR Valve Control

    By

    Nicholas P. Teske

    B.S. (University of New Mexico, Albuquerque) 2002

    A report submitted in partial satisfaction of the

    Requirements for the degree of

    Masters of Science, Plan II

    in

    Mechanical Engineering

    at the

    University of California at Berkeley

    Committee in Charge:Professor J. Karl Hedrick, Chairman

    Professor Pravin Varaiya

    Fall 2003

  • 8/8/2019 Teske Ms Thesis

    2/61

    2

  • 8/8/2019 Teske Ms Thesis

    3/61

    3

    To Sidnee

  • 8/8/2019 Teske Ms Thesis

    4/61

    4

    Abstract

    Nonlinear EGR Valve Control

    by

    Nicholas P. Teske

    Masters of Science in Mechanical Engineering, Controls

    University of California, Berkeley

    Professor J. Karl Hedrick, Chair

    The main function of an exhaust gas recirculation (EGR) valve is to allow post-

    combustion gases to reenter the intake air stream and influence the combustion process.

    By doing this, engineers have achieved reduced emissions and increased fuel economy.

    There are three main types of EGR valves: pressure differential valves, solenoid driven

    valves and variable-position electronic valves. The latter of the three is the basis of this

    project.

    Several types of controllers are derived and their performances are compared. The three

    main controllers derived are a PID controller, an Input/State Linearization controller and

    a Sliding Mode controller. Also, an Adaptive Sliding Mode controller is derived for

    unknown parameter estimation. Both a Luenberger Observer and a Sliding Mode

    Observer are derived and compared. After the full controller/observer combination is

    designed, it is then converted to C code and run on an external processor. This is done to

    verify the ability of the controller/observer in a hardware setup.

  • 8/8/2019 Teske Ms Thesis

    5/61

    5

    Acknowledgements

    Professor J. Karl Hedrick, my advisor and professor, for providing the knowledge to

    study the topic of nonlinear control. I would also like to thank him for providing the

    funding required to attend such an incredible University.

    Daniel M. Lamberson, my research partner, for everything ranging from help with

    homework to career advice. Good luck as a dad!

    Carlos Zavala for all his help with the hardware-in-the-loop experiment.

    Paul, Yvonne and Lauren Teske, for their unconditional support and guidance

    throughout this experience.

  • 8/8/2019 Teske Ms Thesis

    6/61

    6

    Contents

    Acknowledgements .................................................................................5List of Tables...........................................................................................9

    1 Introduction......................................................................................101.1 Background ............................................................................................................. 101.2 Motivation............................................................................................................... 11

    1.3 Organization............................................................................................................ 12

    2 EGR Valve Model.............................................................................132.1 Introduction............................................................................................................. 132.2 Plant ........................................................................................................................ 132.3 System Equations .................................................................................................... 14

    2.4 System Nonlinearity................................................................................................ 152.5 Model Uncertainty.................................................................................................. 17

    3 Controllers ........................................................................................183.1 Introduction............................................................................................................. 183.2 PI and PID Control.................................................................................................. 19

    3.2.1 System Linearization........................................................................................ 193.2.2 Application of the PID Controller.................................................................... 20

    3.3 Input/State Linearization......................................................................................... 213.3.1 Input/State Linearization Controller Design .................................................... 213.3.2 Application of Input/State Linearization Controller ........................................ 22

    3.4 Sliding Mode Control ............................................................................................. 243.4.1 Sliding Mode Controller Design...................................................................... 24

    3.4.2 Application of the Sliding Mode Controller .................................................... 253.5 Adaptive Sliding Mode Control.............................................................................. 27

    3.5.1 Adaptive Sliding Mode Controller Design ...................................................... 283.5.2 Application of the Adaptive Sliding Mode Controller .................................... 293.5.3 Persistency of Excitation Requirement............................................................ 31

    3.6 Conclusion.............................................................................................................. 32

    4 State Estimation................................................................................334.1 Introduction............................................................................................................. 334.2 Luenberger Observer............................................................................................... 34

  • 8/8/2019 Teske Ms Thesis

    7/61

    7

    4.2.1 Accessibility..................................................................................................... 344.2.2 Observability.................................................................................................... 35

    4.2.3 Observer Pole Placement ................................................................................. 354.2.4 Application of the Luenberger Observer ......................................................... 38

    4.2.4 Model Uncertainty........................................................................................... 39

    4.3 Sliding Observer ..................................................................................................... 414.3.1 Observer Design............................................................................................... 42

    4.3.2 Model Uncertainty........................................................................................... 424.3.3 Application of the Sliding Observer ................................................................ 43

    4.4 Conclusion.............................................................................................................. 44

    5 Hardware-In-The-Loop.....................................................................465.1 Introduction............................................................................................................. 46

    5.2 Hardware-In-The-Loop Setup ................................................................................. 465.3 Controller Code Generation.................................................................................... 47

    5.4 Hardware-In-The-Loop Simulation........................................................................ 485.5 Hardware-In-The-Loop Results .............................................................................. 51

    5.6 Conclusion.............................................................................................................. 546 Conclusion.........................................................................................557 Appendices ........................................................................................57

    Appendix A.) Parameter values used in EGR model.................................................... 57Appendix B.) Controller/Observer Performance Comparison...................................... 58

    Appendix C.) Simulink Model of System and Controllers........................................... 59Appendix D.) Simulink Model Used In the HWIL Setup ............................................ 60

    8 References .........................................................................................61

  • 8/8/2019 Teske Ms Thesis

    8/61

  • 8/8/2019 Teske Ms Thesis

    9/61

    9

    List of Tables

    Table 1.) System initial conditions................................................................................... 16Table 2.) Model parameter values................................................................................... 57

    Table 3.) Controller/Observer performance comparison................................................. 58

  • 8/8/2019 Teske Ms Thesis

    10/61

    10

    1 Introduction

    1.1 Background

    Exhaust gas recirculation (EGR) systems have long been used in diesel applications.

    They allow post combustion exhaust to reenter the intake stream and mix with the fresh

    air/fuel mixture. The effect is reduced NOx levels by the reduction of overall combustion

    temperatures. Recently EGR has been applied to gasoline engines for the primary

    purpose of reducing fuel consumption in partial throttle ranges, and secondarily, in

    reducing the level of NOx produced [5].

    EGR requires precise valve control over a wide range of engine operating conditions

    combined with reliable operation and maintained tolerances over the life of the vehicle.

    As government emission and fuel consumption requirements grow tighter and tighter the

    need for higher tolerance EGR valve control arises. The modern open-loop controllers

    for gasoline engine EGR valves will soon become obsolete. With this precision

    requirement the need for closed-loop control arises. The basis of this thesis is the

  • 8/8/2019 Teske Ms Thesis

    11/61

    11

    exploration and application of different control theories, all with the goal of high-

    tolerance EGR valve control.

    1.2 Motivation

    One style of EGR valve that was popular in the past was the pressure differential valve.

    It consisted of a diaphragm that would flex due to a pressure difference across it. The

    vacuum source was typically the intake manifold. This flex would raise and lower a

    valve allowing exhaust in the intake manifold. While the diaphragm could be tuned

    fairly well, over time its performance would degrade causing unwanted performance

    from the valve and therefore the vehicle.

    One solution to this problem, introduced with the advent of the computer controlled fuel

    injection system, used the same diaphragm valve but in a different manner. A separate

    computer controlled valve would regulate the amount of vacuum supplied to one side of

    the diaphragm, in effect controlling the valve. This setup is still commonly used in many

    mass produced vehicles to this day.

    One issue with this setup is the fact that the computer is not supplied with position data

    from the valve. It simply supplies a specified vacuum and monitors the air-to-fuel ratio.

    The approach taken in this study is the application of an electronic actuator. By using a

    valve position sensor, the computer will then have exact information on the position of

    the EGR valve and will be able to control more closely the effect of EGR on the engine.

  • 8/8/2019 Teske Ms Thesis

    12/61

    12

    1.3 Organization

    Chapter 2 discusses the 3rd order plant dynamics and the nonlinearity associated with the

    actuator windings.

    Chapter 3 compares the performances of several types of controllers. The controllers

    discussed in this thesis are a PI/PID controller, an Input/State Linearization controller and

    a Sliding Mode Controller. Each controller is used to actuate the valve in the same

    manner and the performances are compared. Chapter 3 also investigates the application

    of an adaptive controller to account for error in the resistance value of the nonlinear

    controller model. Very little change in resistance causes large changes in the plant

    dynamics, making it very important to know the exact value of the windings resistance.

    Chapter 4 looks at the application of two different types of observers: a Luenberger

    Observer and a Sliding Observer. The two observers performances are compared.

    Chapter 5 studies the effect of the controller in a hardware-in-the-loop scenario. The

    controller and observer that were derived in chapters 3 and 4 will be compiled to C code

    and run on an external processor. MATLAB will be used to run a simulation of the valve

    that will be controlled by this external processor. Issues and results will be discussed.

  • 8/8/2019 Teske Ms Thesis

    13/61

    13

    2 EGR Valve Model

    2.1 Introduction

    An accurate model is necessary for both the nonlinear controllers and also both the

    observers discussed later in this thesis. This chapter discusses the plant, the system

    equations and the nonlinearities of the system. Also discussed are the effects of small

    model changes and the large effects they can have on the system, reinforcing the need for

    an accurate model.

    2.2 Plant

    The valve consists of a simple electric solenoid with a resistive and inductive element.

    Figure 1 shows the plant schematic and the simplified model used for analysis:

  • 8/8/2019 Teske Ms Thesis

    14/61

    14

    Figure 1.) Plant diagram with simplified model

    A voltage (V) is placed across the coil and current (i) is developed in its windings. This

    current creates a magnetic field that causes the plunger to rise into the gap, compressing

    the spring. The plungers motion is a function of the downward force created by the

    compressed spring and any upward force from the magnetic field.

    2.3 System Equations

    The following differential equations [1] describe the EGR valve model in Figure 1.

  • 8/8/2019 Teske Ms Thesis

    15/61

    15

    vdt

    dx= (1.)

    mvFmgKxi

    xdt

    dvf

    1)sgn(

    =

    (2.)

    iL

    t

    x

    xRiV

    dt

    di

    +

    =

    1(3.)

    xy = (4.)

    Conveniently, the variable to be controlled (position) is directly measurable from the

    position sensor. This makes the application of a linear controller fairly easy, but the lack

    of remaining state information makes the application of a nonlinear controller a little

    more involved. This will be further discussed in Chapters 3 and 4.

    See reference Table 2 in Appendix A for a complete list of parameters and their values.

    The parameters were based on models discussed in [2] and [3].

    2.4 System Nonlinearity

    The magnetic flux (lambda) term is a nonlinear function of current and position and is

    given by:

    )xii 1055.87 2 += (5.)

    iix

    1055.87 2 +=

    (6.)

    ( )xii

    105175 +=

    (7.)

  • 8/8/2019 Teske Ms Thesis

    16/61

    16

    This nonlinearity emerges from two different sources. First is the basic relationship

    between current in the windings and magnetic flux. The second source of nonlinearity is

    from the non-uniform medium in the middle of the coils. That is, the further out the

    plunger is the more air (and less steel) is in the center of the windings. Figure 2 is a

    surface plot of the magnetic flux curve used in this analysis.

    Figure 2.) Magnetic flux (lambda) in Webers

    When x is at 10mm the plunger is fully plunged and the entire medium within the coils is

    steel. Lambda, for this system, was approximated with methods discussed in [1]. Table

    1 shows the initial conditions used for this analysis.

    Table 1.) System initial conditions.State Initial Value

    Depth of plunger (x) 0 [m]

    Velocity of plunger (v) 0 [m/s]

    Current in coils (i) 0.101 [amps]

  • 8/8/2019 Teske Ms Thesis

    17/61

    17

    This puts the EGR valve closed with the spring at its free-length and the coil holding

    simply the weight of the plunger. See Appendix C for the Simulink schematic of the

    plant dynamics.

    2.5 Model Uncertainty

    In order to demonstrate the robustness of the following nonlinear control methods the

    parameter R (coil resistance) was chosen to be uncertain. R, in reality, would probably

    be known with some confidence but in the interest of discussion the plant value will be

    assumed different than our controller value. Another reason it is important to be robust

    with respect to variations in R is because very little change in R causes large changes in

    plant behavior. Figure 3 represents the difference in open-loop response with the coil

    resistance set at two different values.

    Figure 3.) The effect of coil resistance on open-loop performance

    As shown, with approximately 15% increase in coil resistance the plunger has moved

    2mm less than with the lower resistance.

  • 8/8/2019 Teske Ms Thesis

    18/61

    18

    3 Controllers

    3.1 Introduction

    As stated in the introduction the need for feed-back control of the EGR valve will soon

    become necessary due to the ever tightening government regulations on emissions and

    fuel consumption. Open-loop control meets these current standards, but will soon be

    obsolete. The following section explores a linear controller (PID) and two nonlinear

    controllers as a solution to the growing needs of EGR valve control.

    In an effort to quantitatively compare the following controllers an error was defined as

    follows:

    2)(*1000 dxxE (8.)

    This error was evaluated for 100ms at a constant period of 10s once the system had

    reached steady state. Also, the error was calculated over the same trajectory for all the

    controllers; a 7Hz sine wave with 4.5mm bias. This trajectory represents the fastest

  • 8/8/2019 Teske Ms Thesis

    19/61

    19

    response possible from the valve due to physical constraints. This error definition will let

    the performance of the different controllers be compared on the same basis and identify

    which controller is actually performing the best. Refer to Appendix B for a complete

    comparison of all the following controllers.

    3.2 PI and PID Control

    3.2.1 System Linearization

    To begin, a PI controller was derived for the system. The main application of a PI

    controller is to a linear system. A Jacobian Linearization can be performed about an

    operating point, but for our application this may be unusable. We are interested in the

    full range of motion of the valve, not just small motion about an operating point.

    Regardless, a Jacobian Linearization was performed around the following equilibrium

    point.

    x = 0.0045 [m], v = 0 [m/s], i = 0.281 [A] and V = 5.78 [V]

    This linearization yielded the following system matrix.

    =

    76.15275.8908.5055

    34.383012000

    010

    A

    The real parts of the eigenvalues of this A matrix are all negative, indicating that the

    system is stable at this operating point. Using this linearization the closed loop poles can

    be placed based on the desired performance.

  • 8/8/2019 Teske Ms Thesis

    20/61

    20

    3.2.2 Application of the PID Controller

    After the PI controller was designed and implemented it was found that the linear

    controller was not able to control the nonlinear system to the desired performance. The

    nonlinearities of the system overpowered the ability of the PI controller away from the

    operating point. To address this problem derivative control was added. The derivative

    term causes the controller to increase control effort initially, reducing the error more

    quickly than with just the proportional and integral terms. Figure 4 shows the effect of

    adding derivative control.

    Figure 4.) PI control vs. PID control

    As shown, the PID controller controlled fairly well. The error as defined by equation (8)

    for the PID control was 10.6.

  • 8/8/2019 Teske Ms Thesis

    21/61

    21

    The only problem with PID control is that the derivative term can be very hard to deal

    with. When differentiating a sensor output any noise in the signal is amplified. For this

    system a perfect sensor was assumed. Also, with the small error signals, large gains were

    needed to attain the necessary actuation. These large gains will also amplify any noise

    from the position sensor. The two preceding issues were significant enough to consider

    nonlinear controllers.

    3.3 Input/State Linearization

    The next methodology used to derive a controller was Input/Output Linearization. The

    object of I/O Linearization is to use the control input to cancel out the nonlinearities of

    the system and then control the system with a synthetic input to achieve the desired

    output.

    3.3.1 Input/State Linearization Controller Design

    The following are the first three derivatives of the output, x, which yield the input (V) in

    the third derivative.

    xy = (9.)vxy == && (10.)

    mvFmgKxi

    xvy f

    1)sgn(

    ==

    &&& (11.)

    ( )mvFmgKxiiy f 1)sgn(1055.87 23 +=&& (12.)

    ( ) ut

    vF

    m

    iL

    t

    x

    xRiV

    miiv

    m

    Ky

    f =+

    ++

    =

    )sgn(111210262 2&&& (13.)

  • 8/8/2019 Teske Ms Thesis

    22/61

    22

    Since the system is a third-order system with a relative degree of three, Input/State and

    Input/Output Linearization are essentially the same analyses [6]. Typically I/S

    Linearization is not ideal for tracking control because the output is chosen to make the

    system a desired relative degree [6]. For this system it was convenient that the ideal

    output happened to be the parameter of interest. This is not always the case.

    The following equations represent the input, V, and the synthetic input, u (state

    feedback), respectively.

    viiRiab

    t

    vFv

    m

    Ku

    V

    f

    )1055.87(

    )sgn(

    2 +++

    =

    (14.)

    miia

    1)210262( 2 += (15.)

    xiLb

    )105175(

    1

    = (16.)

    dddd xxzKxzKxzKu &&&&&& += )()()( 332211 (17.)

    After I/S Linearization was performed the converted controllable canonical states are:

    xz =1 (18.)vz =2 (19.)

    ( )m

    vFmgKxiiz f1

    )sgn(1055.87 233 = (20.)

    K1, K2 and K3 were chosen to place the poles at 122.95. This gave the controller desired

    performance with minimal actuator saturation.

    3.3.2 Application of Input/State Linearization Controller

    Robustness to model uncertainty is one of the main problems with I/S Linearization. The

    method is based on the assumption that the model is an accurate representation of the

  • 8/8/2019 Teske Ms Thesis

    23/61

    23

    actual plant. Figure 5 shows the effect of uncertain coil resistance. In this case, the

    resistance in the plant was 15% more than the actual system.

    Figure 5.) I/S Linearization with an accurate and inaccurate coil resistance

    With the plant resistance more than the model resistance, not enough current is being

    produced and friction is causing the plunger to hang up. The error for each plot,

    calculated by (8), was 0.0458 and 21.9, respectively. From these results we can see that

    I/S Linearization with a perfect model does achieve near perfect tracking. But, with 15%

    error in the resistance model the error definition increases over 450 times. This result,

    like the PID, was unacceptable. The controller must be immune to any coil resistance

    uncertainty.

  • 8/8/2019 Teske Ms Thesis

    24/61

    24

    3.4 Sliding Mode Control

    Often with highly nonlinear systems it can be very difficult to find an accurate model.

    And in some cases it is necessary to use this uncertain model for control. Our second

    type of nonlinear controller is a Sliding Mode Controller, which allows for bounded error

    in parameters while providing low-error tracking. It operates on the simple principle

    push in the opposite direction of the error. This principle is achieved by reducing the

    higher-order system to a first-order stabilization problem of a user-defined surface S.

    Once the system reaches S the desired control objective will be reached asymptotically

    [6].

    3.4.1 Sliding Mode Controller Design

    In general, surfaces are defined as follows.

    xdt

    dS

    n

    ~1

    += (21.)

    With this the surface becomes:

    )()(2~2~ 22 ddd xxxxxxxxS ++=++= &&&&&&&&& (22.)

    In order to make this surface attractive it was made to satisfy the following Lyapunov

    function candidate.

  • 8/8/2019 Teske Ms Thesis

    25/61

    25

    2

    2

    1SL = (23.)

    )sgn( SSSSSL === && (24.)

    To reach this relation a control input (V) must be defined to make )sgn( SS =& . The

    following was that control input.

    ab

    xvcxt

    F

    mm

    KvvabiiabRS

    Vdd

    f)(

    1)1055.87()sgn( 22 &&&& ++++

    =

    (25.)

    miia

    1

    )210262(

    2

    += (26.)

    xiLb

    )105175(

    1

    = (27.)

    ( )

    += df x

    mvFmgKxiic &&

    1)sgn(1055.872

    23 (28.)

    The input contains an ""R term that represents the uncertain coil resistance. This term is

    assumed to be bounded with a 50% error and entered in the input with the worst-case

    scenario in mind ( )sgn(5.0 SRR . This makes the controller immune to coil resistance

    error up to 50% of the modeled value.

    3.4.2 Application of the Sliding Mode Controller

    Once the controller was applied to the system the robustness ability to model error was

    tested. Figure 6 shows how exceeding the defined boundary causes the system to loose

    accuracy.

  • 8/8/2019 Teske Ms Thesis

    26/61

    26

    Figure 6.) Effects of modeling error with a 50% bounded coil resistance parameter

    The first two plots demonstrate the ability of the controller within the set error bounds.

    The third plot shows the plant resistance exceeding the 50% error bounds and friction

    starting to cause plunger hang-ups. This demonstrates the controllers robustness up to

    the set bounds. The errors based on (8) for the first two plots were .0222 and .0949,

    respectively. The error associated with the incorrect resistance model is over four times

    higher than with the correct model. While this is significantly higher, overall both

    controllers perform very well when compared to the 21.9 error associated with the I/S

    Linearization controller with only 15% resistance inaccuracy. Refer to Appendix B for a

    complete listing of all the controller errors.

  • 8/8/2019 Teske Ms Thesis

    27/61

    27

    While these results are very good, the robustness to uncertainty does cause the controller

    to chatter with higher amplitude and frequency. For our system there was no unmodeled

    dynamics so the excess chatter was no problem. Figure 7 shows the increase in input

    activity from the increase in model uncertainty.

    Figure 7.) The effect on the system input of coil resistance parameter uncertainty

    This increase in input activity can be difficult to implement. The following section

    discusses Adaptive Sliding Control, a method used to reduce model uncertainty in an

    attempt to reduce control effort.

    3.5 Adaptive Sliding Mode Control

    The previous section explored three separate ways of applying closed-loop control to the

    EGR valve. The last of these, Sliding Mode Control, even presented a method of dealing

  • 8/8/2019 Teske Ms Thesis

    28/61

    28

    with model uncertainty. While this is very useful because of the possibility of changing

    parameters over time, it can cause unwanted performance such as excess heat and

    possible premature failure. The following section explores the use of adaptive control to

    accurately estimate unknown or changing parameters on-line, with the end goal being

    reduced motor actuation and increasing the overall life of the motor. If the parameter that

    contains the uncertainty is constant or slowly changing, adaptive control can be used to

    identify the value of the parameter and reduce the control effort.

    3.5.1 Adaptive Sliding Mode Controller Design

    For this section the uncertain parameter will be the coil resistance. The parameter update

    law is found by redefining a Lyapunov function candidate with RRR = .

    ( )222

    1RSL += (29.)

    RRSSL &&& += (30.)

    += RRSSL &&& (31.)

    plugging the input (V) into S& yields

    )sgn()sgn( SRiabSRiabiabRS ==& (32.)

    plugging S& back into the Lyapunov function candidate yields

    )()sgn( RiabSRSSL && += (33.)

    The term )"(" RiabSR&+ is then set to zero, making L& negative semidefinite and

    returning the parameter update law

  • 8/8/2019 Teske Ms Thesis

    29/61

    29

    iabSR =& (34.)

    with a and b defined in (26) and (27).

    Barbalats lemma can be used to show that the surface does converge to zero as time goes

    to infinity. It is known that L& is negative semidefinite because we defined R&

    to force it

    that way. This guarantees that R and S are bounded. After finding L&& , Barbalats lemma

    can be used to prove L&& is bounded and L& goes to zero [6]. We know, from section 3.4.1,

    that S goes to zero. But since R&

    is a function of S there is no guarantee that R goes to

    zero, unless that system is constantly excited. S has to be nonzero in order for R to

    converge and persistent excitation provides this non-zero (but still near zero) S.

    3.5.2 Application of the Adaptive Sliding Mode Controller

    Once the controller was applied to the system the parameter tracking capability was

    tested. Figure 8 shows the system response with an initial model resistance )(R of

    30.75O and a plant resistance )(R of 20.5 O.

  • 8/8/2019 Teske Ms Thesis

    30/61

    30

    Figure 8.) Adaptation law converges to 20.5 O, the value of the actual plant

    As shown, the adaptive parameter eventually converges to the actual value in the plant.

    The error associated with (8) for the adaptive sliding mode controller is .0462. This is a

    50% reduction in error when compared to the sliding mode controller with the inaccurate

    resistance model. It should be noted that the adaptive sliding mode controller started

    with an initial resistance with 50% error in order to compare it the sliding mode

    controller that also had 50% resistance error. Refer to Appendix B for a complete

    comparison of all the controller errors.

  • 8/8/2019 Teske Ms Thesis

    31/61

    31

    3.5.3 Persistency of Excitation Requirement

    One issue with adaptive control is the need for persistent excitation. If the plant were to

    receive a step input as opposed to a sinusoid, the adaptation law might not converge due

    to the lack of system excitation. Figure 9 shows the non-converging R with a step input.

    Figure 9.) Adaptation law does not converge without constant system excitation

    As shown, the parameter update law does not converge to the proper value due to the lack

    of system excitation. This is not a problem for the system because the EGR valve keeps

    all states constantly changing as the driver requests varying levels of performance from

    the vehicle.

  • 8/8/2019 Teske Ms Thesis

    32/61

    32

    3.6 Conclusion

    Three different types of controllers were used to control the EGR valve, all yielding

    different performance. First PI control was implemented, but was unable to achieve low

    error tracking without the addition a derivative term, D, which is often problematic to

    implement. Because of the need for higher tolerance control and also control over the

    entire state space, Input/State Linearization was used. While I/S Linearization could

    theoretically achieve zero error tracking, with any model error the tracking ability

    degraded quickly. Because of this Sliding Mode Control was introduced. Sliding Mode

    Control offers low error tracking even with model error. But, the benefit does not come

    without a price. The controller robustness comes from a raised level of actuation.

    Because of the need to lower the level of actuation while still achieving low error

    tracking was important, Adaptive Sliding Mode Control was introduced. Adaptive

    Sliding Mode Control tracks the unknown parameter in effect reducing the level of

    actuation.

  • 8/8/2019 Teske Ms Thesis

    33/61

    33

    4 State Estimation

    4.1 Introduction

    The four control analyses performed above leave out a very important issue: sensor

    measurements for state information. A wide range of sensors could be used to collect

    state information. These sensor readings will contain noise and may have to be filtered.

    Also, sensors can be expensive and unreliable. A method of dealing with the lack of state

    information is state observers. Two common deterministic observers are the Luenberger

    Observer and the Sliding Observer.

    As with the controllers, an error definition is defined to compare the following observers.

    The error function is defined as follows:

    222 iivvxxE ++ (35.)

    This definition allows for the error in each state to be accounted for and compared. This

    error was evaluated for 100ms at a constant period of 10s. Also, the error was

    calculated over the same desired trajectory for both the observers; a 7Hz sine wave with

    4.5mm bias. This error definition will let the performance of the observers be compared

  • 8/8/2019 Teske Ms Thesis

    34/61

    34

    on the same basis and identify which observer is actually predicting more accurate state

    information. Refer to Appendix B for a complete comparison of the following abservers.

    4.2 Luenberger Observer

    The Luenberger Observer is a linear observer that can be applied to a linearized nonlinear

    system. As with the PI control, the nonlinearities can often be too great or the desired

    operating range can be too large to usefully implement a linear observer. The following

    analysis discusses the process for the application of a Luenberger Observer to our system.

    First, the Accessibility and Controllability around the equilibrium point have to be

    verified.

    4.2.1 Accessibility

    The accessibility matrix, when full rank indicates that the system is controllable, is

    calculated using Lie brackets [6]. The rank of the following matrix was checked.

    C = [f, [f,g], [f,[f,g]]] (36.)

    But we are only concerned about this matrix at the following equilibrium point.

    x = 0.0045 [m], v = 0 [m/s], i = 0.281 [A] and V = 5.78 [V]

    After applying this equilibrium point the C matrix is now as follows.

    =

    13324414.32296.3

    4.414806.15190

    6.151900

    C

    This matrix is full rank, therefore the system fully accessible at the equilibrium point.

  • 8/8/2019 Teske Ms Thesis

    35/61

    35

    4.2.2 Observability

    The observability matrix is calculated using Lie derivatives [6]. The following process

    was used to find and check the rank of the observability matrix.

    The Lie derivative matrix, G, was calculated as follows.

    =xL

    xL

    xL

    G

    f

    f

    f

    2

    1

    0

    (37.)

    +=

    m

    mgkxiiv

    x

    G)1055.87( 23

    The observability matrix is the gradient of G.

    ==

    m

    ii

    m

    kG

    25.2622100

    010

    001

    (38.)

    From observation the system is observable everywhere but at i = 0 [A] and i = 0.8 [A].

    Our system is operating at an equilibrium point with i = 0.281 [A]. Also, our system will

    never reach zero current because there is always a small amount to hold the valve in the

    zero position. Therefore O is full rank and the system is observable.

    4.2.3 Observer Pole Placement

    Now that we know the system is accessible and observable we can implement the

    Luenberger Observer. The following equation shows the form of the observer [8].

  • 8/8/2019 Teske Ms Thesis

    36/61

    36

    ][ xCyLBVxAx ++=& (39.)

    BVLyxLCAx ++= )(& (40.)

    eLCAe )( =& (41.)

    If all the eigenvalues of (A-LC) have negative real parts the equation is asymptotically

    stable. It should be noted that this means asymptotically stable for the linearized system,

    not the nonlinear system. For this system (A-LC) is as follows.

    [ ]

    =

    76.15275.89308.5055

    34.3830212000

    011

    001

    3

    2

    1

    76.15275.8908.5055

    34.383012000

    010

    L

    L

    L

    L

    L

    L

    The characteristic equation of (A-LC) is as follows.

    104711334.383276.15216.34406)6.464062176.152()76.1521(23 ++++++++ LLLLLL

    We are going to put the real parts of all three of our poles at -100. This will keep the

    poles symmetric about the real axis. Therefore the characteristic equation needs to look

    like:

    048828364.681048.292 23 =+++ (42.)

    To achieve the characteristic equation in (42) L1 = 140, L2 = 311.41 and L3 = 321.

    The next step is to apply these gains to the nonlinear system. The following equations

    represent the new Luenberger system that will estimate the states of the original system.

  • 8/8/2019 Teske Ms Thesis

    37/61

    37

    )~( 1 xLvx +=& (43.)

    )~()1055.87(

    2

    23

    xLm

    gmxkiiv +

    +=& (44.)

    )~()105175(

    )1055.87(3

    2

    xLxiL

    viiiRVi +

    +

    =& (45.)

    xCyx ~ = (46.)

    The following plots show the actual states and the estimated states.

    Figure 10.) Estimated states converge to the actual states of the system.

    As expected, the estimated states converge to the actual states. The error defined by (35)

    for the Luenberger Observer is 0. This zero error is purely theoretical and is expected for

    an observer with a perfect model.

  • 8/8/2019 Teske Ms Thesis

    38/61

    38

    During the simulation the system did not move far from the equilibrium point that was

    used to linearize the system and solve for the observer gains. If the system were to leave

    this envelope there would be no performance guarantee.

    4.2.4 Application of the Luenberger Observer

    The Luenberger Observer is applied by replacing the state information, previously

    collected directly and unrealistically from the plant model, by the observed states. These

    observed states will then be used to calculate the controller output. The following plot

    shows the output of the system with the I/S Linearization controller running on observed

    states.

    Figure 11.) Results with a perfect observer and controller model

  • 8/8/2019 Teske Ms Thesis

    39/61

    39

    As you can see near perfect tracking is achieved. The error calculated from (8) is 0.0458,

    which is identically equal to the I/S Linearization controller with actual state information.

    This is to be expected because of the zero error state tracking provided by the Luenberger

    Observer with the perfect model.

    This assumption of a perfect model is almost never possible, though. Now that the

    control is based on two independent but identical models any error will now have an even

    larger effect. Model uncertainty and its effects on control will now be discussed.

    4.2.4 Model Uncertainty

    The application of the Luenberger Observer to a nonlinear system assumes a perfect

    observer model. Any small error in the model causes the estimated states to not

    converge. This violates the whole basis of an observer; to predict accurate state

    information. The following plots show the performance of the observer with a 10% error

    in the resistance model of the windings.

  • 8/8/2019 Teske Ms Thesis

    40/61

    40

    Figure 11.) Loss of parameter convergence due to small model error

    The error defined by (35) is 2.59. This is a huge increase in error, which is visually

    noticeable from Figure 11. When these estimated states are used with the controller any

    deviation from the real states would cause unwanted performance. The controller would

    be driving the system to an incorrect setpoint with minimal error. This adds an element

    of guaranteed error to the system. The need for accurate state information is crucial. The

    following plots show the effect of 10% error in the coil windings resistance model in both

    the observer and controller model.

  • 8/8/2019 Teske Ms Thesis

    41/61

  • 8/8/2019 Teske Ms Thesis

    42/61

    42

    Observers ability to deal with model uncertainty. Using the same basis as the Sliding

    Mode Controller, the Sliding Observer capitalizes on a discontinuous model.

    4.3.1 Observer Design

    The Sliding Observer design is similar to the Luenberger design. In fact, the Luenberger

    Observer is the basis for the Sliding Observer. The following equations represent the

    Sliding Observer [4].

    )~sgn()~( 11 xKxLvx ++=& (47.)

    )~sgn()~()

    105

    5.87( 22

    23

    xKxLm

    gmxkiiv +++=& (48.)

    )~sgn()~()105175(

    )1055.87(33

    2

    xKxLxiL

    viiiRVi ++

    +

    =& (49.)

    xCyx ~ = (50.)

    As you can see the only difference is the sign term at the end of each estimated state.

    This sign term is the key to dealing with model uncertainty. The gains L1, L2 and L3

    are taken directly from the Luenberger observer to place the poles of the linearized

    system at -100.

    4.3.2 Model Uncertainty

    The discontinuous sign function changes the sign of a portion of the state estimation,

    constantly adjusting states to track the proper value. Essentially it applies the same

    principle as the Sliding Mode controller: Push in the opposite direction of the error.

    Figure 13 shows the ability of the observer to correctly track states regardless of model

    integrity.

  • 8/8/2019 Teske Ms Thesis

    43/61

    43

    Figure 13.) State variables converge regardless of model error

    The sliding observer is able to accurately track the states. The error defined by (35) is

    0.1467. This is a 94% increase in performance over the Luenberger observer with similar

    conditions. This reduction in error is important because this information will be applied

    via a model based controller that requires correct state information.

    4.3.3 Application of the Sliding Observer

    Now that we have verified that the sliding observer is converging to accurate state

    information it can be applied to the Sliding Mode Controller. It is applied in the same

    fashion as the Luenberger Observer. The state information, taken directly from the

    system and used in the controller, is replaced by the state information produced by the

    observer. Figure 14 shows the output of the system with all observed state information.

  • 8/8/2019 Teske Ms Thesis

    44/61

    44

    Figure 14.) State convergence and acceptable control regardless of model error

    The control with the model error is not perfect, but demonstrates the ability of the sliding-

    surface controller in dealing with model uncertainty. The error defined by (8) is 4.8. This

    is an 88% increase in performance over the I/S Linearization control with the Luenberger

    Observer values. This small amount of error stems from the error build up discussed

    earlier.

    4.4 Conclusion

    The application of the nonlinear controllers discussed in section 3 requires full state

    information. To outfit the plant with sensors could be costly and difficult, in addition to

    having to deal with noisy data. Because of these issues, state estimators were used to

  • 8/8/2019 Teske Ms Thesis

    45/61

    45

    predict the state information used in the nonlinear controllers. Two types of state

    estimators were used, first being the Luenberger Observer. The Luenberger observer

    uses a linear model to calculate the gains that are applied to the nonlinear observer. This

    observer will predict zero-error state information with a perfect model but degrades

    quickly with any model uncertainty. Because of this a Sliding Observer was

    implemented, which demonstrates the ability to track accurate state information even

    without a perfect model.

  • 8/8/2019 Teske Ms Thesis

    46/61

    46

    5 Hardware-In-The-Loop

    5.1 Introduction

    A nonlinear model-based controller that provides low-error tracking throughout the entire

    state space and a nonlinear observer that provides this controller with accurate state

    information have been designed and are ready to implement. While the EGR valve

    discussed in this paper was not readily available for controller application, a Motorola

    MPC555 processor was. This shortage of hardware induced a unique type of controller

    implementation testing known as hardware-in-the-loop testing. The following sections

    discuss the processes involved with this kind of testing.

    5.2 Hardware-In-The-Loop Setup

    Without the actual EGR valve with which to apply the control, an artificial one had to be

    implemented from the simulation software. Figure 15 shows the setup for the hardware-

    in-the-loop test.

  • 8/8/2019 Teske Ms Thesis

    47/61

    47

    Figure 15.) Hardware-In-The-Loop setup

    A desktop PC, running a Matlab simulation of the EGR valve, outputs valve position data

    via an analog out channel and accepts controller output via an analog input channel. The

    MPC555 takes the position data and uses it to run the controller code and calculate the

    controller output. The output is then converted into a PWM signal using hardware

    associated with the MPC555 and sent to the analog input of the simulation PC. This

    digital PWM signal is then synthetically amplified and used to control the simulated EGR

    valve.

    5.3 Controller Code Generation

    In an attempt to reduce the amount of error associated with controller code generation, a

    software package, dSPACE, was used to convert the controller code directly from the

    MATLAB simulation model. dSPACE simplifies the controls engineering process with

    real-time tools for rapid control prototyping, production code generation, and hardware-

    in-the-loop analysis and implementation [7]. TargetLink is the tool within dSPACE that

    has the production code generation capability. It was used to take the controller

    simulation in MATLAB and directly convert it to C code that could be compiled and sent

    to the MPC555. This capability allows for reliable code generation without hours of

    painstaking code writing and debugging. Also, one useful feature of TargetLink is that

  • 8/8/2019 Teske Ms Thesis

    48/61

    48

    the C code produced is legible and can be altered itself. This also saves time by not have

    to regenerate the code every time a little change is made.

    5.4 Hardware-In-The-Loop Simulation

    Before the actual implementation of the generated code can take place it is a good idea to

    understand how the system will behave with a pulse width modulated (PWM) input as

    opposed to a theoretical analog voltage input. The period of the PWM is 1ms and the

    period of the simulated plant is 10s. The difference in sampling rate is intended to

    model a pseudo-continuous system being actuated by a digital PWM signal. Figure 16

    shows the design of the simulated PWM in Simulink.

    Figure 16.) Simulink schematic of simulated PWM

    This Simulink diagram takes an input from the controller, which is an analog voltage, and

    converts it to a percentage of the available voltage. This is the calculated duty cycle. It

    also calculates exactly how far the simulation is into the current PWM period. This is

    also a percentage. The PWM is initially on and when the percent into the PWM period

    exceeds the percent duty cycle the voltage is switched off. Figure 17 represents this

    process graphically.

  • 8/8/2019 Teske Ms Thesis

    49/61

    49

    Figure 17.) The intersection of the lines indicates when the voltage is shut off.

    In this figure the green line represents the progress through the PWM period. When the

    period just starts, say at 0.011s, the PWM is currently 0 percent through the period. As

    the period progresses, the green line indicates how far along the period is. The flat blue

    line indicates the required duty cycle for that period, calculated from the controller

    output. Figure 18 shows the system performance and the corresponding PWM input.

  • 8/8/2019 Teske Ms Thesis

    50/61

    50

    Figure 18.) Simulated system performance with PWM input.

    As you can see the performance does degrade slightly. The error based on (8) was 8.3.

    This has to do with the fact that the PWM is run on a 1ms period. The reason the PWM

    could not be run any faster is because the scheduler is actually running 100 times faster in

    order to get good resolution within the PWM period. In simulation the PWM period

    could be run as fast as we would like, but in real application that is not possible. PWM

    performance is directly related to the capabilities of the processor. The 10s scheduler

    period represented by this simulation could even be considered unattainable by todays

    processor capabilities. The reason it is assumed acceptable by this simulation is because

    the MPC555 has dedicated hardware to calculate the PWM signal. Because of this a 1ms

  • 8/8/2019 Teske Ms Thesis

    51/61

    51

    PWM period can be reliably achieved. With the information from this simulated

    hardware-in-the-loop analysis enough is known about the performance of the system with

    a PWM input to apply the MPC555 processor and control the simulated valve. The

    simulated valve is represented with the Simulink schematic in Appendix D.

    5.5 Hardware-In-The-Loop Results

    Initially the hardware-in-the-loop test seemed like a great method of demonstrating the

    ability of the sliding mode controller/observer. After actually attempting the experiment

    it was found to be more difficult than originally planned. The main problem was the

    computer simulation of the valve. The valve is a low mass/high force system. Therefore

    it yields extremely fast response times. Initially it was thought that a MATLAB

    simulation running in real-time would be able to accurately represent the dynamics of the

    valve, but this was soon found to be false.

    We know from the simulated PWM analysis that the controller cannot control the valve

    with a PWM period greater than 1ms. We also know the fastest rate that MATLAB can

    run a real-time target is 100s. With these limitations in mind it only makes sense to run

    the valve simulation as fast as possible (10kHz) and run the PWM as slow as possible

    (1kHz). After a simple division it becomes apparent that the simulation will only be

    getting 10 points of input for every PWM period. This gives a max input error of 10%.

    If the PWM is intended to have a duty cycle of 41% the controller will see a 50% duty

    cycle due to the holding characteristics of the DIO card. It will always round the period

    up to the nearest percentage that is a multiple of ten. The discrepancy in the input causes

  • 8/8/2019 Teske Ms Thesis

    52/61

    52

    confusion in the observer and controller. The observer is calculating state information

    from an assumed input. The controller is then taking this incorrect information and

    calculating the control law.

    One positive effect of the real-time control was that the PWM period length would

    slightly drift every period. This caused a reduction in the input error because the

    beginning of the PWM period did not perfectly line up with beginning of the simulation

    period. The effect was an error in the beginning of the PWM period that was generally

    counteracted at the end of the period. Figure 19 graphically explains this situation.

    Figure 19.) Problems with the implementation of the PWM controller

    In Figure 19 the red line represents the actual PWM signal. The blue line represents the

    signal that the simulated valve will see. In both plots the duty cycle is 41%. Figure 19a

  • 8/8/2019 Teske Ms Thesis

    53/61

    53

    shows the effect of the scenario with no PWM drift. The duty cycle is at 41% and the

    system is seeing 50%. This stems from the fact that the system only gets new input

    information every 100s. Figure 19b shows the situation involving the drifting PWM

    period. The PWM duty cycle is still 41% and the controller is seeing a 40% duty cycle.

    This is an instance when the error is greatly reduced, but as the PWM period keeps

    drifting the error will keep increasing and decreasing cyclically. Figure 20 shows fixed

    setpoint control using the MPC555 generated PWM to control the simulated system.

    Figure 20.) 5mm step input with controller running on MPC555.

  • 8/8/2019 Teske Ms Thesis

    54/61

    54

    As one can see the control is unacceptable. The sinusoidal effect stems from the drifting

    PWM period discussed above. As the PWM period drifts the input error is increasing and

    decreasing causing the controller/observer to constantly play catch up. The error based

    on (8) was 53.2.

    These is results are completely undesirable and demonstrate the need for the real valve

    for an accurate test. But, with the implementation of the real valve comes the task of

    dealing with the collection of real sensor data for the observer. This thesis does not go

    into the details of sensor data manipulation.

    5.6 Conclusion

    In conclusion, the hardware-in-the-loop simulation did demonstrate the fact that the

    controller was controlling despite the less-than-desirable setup. Changes to the setup

    could be made to remedy the problems discussed above. The valve simulation could be

    run in an environment that has the capability of a 10s or even 1s period. This would

    probably involve another external processor running the valve simulation in addition to

    one running the controller/observer. With this setup, two MPC555s in parallel, the

    continuous valve could be more accurately modeled. Possible further analysis could go

    into the design of Kalman filter to deal with a real position sensor. With this addition a

    real valve could be used, instead of a relatively slow computer simulation of one, and the

    controller could be realistically tested.

  • 8/8/2019 Teske Ms Thesis

    55/61

    55

    6 Conclusion

    The preceding analysis discussed four methods for controlling an electric solenoid with

    application to an EGR valve. A linear controller, which is intended for small motion

    about an equilibrium point, was applied to this model to control throughout the entire

    range of motion. It was expected that performance would be poor, but ended up better

    than expected. One major issue was the use of a PID controller instead of a PI controller.

    The addition of derivative control can often be difficult to implement. For this system PI

    control was unable to achieve acceptable tracking error, but with the addition of a

    derivative term tracking was achieved within reasonable tolerance.

    Input/State Linearization was the first nonlinear controller implemented and was

    successful assuming a perfect model. This is generally an incorrect assumption because

    the model is constantly changing. Error bounds were exceeded with only small changes

    in model parameters.

  • 8/8/2019 Teske Ms Thesis

    56/61

    56

    Sliding Mode Control was the second nonlinear controller implemented and was also

    successful with a perfect model. The difference with Sliding Mode Control is that model

    uncertainty can be accounted for and zero error can still be maintained.

    Adaptive Sliding Mode Control was the final nonlinear controller implemented and was

    used to reduce actuator effort by using parameter update laws that converge to the actual

    plants values.

    After a satisfactory controller was defined, the need for state information became

    apparent. Two types of observers were designed and tested, a nonlinear Luenberger

    Observer and a Sliding Mode Observer. The Luenberger Observer demonstrated no

    robustness to model uncertainty, while the Sliding Observer did.

    After an observer was chosen the complete observer/controller combination was

    converted to production C code using dSPACE/TargetLink and downloaded to an

    external processor for hardware-in-the-loop analysis. This analysis tested the system

    under real-time control with a digital PWM input. While the conditions for a true

    hardware-in-the-loop test were impossible to run with a MATLAB simulation, the

    controller on the external processor was able to maintain some level of control.

  • 8/8/2019 Teske Ms Thesis

    57/61

    57

    7 Appendices

    Appendix A.) Parameter values used in EGR model

    Table 2.) Model parameter values

    Parameter Value

    Max input voltage (V) 13.8 [V]

    Min input voltage (V) 0 [V]Plunger mass (m) 0.1 [kg]

    Gravity (g) 9.81 [m/s^2]

    Spring constant (K) 1200 [N/m]Winding Resistance (R) 20.5 [ohms]

    Winding Inductance (L) 0.0017 [H]Maximum Static Friction (Ffs) 0.2 [N]

    Kinetic Friction (Ffk) 0.15 [N]

  • 8/8/2019 Teske Ms Thesis

    58/61

    58

    Appendix B.) Controller/Observer Performance Comparison

    Table 3.) Controller/Observer performance comparison

    Controller/Observer Error Def. Error Value

    SMC w/ perfect model 8 0.0222

    I/S Lin w/ perfect model 8 0.0458I/S Lin + Luenberger Obs w/ perfect model 8 0.0458

    Adap SMC w/ 50% initial resistance model error 8 0.0462SMC w/ 50% error in resistance model 8 0.0949

    SMC + SM Obs w/ 10% error in resistance model 8 4.8

    SMC + SM Obs with simulated PWM 8 8.3P.I.D. 8 10.6

    I/S Lin w/ 15% error in resistance model 8 21.9

    I/S Lin + Luenberger Obs w/ 10% error in resistance model 8 39.2SMC + SM Obs with MPC555 generated PWM 8 53.2

    Luenberger Observer w/ perfect model 35 0SM Observer w/ 10% error in resistance model 35 0.1467

    Luenberger Observer w/ 10% error in resistance model 35 2.59

  • 8/8/2019 Teske Ms Thesis

    59/61

  • 8/8/2019 Teske Ms Thesis

    60/61

    60

    Appendix D.) Simulink Model Used In the HWIL Setup

  • 8/8/2019 Teske Ms Thesis

    61/61

    8 References

    [1] N.C. Cheung, K.W. Lim, M.F. Rahman, Modeling a Linear and Limited TravelSolenoid, University of New South Wales, Australia, 1993.

    [2] Y. Mitsutake, K. Hirata, Dynamic Response Analysis of A Linear Solenoid

    Actuator, Evaluation & Reliability Technology Center, Kadoma, Japan, 1997.

    [3] K. Harmer, G.W. Jewell, D. Howe, Transient Performance of A Short-Stroke

    Linear Solenoid Actuator, IEEE Proc.-Electr. Power Appl. Vol. 149, No. 5,September 2002.

    [4] J.-J. E. Slotine, J. K. Hedrick, E. A. Misawa, On Sliding Observers forNonlinear Systems, Massachusetts Institute of Technology, Cambridge, MA,

    September 1987.

    [5] Blank, Dismon, Kochs, Sanders, Golden, EGR and Air Management for Direct

    Injection Gasoline Engines, SAE 2002 World Congress, 2002-01-0707, Detroit,MI, March 2002.

    [6] J.-J. E. Slotine, Weiping Li, Applied Nonlinear Control, Prentice Hall (1991).

    [7] http://www.dspaceinc.com

    [8] Masayoshi Tomizuka, Advanced Control Systems I, Fall 2002 Reader.