Section 10.2
Representation of Systems in MATLAB
535
1.5
1
0.5
2
0
1.5
0
0.05
1
0.5
0.1
0
Time (s)
2
(kg m )
Load inertia J
Figure 10.5
load
Response of the closed-loop servomotor to a step command in posi- tion as a function of load
inertia.
Upon executi
Section 10.3
Response of Systems
hold on
for i =
0:13
x0 = [-1.4+0.2*i, 1];
[y, t, x] = initial(PlantRPM, x0, t);
plot(x(:,2), x(:,1), 'k-')
k = floor(0.05*length(t);
plot(x(k,2),x(k,1),'ro')
end
for i = 0:13
x0 = [-1+0.2*i, -1];
[y, t, x] = initial(Plant
Section 10.3
Response of Systems
559
6
4
2
0
2
4
Angle
6
Command
8
0
Figure 10.17
10
20
30
40
50
System identification data set. The x-axis is time.
net delay. Because we have simulated the data, we know in advance that the sys- tem has three poles; in
pr
Section 10.3
Response of Systems
551
10.3.2 Estimating Response from Poles and Zeros
When using MATLAB to solve control problems, it is important to have a qualita- tive understanding of the
solution
of differential equations. Since controller design is a
552
Chapter 10
Control Systems
y = step(tf([polevect(i)], [1, polevect(i)]), t);
plot(t, y, 'k-')
end xlabel('Time')
ylabel('Step response')
text(0.2, 0.95, '\sigma = 2')
text(3, 0.1 ,'\sigma = 0.1 (\Delta\sigma = 0.1)')
The results from executing this sc
550
Chapter 10
Upon
execution, we obtain
Figure
10.10. Note
that
Control Systems
after
an initial transient, the error settles to
approximately 0.13. A control system design objective could be to reduce this steady-state error to less than 0.05.
For a sta
Section 10.3
Response of Systems
553
for i = 1:length(omega)
data(:,i) = step(tf([sigma^2 + omega(i)^2], [1 2*sigma sigma^2+omega(i)^2]), t);
end subplot(2,2,3) mesh(t, omega, data')
ylabel('\omega') xlabel('Time')
zlabel('Response')
title('Response as a
Section 10.3
Response of Systems
557
legend('zero at -5', 'zero at -1', 'zero at 1', 'zero at 5')
xlabel('Time')
ylabel('Step response')
Executing this script results in Figure 10.15. The zeros are stable at z = - 5
and z = - 1; however, for the cases whe
558
Chapter 10
Control Systems
masking its effect. However, this is not generally practical to do, since in order to
force G3 to move quickly, G4 will initially produce a large output, which may saturate
or damage the actuators. This can be observed in th
Section 10.4
Figure 10.24
Design Tools
Root-locus plots of the motor positioning system: (a) proportional
controlled, and (b) lead controlled
569
Figure 10.24
Root-locus plots of the motor positioning system: (a) proportional
controlled, and (b) lead cont
560
Chapter 10
Control Systems
of the three models are then compared using the System Identification toolbox
function compare.
Ts = 5e-2; N = 1000;
u = zeros(N, 1);
Jmodel = rand;
clSys = feedback(c2d(MotorSS(Jmodel), Ts), 0.4);
r = 1;
for i = 1:length(u)
Section 10.4
Design Tools
561
Design criteria for control systems involve three requirements:
Stability
Transient response
Steady-state response
The consequences of instability are clarified when solving the differential equa- tions. Each root of the
d
Section 10.4
Design Tools
565
Frequency-based design does not require an explicit model, only the results from a col- lection of experiments.
The last two methods require very good models of the plant.
In the course of illustrating the use of these design
572
Chapter 10
Control Systems
20
15
10
5
0
5
10
15
15
20
40
35
30
25
10
20
Real axis
Figure 10.25 Closed-loop poles of the optimal controller as a function of the input cost weight R.
hold on
plot(real(clPoles), imag(clPoles), 'kx')
5
0
axis(40*[-1, 0, -
564
Chapter 10
Control Systems
of its final value. A related value is peak time, the time of the first maximum. In this
particular system, rise time and peak time are in conflict with the next criteria, which
is overshoot. Percentage overshoot is the amou
Section 10.4
Design Tools
563
amount of gain that may be applied before the system becomes unstable) is
gm = 128.38 or 42.2 dB.
Even if the closed-loop system is stable, the behavior may not be acceptable.
Consider the step response of the DC permanent ma
554
Chapter 10
Response as a function of : = 1.0
Pole location
Imaginary axis
2
Control Systems
2
Response
1
1
0
10
0
1
5
0
0.5
1
Time
2
0
2
1
0
1
Real axis
Response as a function of : = 0.5
Pole location
2
Imaginary axis
Response
2
1
10
0
1
0
1
5
2
Time
Section 10.3
Response of Systems
549
MATLAB does not supply functions for all standard test inputs. However, MATLAB does provide
the capability of determining the response of a system to an arbitrary input by using
lsim (sys, u, t)
where sys is the system
Section 10.2
Representation of Systems in MATLAB
533
C=
1
0
0
D=
0
MATLAB provides functions that take system objects such as MotorSS as
an argument. Suppose that we wish to examine the behavior of the motor when it
is connected in a simple feedback confi
536
Chapter 10
Control Systems
where
N(s) = kt
(10.5)
D(s) = JLs3 + (JR + bL)s2 + (bR + ktkb)s + 0
MATLAB represents these polynomials as vectors containing the polynomial coefficients, from highest
power
to the constant. In the case of the servomotor, th
534
Chapter 10
Control Systems
Example 10.2 Step response of a servomotor
We shall determine the response of the servomotor shown in Figure 10.1, connected
with unity feedback as shown in Figure 10.3, to a step input. The script is
[y, t] = step(feedback(
Section 10.2
Representation of Systems in MATLAB
537
in the command window, the following is displayed:
Transfer function:
15
0.00015 s^3 + 0.15 s^2 + 1.925 s
The coefficients of the numerator and denominator polynomials, Num and Den, are the essential da
538
Chapter 10
Control Systems
which are the closed-loop poles of the simple unity feedback control system. The function tzero returns
the transmission zeros of a plant. Thus, the execution of
z = tzero(feedback(MotorTF, 1)
returns z as an empty matrix; t
Section 10.2
Representation of Systems in MATLAB
539
each other, an embedded computer will only observe the angle and change the voltage v(t) at fixed times. To
design a controller for an embedded computer, it is helpful to have a set of tools for studyin
Section 10.2
Representation of Systems in MATLAB
Figure 10.6
541
Comparison of the discrete-time step response and the continuous-
time step response. (The continuous-time step response and the discrete-time
response overlap.)
In discrete time, transfer f
540
Chapter 10
Control Systems
where is the sampling interval as long as the matrices Ad and Bd are chosen properly. With a zero-order hold
approximation, the discrete time matrices are given by3
Ad = e A
A( - t)
Bd =
e
Bdt
3
0
which maps all left-half co
Section 10.2
Representation of Systems in MATLAB
545
This brings up the SIMULINK library browser window, which displays a list of
available libraries and includes the SIMULINK main library. First, we click on the
new page icon (white rectangle) to open a
542
Chapter 10
Control Systems
response (IIR) filter. A computer can implement this type of algorithm at each sample time with a series of multiplications and additions as long as the computer stores
previous values of the computed output and measured inp
Section 10.2
Representation of Systems in MATLAB
standard operators + , - , *, /
543
and provides feedback, series, and connect,
among others, so that from the command line the block diagrams may be implemented and simulated. The SIMULINK toolbox provides
544
Chapter 10
Control Systems
operations allow the quick construction of MIMO systems. For example, a two-input, one-output system H3
can be created from SISO plants, H1 and H2, using
H3 = [H1, H2]
A one-input, two-output system can be created with
H3 =