Prof. Wahied Gharieb Ali Abdelaal

Post on 31-Dec-2015

51 views 0 download

description

Faculty of Engineering Computer and Systems Engineering Department Master and Diploma Students. CSE 502: Control Systems(1) Topic#2 Mathematical Tools for Analysis. Prof. Wahied Gharieb Ali Abdelaal. Outline. Ordinary Differential Equations (ODE) Laplace Transform and Its Inverse - PowerPoint PPT Presentation

Transcript of Prof. Wahied Gharieb Ali Abdelaal

Prof. Wahied Gharieb Ali Abdelaal

CSE 502: Control Systems(1)

Topic#2

Mathematical Tools for Analysis

Faculty of EngineeringComputer and Systems Engineering Department

Master and Diploma Students

2

Outline

• Ordinary Differential Equations

(ODE)

• Laplace Transform and Its Inverse

• Laplace Transform Properties

• Sampling and Digital Systems

• Selection of Sampling Frequency

• Z-Transform and Its Properties

• Summary

3

Ordinary Differential Equations (ODE)

• An ordinary differential equation of order n is given by:

)()(y)(ydt

d...)(y

dt

d)(y

dt

d011-n

1-n

1n

n

tftatatat n

• Example:

Second order linear ordinary differential equation.

It is convenient to define the differential operators:

and

1)(y6)(ydt

d3)(y

dt

d2

2

ttt

dt

dD

n

n

dt

dnD

4

Characteristic Polynomial & Characteristic Equation

• The polynomial: is called the Characteristic Polynomial and the equation :

is called the characteristic equation

0

1

1

1

1 ... aDaDaD n

n

n

0... 0

1

1

1

1 aDaDaD n

n

n

The characteristic polynomial is D2 +3D +2.The characteristic equation is D2+3D+2=0(D+2)(D+1)=0. The roots are D1=-2 & D2=-1

u y2ydt

d3y

dt

d2

2

Example:

Ordinary Differential Equations (ODE)

5

Solution of Linear Ordinary Differential Equation

The solution of a differential equation contains two parts:• Free response• Forced response

The free response; is the solution of the differential equation when the input is zero.

The forced response ; is the solution of the differential equation when all initial conditions are zero.

The total response is the sum of the free response and the forced response.

Ordinary Differential Equations (ODE)

6

Example

The free response (y1)D2 + 3D +2 =0 (D+2)(D+1)=0

D=-1 ; D=-2

)(y2ydt

d3y

dt

d2

2

tf 0y(0) 1dt

dy(0)

-2t2

-t11 eA eA(t)y

The forced response (y2) depends on the forcing function f(t).If f(t)= cos t y2(t) = A1 cos t + A2 sin t

f(t)= t2 y2(t) = A1 + A2t + A3t2

f(t)= te-t y2(t) = A1 e-t + A2 te-t

f(t)= et y2(t) = Aet

The above forms will usually work if the forcing function is not a part of the free response !

Ordinary Differential Equations (ODE)

7

• In this example, f(t) = -4e-3t y2(t)= Ae-3t because

te 32

2

4 y2ydt

d3y

dt

d

• The total response y(t)= y1(t) + y2(t)

• We have to find A , A1 and A2 satisfying the differential equation and the initial conditions

9Ae-3t –9Ae-3t +2Ae-3t = -4e-3t A=-2

y2(t)=-2e-3t

Ordinary Differential Equations (ODE)

8

• Using initial conditions to find A1 and A2 y(0)=0 A1+A2-2=0 A1=2-A2

ý(0)= 1 -A1-2A2+6=1 A1=-1 and A2=3

y(t)= -e-t + 3e-2t - 2e-3t

• The total response y(t)= -2e-3t + A1e-t

+ A2e-2t

Ordinary Differential Equations (ODE)

Example

The free response (y1)

D2 + D +1/2 =0 Complex poles

D1,2= -1/2 j1/2

t2

1y

2

1y

dt

dy

dt

d2

2

1y(0) 2

1dt

dy(0)

tAtAety

t

2

1sin

2

1cos)( 21

2

1

1

9

Ordinary Differential Equations (ODE)

Forced response

Since f(t)=1/2t y2(t)=B1+B2t

0+B2 +1/2B1 +1/2B2t =1/2t B1=-2 and B2=1

y2(t)=-2+t

ty

2

1y

2

1

dt

dy

dt

d2

2

2

2

2

10

Ordinary Differential Equations (ODE)

11

Laplace Transform

Given a real function f(t) that satisfies

Laplace Transform of f(t) is defined as :

Where F(s) = L[f(t)] or f(t) = L-1[F(s)]

0

)( dtetf t

0

)]([)()( tfLdtetfsF st

Definition

12

Laplace Transform

1. f(t) = (t) = impulse signal defined by:

where for t0,

otherwise

s

edt

etL

sst

1)]([

0

11

lim)]([0

s

etL

s

)(lim)()(0

tttf

1)( t

0)( t

Examples

1)]([ tL

13

2. f(t) = u(t) = Unit Step

01)( ttu

00)( ttu

ss

edtetuLsF

st

st 1][)]([)( 00

stuL

1)]([

s

ettuL

stuL

st0

)]([1

)]([ 0

A shift in the time domain is equivalent to an exponential term in the s-plane.

Laplace Transform

14

3. f(t) = t u(t) = Ramp Function

0tt

00 t

2000

11][

1)]([)(

sdte

ste

sdttettuLsF ststst

Laplace Transform

se

sdteettuLsF tsstt 1

][1

)]([)( 0)(

0

4. Exponential Function f(t)=e-t u(t)

15

][sin][cos][)( tLjtLeLsF tj

5. Sinusoidal Functions f(t) =

ejωtu(t)

222222

1][

s

js

s

s

js

jseL tj

22][cos

s

stL

22][sin

s

tL

Laplace Transform

16

Laplace Transform

17

Laplace Transform

18

Laplace Transform

19

Laplace Transform

20

If the limit

exist

Initial Value Theorem

1.

F(s) has a pole of order 2 at zero and theorems can not be

applied.

)()( limlims0t

ssFtf

Provided that sF(s) does not have any

poles on the j axis and in the right half s-

plane

Final Value Theorem)()( limlim

0st

ssFtf

Examples

)3(2s

2sF

2

ss

2. ; No poles in the right half s-plane

(Stable).

)6(

3sF

2

sss

2

1

6

3)()(

20s0st

limlimlim

ss

ssFtf

Initial and Final Value Theorems

21

Inverse Laplace Transform using Partial Fraction Expansion

The inverse Laplace Transform does not relay on the use of the inversion Integral. Rather the inverse Laplace transform operation involving rational functions can be carried out using a Laplace Transform table and Partial fraction expansion. f(t)=L-1[F(s)]

Suppose that all poles of the transfer function are simple

)2()1()1)(2(

3s

23

3ssF

2

s

B

s

A

ssss

2)2(

)3()()1(A

1

1

s

s s

ssFs

1)1(

)3()()2(

2

2

s

s s

ssFsB

)2(

1

)1(

2sF

ss

From the Laplace Transform

Table,

tt ee 22tf

Inverse Laplace Transform

22

Example

Consider

:

)2()1()1)(2(

52

)23(

52sF

2

s

C

s

B

s

A

sss

ss

sss

ss

The first term is the steady-state solution; the last two

terms represent the transient solution. Unlike the

classical method, which requires separate steps to give the

transient and the steady state solutions, the Laplace

transform method gives the entire response.

02

35

2

5tf 2 tee tt

2

3;5;

2

5 CBA

By tacking the inverse Laplace transform of this

equation, we get the complete solution as:

Inverse Laplace Transform

23

Example

Inverse Laplace Transform

24

Example

Inverse Laplace Transform

25

Inverse Laplace Transform

26

f(t) F(s)

1. δ(t) 1

2. u(t)

3. t u(t)

4. tn u(t)

5. e-at u(t)

6. sin t u(t)

7. cos t u(t)

s

1

2

1

s

1

!ns

n

as 1

22 s

22 s

s

Laplace Transform of Basic Functions

27

Laplace Transform Properties

28

Laplace Transform Properties

29

Laplace Transform Properties

30

Sampling and Digital Systems

31

Advantages of digital control

Hardware is replaced by software, which is costly-effective

Complex function can be implemented in software so easily

rather than hardware

Reliability in implementation, that means, you can simply

modify the control function in software without extra cost.

Computers can be used in data logging (monitoring),

supervisory control and can control multiple loop

simultaneously as the computers are well fast.

Sampling and Digital Systems

32

Sampling and Digital Systems

33

Sampling and Digital Systems

34

Sampling and Digital Systems

35

Sampling and Digital Systems

36

Digital controllers could take one of the forms:• A computer or simply microprocessor board. Once they have developed and started to be manufactured commercially, digital controllers are developed.• Microcontroller is a microprocessor system on chip as a single integrated circuit. It is used in embedded control applications such as TV, mobile phones, Air conditioner, Video Camera, Hard disk controllers, Robots, Smart car manufacturing, ...etc. It is used for a limited number of I/O signals in real time applications.• Programmable logic controller (PLCs). PLC can handle a very large number of I/O signals (as hundreds or thousands) in industrial control applications. It has a standard interfaces with the field measurements. The PLC technology replaces the old hardwired control (relay logic control) cabinets in the industry.

Sampling and Digital Systems

37

The analog signal is a continuous representation of a signal, that it takes different values with time. Digital signals have two values only or two level corresponding to logic 1 and logic zero

Sampling and Digital Systems

38

The ADC requires three operations in sequence:

1- Sampling, we need to sample the analog signal at a constant rate. The sampler could be an electronic switch. The critical question is how to select the sampling frequency.

2- Holding, that holds the sample in during the sampling period until a new sample is captured. This is necessary to convert a constant value into digital word.

3- Conversion, it is often sequential circuit that takes a considerable time to convert the holding sample into digital word.

Sampling and Digital Systems

39

Sampling and holding process

A/D Converters

n

VV

VVN 2

)(

)(

minmax

min

Digitized Value

Sampling and Digital Systems

40

Sampling and Digital Systems

41

DAC requires two operations in sequence:

1- DAC, in general is faster than ADC ones and easier in

implementation.

2- Holding, it is very difficult to apply the discrete signal that

outputs from DAC directly to an analog process. It will excite

the system and fatigue the actuator. Therefore, holding these

samples makes them in a continuous form (stepping levels).

Sampling and Digital Systems

42

Sampling and Digital Systems

43

It is imperative that an ADC's sample time is fast enough to capture

essential changes in the analog waveform. In data acquisition

terminology, the highest-frequency waveform that an ADC can

theoretically capture is called Nyquist frequency, which equals to

one-half of the ADC's sample frequency. Therefore, if an ADC circuit

has a sample frequency of 5000 Hz, the highest frequency waveform

will be the Nyquist frequency of 2500 Hz. If an ADC is subjected to

an analog input signal whose frequency exceeds the Nyquist

frequency for that ADC, the converter will output a digitized signal of

falsely low frequency.This phenomenon is known as aliasing effect.

Selection of Sampling Frequency

44

Selection of Sampling Frequency

45

Selection of Sampling Frequency

46

Aliasing Phenomenon

In practice, the sampling frequency = 10 *frequency bandwidth of the analog signal.

Selection of Sampling Frequency

47

The system bandwidth frequency is not the only limit to select the sampling frequency, there is also other constraints due to time considerations in ADC, DAC, and microprocessor to execute the control program. In general, the sampling period Ts to control a single loop can be selected using the following relationship:

1)/2 fB > (Ts > (TADC + Tμp +TDAC)

Where fB = frequency bandwidth of the analog signalTADC = conversion time of ADCTDAC = conversion time of DAC(can be ignored)Tμp = Execution time of the control program in

microprocessor, it depends the speed of microprocessor

Selection of Sampling Frequency

48

0 1 2 3 4 5 6 7 8 9 10-5

-4

-3

-2

-1

0

1

2

3

4

5

FourierTransform

F()

0-0

0 1 2 3 4 5 6 7 8 9 10

-5

-4

-3

-2

-1

0

1

2

3

4

5

Fs()

0-0-s s 2s-2s

0 1 2 3 4 5 6 7 8 9 100.5

1

1.5

2

2.5

3

3.5

4

Fs()

0-0-s s 2s-2s

Aliasing effect

Selection of Sampling Frequency

49

Preventing aliases Make sure your sampling frequency is greater than twice

of the highest frequency component of the signal. In practice, take it ten times the highest frequency component.

Pre-filtering of the analog signal

Set your sampling frequency to the maximum if possible

Selection of Sampling Frequency

50

Selection of Sampling Frequencyw

ith

ou

t p

re-

filt

erin

g

Wit

h p

re- fi

lter

ing

51

Z-Transform and Its Properties

52

Z-Transform and Its Properties

53

Z-Transform and Its Properties

54

Z-Transform and Its Properties

55

Z-Transform and Its Properties

56

Z-Transform and Its Properties

57

Z-Transform and Its Properties

58

Z-Transform and Its Properties

59

Z-Transform and Its Properties

60

Z-Transform and Its Properties

61

Inverse of Z-Transform

Z-Transform and Its Properties

62

Z-Transform and Its Properties

63

Z-Transform and Its Properties

64

Z-Transform and Its Properties

65

Inverse of Z-Transform

For simple poles of X(z) zk-1 at z=zi the corresponding residue K is given by

If X(z) zk-1 contains multiple pole of order q at z=zj the corresponding residue K is given by

Z-Transform and Its Properties

66

Examples

Z-Transform and Its Properties

67

Z-Transform and Its Properties

68

Z-Transform and Its Properties

69

Laplace transform is a necessary mathematical tool for analysis and design of continuous control systems

Z-Transform is a necessary mathematical tool for analysis and design of sampled and digital control systems

MATLAB/SIMULINK software is a powerful tool for analysis, simulation, and design for both continuous and digital control systems

Summary

70

In real time digital control applications, the sampling period is bounded by lower and upper limits

The lower sampling limit depends on the computational and conversion delays

The upper sampling limit depends on the frequency bandwidth of the sampled signals

Noise rejection in the measured signals by using low pass filter is necessary to avoid aliasing effect in the frequency spectrum

Summary