me 534 - 01 introduction (rev. 2.1)
TRANSCRIPT
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
1/13
Outline Introduction
Classification of Control S stems
Analog Controllers
Op-amp circuits
Comparison
Signals in Control Engineering
I/O interfaces
Control computer
on ro a gor m
Example: Water Level Control
P control law Hysteresis control
Chapter 1 ME 534 2
Classification of Control S stems
-
Mostly referred to as Analog Control Controller takes corrective action continuously in time.
Analog circuit elements are used to implement such controllers.
Discrete-time Control
Also known as Digital- or Numerical Control
Corrections take place at particular instances in time. Controllers output stays constant between these instances.
Microprocessors are generally employed to realize thesecontrollers.
A blend of both control systems (and strategies).
Chapter 1 ME 534 3
Discrete-time Control A lications
Home a liances Millitar a lications Dishwasher
Washing machine
Advanced weapons systems
Radar systems
Robotics Mobile robots
Electric Motor Drivers
Consumer goods
n us r a ro o s
Automations systems Factory automation
TV sets
CD / DVD players / recorders
Aerospace applications Aircraft control / guidance
Mobile phones
Personal Computing
Rocket / missile guidance
ar s r ves
CD-RW drives
Chapter 1 ME 534 4
Di ital A lications Contd
Several computers are onboard.
by these computers (calledelectronic control units orECUs
Fuel injection / Ignitioncontrol
Anti-lock Break Systems
Stability and tractioncontrol (anti-skid)
Climate control Automatic transmission
system
Chapter 1 ME 534 5
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
2/13
Typical Digital Control SystemPower Disturbance
Control
Element
m(t) u(t) y(t)
Computer
Sensorb(t)
Computation of correction signal
Decision making
Chapter 1 ME 534 6
.
Typical Analog Control System
Function of analog computer:
Analog filtering of the measurement noise in the input signals Comparison of the measurement (b) and the command (r)
Generation of correction signal (m) on a continuous basis.
Chapter 1 ME 534 7
Analog Control using Op-amps
Analog controllers are frequently
implemented via operational amplifiers
(or simply op-amps).
One can implement almost any desired
function.+
_2
1
7
8
+V
Of f s e t n u l l N o c o nne c t io n
I n v e r t i n g i n p u t
Op-amps are very versatile amplifiers: Precise
Error tolerant / Robust
4 5-V O f f s e t n u l l
o n- n v e r n g n p u
Low-cost
There exists a wide variety of
-
-
applications:
Radio/video
onar ra ar
Automation
Automotive
Chapter 1 ME 534 8
ns rumen a on, e c.
Inverting Amplifier
A number of different functions can be implemented by employing op-amps with various
passive circuit elements.
Integrator:
ZA= R
ZB= 1/(Cs)
Transfer function of this circuit is s
1
RC
1
)s(E
)s(E
i
o
=
Differentiator:( )
( ) ( )o B
i
i A
G sE s Z s
= =
ZA= 1/(Cs)ZB= Rwhere ZA, ZB refer to the generalized
s)RC()s(E)s(E
i
o =
impedances [] of the components.Note that the bipolar voltage supply(+V, -V) of the circuit is customari ly
ME 534 9
.
Chapter 1
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
3/13
Common O -am CircuitsSumming Amplifier (Mixer): Buffer (Voltage Follower):
=
Rf
o i
R1Rn
_
+
+
e1
+
en
RL eoLow-pass Filter:
n 1E s
1
f
i
R
o iRi
e e=
= ( ) ( ) 1iE s RC s=
+
Chapter 1 ME 534 10
Differential Am lifier
Differential am lifier is used to
amplify small signals buried in
much larger signals.
R resistances alon with R s
ek)vv(v 12RR
o1
2 ==
must be equalized to reduce the
effect of common mode voltage on
the out ut v .
Chapter 1 ME 534 11
Voltage Limiter
Output of op-amps cannot exceed a certain voltage level Vsat:
sa s .
One can built a voltage limiterusing this important property. To accomplish
that, two cascaded op-amp circuits are designed: i
some desired level.
o The following circuit (Attenuator) , which has a reciprocal of the amplifiers gain, reverts the
amplified voltage back.
As an illustration, assume that
we would like to limit ei such that
- i
Let Vs = 15[V] and Vsat = 13[V].
In this case, the gain of the
amplifier is calculated as
= =sat i, max .
Hence, we choose R1
= 10 kand R2 = 26 k.
Chapter 1 ME 534 12
Analog PID Controller
Kdd
D-control Analog computations involved in PID: Integration (dt)
Ki dt+r(t) m(t)
+
I-control
eren a on
Amplification (by a gain)
Summation (addition, subtraction)
Kp
_P-control 2
1 2( 1)( 1)( ) d p ii
K s K s K s sM sK
+ + + += =
Transfer Function:
b(t) ( ) ( ) ( )E s R s B s=
1 1 1R C =
=
2 2 2
4
1 3 2
iRK
R R C=
Chapter 1 ME 534 13
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
4/13
Another PID Controller A more versatile version of the PID
controller can be built by simply
im lementin each control law via a
separate circuit.
Controller gains can be conveniently
adjusted via R1, R2, and R3.
3
4
p
RK
R=
1 1
1i
KR C
=
= 2 2d
Chapter 1 ME 534 14
A Multi- ur ose PID Controller
Chapter 1 ME 534 15
Com arison
Analog Control Digital Control
Control computations (such as dt, d/dt,, , , etc.) are continuous in time.
All computations are performed in
distinct time intervals.
Op-amps are used as computingelements.
Ps, DSPs, Cs, PLCs are commonlyutilized.
ar w re o su a e or
reconfiguration.
ex e eas y programme .
Very sensitive to measurement- and Somewhat sensitive to signal
process noise. conversion errors, quantization noise,
and round-off / truncation errors.
Inex ensive for sim le control s stems Hardware is inex ensive but control
but can be quite costly for complexsystems.
software development tools can be
expensive.
Chapter 1 ME 534 16
. -2. Discrete-time signal
3. Amplitude-quantized discrete-time signal
- -.signal
Chapter 1 ME 534 17
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
5/13
T e 1: Continuous-time
,
The signal ranges between a lower bound (fmin)
max min, max By definition, f(t) = 0 when t < 0.
Chapter 1 ME 534 18
-
f(t) f*(t)
TTtt ,...2,,0,*
=
elset
,0)(
tT 2T 3T0
Time: t {0, T, 2T, ... , kT, ...}
The si nal ran es between a lower bound f and an upper bound (fmax):f [fmin, fmax ]
Chapter 1 ME 534 19
Type 3: Amplitude Quantized
Discrete-time
nm
fff
+
= minmax
f
*~( )
, {0, ,...}f t
f floor t Tt
= 3 f
0, elseT 2T 3T0
f
Time: t {0, T, 2T, ... , kT, ...}
e range o e unc on ecomes
},,2,,0,,)1(,{~
* fmfffnfnf
Chapter 1 ME 534 20
T e 4: uantized Continuous-time
Time: t 0 +
The range of the
],[ maxmin~
fff =
Since the transitions of
the function at T, 2T, 3T,
... are extremely fast, the
function values
predominantly reside atthe quantized levels.
Chapter 1 ME 534 21
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
6/13
Properties of Digital Control
Systems
All physical quantites are represented by
length.
All computations are synchronized and are
carried out eriodicall .
The period in which all these computations
(T).
Chapter 1 ME 534 22
Properties (Contd)
All uantites in discrete-time domain could be
expressed as
X t = kT X k where k 0 1 2 ... k is called time index.
expression (difference equation) which
also that of the manipulation):
==
+=j
j
i
i jkebikmakm01
)()()(
Chapter 1 ME 534 23
A General Digital Control SystemPower Disturbance
m(kT) m(t)~
u(t) y(t)e(kT)r(kT) OutputInterface
DifferenceEquation
t t t tt Control
Alg ori thm
Latch &
D/AErrorCommand Manipulation OutputManipulated
Input
Control
Element Plant+
_
Clock
b(t)
t
b(kT)
t
~
Measurement
A/D Sensor
Control Computer
and Software InputInterface
Digital Domain Analog Domain
Control elements:
o or r ver + ec r c o or
Servo-valve + Hydraulic Cylinder / Motor
+
Chapter 1 ME 534 24
Elements of I/O Interfaces
.
II. Analog-to-Digital (A/D) Converter
III. Latch
- -.
Chapter 1 ME 534 25
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
7/13
I Sam ler
f*(t)
Sampler
f(t)
Type 2Type 1
t
T 3T0
Tf(t) f*(t)
t
-
instances.
into a discrete-time one (Type 2).
Chapter 1 ME 534 26
II A/D Converter
It converts a voltage level into a corresponding
instant of time.
Chapter 1 ME 534 27
Pro erties of A/D Converters Input Voltage Range:
n po ar:
5V Bipolar: -5V +5V
10V Bipolar: -10V +10V
Denotes quantization level
-
Conversion time:
an N-bit binary number
Chapter 1 ME 534 28
A/D Converters Contd
designed specifically to do this
conversion:
in min, max Vout0, ..., VoutN {0, 5 V} (TTL)
For convenience, out ut volta e states
are represented as binary numbers:
0 Volt 0 (low logic level)
For A/D converter chips, prices go up as
Resolution (and accuracy) increases
Conversion time decreases
Chapter 1 ME 534 29
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
8/13
Uni olar A/D Converter
- ,
we have the following ADC output code:
Output Voltage at Pins [V] Binary
Number
Unsigned
IntegerDB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
0 0 0 0 0 0 0 5 00000001 1
0 0 0 0 0 0 5 0 00000010 2
0 0 0 0 0 0 5 5 00000011 3
... ... ...
Chapter 1 ME 534 30
Uni olar ADC Out ut 8-bitOutput of ADC
11111111
00000010
00000011
00000001
00000000 Input Voltage0 V V V V
(Vmin)
Chapter 1 ME 534 31
Bipolar ADC Output (8-bit)Note that the ADC output format in bipolar operation is
device-dependent: Device manufacturers commonly
em lo direct strai ht binar - and/or twos com lement
representations.
8
V
max
)
7
V
6
V
8
V
7
V
6
Vmin)
Chapter 1 ME 534 32
1 (11-12
-12
-12(
Exam le A/D Converter
Consider a 10V unipolar A/D converter with
- = reso u on.a) Determine the voltage resolution of this
device.
b Find the out ut re resentation as unsi ned
integer) when an input voltage of 3.27 V is
a lied.
Chapter 1 ME 534 33
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
9/13
Solution Part a
Voltage resolution (i.e. quantization level) can be given as
max min| |
2NV V
V
=
Hence,
8
|10 0 | 1039.0625[ ]V mV
= = =
Chapter 1 ME 534 34
Solution Part bThe corresponding number representation can be simply
33.27 83inVoutput floor floor = = =
.
where flooris a function rounding its argument to the
.
Input Voltage Range [V] Binary # Rep. Unsigned Int. Rep.
[0, 0.0391) 00000000 0
[3.2422, 3.2813) 01010011 83[9.9219,9.9609) 11111110 254
9.9609,10 11111111 255
Chapter 1 ME 534 35
Quantization Error (or Accuracy)
A/D conversion
mentioned here leads to
a quantization error of
significant bit: LSB) at
maximum.
Such an quantization
error mi ht be
unacceptable for certain
applications.
Chapter 1 ME 534 36
Quantization Error (Contd)
To reduce this error, a
better A/D conversion
method is adapted by ADC
A bias of V/2 is internallyadded to Vin.
Quantization error now ranges
between -V/2 and V/2 (or.
Output (code) of the ADC
can be ex ressed as
output = floor(Vin/V + )
Chapter 1 ME 534 37
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
10/13
In ut Interface
f*(t)~
*~ Type 3f t
f(t)
Type 1
amp er
& ADCt
T 3T0
3 f
ft
In ractice, sam ler & ADC are considered to be
a single unit:
In ut to the unit is an analo volta e var in in time, Output is binary number sequence with finite word
length.
Chapter 1 ME 534 38
III Latch
Latch holds a binary number during onesamp ng per o .
It is an inte rated circuit which holds the
input (N-bit digital) signal throughout one
.
The output of the device remains the same
ur ng s per o .
Chapter 1 ME 534 39
IV D/A Converter
Converts an N-bit digital signal into a
corres ondin volta e level:
Complementary operation of A/D converter.
Output Voltage Range:
5V unipolar, 5V bipolar, 10V unipolar, 10V bipolar
Resolution and Accurac
Conversion Time
Chapter 1 ME 534 40
Out ut Interface
single unit (output interface).
Sample and Hold (S/H) Unit.
Chapter 1 ME 534 41
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
11/13
Errors in Di ital Control S stems
Chapter 1 ME 534 42
Control Com uter
As control com uters there exist a wide
variety of choices in practice:
PC + Motion Control Card
Microcontroller: Single Control IC
Pro rammable Lo ic Controller PLC
Chapter 1 ME 534 43
A Simple Control Algorithm
.
2. Fetch (or generate) command r(k)
3. Compute error e(k) = r(k) - b(k)
.
5. Output m(k)
6. Wait till end of sampling period
. o o ep
Chapter 1 ME 534 44
Illustrative Exam le
Consider the waterlevel control system.
Servo-valve or Pro .ensor
Flow Control Valve): m(t) is control voltage:L
evel
S
0 V qi = 0 lt/s
5 V qi = 100 lt/s
ensor: b(t) is sensor output
0 V h = 0 m 5 V h = 5 m
Chapter 1 ME 534 45
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
12/13
Control System
Controlr(k) + Latch &m(t) qi(t)
qo(t)
Servo- Waterh(t)m(k)
8-bit / 5V
unipolar
_
ClockT
Data AcquisitionBoard
Sampler
& A/D
b(t) Level
Sensor
b(k)
Program
8-bit / 5V
unipolar
- Desired water level: -
Control Law: Proportional Control
Sampling Time: T = 0.1 sec. D/A Converter: 8-bit / 5V unipolar
A/D Converter: 8-bit / 5V unipolar
Chapter 1 ME 534 46
C Librar Functions
drivers along with high-level language support. . .
For this example, let us assume that the
read_ADC(): returns water-level as unsigned integer.
write DAC(m): enerates out ut volta e de endin_on the input argument m. Here, m < 256 is anunsigned integer.
pause(n): e ays e execu on y n m secon s.
init(): initializes the units on the DAQ board.
Chapter 1 ME 534 47
Control Program 1 (ANSI C)#include
#include
#include control.h
#define K 1.2
voidmain() {
float r,dr,e,b,qi; unsigned intm;
r = 0; dr = 3/3000;init(); /* Initialize */
while(1){ /* Infinite loop */
b = 5*read_ADC()/255; /* Read sensor */
r += dr; if (r>3) r = 3; /* Calculate cmd */
e = r b; qi = K*e; /* P-control law */
if (qi < 0) qi = 0; /* 0
-
8/13/2019 ME 534 - 01 Introduction (Rev. 2.1)
13/13
H steresis Control
hysteresis (a.k.a. bang-bang or on/off)
.
The power control element (PCE) is either
magnitude of error:
.
If error < -threshold then PCE is switched off.
res o s o en mes re erre o as error-
band, deadband, or tolerance.
Chapter 1 ME 534 50
H steresis Control Contd
Chapter 1 ME 534 51
Control Program 2 (ANSI C)#include
#include
#include control.h
#define dh 0.1 /* Define deadband */
voidmain() {
float r,dr,e,b; unsigned intm;
r = 0; dr = 3/3000;init(); /* Initialize */
write_DAC(255); /* Turn on valve */
while(1) { /* Infinite loop */
b = 5*read_ADC()/255; /* Read sensor */
r += dr; if (r>3) r = 3; /* Calculate cmd */
e = r b;
if (e > dh) m = 255; /* Hit lower bound? */
if (e