Automatic Control – C. Novara
Digital control
Introduction to digital control
Discrete-time signals
Discrete-time systems
Automatic Control – C. Novara L1 2
Introduction to digital control
� At present, most control systems use digital computers to
implement the controllers.
� Digital computers allow one to calculate the control signal in
software rather than in hardware. This gives relevant
advantages:
� Flexibility in making modifications to the control law after the
hardware design is fixed.
� Hardware and software design can proceed almost
independently, saving a large amount of time.
� Logic and nonlinear operations can be easily included in the
controller.
� Rapid prototyping.
Automatic Control – C. Novara L1 3
Introduction to digital control
� Digital control system design is typically based on three main
steps:
1. Design of a continuous-time controller CCT(s).
2. Discretization of the controller: CCT(s) � C(z).
3. Verification of the design using discrete analysis and
simulation.
� The discrete-time controller is implemented on the real system to
be controlled as follows:
Automatic Control – C. Novara L1 4
Introduction to digital control
� Analog-to-digital converter (A/D): This device samples a
physical variable, and covert it into a binary number (truncation).
The sampling is performed using a given sampling period T.
� Digital-to-analog converter (D/A):
1. This device changes the binary number to an analog signal.
2. A zero-order hold (ZOH) hold maintains the same signal
value throughout the sample period.
Automatic Control – C. Novara L1 5
Introduction to digital control
0 1 2 3 4 5
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
t
e
e(t)
e(k)
0 1 2 3 4 5
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
t
u
u(k)
u(t)
Automatic Control – C. Novara L1 6
Discrete-time signals: signal types
� Analog signals: continuous in time and amplitude.
� Example: voltage, current, temperature, mass position,…
� Digital signals: discrete both in time and amplitude.
� Example: attendance of this class, digitizes analog signals,…
� Discrete-time signals: discrete in time, continuous in
amplitude.
� Example: hourly change of temperature.
� Theory for digital signals is complicated.
� Discrete-time signals:
� Most convenient to develop theory.
� Good enough approximation in most practical applications.
� In practice we mostly process digital signals on processors.
� Need to take into account finite precision effects.
Automatic Control – C. Novara L1 7
Discrete-time signals: sampling
� Sampling is a continuous-time to discrete-time conversion:
T is the sampling period (s)
fs = 1/T is the sampling frequency (Hz)
ωs = 2pifs = 2pi/T is the sampling frequency (rad/s)
( ) ( ) K0,1,2,kkTxkx ==
0 1 5 6 72 43
x
t
Automatic Control – C. Novara L1 8
Discrete-time signals: sampling
� Sampling is not reversible.
� Given a sampled signal there exist infinite continuous signals
which fit the samples:
� Sampling yields an information loss.
� Under certain conditions an analog signal can be sampled
without loss so that it can be reconstructed perfectly.
0
-1
20 40 60 80 100
-0.5
0
0.5
1
t
x
Automatic Control – C. Novara L1 9
Discrete-time signals: sampling
Sampling Theorem (Nyquist-Shannon)
� Let x(t) be a continuous-time bandlimited signal with
where X(jω) is the continuous-time Fourier Transform of x(t).
� Let x(k)=x(kT) be the discrete-time signal obtained from x(t)
using a sampling frequency ωs=2π/T.
� Then, x(t) is uniquely determined by its samples x(k) if
ωs/2=π/T is called the Nyquist frequency.
Bfor )j(X ≥ω=ω 0
B s 2≥ω
Automatic Control – C. Novara L1 10
Discrete-time signals: sampling
� Continuous-time Fourier transform:
� Continuous-time Fourier inverse transform:
( ) ( )∫
∞
∞−
ω−
=ω dtetxjX tj
( ) ( )∫
∞
∞−
ω ωω
pi
= dejXtx tj
2
1
� x(t) is written as a superposition of harmonic signals:
ejωt = cos(ωt) + j sin(ωt).
� X(jω) is the weight of the harmonic component with
frequency ω.
Nepster
高亮
Automatic Control – C. Novara L1 11
Discrete-time signals: sampling
� continuous-time signal
� Fourier transform
B = 17 rad/s, ωs ≥ 2B � T ≤ 2π/ωs = π/B = 0.185 s
Automatic Control – C. Novara L1 12
Discrete-time signals: sampling
B=17 rad/s, ωs ≥ 2B � T ≤ 0.185 s
full information
maintained
little loss of
information
relevant loss of
information
Automatic Control – C. Novara L1 13
Discrete-time signals: sampling
� Let x(t)=sin(Bt).
� If ωs < 2B, then this sinusoidal signal is not correctly sampled.
� This effect is called aliasing and may occur for any type of signal if
the sampling rate is not properly chosen.
� Aliasing is very dangerous in real digital control systems since high-
frequency noises may cause large low-frequency oscillations.
t (s)
x(k)
x(t)
Automatic Control – C. Novara L1 14
Discrete-time signals: sequences
� A discrete-time signal is represented by a sequence of real
numbers.
0 20 40 60 80 100
-10
0
10
t (s)
0 10 20 30 40 50
-10
0
10
k (samples)
Automatic Control – C. Novara L1 15
Discrete-time signals: sequences
� Unit impulse sequence:
� Unit step sequence:
� Exponential sequence:
� Delayed (shifted) sequence:
)kk(x)k(y o−=
=
≠
=δ
01
00
k
k
)k(
≥
<
=ε
01
00
k
k
)k(
kA)k(y α=
-10 -5 0 5 100
0.5
1
1.5
-10 -5 0 5 100
0.5
1
1.5
-10 -5 0 5 100
0.5
1
k (samples)
Automatic Control – C. Novara L1 16
Discrete-time systems
� A discrete-time system is an operator F mapping an input
sequence u=[u0 u1 …]
T (and an initial condition) into an output
sequence y=[y0 y1 …]
T:
Fu y
� A discrete-time system is in general described by a
difference equation:
( )
( )
( )
( ) ( 1), ( 2), , ( ), ( 1), ( 2),
( 1) ( ), ( )
( ) ( ), ( )
y k f y k y k u k u k u k
x k f x k u k
y k h x k u k
= − − − −
+ =
=
K K
y=F(u)
input-output
state-space
Nepster
高亮
离散时间系统
Automatic Control – C. Novara L1 17
Discrete-time systems: examples
Traveling mass subject to friction
M u(t)
β
y(t)
� This simple model can be used for the design of cruise
control systems.
( ) )t(u)t(ytyM
speedmass:)t(y
+β−=&
Automatic Control – C. Novara L1 18
� Forward Euler discretization method. The time derivative
is approximated by the difference quotient:
where T is the sampling period.
� Using this discretization, we obtain the following difference
equation:
Discrete-time systems: examples
( ) ( ) ( )
T
kTyT)k(y
ky
−+
≅
1
&
)k(u
M
T
)k(y
M
T
)k(y 111 −+−
β
−=
Nepster
高亮
欧拉
方法
快递客服问题件处理详细方法山木方法pdf计算方法pdf华与华方法下载八字理论方法下载
Automatic Control – C. Novara L1 19
Discrete-time systems: examples
Classical example: Pendulum
Variables:
- y(t) : angular position
- u(t) : external torque
Parameters:
- m : pendulum mass
- L : pendulum length
- g : gravity constant
- J=mL2 : moment of inertia
- β : friction
- k=gmL
mg
u(t)
y(t)
L
Automatic Control – C. Novara L1 20
Discrete-time systems: examples
� Pendulum differential equation:
� Forward Euler discretization method:
where y(k)=y(kT) and T is the sampling period.
( ) ( ) ( ) ( ) ( ) ( ) ( )
2
12211
T
kykyky
T
kyky
)k(y,
T
kyky
)k(y
++−+
=
−+
≅
−+
≅
&&
&&&
� Discretized pendulum difference equation:
[ ] )t(u)t(y)t(ysink)t(yJ +β−−= &&&
( ) ( ) ( ) [ ]
J
T
b,
J
kT
a,
J
T
a,
J
T
a
)k(bu)k(ysinakyakyaky
22
321
321
12
2221
==
β
−=−
β
=
−+−−−−−−=
Automatic Control – C. Novara L1 21
Discrete-time systems: examples
Matlab program for simulation of pendulum time evolution
% Parameters
m=1; l=0.8; J=m*l^2; K=9.81*m*l; beta=0.6; T=0.01;
a1=2-T*beta/J; a2=-1+T*beta/J; a3=-T^2*K/J; b=T^2/J;
% Initial conditions
y=[pi/4;pi/4];
% Time evolution by iteration of the difference equation
for k=3:4000
u(k)=sin(0.01*k);
y(k)=a1*y(k-1)+a2*y(k-2)+a3*sin(y(k-2))+b*u(k-2);
end
Automatic Control – C. Novara L1 22
Discrete-time systems: examples
� Moving Average:
� Maximum:
� Ideal Delay System:
[ ] 4321 /)k(u)k(u)k(u)k(u)k(y −+−+−+=
[ ])k(u),k(u),k(umax)k(y 21 −−=
)kk(u)k(y 0−=
Automatic Control – C. Novara L1 23
Discrete-time systems: memoryless systems
� A system is memoryless if the output y(k) at each time k
depends only on the input u(k) at the same time k.
� Example of memoryless systems
� Square:
� Sign:
� Counter Example
� Ideal Delay System:
2)k(u)k(y =
[ ])k(usign)k(y =
)kk(u)k(y o−=
Automatic Control – C. Novara L1 24
Discrete-time systems: causal systems
� A system is causal if its output is a function of only the
current and previous samples.
Example
� Backward Difference:
Counter example, non-causal system
� Forward Difference: )k(u)k(u)k(y ++= 1
)k(u)k(u)k(y 1−−=
Automatic Control – C. Novara L1 25
Discrete-time systems: linear systems
� Linear Time Invariant (LTI) discrete-time system:
1 2 0 1( ) ( 1) ( 2) ( ) ( 1)
( 1) ( ) ( )
( ) ( ) ( )
y k a y k a y k b u k b u k
x k Ax k Bu k
y k Cx k Du k
= − − − − + + + − +
+ = +
= +
K K
� A discrete-time system is linear if
for any input sequences u=[u0 u1 …]
T and v=[v0 v1 …]
T, and for
any real numbers a and b (superposition principle).
( ) )v(bF)u(aFbvauF +=+
input-output
state-space