Sliding mode for detection and accommodation of computation time delay fault

17
Available online at www.sciencedirect.com Mathematics and Computers in Simulation 80 (2009) 449–465 Sliding mode for detection and accommodation of computation time delay fault José Paulo F. Garcia a,, Lizete Maria C.F. Garcia b , Gisele C. Apolinário c , Fernando B. Rodrigues c a Department of Electrical Engineering, State University of São Paulo, P.O. Box 31, Ilha Solteira, Brazil b Department of Mathematics, State University of São Paulo, P.O. Box 31, Ilha Solteira, Brazil c Laboratory Research on Control, State University of São Paulo, P.O. Box 31, Ilha Solteira, Brazil Received 24 October 2008; received in revised form 20 August 2009; accepted 21 August 2009 Available online 31 August 2009 Abstract Computation time delay in digital control systems reduces its robustness as well as degrades its performance. In this paper, the computation time delay is assumed to be constant and smaller than the sampling time and is treated as a fault to be detected, using an appropriate controller to minimize its effects. Thus, a discrete-time sliding mode control that improves the systems’ performance when a computation time delay fault is found is proposed herein. A robust sliding mode observer-based is used to generate the residuals. Using the accumulated residual functions, a new scheme for fault detection and for controller adaptation is proposed. The technique is used to control a Rotary Motion Inverted Pendulum System to illustrate the design procedures and the effectiveness of the method. © 2009 IMACS. Published by Elsevier B.V. All rights reserved. Keywords: Discrete-time sliding mode control; Sliding mode observer; Computation time delay; Fault detection 1. Introduction Variable structure control with sliding mode (VSC) has been studied since the early sixties [24]. Recently the application of computer-based sliding mode control has increased in the design of practical systems [9,10,13]. It is known that the VSC in continuous-time system is robust for a class of uncertainties in the plant [3,22,24]. According to [7], its implementation by digital devices, however, requires a certain sampling interval which brings not only chattering along the sliding surface but also possible instability [9]. In addition, the presence of input delay not only reduces relative stability and robustness but also degrades the performance [11,17]. In digital systems, the computation time delay is caused mainly by the instruction execution time that generates the control input after the sampling instant. In most applications the computation time delay is smaller than the sampling time, but this case has been studied by few researchers [15]. A fault is deemed to occur when the system experiences an abnormal condition, as for instance a malfunction in the actuators/sensors [21]. Fault detection and isolation has increasingly become an important area [6,12,16].A Corresponding author. Tel.: +55 018 3743 1231; fax: +55 018 3743 1163. E-mail address: [email protected] (J.P.F. Garcia). 0378-4754/$36.00 © 2009 IMACS. Published by Elsevier B.V. All rights reserved. doi:10.1016/j.matcom.2009.08.006

Transcript of Sliding mode for detection and accommodation of computation time delay fault

Available online at www.sciencedirect.com

Mathematics and Computers in Simulation 80 (2009) 449–465

Sliding mode for detection and accommodation ofcomputation time delay fault

José Paulo F. Garcia a,∗, Lizete Maria C.F. Garcia b,Gisele C. Apolinário c, Fernando B. Rodrigues c

a Department of Electrical Engineering, State University of São Paulo, P.O. Box 31, Ilha Solteira, Brazilb Department of Mathematics, State University of São Paulo, P.O. Box 31, Ilha Solteira, Brazil

c Laboratory Research on Control, State University of São Paulo, P.O. Box 31, Ilha Solteira, Brazil

Received 24 October 2008; received in revised form 20 August 2009; accepted 21 August 2009Available online 31 August 2009

Abstract

Computation time delay in digital control systems reduces its robustness as well as degrades its performance. In this paper, thecomputation time delay is assumed to be constant and smaller than the sampling time and is treated as a fault to be detected, usingan appropriate controller to minimize its effects. Thus, a discrete-time sliding mode control that improves the systems’ performancewhen a computation time delay fault is found is proposed herein. A robust sliding mode observer-based is used to generate theresiduals. Using the accumulated residual functions, a new scheme for fault detection and for controller adaptation is proposed. Thetechnique is used to control a Rotary Motion Inverted Pendulum System to illustrate the design procedures and the effectiveness ofthe method.© 2009 IMACS. Published by Elsevier B.V. All rights reserved.

Keywords: Discrete-time sliding mode control; Sliding mode observer; Computation time delay; Fault detection

1. Introduction

Variable structure control with sliding mode (VSC) has been studied since the early sixties [24]. Recently theapplication of computer-based sliding mode control has increased in the design of practical systems [9,10,13]. It isknown that the VSC in continuous-time system is robust for a class of uncertainties in the plant [3,22,24]. Accordingto [7], its implementation by digital devices, however, requires a certain sampling interval which brings not onlychattering along the sliding surface but also possible instability [9]. In addition, the presence of input delay not onlyreduces relative stability and robustness but also degrades the performance [11,17]. In digital systems, the computationtime delay is caused mainly by the instruction execution time that generates the control input after the sampling instant.In most applications the computation time delay is smaller than the sampling time, but this case has been studied byfew researchers [15].

A fault is deemed to occur when the system experiences an abnormal condition, as for instance a malfunctionin the actuators/sensors [21]. Fault detection and isolation has increasingly become an important area [6,12,16]. A

∗ Corresponding author. Tel.: +55 018 3743 1231; fax: +55 018 3743 1163.E-mail address: [email protected] (J.P.F. Garcia).

0378-4754/$36.00 © 2009 IMACS. Published by Elsevier B.V. All rights reserved.doi:10.1016/j.matcom.2009.08.006

450 J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465

concept in the fault diagnosis literature is the failure detection filter in which the structure of the observer (filter) isspecially designed to provide fault detection [6]. The use of the observer for fault detection is to estimate the outputsof the system, and then construct the residual by an output estimate error [16]. The residual analysis provides the faultdetection.

The fault detection and accommodation focus due to computation time delay is rarely approached in papers. Inthis paper the computation time delay is treated as a fault to be detected and to minimize its effects an appropriatecontroller is used. Here, a new discrete-time sliding mode control is proposed, which is a smooth sliding law that takesinto account not only the sampling period but also the computation time delay. The main aspect of the proposed controldesign is its simplicity and effectiveness in minimizing the computation time delay problem and is treated as a faultto be detected. To detect the computation time delay fault a robust sliding mode observer is used [5]. To adapt thecontroller to fault condition, a strategy based on the slope of the accumulated residual functions is proposed.

The paper is organized as follows. Section 2 presents a review of a discrete-time sliding mode design that doesnot consider computation time delay [9]. A new discrete-time sliding mode controller, which takes into account thecomputation time delay, is proposed in Section 3. In Section 4, a robust sliding mode observer [5] is summarized. Anew fault detection and controller adaptation techniques are proposed in Section 5. Section 6 presents the nonlinearmathematical model of the Rotary Motion Inverted Pendulum used in the simulations [20]. Section 7 presents thesimulation results to prove the robustness of the proposed controller and the effectiveness of computation time delayfault detection and adaptation scheme. The conclusions are in Section 8.

2. Discrete-time sliding mode control without time delay (DSMC)

In this section, discrete-time sliding mode control (DSMC) is briefly reviewed and a DSMC law is derived.Consider the linear continuous-time system [1,25]

x(t) = Ax(t) + Bu(t)

y(t) = Cx(t)(1)

where x(t) ∈ �n is the continuous state vector, u(t) ∈ �m is the sliding mode control, A ∈ �nxn, B ∈ �nxm, C ∈ �pxn.The control input is accomplished by a digital computer. The control input is given at every sampling instant k�,

where � is the sampling period. The corresponding discrete-time system is [7]

xk+1 = �xk + �uk

yk = Cxk

(2)

where xk = x(k�), yk = y(k�), � = eA�, Γ = ∫ �

0 eAτdτB, uk = u(k�) is the control input vector. The pair (�,�) isassumed to be controllable, and the pair (�,C) to be observable.

In digital control, the input u has a constant value between samplings

u(t) = uk = ueqk + u±

k , k� ≤ t < (k + 1)�, (3)

where uk is the discrete-time sliding mode input control vector, ueqk is the equivalent control vector and u±

k is the controlvector that maintains the system in the sliding mode [7].

2.1. Discrete-time sliding mode control design

In the sliding mode control design, the equivalent control, ueqk , is designed first. Secondly, the control u±

k to transferthe state to the sliding mode is designed.

Let the discrete-time sliding surface Sk be defined as [7]

Sk = Gxk, (4)

where the matrix G ∈ �mxn is designed so that the states, maintained on Sk for all k, is stable.

J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465 451

In the sliding mode condition, in which Sk+1 = Sk is assumed held [7], the following equivalent control can beobtained:

ueqk = Feqxk, (5)

where Feq = (G�)−1G(� − I) and G� is a nonsingular matrix.Substituting (5) into (2), the sliding dynamic is

xk+1 = �xk, � = � − �(G�)−1G(� − I),

Gxk = 0.(6)

The matrix G can be designed to guarantee the sliding mode stability, that is, G can be designed such that theeigenvalues of � are placed within the unit circle centered at zero to ensure the stability of the system in sliding mode[2,3,7].

Now, the control input u±k will be designed. Suppose a Lyapunov function candidate

Vk = 1

2ST

k Sk. (7)

The system will be attracted to the sliding surface (4) if the following inequality is satisfied:

Vk+1 < Vk. (8)

From Eq. (7), the attractiveness condition (8) becomes

1

2ST

k+1Sk+1 <1

2ST

k Sk. (9)

Assuming that [7]

�Sk+1 = Sk+1 − Sk. (10)

From Eqs. (2)–(5) and Eq. (10) the following can be obtained

�Sk+1 = G�u±k . (11)

Substituting Sk+1 = Sk + �Sk+1 and Eq. (11) into condition (9), and arranging terms, it becomes

(G�u±k )

TSk < −1

2(G�u±

k )T

(G�u±k ). (12)

A discrete-time control u±k that satisfies the attractiveness condition (12) is given by

u±k = −(G�)−1Sk. (13)

From Eqs. (4) and (5) and Eq. (13) the discrete-time input control (3) is reduced to

uk = −(G�)−1[G�xk]. (14)

This control was chosen due to its accomplishment simplicity and also due to computation high speed.

2.2. Robustness analysis

The discrete-time control input (14) presents robustness with respect to an uncertainty class, as shown to follow.Consider the uncertain discrete system

xk+1 = �xk + �uk + �fk(xk)

yk = Cxk

, (15)

where �fk(xk) ∈ �n is an unknown but bounded discrete-time nonlinear function, which represents uncertainties of theplant.

Proposition 1. Consider the system (15), with discrete-time input (14), satisfying ||G�fk(xk)|| < ||Gxk|| for all k.Then the attractiveness condition (8) is satisfied.

452 J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465

Proof. From Eqs. (10) and (15) it follows that

�Sk+1 = G(�xk + �uk + �fk(xk)) − Gxk (16)

and substituting Eqs. (3) and (5) into Eq. (16) it gives

�Sk+1 = G�u±k + G�fk(xk). (17)

In the sample time k + 1, using Eq. (17), the Lyapunov function (7) becomes

Vk+1 = 1

2(Sk + G�u±

k + G�fk(xk))T

(Sk + G�u±k + G�fk(xk)). (18)

By Eq. (13), it follows that

Vk+1 = 1

2||G�fk(xk)||2. (19)

In the sample time k the Lyapunov function (7) is

Vk = 1

2||Gxk||2. (20)

From Eqs. (19), (20) and ||G�fk(xk)|| < ||Gxk||, then Vk+1 < Vk and the attractiveness condition (8) is satisfied. �

3. Discrete-time sliding mode control with computation time delay (DSMC-h)

The discrete-time control (14) does not present robustness in respect to computation time delay. In this sectioncontrol (14) will be modified. The main objectives are to preserve the simplicity and to obtain robustness in respect tocomputation time delay.

When a control law is implemented by digital computer, a delay h can happen, caused mainly by the execution timeof the instructions that generates the control input after the sampling instant. In most applications, the computationtime delay is smaller than the sampling time. In the case herein presented, it is assumed that the delay is constant andsmaller than one sampling interval �(0 < h < �). Therefore, the control u(t) should be chosen as follows [15]

u(t) = uk = ueqk + u±

k k� + h ≤ t < (k + 1)� + h. (21)

Consider the discrete-time model with computation time delay in the form of:

xk+1 = �xk + �1uk−1 + �2uk, (22)

where xk ∈ �n is the state vector, uk ∈ �m is the discrete-time sliding mode control. The time-invariant matrices areΦ ∈ �nxn, �1 ∈ �nxm and �2 ∈ �nxm, with

�1 = � − ��−h =∫ �

�−h

exp(Aτ)dτB,

�2 = ��−h =∫ �−h

0exp(Aτ)dτB,

(23)

where A and B are the matrices of (1).In this model, the controllability and observability assumptions are preserved in spite of the computation time delay

[18,19]. Note that the input matrix � satisfies � = �1 + �2.

3.1. Sliding surface and control design

The discrete-time sliding surface Sk is now proposed as

Sk = Gxk + G�1uk−1, (24)

where the matrix G ∈ �mxn is designed so that the states, maintained on Sk for all k, are stable.

J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465 453

A discrete-time equivalent control ueqk for the system (22), in sliding mode condition, is obtained assuming that

Sk+1 = Sk and � = �1 + �2, resulting in

ueqk = Feqxk, (25)

where Feq = −(G�)−1G(� – I) and G� is a nonsingular matrix.Note that the equivalent control is the same for both, Eqs. (5) and (25), but the sliding surface, Eqs. (4) and (24),

are different.Now, the control law u±

k will be designed.By Eqs. (22) and (24), Eq. (10) becomes

�Sk+1 = Gxk+1 + G�1uk − Gxk − G�1uk−1. (26)

Substituting Eqs. (21) and (25) into Eq. (26) results in

�Sk+1 = G�u±k . (27)

Since Eqs. (11) and (27) are equal, then a discrete-time control u±k that satisfies the attractiveness condition (12) is

given by

u±k = −(G�)−1Sk. (28)

From Eqs. (25) and (28) and assuming the sliding surface (24), the discrete-time control (22) that considers theeffects of computation time delay is

uk = −(G�)−1[G�xk + G�1uk−1]. (29)

3.2. Robustness analysis

The proposed DSMC-h control law (29), presents robustness with respect to an uncertainty class and to computationtime delay, as shown to follow.

Consider the uncertain discrete delay-time system:

xk+1 = �xk + �1uk−1 + �2uk + �fk(xk), (30)

where �fk(xk) ∈ �n is an unknown but limited discrete-time nonlinear function, which represents uncertainties of theplant.

Proposition 2. Consider the system (30), with discrete-time input (29), satisfying ||G�fk(xk)|| < ||G(xk + �1uk−1)||for all k. Then the attractiveness condition (8) is satisfied.

Proof. Using Eqs. (21), (25) and (30) to Eq. (10), results in

�Sk+1 = G�u±k + G�fk(xk), (31)

In the sample time k + 1, using Eq. (31), the Lyapunov function (7) becomes

Vk+1 = 1

2(Sk + G�u±

k + G�fk(xk))T

(Sk + G�u±k + G�fk(xk)). (32)

By Eq. (28), it follows that

Vk+1 = 1

2||G�fk(xk)||2 (33)

in the sample time k, with sliding mode (24), the Lyapunov function (7) is

Vk = 1

2||Gxk + G�1uk−1||2. (34)

From Eqs. (33), (34) and ||G�fk(xk)|| < ||G(xk + �1uk+1)||, then Vk+1 < Vk and the attractiveness condition (8) issatisfied. �

454 J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465

4. Input delay-time sliding mode (SM) observer

The observer herein reviewed was developed by Edwards and Spurgeon [5].Consider the uncertain continuous system

x(t) = Ax(t) + Bu(t − h) + Dξ(t, x, u)

y(t) = Cx(t), (35)

where x(t) ∈ �n is the continuous state vector, u(t − h) ∈ �m is the time-delayed sliding mode control A ∈ �nxn, B ∈ �nxm,C ∈ �pxn, D ∈ �nxq, p ≥ q and the function ξ:�+ × �p × �m → �q is unknown but bounded so that

||ξ(t, x(t), u)|| ≤ r1||u|| + α(t, y), (36)

where r1 ∈ �+ and α:�+ × �p → �+ is a known function.Suppose that there exists a linear change of coordinates T0 so that Eq. (35) can be written as [5],

x1(t) = A11x1(t) + A12y(t) + B1u(t − h)

y(t) = A21x1(t) + A22y(t) + B2u(t − h) + D2ξ, (37)

where x1 ∈ �(n−p), y ∈ �p and the matrix A11 have stable eingenvalues.Consider a sliding mode observer of the form

˙x1(t) = A11x1(t) + A12y(t) + B1u(t − h) − A12ey(t)˙y(t) = A21x1(t) + A22y(t) + B2u(t − h) − (A22 − AS

22)ey(t) + ν, (38)

where ey = y − y and AS22 is a stable design matrix.

Consider P2 ∈ �pxp a symmetrical positive Lyapunov matrix for AS22. The discontinuous vector v is defined by

v =⎧⎨⎩−ρ(t, y, u)||D2|| P2ey

||P2ey|| if ey /= 0

0 otherwise, (39)

where the function ρ:�+ × �p × �m → �+ satisfies

ρ(t, y, u) ≥ r1||u|| + α(t, y) + γ0 (40)

and γ0 ∈ �+.The state error vector is defined as e1 = x1 − x1 and the sliding surface is S0 = {e(t) ∈ �n:Ce = ey = 0}, where

e(t) = [e1(t) ey(t)]T.The dynamic equation of the error is:

e1(t) = A11e1(t)

ey(t) = A21e1(t) + As22ey(t) + v − D2ξ

. (41)

Theorem 1. The dynamic of the error, Eq. (41), is asymptotically stable.

Proof. In [5] and [8].In original coordinates, if x(t) represents the states estimate for x(t) and e(t) = x(t) − x(t), then the robust observer

can conveniently be written as [5]:

˙x(t) = Ax(t) + Bu(t − h) − GlCe(t) + Gnv, (42)

where the linear gain is

Gl = T−10

[A12

A22 − As22

], (43)

J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465 455

the nonlinear gain is

Gn = ||D2||T−10

[0

Ip

](44)

and

v =

⎧⎪⎨⎪⎩

−ρ(t, y, u)P2Ce

||P2Ce|| if Ce /= 0

0 otherwise

. (45)

Here, the robust SM Observer (42)–(45) will be used, by emulation, not only to estimate the states, but also to detect,diagnose and accommodate the computation time delay fault, as seen in the next section. �

5. Fault detection and controller adaptation

In the proposed scheme it is assumed that a system without computation time delay is an unfaulty system and that asystem with computation time delay is a faulty system, which should be identified and the controller should be adaptedin order to improve the performance and the relative stability.

5.1. Accumulated residuals

The available discrete-time output of the actual plant yk ∈ �p is compared with the outputs of the sliding modeobservers. Two SM Observers are used: in the structure of the first one it is supposed that the controlled system iswithout computation time delay, providing the output yo

k ∈ �p and the states xok ∈ �n; in the other observer it is assumed

that the computation time delay is present, providing the discrete-time output yhk ∈ �p and the states xh

k ∈ �n.Here, the accumulated residual discrete-time functions are defined as

rok =

k∑i=1

||yoi − yi|| (46)

and

rhk =

k∑i=1

||yhî − yi||. (47)

5.2. Computation time delay fault diagnosis

The slope of the accumulated residual functions in the sample time k is defined as

�rok = ro

k − rok−1 (48)

and

�rhk = rh

k − rhk−1. (49)

The accumulated residual function with the smallest slope indicates the actual condition of the system. Thus, thefault diagnosis can be formulated as:

(i) If �rok < �rh

k , (50)

then the actual system is operating without computation time delay, i.e., under unfault condition.

(ii) If �rok > �rh

k , (51)

then the actual system is operating with computation time delay, i.e., under fault condition.

456 J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465

5.3. Controller adaptation

The controller adaptation can be switched as the following logic:

(i) If condition (50) holds, use the controller DSMC, Eq. (14);(ii) If condition (51) holds, use the controller DSMC-h, Eq. (29).

Defining

rk = �rok − �rh

k , (52)

then, the decision function to adapt the controllers to the fault/unfault condition is chosen as{if rk > 0 ⇒ controller DSMC-h should be activated

if rk ≤ 0 ⇒ controller DSMC should be activated. (53)

Fig. 1 illustrates the scheme used in Section 7 for the computing simulation of the proposed fault detection andcontroller adaptation. The next section presents the mathematical model of Rotary Motion Inverted Pendulum Systemused as example for the design procedures and to show the effectiveness of the method.

6. Rotary Motion Inverted Pendulum System

Consider the system shown in Fig. 2, where a simplified model of the Rotary Motion Inverted Pendulum Systemis presented. The Rotary Motion Inverted Pendulum is a nonlinear unstable system. Thus, it is a perfect plant fordemonstrations of automatic control techniques [4,20].

For the configuration, as seen in Fig. 2, the base of the pendulum is coupled to a horizontal link via a pin joint.The angle of the pendulum is α. The horizontal link is coupled either directly or via gearing to the motor shaft, hencegiving it rotating motion. The angular position of the rotary link is θ. The input of the system is the torque T appliedby a motor. Jb is the total inertia after gearbox including arm, mp is the pendulum mass, r is the length of the arm, θ isthe arm angle and α is the pendulum angle. Note that lp is half of the actual length of the pendulum (lp = 0.5 Lp).

The Quanser’s Rotary Motion Inverted Pendulum Manual [20] provides the mathematical model used in this work.The nonlinear dynamics equations, representing the behavior of the pendulum, are

(mpr2 + Jb)θ + mprαlp cos(α) − mprα2lp sin(α) = T

mplp cos(α)θr − mplp sin(α)αθr + mpαl2p − mpglp sin(α) = 0. (54)

This model is based on a torque T applied to the arm. In the real system, however, it is voltage driven. The controltorque T as a function of the tension V, in volts, is

T = VKmKg

R− K2

mK2g

Rθ. (55)

The values of these parameters are given in Table 1 [20].After linearising the system in the equilibrium point

[θ α θ α

] = [0 0 0 0

], the linear continuous

dynamics equations results in⎡⎢⎢⎢⎢⎢⎢⎣

θ

α

θ

α

⎤⎥⎥⎥⎥⎥⎥⎦

=

⎡⎢⎢⎢⎢⎢⎢⎣

0 0 1 0

0 0 0 1

0 −mprg/Jb 0 0

0 g(mpr2 + Jb)/lpJb 0 0

⎤⎥⎥⎥⎥⎥⎥⎦

⎡⎢⎢⎢⎢⎢⎢⎣

θ

α

θ

α

⎤⎥⎥⎥⎥⎥⎥⎦

+

⎡⎢⎢⎢⎢⎢⎣

0

0

1/Jb

−r/Jblp

⎤⎥⎥⎥⎥⎥⎦ T. (56)

J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465 457

Fig. 1. Schematic model for fault detection and controller adaptation used for computational simulations.

Table 1Values of the parameters.

Parameter Symbol Value Units

Motor torque constant Km 0.00767 N m/AMotor armature resistance R 2.6 �

Total gear ratio Kg 60.5 –Total inertia after gearbox including arm Jb 0.0044 kg m2

Pendulum true length Lp 0.43 mPendulum mass mp 0.14 kgArm length r 0.2 mGravity g 9.81 m/s2

458 J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465

Fig. 2. Simplified model of the Rotary Motion Inverted Pendulum.

Substituting Eq. (55) into Eq. (56) and inserting the parameters values from Table 1, it results in

⎡⎢⎢⎢⎢⎢⎣

θ

α

θ

α

⎤⎥⎥⎥⎥⎥⎦ =

⎡⎢⎢⎢⎢⎢⎢⎣

0 0 1 0

0 0 0 1

0 −67.4 −25.6 0

0 112.8 25.6 0

⎤⎥⎥⎥⎥⎥⎥⎦

⎡⎢⎢⎢⎢⎢⎢⎣

θ

α

θ

α

⎤⎥⎥⎥⎥⎥⎥⎦

+

⎡⎢⎢⎢⎢⎢⎣

0

0

47.4

−47.4

⎤⎥⎥⎥⎥⎥⎦ V

α

]=

[1 0 0 0

0 1 0 0

]⎡⎢⎢⎢⎢⎢⎢⎣

θ

α

θ

α

⎤⎥⎥⎥⎥⎥⎥⎦

. (57)

7. Simulations

In the simulations the main objective is to control the Rotary Motion Inverted Pendulum, even in the presence ofcomputation time delay faults. The numerical integration of the nonlinear model Eq. (54) and the algorithm shown inFig. 1 are performed in the SIMULINK® and MATLAB® [23].

7.1. Numeric values and adopted conditions

It was assumed that only the plant output was available, which are the arm angle θ and the pendulum angle α. Thestates are obtained by estimation using the robust sliding mode observer (42). In the simulations the arm angle θ has asquare wave as reference signal. This type of signal was used because it is useful to test control robustness due to itsinstantaneous variations.

The inherent operational condition of the digital controller was simulated as shown in Table 2. The unfault caseindicates that there is no computation time delay, therefore the system should be controlled by DSMC, Eq. (14). The

J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465 459

Table 2Inherent condition fault.

Time (s) 0 ≤ t < 20 20 ≤ t < 40 40 ≤ t < 60 60 ≤ t < 80 80 ≤ t < 100 100 ≤ t < 120

Condition Unfault With fault Unfault With fault Unfault With faultDelay 1 0 0.050 0 0.050 0 0.050Delay 2 0 0.038 0 0.038 0 0.038

fault condition indicates that there is a computation time delay, thus the system should be controlled by DSMC-h, Eq.(29). For a sample time of 0.06 s, two delay values were simulated as: 0.050 and 0.038 s.

For continuous sliding mode observer design the continuous-time linearised model was used (57). For DSMC andDSMC-h control design the corresponding discrete-time model was used, with a sample time of 0.06 s, that is

� =

⎡⎢⎢⎢⎢⎢⎢⎣

1.0000 −0.0891 0.0355 −0.0019

0 1.1742 0.0250 0.0636

0 −2.6096 0.2957 −0.0891

0 5.5228 0.7327 1.1742

⎤⎥⎥⎥⎥⎥⎥⎦

� = [0.0528 −0.0539 1.5178 −1.5789

]T

.

Matrix G, used in control (14) and (29), was calculated for sliding poles, Eq. (6), placed [3,10] in{ 0.5488 0.7408 0.8353 }. The numeric values of matrix G are:

G = [−1.2974 −8.2335 −0.8216 −1.1853].

The gain values of SM Observer, Eqs. (43) and (44), are

Gl =

⎡⎢⎢⎢⎢⎢⎢⎣

80.0 0

0 82.0

4894.2 1484.6

0 6837.4

⎤⎥⎥⎥⎥⎥⎥⎦

, Gn =

⎡⎢⎢⎢⎢⎢⎢⎣

1.0 0

0 1.0

61.1776 18.9275

0 82.0000

⎤⎥⎥⎥⎥⎥⎥⎦

.

All these numeric values were obtained using MATLAB® commands [23]. The detailed steps for the calculation ofGl and Gn can be found in [5].

7.2. Simulation results for a sample time of 0.06 s and computation time delay of 0.050 s

The sampling interval used was of 0.06 s and the computation time delay was of 0.050 s for fault condition. Thenumeric values of the matrix Γ 1 used in DSMC-h (29) are

�1 = [0.0384 −0.0391 1.3513 −1.3904

]T

The results of the simulations with initial conditions[θ α θ α

] = [0 0 0 0

]are shown in Figs. 3 and 4.

The dotted lines in Fig. 3a shows the reference signal used for arm angle; a square wave. The solid line represents theactual arm angle θ, which tracks the reference when the system is fault-free. When the fault is present the behavior ofthe arm angle is deteriorated, but the system still remains stable. Fig. 3b shows the actual pendulum angle α. Fig. 4ashows the control input. The corresponding sliding surface is given in Fig. 4b.

Fig. 5a shows the accumulated residual curves rok and rh

k . It can be noticed that when the system operates withdelay, the slope of the rh

k curve is smaller than the slope of the rok curve. On the other hand, when the system works

without delay, the slope of the rok curve is smaller than the slope of the rh

k curve. Fig. 5b shows the decision func-tion rk and Fig. 5c shows the active controller at each interval of time: when the system operates with delay, the

460 J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465

Fig. 3. Active fault detection and controller adaptation: reference signal, arm angle and pendulum angle for sampling interval 0.06 s and delay 0.05 s.

Fig. 4. Active fault detection and controller adaptation: control signal and sliding surface for sampling interval 0.06 s and delay 0.05 s.

J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465 461

Fig. 5. Accumulated residual curves, decision function and active controller for sampling interval 0.06 s and delay 0.05 s.

controller DSMC-h is active; when the system works without delay, the controller DSMC is active. The DSMC/DSMC-h controllers were adequately switched by the proposed detection/adaptation scheme for each unfault/faultcondition.

For comparison purposes, Fig. 6 shows the behavior of the system without the proposed detection and adaptationscheme: the system is unstable when the delay is present.

7.3. Simulation results for sample time of 0.06 s and computation time delay of 0.038 s

The sampling interval used was of 0.06 s and the computation time delay was of 0.038 s for fault condition.The numeric values of the matrix �1 used in DSMC-h (29) are

�1 = [0.0236 −0.0238 1.1190 −1.1397

]T.

The results of the simulations with initial conditions[θ α θ α

] = [0 0 0 0

]are shown in Figs. 7 and 8.

The dotted lines in Fig. 7a show the reference signal used for arm angle; a square wave. The solid line represents theactual arm angle θ, which tracks the reference even when the fault is present. Fig. 7b shows the actual pendulum angleα. Fig. 8a shows the control input. The corresponding sliding surface is given in Fig. 8b.

Fig. 9a shows the accumulated residual curves rok and rh

k . It can be noticed that, when the system operates withdelay, the slope of the rh

k curve is smaller than the slope of the rok curve. On the other hand, when the system works

without delay, the slope of the rok curve is smaller than the slope of the rh

k curve. Fig. 9b shows the decision functionrk and Fig. 9c shows the active controller at each interval of time: when the system operates with delay, the controllerDSMC-h is active; when the system works without delay, the controller DSMC is active. Again, the DSMC/DSMC-hcontrollers were adequately switched by the proposed detection/adaptation scheme for each unfault/fault condition.The proposed scheme provided a good performance to the rotary pendulum.

For comparison purposes Fig. 10 shows the performance of the system without the proposed detection and adaptationscheme: instability when the delay is present.

462 J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465

Fig. 6. Inactive scheme of fault detection and controller adaptation: instability.

Fig. 7. Active fault detection and controller adaptation: reference signal, arm angle and pendulum angle for sampling interval 0.06 s and delay0.038 s.

J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465 463

Fig. 8. Active fault detection and controller adaptation: control signal and sliding surface for sampling interval 0.06 s and delay 0.038 s.

Fig. 9. Accumulated residual curves, decision function and active controller for sampling interval 0.06 s and delay 0.038 s.

464 J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465

Fig. 10. Inactive scheme of fault detection and controller adaptation: instability when the fault is present.

8. Conclusions

In this paper the computation time delay in a digital control system was treated as a fault to be detected and thecontrollers were adapted to improve the performance of the faulty system. For this purpose, two sliding mode controldesigns were presented: a discrete-time sliding mode control that does not consider computation time delay (DSMC)was reviewed [9] and a new discrete-time sliding mode controller which takes into account the computation time delay(DSMC-h) was presented. It was proven that the proposed discrete-time control DSMC-h presents robustness withrespect to certain uncertainty classes and to computation time delay.

Also, a strategy for fault detection and controller adaptation was presented, based on the slope of the accumulatedresidual functions.

Simulations in the Rotary Motion Inverted Pendulum System were presented. The obtained results proved therobustness of the proposed DSMC-h design and the effectiveness of the fault detection and controller adaptationstrategy. The proposed scheme showed a good performance, even for larger values of computation time delay anduncertainties.

In the present work a robust continuous-time sliding mode observer was used in the proposed method of detectionand accommodation of computation time delay fault. Discrete-time observer designs [14] can also be used to operatewith DSMC and DSMC-h controllers.

Acknowledgements

This research was supported by the Brazilian agency FAPESP; under contracts no. 06/58850-6 and 07/53010-2.The authors would like to thank the Associate Editor and the reviewers for their valuable comments.

References

[1] P.J. Antsaklis, A.N. Michel, Linear Systems, McGraw-Hill, 1997.[2] R. Bellman, Introduction to Matrix Analysis, Mcgraw-Hill Book Company, New York, 1960.

J.P.F. Garcia et al. / Mathematics and Computers in Simulation 80 (2009) 449–465 465

[3] R.A. DeCarlo, S.H. Zak, G.P. Mathews, Variable structure control of multivariable systems: a tutorial, in: Proceeding of the Institute of Electricaland Electronics Engineers, vol. 76, 1988, pp. 212–232.

[4] J. Driver, D. Thorpe, Design, Build and Control of a Single/Double Rotational Inverted Pendulum, The University of Adelaide, School ofMechanical Engineering, Australia, 2004.

[5] C. Edwards, S.K. Spurgeon, On the development of discontinuous observers, International Journal of Control 59 (5) (1994) 1211–1229.[6] P.M. Frank, Fault diagnosis in dynamic systems using analytical and knowledge-based redundancy—a survey and some new results, Automática

26 (1990) 459–474.[7] K. Furuta, Sliding mode control of a discrete system, Systems & Control Letters 14 (1990) 145–152.[8] L.M.C.F. Garcia, J.F. Bennaton, Sliding mode control for uncertain input-delay systems with only plant output access, in: Proceeding of the

7th International Workshop on Variable Structure Systems, Sarajevo, Bosnia and Herzegovina, 2002, pp. 175–184.[9] J.P.F. Garcia, J.M.S. Ribeiro, J.J.F. Silva, E.S. Martins, Continuous-time and discrete-time sliding mode control accomplished using a computer,

Control Theory and Applications 152 (2005) 220–228.[10] J. Guo, X. Zhang, Advance in discrete-time sliding mode variable structure control theory, in: Proceedings of the 4th World Congress on

Intelligent Control and Automation, vol. 2, 2002, pp. 878–882.[11] S. Janardhanan, B. Bandyopadhyay, V.K. Takar, Discrete-time output feedback sliding mode control for time-delay systems in uncertainty, in:

Proceeding of IEEE International Conference on Control Applications, 2004, pp. 1358–1363.[12] J. Jin, S. Ko, C. Ryoo, Fault tolerant control for satellites with four reaction wheels, Control Engineering Practice 16 (2008) 1250–1258.[13] A.J. Koshkouei, A.S.I. Zinober, Discrete-time sliding mode control design, in: Proceeding of the 13th IFAC World Congress G, 1996, pp.

481–486.[14] A.J. Koshkouei, A.S.I. Zinober, Sliding mode state observers for siso linear discrete-time systems, in: Proceedings of the International

Conference on Control, 1996, pp. 837–842.[15] S.M. Lee, B.H. Lee, A discrete-time sliding mode controller and observer with computation time delay Control Engineering Practice, vol. 7,

Pergamom, 1999, pp. 943–955.[16] G. Liu, B. Jiang, Y. Zhang, Sliding mode observer-based fault detection and isolation in flight control systems, in: Proceedings of the 16th

IEEE International Conference on Control Applications, Singapore, 2007, pp. 1049–1054.[17] M.S. Mahmoud, Robust Control and Filtering for Time-Delay Systems Control Engineering Series, Marcel Dekker Inc., New York, 2000.[18] J.S. Respondek, Approximate controllability of the nth order infinite dimensional systems with controls delayed by the control devices,

International Journal of Systems Science 39 (8) (2008) 765–782.[19] J.S. Respondek, Approximate controllability of infinite dimensional systems of the n-th order, International Journal of Applied Mathematics

and Computer Science 18 (2) (2008) 199–212.[20] Rotary Motion Inverted Pendulum—User’s Manual, Quanser Consulting Inc., Ontario, Canada, 2005.[21] S. Simani, R.J. Patton, Fault diagnosis of an industrial gas turbine prototype using a system identification approach, Control Engineering

Practice 16 (2008) 769–786.[22] S.K. Spurgeon, R. Davies, A nonlinear control strategy for robust sliding mode performance in the presence of unmatched uncertainty,

International Journal of Control 57 (5) (1993) 1107–1123.[23] Inc. The MathWorks, MATLAB User’s Guide, The MathWorks Inc., Natick, MA, USA, 2005.[24] V.I. Utkin, Sliding Modes and their Applications in Variable Structure Systems, Mir, Moscow, 1978.[25] L. Zadeh, C. Desoer:, Linear System Theory. The State Space Approach, McGraw-Hill, New York, 1963.