Define the TRANSFER FUNCTION, standard form for a 2nd order

EGR 326
HW 11 Solutions
April 28, 2017
3 Mass – 4 Spring System Control Design
To apply the design criteria given: PO = 3% and ts = 3s, use the expressions on pages
240 – 241 in the text.
Using Matlab to perform these calculations results in:
dampR = 0.7448
natlF = 1.7902
pole1 = -1.3333 + 1.1946i
pole2 = -1.3333 - 1.1946i
These are also written out on EGR paper, on the following page.
Note that you do not actually need to calculate any feedback gain matrix for the
generic models. You only need to calculate the feedback gain matrix for your actual
6th order system model. This is to say, you need to:
1. Determine the eigenvalues for a generic 2nd order system to behave
according to the specified criteria
2. Determine the 4 additional eigenvalues required in order to model a generic
6th order system that behaves as close as possible to the 2nd order
system you defined above in part (1)
3. Force your actual 6th order system model to have the eigenvalues defined
in part (2) above.
a. To do this, you need to apply a closed-loop state feedback controller,
which is defined by the matrix K.
b. So only at this point do you need A and B matrices (from your actual
6th order MSD model) in order to use them with the ‘place()’
command.
EGR 326
HW 11 Solutions
April 28, 2017
parts (a), (b) and (c)
The Matlab script below is used to define the transfer functions for the two generic
systems – the 2nd order and augmented 6th order systems – that have the two
performance characteristics given in the problem statement: 3% overshoot and a
settling time of 3s. This follows the discussion on page 238, which moves from the
state space model, to the transfer function representation. Either form for
representing the systems is fine.
The two transfer functions are found to be:
Transfer function:
3.204
--------------------s^2 + 2.666 s + 3.204
Transfer function:
1.533e05
----------------------------------------------------------------------s^6 + 62.0 s^5 + 147 s^4 + 1.6e04 s^3 + 8.6e04 s^2 + 1.69e05 s + 1.5e05
The step responses of each are shown below.
fig. 1: Step response for generic 2nd order system
fig. 2: Step response for generic 6th order system
These figures show that the 2nd order system achieves the desired performance
criteria with PO = 3% and settling time = 3.23s. The 6th order system also has PO =
3%, with a longer settling time of 3.5 seconds. This slower response (also seen in the
rise time increasing from 1.27s to 1.31s) is expected as a result of the dynamic
response from the 4 additional eigenvalues (see discussion on pp 247-248).
Additional comparison of these two step responses is shown below in figure 3.
EGR 326
HW 11 Solutions
April 28, 2017
fig. 3: Step response of 2nd and 6th order systems compared
part (d): MSD controller design
The design process of the feedback controller for our 3-mass 4-spring system is
shown in the Matlab script below. The resulting K matrix is:
K = [18680
2890
1723
118
-32111
-3727 ]
These values can be interpreted as multipliers on each of the state variables as they
are fed back into the system via the input. Recall that these values modify the
effective system matrix via (A – BK), or through being multiplied by the input matrix
B. This multiplication results in:
B*K=
1.0e+04 *
0
0
0
0.9340
0
0
0
0
0
0.1445
0
0
0
0
0
0.0862
0
0
0
0
0
0.0059
0
0
0
0
0
-1.6056
0
0
0
0
0
-0.1863
0
0
from which we see that the feedback gain matrix is used to modify the coupling
between the 4th state variable (the velocity of the 2nd or middle mass) and all the
other state variables. Looking at the original system matrix A, we see that this could
EGR 326
HW 11 Solutions
April 28, 2017
be achieved by having the feedback controller connect to the 2nd and 3rd springs and
dampers.
A plot showing the behavior of my 6th order MSD model (of the actual 3 mass, 4
spring system), (blue, upper line) as compared to the generic 6th order system
(green, lower line) is below. This graph shows that the peak overshoot and peak
time coincide almost exactly for these two systems. The rise times are also very
close, while the settling time for the actual system, 3.41s, is 0.09s (or 2.6%) faster
than the 3.5s settling time for the generic 6th order system.
Step Response
System: TFsix
Settling time (seconds): 3.5
Amplitude
System: sysCntl
Settling time (seconds): 3.41
0
1
2
3
4
5
Time (seconds)
%
%
%
%
%
%
%
MSDcntlDesign.m
MSD Control Design for HW 11, using the 3 mass, 4 spring continuing
exercise from the text
J Cardell, April 2017
% Define constants, calculated separately from problem statement, for a
% second order system with PO = 3% and ts = 3s, see pages 240-241
zeta = 0.7448;
wn = 1.790;
% damping ratio
% natural frequency rad/s
%% Generic Second Order System
% Define the TRANSFER FUNCTION, standard form for a 2nd order system (see
% page 238)
num = wn^2;
dem = [1 2*zeta*wn wn^2];
% numerator
% denominator
% the roots of the denominator = eigenvalues
eigs = roots(dem);
% define the transfer functoin for this 2nd order system
TF2nd = tf(num, dem)
EGR 326
%
%
%
%
HW 11 Solutions
April 28, 2017
Plot the step response of this generic 2nd order system, and use the
Matlab figure window options to lable the performance characteristics right click within the resulting figure window and select the desired
characteristic.
step(TF2nd)
set(gca, 'FontSize', 18)
grid
%% Augemented for 6th order system
% For a 6th order system, such as the continuing exercise MSD system,
% define 4 additional eigenvalues, to be at least 10x further to the left
% in the LHP (left-half plane), of the complex plane. See page 247. Be sure
% to avoid creating repeated eigenvalues.
for i = 3:6
eigs(i) = real(eigs(1)*10 - (i-3));
end
% Define the characteristic polynomial that has these 6 eigenvalues as its
% roots, and the associated transfer function.
charPoly6 = poly(eigs);
%
%
%
%
%
%
%
%
%
%
%
Note, the final term from 'poly(eigs)' is the constant in the polynomial
expression. If the coefficients of lambda (or s) are 'ci' then the
polynomial is c1*s^6 + c2*s^5 ... c6*s + c7. Recognize that if c7 = 0
then this is a homogeneous equation. If c7 <> 0 then this is a
non-homogeneous equation and c7 is in fact the forcing function - i.e.,
it is the input. Therefore, this terms is the numerator of the transfer
function. The denominator of a transfer function is always the
characteristic equation, or characteristic polynomial, of the system.
ALSO, see page 249 and generic characteristic polynomials defined in the
table and discussed in the following figure.
TFsix = tf([charPoly6(7)], charPoly6)
% Plot the step response of this system as above. Also plot the step
% response of the two transfer functions, together, in order to allow
% visual comparison.
figure
step(TFsix)
set(gca, 'FontSize', 18)
grid
figure
step(TF2nd, TFsix)
set(gca, 'FontSize', 18)
grid
%% Control Law (K matrix) definition for specific MSD system of our
%'continuing exercise'
% From previous homework we have the A and B matrices. Use these with the
% 'place' command in order to find the specific values of the feedback
% matrix K that willforce our 3-mass 4-spring system to have the
% eigenvalues defined above
% Constants / Parameters
k1
k2
c1
c2
=
=
=
=
10;
% spring constant, N/m
20; k3 = 30; k4 = 40;
0.4; % damping coefficient, Ns/m
0.8; c3 = 1.2; c4 = 1.6;
EGR 326
HW 11 Solutions
m1 = 1;
% mass, kg
m2 = 2; m3 = 3;
A = [0 1 0 0 0 0;
-(k1+k2)/m1 -(c1+c2)/m1 k2/m1 c2/m1 0 0
0 0 0 1 0 0
k2/m2 c2/m2 -(k2+k3)/m2 -(c2+c3)/m2 k3/m2 c3/m2
0 0 0 0 0 1
0 0 k3/m3 c3/m3 -(k3+k4)/m3 -(c3+c4)/m3 ];
B = [ 0; 0; 0; 1/m2; 0; 0];
C = [ 1 0 0 0 0 0];
D = [0];
K = place(A, B, eigs)
sysCntl = ss((A-B*K), B, (C-D*K), D);
figure
hMSD6 = stepplot(sysCntl)
% Normalize responses.
setoptions(hMSD6,'Normalize','on');
set(gca, 'FontSize', 18)
grid
figure
hFinal = stepplot(sysCntl, TFsix)
setoptions(hFinal,'Normalize','on');
set(gca, 'FontSize', 18)
grid
April 28, 2017