Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very...

40
Digital Control CSE421 Asst. Prof. Dr.Ing. Mohammed Nour A. Ahmed [email protected] https://mnourgwad.github.io Lecture 10: Discrete Controller Design (Deadbeat & Dahlin Controllers) Copyright ©2016 Dr.Ing. Mohammed Nour Abdelgwad Ahmed as part of the course work and learning material. All Rights Reserved. Where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. ζ =0.2 ✁☛ ζ =0.5 !0 =0.3π/T ✟✙ !0 =0.5π/T @ @R Zagazig University | Faculty of Engineering | Computer and Systems Engineering Department | Zagazig, Egypt

Transcript of Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very...

Page 1: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Digital ControlCSE421

Asst. Prof. Dr.Ing.

Mohammed Nour A. [email protected]

https://mnourgwad.github.io

Lecture 10: Discrete Controller Design(Deadbeat & Dahlin Controllers)

Copyright ©2016 Dr.Ing. Mohammed Nour Abdelgwad Ahmed as part ofthe course work and learning material. All Rights Reserved.Where otherwise noted, this work is licensed under a Creative CommonsAttribution-NonCommercial-ShareAlike 4.0 International License.

ζ = 0.2

&&

&&*

ζ = 0.5

!!

!)

!0 = 0.3π/T+++,

!0 = 0.5π/T

@@R

Zagazig University | Faculty of Engineering | Computer and Systems Engineering Department | Zagazig, Egypt

Page 2: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Lecture: 10

Discrete Controller Design (Deadbeat & Dahlin

Controllers)

Deadbeat controller

Dahlin controller

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 2 / 19

Page 3: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat Controller

Its aim is to bring the output to steady state in smallest number of time steps◮ assuming, for simplicity, that the set point is a step input.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 3 / 19

Page 4: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat Controller

Its aim is to bring the output to steady state in smallest number of time steps◮ assuming, for simplicity, that the set point is a step input.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 3 / 19

Page 5: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat Controller

Therefore, the desired closed-loop transfer function is

T (z) = z−k

, k ≥ 1

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 4 / 19

Page 6: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat Controller

Therefore, the desired closed-loop transfer function is

T (z) = z−k

, k ≥ 1

and the controller achieving this response is given by:

D(z) =1

GH(z)

T (z)

1− T (z)=

1

GH(z)

(

z−k

1− z−k

)

=1

GH(z)

(

1

zk − 1

)

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 4 / 19

Page 7: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat Controller

Therefore, the desired closed-loop transfer function is

T (z) = z−k

, k ≥ 1

and the controller achieving this response is given by:

D(z) =1

GH(z)

T (z)

1− T (z)=

1

GH(z)

(

z−k

1− z−k

)

=1

GH(z)

(

1

zk − 1

)

It is interesting to note that deadbeat control is equivalent to placing all closed-loop polesat z = 0.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 4 / 19

Page 8: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat Controller

Therefore, the desired closed-loop transfer function is

T (z) = z−k

, k ≥ 1

and the controller achieving this response is given by:

D(z) =1

GH(z)

T (z)

1− T (z)=

1

GH(z)

(

z−k

1− z−k

)

=1

GH(z)

(

1

zk − 1

)

It is interesting to note that deadbeat control is equivalent to placing all closed-loop polesat z = 0.

These poles correspond to the fastest response possible.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 4 / 19

Page 9: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat Controller

Therefore, the desired closed-loop transfer function is

T (z) = z−k

, k ≥ 1

and the controller achieving this response is given by:

D(z) =1

GH(z)

T (z)

1− T (z)=

1

GH(z)

(

z−k

1− z−k

)

=1

GH(z)

(

1

zk − 1

)

It is interesting to note that deadbeat control is equivalent to placing all closed-loop polesat z = 0.

These poles correspond to the fastest response possible.◮ Usually such requirement will come at the expense of large control signal.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 4 / 19

Page 10: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerExample

Example

The open-loop transfer function of a plant is given by:

G (s) =e−2s

10s + 1

Design a dead-beat digital controller for the system. Assume that T = 1 s.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 5 / 19

Page 11: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerExample

Example

The open-loop transfer function of a plant is given by:

G (s) =e−2s

10s + 1

Design a dead-beat digital controller for the system. Assume that T = 1 s.

The transfer function of the system with a ZOH is given by

GH(z) = Z

{

1− e−Ts

sG (s)

}

= (1− z−1)Z

{

e−2s

s(10s + 1)

}

= (1− z−1)z−2

Z

{

1

s(10s + 1)

}

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 5 / 19

Page 12: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerExample

From the z-transform tables

Z

{

a

s(s + a)

}

=z(1− e

−aT )

(z − 1)(z − e−aT )

So, GH(z) = (1− z−1)z−2

Z

{

0.1

s(s + 0.1)

}

= (1− z−1)z−2 z(1− e

−0.1)

(z − 1)(z − e−0.1)

=0.095

z3 − 0.904z2

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 6 / 19

Page 13: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerExample

From the z-transform tables

Z

{

a

s(s + a)

}

=z(1− e

−aT )

(z − 1)(z − e−aT )

So, GH(z) = (1− z−1)z−2

Z

{

0.1

s(s + 0.1)

}

= (1− z−1)z−2 z(1− e

−0.1)

(z − 1)(z − e−0.1)

=0.095

z3 − 0.904z2

Hence, the dead-beat controller is given by:

D(z) =1

GH(z)

T (z)

1− T (z)=

z3 − 0.904z2

0.095

(

1

zk − 1

)

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 6 / 19

Page 14: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerExample

For realizability, we must choose k ≥ 3.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 7 / 19

Page 15: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerExample

For realizability, we must choose k ≥ 3.

Choosing k = 3, we obtain the controller:

D(z) =z3 − 0.904z2

0.095

1

z3 − 1=

z3 − 0.904z2

0.095(z3 − 1)

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 7 / 19

Page 16: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerExample

For realizability, we must choose k ≥ 3.

Choosing k = 3, we obtain the controller:

D(z) =z3 − 0.904z2

0.095

1

z3 − 1=

z3 − 0.904z2

0.095(z3 − 1)

With this controller, the block diagram of the closed-loop is:

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 7 / 19

Page 17: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerExample

For realizability, we must choose k ≥ 3.

Choosing k = 3, we obtain the controller:

D(z) =z3 − 0.904z2

0.095

1

z3 − 1=

z3 − 0.904z2

0.095(z3 − 1)

With this controller, the block diagram of the closed-loop is:

To analyze the designed system performance, we simulate the closed-loop step responseand the control signal.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 7 / 19

Page 18: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerMATLAB code for Example

1 % Deadbeat control: D(z) = (z^3 - 0.904 z^2) / (0.095 (z^3 - 1))

23 Gp = tf(1 ,[10 1],'iodelay ' ,2);

4 Gpd = c2d(Gp ,1);

5 Gc = tf([1 -0.904 0 0] ,[0.095 0 0 -0.095] ,1);

6 Gcl=Gc*Gpd /(1+Gc*Gpd);

7 t=0:1:10;

8 y=step(Gcl ,t)

9 figure; plot(t,y,'o'); hold on; stairs(t,y); hold off

10 xlabel('time , t'), ylabel('output , y'), axis ([0 10 0 1.2]) ,title('Step

response ')

1112 Gru=Gc/(1+Gc*Gpd);

13 u=step(Gru ,t)

14 figure; plot(t,u,'o'); hold on; stairs(t,u); hold off

15 xlabel('time , sec'), ylabel('control signal , u'), axis ([0 10 0 15]), title('

Control signal ')

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 8 / 19

Page 19: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerExample

As desired, the step response is unity after 3 seconds.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 9 / 19

Page 20: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerExample

As desired, the step response is unity after 3 seconds.It is, however, important to realize that the response is correct only at the samplinginstants and the response can have an oscillatory behavior between samples.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 9 / 19

Page 21: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerExample

We realize that the magnitude of the control signal is very large at the beginning (≈ 11).

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 10 / 19

Page 22: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Deadbeat ControllerExample

We realize that the magnitude of the control signal is very large at the beginning (≈ 11).

The main drawback of dead-beat control is that it requires excessive (large) control effortswhich may not be acceptable in practice.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 10 / 19

Page 23: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin Controller

Dahlin1 controller is a modification of the deadbeat controller which produces anexponential response that is smoother than deadbeat response.

1Eric Dahlin worked for IBM in San Jose then for Measurex in Cupertino.Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 11 / 19

Page 24: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin Controller

Dahlin1 controller is a modification of the deadbeat controller which produces anexponential response that is smoother than deadbeat response.

The desired closed-loop response for step input looks like:

1Eric Dahlin worked for IBM in San Jose then for Measurex in Cupertino.Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 11 / 19

Page 25: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin Controller

Hence, the desired closed-loop transfer function is:

Gcl(s) =e−Ls

τs + 1

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 12 / 19

Page 26: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin Controller

Hence, the desired closed-loop transfer function is:

Gcl(s) =e−Ls

τs + 1

As step input is assumed (which is constant between samples), the desired closed-looptransfer function in the z-domain will be:

T (z) = Z{Gzoh(s) Gcl(s)} = Z

{

1− e−Ts

s

e−Ls

τs + 1

}

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 12 / 19

Page 27: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerExample

Example

The open-loop transfer function of a plant is given by:

G (s) =e−2s

10s + 1

Design a Dahlin digital controller for the system to achieve a closed-loop time constant of 5 s.Assume that T = 1 s.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 13 / 19

Page 28: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerExample

First, we need to find the z-transform of the process (preceded by a ZOH). From theprevious example, this is found to be:

GH(z) =0.095

z3 − 0.904z2

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 14 / 19

Page 29: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerExample

First, we need to find the z-transform of the process (preceded by a ZOH). From theprevious example, this is found to be:

GH(z) =0.095

z3 − 0.904z2

Second, we need to find the z-transform of the desired closed-loop transfer function, T (z).

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 14 / 19

Page 30: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerExample

First, we need to find the z-transform of the process (preceded by a ZOH). From theprevious example, this is found to be:

GH(z) =0.095

z3 − 0.904z2

Second, we need to find the z-transform of the desired closed-loop transfer function, T (z).

As the desired closed-loop time constant, τ , is 5 sec,

T (s) =e−Ls

5s + 1

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 14 / 19

Page 31: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerExample

Therefore,

T (z) = Z

{

1− e−sT

s

e−Ls

5s + 1

}

= (1− z−1)z−L/T

Z

{

1

s(5s + 1)

}

= (1− z−1)z−k

Z

{

0.2

s(s + 0.2)

}

= (1− z−1)z−k

z(1− e−0.2T )

(z − 1)(z − e−0.2T )

= z−k

(0.181)

(z − 0.819)

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 15 / 19

Page 32: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerExample

Therefore,

T (z) = Z

{

1− e−sT

s

e−Ls

5s + 1

}

= (1− z−1)z−L/T

Z

{

1

s(5s + 1)

}

= (1− z−1)z−k

Z

{

0.2

s(s + 0.2)

}

= (1− z−1)z−k

z(1− e−0.2T )

(z − 1)(z − e−0.2T )

= z−k

(0.181)

(z − 0.819)

The Dahlin controller is thus given by:

D(z) =1

G (z)

T (z)

1− T (z)

=z3 − 0.904z2

0.095

z−k (0.181)

(z−0.819)(

1− z−k (0.181)(z−0.819)

)

=z3 − 0.904z2

0.095

0.181z−k

z − 0.819− 0.181z−k

=0.181z3−k − 0.164z2−k

0.095z − 0.078− 0.017z−k.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 15 / 19

Page 33: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerExample

For the controller to be realizable: degree of numerator must be ≤ degree of denominator

3− k ≤ 1 ⇒ k ≥ 2

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 16 / 19

Page 34: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerExample

For the controller to be realizable: degree of numerator must be ≤ degree of denominator

3− k ≤ 1 ⇒ k ≥ 2

Choosing k = 2, the controller is, then, given by:

D(z) =0.181z − 0.164

0.095z − 0.078− 0.017z−2=

0.181z3 − 0.164z2

0.095z3 − 0.078z2 − 0.017

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 16 / 19

Page 35: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerExample

For the controller to be realizable: degree of numerator must be ≤ degree of denominator

3− k ≤ 1 ⇒ k ≥ 2

Choosing k = 2, the controller is, then, given by:

D(z) =0.181z − 0.164

0.095z − 0.078− 0.017z−2=

0.181z3 − 0.164z2

0.095z3 − 0.078z2 − 0.017

Using the designed controller, the closed-loop step response and control signal aresimulated next.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 16 / 19

Page 36: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerMATLAB code for Example

1 Gp = tf(1 ,[10 1],'iodelay ' ,2);

2 Gpd = c2d(Gp ,1);

3 Gc = tf ([0.181 -0.164 0 0] ,[0.095 -0.078 0 -0.017] ,1);

4 Gcl=Gc*Gpd /(1+Gc*Gpd);

5 t=0:1:30;

6 y=step(Gcl ,t);

78 figure; plot(t,y,'o',t,y)

9 xlabel('time , t'), ylabel('output , y')

10 axis ([0 30 0 1.2])

11 title('Step response ')

1213 Gru=Gc/(1+Gc*Gpd);

14 u=step(Gru ,t)

1516 figure; plot(t,u,'o'); hold on; stairs(t,u); hold off;

17 xlabel('time , sec'), ylabel('control signal , u')

18 axis ([0 30 0 5])

19 title('Control signal ')

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 17 / 19

Page 37: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerExample step response

the response is exponential as designed but slower than deadbeat control.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 18 / 19

Page 38: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerExample step response

the response is exponential as designed but slower than deadbeat control.

What is the time delay? time constant?

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 18 / 19

Page 39: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Dahlin ControllerExample step response

the maximum control signal magnitude (≈ 1.9) is much smaller than the control signalobtained using a deadbeat controller (≈ 11). This is more acceptable in practice.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 19 / 19

Page 40: Digital Control - CSE421 - GitHub PagesWe realize that the magnitude of the control signal is very large at the beginning (≈ 11). The main drawback of dead-beat control is that it

Thanks for your attention.

Questions?

Asst. Prof. Dr.Ing.

Mohammed Nour A. [email protected]

https://mnourgwad.github.ioRobotics Research Interest Group (zuR2IG)Zagazig University | Faculty of Engineering |

Computer and Systems Engineering Department| Zagazig, Egypt

Copyright ©2016 Dr.Ing. Mohammed Nour Abdelgwad Ahmed as part of the course work and learning material. All Rights Reserved.Where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Mohammed Ahmed (Asst. Prof. Dr.Ing.) Digital Control 20 / 19