You are on page 1of 33

Discrete Controller

Design
Thanh Vo-Duy
Department of Industrial Automation
thanh.voduy@hust.edu.vn

Content
Digital Controllers
Dead-Beat Controller
Dahlin Controller
Microcontroller Implementation

PID Controller
Exercises

Prior to Lecture

Discrete-time System with analog reference input

Discrete-time System with digital reference input

Digital Controllers
Consider the Discrete-time System as

- Reference Input
- Error signal
- Output of the Controller
- Output of the System
- Digitized plant with Zero-order hold

Digital Controllers
The close-loop transfer function of the system


=

1 +

Desired transfer function

So, required controller

1

=
1

Digital Controllers
Dead-Beat Controller
Dead-Beat Controller: brings system to steady state
in the smallest number of time steps
= where 1

Digital Controller transfer function

1

1

=
=
1
1

(1)

Digital Controllers
Dead-Beat Controller
Example:
Design the Dead-Beat Controller for the
system given by
2
=
1 + 10
Assume that T = 1s

Digital Controllers
Dead-Beat Controller
Solution:
The transfer function of the system with ZOH:
1
1
=
() =
.

1 + 10

since T = 1s
From (1):

0.095 3
=
1 0.904 1

1

1 0.904 1
=
=

1
0.095 3 1

Digital Controllers
Dead-Beat Controller
Solution (cont.)
It can be chosen that 3. So, choose = 3
1 0.904 1 3
=
0.095 3 1 3

The controllers transfer function:


3 0.904 2
=
0.095 3 1

Digital Controllers
Dead-Beat Controller
Solution (cont.)

Step response of the system

Control signal

Digital Controllers
Dahlin Controller
Dahlin Controller: produces an exponential
response smoother than Dead-Beat.
Response of the system:
1
=
1 +

If =
=

1 1
1 1

Digital Controllers
Dahlin Controller
Closed-loop transfer function (unit step input):

=
=

1
1 1

1
1

1
1

1 1
1

Transfer function of required controller


1
=

1
1

Digital Controllers
Dahlin Controller
Example:
The open-loop transfer function of a plant:
2
=
1 + 10
assume that T = 1s
Design a Dahlin digital controller for the system
(lets choose = 10
note: 0.1 = 0.904)

Digital Controllers
Dahlin Controller
Solution

0.095 3
=
1 0.904 1
Choose = 10
1

=
1

1 0.904 1
1 1 0.1
=
.
3
0.095
1 0.1 1 1 0.1 1

Digital Controllers
Dahlin Controller
Solution (cont.)

1 0.904 1
0.095 1
=
.
3
0.095
1 0.904 1 0.095 1

Choose = 2, so

0.095 3 0.0858 2
=
0.095 3 0.0858 2 0.009

Digital Controllers
Dahlin Controller
Solution (cont.)

Digital Controllers
Microcontroller Implementation
Implement Dead-Beat Controller in the Example
3 0.904 2
=
0.095 3 1
Use Time Shifting property of z-Transform
+ =
= ()
Build computer equation for Controllers transfer
function
Implement the equation on specified MCU

Digital Controllers
Microcontroller Implementation
1. Build computer equation:


=

0.904 1 + 0.095 3
=
0.095

Digital Controllers
Microcontroller Implementation
2. Implement on MCU
Start

Initialization
uk=uk_1=uk_2=uk_3=0;
ek=ek_1=0;
rk=yk=0;

Calculate control value


uk=(ek-0.904ek_1+0.095uk_3)/0.095;

Send uk to ZoH (PWM)

Measure instant values


rk,yk

Update value
uk_3=uk_2;uk_2=uk_1;uk_1=uk;
ek_1=ek;

Calculate error
ek = rk yk;

Stop?

Yes
1

End

No

Digital Controllers
Microcontroller Implementation
Do the same work with Dahlin Controller

0.095 3 0.0858 2
=
0.095 3 0.0858 2 0.009

Digital Controllers
PID Controller
PID Proportional Integral Derivative controller
Proportional - (or ): error is multiplied by

High causes instability, Low gain causes drifting away

Integral - (or ): integral of error and multiplied


by
High causes oscillation, Low gain cause sluggish
response

Derivative - (or ): derivative of error and


multiplied by

High causes oscillation, Low gain cause sluggish


response

Digital Controllers
PID Controller

Digital Controllers
PID Controller
Input Output relationship of PID Controller
1
= . [ +


+ .
]

where
= ()
and : Integral and derivative action time

Another form
= +
where =


+ .
+ 0

and =

(2)

Digital Controllers
PID Controller
Build computer equation Positional PID Controller
Use approximation in (2)

[] [ 1]

[] =

[]
=1

+
+

=1

+ 0

Digital Controllers
PID Controller
Build computer equation Velocity PID Controller
Use z-Transform of (2)

1 1
= 1 +
+
1

1


= 1 + 1 +


+
2 1 2

Digital Controllers
PID Controller
Note:
Positional PID and Velocity PID are similar
Prove yourself

Exercise: Build flow chart for 2 types of PID above

Digital Controllers
PID Controller
Problems with PID controller
Saturation and Integral Wind-up
Causes by physical constraints
Results in long period overshoot
Solution: fix the limits of integral, use velocity form of PID.

Derivative kick
Causes by sharply change in setpoint
Results in damage of system

Digital Controllers
PID Controller
PID Tuning Ziegler-Nichols tuning algorithm
A system can be approximated as:

=
1 + 1
where
: System time delay
1 : Time constant of system

Digital Controllers
PID Controller
Open-loop Tuning
Controller
Proportional
PI
PID

0.91

1.21

3.3
2

0.5

Digital Controllers
PID Controller
Close-loop Tuning
1. Leave the controller only Proportional control

2. Carry out a step input of system


3. Increase/decrease controller gain until stable oscillation.
This gain is called (ultimate gain)
4. Read the period
5. Calculate controller parameters:
PI: = 0.45 and = /1.2
PID: = 0.6 , = /2, = /8

Exercises
1. Open-loop transfer function of a plant:
4
=
1 + 2
a. Design a dead-beat controller. Assume T=1s. Plot
the system response in Matlab-Simulink
b. Design a Dahlin controller. Plot the system
response in Matlab-Simulink.
c. Compare the results

Exercises
2. Explain the difference between Positional and
Velocity form of PID controller
3. The open-loop unit step response of a system is
shown as figure below. Obtain the transfer function
of the system and use Ziegler-Nicholes algorithm to
design:
- A Proportional Controller
- A PI Controller
- A PID Controller

Exercises
4. A mechanical process has the transfer function:

=

The system oscillates with a frequency of 0.05Hz when


unity feedback is applied. Determine .
5. The continuous-time PI Controller has transfer
function:
+

=

Derive the equivalent discrete-time controller transfer


function and build computer equation.

You might also like