Exercise 6 “Digital Control Systems” OBJECTIVE REQUIREMENTS ...

amaranthgymnophoriaElectronics - Devices

Nov 15, 2013 (3 years and 6 months ago)

102 views





43
Gdansk University of Technology, Faculty of Ocean Engineering and Ship Technology
Modeling and Control of Dynamic Systems, Laboratory,
M. H. Ghaemi
Exercise 6
“Digital Control Systems”
OBJECTIVE
The objective of this exercise is introducing the principles of digital control systems. The
concept of signal sampling, application of deadbeat controller and influence of sampling
time on control system stability are presented. The second order objective is introducing
the application of Symbolic Math Toolbox.
REQUIREMENTS
A. Prerequisite knowledge
:
You are expected to know the following topics:
1. Modeling the digital computer
2. The z-transform
3. Digital system stability
4. Deadbeat controller concept.
To find basic information on digital control students may visit the following web page:
http://dspcan.homestead.com/files/idxpages.htm
.
B. MATLAB/SIMULINK:

The Symbolic Math Toolbox.
LAYOUT
1. Select an arbitrary P1 element and observe the effect of ZOH by making
simulation. Compare the results for the same system in discrete form. In this
regard use Symbolic Math Toolbox to find z-transform of the selected element.
(See the following enclosed example –file Exercise_6.mdl-, with T=0.1).
Zero-Order
Hol d
1
s+1
Transfer Fcn
Sum2
Sum1
Step
Scope
0.09516
z-.9048
Di screte
Transfer Fcn

2. Using root locus method determine the range of gain K for stability of the
following system:
-
+
)(zR
)(zX
K
)75.0()5.0(
)5.0(
−⋅−
+
zz
z






44
Gdansk University of Technology, Faculty of Ocean Engineering and Ship Technology
Modeling and Control of Dynamic Systems, Laboratory,
M. H. Ghaemi
3. For the above given system determine the range of gain K for overshoot less than
6%.
4. Use Symbolic Math Toolbox for finding the inverse z-transform and present the
selected element as function of kT.
5. Recall Exercise 2, select a proper sampling time, make a discrete control system
and derive the function of deadbeat controller for the closed-loop system.
6. Estimate the critical sampling time due to stability of the system.
MATLAB/SIMULINK
The following new MATLAB commands and functions are necessary to be understood and
applied in this exercise:
c2d
syms
laplace
ilaplace
ztrans
iztrans
pretty
REPORT
In addition to those points mentioned under Layout, your report should include:
1. A plot to show the influence of ZOH and comparison of continuous and discrete
responses,
2. A plot to show the effect of changing of sampling time on system stability (at least
for 4 different values of T).
3. Hand-on calculation of deadbeat controller transfer function.

EXAMPLE
Part 1:
This part of Example is taken from Reference 6 and is coded in file
Exercise_6_1.m.

Consider the following discrete control system:

-
+
)(zR
)(zX
K
)5.0()1(
)1(
−⋅−
+
zz
z


We introduce this discrete system under MATLAB as follows:

» numg=[1 1];
» deng=poly([1 0.5]);
» G=tf(numg,deng,[])

Now let us sketch the root locus:
» rlocus(G)
» zgrid([],[])
» title('z-Plane Root Locus')




45
Gdansk University of Technology, Faculty of Ocean Engineering and Ship Technology
Modeling and Control of Dynamic Systems, Laboratory,
M. H. Ghaemi
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
z-Plane Root Locus
Real Axis
Imaginary Axis



The critical value of K could be found for intersection of unit circle and root locus plot.
Using rlocfind these points can be hinted and the range of K will be determined:

» [K,p]=rlocfind(G)
Select a point in the graphics window
selected_point =
0.5007 + 0.8682i
K =
0.5016
p =
0.4992 + 0.8674i
0.4992 - 0.8674i

Therefore, the range of K for stability is:
5.00
<
<
K
.

Now consider that we have an additional design requirement: the maximum permissible
overshoot is 10%. This means that damping ratio is equal 0.59. This time we intersect
the root locus plot with 0.59 damping ratio curve:
» rlocus(G)
» axis([0,1,-1,1])
» zgrid(0.59,[])
» title(['z-Plane Root Locus'])
» [K,p]=rlocfind(G)




46
Gdansk University of Technology, Faculty of Ocean Engineering and Ship Technology
Modeling and Control of Dynamic Systems, Laboratory,
M. H. Ghaemi
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
0.59
z-Plane Root Locus
Real Axis
Imaginary Axis

selected_point =
0.7097 + 0.2746i
K =
0.0797
p =
0.7101 + 0.2747i
0.7101 - 0.2747i

The values of poles (p) are now given for the adjusted gain. For this adjusted gain value,
the step response of the closed-loop system could be :
» cl_sys=feedback(K*G,1)
» step(cl_sys); grid
» title('Adjusted Gain Closed Loop Step Response')
0
5
10
15
20
25
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Adjusted Gain Closed Loop Step Response
Time (sec)
Amplitude





47
Gdansk University of Technology, Faculty of Ocean Engineering and Ship Technology
Modeling and Control of Dynamic Systems, Laboratory,
M. H. Ghaemi
Part 2:

Recalling the example of Exercise 2, we select the same plant and try to design a digital
control system, which then could be compared with analog control system delivered
under Exercise 2. Consider the same design requirements which were given for Exercise
2. The control system in question is shown below:

)(sG
d
)(sG
p
)(sD
)(sU
)(sX
+
+
)(sG
c
-
+
)(sR
)(sE


This is equivalent to the following system:
)(
2
sG
)(sD
)(sU
)(sX
+
+
)(sG
c
-
+
)(sR
)(sE
)(
1
sG
d
)(sU


The adequate digital control system will have the following configuration:
)(
ˆ
tu
)(
ˆ
tx
+
+
)(zG
c
-
+
)(tr
)(ke
D/A
(e.g. ZOH)
A/D
A/D
)(kr
)(td







)(
1
1
sG
L
d
[ ]
)(
2
1
sGL

)(
ˆ
tx
)(kx
Digital Controller


The main difference between digital controller (computer) and continuous analog one is
that the digital controller operates on discrete signals (sampled signals) rather than on
continuous signals. The A/D element is a switch which converts the analog signal to
digital signal. The D/A element is a holder which converts discrete signal to analog signal.
An example of D/A is Zero Order Hold (ZOH) which has the following transfer function:
s
e
sG
Ts
h


=
1
)(

We consider this holder type for further analysis.

In our case when
r=
0; the control system block diagram can be redrawn as follows:




48
Gdansk University of Technology, Faculty of Ocean Engineering and Ship Technology
Modeling and Control of Dynamic Systems, Laboratory,
M. H. Ghaemi
ZOH
[
]
)(
2
1
sGL








)(
1
1
sG
L
d
-
+
A/D
)(zG
c
A/D
)(kd
)(td
Digital Controller
Plant with ZOH
)(
ˆ
tx

or simply:
)(
2
zG
)(
1
zG
-
+
)(kd )(
ˆ
tx
)(zG
c

in which
( )
( )












++
+
⋅⋅−=












⋅−=
−−−−
kzsms
kzs
s
Lzz
s
sG
LzzzG
2
11
2
11
2
1
1
)(
1)(













+
=












=
−−
kzs
Lz
sG
LzzG
d
1
)(
1
)(
11
1

and )(zG
c
is the deadbeat digital controller.

Step 1
: Selection of sampling time: Generally, the sampling rate should be at least twice
the bandwidth of the signal, or else there will be distortion. This minimum sampling
frequency is called Nyquist Sampling Rate (NSR). The usual practice is selecting the
sampling rate between 20 to 30 times of the signal bandwidth. For simulation purpose we
use step response of the plant. Based on the design requirement the permissible
maximum overshoot is 5%. Therefore, for a disturbance equal 0.1 m the maximum
permissible value of
x
can be 5 mm. First we introduce the plant
:

» m=100;k=200;z=50;
» num2=[z,k];
» den2=[m,z,k];
» g2=tf(num2,den2);
» [a,b,c,d]=tf2ss(num2,den2);
» o_sys=ss(a,b,c,d)
a =
x1 x2
x1 -0.50000 -2.00000
x2 1.00000 0
b =
u1
x1 1.00000
x2 0
c =
x1 x2
y1 0.50000 2.00000
d =
u1
y1 0




49
Gdansk University of Technology, Faculty of Ocean Engineering and Ship Technology
Modeling and Control of Dynamic Systems, Laboratory,
M. H. Ghaemi
Continuous-time system.

Then let us simulate just the beginning of step response using step function:
» ti=0;
» dt=1e-6;
» tf=.2;
» step(o_sys*.1, ti:dt:tf)
» axis([0 .2 0 0.01]); grid

This figure shows that the spring is compressing very quickly and exceeds our
requirement of 5 mm for values more than 0.07s. Therefore, the proper sampling time
would be
.0027.0
30
08.0
=

We select a sampling time equal 0.002, i.e. the sampling frequency is 500 Hz.

Step 2
: Converting the system elements from continuous form to discrete one: By using
c2d function we convert our continuous plant, for example, to a discrete system:
» T=0.002;
» o_sys_d=c2d(o_sys,T, 'zoh')
a =
x1 x2
x1 0.99900 -0.00400
x2 0.00200 1.00000
b =
u1
x1 0.00200
x2 1.99933e-006
c =
x1 x2
y1 0.50000 2.00000
d =
u1
y1 0
Sampling time: 0.002
Time (sec.)
Amplitude
Step Response
0
0.05
0.1
0.15
0.2
0
0.001
0.002
0.003
0.004
0.005
0.006
0.007
0.008
0.009
0.01






50
Gdansk University of Technology, Faculty of Ocean Engineering and Ship Technology
Modeling and Control of Dynamic Systems, Laboratory,
M. H. Ghaemi
Discrete-time system.
The c2d function takes three arguments: the continuous time system, the sampling time,
T, and the type of holder.

Step 3
: Finding the controller transfer function: The design requirements are stability,
min. steady state error, max. 5% overshoot and max. settling time 5 sec.

One way is applying the deadbeat controller. The concept of deadbeat controller is
achieving the same controlled variable by the system as is the input signal, but after a
time delay equal T (sampling time), i.e.:
)()(
1
zRzzX ⋅=


where
sT
ez =

Therefore, in our case we have:
1
12
2
)()()(1
)(
)(

=
⋅⋅+
= z
zGzGzG
zG
zG
c

Solving this equality for
)(
zG
c
we get
1
12
1
2
)()(
)(
)(


⋅⋅

=
zzGzG
zzG
zG
c


Now, using Symbolic Math Toolbox we do the same job under MATLAB. File
Exercise_6_2.m delivers this method by using Symbolic Math Toolbox.

Please note that applying the Symbolic Math Toolbox in case of deadbeat controller, in
spite of its advantages, is not a proper way for higher degree systems. Moreover, the
results are not transformable directly for further use, for example under SIMULINK.



* * *