Professional Documents
Culture Documents
VUT
Vaal University of Technology
Learning Guide – Digital Control Systems IV ii
INDEX
Unit 2
4. Chapter 4 – Stability Analysis ……………....….…………...………….......... 4-1
5. Chapter 5 – Root Locus Techniques ……….………...……...…………....…. 5-1
6. Chapter 6 – Digital Controller Design …….…………...……….………....…. 6-1
Unit 3
7. Project
7.1 Project outcome ……..……………...…………………….....…...…… 7-1
7.2 Project schedule ……….………………...….……………...……...…. 7-1
7.3 Assessment …………...………..……………..….....………………… 7-10
7.4 Apendix …......………...………..……………..….....………………… 7-10
Learning Guide – Digital Control Systems IV iii
1. WORD OF WELCOME
The Department of Process Control and Computer Systems, welcomes you as a
student to the Faculty of Engineering at the Vaal University of Technology. The
department strives towards integration of existing knowledge with new knowledge and
to afford the student the ability to think logically, gain knowledge of Electrical
Engineering, and specifically Digital Control Systems, in order to make a positive
contribution to the field of Industrial Instrumentation and Electrical Engineering.
2. CONTACT PERSONS
Title and Surname Office Telephone number and e-mail address
Prof MO Ohanga (HOD) R007 016 950 9323 marcelo@vut.ac.za
Ms. R Mwale (Administrator) R007 016 950 9254 refilwem1@vut.ac.za
Mr. R Fitchat (Lecturer) S115 016 950 9432 bennien@vut.ac.za
ii) Unit 1 assessment (1½ hour session): Assessment of unit 1 is scheduled for
Thursday 24 August 2017 at 10h00. Students that fail to receive 50% for unit 1,
will be offered a second and final opportunity to complete unit 1 on Thursday
26 October 2017 at 10h00. Students who successfully complete the final
assessment, will however receive a maximum mark of 50% for unit 1. Students
who were unable to attend the first assessment session, will receive the full mark
obtained for the final assessment of unit 1. A student that fails to receive 50% for
the final attempt to complete unit 1, fails the module. The assessment venue is
lecture room S205 (main campus), and as arranged at the Secunda campus.
iii) Unit 2 assessment (1½ hour session): Assessment of unit 2 is scheduled for
Thursday 21 September 2017 at 10h00. Students that fail to receive 50% for unit 2,
will be offered a second and final opportunity to complete unit 2 on Thursday
26 October 2017 at 11h35. Students who successfully complete the final
assessment, will however receive a maximum mark of 50% for unit 2. Students
who were unable to attend the first assessment session, will receive the full mark
obtained for the final assessment of unit 2. A student that fails to receive 50% for
the final attempt to complete unit 2, fails the module. The assessment venue is
lecture room S205 (main campus), and as arranged at the Secunda campus.
iv) Unit 3 assessment: For the purpose of assessing unit 3 (project), each student will
prepare and demonstrate a hardware simulation of a water level control system,
constructed according to the guidelines given in the learning guide for unit 3. A
clear photograph showing the project with the student’s student card (or other clear
identification), must also be available for assessment and moderation. Unit 3 will
be assessed in the lecture room, on the date and time scheduled by the lecturer.
Students that fail to receive 50% for unit 3, will be offered a second and final
opportunity to complete unit 3 on the date and time scheduled by the lecturer.
Students who successfully complete the final assessment, will however receive a
maximum mark of 50% for unit 3. Students who were unable to attend the first
assessment session, will receive the full mark obtained for the final assessment of
unit 3. A student that fails to receive 50% for the final attempt to complete unit 3,
fails the module.
Learning Guide – Digital Control Systems IV v
Section still
under
construction
EIDBS4 Sampled Data Systems 1-1
Learning Guide Unit 1
Pneumatic signal
u Current to control valve
source (represented by u) Water inflow
i0 (represented by i0)
Water level
v (represented by v)
iL
Water outflow
Figure P2 (represented by iL)
Using a 1000 F capacitor and maximum source current of 200 A, a real world
situation is simulated, where it takes in the order of one minute to fill up the tank.
Changing the water outflow will be simulated by varying the value of the resistor in
parallel with the capacitor.
Many ways exist to implement a voltage controlled current source, but the circuit in
Figure P3, built around a LM358 operational amplifier, was found to perform rather
well. The source current, i0, will vary linearly between 0 and 200 A (approx), with
the control voltage, u, varying between 0 and 8/9 volt. In order to change the simulated
water outflow iL, two 47k resistors are provided. To increase the water outflow, the
bottom 47k resistor may be short circuited.
EIDBS4 Project 7-3
Learning Guide Unit 3
390 k
+
10 M 1.5 k i0
3 8 9V
u ½LM358
1 5 8 battery
iL 7
2 4
½LM358
47k v +
MV
6 4
1000F
(64 volt) Volt-
390 k meter
47k
10 M 0-10V
The voltage controlled The capacitor represents the water Top view
current source (i0), tank and the current iL through 8 7 6 5
represents the flow control the two 47k resistors, represents the LM358
valve in Figure P1 water outflow in Figure P1. 1 2 3 4
Figure P3
The maximum simulated water outflow with only one 47k across the capacitor
(assuming a maximum voltage of 8V across the capacitor) will therefore be 170A.
This means that the maximum simulated water inflow will always be able to
counterbalance the maximum simulated water outflow. We should therefore in
principle, retain control of the voltage level, under all circumstances.
Note: The current source (valve) and inflow current i0 (water inflow) and 1000 F
capacitor (container) work just like a simple water tap filling up a bucket with a big
hole (47k + 47 k resistors) in it. If u = 0 V (tap closed) the water level (v) will start
to drop to 0 and if u = 9 V (tap fully open) the bucket will begin to fill up (v will begin
to rise to 8/9 V). For the benefit of interested students, an analysis of the current
source circuit is given in Appendix A1.
In order to measure the capacitor voltage without disturbing the charging and
discharging process, the second operational amplifier in the LM358 package is used to
buffer the capacitor voltage, as shown in Figure P3. The output of this amplifier is the
measured value MV of the controlled variable and can be confidently measured at this
point with any voltmeter.
EIDBS4 Project 7-4
Learning Guide Unit 3
This section of the simulation forms a unit, and students are encouraged to build and
test this section first, before proceeding with the proportional and integral control
section. The value of ‘u’ may be varied by connecting ‘u’ to the battery + rail (fill up
the tank) and by connecting ‘u’ to the battery – rail (drain the tank), as shown in
Figure P4. A small 9 volt battery will be an adequate power source for the circuit.
u = 9V and i0 200 A
MV should rise to approx. 8V
u Current
source i0 5 8
MV +
7
47k 9V
v 4
6
47k 1000F
Figure P4
If the bottom 47k resistor is short circuited while the capacitor voltage is increasing,
the rate at which the capacitor voltage rises, will be slowed down a little bit and this
may be verified by careful observation of the voltmeter reading. Similarly, when the
capacitor voltage is going down (that is when u = 0), the rate at which the voltage
diminishes, may be accelerated by short circuiting the bottom 47k resistor. (This of
course corresponds to the behaviour of the water level in a container when the outflow
is increased while filling it up or when the water outflow is increased when draining
the vessel.)
Students that successfully complete this section of the project, demonstrating that they
can control the charging and discharging of the capacitor by switching the control
voltage (u) between plus and negative supply, will receive a minimum mark of 50%
for unit 3.
9V
battery
100 k (R1)
10 k +
MV 2 8
1 u
SP ½LM358
3 4
10 k
Figure P5
Referring to Figure P5, the set point value, SP, is fixed and obtained as the mid point
voltage between two 10 k resistors that serve as a voltage divider. This will fix the
set point to half the battery voltage. The set point or desired value will therefore
correspond to a container that is half or 50% full. In terms of our model, this will mean
that the controller will try to drive the capacitor voltage to half the battery voltage or
50% of the maximum voltage that could develop across the capacitor.
The circuit in Figure P5 will calculate the difference between the capacitor voltage at
any moment (MV) and the desired value (SP). This will produce the error value
e=MV-SP. From this, the proper proportional and integral control action, u, will then
be computed. (Quite amazing for one op-amp, one capacitor and two resistors – credit
also to Dr. H van Rensburg for suggesting this circuit. An analysis of the controller is
given in Appendix A2.)
This section can be tested in conjunction with the first section (the same battery is
used for both sections). The controller output, u, should be connected to the input of
the current source, while the feedback loop is closed, by feeding back the measured
value, MV, to the controller. The measured value, will now be forced to follow the set
point value, according to the proportional/integral control law, established by the
controller. For clarity, a block diagram showing the connection of the controller to the
system, is shown in Figure P6.
The behaviour of the measured value MV, when a load change (or disturbance)
occurs, may be studied by putting a short circuit across the bottom 47 k resistor in
Figure P3, causing an increase in the simulated water outflow from the container.
EIDBS4 Project 7-6
Learning Guide Unit 3
Figure P6
It is very interesting also to monitor the control voltage u, to observe the controller
behaviour in its effort to keep the level close to set point, when the outflow is changed.
It is safe to measure the voltage u at the output of the PI controller op-amp output in
Figure P5, without disturbing the system operation. As given in Figure P5, the
controller will produce a proportional gain setting of KP = R2/R1 = 1 and the integral
gain setting is KI = 1/R1C = 1. Students should experiment with these values (C may
be electrolytic).
Students that successfully complete the basic continuous control system, depicted in
Figure P6, and demonstrate that the measured value (MV) will be driven to set point
after switch on and revert back to set point after a disturbance (short circuiting one
47k resistor), will receive a minimum mark of 60% for unit 3.
7.2.3 Sample and hold
Again, to keep the system as simple as possible, only the controller signal (u) will be
sampled. A 555 timer will be used to supply the master clock that drives a CD4022
ring counter to provide a short high going pulse to activate one of the analog switches
in a CD4066 that together with a RC circuit and op-amp, will provide the sample and
hold function for the controller signal. This arrangement is shown in Figure P7.
The sampling clock is provided on pin 2 of the CD4022 counter. The operation of
the 555 master clock and CD4022 ring counter may be verified by connecting a LED
test probe at this point. The LED should produce a short flash every second. This
clock pulse will enable (pin 6) the third switch available on the CD4066. The
controller signal (u) is now connected to pin 8 of the CD4066 and the sampled value
will appear on pin 7. The sampled value is stored for the duration of the sampling
period via a 1 k resistor on a 10 F capacitor connected to one amplifier on a LM358
package. The sampled version of u, u*, is available at the output of this amplifier and
it may also be safely monitored with a voltmeter at this point. Some additional design
information for the 555 timer is given in Section 7.2.6 and the pin out configuration
for the CD4022 and CD4066 is given in section 7.2.5.
A block diagram of the complete system is given in Figure P8. The complete system
may derive its power from the same 9V battery. The total current consumption of the
prototype system was measured and found to be in the neighbourhood of 7 mA.
EIDBS4 Project 7-7
Learning Guide Unit 3
1 k reset inhibit
u
1 k
5 8
10 k
7 u*
clock
6 4
8 7 6 5 16 15 14 13 12 11 10 9 14 13 12 11 10 9 8
555 CD4022 CD4066 ½LM358
1 2 3 4 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7
9V
battery
+
T0.125s T1s
+ +
1 k
10F LED 10F
Figure P7
u u* MV
+
MV PI controller u Sample & hold u* Water level control MV 9V
(Figure P5) (Figure P7) system (Figure P3)
Figure P8
Before the signal u* is used to control the current source, it may be a good idea to
still operate the system in continuous mode and just connect the continuous output u
from the PI controller, to the input of the sampler and confirm, by monitoring the
signal u* with a voltmeter, that a discrete version of the continuous signal u, is
obtained. When satisfied that the sampler is working, the signal u* may replace u to
control the current source in a discrete fashion.
EIDBS4 Project 7-8
Learning Guide Unit 3
A model and transfer function will be developed for this system in the future.
Students may however experiment with the PI controller. It was found with the
prototype that when C in Figure P5 was changed to 1 F, the system was still stable in
continuous mode but unstable in digital mode. The sample period was chosen to be
approximately 1 second. Changing the sampling period, is easily accomplished by
changing the RC timing components of the 555 timer. For example, changing RA (see
Figure A3 and P7) from 1 k to 100k, changes the sampling period to
approximately 7 seconds. The prototype definitely displayed instability with this
sampling period.
Students that successfully complete the project including the sampling of the
controller signal will be awarded a minimum mark of 70% for unit 3.
7.2.4 Practical note
Top view
3, 5 8 8 7 6 5
1, 7 + 9V LM358
1 2 3 4
2, 6 4
Figure P9
The LM385 package contains two operational amplifiers, with pin out configuration
as shown in Figure P9. If it is suspected that the LM385 operational amplifier is
faulty, a simple technique to check whether both amplifiers are working is to connect
each one in voltage follower mode, shown in Figure P9. If the non-inverting input is
connected to the positive supply (+9V), the output should be high (8V) while if
connected to the negative rail, the output should be zero volt. If the non-inverting
input is left open, the output should be high.
7.2.5 Pin out details for CD4022 and CD4066
4022 4066
CP1 1 16 Vcc 1X 1 14 Vcc
RA
Figure P10
RB
8 7 6 5
Output
555 +
1 2 3 4
time
+ Output TL TH
C T
7.4 APPENDIX
A1. Analysis of current source circuit vo
Refer to the circuit in Figure A1 R1 i0
At node N1: N3
R0
(u – v’)/R = (v’ – v0)/R1 u N1
Riu – R1v’ = Rv’ – Rv0
R v’ v”
Rv’ + R1v’ = Rv0 + R1u
v’ = (Rv0 + R1u)/(R + R1) ………...…….(1)
And at node N2: N2
(v” – v’)/R1 = v’/R R1
Rv” – Rv’ = R1v’
R
Rv” = Rv’ + R1v’ Figure A1
v” = [(R + R1)/R]v’
And using v’ from (1):
v” = [(R + R1)/R][(Rv0 + R1u)/(R + R1)]
v” = (Rv0 + R1u)/R ……………..……….(2)
EIDBS4 Project 7-11
Learning Guide Unit 3
Finally at node N3:
(v’ – v0)/R1 = i0 + (v0 – v”)/R0 R0v’ – R0v0 = R0R1i0 + R1v0 – R1v”
R0R1i0 = R0v’ + R1v” – (R0 + R1)v0
Using now v” and v’ from (1) and (2):
R0R1i0 = R0[(Rv0 + R1u)/(R + R1)] + R1[(Rv0 + R1u)/R] – (R0 + R1)v0
R0R1i0 = [R0/(R + R1) + (R1/R)][Rv0 + R1u] – (R0 + R1)v0
Assuming now that R0 << (R + R1) and R0 << R1, then,
R0R1i0 (R1/R)(Rv0 + R1u) – R1v0 R0R1i0 R1v0 + (R12/R)u – R1v0
R0R1i0 (R12/R)u
R
i0 1 u
R R
0
A2. Analysis of the proportional and integral controller
R2 C
i
R1 vc
MV i N1
N2 u
SP
SP SP Figure A2
MV - SP
At node N1 in Figure A2: i = …….…..……………………...………… (1)
R
1
dv c
Also i = C ………………………………………...…………....…………… (2)
dt
dv cMV - SP
From (1) and (2): = ……………………………………………… (3)
dt R C
1
For loop N1N2 in Figure A2, by KVL: SP – iR2 – vc – u = 0
R
SP – 2 (MV – SP) – vc – u = 0; from (1)
R iR2 vC
1
R u
vc = SP – 2 (MV – SP) – u SP
R
1
dv c d R d du
= (SP) – 2 (MV – SP) –
dt dt R dt dt
1
R d du
=0– 2 (MV – SP) – ; because SP = constant
R dt dt
1
EIDBS4 Project 7-12
Learning Guide Unit 3
dv c R d du
=– 2 (MV – SP) – ……………………………………….... (4)
dt R dt dt
1
MV - SP R 2 d du
From (3) and (4): = (MV – SP) –
R C R dt dt
1 1
du R d MV - SP R 2 d 1
=– 2 (MV – SP) – = (SP – MV) + (SP – MV)
dt R dt R C R dt R C
1 1 1 1
We now recognise that the difference between the set point SP and the measured
value MV, is in fact the error signal e = SP – MV
du R de 1
= 2 + e
dt R dt R C
1 1
R de R
du 2 dt + 1 1
dt = edt du = 2 de + edt
dt R dt R C R R C
1 1 1 1
R
1
u = 2 e + edt ………………………………………..………….. (5)
R R C
1 1
R 1
Therefore from (5) and with KP = 2 and KI = :
R R C
1 1
u = KPe + KI edt ……………………………………………………….….. (6)
We conclude therefore from Equation (6) that the circuit in Figure P3, provides a
R 1
PI control law with a proportional gain KP = 2 and an integral gain KI = .
R R C
1 1