second-order sliding mode control of induction motoretd.dtu.dk/thesis/252991/pejstrup.pdf ·...

85
Nils Emil Pejstrup Larsen Second-Order Sliding Mode Control of an Induction Motor Master’s thesis, October 2009

Upload: doanthu

Post on 04-Jul-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Nils Emil Pejstrup Larsen

Second-Order Sliding Mode Control of an Induction Motor

Master’s thesis, October 2009

Page 2: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Second-Order Sliding Mode Control of an Induction Motor

Rapporten er udarbejdet af: Nils Emil Pejstrup Larsen

Vejleder: Elbert Hendricks

DTU Elektro Automation and Control Danmarks Tekniske Universitet 2800 Kgs. Lyngby Denmark

[email protected]

Projektperiode: 1.4.2009 – 1.11.2009

ECTS: 30

Uddannelse: Kandidat

Retning: Elektro

Klasse: Offentlig

Bemærkninger: Denne rapport er indleveret som led i opfyldelse af kravene til ovenstående uddannelse på Danmarks Tekniske Universitet.

Rettigheder: © Nils Emil Pejstrup Larsen, 2009

Page 3: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Abstract

The induction motor is probably the most used electrical motor today. Itsmain advantage over other motors is that it can be built without brushesfor electrical power transfer to the rotor. It is thus very reliable. Althoughit was invented almost 130 years ago, it is only recently that the problemof speed control was solved efficiently. Still, the performance of existingcontrollers suffers from sensitivity to motor parameter variations. The ro-tor resistance is of particular importance because it can increase drasticallywhen the temperature rises. One class of controllers adapt to parameterchanges by estimating them online. This strategy, called adaptive control,might not work in all operation regimes and increases overall controller com-plexity. Another strategy is to design a controller which is less sensitive toparameter variations (robust control). That is the focus of this work.

In the 1950s and 1960s, Russian scientists investigated switching controllaws, e.g., control laws with an on/off element. Their goal was to realizerobust control systems, i.e., control systems which are less sensitive to pa-rameter variations and disturbances. Their research evolved into the theoryof sliding mode control. The fundamental result of the theory is that aninfinitely fast switching control can constrain the controlled system to onlyevolve (slide) along a certain surface, which has a lower dimension than theoriginal system dynamics. On this so-called sliding surface, the system isperfectly immune to a broad class of disturbances. Of course, any practicalrealization will be limited to a finite switching frequency. This will introducean error.

This work is focused on second-order sliding mode controllers. They featuresmaller errors than standard sliding mode controllers when the switchingfrequency is not infinite. Such a controller is designed for an inductionmotor with the goal of achieving highly robust speed control. The designalso includes a sliding mode observer to estimate the rotor flux. The fluxis used as part of the feedback control. Certain derivatives of motor statevariables are required by the controller as well. A recently developed robustfinite-time differentiator is applied to estimate those derivatives.

To test the proposed design, a 1.5 kW induction motor is chosen, a loadbenchmark is specified and the control system performance is carefully ex-amined by simulation.

Page 4: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Preface

This master’s thesis is the final project for receiving the Master of Sciencein Engineering degree at the Danish Technical University.

The work has been carried out at the Technische Universitat Dresden, Ger-many in the period from April to October, 2009. I would like to thank mysupervisor, Dr.-Ing. Jens Weber, and the Chair of Power Electronics fortheir support.

I would also like to thank my supervisor at the Danish Technical University,Elbert Hendricks, for his ideas, advice and support.

Nils Emil Pejstrup LarsenDresden, October 21, 2009

Page 5: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Contents

1 Introduction 9

1.1 Background and state of the art . . . . . . . . . . . . . . . . . 9

1.2 Goals and organization of the thesis . . . . . . . . . . . . . . 11

2 Sliding mode control: Theory and motivation of its use 13

2.1 Standard first-order continuous-time SMC . . . . . . . . . . . 13

2.2 Mathematical introduction of 1-SMC . . . . . . . . . . . . . . 15

3 2-SMC: A generalization of 1-SMC 19

3.1 From 1-SMC to 2-SMC . . . . . . . . . . . . . . . . . . . . . 19

3.2 2-SMC algorithms . . . . . . . . . . . . . . . . . . . . . . . . 22

3.2.1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . 23

3.2.2 Twisting algorithm . . . . . . . . . . . . . . . . . . . . 24

3.2.3 The sub-optimal algorithm . . . . . . . . . . . . . . . 24

3.2.4 Super-twisting algorithm . . . . . . . . . . . . . . . . 25

3.3 Two short notes on relative degree . . . . . . . . . . . . . . . 28

3.4 Estimation of needed derivatives . . . . . . . . . . . . . . . . 28

4 Robust induction motor control using 2-SMC 31

4.1 Preliminary remarks and control goal . . . . . . . . . . . . . . 31

4.2 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

4.3 Induction motor model . . . . . . . . . . . . . . . . . . . . . . 34

4.3.1 Model states and coordinates . . . . . . . . . . . . . . 36

4.4 Control design . . . . . . . . . . . . . . . . . . . . . . . . . . 36

4.4.1 Mathematical formulation of control problem . . . . . 36

4.4.2 Control design – decoupling . . . . . . . . . . . . . . . 37

4.4.3 Derivatives of sliding variables . . . . . . . . . . . . . 38

4.4.4 Control design – preliminary attempt . . . . . . . . . 39

4.4.5 Sliding mode control design . . . . . . . . . . . . . . . 39

4.4.6 Sliding mode observer . . . . . . . . . . . . . . . . . . 40

4.4.7 Differentiator . . . . . . . . . . . . . . . . . . . . . . . 43

4.4.8 Discretization and PWM issues . . . . . . . . . . . . . 44

4.5 Initial magnetization . . . . . . . . . . . . . . . . . . . . . . . 47

Page 6: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

6 CONTENTS

4.6 Construction of simulation model . . . . . . . . . . . . . . . . 47

5 Design example and simulation 49

5.1 Choice of conditions . . . . . . . . . . . . . . . . . . . . . . . 495.1.1 Control task definition and motor parameters . . . . . 495.1.2 Simulation conditions . . . . . . . . . . . . . . . . . . 51

5.2 Controller parameter tuning . . . . . . . . . . . . . . . . . . . 515.2.1 Stage 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 555.2.2 Stage 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 595.2.3 Stage 3 . . . . . . . . . . . . . . . . . . . . . . . . . . 605.2.4 Stage 4 . . . . . . . . . . . . . . . . . . . . . . . . . . 605.2.5 Result of stage 1–4 . . . . . . . . . . . . . . . . . . . . 625.2.6 Robustness analysis . . . . . . . . . . . . . . . . . . . 62

6 Conclusions 65

6.1 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

Appendices 71

A Simulink model 71

A.1 Source code for compiled blocks . . . . . . . . . . . . . . . . . 73

Bibliography 81

Page 7: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Nomenclature

ω The actual motor angular velocity

ωref The desired motor angular velocity

φ2r The squared magnitude of the rotor flux vector

φrα The α component of the rotor flux vector

φrβ The β component of the rotor flux vector

σ Induction motor loss factor, see (4.6)

d A general disturbance signal

dm A matched disturbance signal

du A unmatched disturbance signal

isα Induction motor stator current, α component

isβ Induction motor stator current, β component

Lh Induction motor mutual inductance

Lr Induction motor rotor inductance (leakage+mutual inductance)

Ls Induction motor stator inductance (leakage+mutual inductance)

M The torque generated by the motor

ML The load torque attacking on the motor shaft

O(τ q) A function smaller than a constant times τ q (“big O-notation”)

p The number of pole pairs of the motor

Rr Induction motor rotor resistance

Rs Induction motor stator resistance

s The sliding variable

Tr Non-singular matrix for transforming a system into the regular form

Page 8: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

8 CONTENTS

1-SMC First order sliding mode control

2-SMC Second order sliding mode control

AC Alternating Current

DC Direct Current

EMC Electromagnetic compatibility

FOC Field-Oriented Control

PD Proportional-differential, e.g., PD-controller

PWM Pulse Width Modulation

Page 9: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Chapter 1

Introduction

This chapter presents the current role of induction motors in the society andgives a short overview of the control problem associated with the use of thiskind of motors. It is justified why sliding mode control (SMC) is of interestas a control strategy and the goals of this work are specified. Finally, anoverview of the thesis is given.

1.1 Background and state of the art

This master’s thesis is dedicated to robust speed control of induction motors.The induction motor was invented in 1882 by Nikola Tesla. Initially, thismotor type was only used in applications where accurate speed control isunimportant, e.g., in some home appliances, fans and pumps. No efficientway to implement speed control with induction motors was available untilabout 30 years ago, [1, p. 160]. Due to technological development, thethree-phase induction motor fed by power semiconductors is now widelyused in high performance and high power applications where accurate speedis important—for example, in paper or textile industry, in steel rolling millsor for electrical railway traction.

The main advantage of the induction motor is that it can be built withoutusing brushes for electrical power transfer to the rotor. Other types ofmotors, including the synchronous motor and DC motor, require brushesand are subject to brush sparking and wear. The induction motor thusfeatures decreased maintenance costs and decreased risk of failure which aretwo major advantages.

It is challenging to realize speed control of an induction motor. Before theproblem was solved efficiently, several technologies and techniques had to

Page 10: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

10 Introduction

be invented, including: The state-space approach (1956)1 which provideda better understanding of multivariable systems, fast semiconductor-basedpower converters which can be used as variable-frequency power sources, therise in performance of digital computers, and the Field-Oriented Control(FOC; F. Blaschke, 1971). FOC is a decoupling technique for inductionmotors that reduces the control problem to be similar to that of a DCmotor, [3, p. 191]. DC motors are known to be relatively easy to controland existing solutions have long been available. FOC works by transformingthe motor variables into a coordinate system which rotates with the rotorflux, i.e., the (d, q) frame. In these coordinates, the system is decoupled intotwo subsystems: one for the motor torque and one for the excitation flux.A controller can be designed for each subsystem independently. The controldesign is relatively simple due to the decoupled structure. The controlleroutputs are transformed back in motor coordinates before they are fed tothe semiconductor-based power converter. This control strategy is beingused with success since then 1980s to achieve accurate speed control.

FOC relies on exact knowledge of the rotor flux angle which can either bemeasured directly, e.g., using Hall sensors, or be estimated using an observer.Flux observers generally work based on rotor speed and stator current mea-surements. Due to the fact that Hall sensors complicate the mechanicalmotor design, are expensive and subject to drift of measurements, they areused more rarely than observers. If the flux estimate is not perfect, thecoordinate transform will in turn result in imperfect decoupling and degra-dation of overall control performance. The most critical motor parameter isthe rotor resistance, which value can increase up to 100% when the motortemperature rises, [4].

It is clear that the developments in induction motor control did not end withthe invention of FOC. Current topics in research include a higher level ofrobustness against unknown load and parameter variations, faster responseand a higher level of energy efficiency.

Sliding mode control, which is treated in this thesis, is a promising moderncontrol strategy for electric drives due to its ability to suppress load andparameter variations. Its foundations were laid by Russian scientists in the1950s and 1960s. It relies on fast switching, which made its implementationat that time difficult due to the lack of fast digital computers and fastsemiconductor-based power converters. The recent revolutions of computersand power semiconductors have made SMC a major and today very actualfield of research by many scientists in many countries.

1 The state-space model is the central element of the so-called modern control theory.In the historical background section of the introductory book on modern linear controltheory, [2, p. 7], 1956 is named as the year when the classical control theory based ontransfer functions was supplemented with “modern” tools.

Page 11: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

1.2 Goals and organization of the thesis 11

Currently, researchers in the field of SMC are striving to reduce the so-called chattering problem. Chattering is defined as unwanted and harmfuloscillations in the motor outputs. It is caused by unmodeled delays in thecontrol loop and by the fact that the switching frequency cannot be infiniteas assumed in the theory of SMC. Another actual research activity is to de-sign accurate and fast observers to successfully implement the sliding modecontrollers which usually require full state feedback.

It has already been proposed that second-order sliding mode control (2-SMC) could be used for chattering reduction in induction motor control.The author is aware of a single paper only, [5], about 2-SMC of an inductionmotor. That paper is unfortunately incomplete in its treatment; it doesnot reveal how certain derivatives of motor outputs are calculated. Severalresearchers have treated the problem of derivative estimation in detail, e.g.,[6], [7], but not explicitly in connection with induction motor control. Theauthor is not aware of any publication demonstrating 2-SMC of an inductionmotor or other AC motor while also proposing a method for determining therequired derivatives.

1.2 Goals and organization of the thesis

The justification for examining second-order sliding mode controllers is thatthey potentially can be used to obtain smoother speed control of inductionmotors. Standard sliding mode control (1-SMC) promises speed control withfast suppression of randomly applied load transients and robust operationin a wide temperature range. As already mentioned, 1-SMC suffers from thechattering problem. It is expected that 2-SMC can reduce the chatteringproblem (i.e., obtain smoother output) while retaining the advantages of1-SMC. This could obviously be an economical advantage in the industry.

The goals are

• To introduce standard SMC (1-SMC).

• To choose an induction motor model and implement it in a simulationsystem.

• To determine if 2-SMC can be realized for that motor model withoutrelying on exact knowledge of motor parameters and motor outputderivatives. And if it is possible, to built up a simulation model forthe whole control system.

• To determine a usable strategy for tuning of the controller parametersand to examine the system behavior by means of simulation.

Page 12: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

12 Introduction

In chapter 2, the theoretical foundation of 1-SMC is shortly summarized.Next, 2-SMC is introduced and treated in greater detail in chapter 3. Chap-ter 4 presents the theoretical results regarding the main problem of thiswork: Robust speed control of the induction motor using 2-SMC. Finally,chapter 5 describes the strategy for parameter tuning developed by the au-thor. Based on simulation, the process is carried out for a chosen inductionmotor and the results are analyzed.

Page 13: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Chapter 2

Sliding mode control: Theory

and motivation of its use

In the previous chapter, the main goal of this work was defined; namely, todesign a robust controller for an induction motor while maintaining smooth(chattering-free) operation. A justification (based on expectations) for ex-amining 2-SMC to achieve this was given. This chapter will introduce thestandard 1-SMC mathematically to lay the foundations. It is shown howLyapunov’s Direct Method can be used to prove stability.

2.1 Standard first-order continuous-time SMC

This semiformal introduction of SMC and its associated vocabulary arelargely based on [8, pp. 11–13,16].

SMC is a control strategy to stabilize the output(s) of a plant at a certain setpoint or around a certain trajectory. Sliding modes have first been describedby scientists in the former Soviet Union in the 1950s or in the 1960s (seefor example the standard work Sliding Modes in Control and Optimization[9], first published in Russian in 1981, by Prof. Vadim Utkin, one of themain contributors to the SMC methodology). Utkin and his colleges werestudying variable structure systems and relay control. These control systemsincorporate some kind of value-discontinuous control law. It is therefore anonlinear control strategy. Some very simple examples of other (not SMC)discontinuous control laws are found in ordinary electrical home applianceswith on/off regulators like ovens, irons and domestic heaters. In contrast tovariable structure systems are control systems with value-continuous controllaws, i.e., control laws that can generate any value within a continuousrange (e.g., an analog voltage for a DC motor armature winding). Notice

Page 14: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

14 Sliding mode control: Theory and motivation of its use

0

0

0

0

x1

x1

s

s

s ≡ 0

Figure 2.1: Two phase plane plots qualitatively showing behavior of 1-SMC. Theplant is defined as x1 = x2, x2 = u + d with the output (the sliding variable)s = cx1+x2. The simplest 1-SMC controller u = −K sign(s) is applied with a hys-teresis. In the left phase plot, the initial reaching phase before reaching the slidingphase where s ≡ 0 is clearly identifiable. After the initial reaching period, the con-troller is forcing the trajectories to stay on the line s = cx1+x2 which correspondsto exponential decay of x1 with the rate defined by the control parameter c. Thesystem has been reduced from being two-dimensional to be of just one dimension,i.e., the sliding surface s = 0 along which the system slides. When the hystere-sis tend to zero width, any bounded disturbance will be rejected if K is chosensufficiently large. This disturbance rejection is known as the invariance property.These are the main advantages of SMC. The chattering in the sliding phase is themain problem with 1-SMC. The right plot is the s-s phase plane. After the initialtransient, it is clear that s = 0 and that s = cx2 −K sign(s) + d is discontinuous.Deviations are due to the hysteresis which is an imperfection.

Page 15: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

2.2 Mathematical introduction of 1-SMC 15

that this distinction is a different one than the distinction between discrete-time (sampled) and continuous-time control systems and that sliding modecontroller variants exist in both sampled and continuous-time versions.

The strength of SMC lies in its robustness against plant parameter uncer-tainties and its ability to decompose control problems into two subproblemsof lower dimension (as will be shown later). High feedback gain is necessaryto achieve these goals. In SMC, a high (theoretically infinite) gain is attainedusing a control signal with a discontinuous element (e.g., a sign function).Consider for example the simplest discontinuous control law u = −K sign s.Even the slightest change across s = 0 will flip the control output from K to−K or vice versa. Such a control law is theoretically realizing infinite feed-back gain with a finite-valued control signal. In [10, p. 24], Utkin writes:“...the [discontinuous] element implements high (theoretically infinite) gain,that is the conventional mean to suppress influence of disturbances and un-certainties in system behavior” and “Unlike systems with continuous controlthe invariance is attained using finite control actions”. In the second quotehe is referring to the fact that continuous control can only attain an infinitegain using an infinite control signal.

A typical trajectory of an uncertain system being controlled with 1-SMC isshown in figure 2.1. No values are specified on the axes because the intent isonly to qualitatively show characteristic properties: the order reduction andthe invariance to disturbances (see figure text). This figure will be referredto later in the thesis (figure 3.2) after the mathematical background hasbeen introduced.

2.2 Mathematical introduction of 1-SMC

To motivate the use of sliding modes in control, a simple design procedureis presented here. It is shown how a stabilizing controller can be designedfor a multiple-input multiple-output linear plant using sliding mode control.Further, it is shown that the system can be brought into sliding mode infinite time despite the presence of a class of bounded disturbances/parametervariations, and that the closed-loop system dynamics can be specified at will.

This entire section is largely based on [11, pp. 14-20] and [10, pp. 25–28],but the author has highlighted some points which were not made very clearin those texts (see the note below).

Assume a plant with m inputs given in the n-dimensional state-space rep-resentation

x = Ax+Bu+ d, (2.1)

Page 16: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

16 Sliding mode control: Theory and motivation of its use

with x, d ∈ Rn, u ∈ R

m and A,B matrices of consistent dimensions. Thegoal is to stabilize the system at the origin x ≡ 0 despite the disturbingsignal d which is assumed to be bounded. In many cases, it is practicallypossible to give such an upper bound for the disturbance, for example foran unknown load torque of an electric drive.

To be able to show that SMC can make the control system invariant (im-mune) to disturbances d and parameter variations in A and B, it is necessaryto perform a state transformation. It will become clear why. The followingnon-singular transformation

(x1x2

)

= Trx (2.2)

turns (2.1) into a new state-space representation

˙x1 = A11x1 + A12x2 + du

˙x2 = A21x1 + A22x2 + B2u+ dm(2.3)

of the so-called regular form which is thoroughly described in [12]. Thetransformation is sought to be carried out in such a way that 1) all plantparameters subject to unknown disturbances are carried in A21 and A22,leaving only structural ones and zeros in A11 and A12, and 2) such that alldisturbances d in (2.1) are carried by dm, the so-called matched disturbance,leaving the unmatched disturbance du zero

1. In this form, the design proce-dure can be carried out in two stages (as it is done by Utkin in [10]), eachconcerning problems of order lower than the original control problem:

In stage 1, design a new virtual output function

s = Sx = STrx = S1x1 + S2x2, s ∈ Rm (2.4)

with as many scalar components as inputs of the plant (2.1). Later it willbe shown that the dynamics of the closed-loop system is determined by Salone after the sliding mode has been reached.

In stage 2, design a feedback control law u with a discontinuous elementto stabilize the new output s at the origin s ≡ 0 in finite time and despitedisturbances. The system stability and the finite-time convergence propertyare to be proved using a Lyapunov function candidate.

Assume first the success of stage 2, i.e., assume s ≡ 0. Using (2.4), x2 =−S−12 S1x1, reduces the system (2.3) to

˙x1 = (A11 − A12S−12 S1)x1 + du , (2.5)

1 The terms matched and unmatched disturbances are explained in [13, p. 17]. Ac-cording to [3, pp. 42–43], they have been introduced by Drazenovic in 1969. Matcheddisturbances are those to which a variable structure system can be made invariant to.The condition for invariance is given as the theoretical existence of a u in (2.1) whichwould neutralize d (i.e., ∃u : Bu = −d) meaning the disturbance acts in the control space.

Page 17: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

2.2 Mathematical introduction of 1-SMC 17

which has the dimension n − m compared to n of the original system(2.3). Also called the zero dynamics2 with respect to s, it fully describesthe dynamic behavior of the system when the controller is forcing s ≡ 0.The remaining states can be calculated algebraically using (2.4), i.e., x2 =−S−12 S1x1.

If the transformation (2.2) was made in such a way that du = 0, and A11,A12 only contain structural ones and zeros (i.e., no plant parameters), it isobvious that the dynamics of the reduced system can be specified at willwith S, for example using pole placement or LQR methods3. The chosendynamics is completely invariant in the presence of parameter variations inA21 and A22 and matched disturbances dm since they do not appear in (2.5)(the controller designed in stage 2 neutralizes them). This was the rationalefor performing the transformation (2.2) at all.

Now that the closed-loop dynamics has been defined, the design of the dis-continuous control law in stage 2 is given attention. The following functionis used as Lyapunov function candidate:

V =1

2sT s . (2.6)

It is positive definite (V > 0∀s 6= 0) and radially unbounded (V → ∞ ifjust a single component of s →∞). Differentiation yields

V = sT s = sT Sx = sT S(Ax+Bu+ d) = sT (SAx+ SBu+ Sd) (2.7)

By choosing the discontinuous control law4

u = −(SB)−1SAx− k(SB)−1s

‖s‖ (2.8)

the time-derivative along V reduces to

V = sT (−ks

‖s‖ + Sd) = −k‖s‖+ sT Sd (2.9)

and because of the Cauchy-Schwarz inequality sT Sd ≤ ‖s‖ · ‖Sd‖

V < −η

︷ ︸︸ ︷

(k − ‖Sd‖) ‖s‖ = −η‖s‖ s 6= 0 . (2.10)

2Zero dynamics and also relative degree are concepts defined by A. Isidori in [14]. Theywill be used later in this thesis as well.

3Equation (2.5) corresponds to eq. 13 in [10]. In that paper by Utkin it is not obviousthat it is really possible to assign closed-loop eigenvalues at will in the general case of aplant with unknown parameter variations of A11 and A12. A note in [11] led the authorof this work to the idea that the state transformation (2.2) can be carried out such thatthose two matrices only contain structural ones and zeros (i.e., no parameters subject todisturbances) making it a trivial task to design S in (2.5).

4Note that s

‖s‖is a multidimensional generalization of sign(s). It is called unit control

in [3, p. 43] because the term always has the absolute value of one everywhere except onthe discontinuity surface.

Page 18: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

18 Sliding mode control: Theory and motivation of its use

In the nominal case (i.e., the plant does not deviate from the parameters inA and B), a value of η greater than zero (achievable by choosing k ≥ ‖Sd‖)ensures a negative definite V . In a more realistic case, the plant has un-known (but bounded) parameter variations. If the effects of those variationscan be included as a disturbance (in d), k can be chosen large enough to en-sure a negative definite V even in the presence of such disturbances. Thus,according to Lyapunov’s Direct Method, s = 0 is globally asymptoticallystable. However, according to [11, p. 16], an even stronger property applies:The special form of (2.10) (ss ≤ −η|s|) is called the η-reachability conditionwhich for η > 0 guarantees finite-time convergence to s ≡ 0. It ensuresthat s does not vanish in the vicinity of s like it would in case of a stablecontinuous control law. Moreover, s remains unzero (except at s = 0 whereit is formally undefined) and its sign steers to system back to s = 0. Whenthe η-reachability condition is satisfied, the minimum step of s at the s = 0crossing is 2η. By proper design, it is thus possible (even in presence ofdisturbances) to force the system to reach s = 0 after a finite time and letit stay there. No continuous feedback controller can achieve this.

Note that in a real system there will always be a delay and s = 0 will onlybe satisfied at isolated time instants. Rather, The system trajectories willbe confined to a small region around s = 0. This mode is called real slidingas opposed to ideal sliding where s = 0 is always satisfied. Generally, with1-SMC, the size of the region is directly proportional to the delay. ArieLevant has termed this sliding order 1 in his publication from 1993, [15],in which he also introduced the terms real/ideal sliding and higher ordersliding modes, which are the topic of the next chapter.

Page 19: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Chapter 3

2-SMC: A generalization of

1-SMC

Based on the introduction of 1-SMC in the last chapter, 2-SMC will now bepresented as an extension of 1-SMC.

3.1 From 1-SMC to 2-SMC

Some advantages of first-order sliding mode control (1-SMC) have been mo-tivated in the preceding sections. In particular, those are the invarianceproperty, the simplicity of implementation of the controller itself (no preciseplant model is needed) and the order reduction when the system is on thesliding surface. In all practical implementations, there are some importantpotential problems to be faced when using 1-SMC though:

1. Chattering: Defined as unwanted fast oscillations of the system trajec-tories near the sliding surface, chattering needs to be considered in any1-SMC implementation. Because any 1-SMC control signal is of fast-switching nature, there is always the chance that those fast switchingswill excite plant eigenmodes not accounted for in the design—which inturn can lead to chattering. A smooth control signal might not excitethese eigenmodes. Chattering is also caused when the control law isimplemented in a sampled system, which is mostly the case. Becausesampled control systems act as open-loop systems between two sam-pling instants, it is impossible for any sampled control algorithm tosatisfy a constraint with infinite accuracy when acting on a plant withuncertain internal and/or external disturbances. Also in the case of 1-SMC, the trajectories will inevitably leave the sliding surface betweensliding instants (discretization chattering).

Page 20: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

20 2-SMC: A generalization of 1-SMC

0

0

s

s

ss > 0, ssM < 0

ss > 0, ssM < 0ss < 0, ssM > 0

ss < 0, ssM > 0

sM1sM2 sM3

Figure 3.1: 2-SMC. Qualitative display of the reaching phase of the twisting al-gorithm (sliding takes place in the origin only). The points sM1, sM2 and sM3

are the first singular values of s, respectively. They are relevant for the treatmentof the “sub-optimal algorithm”. The twisting is always clockwise which impliesss > 0⇔ ssM < 0 and ss < 0⇔ ssM > 0.

0

0

s

s

Figure 3.2: 1-SMC reaching phase (same as figure 2.1 right). Sliding takes placeon the s = 0 axis. Compare with figure 3.1. The smooth s in figure 3.1 is the mainadvantage of 2-SMC.

Page 21: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

3.1 From 1-SMC to 2-SMC 21

2. Accuracy: It has been shown in [15] that real, sampled 1-SMC al-gorithms can keep the sliding constraint s = 0 no better than withan error proportional to the sampling time τ , i.e., the sliding error isO(τ).

3. Relative degree one limitation: Finite-time stabilization of the slidingvariable at the origin, s = 0, is only guaranteed with a 1-SMC algo-rithm if the algorithm can assign the sign of s directly. In other words,the input must appear explicitly in the first derivative of s, i.e. thesystem must have relative degree one with respect to s. If more levelsof differentiation of s are required before the input appears, i.e., incase of higher relative degree, 1-SMC algorithms might not be able tostabilize the system at all.

There are different ways to reduce the impacts of the mentioned disadvan-tages and among them is application of higher order sliding mode controllers,introduced by Arie Levant (formerly L.V. Levantovsky). By definition, thesecontrollers achieve better accuracy. Indeed, in [15], Levant has defined qthorder real sliding algorithms as those SMC algorithms able to keep a con-straint, s = 0, with an error O(τ q) where τ is the sampling time. In thesame paper, he shows that a necessary condition to achieve this is a thats = s = · · · = s(q−1) = 0 is satisfied in an ideal sliding mode. In a laterpaper, [16], he adds that the qth derivative s(q) mostly is “supposed to bediscontinuous or non-existent”. It is important to note this: While in stan-dard 1-SMC, s is value-discontinuous, in q-SMC, the discontinuity appearsonly after (at least) q-times differentiation, in s(q). This is why s is smootherthe higher the sliding order. Levant also proposes some 2-SMC control lawsand provides conditions for finite-time convergence to s = s = 0. Amonghis proposed 2-SMC algorithms are the “twisting algorithm” and the “driftalgorithm”. Other authors have contributed with other 2-SMC algorithms.

2-SMC controllers as a special case of higher order sliding mode control pre-serve the desirable properties (in particular: invariance and order reduction)but they achieve better accuracy and guarantee finite-time stabilization ofrelative degree two systems. There are new problems to be faced, however:

1. 2-SMC controllers generally need tuning of several parameters. Theo-retically, it is possible to find the parameters by using the convergenceconditions (some are presented later on) for the controllers togetherwith a worst-case estimate of the plant error. The convergence con-ditions are generally sufficient, but might be too conservative. Thisleaves the control engineer with the complex problem of finding theideal set of control parameters. Some authors, [7, p. 367], [17, p. 341],suggest the trial-and-error method to solve the problem—a solutionwhich is far from ideal in the opinion of the author: In the lack of

Page 22: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

22 2-SMC: A generalization of 1-SMC

a more intelligent algorithm, the design engineer might try doing a“dumb” grid search, but this optimization problem may be of suchhigh dimension/complexity that it is practically impossible to find theoptimal set of parameters in the sense of some cost function.

2. In general, 2-SMC controllers rely on known s (like in 1-SMC) and ad-ditionally s. In a real application, these signals are probably not avail-able, at least not without the use of observers or differentiators—thoseagain being sensitive to noise and disturbances. In the literature, suc-cessful experiments using sliding mode observers [5] or robust slidingmode differentiators [18] to reconstruct s and s have been reported1,but it is generally difficult to prove the closed-loop stability, even if thecontroller and the observer can be proved convergent separately—theseparation theorem generally cannot be applied in nonlinear controlsystems. Apart from troubles proving stability, the use of observers-/differentiators introduces additional parameters potentially hard todetermine/tune.

3. It is harder to prove stability with 2-SMC than for 1-SMC. WhileLyapunov’s Direct Method can be used (see section 2.2) for 1-SMCdesigns, Lyapunov functions are not known for most 2-SMC designs.The first Lyapunov function to prove stability of a 2-SMC algorithmwas presented in 2008, in [19], for the so-called super-twisting algo-rithm (introduced below). Because the Lyapunov approach generallydoes not lead to a conclusion on stability, “special treatments, oftennon-systematic, are needed” ([18]) and Bartolini presents such a proofin several parts in [20] using a multistep algorithm.

In the next sections, an overview of some important 2-SMC algorithms andtheir properties is given.

3.2 2-SMC algorithms

A variety of 2-SMC control algorithms have been proposed by different au-thors. The algorithms differ with respect to the following aspects:

• Some are formulated in continuous-time (which must be discretized)and others explicitly in discrete-time (e.g., the drift algorithm is for-mulated in discrete-time in [15]).

• Most 2-SMC algorithms are able to stabilize a sliding constraint s withrelative degree r = 2. One notable exception is the super-twisting

1The way the sliding derivatives are calculated in [5] is probably through explicit sub-stitution in the motor model equations—a method which is sensitive to any parametervariation and thus appalling.

Page 23: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

3.2 2-SMC algorithms 23

algorithm (to be presented) which can only stabilize r = 1 plants.

• The algorithms differ in the number of necessary parameters to tune.

• Most algorithms require knowledge of s and s, but some require lessreal-time plant information (the super-twisting algorithm) and somerequire other information (e.g., it will be shown that the sub-optimalalgorithm is different with respect to this).

3.2.1 Preliminaries

Considered are plants which are affine in the input

x = f(t, x) + b(t, x)u (3.1)

where x ∈ Rn is the system state, t the time, f , b are smooth uncertain vector

functions and u ∈ R is the plant input. A sliding manifold is introduced asa control design parameter

s = s(t, x) ∈ R (3.2)

and treated as a new output of the system. s can be designed such that ithas the relative degree r and a corresponding stable zero dynamics s = 0.Relative degree r means that s must be differentiated r times before theinput u appears. The zero dynamics of the system (3.1) with respect to sis simply the remaining dynamics when s = 0 is forced to zero. It has thedimension n−1. See the book by Isidori, [14], for additional information onzero dynamics and relative degree. The treatment is additionally limited tosystems with constant relative degree.

If the system has a relative degree r = 1 with respect to s, 1-SMC canstabilize s = 0 in finite time, but s is nonzero which can easily lead tochattering in the output trajectory as described in previous sections. 2-SMC can stabilize the same system (with r = 1) on the sliding set s =s = 0 in finite time. Because 2-SMC additionally keeps s = 0 it is aneffective means of removing or reducing chattering. In sampled systems,the constraints naturally cannot be held perfectly at zero; however, theerror is vanishing fast with decreasing sample times. Per definition, [15],s is O(τ2) and s is O(τ) in 2-SMC. For systems with r = 2, 1-SMC canonly in some case achieve exponential stability (finite-time stability beingimpossible) and other systems become unstable, [21, p. 64]. Therefore, atleast a second-order controller is normally required for a relative degree twosystem.

Below, some notable 2-SMC control laws are presented.

Page 24: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

24 2-SMC: A generalization of 1-SMC

3.2.2 Twisting algorithm

The twisting algorithm, one of the first known 2-SMC algorithms, was in-troduced by L.V. Levantovsky (now Arie Levant) in a Russian publicationin 1985. In a paper from 1993, [15], he formally introduces sliding order andhigher order sliding mode as concepts and he presents the twisting algorithmagain for the first time in English.

Assume that s(t, x) ∈ R has been defined for the uncertain plant (3.1) suchthat the corresponding zero dynamics s ≡ 0 is stable and achieves the controlgoal. Assume a relative degree of the system with respect to s of r = 2. Theremaining control problem is to stabilize

s = φ(t, x) + γ(t, x)u (3.3)

of which only the bounds Φ, Γm, ΓM and s0 are known:

|φ(t, x)| < Φ, 0 < Γm ≤ γ(t, x) ≤ ΓM , |s(t, x)| < s0. (3.4)

The twisting algorithm

u =

−Vm sign(s) if ss ≤ 0−VM sign(s) if ss > 0

(3.5)

ensures stabilization of the sliding set s = s = 0 in finite time given aproper choice of VM and Vm. Sufficient conditions are (these might be tooconservative!), [15],

VM > Vm

Vm > 4ΓM

s0

Vm > ΦΓm

ΓmVM − Φ > ΓMVm +Φ

. (3.6)

The trajectories in the s-s plane rotate (“twist”) around the origin an infinitenumber of times while the distance to the origin is decreasing. The origin isreached in finite time. See figure 3.1. Note that sliding only takes place inthe origin. In the reaching phase (i.e., the time before sliding commences),s converges non-monotonically.

3.2.3 The sub-optimal algorithm

The so-called sub-optimal algorithm introduced by Bartolini, Ferrara andUsai in [22] and the twisting algorithm presented above belong to the sameclass of 2-SMC algorithms defined by, [18],

u =

−U sign(s− βsM ) if (s− βsM )sM ≥ 0−α∗U sign(s− βsM ) if (s− βsM )sM < 0

(3.7)

Page 25: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

3.2 2-SMC algorithms 25

where U > 0 is the minimum control magnitude, α∗ > 1 is the modulationfactor, β is the anticipation factor, and sM is the value of s at the last instantwhere s = 0. sM is in other words the last local minimum, maximumor inflection point and is called the last singular value of s (terminologyaccording to [18]).

The sufficient conditions for finite-time convergence to the sliding set s =s = 0 are, [18],

U > ΦΓm

α∗ ∈ [1;∞) ∩(2Φ+(1−β)ΓMU

(1+β)ΓmU;∞

)

β ∈ [0; 1). (3.8)

Contrary to the special case of the twisting algorithm, this general algorithm(3.7) does not only commute on the axes, see figure 3.3. It turns into thetwisting algorithm (3.5) under the conditions β = 0, U = Vm, α∗ = VM/Vm

which is easily verified. That

ssM > 0⇔ ss < 0 and ssM < 0⇔ ss > 0 (3.9)

applies is easily assured for the special case β = 0 - see figure 3.1.

While the twisting algorithm shows non-monotonous convergence of s in thereaching phase, the general algorithm can provide monotonous convergenceby choosing parameters stricter than indicated in (3.8). This will generallyincrease the convergence time, however. The set of stricter parameters andthe maximal duration of the reaching phase are given in [18].

With β = 0.5, (3.7) becomes the sub-optimal algorithm. A typical reachingphase is depicted in figure 3.3. Note that controller structure shifts (com-mutations) do not only take place on the axes. The parameter β is used toinfluence this in such a way that the maximal s stays smaller than if thetwisting algorithm were used. This could be an advantage.

3.2.4 Super-twisting algorithm

Another algorithm, the super-twisting algorithm, was introduced by Levantin 1993, in [15], and the name has been used since the publication [23] byBartolini from 2000. It is a 2-SMC algorithm capable of stabilizing s = s = 0in finite time for relative degree one systems only. The control law

u = −λ|s|ρ sign s+ u1 (3.10)

u1 = −W sign s

is continuous in contradiction to those of the class (3.7) and it only requiresmeasurements of s.

Page 26: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

26 2-SMC: A generalization of 1-SMC

−0.5 0 0.5 1 1.5 2 2.5−15

−10

−5

0

5

0 0.2 0.4 0.6

0

1

2

0 0.2 0.4 0.6−500

0

500

s

s

x1

tt

u

Figure 3.3: A typical reaching phase of the sub-optimal algorithm (U = 150, α∗ = 3,β = 0.5). Notice the “bouncing” behavior and compare with the twisting algorithmin figure 3.1. Because commutation of the sub-optimal control signal is not limitedto take place on the axes, it is possible to achieve a lower maximal s which mightbe an advantage. Plant (with sinusoidal disturbance): x1 = 5x1 + 50 sin 10t + uwith initial conditions x1 = 2, x1 = 5. Sliding manifold: s = x1. Simulation inSimulink with Euler fixed step T = 1× 10−4 s.

Page 27: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

3.2 2-SMC algorithms 27

−40 −20 0 20 40 60 80 100−2000

−1000

0

1000

0 0.2 0.4 0.6−1

0

1

2

0 0.2 0.4 0.6−1000

−500

0

500

1000

snew

s new

x1

tt

u

Figure 3.4: Reaching phase using super twisting algorithm (W = 550, λ = 100, ρ =0.5). Same plant/disturbance/initial conditions/simulation conditions as in figure3.3, but new sliding surface snew = 40x1 + x1. Sliding commences at t = 0.305 safter which x1 is governed by the zero dynamics snew ≡ 0 (exponential decay).

Page 28: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

28 2-SMC: A generalization of 1-SMC

The sufficient conditions for finite-time convergence are, [21],

W >Φ

ΓM

λ2 ≥ 4ΦΓM (W +Φ)

Γ3m(W − Φ)(3.11)

0 < ρ ≤ 0.5

where Φ, Γm and ΓM are the same as in (3.3) and (3.4) where u has beenreplaced by u.

To be able to compare the super-twisting with the sub-optimal algorithm,the sliding manifold has been redefined such that it has relative degree one.The simulation results are depicted in figure 3.4. Note that the controller pa-rameters have been chosen heuristically because the convergence conditions(3.11) result in practically useless results (i.e., much too high values of s)because they are too conservative. Note also that the necessary redefinitionof the sliding manifold to include the derivative x1 can be interpreted as adisadvantage of this algorithm, because it has a wider information demand.

3.3 Two short notes on relative degree

Most SMC algorithms require a certain, constant relative degree. Somenonlinear systems do not have constant relative degree (consider for examplea system in which the coefficient of the input u vanishes for some systemstates2). Such systems consequently require special treatment.

Another issue related with relative degree is that of fast actuators. If a sys-tems is modeled as having a well-defined relative degree of 2, the real systemmight be controlled by an actuator with a very fast unmodeled dynamic be-havior. In theory, this would increase the relative degree by the order of theunmodeled dynamics, but it might not render the designed control useless—at least not if the system is still fundamentally acting as a relative degreetwo system. As a result, oscillations in a limit cycle might arise (chattering).For 2-SMC, the error of s and s is limited by O(τ2) and O(τ) respectively,where τ is the small time constant of the fast actuator [24].

3.4 Estimation of needed derivatives

As it has become clear above, it is generally necessary to estimate certainderivatives to deploy sliding mode control in practice. Indeed, the 2-SMC

2 This is also the case for the induction motor which will be treated later. It has arelative degree 2 with respect to some outputs but this number increases if the flux is zero.

Page 29: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

3.4 Estimation of needed derivatives 29

controllers generally need the sign of s. The super-twisting algorithm doesnot need this information, but works only for relative degree one systems.

If, for example, the twisting algorithm is to stabilize the sliding variable sof relative degree two in finite time, it would require the sign of s. To usethe super-twisting algorithm, it would be necessary the redefine the slidingvariable as snew = cs+ s. This redefinition decreases the relative degree toone and allows the super-twisting algorithm to stabilize snew in finite time.The convergence of s would by exponential only, however. Since the newsliding surface includes s, the necessary number of derivatives is not reallysmaller.

A way to find one or more derivatives of a virtual output must be found. Ifit is not feasible or possible to add an additional sensor, means of estima-tion must be considered. The author has found two main solutions in theliterature: Using observers combined with direct evaluation of differentialequations of the plant (inherently subject to accuracy problems in case ofparameter variations) or using differentiators not including even a nominalplant model. The latter possibility is explored in section 4.4.7.

Page 30: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

This page intentionally contains only this sentence.

Page 31: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Chapter 4

Robust induction motor

control using 2-SMC

In this chapter, a robust speed controller based on 2-SMC is developed forthe induction motor. A mathematical model of the induction is selected andpresented. The control problem is formulated and each part of the controlleris presented, also including how required, but immeasurable, functions ofthe motor state are estimated. The problem of finding suitable controllerparameters will be left to the following chapter 5.

4.1 Preliminary remarks and control goal

From now on, the control system in figure 4.1 is studied. The goal is tomake an induction motor turn the shaft of a work machine accurately at the

Trajectorygenerator

Controller &observer

Inverter

Currentsensors

Speedsensor

Workmachine

Motor

234 1

Figure 4.1: Subdivisions 1–4 of the control system (the numbers are referred to insec. 4.2): (1) Work machine, a mechanical device performing a task, (2) motor, withsensors and inverter, (3) controller & observer and (4) speed trajectory generator.

Page 32: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

32 Robust induction motor control using 2-SMC

speed given by the trajectory generator. A feedback controller (acquiringmeasurements from sensors) is needed to achieve this goal because knowledgeof inverter, motor and work machine parameters is only approximativelyavailable.

The following section presents what is assumed about the system. Based onthese assumptions the controller design is carried out.

4.2 Assumptions

1. The work machine is the load—a torque working on the motor shaft.Very different load characteristics are possible; for example, an elevatoror crane provides approximately a constant (gravitational) load torquewith constant sign independent of direction and speed while a fan isdominated by speed-dependent forces. A very problematic case is theslip-stick effect caused by transitions between static and dynamic fric-tion in some mechanical systems. The slip-stick phenomenon resultsin steep jumps in load torque. Here, no certain kind of load is speci-fied initially. Instead, the load torque and its derivative are assumedsmooth and bounded:

|ML| < ML, |ML| < ¯ML (4.1)

2. The motor is a three-phase squirrel-cage induction motor. A detaileddynamical model is used for control design, but as any other modelit does not reproduce every physical characteristic. Specifically, themagnetic circuit is assumed to be operated in a saturation-free, linearregion (i.e., no hysteresis losses). The iron permeability is taken to beinfinite such that only the permeability of the uniform, narrow air gapaffects the magnetic circuit. Additionally, the stator winding distribu-tion is sinusoidal (to ensure steady torque generation when the motoris spinning under steady-state conditions). Effects of windings beingconcentrated in slots are ignored. The mathematical formulation ofthe model will be described in the next section. The model does takeaccount for stator and rotor leakage inductances (i.e., the unwantedself-inductances of the stator and rotor windings). The motor parame-ters are assumed to be nominally known. Deviations from the nominalvalues are allowed if bounded. It is known that the rotor resistanceis especially sensitive to temperature variations and it can increase upto factor two in some cases [4].

It is expected that a speed sensor delivers the shaft speed ω accuratelyand with a specified upper bound for the noise. It could work by

Page 33: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

4.2 Assumptions 33

differentiating an optical encoder signal (for instance, using robustfinite-time differentiators as described later in section 4.4.7). The wayω is estimated is not considered any further here. Similarly, currentclamps and amplifiers deliver the three phase currents. These signalsmight be corrupted by noise from the inverter but its effect is assumedsmall.

The motor is powered by a pulse-width modulation controlled three-phase inverter. The duty cycles for each phase is provided directlyfrom the control algorithm to be designed. The dynamics of the powersemiconductors is not modeled.

3. It is assumed that the desired speed trajectory signals ωref, ωref, ωref,the measured actual speed ω and stator phase currents ia, ib and icare available to controller and observer. It is furthermore assumedthat the algorithms are implemented in a computer with sufficientcomputational power to maintain a fixed sampling frequency at leasttwo times higher than the fastest eigenfrequency of the motor electricaland mechanical subsystems (in order to satisfy the Nyquist samplingtheorem).

4. The trajectory generator provides the desired shaft rotational speedωref and its derivatives ωref, ωref. Since the motor is supposed totrack this trajectory accurately, it is necessary to assume smooth ωref,ωref and ωref (i.e., no steps) bound by physical limitations

|ωref| < ωref, |ωref| < ¯ωref, |ωref| < ¯ωref. (4.2)

A simple way to implement the trajectory generator if the externallyprovided speed setpoint ωdisc has discontinuities (e.g., steps) is to usea third-order state-space low-pass filter to get smooth ωref , ωref andωref. The principle is the same as for the second-order low-pass filterin figure 4.2: With properly chosen ks, the error at the summing pointconverges to zero quickly, i.e., ωref follows ωdisc closely but with asmall delay. The derivatives of the filtered signal are available at theintegrator inputs. The author used MATLAB’s besself function todesign a Bessel low-pass filter (see the source code in the appendix onpage 80). The cut-off frequency is to be chosen high enough to let theimportant reference signal part pass, but choosing a lower frequencyreduces the maximal derivatives (which in turn limits mechanical stressand eases controller design).

Page 34: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

34 Robust induction motor control using 2-SMC

2

wref'

1

wref

1s

1s

k2

k1

1

wdisc

Figure 4.2: Using a second-order linear low-pass filter to generate smooth andconsistent ωref, ωref from a discontinuous input.

4.3 Induction motor model

In this work, a dynamical model of the induction motor has been used. Thephysical quantities are mapped into a certain coordinate system to be ableto handle the model in a common state-space form. This form is used inseveral publications treating SMC of induction motors by Utkin, [9], [10],[25], and by other authors, [5], [26], [4] and [27], to mention a few. Differentconventions in regard to how the physical quantities are mapped into thementioned coordinate system are used, however, and the authors are not al-ways explicit. This results in a factor 3

2 appearing in the expressions for theelectrical torque M in some publications and in other not. To investigatethis, the author decided to derive the state-space form from a more funda-mental model from the popular book by W. Leonhard on electric motors,[1].

In the book, he derives the following model equations based on the simpli-fying assumptions specified in the previous section:

Rsis +dφs

dt= us

Rrir +dφr

dt= 0

φs = Lsis + Lhejpθirφr = Lhe−jpθis + Lrirdθdt

= ω

J dωdt

= M −ML M = pIm(i∗rφr).

(4.3)

The mechanical rotor angle is denoted θ and the angular velocity ω. p isthe number of pole pairs such that pω is the so-called electrical rotor speed.ir and is are the complex vector sums of rotor and stator currents, us isthe complex vector sum of the stator input voltage, and φr and φs are thecomplex fluxes due to the rotor and stator currents, respectively. The effectsof rotor and stator resistances are described through the parameters Rr andRs. The mutual inductance between rotor and stator is denoted Lh. Theunwanted leakage inductances Lrσ, Lsσ are included in the total inductancesof the rotor and stator, in Lr = Lh + Lrσ and Lr = Lh + Lsσ. Im denotes

Page 35: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

4.3 Induction motor model 35

the imaginary part, j is the imaginary unit and e is Euler’s number.Eliminating φs and then ir in the first four equations yields

Rsis + Lsdisdt+ Lh

Lr

ddt

(ejpθφr − Lhis

)= us

dφr

dt= −Rr

Lrφr +

RrLh

Lre−jpθis

(4.4)

and introducing the complex rotor flux in stator coordinates φr = ejpθφr

instead of rotor coordinates simplifies the equations further to

σLsdisdt

= −Rλis − µjpωφr + µαrφr + us

dφr

dt= jpωφr − αrφr + Lhαris

(4.5)

where

σ = 1− L2hLsLr

, µ =Lh

Lr, Rλ = Rs +

L2hL2r

Rr, αr =Rr

Lr(4.6)

have been used. The complex equations are then written in their real com-ponents using

is = isα + jisβ and φr = φrα + jφrβ . (4.7)

The motor torque M has been evaluated using the fourth equation of (4.3)for ir and φr = e−jpθφr again. After cancelations, the expression becomes

M = pµ(isβφrα − isαφrβ). (4.8)

This equation for the torque does not correspond to the one used in simu-lations which are presented later in the report. Rather, the equation

M =3pµ

2(isβφrα − isαφrβ), (4.9)

has been used since an early stage of the project. Equation (4.9) is in accor-dance with Utkin in [25]. The discrepancy was discovered late and it wasdecided to continue using (4.9). Regardless, it does not effect the conclu-sions because it is just a small scaling factor. It remains to be determinedwhich expression is right.

Finally, the complete model can be described in state-space form as

J ddt

ω = 3pµ2 (isβφrα − isαφrβ)−ML

ddt

φrα = Lhαrisα − αrφrα − pωφrβddt

φrβ = Lhαrisβ − αrφrβ + pωφrα

σLsddt

isα = −Rλisα + µαrφrα + µpωφrβ + usα

σLsddt

isβ = −Rλisβ + µαrφrβ − µpωφrα + usβ .

(4.10)

The state variables ω, φrα, φrβ, isα, isβ describe the mechanical rotor speed,the rotor flux and stator currents, and uα, uβ are the stator voltage inputs—all in the stator-fixed (α, β) reference frame. It is straightforward to convertthe (α, β) coordinates into physical quantities as will be shown in section4.3.1.

Page 36: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

36 Robust induction motor control using 2-SMC

4.3.1 Model states and coordinates

The state-space model of the induction motor has already been given in(4.10). It must be kept in mind that other state-space representations withanother choice of states equivalently can describe the motor. Common vari-ants include 1) rotor flux components and stator current components in rotorflux-oriented (d, q) coordinates [3, p. 216] and 2) rotor flux components andstator current components in stator-oriented (α, β) coordinates [3, p. 214].The latter variant is used in this work because a controller designed for thesecoordinates does not need a rotor flux angle-depending coordinate transformto be implemented (which is the case for the former variant). In this work,the controller output (uα, uβ stator-oriented voltages) is transformed intothe actual phase voltages ua, ub, uc using the static transform [3, p. 215]

ua

ub

uc

=

[1 −1/2 −1/20√3/2 −

√3/2

]T [uα

]

(4.11)

and the compliant transform to calculate (α, β) current components fromactual, measured ia, ib, ic phase currents [3, p. 215]

[iαiβ

]

= 2/3

[1 −1/2 −1/20√3/2 −

√3/2

]

iaibic

. (4.12)

To derive the inverter voltages u1, u2 and u3 yet another time-invarianttransform is necessary depending on whether the phases are connected indelta or star arrangement. For the purpose of simulation, none of thesetrivial transformations are required: Only the (α, β) coordinates are consid-ered below. For real implementation or for comparison between simulationresults and real experimental data, it is unproblematic to apply the relevant(time-invariant) transforms.

4.4 Control design

4.4.1 Mathematical formulation of control problem

The model of the control object (4.10) has 5 states, 2 inputs uα, uβ andan unknown load torque ML which is seen as a disturbance. Three of thestates, ω, isα, isβ , are directly measured using sensors—see figure 4.1.

For the following treatment it is desirable to choose some virtual outputs insuch a way that keeping these outputs zero will achieve the control goal. It

Page 37: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

4.4 Control design 37

turns out that it is suitable to specify two such virtual outputs. If they aredefined as

s1 = ω(t)− ωref(t)s2 = ||φr(t)||2 − ||φr,ref||2

(4.13)

a successful controller would guarantee tracking of the external speed ref-erence ωref(t) and keep the rotor flux magnitude constant at ||Φref||. Ithas intentionally been chosen to operate with constant rotor flux in orderto simplify the control design. A varying rotor flux is necessary in order tooptimize power consumption, but the scope of this work is another, i.e., toexamine sliding mode control.

To recapitulate: The controller is successful if it can be designed to keeps1 ≡ 0, s2 ≡ 0.

4.4.2 Control design – decoupling

Since the goal has been formulated to stabilize s1, s2 at the origin, the systemshould be analyzed with respect to this virtual output. The dynamics canbe written [

s1s2

]

=

[D1

D2

]

+

[A11 A12

A21 A22

] [uα

]

(4.14)

where D1, D2, A11, A12, A21, A22 are scalar functions of the system statesω, φrα, φrβ, isα, isβ, of the motor parameters and of the load torque derivativeML, but not of uα and uβ—the dependence is explicitly given in (4.22) inthe following section. Equation (4.14) reveals the relative degrees of thecontrol object (4.10) with respect to the virtual outputs s1 and s2 to beboth two (the inputs appear after two times differentiation). Analyzing thematrix definitions closer, it is seen that zero rotor flux must be handled asa separate case (see section 4.5). If a new control v is introduced as

u = A−1(−D + v) (4.15)

(with self-evident matrix definitions) it reduces the system (4.14) to

[s1s2

]

=

[v1v2

]

(4.16)

which can be identified as a very simple system: Two independent doubleintegrators. The new control is thus ideally achieving a feedback lineariza-tion and has simplified the solution of the problem. Now, controllers justhave to be designed for the independent subsystems s1 = v1 and s2 = v2.The prerequisites for this to work is perfect feedback linearization whichrequires exact knowledge of all motor parameters, load torque derivative,system states and reference trajectories. In a practical situation, some of

Page 38: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

38 Robust induction motor control using 2-SMC

these parameters are known with good accuracy and others only with lim-ited accuracy or not at all. Disturbance terms can be added to include theerrors which arise due to limited accuracy or no knowledge and (4.16) turnsinto [

s1s2

]

=

[v1v2

]

+

[d1d2

]

. (4.17)

If the load torque and its derivative and all parameters uncertainties arelimited such that the bounds

|d1| < d1, |d2| < d2 (4.18)

exist, it is possible to design a s1, s2-stabilizing controller for (4.17).

4.4.3 Derivatives of sliding variables

The feedback linearization need the second derivatives of the sliding vari-ables. The are calculated explicitly below. The sliding variables

s1 = ω(t)− ωref(t)s2 = ||Φ(t)||2 − ||Φref||2

(4.19)

which were defined in (4.13) and are functions of the state variables of (4.10)are differentiated once

s1 =1J32pµ(isβφrα − isαφrβ)− 1

JML − ωref

s2 = 2Lhαr(φrαisα + φrβisβ)− 2αr(φ2rα + φ2rβ)

(4.20)

and once again, to yield the matrix equation[

s1s2

]

=

[D1

D2

]

+

[A11 A12

A21 A22

] [uα

]

(4.21)

withD1 = − 1

J32pµ(φrαisβ − φrβisα)(αr +

σLs)+

1J32pµ(φ2rα + φ2rβ)pω(− µ

σLs)+

1J32pµ(−φrαisα − φrβisβ)(pω)+

−1J

ML − ωrefD2 = (φrαisα + φrβisβ)(−6Lhα2r − 2Rλ

Lhαr

σLs)+

ω(φrαisβ − φrβisα)(2pLhαr)+

(φ2rα + φ2rβ)(4α2r + 2Lhα2

rµσLs

)+

(i2sα + i2sβ)(2L2hα2r)

A11 = −32(φrβ

pµJσLs

)

A12 =32(φrα

pµJσLs

)

A21 = φrα2Lhαr

σLs

A22 = φrβ2Lhαr

σLs.

(4.22)

The scalars D1, D2, A11, A12, A21, A22 are needed by the linearizing feedback.Note that they depend on all motor parameters, all motor states, on thespeed reference signals and on ML. They do not depend on ML.

Page 39: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

4.4 Control design 39

4.4.4 Control design – preliminary attempt

The simplest imaginable way to proceed would be to use the linear feedbackcontrols

v1 = −k11s1 − k10s1v2 = −k21s2 − k20s2

(4.23)

where the control engineer can place the closed-loop poles at will by choosingproper ks. The real control output uα, uβ would be calculated using (4.15)and subsequently by applying the transforms described in section 4.3.1.

Assigning proper values to s1 and s2 is basically the way to stabilize thesystem. This proportional-differential controller directly assigns values tos1 and s2 if d1 = d2 = 0. If the errors s1, s2 are small compared to nonzerodisturbances δ1, δ2, the errors—rather than the controller—assign the signsof s1 and s2. The controller is said to have little authority under theseconditions. An integral term could be added to remove any steady-stateerror, but before the integral term can possible take authority of s1 and s2,an error must have been present for some time.

In the next section, a sliding mode controller is designed. Since discontinuousfeedback based on the sign of the error is used in SMC, the controller has ahigh authority of s1 and s2 even for very small errors. This is a significantdifference compared with continuous feedback control. With SMC, smallerrors are acted upon swiftly and with an amplitude designed to dominatethe disturbances.

4.4.5 Sliding mode control design

With a sliding mode control, it is possible to ensure finite-time stabilizationof s1, s2 at the origin if the disturbances are bounded as in (4.18). A first-order sliding mode control will usually not be able to stabilize s1, s2 becausethe relative degree of the system with respect to these variables is 2. Inthis case, 2-SMC or even higher order SMC is necessary. Here, the twist-ing algorithm (a 2-SMC algorithm) is used. While a discontinuous controlhas strong authority of the controlled system in the vicinity of the slidingsurface, the same is no true far from the sliding surface. On the contrary,a continuous proportional-differential (PD) feedback has limited authoritynear the sliding surface, but a strong one far from it. For the same reasons,i.e., to improve the convergence rate and to achieve a wider domain of at-traction, [19, p. 2858] and [5] suggest to add a continuous feedback vc tothe discontinuous one. This procedure is adopted here and called composite2-SMC+PD control. The resulting control becomes

vi = vd,i + vc,i i = 1, 2 (4.24)

Page 40: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

40 Robust induction motor control using 2-SMC

where vd,i is the output of the twisting algorithm

vd,i =

−Vm,i sign si if sisi ≤ 0−VM,i sign si if sisi > 0

i = 1, 2 (4.25)

and vid is the linear state feedback

vc,i = −k2i si − 2kisi i = 1, 2. (4.26)

Note that this control law reduces the plant to have same the behavior astwo critically damped oscillators of the form si + 2kisi + k2i si = 0 (valid inthe absence of the discontinuous feedback and plant disturbances). Criti-cal damping means fastest possible convergence without overshoot. If thedisturbances are bounded as in (4.18), it is possible (see section 3.2.2) tochoose the gains Vm,1, VM,1, Vm,2, VM,2 such that s1, s1, s2, s2 converge tozero in finite time and stay there.

4.4.6 Sliding mode observer

To realize the feedback law (4.15) and (4.24), the following quantities arerequired: The inverse of the A matrix and the D matrix for linearizingfeedback, the two sliding variables s1, s2 and their derivatives s1, s2. Thesliding variables do only depend on reference speed ωref, actual speed ω,reference rotor flux and actual rotor flux φ2r = φ2rα+φ2rβ . The matrices A−1

and D, however, depend on all motor parameters, on all 5 state variables, onthe reference signal ωref and on the derivative of the load torque ML. For thelinearizing feedback, the controller will use nominal motor parameters. Thereference signal ωref is provided. The derivative of the load torque ML is

impossible to forecast so it will be approximated to ML ≡ 0 (correspondingto a slowly varying load). Of the 5 state variables, only the rotor fluxcomponents φrα, φrβ are unknown and have to be estimated. This is doneusing an observer which is presented below. In the next section, it is shownhow the derivatives of the sliding variables are estimated without relying onexact knowledge of the motor parameters.

The simplest way to estimate the rotor flux is to integrate the second andthird equation of (4.10) online in the controller hardware. This requires theuse of the measured signals ω, isα and isβ. In [25, p. 279], it is shown (usinga simple Lyapunov candidate function) that the estimation errors φrα =φrα − φrα and φrβ = φrβ − φrβ converge to zero. The rate of convergenceis not adjustable, however, and this method of estimation may be too slow.There exist several ways to estimate the flux while being able to adjust theconvergence rate. One way would be to implement an Extended KalmanFilter, which is a recursive state estimator for nonlinear systems. In eachtime step, the motor equations would be linearized. Then a feedback gain

Page 41: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

4.4 Control design 41

matrix, optimal with respect to process and measurement noise, would becalculated. Since this process is calculation intensive and because this reportis on sliding mode control, a sliding mode observer is used instead. It isnonlinear by nature and no online linearization and optimization is needed.Its convergence can be shown using Lyapunov’s Direct Method.

The sliding mode observer proposed by the authors of [26] is used. It is sim-ilar to the sliding mode flux observer presented by Utkin in [3] but the gainshave been modified to be rotor speed dependent to improve the convergencerate. An extra equation for online rotor resistance estimation has been leftout here in order to reduce complexity.

The observer differential equations are

ddt

φrα = Lhαr isα − αrφrα − pωφrβ +Gx1Isddt

φrβ = Lhαr isβ − αrφrβ + pωφrα +Gx2Is

σLsddt

isα = −Rλisα + µαrφrα + µpωφrβ + usα +Gz1Is

σLsddt

isβ = −Rλisβ + µαrφrβ − µpωφrα + usβ +Gz2Is

(4.27)

which are the last four equations of (4.10) with ω as a parameter insteadof an observer variable and with added discontinuous gains based on theswitching function

Is =

[sign(isα − isα)

sign(isβ − isβ)

]

=

[− sign(isα)− sign(isβ)

]

. (4.28)

This is a first-order sliding mode observer. By proper choice of the gainsGz1 and Gz2, the observer will reach the intersection of the sliding surfacesdefined by isα = isα − isα = 0, isβ = isβ − isβ = 0 in finite time. Afterarriving in sliding mode, and if Gx1 and Gx2 are properly chosen, the errorsφrα = φrα−φrα and φrβ = φrβ−φrβ converge asymptotically to zero as willbe shown using Lyapunov theory. The gain matrices are given as follows

Gz =

[Gz1

Gz2

]

=

[η1 00 η1

]

(4.29)

Gx =

[Gx1

Gx2

]

= η1

[

q2αr − 1µ

−q2ω

q2ω q2αr − 1µ

]

(4.30)

where η1 and q2 are the observer gains to be tuned. The observer errordynamics is

ddt

φrα = Lhαr isα − αrφrα − pωφrβ +Gx1Isddt

φrβ = Lhαr isβ − αrφrβ + pωφrα +Gx2Is

σLsddt

isα = −Rλisα + µαrφrα + µpωφrβ +Gz1Is

σLsddt

isβ = −Rλisβ + µαrφrβ − µpωφrα +Gz2Is.

(4.31)

Page 42: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

42 Robust induction motor control using 2-SMC

To prove observer convergence, it is first shown that sliding mode will takeplace on the sliding surfaces isα = 0, isβ = 0 using the positive definiteLyapunov candidate function Vi =

12 (i

2sα + i2sα). Its derivative is

Vi = isαisα + isβ˙isβ =1

σLsisα(−Rλisα + µαrφrα + µpωφrβ − η1 sign isα)

+ 1σLs

isβ(−Rλisβ + µαrφrβ − µpωφrα − η1 sign isβ) =

− 1σLs

[|isα|(η1 − fα sign isα) + |isβ|(η1 − fβ sign isβ)]

− Rλ

σLs(i2sα + i2sα)

(4.32)

where fα = µ(αrφrα + pωφrβ) and fβ = µ(αrφrβ − pωφrα). If the condition

η1 > |fα| ∧ η1 > |fβ | (4.33)

is fulfilled, Vi is negative definite and satisfies even the η-reachability cond-tion (which was also used in chapter 2.2, see (2.10)). Finite-time convergenceof isα = 0, isβ = 0 is thus given.

Next, the asymptotic convergence of φrα and φrβ to zero must be proved. Inorder to do so, it is useful to determine a continuous version of Is (denotedIs,eq) which would have the same effect on the system as the actual (discon-tinuous) signal. Such a signal is called the equivalent control, [9, p. 14], and

is obtained by formally setting isα = 0, ˙isα = 0, isβ = 0, ˙isβ = 0 and solvingfor Is in the two lower equations of (4.31). The equivalent control is

Is,eq =

[

− 1η(µαrφrα + µpωφrβ)

− 1η(µαrφrβ − µpωφrα)

]

. (4.34)

Notice that the equivalent control is just at tool to demonstrate convergence;it could not be used as actual input to the observer since it depend onunknown variables. When substituted for Is in the upper two equations of(4.31), the flux error dynamics gets

ddt

φrα = φrαq2(−α2rµ− ω2µp) + φrβq2(ωµαr − αrµpω)ddt

φrβ = φrβq2(−α2rµ− ω2µp) + φrαq2(−ωµαr + αrµpω)(4.35)

where isα = 0, isβ = 0 have been used once more.

The Lyapunov candidate function Vφ =12(φ

2rα + φ2rβ) will be used to prove

that the flux estimation errors converge to zero. Its derivative

Vφ = −q2(φ2rα + φ2rβ)(α

2rµ+ ω2µp) (4.36)

is negative definite for q2 > 0 which proves that flux observation error de-creases asymptotically (not in finite time because the η-reachability condi-tion does not hold for (4.36)).

Page 43: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

4.4 Control design 43

To recapitulate: In order to make the observer converge, η1 must be chosenlarger than the maximal value of a function depending on motor parameters,rotor speed and observer error (condition (4.33)). It is not possible to give anexact value for the maximal observer error (because it depends on unknowninitial conditions), so an alternative approach would be to make a qualifiedguess and verify it through simulation. After successful choice of η1, therate of asymptotic convergence of the flux estimate should be tuned. It isgoverned by q2 > 0.

4.4.7 Differentiator

In the previous section, it has been described how all quantities necessary foran approximative linearizing feedback can be estimated. Even though thelinearization is only approximate, it is expected to ease control significantly.The result of a non-ideal linearization must be compensated for by the slidingmode control feedback. In order to make that work, the sliding variables onthe one hand and their derivatives on the other must be consistent.

The time derivatives of the sliding variables s1, s2 along the trajectories ofthe induction motor equations (4.10) depend algebraically on the torqueload ML and on several of the physical motor parameters of which no exactknowledge is assumed. The explicit expression for the derivative was givenas (4.20). Using the explicit expressions in (4.20) to calculate the derivativeswill lead to inconsistency with the sliding variables in the case of uncertainparameters and unknown ML. The derivatives are thus estimated throughnumerical differentiation which is now described.

Estimation of sliding derivatives through numerical differentiation is treatedin [18] for several mechanical systems. The author is not aware of anypublication using numerical differentiation in connection with sliding modecontrol of an induction motor.

It is known that numerical differentiation is sensitive to noise. It is normallynecessary to low-pass filter (i.e., to limit the bandwidth of) the signal ofinterest. This introduces a phase shift which might not be acceptable. Arecent development in this domain is the contributions of Arie Levant since1998 with his family of robust exact finite-time differentiators based on 2-SMC. The author of this thesis decided to use Levant’s differentiators afterfailure using ordinary backward difference derivative combined with a low-pass filter. In [16], Levant proposed a differentiator with the differentialequations

z0 = −1.5√

L√

|z0 − s| sign |z0 − s|+ z1z1 = −1.1L sign(z0 − s)

(4.37)

where the numbers 1.5 and 1.1 are “suitable factors” determined through

Page 44: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

44 Robust induction motor control using 2-SMC

simulation by Levant and L is a tunable parameter which must satisfy thecondition |s| ≤ L. In the absence of noise, Levant has shown that theestimates are exact after finite time: z0 = s and z1 = s. In the presence ofnoise characterized by the simple inequality |s−s0| ≤ ǫ where s0 is the noise-free signal of interest and s is the actual signal with noise, the estimationerrors are as low as, [16],

|z0 − s0| ≤ µ0ǫ

|z1 − s0| ≤ µ1ǫ12

µ0 > 0, µ1 > 0 (4.38)

where µ0 and µ1 are constants bounded by the properties of the input signals. To demonstrate the effectiveness of the differentiator, simulation exam-ples with two different test signals are shown in figure 4.3 and 4.4. Gaussiandistributed noise has been added for realism. The algorithm is discretizedusing the Euler method and the time step is T = 1× 10−5. The value forL is 50000. The results are compared to linear backward differentiation(x′ ≈ x(t)−x(t−τ)

τ) of the low-pass filtered test signals. The first test signal

is not physical because its second derivative is discontinuous and does thusnot satisfy the condition |s| ≤ L. It is seen that the derivative is nonethelessestimated properly after a short transient of finite duration. The secondtest signal has a continuous second derivative with a maximal value close to−9000 which fulfills |s| ≤ L, which was given as the condition for finite-timeexact differentiation. Indeed, the derivative calculated through Levant’s al-gorithm cannot be visually distinguished from the ideal value. In both cases,the noise level in the derivative is approximately 10 times lower when us-ing Levant’s differentiator than when using linear backward differentiation.Levant’s differentiator thus seems to be a good alternative to linear back-ward differentiation with respect to convergence time and noise level, andsuitable for obtaining a consistent estimate of the derivatives of the slidingvariables.

4.4.8 Discretization and PWM issues

While the induction motor and the load make up an analog (time-continuous)system, the inverters which are normally used to feed the stator windingsare always operated in a sampled on/off mode (the only exception is for verysmall motors with output power in the order of few watts). It is standardpractice to operate the power semiconductors at a fixed frequency (this isdue to various reasons; among them to ease output filter design and to beable to cope with EMC constraints). This switching frequency must be lowenough to keep switching losses acceptable but also high enough to reduceripple and delay. When present, the latter is a challenge for control perfor-mance. In this work, the delay is taken into account because it is one ofthe imperfections which prevent ideal sliding mode to occur. The internal

Page 45: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

4.4 Control design 45

0 0.5 1 1.5 2

−100

0

100

0 0.5 1 1.5 2

−1000

0

1000

0 0.5 1 1.5 2

−1000

0

1000

(a) Test signal plus white Gaussian noise

(b) Num. derivative using low-pass filter and Simulink derivative block

(c) Num. derivative using Levant differentiator

Figure 4.3: Numerical differentiation. Test signal (a) has discontinuous derivative.White Gaussian noise (variance σ2

x = 1) has been added to (a). The exact deriva-tive consists of a sequence of steps from zero to ±100 and ±1000. (b) is the noisyand slowly converging result of low-pass filtering ( 1

0.01s+1) followed by linear dif-

ferentiation using the Simulink block. The output from the Levant differentiator(c) converges faster and has 10 times lower noise level even though convergence fordiscontinuous-derivative signals is not proved for the Levant differentiator.

0 1 2 3 4 5050100150

0 1 2 3 4 5

−500

0

500

0 1 2 3 4 5

−500

0

500

(a) Continuously differentiable test signal plus white gaussian noise

(b) Num. derivative: Low-pass filter and Simulink derivative block

(c) Num. derivative: Levant differentiator

Figure 4.4: Like figure 4.3, but with continuously differentiable test signal (a)with Gaussian noise (variance σ2

x = 1). The exact derivative has additionallybeen plotted in (c), but is not visible due to almost perfect tracking using Levantdifferentiator.

Page 46: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

46 Robust induction motor control using 2-SMC

working of the inverter is not modeled and, for simplicity, it is assumed thatthe inverter can deliver any given voltage (up to the link voltage), hold thisvoltage one sampling period, and apply a new voltage in the next samplingperiod. In reality, due to the on/off mode of operation, this has to be ap-proximated by programming a new duty cycle in each switching period suchthat the average voltage in each period equals the desired voltage, i.e., PulseWidth Modulation (PWM). This simplification is not expected to introduceany significant error; after all, the delay is the same and the averaged voltageis the same no matter which way it is simulated.

Different parts of the control algorithm could operate at different sampletimes. While there is no point in generating output voltages faster thanthe inverter switching frequency, it could be useful to measure outputs andupdate the observer at a faster rate. The author has considered simulatingthe whole control system at a fixed time step equal to the fastest sample timeof all control units. For this to be valid, that sample frequency should alsobe significantly faster than the fastest eigenfrequency of the motor/load-subsystem. In order to achieve a better trade-off between accuracy andcomputational resources, it was instead decided to use the Dormand-Prince-integrator with variable time step as it is implemented in MATLAB Simulink(ode45). It is a combined fourth- and fifth-order integration algorithm whichmeans that the error made in each step is smaller than k1h

4 and k2h5 (h

being the step size and k1, k2 some constants), respectively. The local errorof the fourth-order part is estimated as the difference between the fourth-and fifth-order result and this error is used to adaptively calculate the stepsize in order to keep the local error below a given limit. This approachstill allows some parts of the simulated system to work at a fixed samplingfrequency.

Sliding mode control algorithms are typically defined and described in con-tinuous time in the literature. When used with inverters, as described above,the output of the control algorithm must be discretized by connecting it toa sample and hold block with a time period equal to the switching period.This imperfection will introduce a limit cycle in the vicinity of the idealsliding surface (this will be studied later on, in chapter 5). The dynamicparts of the sliding mode control algorithms (specifically: differentiators andobserver) are calculated using simple Euler integration with fixed step sizeas recommended by Arie Levant in several of his publications, [15], [28],[16]. Levant did not provide an explanation for this. The author has indeedchosen to use Euler integration for the discretization of differentiators andobserver—not because of Levant’s statement but because of the simplicityand because it turned out to be working well. This procedure is used forsimulation, but it would also be suitable to implement in a digital signalprocessor.

Page 47: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

4.5 Initial magnetization 47

4.5 Initial magnetization

In the control design above, a nonzero rotor flux has been assumed, meaningat least one of φrα, φrβ must be nonzero. If the flux is zero, the A matrixof the linearizing feedback becomes singular (not invertible). Likewise, therelative degree of the system with respect to the sliding variables wouldincrease from two to three, which would violate the convergence conditionsof the sliding control algorithm.

Since the controller is keeping the flux constant and nonzero during oper-ation, the case of zero flux only has to be considered for the start-up ofa demagnetized motor. The motor could be magnetized initially using anopen-loop controller. After a short start-up time, the control algorithm de-signed here could take over. This has not been considered further within thescope of this work. Rather, nonzero initial values of the rotor flux variablesare assumed.

4.6 Construction of simulation model

The described motor model as well as the composite 2-SMC+PD controller,the sliding mode observer and the Levant differentiator have been imple-mented as MATLAB Simulink model blocks and connected graphically in aSimulink model file. The model files are found in appendix A.

The blocks were initially written as MATLAB “Level 1 M s-functions” inMATLAB’s “M” scripting language but they were found to be too slow. Inorder reduce simulation time, they were rewritten as MATLAB “Level 2 Cs-functions” in the C programming language. They must be compiled forthe computer platform on which they are to run. In the process, they getoptimized to use the specific architecture and processor features available(in this case, a Intel Pentium Dualcore 1.80GHz running Windows XP). TheMEX compiler which is bundled with MATLAB was used. The increase inspeed was noticeable.

The motor model was written with “continuous” sample time. Notice thezero-order hold and the rate transition blocks in the model on page 71. Theyensure that the voltages controlling the motor get updated just once every“inverter switching period”, as was described in section 4.4.8. The torqueload is by nature not sampled so it is applied without delay.

The observer is supposed to operate in a digital signal processor, so it isimplemented with fixed sample time, just like the differentiators are. Whilethe advanced Dormand-Prince integrator is used by Simulink for the blocks

Page 48: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

48 Robust induction motor control using 2-SMC

with “continuous” sample time, the much simpler Euler integration algo-rithm has been built into the observer and differentiator blocks. While theEuler algorithm certainly is less accurate, it is easier to implement in adigital signal processor.

The source code is available in appendix A for the most important blocks.The rest of the code and the files describing the particular configuration ofeach simulation setup, can be found on the included CD-ROM.

Page 49: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Chapter 5

Design example and

simulation

The controller which has been presented in the previous chapter is nowtested by simulation. First, a control task is defined and a suitable motoris chosen. Then, the controller and observer gains are determined using anapproach developed by the author. The behavior of the control system isanalyzed.

5.1 Choice of conditions

5.1.1 Control task definition and motor parameters

The control task is defined in figure 5.1. The desired trajectory of the shaftangular speed (left side of the figure) is available to the controller togetherwith the first and second derivatives which are continuous. The load torquein the right of the figure is applied on the motor shaft. It has a continuousderivative. The load torque is not available to the control algorithm, butthe control design has been carried out under the assumption that the loadtorque has a bounded continuous derivative.

These trajectories were designed to test different operation regimes of themotor. They have been chosen inspired by the induction motor benchmarkin [5] and they do not correspond to a real world problem. Tested regimesare: Zero speed with no load (t < 0.5 s) and varying load (t > 4.5 s); fullrated speed with no load (t ≈ 3 s), half rated load and full rated load;and strong negative acceleration (t ≈ 4 s). Although no frequency responseanalysis is carried out, the successful tracking of a steep reference trajectory

Page 50: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

50 Design example and simulation

0 2 4 6 8 10−100

0

100

200

ωref(s−1)

0 2 4 6 8 10−5

0

5

10

15

ML(Nm)

0 2 4 6 8 10−1

−0.5

0

0.5

ωref(ks−

2)

0 2 4 6 8 10

−0.1

0

0.1

ML(kNms−

1)

Time t (s)

0 2 4 6 8 10−10

−5

0

5

Time t (s)

ωref(ks−

3)

Figure 5.1: Speed (right) and load torque (left) references. Notice the units.

Stator resistance Rs = 1.633ΩRotor resistance Rr = 0.93ΩStator inductance Ls = 0.142HRotor inductance Lr = 0.076HMutual inductance Lh = 0.099HNumber of pole pairs p = 2Rotor moment of inertia J = 0.029 kgm2

DC link voltage 450VMax. load torque ±7NmMax. speed 1430 rpmNom. stator flux magnitude φ0 = 0.59V sMax. power 1500W

Table 5.1: Leroy Somer A3L induction motor parameters (all referenced to statorside) and ratings. Sources: [27], [5].

Page 51: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

5.2 Controller parameter tuning 51

in presence of steep load variation is an indicator of high controller band-width. It was described in section 4.2 how the trajectories are generated forsimulation purposes.

The motor with the parameters given in table 5.1 is selected for simulation.Its rated speed and its rated load are tested to the limit with the abovedescribed control task.

The switching frequency of the power semiconductors is initially fixed at thevalue f = 20 kHz which is a normal value for output powers in the order of1 kW. When specific hardware is chosen to carry out a real experiment, theswitching frequency as well as all other physical parameters and conditionsshould be adjusted.

5.1.2 Simulation conditions

Simulink version 7.0 in MATLAB 2007b is used for simulation with thevariable step solver Dormand-Prince (ode45). The relative tolerance is setto 1× 10−6. This means that an integration step will be repeated with asmaller step size until the estimated error in this step is smaller than 0.0001%compared to the current state variable. Note that the errors might sum upand the absolute error after several steps can be more significant. To ascer-tain that the simulator is providing reliable results, some of the simulationshave been tested with deviating tolerance settings. Small changes in thesesettings should not change the character of the results.

5.2 Controller parameter tuning

In the following, it is shown how the controller parameters are determinedfor this motor. As mentioned in chapter 3, the convergence conditions forthe 2-SMC algorithms are not very useful for design because they are tooconservative. The same is the case for the Levant differentiators because itis not easy to know the bandwidth of the sliding variables s1 and s2 whichare to differentiated. No solution to this problem can be found in the slidingmode literature currently.

As part of this work, the author has developed an iterative approach to finda working set of parameters. It is based on four stages which will be referredto through the rest of this chapter.

The principle is to start off letting the controller know all relevant param-eters and variables exactly in stage 1. Then, step-by-step, exact knowledgeis replaced by estimates while analyzing changes in closed-loop behavior

Page 52: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

52 Design example and simulation

Stage 1 & 2 3 4

Linearizing feedbackMotor parameters exact exact exact

Load torque derivative exact ML ≡ 0 ML ≡ 0Ref. trajectories exact exact exactMotor ω, isα, isβ exact exact exactMotor φrα, φrβ exact observed observed

Sliding vars s1, s2Ref. trajectories exact exact exactMotor ω exact exact exactMotor φrα, φrβ exact exact observed

Sliding derivatives s1, s2 differentiatedMotor parameters exact exact n/aLoad torque exact exact n/aRef. trajectories exact exact n/aMotor ω, isα, isβ exact exact n/aMotor φrα, φrβ exact exact n/a

Table 5.2: How information is made available to the controller in the four controlstages.

carefully. In stage 4, the controller is only using information realisticallyavailable.

The idea behind each stage is now presented. In stage 1, the 6 parametersof the 2-SMC and PD controllers are determined. Perfect knowledge of allmotor parameters, states and of load torque derivative ML is assumed sofar.

The control algorithm requires the availability of

• the time-varying matrices realizing the feedback linearization (A11,A12, A21, A22, D1 and D2) which depend on all motor parameters andall states, load torque derivative ML and reference trajectories,

• the sliding variables s1, s2 which are only depending on motor statesand reference trajectories, and

• the derivatives of the sliding variables s1, s2 which can be calculatedalgebraically only knowing motor the parameters and the states, theload torque derivative and reference trajectories.

In stage 1, information which is not realistically available is demanded (e.g.,directly measured flux values and ML). The purpose of the stages 2–4 isto find proper parameters for the observer and for the two differentiators.The proposition is that the controller will work with observer and differ-

Page 53: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

5.2 Controller parameter tuning 53

LFB IM SMO

s1

s1

s2

s2

Twist. 1

Lin. 1

Twist. 2

Lin. 2

ω

v1v2

φrα, φrβ , isα, isβ

φrα, φrβ

φrα, φrβ , isα, isβ

ω, isα, isβ

usα,usβusα

usβ

ωref

ML, ωref

φref

ω, φrα, φrβ, isα, isβ

MLωref ML

4

4

2

5

2

3

Figure 5.2: Simplified block diagram of stage 1 (determine controller gains)and stage 2 (determine observer gains). IM=Induction Motor, LFB=LinearizingFeedback, SMO=Sliding Mode Observer, Twist.=Twisting algorithm, Lin.=LinearFeedback

Page 54: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

54 Design example and simulation

LFB IM SMO

s1

s1

s2

s2

Twist. 1

Lin. 1

Twist. 2

Lin. 2

ω

v1v2

φrα, φrβ , isα, isβ

φrα, φrβ

φrα, φrβ , isα, isβ

ω, isα, isβ

usα,usβusα

usβ

ωref

ML, ωref

φref

ω, isα, isβ

0 ωref ML

φrα, φrβ

4

4

2

32

2

3

Figure 5.3: Simplified block diagram of stage 3 (test with realistic linearizing feed-back). Compare to figure 5.2; the actual flux values and load torque derivativeare no longer available to the LFB. Observed values are used instead and the loadtorque derivative ML is assumed zero (good approximation for slowly varying load).

LFB IM SMO

s1

s2

Twist. 1

Lin. 1

Twist. 2

Lin. 2

ω

v1v2

φrα, φrβ

ω, isα, isβ

usα,usβusα

usβ

ωref

φref

ω, isα, isβ

0 ωref ML

φrα, φrβ

2

32

2

3

SMD

SMDs1

s2

Figure 5.4: Simplified block diagram of stage 4 (determine differentiator gains).The sliding derivatives are estimated by means of Levant Sliding Mode Differentia-tors (SMD) to ensure consistency between the sliding variables and their derivatives.

Page 55: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

5.2 Controller parameter tuning 55

entiator estimates as well, such that only measured signals are used. Therealistic configuration corresponds to stage 4. No proof is provided. Theseparation theorem1 from linear control theory can generally not be appliedon nonlinear systems.

The stages are

1. Determine controller gains (block diagram 5.2): Vm,1, Vm,2, VM,1, VM,2

as well as k1 and k2. Perfect knowledge of all parameters and statesis assumed.

2. Determine observer gains (block diagram as above): η1, q2. The ob-server is not yet in the loop, but it is acquiring input from the closed-loop system which dynamics already should be final.

3. Test with realistic linearizing feedback (block diagram 5.3). Use ob-server flux estimates and the approximation ML = 0 in the feedback.Is the system dynamics basically unchanged?

4. Determine differentiator gains L1, L2 with observer and differentiatorin loop (block diagram 5.4). The differentiators are now used for esti-mation of the sliding derivatives. Only actually measured signals arenow used by the controller. Is the system dynamics still acceptable?

Refer to the block diagrams and the table 5.2 to see how signals are routedin each stage.

Note: The set of controller parameters and system initial conditions givenin table 5.3 will be used for all simulations when nothing else is stated. Thevalues are used as reference values and are the final values found. In thefollowing it is described how they were found.

5.2.1 Stage 1

The purpose of stage 1 is to find suitable controller gains for the twistingalgorithm Vm,1, Vm,2, VM,1, VM,2 as well as k1 and k2 for the additionallinear feedback. First, linear feedback gains are found without using SMCfeedback at all. Different values for k1, k2 are tested by simulation and k1 =60, k2 = 60 are found to provide a reasonable small error (after the initialtransient, the speed error is less than 0.2 s−1). See figure 5.5(a). Notice thesteady-state error. It is initially surprising that there is a steady-state error:The linearizing feedback is exact in stage 1 so there should be no work to dofor the feedback controller after the settling of the initial conditions. The

1In linear control systems, the separation theorem allows to conclude that the total ob-server+controller system is stable if the controller and observers are stable independently.There exists no generalization of the separation theorem for nonlinear systems.

Page 56: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

56 Design example and simulation

InverterSwitching period Tinv = 50× 10−6 sMotor initial conditionsAngular speed ω(0) = 15 s−1

Rotor flux φrα(0) = 0.9φ0/√2

φrβ(0) = 0.9φ0/√2

Stator current isα(0) = 0isβ(0) = 0

Observer initial conditions

Rotor flux φrα(0) = 2.0φ0/√2

φrβ(0) = 0.5φ0/√2

Stator current isα(0) = 0

isβ(0) = 0ControllerLinear feedback k1 = 60

k2 = 60Twisting 2-SMC VM,1 = 10000

Vm,1 = 2000VM,2 = 20000Vm,2 = 5000

Observerη1 = 10q2 = 0.02

Sample time Tobs = TinvDifferentiator for s1Initial z0 z0(0) = ω0Initial z1 z1(0) = 0Gain L1 = 50000Sample time Tdiff,1 = Tinv/5

Differentiator for s2Initial z0 z0(0) = 0Initial z1 z1(0) = 0Gain L2 = 500000Sample time Tdiff,2 = Tinv/5

Table 5.3: Parameters used for simulation when nothing else is stated.

Page 57: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

5.2 Controller parameter tuning 57

0 2 4 6 8 10−2

−1

0

1

2

0 2 4 6 8 10

0

2

4

6

8

x 0.1 x 0.01

Speederror

s 1(s−

1)

Fluxerror

s 2(V

2s2)

Time t (s)Time t (s)

(a) Stage 1 with PD controller only. The PD controller inherently exhibit asteady-state error, as seen in the plot. Speed error lower than 0.2 s−1.

0 2 4 6 8 10−4

−2

0

2

4x 10

−4

0 2 4 6 8 10−2

−1

0

1

2x 10

−4

Speederror

s 1(s−

1)

Fluxerror

s 2(V

2s2)

Time t (s)Time t (s)

(b) Stage 1 with 2-SMC+PD controller. The addition of a discontinuous feedbackhad the same effect as very high gain. As seen from the plot, the error after theinitial transient is lower than 0.4× 10−4 s−1 .

0 2 4 6 8 10−4

−2

0

2

4

x 10−4

0 2 4 6 8 10−2

−1

0

1

2x 10

−4

Speederror

s 1(s−

1)

Fluxerror

s 2(V

2s2)

Time t (s)Time t (s)

(c) Stage 3. Same 2-SMC+PD controller, but with “realistic” linearizing feedback.Except for two spikes at 2.5 s and 3.5 s (coincident with large values of ML), theerror did not increase more than 50%.

0 2 4 6 8 10

−8

−4

0

4

8

x 10−3

0 2 4 6 8 10−2

−1

0

1

2x 0.01

Speederror

s 1(s−

1)

Fluxerror

s 2(V

2s2)

Time t (s)Time t (s)

(d) Stage 4. Same 2-SMC+PD controller. Only “realistically” available informa-tion. The speed error is lower than 0.008 s−1 except at 2.5 s.

Figure 5.5: Speed error (s1) and squared flux error (s2) for different controllers.Parameters in table 5.3.

Page 58: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

58 Design example and simulation

0 10 20−400

−300

−200

−100

0

100

0 0.01 0.02−1

−0.5

0

−0.1 0 0.1

−10

0

10

20

−4 −2 0

x 10−4

0

0.005

0.01

0.015

0.00s to 0.30s

0.15s to 0.30s

s1

s1

s 1s 1

0.000s to 0.300s

0.150s to 0.300s

s2

s2

s 2s 2

(a) PD controller only (Vm,1 = Vm,2 = VM,1 = VM,2 = 0).

0 10 20−400

−300

−200

−100

0

100

−5 0 5

x 10−3

−5

0

5

−0.1 0 0.1

−10

0

10

20

−5 0 5 10

x 10−4

−4

−2

0

2

4

0.00s to 0.15s

0.09s to 0.15s

s1

s1

s 1

s 1

0.000s to 0.150s

0.011s to 0.150s

s2

s2

s 2s 2

(b) 2-SMC+PD feedback.

Figure 5.6: Stage 1. Phase plane plot of the sliding variables in the initial reachingphase (notice time interval) for two different controller configurations.

Page 59: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

5.2 Controller parameter tuning 59

answer lies in the discretization; the feedforward linearization is sampledand then held for an inverter clock cycle and nothing special has been doneto correct for the error which arises due to the delay2. For a phase planeplot of the initial reaching phase, see figure 5.6(a).

Next, the 2-SMC feedback will be designed. It is expected to keep theconstraints s1 = 0, s2 = 0 with no steady-state error because of its high gaincharacter. It is also expected that convergence takes place in finite time.

The sliding gains Vm,1, Vm,2, VM,1, VM,2 are found heuristically, starting withsmall values and increasing until sliding mode is realized. It is clear whenthis happens; the error drop to a very small value and stays there. Onlygains satisfying VM > 3Vm are considered—a necessary condition which canbe derived from the conditions for finite-time convergence of the twistingalgorithm (3.6) for the present case of unity input gain, Γm = ΓM = 1(see (4.17)). The simulation results with ks unchanged and Vm,1 = 2000,VM,1 = 10000, Vm,2 = 5000, VM,2 = 20000 are seen in figure 5.5(b) and5.6(b). Compare with the previous results without SMC feedback. Thechange is clear; convergence to the sliding surfaces now takes place in finitetime and the error shrunk by three orders of magnitude. The error is nowdominated by high-frequency oscillations (chattering). Notice the similarityof the upper left of the phase plane plots 5.6(a) and (b): When far awayfrom the sliding surface, the linear control determines system behavior ratherthan the discontinuous feedback, as it is expected.

5.2.2 Stage 2

The goal of stage 2 is to determine the observer gains, η1 and q2. It is doneusing the same configuration as for stage 1 (refer to the block diagram 5.2).The estimated states are not used in the feedback yet. Rather, the “unre-alistic” availability of actual motor states is used like above. The reason isthat a poor observer configuration would lead to poor flux estimation whichagain would degrade the closed-loop performance or lead to instability. Insuch a case, it would be hard to conclude anything else than it does notwork. When choosing to leave the closed-loop performance intact (by notusing the observer estimates), it gets easier to interpret the results.

The gains η1 and q2 cannot be chosen independently of each other. Aninitial value for η1 can be estimated using (4.33). For example, it can beassumed that the motor is standing or running slowly at startup (e.g., ω <15 rad s−1) and that the flux error is limited to 10% of the nominal flux,i.e., φrα < 0.05V s. Inserting these quantities together with the motor

2To verify this, a simulation with inverter period one order of magnitude smaller(Tinv/10) was run. It resulted in much smaller errors.

Page 60: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

60 Design example and simulation

parameters in (4.33) gives a minimum value η1 = 2.4 to assure attractivityof the observer sliding surface. To give some room for parameters errors,an initial value of η1 = 5.0 is chosen. q2 must be chosen larger than zeroand large enough to ascertain fast convergence of the observer flux errorto zero. The treatment on observer design in section 4.4.6 did not providean inequality or another means to judge the magnitude of this constant inadvance, however. It is thus found by repeated simulation. This searchproblem is of acceptable complexity—since an initial value of η1 is known,the search is only one-dimsensional.

The observer errors are shown for three of the tested sets of gains in figure5.7. To interpret the magnitude of the error, refer to the actual motor statesin the top of the figure. The lower plots of figure 5.7 show the current errors(right) and the flux errors (left). The gains are shown in the figure captionsand are increasing gradually, from top to bottom. Of the three sets ofobserver gains, the first one with the lowest gains provides the best estimates.The last one with the highest gains provide a faster initial convergence at thecost of an higher ripple. The middle set has been chosen as a compromise,i.e. η1 = 10, q2 = 0.02.

5.2.3 Stage 3

In the transition from stage 2 to stage 3 the perfect feedback linearization islost. The goal of stage 3 is to analyze the degradation in control performancewhen the linearization feedback is based on observed flux values and theapproximation ML = 0 instead of perfect information availability. Comparethe resulting speed and flux errors in figure 5.5(c) with the errors in theprevious stage, figure 5.5(b). When the initial transient and two spikes at2.5 s and 3.5 s are ignored, the speed error increased roughly by 50% andthe flux error remained within same limits. These errors are still very low,i.e., less than 4.5× 10−4 s−1 and 1× 10−4V2 s2, respectively. The spikes arecoincident with the instants of maximal ML at 2.5 s and 3.5 s (see figure 5.1).They have the magnitudes 1.2× 10−2 s−1 and 1.4× 10−3 s−1, respectively.Since ML has been approximated to zero, it is not surprising that these arecritical points. The discontinuous feedback did not have authority enoughto keep the system in sliding mode at these two point. It did not lead toinstability though, and the error is low even including the spikes.

5.2.4 Stage 4

The goal of stage 4 is to configure the robust sliding mode differentiators toestimate the derivatives of the sliding variables s1 and s2 and test them in theloop. Differentiators are necessary because these derivatives can otherwise

Page 61: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

5.2 Controller parameter tuning 61

0 2 4 6 8 10−1

−0.5

0

0.5

1

Actual flux

0 2 4 6 8 10

−10

−5

0

5

10

Actual current

φα(Vs)

i α(A)

Time t (s)Time t (s)

(a) Stage 2. Actual motor flux and current variables φrα and isα (the β-componentsare left out because they basically look the same).

0 2 4 6 8 10−0.01

−0.005

0

0.005

0.01

Observer error, flux

0 2 4 6 8 10−0.05

−0.025

0

0.025

0.05

Observer error, current

φα−

φα(Vs)

i α−

i α(A)

Time t (s)Time t (s)

(b) Stage 2. Observer errors with observer gains η1 = 5.0, q2 = 0.01. Maximal fluxerror lower than 0.006V s.

0 2 4 6 8 10−0.01

−0.005

0

0.005

0.01

Observer error, flux

0 2 4 6 8 10−0.05

−0.025

0

0.025

0.05

Observer error, current

φα−

φα(Vs)

i α−

i α(A)

Time t (s)Time t (s)

(c) Stage 2. Observer errors with observer gains η1 = 10.0, q2 = 0.02 (like in table5.3). Maximal flux error lower than 0.008V s.

0 2 4 6 8 10−0.025

−0.013

0

0.013

0.025

Observer error, flux

0 2 4 6 8 10−0.125

−0.063

0

0.063

0.125

Observer error, current

φα−

φα(Vs)

i α−

i α(A)

Time t (s)Time t (s)

(d) Stage 2. Observer errors with observer gains η1 = 20.0, q2 = 0.04. Maximalflux error lower than 0.015V s.

Figure 5.7: Stage 2. Three sets of gains are tested to tune the sliding mode observer.Of the three, (b) is finally selected because that observer is more accurate than (c),but probably less robust than (a).

Page 62: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

62 Design example and simulation

only be calculated using a algebraic expressions involving the unknown loadtorque and uncertain motor parameters.

When the differentiators are put into operation, the controller is exclusivelyfed with realistically available information (the focus point in stage 4 is thesliding variables and their derivatives). The gains are chosen heuristicallysuch that the degradation in closed-loop performance is kept at a minimumin the transition from stage 3 to 4. Notice that too low gains will result in tooslowly following estimates and will ruin the working of the 2-SMC algorithm.Too high gains will result in estimates with exaggerative chattering whichwill likewise ruin the performance of the controller. The interval of gainsresulting in a working control system was found to be wide, however, andto span approximately one to two orders of magnitude.

It was found that the differentiators work better at a higher update rate.It was thus decided to increase their (and their only) update rate to be fivetimes faster the semiconductor switching frequency. The best compromisefor the gains was found to be L1 = 50000, L2 = 500000. The resulting errorsare seen in figure 5.5(d). In the transition from stage 3 to 4, the speed errorincreased by one order of magnitude and the flux error by two orders ofmagnitude. The spike at 2.5 s did not change in magnitude, however, and isstill at 1.2× 10−2 s−1.

5.2.5 Result of stage 1–4

So far, the controller have had perfect knowledge of motor parameters,but not of the applied load torque. A final speed error not larger than1.2× 10−2 s−1 corresponding to 0.01% of the rated speed was achieved. Thisis a good result so far. Since the controller structure has been made withthe possibility of unknown parameter variations in mind, it is expected thatthe performance will not degrade too much if e.g. the rotor resistance isincreased. This case will be analyzed next.

5.2.6 Robustness analysis

The rotor resistance was increased by 75% compared to the nominal valueknown by the controller and observer. By simulation with the parametersfound above (see table 5.3), the control system still turned out to be stable.An increase of the differentiator gains to L1 = 500000, L2 = 500000 ledto better results: The speed error and flux error are plotted in figure 5.8together with a phase plane view of the initial reaching phase. Comparedto the ideal situation in stage 1 (see figure 5.6(b)), the reaching of a “small”region about the origin is not very smooth anymore and it is more clearly

Page 63: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

5.2 Controller parameter tuning 63

seen that the system moves around in a limit cycle close to the origin ratherthan converging strictly to it.

The observer performance is seriously degraded due to the increase in rotorresistance. The error grew significantly especially in the low-speed regime(t > 4 s). Due to poorly estimated rotor flux in this region, the closed-loopperformance is degraded. This has led to larger speed errors.

Page 64: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

64 Design example and simulation

0 2 4 6 8 10−0.2

−0.1

0

0.1

0.2

0 2 4 6 8 10−0.02

−0.01

0

0.01

0.02

Speederror

s 1(s−

1)

Fluxerror

s 2(V

2s2)

Time t (s)Time t (s)

(a) Speed and flux errors. The speed error is lower than 0.1 s−1 except in thelow-speed regime after t = 4 s where it is twice as large.

−10 0 10 20−3000

−2000

−1000

0

1000

2000

−0.1 0 0.1−100

−50

0

50

100

−0.5 0 0.5−200

0

200

400

−0.1 0 0.1−100

−50

0

50

0.00s to 0.17s

0.14s to 0.25s

s1

s1

s 1s 1

0.000s to 0.150s

0.003s to 0.150s

s2

s2

s 2s 2

(b) Phase plane plot of the initial reaching phase. In the disturbed case, theconvergence look less like that of the twisting algorithm (compare with figure 5.6).

0 2 4 6 8 10−0.2

−0.1

0

0.1

0.2

Observer error, flux

0 2 4 6 8 10−0.3

−0.15

0

0.15

0.3

Observer error, current

φα−

φα(Vs)

i α−

i α(A)

Time t (s)Time t (s)

(c) Observer errors. They are large especially in the low-speed regime after t = 4 s.

Figure 5.8: Stage 4, rotor resistance +75%, L1 = 500000.

Page 65: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Chapter 6

Conclusions

In this work, a second-order sliding mode controller has been designed foran induction motor. The control problem was to track a reference trajectoryfor the shaft speed—and to do so even in the presence of significant unknownparameter variations and motor load transients. A complete solution to thisproblem using second-order sliding mode control has not been publishedbefore. The only existing paper suggesting a solution was not explicit in howcertain critical signals were made available to the controller. The purposeof this work was to find out if a discontinuous feedback in the form of asecond-order sliding mode controller is suitable to solve the given controlproblem. In particular, it is of interest if the well-known chattering problemof first-order sliding mode control is a problem for second-order sliding modecontrollers as well. An “ultimate” solution of the control problem would bea major contribution to the industry where induction motors are common.

A simulation model for the control system including motor, controller, andobserver has been built up according to the theoretical considerations inchapter 4. The used simulation system was MATLAB Simulink 7.0 and thecritical parts were written in the C programming language to allow for fastersimulation.

The theoretical considerations did not lead to usable rules for tuning of thecontroller parameters. Indeed, very little attention has been given to thechoice of parameters in sliding mode algorithms by the sliding mode researchcommunity. The only existing convergence conditions are too conservative.An iterative approach for determining proper gains has been developed aspart of this work and was presented in chapter 5.

The work has lead to the following conclusions:

• The high gain characteristic of sliding mode control makes it possibleto achieve closed-loop properties which are not achievable with any

Page 66: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

66 Conclusions

continuous controller: 1) Reduction of the output error to zero in finitetime and 2) total rejection (at least theoretically) of a broad class ofdisturbances. The latter is achieved through immediate response to aninfinitesimally small error with a finite control signal. A demonstrationin the form of a comparison was provided: In figure 5.5(a) and (b) onpage 57, a linear feedback controller was compared to a second-ordersliding controller. The high gain characteristic of the discontinuousfeedback was obvious, i.e., the error reached a region around zero infinite time and stayed there.

• The first-order sliding mode observer has been shown to converge inthe nominal case (exact knowledge of motor parameters) even in thepresence of unknown load transients. The convergence of the observerwas examined in section 5.2.2, see figure 5.7 on page 61. It has beenused in the control loop successfully—at least in the nominal case. Itremains to be determined what kind of observer error will be intro-duced in the case of unknown parameter variations.

• The robust finite-time sliding mode differentiators introduced by Lev-ant have been used in the control design. They were shown to besuperior to linear differentiators both with respect to noise and to de-lay. See the comparison in figure 4.3 and 4.4 on the pages 45 and 45,respectively. These differentiators are a valuable tool for deployingsliding mode controllers with an order higher one.

• The control system has been simulated under conditions taking thelimited inverter frequency and the absence of flux and load torquemeasurements into account. The signals required by the controllerwere estimated using the mentioned observer and differentiators. Un-der these conditions, the system is stable and features a very smallmaximal error (see figure 5.5(d) on page 57). Chattering, i.e., highfrequency oscillations in the outputs, is present. It remains to be de-termined if these oscillations can excite unmodeled eigenmodes of themotor and its mechanical load and cause damage. This can only bedone by a more accurate model or by experiment.

• A robustness test of the control system has been performed. The ro-tor resistance was increased by 75% compared to the nominal valueknown by the controller. Such an increase corresponds to a significanttemperature rise of the rotor. The controller was still able to stabilizethe error in presence of this disturbance. Following an adjustment ofthe controller parameters, the maximal speed error was found to beof small magnitude (less than 0.15% compared to the motor’s ratedspeed). See figure 5.8 on page 64. Due to the parameter disturbance,the flux observer was not anymore able to provide an satisfactory esti-mate. The convergence was especially bad at low rotor speeds, which

Page 67: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

6.1 Future work 67

leads to higher speed errors.

6.1 Future work

While the work has demonstrated that second-order sliding mode controlhas potential for implementation of robust controllers, several issues remainto be investigated:

• Stability: It has not been possible to prove the stability of the wholesystem. Before the controller safely can be used in critical areas, atheoretical proof of stability is a must.

• Improvement of observer. A new class of second-order sliding modeobservers known as step-by-step observers in the literature promisesfinite-time convergence of all observer states. If they are implement-able on the present system, the flux estimation and thus overall controlperformance could be improved.

• Optimal parameters: While the approach for determination of con-troller parameters has been shown to work, there is no guarantee thatthe found set of parameters is “optimal”. More work must be done inorder to find the best compromise between robustness and chattering.

• Operation in all regimes. The designed controller only works whenthe rotor flux is nonzero. The controller is thus unable to start up ademagnetized machine. It has been proposed to magnetize the motorinitially using an open-loop controller, but it remains to provide asolution for this, e.g., how and when to make the changeover.

• Variable flux: For simplicity, it was chosen to operate the motor with aconstant rotor flux magnitude. This is a restriction for optimization ofenergy consumption. No structural change in the control system wouldbe necessary to implement this, except for the addition of 1) a flux-computing algorithm and 2) additional terms to the sliding variablesto accommodate for nonzero flux derivatives.

• Experiment: It is of great importance to test whether the chatteringwill excite unmodeled eigenmodes of the motor and of the mechan-ical system. Since even detailed simulation models normally do nottake high-frequency “parasitic” eigenmodes into account, the effect ofchattering can only be evaluated experimentally.

• Test of another second-order sliding algorithm than the used twist-ing algorithm: The so-called sub-optimal algorithm has an additionalparameter for adjustment of the maximal derivative of the sliding vari-

Page 68: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

68 Conclusions

able during the reaching phase. A comparison of the two algorithmscould lead to new insight.

• Use of a third-order sliding mode controller: This would allow for acontinuous control signal while leaving the control task specificationunchanged. This might be an aid in reducing chattering due to un-modeled system dynamics.

Page 69: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Appendices

Page 70: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils
Page 71: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Appendix A

Simulink model

The graphical part of the MATLAB Simulink model is shown below. This isthe model used in chapter 5 for tuning and analysis of the designed controlsystem. It is thus the Simulink realization of stage 1–4 in figure 5.2, 5.3 and5.4. To eliminate redundancy, all four stages are simulated using just onemodel. The difference between the stages is the signal flow. It is controlledusing four sets of switches in the controller submodel (next page). Beforestarting a simulation, the switches must be set according to the actual stage,the blocks coded in C must be recompiled with the actual set of parametersand the parameters for the graphical Simulink blocks must be loaded usinga M-file script.

Zero-Order

Hold

Trajgen

wd

wd'

wd''

voltout

obsout

statesout

slidingvarsout

observer

motorRate Transition

Loadgen

ML

ML'

Controller

x1

x2

x3

x4

x5

ML

ML'

wd

wd'

wd''

x2est

x3est

ualp

ubeta

Out3

Out4

Out5

Out6

Main model

Page 72: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

72 Simulink model

don't touch (UP)

switches for lin fb

don't touch

(DOWN)

SW1

SW2

Stage 1&2 3 4

SW1 U D D

SW2 U D D

SW3 U U D

SW4 U U D

SW4

SW3

Out6

6

Out5

5

Out4

4

Out3

3

ubeta

2

ualp

1

obs s1 s2

ML unavail

algs1s2

estexactdiffs

checkdiffers

exact s11 s21

algs11s21

slidingdiffs

S-Function3

difffirstorder

S-Function2

difffirstorder

S-Function

controller

-

algs1s2

x3est

12

x2est

11

wd''

10wd'

9wd

8ML'

7ML

6x5

5x4

4

x3

3

x2

2x1

1

Controller submodel

wd''

3 wd'

2wd

1

To Workspace2

wdwddotwdddot

State-Space

x' = Ax+Bu

y = Cx+Du

Signal Builder1

Signal 1

Gain1

refscale

Speed reference generator submodel

2

ML'

1

ML

MLMLdot

To Workspace2

x' = Ax+Bu y = Cx+Du

State-Space

loadgenerator

S-Function2

loadscale

Gain1

Simulink model - load disturbance submodel

Page 73: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

A.1 Source code for compiled blocks 73

A.1 Source code for compiled blocks

The source code for the four most important compiled blocks, and two fileswith parameter definitions, are included below:

1. motor.c (on this page): The continuous implementation of the induc-tion motor state space model. (4.10)

2. controller.c (on page 75): The control law implementation includ-ing linearizing feedback and twisting algorithm.

3. observer.c (on page 77): The sliding mode observer (4.27) imple-mented using fixed time step Euler integration.

4. difffirstorder.c (on page 79): The Levant differantiator (4.37) im-plemented using fixed time step Euler integration.

5. myconf.h (on page 80): An excerpt of the C header file with motorand controller parameters, used by all blocks above. The full file (notincluded here) has a section for each set of parameters (PARMSET 0–22)and only one section is used at a time.

6. parmset0.m (on page 80): The remaining parameters in a MATLABM-file. This is just PARMSET 0. A separate file has been made for eachset of control system parameters.

The files written in C conform to the standards of “MATLAB SimulinkLevel-2 C MEX S-Functions”. The MEX compiler included in MATLAB isused.

Listing A.1: motor.c1 #define S FUNCTION NAME motor2 #define S FUNCTION LEVEL 234 #include <math . h>

5 #include ” s imstruc . h”6 #include ”myconf . h”78 /∗ Funct ion : m d l I n i t i a l i z e S i z e s ===============================================9 ∗ I n i t i a l i z a t i o n . Se t number o f inpu t s , ou tpu t s , s t a t e s , e t c

10 ∗/11 stat ic void md l I n i t i a l i z e S i z e s ( SimStruct ∗S)12 13 int i ;1415 ssSetNumSFcnParams (S , 5 ) ; /∗ Number o f e x p e c t e d parameters ∗/1617 i f ( ssGetNumSFcnParams(S) != ssGetSFcnParamsCount (S ) ) 18 /∗ Return i f number o f e x p e c t e d != number o f a c t u a l parameters ∗/19 s sSe tEr ro rS ta tus (S , ”ssGetNumSFcnParams(S) != ssGetSFcnParamsCount (S) ” ) ;20 return ;21 2223 ssSetNumContStates (S , 5 ) ;24 ssSetNumDiscStates (S , 0 ) ;2526 i f ( ! ssSetNumInputPorts (S , 3 ) ) return ;27 for ( i =0; i <3; i++)28 29 ssSetInputPortWidth (S , i , 1 ) ;30 // No inpu t po r t has d i r e c t f e e d t h r ou g h to ou tpu t :31 ssSetInputPortDirectFeedThrough (S , i , 0 ) ;

Page 74: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

74 Simulink model

32 3334 i f ( ! ssSetNumOutputPorts (S , 5 ) ) return ;35 for ( i =0; i <5; i++)36 37 ssSetOutputPortWidth (S , i , 1 ) ;38 3940 ssSetNumSampleTimes (S , 1 ) ;41 4243 /∗ Funct ion : md l I n i t i a l i z eSamp l eT ime s =========================================44 ∗ Set sample t ime to CONTINUOUS45 ∗/46 stat ic void mdlIn i t ia l i zeSampleTimes ( SimStruct ∗S)47 48 ssSetSampleTime (S , 0 , CONTINUOUS SAMPLE TIME) ;49 ssSetOf f setTime (S , 0 , 0 . 0 ) ;50 ssSetModelReferenceSampleTimeDefault Inher i tance (S ) ;51 5253 #define MDL INITIALIZE CONDITIONS /∗ Change to #undef to remove f un c t i o n ∗/54 /∗ Funct ion : m d l I n i t i a l i z e C o n d i t i o n s ========================================55 ∗ Set t h e i n i t i a l v a l u e o f t h e s t a t e v a r i a b l e s acco rd ing to d i a l o g parms56 ∗/57 stat ic void md l I n i t i a l i z eCond i t i o n s ( SimStruct ∗S)58 59 rea l T ∗x = ssGetContStates (S ) ;60 x [ 0 ] = ∗ (mxGetPr( ssGetSFcnParam (S , 0 ) ) ) ;61 x [ 1 ] = ∗ (mxGetPr( ssGetSFcnParam (S , 1 ) ) ) ;62 x [ 2 ] = ∗ (mxGetPr( ssGetSFcnParam (S , 2 ) ) ) ;63 x [ 3 ] = ∗ (mxGetPr( ssGetSFcnParam (S , 3 ) ) ) ;64 x [ 4 ] = ∗ (mxGetPr( ssGetSFcnParam (S , 4 ) ) ) ;65 6667 /∗ Funct ion : mdlOutputs =======================================================68 ∗ Output t h e f u l l motor s t a t e ,69 ∗/70 stat ic void mdlOutputs ( SimStruct ∗S , int T t i d )71 72 rea l T ∗x = ssGetContStates (S ) ;73 rea l T ∗y = ssGetOutputPortSignal (S , 0 ) ;74 int i =0;7576 for ( i =0; i <5; i++)77 78 y [ i ] = x [ i ] ;79 80 8182 #define MDL DERIVATIVES /∗ Change to #undef to remove f un c t i o n ∗/83 /∗ Funct ion : md lDe r i v a t i v e s =================================================84 ∗ Ca l c u l a t e t h e motor s t a t e d e r i v a t i v e s f o r S imu l ink ’ s i n t e g r a t o r .85 ∗/86 stat ic void mdlDer ivat ives ( SimStruct ∗S)87 88 rea l T ∗dx = ssGetdX (S ) ;89 rea l T ∗x = ssGetContStates (S ) ;9091 rea l T x1 = x [ 0 ] ;92 rea l T x2 = x [ 1 ] ;93 rea l T x3 = x [ 2 ] ;94 rea l T x4 = x [ 3 ] ;95 rea l T x5 = x [ 4 ] ;9697 // i n pu t s98 rea l T u1 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 0 ] ) ;99 rea l T u2 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 1 ] ) ;

100 rea l T ML = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 2 ] ) ;101102 rea l T Rs = MACRORS ∗ MACRORSDIST; // Motor parameters from parmset . h103 rea l T Rr = MACRORR ∗ MACRORRDIST;104 rea l T Ls = MACROLS ∗ MACROLSDIST;105 rea l T Lr = MACROLR ∗ MACROLRDIST;106 rea l T Lh = MACROLH ∗ MACROLHDIST;107 rea l T J = MACROJ ∗ MACROJDIST;108 rea l T p = MACROP;109110 // motor parms111 rea l T ar = Rr/Lr ;112 rea l T sigma = 1.0 − pow(Lh , 2 ) / Ls/Lr ;113 rea l T mu = Lh/Lr ;114 rea l T Rl = (Rs + pow(Lh/Lr , 2 )∗Rr ) ;115

Page 75: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

A.1 Source code for compiled blocks 75

116 // De r i v a t i v e s o f : w , phia , phib , ia , i b117 dx [ 0 ] = 1.0/ J ∗ ( 3 . 0/2 . 0∗p∗mu∗( x5∗x2−x3∗x4 ) − ML ) ;118 dx [ 1 ] = Lh∗ar∗x4 − ar∗x2 − p∗x1∗x3 ;119 dx [ 2 ] = Lh∗ar∗x5 − ar∗x3 + p∗x1∗x2 ;120 dx [ 3 ] = 1 . 0/ ( sigma∗Ls)∗(−Rl∗x4 + mu∗ar∗x2 + mu∗p∗x1∗x3 + u1 ) ;121 dx [ 4 ] = 1 . 0/ ( sigma∗Ls)∗(−Rl∗x5 + mu∗ar∗x3 − mu∗p∗x1∗x2 + u2 ) ;122123 124125 stat ic void mdlTerminate ( SimStruct ∗S) // empty f u n c t i o n d e f i n i t i o n126127 // Required S−f u n c t i o n t r a i l e r128 #ifde f MATLAB MEX FILE /∗ I s t h i s f i l e b e i n g compi l ed as a MEX− f i l e ? ∗/129 #include ” s imul ink . c” /∗ MEX− f i l e i n t e r f a c e mechanism ∗/130 #else

131 #include ” cg s fun . h” /∗ Code g en e r a t i on r e g i s t r a t i o n f un c t i o n ∗/132 #endif

Listing A.2: controller.c1 #define S FUNCTION NAME con t r o l l e r2 #define S FUNCTION LEVEL 234 #include <math . h>

5 #include ” s imstruc . h”6 #include ”myconf . h”78 #define SIGN(x ) ( (x ) >= 0 ? 1 .0 : −1.0 )9

10 /∗ Funct ion : m d l I n i t i a l i z e S i z e s ===============================================11 ∗ I n i t i a l i z a t i o n . Se t number o f inpu t s , ou tpu t s , s t a t e s , e t c12 ∗/13 stat ic void md l I n i t i a l i z e S i z e s ( SimStruct ∗S)14 15 int i ;1617 ssSetNumSFcnParams (S , 0 ) ; /∗ Number o f e x p e c t e d parameters ∗/1819 i f ( ssGetNumSFcnParams(S) != ssGetSFcnParamsCount (S ) ) 20 s sSe tEr ro rS ta tus (S , ”ssGetNumSFcnParams(S) != ssGetSFcnParamsCount (S) ” ) ;21 return ;22 2324 ssSetNumContStates (S , 0 ) ;25 ssSetNumDiscStates (S , 0 ) ;2627 i f ( ! ssSetNumInputPorts (S , 14)) return ;28 for ( i =0; i <14; i++)29 30 ssSetInputPortWidth (S , i , 1 ) ;31 // Each inpu t po r t has d i r e c t f e e d t h r ou g h to ou tpu t :32 ssSetInputPortDirectFeedThrough (S , i , 1 ) ;33 3435 i f ( ! ssSetNumOutputPorts (S , 6 ) ) return ;36 for ( i =0; i <6; i++)37 38 ssSetOutputPortWidth (S , i , 1 ) ;39 4041 ssSetNumSampleTimes (S , 1 ) ;42 4344 /∗ Funct ion : md l I n i t i a l i z eSamp l eT ime s =========================================45 ∗ Set sample t ime the CONTINUOUS46 ∗/47 stat ic void mdlIn i t ia l i zeSampleTimes ( SimStruct ∗S)48 49 ssSetSampleTime (S , 0 , CONTINUOUS SAMPLE TIME) ;50 ssSetOf f setTime (S , 0 , 0 . 0 ) ;51 ssSetModelReferenceSampleTimeDefault Inher i tance (S ) ;52 5354 /∗ Funct ion : mdlOutputs =======================================================55 ∗ The a c t u a l c o n t r o l s are b e i n g c a l c u l a t e d here56 ∗/57 stat ic void mdlOutputs ( SimStruct ∗S , int T t i d )58 59 rea l T ∗y = ssGetOutputPortSignal (S , 0 ) ; // ou tpu t array6061 rea l T x1 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 0 ] ) ; // i n pu t s . . .62 rea l T x2 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 1 ] ) ;63 rea l T x3 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 2 ] ) ;

Page 76: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

76 Simulink model

64 rea l T x4 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 3 ] ) ;65 rea l T x5 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 4 ] ) ;66 rea l T ML = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 5 ] ) ;67 rea l T ML1 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 6 ] ) ;68 rea l T wref = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 7 ] ) ;69 rea l T wref1 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 8 ] ) ;70 rea l T wref2 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 9 ] ) ;71 rea l T s1 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 1 0 ] ) ;72 rea l T s2 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 1 1 ] ) ;73 rea l T s11 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 1 2 ] ) ;74 rea l T s21 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 1 3 ] ) ;7576 // c o n t r o l l e r parms from prep roce s so r−macros in parmset . h :77 rea l T k1 = MACROK1;78 rea l T k2 = MACROK2;79 rea l T lM1 = MACROlM1;80 rea l T lm1 = MACROlm1;81 rea l T lM2 = MACROlM2;82 rea l T lm2 = MACROlm2;8384 rea l T ph i r e f s q = MACROPHIREFSQ;8586 // motor parms87 rea l T Rs = MACRORS;88 rea l T Rr = MACRORR;89 rea l T Ls = MACROLS;90 rea l T Lr = MACROLR;91 rea l T Lh = MACROLH;92 rea l T J = MACROJ;93 rea l T p = MACROP;9495 // motor parms96 rea l T ar = Rr/Lr ;97 rea l T sigma = 1.0 − pow(Lh , 2 ) / Ls/Lr ;98 rea l T mu = Lh/Lr ;99 rea l T Rl = (Rs + pow(Lh/Lr , 2 )∗Rr ) ;

100101 // D matr ix f o r l i n e a r i z i n g f e e d b a c k102 rea l T D1 = (3 . 0/ J /2.0∗p∗mu)∗ ( ( x2∗x5−x3∗x4)∗(− ar −Rl/sigma/Ls )103 + (pow(x2 ,2)+pow(x3 , 2 ) )∗ x1∗(−p∗mu/sigma/Ls ) − ( x2∗x4+x3∗x5 )∗x1∗p)104 − 1 .0/ J∗ML1 − wref2 ;105106 rea l T D2 = ( x2∗x4+x3∗x5 )∗(−6.0∗Lh∗pow( ar , 2 ) − 2 .0∗Rl∗Lh∗ar / sigma/Ls )107 + x1∗( x2∗x5−x3∗x4 )∗ ( 2 . 0∗p∗Lh∗ar )108 + (pow(x2 ,2)+pow(x3 , 2 ) ) ∗ ( 4 . 0∗pow( ar ,2)+2.0∗Lh∗pow( ar , 2 )∗mu/sigma/Ls )109 +(pow(x4 ,2)+pow(x5 , 2 ) ) ∗ ( 2 . 0∗pow(Lh∗ar , 2 ) ) ;110111 // A matr ix f o r l i n e a r i z i n g f e e d b a c k112 rea l T A11 = −3.0/2.0/J/sigma/Ls∗p∗mu∗x3 ;113 rea l T A12 = 3 .0/2 . 0/ J/sigma/Ls∗p∗mu∗x2 ;114 rea l T A21 = 2.0∗ x2∗Lh∗ar / sigma/Ls ;115 rea l T A22 = 2.0∗ x3∗Lh∗ar / sigma/Ls ;116117 // Ca l c u l a t e i n v e r s e o f t h e A matr ix118 rea l T detA = A11∗A22−A12∗A21 ;119 rea l T invA11 = A22/detA ;120 rea l T invA12 = −A12/detA ;121 rea l T invA21 = −A21/detA ;122 rea l T invA22 = A11/detA ;123124 rea l T v1 , v2 ;125 rea l T u1 , u2 ;126127 // Twi s t ing a l g o r i t hm + l i n e a r f e e d ba c k f o r ”new inpu t ”128 i f ( s1∗ s11 <= 0 .0 ) v1 = −pow(k1 , 2 )∗ s1 − 2 .0∗ k1∗ s11 − lm1∗SIGN( s1 ) ;129 else v1 = −pow(k1 , 2 )∗ s1 − 2 .0∗ k1∗ s11 − lM1∗SIGN( s1 ) ;130131 i f ( s2∗ s21 <= 0) v2 = −pow(k2 , 2 )∗ s2 − 2 .0∗ k2∗ s21 − lm2∗SIGN( s2 ) ;132 else v2 = −pow(k2 , 2 )∗ s2 − 2 .0∗ k2∗ s21 − lM2∗SIGN( s2 ) ;133134 // Apply l i n e a r i z i n g f e e d ba c k135 u1 = invA11∗(−D1+v1 ) + invA12∗(−D2+v2 ) ;136 u2 = invA21∗(−D1+v1 ) + invA22∗(−D2+v2 ) ;137138 y [ 0 ] = u1 ; // ua lpha139 y [ 1 ] = u2 ; // ube ta140 y [ 2 ] = s1 ;141 y [ 3 ] = s11 ;142 y [ 4 ] = s2 ;143 y [ 5 ] = s21 ;144 145146 stat ic void mdlTerminate ( SimStruct ∗S) // empty f un c t i o n d e f i n i t i o n147

Page 77: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

A.1 Source code for compiled blocks 77

148 // Required S−f u n c t i o n t r a i l e r149 #ifde f MATLAB MEX FILE /∗ I s t h i s f i l e b e i n g compi l ed as a MEX− f i l e ? ∗/150 #include ” s imul ink . c” /∗ MEX− f i l e i n t e r f a c e mechanism ∗/151 #else

152 #include ” cg s fun . h” /∗ Code g en e r a t i on r e g i s t r a t i o n f un c t i o n ∗/153 #endif

Listing A.3: observer.c

1 #define S FUNCTION NAME observer2 #define S FUNCTION LEVEL 234 #include <math . h>

5 #include ” s imstruc . h”6 #include ”myconf . h”78 #define SIGN(x ) ( (x ) >= 0 ? 1 .0 : −1.0 )9

10 /∗ Funct ion : m d l I n i t i a l i z e S i z e s ===============================================11 ∗ I n i t i a l i z a t i o n . Se t number o f inpu t s , ou tpu t s , s t a t e s , e t c12 ∗/13 stat ic void md l I n i t i a l i z e S i z e s ( SimStruct ∗S)14 15 int i ;1617 ssSetNumContStates (S , 0 ) ;18 ssSetNumDiscStates (S , 4 ) ;1920 ssSetNumSFcnParams (S , 5 ) ; /∗ Number o f e x p e c t e d parameters ∗/21 i f ( ssGetNumSFcnParams(S) != ssGetSFcnParamsCount (S ) ) 22 /∗ Return i f number o f e x p e c t e d != number o f a c t u a l parameters ∗/23 s sSe tEr ro rS ta tus (S , ”ssGetNumSFcnParams(S) != ssGetSFcnParamsCount (S) ” ) ;24 return ;25 2627 i f ( ! ssSetNumInputPorts (S , 5 ) ) return ;28 for ( i =0; i <5; i++)29 30 ssSetInputPortWidth (S , i , 1 ) ;31 ssSetInputPortRequiredContiguous (S , i , f a l s e ) ; /∗ d i r e c t i npu t s i g n a l a c c e s s ∗/32 // No inpu t po r t has d i r e c t f e e d t h r ou g h to ou tpu t :33 ssSetInputPortDirectFeedThrough (S , 0 , 0 ) ;34 3536 i f ( ! ssSetNumOutputPorts (S , 5 ) ) return ;37 for ( i =0; i <5; i++)38 39 ssSetOutputPortWidth (S , i , 1 ) ;40 4142 ssSetNumSampleTimes (S , 1 ) ;43 4445 /∗ Funct ion : md l I n i t i a l i z eSamp l eT ime s =========================================46 ∗ Set d i s c on t i n uou s sample t ime .47 ∗/48 stat ic void mdlIn i t ia l i zeSampleTimes ( SimStruct ∗S)49 50 // Sample t ime i s c o n f i g u r e a b l e th rough 5 th d i a l o g parameter51 ssSetSampleTime (S , 0 , ∗ (mxGetPr( ssGetSFcnParam (S , 4 ) ) ) ) ;52 ssSetOf f setTime (S , 0 , 0 . 0 ) ;53 ssSetModelReferenceSampleTimeDefault Inher i tance (S ) ;54 5556 /∗ Funct ion : m d l I n i t i a l i z e C o n d i t i o n s ========================================57 ∗ I n i t i a l i z e o b s e r v e r s t a t e s from d i a l o g parms .58 ∗/59 #define MDL INITIALIZE CONDITIONS60 stat ic void md l I n i t i a l i z eCond i t i o n s ( SimStruct ∗S)61 62 rea l T ∗x = ssGetDiscStates (S ) ;63 x [ 0 ] = ∗ (mxGetPr( ssGetSFcnParam (S , 0 ) ) ) ;64 x [ 1 ] = ∗ (mxGetPr( ssGetSFcnParam (S , 1 ) ) ) ;65 x [ 2 ] = ∗ (mxGetPr( ssGetSFcnParam (S , 2 ) ) ) ;66 x [ 3 ] = ∗ (mxGetPr( ssGetSFcnParam (S , 3 ) ) ) ;67 6869 /∗ Funct ion : mdlOutputs =======================================================70 ∗ Output o b s e r v e r s t a t e s71 ∗/72 stat ic void mdlOutputs ( SimStruct ∗S , int T t i d )73 74 rea l T ∗z = ssGetDiscStates (S ) ;

Page 78: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

78 Simulink model

75 rea l T ∗y = ssGetOutputPortSignal (S , 0 ) ;76 int i =0;7778 y [ 0 ] = 0 ; // 1 s t ou tpu t was o r i g i n a l l y used f o r t h e speed , now unused .79 for ( i =0; i <4; i++)80 81 y [ i +1] = z [ i ] ;82 83 8485 /∗ Funct ion : mdlUpdate =================================================86 ∗ The o b s e r v e r s t a t e d e r i v a t i v e s are c a l c u l a t e d AND i n t e g r a t e d here87 ∗/88 #define MDL UPDATE89 stat ic void mdlUpdate ( SimStruct ∗S , int T t i d )90 91 rea l T ∗z = ssGetDiscStates (S ) ;92 time T h = ssGetSampleTime (S , 0 ) ;9394 rea l T dz [ 4 ] ; // f o r s t o r i n g o b s e r v e r s t a t e d e r i v a t i v e s95 int i ;9697 // s t a t e s98 rea l T z2 = z [ 0 ] ;99 rea l T z3 = z [ 1 ] ;

100 rea l T z4 = z [ 2 ] ;101 rea l T z5 = z [ 3 ] ;102103 rea l T ph i r e f s q = MACROPHIREFSQ;104105 rea l T d1 = MACROd1; // in r e p o r t : d1=d2 i s c a l l e d e ta1106 rea l T d2 = d1 ;107 rea l T q2 = MACROq2;108109 // f l o q u e t motor parms110 rea l T Rs = MACRORS;111 rea l T Rr = MACRORR;112 rea l T Ls = MACROLS;113 rea l T Lr = MACROLR;114 rea l T Lh = MACROLH;115 rea l T J = MACROJ;116 rea l T p = MACROP;117118 // motor parms119 rea l T ar = Rr/Lr ;120 rea l T sigma = 1.0 − pow(Lh , 2 ) / Ls/Lr ;121 rea l T mu = Lh/Lr ;122 rea l T Rl = (Rs + pow(Lh/Lr , 2 )∗Rr ) ;123124 // i n pu t s125 rea l T x1 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 0 ] ) ;126 rea l T x4 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 1 ] ) ;127 rea l T x5 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 2 ] ) ;128 rea l T u1 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 3 ] ) ;129 rea l T u2 = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 4 ] ) ;130131 rea l T I s1 = SIGN( x4 − z4 ) ; // d i s c on t i n uou s e l ement132 rea l T I s2 = SIGN( x5 − z5 ) ;133134 rea l T Gz11 = d1 ;135 rea l T Gz12 = 0 ;136 rea l T Gz21 = 0 ;137 rea l T Gz22 = d2 ;138139 rea l T Gx11 = d1∗( q2∗ar−1.0/ ar ) ;140 rea l T Gx12 = −d2∗q2∗p∗x1 ;141 rea l T Gx21 = d1∗q2∗p∗x1 ;142 rea l T Gx22 = d2∗( q2∗ar−1.0/ ar ) ;143144 // De r i v a t i v e s o f : z2 z3 x4 x5 = phia , phib , ia , i b145 dz [ 0 ] = Lh∗ar∗x4 − ar∗z2 − p∗x1∗z3 + (Gx11∗ I s 1 + Gx12∗ I s 2 ) ;146 dz [ 1 ] = Lh∗ar∗x5 − ar∗z3 + p∗x1∗z2 + (Gx21∗ I s 1 + Gx22∗ I s 2 ) ;147 dz [ 2 ] = 1 .0/ ( sigma∗Ls)∗(−Rl∗x4 + mu∗ar∗z2 + mu∗p∗x1∗z3 + u1 + Gz11∗ I s 1 + Gz12∗ I s 2 ) ;148 dz [ 3 ] = 1 .0/ ( sigma∗Ls)∗(−Rl∗x5 + mu∗ar∗z3 − mu∗p∗x1∗z2 + u2 + Gz21∗ I s 1 + Gz22∗ I s 2 ) ;149150 // Perform Euler i n t e g r a t i o n151 for ( i =0; i <4; i++)152 153 z [ i ] = z [ i ] + h∗dz [ i ] ;154 155 156157 stat ic void mdlTerminate ( SimStruct ∗S) // empty f un c t i o n d e f i n i t i o n158

Page 79: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

A.1 Source code for compiled blocks 79

159 // Required S−f u n c t i o n t r a i l e r160 #ifde f MATLAB MEX FILE /∗ I s t h i s f i l e b e i n g compi l ed as a MEX− f i l e ? ∗/161 #include ” s imul ink . c” /∗ MEX− f i l e i n t e r f a c e mechanism ∗/162 #else

163 #include ” cg s fun . h” /∗ Code g en e r a t i on r e g i s t r a t i o n f un c t i o n ∗/164 #endif

Listing A.4: difffirstorder.c

1 #define S FUNCTION NAME d i f f f i r s t o r d e r2 #define S FUNCTION LEVEL 234 #include <math . h>

5 #include ” s imstruc . h”67 #define SIGN(x ) ( (x ) >= 0 ? 1 .0 : −1.0 )89 /∗ Funct ion : m d l I n i t i a l i z e S i z e s ===============================================

10 ∗ I n i t i a l i z a t i o n . Se t number o f inpu t s , ou tpu t s , s t a t e s , e t c11 ∗/12 stat ic void md l I n i t i a l i z e S i z e s ( SimStruct ∗S)13 14 int i ;1516 ssSetNumSFcnParams (S , 4 ) ; /∗ Number o f e x p e c t e d parameters ∗/17 i f ( ssGetNumSFcnParams(S) != ssGetSFcnParamsCount (S ) ) 18 /∗ Return i f number o f e x p e c t e d != number o f a c t u a l parameters ∗/19 s sSe tEr ro rS ta tus (S , ”ssGetNumSFcnParams(S) != ssGetSFcnParamsCount (S) ” ) ;20 return ;21 2223 ssSetNumContStates (S , 0 ) ;24 ssSetNumDiscStates (S , 2 ) ;2526 i f ( ! ssSetNumInputPorts (S , 1 ) ) return ;27 for ( i =0; i <1; i++)28 29 ssSetInputPortWidth (S , i , 1 ) ;30 // No inpu t po r t has d i r e c t f e e d t h r ou g h to ou tpu t :31 ssSetInputPortDirectFeedThrough (S , 0 , 0 ) ;32 3334 i f ( ! ssSetNumOutputPorts (S , 2 ) ) return ;35 for ( i =0; i <2; i++)36 37 ssSetOutputPortWidth (S , i , 1 ) ;38 3940 ssSetNumSampleTimes (S , 1 ) ;41 4243 /∗ Funct ion : md l I n i t i a l i z eSamp l eT ime s =========================================44 ∗ Set d i s c on t i n uou s sample t ime .45 ∗/46 stat ic void mdlIn i t ia l i zeSampleTimes ( SimStruct ∗S)47 48 // Sample t ime i s c o n f i g u r e a b l e th rough 4 th d i a l o g parameter49 ssSetSampleTime (S , 0 , ∗ (mxGetPr( ssGetSFcnParam (S , 3 ) ) ) ) ;50 ssSetOf f setTime (S , 0 , 0 . 0 ) ;51 ssSetModelReferenceSampleTimeDefault Inher i tance (S ) ;52 5354 /∗ Funct ion : m d l I n i t i a l i z e C o n d i t i o n s ========================================55 ∗ I n i t i a l i z e o b s e r v e r s t a t e s from d i a l o g parms .56 ∗/57 #define MDL INITIALIZE CONDITIONS58 stat ic void md l I n i t i a l i z eCond i t i o n s ( SimStruct ∗S)59 60 rea l T ∗x = ssGetDiscStates (S ) ;61 x [ 0 ] = ∗ (mxGetPr( ssGetSFcnParam (S , 0 ) ) ) ;62 x [ 1 ] = ∗ (mxGetPr( ssGetSFcnParam (S , 1 ) ) ) ;63 6465 /∗ Funct ion : mdlOutputs =======================================================66 ∗ Output d i f f e r e n t i a t o r s t a t e s67 ∗/68 stat ic void mdlOutputs ( SimStruct ∗S , int T t i d )69 70 rea l T ∗z = ssGetDiscStates (S ) ;71 rea l T ∗y = ssGetOutputPortSignal (S , 0 ) ;7273 y [ 0 ] = z [ 0 ] ; // r e c on s t r u c t e d v e r s i o n o f i npu t74 y [ 1 ] = z [ 1 ] ; // r e c on s t r u c t e d v e r s i o n o f i npu t d e r i v a t i v e

Page 80: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

80 Simulink model

7576 7778 /∗ Funct ion : mdlUpdate =================================================79 ∗ The d i f f e r e n t i a t o r s t a t e d e r i v a t i v e s are c a l c u l a t e d AND i n t e g r a t e d here80 ∗/81 #define MDL UPDATE82 stat ic void mdlUpdate ( SimStruct ∗S , int T t i d )83 8485 rea l T ∗z = ssGetDiscStates (S ) ;86 time T h = ssGetSampleTime (S , 0 ) ;8788 rea l T f = ∗( s sGetInputPortRea lS igna lPtrs (S , 0 ) [ 0 ] ) ; // Inpu t s i g n a l8990 // L parameter c on f i g u r e d th rough 3 rd d i a l o g parameter91 rea l T L = ∗ (mxGetPr( ssGetSFcnParam (S , 2 ) ) ) ;9293 // Levant ’ s a l g o r i t hm f o r r o bu s t f i n i t e −t ime f i r s t −order d i f f e r e n t i a t i o n94 rea l T v0 = −1.5∗pow(L , 1 . 0 / 2 . 0 ) ∗pow( fabs ( z [0]− f ) , 1 . 0 / 2 . 0 )∗SIGN( z [0]− f ) + z [ 1 ] ;95 rea l T v1 = −1.1∗L∗SIGN( z [0]− f ) ;9697 // Eu ler i n t e g r a t i o n98 z [ 0 ] += h∗v0 ;99 z [ 1 ] += h∗v1 ;

100101 102103 stat ic void mdlTerminate ( SimStruct ∗S) // empty f un c t i o n d e f i n i t i o n104105 // Required S−f u n c t i o n t r a i l e r106 #ifde f MATLAB MEX FILE /∗ I s t h i s f i l e b e i n g compi l ed as a MEX− f i l e ? ∗/107 #include ” s imul ink . c” /∗ MEX− f i l e i n t e r f a c e mechanism ∗/108 #else

109 #include ” cg s fun . h” /∗ Code g ene r a t i on r e g i s t r a t i o n f un c t i o n ∗/110 #endif

Listing A.5: myconf.c

1 #define PARMSET 023 #i f PARMSET==0 //−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−45 #define MACRORS 1.6336 #define MACRORR 0.937 #define MACROLS 0.1428 #define MACROLR 0.0769 #define MACROLH 0.099

10 #define MACROJ 0.02911 #define MACROP 2.01213 #define MACRORSDIST 1 .014 #define MACRORRDIST 1 .015 #define MACROLSDIST 1 .016 #define MACROLRDIST 1 .017 #define MACROLHDIST 1 .018 #define MACROJDIST 1 .01920 #define MACROPHIREFSQ 0.59∗0 .592122 #define MACROK1 60.023 #define MACROK2 60.024 #define MACROlM1 10000.025 #define MACROlm1 2000.026 #define MACROlM2 20000.027 #define MACROlm2 5000.02829 #define MACROd1 10 .030 #define MACROq2 0.023132 #e l i f PARMSET==13334 // . . .3536 #endif

Listing A.6: parmset0.m

1 %% t r a j g e n23 wc=15; % Cuto f f f r e qu ency

Page 81: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

A.1 Source code for compiled blocks 81

4 N=3; % F i l t e r order5 [ tgb , tga ]= b e s s e l f (N, wc ) ;6 atrunc= tga ( 2 :N+1);7 trajgenA=[zeros (N−1 ,1) eye (N−1,N−1); − f l i p l r ( atrunc ) ] ;8 trajgenB=[zeros (N−1 ,1); tga (N+1) ] ;9 trajgenC=eye (N,N) ;

10 trajgenD=zeros (N, 1 ) ;11 r e f s c a l e = 1430/60∗2∗pi ;1213 %% loadgen14 wc=50;15 N=2;16 [ tgb , tga ]= b e s s e l f (N, wc ) ;17 atrunc= tga ( 2 :N+1);18 loadgenA=[zeros (N−1 ,1) eye (N−1,N−1); − f l i p l r ( atrunc ) ] ;19 loadgenB=[zeros (N−1 ,1); tga (N+1) ] ;20 loadgenC=eye (N,N) ;21 loadgenD=zeros (N, 1 ) ;22 l o ad s c a l e = 10 ;2324 %% Parameters f o r Levant d i f f e r e n t i a t o r 1 & 225 s1d i f fparms1 =15; % I n i t i a l c ond i t i o n f o r z026 s1d i f fparms2 =0; % I n i t i a l c ond i t i o n f o r z127 s1d i f fparms3 =50000; % The va l u e o f ”L”28 s1d i f fparms4=1e−5; % Sampling t ime f o r d i f f e r e n t i a t o r2930 s2d i f fparms1 =0; % I n i t i a l c ond i t i o n f o r z031 s2d i f fparms2 =0; % I n i t i a l c ond i t i o n f o r z132 s2d i f fparms3 =500000; % The va l u e o f ”L”33 s2d i f fparms4=1e−5; % Sampling t ime f o r d i f f e r e n t i a t o r34 %%35 Tinv = 5e−5; % In v e r t e r sw i t c h i n g f r e q36 %% Motor model i n i t i a l s t a t e v a l u e s ( speed , f l u x e s , c u r r en t s )37 minit1 = 15 ;38 minit2 = 0 .9∗0 .59/ sqrt ( 2 ) ;39 minit3 = 0 .9∗0 .59/ sqrt ( 2 ) ;40 minit4 = 0 ;41 minit5 = 0 ;42 %% I n i t i a l o b s e r v e r s t a t e v a l u e s ( f l u x e s & cu r r en t s )43 o i n i t 2 = 2∗0.59/ sqrt ( 2 ) ;44 o i n i t 3 = 0 .5∗0 .59/ sqrt ( 2 ) ;45 o i n i t 4 = 0 ;46 o i n i t 5 = 0 ;47 o in i tTs = Tinv ; % Observer sample t ime

Page 82: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

This page intentionally contains only this sentence.

Page 83: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

Bibliography

[1] W. Leonhard, Regelung elektrischer Antriebe. Springer, 2000, isbn3-540-67179-X.

[2] E. Hendricks, O. Jannerup, and P. H. Sørensen, Linear Systems Control.Springer-Verlag Berlin Heidelberg, 2008, isbn 978-3-540-78485-2.

[3] V. I. Utkin, J. Guldner, and J. Shi, Sliding Mode Control in Electrome-chanical Systems. Taylor & Francis, 1999, isbn 0-7484-0116-4.

[4] C. Aurora and A. Ferrara, “A sliding mode observer for sensorless in-duction motor speed regulation,” International Journal of Systems Sci-ence, vol. 38, no. 11, pp. 913–929, Nov. 2007.

[5] T. Floquet, J. P. Barbot, and W. Perruquetti, “Second order slidingmode control for induction motor,” in Proc. of the 39th IEEE Confer-ence on Decision and Control, vol. 2, Dec. 2000, pp. 1691–1696.

[6] A. Levant, “Robust exact differentiation via sliding mode technique,”Automatica, vol. 34, no. 3, pp. 379–384, 1998.

[7] A. Damiano, G. L. Gatto, I. Marongiu, and A. Pisano, “Second-ordersliding-mode control of dc drives,” IEEE Transactions on IndustrialElectronics, vol. 51, no. 2, pp. 364–373, Apr 2004.

[8] G. Monsees, “Discrete-time sliding mode control,” Ph.D. dissertation,Technische Univeriteit Delft, 2002, isbn 90-77017-83-6.

[9] V. I. Utkin, Sliding Modes in Control and Optimization. SpringerVerlag, 1992, isbn 3-540-53516-0.

[10] ——, “Sliding mode control design principles and applications to elec-tric drives,” IEEE Transactions on Industrial Electronics, vol. 40, no. 1,pp. 23–36, Feb 1993.

[11] W. Perruquetti and J. P. Barbot, Eds., Sliding mode control in engi-neering. Marcel Dekker, 2002, isbn 0-8247-0671-4.

[12] W. Perruquetti, P. Borne, and J. Richard, “A generalized regular formfor sliding mode stabilization of mimo systems,” in Proc. of the 36th

Page 84: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

84 BIBLIOGRAPHY

IEEE Conference on Decision and Control, vol. 2, Dec. 1997, pp. 957–961.

[13] C. Edwards, T. Floquet, and S. Spurgeon, “Circumventing the rela-tive degree condition in sliding mode design,” in Modern Sliding ModeControl Theory, ser. Lecture Notes in Control and Information Sciences,G. Bartolini, L. Fridman, A. Pisano, and E. Usai, Eds. Springer, 2008,vol. 375, pp. 137–158, isbn 978-3-540-79015-0.

[14] A. Isidori, Nonlinear control systems. Springer, 1995, isbn 3-540-19916-0.

[15] A. Levant, “Sliding order and sliding accuracy in sliding mode control,”International Journal of Control, vol. 58, no. 6, pp. 1247–1263, 1993.

[16] ——, “Principles of 2-sliding mode design,” Automatica, vol. 43, pp.576–586, 2007.

[17] G. Bartolini, A. Ferrara, A. Levant, and E. Usai, “On second ordersliding mode controllers,” in Variable Structure Systems, Sliding Modeand Nonlinear Control, ser. Lecture Notes in Control and InformationSciences, K. Young and U. Ozguner, Eds. Springer, 1999, vol. 247, pp.329–350, isbn 1-85233-197-6.

[18] G. Bartolini, A. Pisano, E. Punta, and E. Usai, “A survey of appli-cations of second-order sliding mode control to mechanical systems,”International Journal of Control, vol. 76, no. 9/10, pp. 875–892, 2003.

[19] J. A. Moreno, “A lyupunov approach to second-order sliding mode con-trollers and observers,” in Proc. of the 47th IEEE Conference on Deci-sion and Control, Dec. 2008, pp. 2856–2861.

[20] G. Bartolini, A. Ferrara, and E. Usai, “Applications of a sub-optimaldiscontinuous control algorithm for uncertain second order systems,”International journal of robust and nonlinear control, vol. 7, pp. 299–319, 1997.

[21] L. Fridman and A. Levant, “Higher-order sliding modes,” in Slidingmode control in engineering, W. Perruquetti and J. P. Barbot, Eds.Marcel Dekker, 2002, pp. 53–101, isbn 0-8247-0671-4.

[22] G. Bartolini, A. Ferrara, and E. Usai, “Chattering avoidance by second-order sliding mode control,” IEEE Transactions on Automatic Control,vol. 43, no. 2, pp. 241–246, Feb 1998.

[23] G. Bartolini, A. Pisano, and E. Usai, “On the robust stabilization ofnonlinear uncertain systems with incomplete state availability,” Trans-actions of the ASME, vol. 122, pp. 738–745, Dec 2000.

Page 85: Second-Order Sliding Mode Control of Induction Motoretd.dtu.dk/thesis/252991/Pejstrup.pdf · Second-Order Sliding Mode Control of an Induction Motor Rapporten er udarbejdet af: Nils

BIBLIOGRAPHY 85

[24] I. Boiko, L. Fridman, A. Pisano, and E. Usai, “A comprehensive analysisof chattering in second order sliding mode control systems,” in ModernSliding Mode Control Theory, ser. Lecture Notes in Control and Infor-mation Sciences, G. Bartolini, L. Fridman, A. Pisano, and E. Usai, Eds.Springer, 2008, vol. 375, pp. 23–49, isbn 978-3-540-79015-0.

[25] V. Utkin, J. Guldner, and J. Shi, Sliding Mode Control in Electro-Mechanical Systems, 2nd ed. CRC Press, 2009, isbn 978-1-4200-6560-2.

[26] A. Mezouar, M. Fellah, and S. Hadjeri, “Adaptive sliding mode observerfor induction motor using two-time-scale approach,” vol. 77, no. 5-6, pp.604–618, 2007.

[27] H. Khalid, M. Benyounes, and D. Sid’Ahmed, “Induction motor fluxestimation using nonlinear sliding observers,” Journal of Mathematicsand Statistics, vol. 3, no. 2, pp. 65–69, 2007.

[28] A. Levant, “Higher-order sliding modes, differentiation and output-feedback control,” International Journal of Control, vol. 76, no. 9-10,pp. 924–941, 2003.