Feedback Control of Computing Systems

Chapter 9.7 - Designing PI Controllers In MATLAB

*9.7   DESIGNING PI CONTROLLERS IN MATLAB

In this section we describe ways to use MATLAB in controller design. In
Section 8.8 we introduce the MATLAB functions feedback, pole, zero,
dcgain, and rlocus. Here we show how to construct transfer functions for
sets of controller parameters and how to estimate the settling time and overshoot
from the closed-loop transfer function.

Our starting point is Figure 9.27 in which we plot ess, k*s , and MP for many
combinations of KP and KI. In MATLAB, each KP, KI pair results in a different
transfer function. Thus, we must construct a matrix of transfer functions to
produce Figure 9.27.

Our approach is as follows. We first define vectors for the set of KI and KP
values to consider.

KIV =(-150:-10)’;
KPV = [-50; -43; -30];

Next, we define the transfer function for the Apache HTTP Server.

apache = tf(-.014, [1 -.59],-1);

Now we construct the transfer functions and place the results into the variable
sys_m. The rows of this variable correspond to the values of KP and the columns
to KI.

sys_matrix = [];
for i=1:length(KPV)
   sys_vector = [];
   for k = 1:length(KIV)
   control = tf([KIV(k) 0], [1 -1], -1) + KPV(i);
   sys_vector = [sys_vector feedback(apache*control,1)];
 end
 sys_matrix = [sys_matrix; sys_vector];
end

The outer loop varies KP, and the inner loop changes KI. sys matrix is
initialized to the empty vector. Each iteration of the outer loop constructs a row
vector of transfer functions for the values of KI. These are then appended to
sys matrix.

To estimate the settling time and overshoot, we need the dominant poles of
the closed-loop transfer function. These are the ones with the largest magnitude.

cl = feedback(apache*control,1);
clpoles = poles(cl);
[r,index] = max(abs(clpoles));

The system is stable in closed loop if the magnitude of the dominant pole is less
than 1. In this case, we can estimate the settling time and maximum overshoot,
and compute the actual overshoot using the step command.

if r < 1
   ks(i) = -4/log(r);
   theta = angle(clpoles(index));

   % check pole too close to zero
   if abs(theta)< 0.00 mp(i) =0;

   % check for negative pole
   elseif abs(theta - pi)< 0.001 mp(i) = r;

   % largest pole is complex
   else mp(i) = r^(pi/theta);
   end

   [y,t] = step(cl);
   mp_actual(i) = (max(y) - dcgain(cl))/dcgain(cl);
end % if

Inside a loop, this set of commands creates a vector of values for ks and MP
(actual and estimated), which can then be plotted.

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Refrigeration Compressors and Air Conditioning Compressors
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.