Feedback and control steady state error

1. Mar 27, 2014

Dustinsfl

1. The problem statement, all variables and given/known data
Determine the system type for
$$G(s) = \frac{K}{(s + 1)(10s + 1)(20s + 1)}$$

2. Relevant equations
I am using a step, ramp, and parabolic inputs. That is,
\begin{align}
R(s) &= \frac{R}{s}\\
R(s) &= \frac{R}{s^2}\\
R(s) &= \frac{R}{s^3}
\end{align}

3. The attempt at a solution
For a step input, we have
$$e_{ss} = \lim_{s\to 0}\frac{sR(s)}{1 + G(s)}$$
where $R(s) = \frac{R}{s}$.
\begin{align*}
e_{ss} &= \lim_{s\to 0}\frac{R}{1 + G(s)}\\
&= \frac{R}{1 + \lim\limits_{s\to 0}G(s)}
\end{align*}
Let $\lim\limits_{s\to 0}G(s) = K_p$.
Then
$$e_{ss} = \frac{R}{1 + K_p}.$$
Since $G(s)$ has no poles, that is $\frac{1}{s}$, $K_p < \infty$.
Therefore,
$$e_{ss} = \frac{R}{1 + K_p} = \frac{R}{1 + K}.$$
For a ramp input, $R(s) = \frac{R}{s^2}$.
\begin{align*}
e_{ss} &= \lim_{s\to 0}\frac{R}{s + sG(s)}\\
&= \lim_{s\to 0}\frac{R}{sG(s)}
\end{align*}
Let $\lim\limits_{s\to 0}sG(s) = K_v$.
Then
$$e_{ss} = \lim_{s\to 0}\frac{R}{sG(s)} = \frac{R}{K_v}.$$
In this case, $sG(s)$ has a pole of order $1$.
Therefore, $K_v = 0$.
$$e_{ss} = \frac{R}{K_v} = \infty$$
For a parabolic input, $R(s) = \frac{R}{s^3}$.
\begin{align*}
e_{ss} &= \lim_{s\to 0}\frac{R}{s^2 + s^2G(s)}\\
&= \lim_{s\to 0}\frac{R}{s^2G(s)}
\end{align*}
Let $\lim\limits_{s\to 0}s^2G(s) = K_a$.
Then
$$e_{ss} = \lim_{s\to 0}\frac{R}{s^2G(s)} = \frac{R}{K_a}.$$
In this case, $s^2G(s)$ has a pole of order $2$.
Therefore, $K_a = 0$.
$$e_{ss} = \frac{R}{K_a} = \infty$$
Thus, we have a type $0$ system.

I am confident with everything above, but how do I find the range that $K$ must be in for the cloosed loop system to be stable?

I have been plotting values of $K$, and for $K \geq 0.18$, my steady state error for the step input goes off to infinity when it should be $\frac{R}{1 + K}$. However, the errors for the ramp and parabolic inputs aren't diverging to infinity like they should. If I take $0 < K < 0.18$, the step input error goes to 0 as $t\to\infty$, and the ramp and parabolic error observe a behavior a system of 1 and 2 respectively.

The matlab code I am using is below.

Code (Text):

%  G(s) = K/((s + 1)(10s + 1)(20s + 1))
%  ss error and error constants

%  step input
K = .1;
Gzpk = zpk([], [-1, -1/10, -1/20], K);
G = tf(Gzpk)
H = 1;
clooptf = feedback(G, H);

figure(1);
step(clooptf, 100)

% ramp input
t = (0:0.001:500);
u = t;
[y, x] = lsim(clooptf, u, t);

figure(2);
plot(t, y, t, u);
title('Cloosed-loop response for a ramp input')
xlabel('time(sec)')
ylabel('amplitude')

%  parabolic input
%t2 = (0:0.001:50);
u2 = t.^2;
[y2, x2] = lsim(clooptf, u2, t);

figure(3);
plot(t, y2, t, u2);
title('Cloosed-loop response for a parabolic input')
xlabel('time(sec)')
ylabel('amplitude')

Last edited: Mar 27, 2014
2. Mar 27, 2014

donpacino

You are not modeling your system correctly.
the error is in here...
% step input
K = .1;
Gzpk = zpk([], [-1, -1/10, -1/20], K);
G = tf(Gzpk)
H = 1;
clooptf = feedback(G, H);

Show me an attempt. If you are still stuck I will help you further

3. Mar 27, 2014

Dustinsfl

There isn't an error there.

Also, this doesn't answer how I analytically find the K value that makes the system stable.

4. Mar 27, 2014

donpacino

Gzpk = zpk([], [-1, -1/10, -1/20], K);
This produces the system
k/[ (s+1) (s+1/10) (s+1/20) ]

5. Mar 27, 2014

donpacino

Since your model was wrong the scale of your graphs were off. The ess was indeed going to 1/(1+K) as t approached inf. The ess was approaching inf as t approached inf.

6. Mar 27, 2014

donpacino

I am going to assume that G is your entire system and controller, and there is unity feedback.

r=input
y=output
sys_cl=closed loop system

In this case e=r-y
y=G*e
so y=G*r-y

find the new relationship between y and r (the closed loop system)

expand G and determine the equations for the new poles and evaluate where the system becomes unstable. It should be a product of K. You will then be able to determine the max K.

Note: I pointed out one problem with your work. When someone criticizes do not get defensive, go back and check your work. For the record you said

"However, the errors for the ramp and parabolic inputs aren't diverging to infinity like they should. If I take 0<K<0.18, the step input error goes to 0 as t→∞, and the ramp and parabolic error observe a behavior a system of 1 and 2 respectively."

I was pointing out why you saw that effect

7. Mar 27, 2014

Dustinsfl

That is what G(s) is so that isn't incorrect. We are analzying the unity feedback of the cloosed loop not G(s). What we are looking at is clooptf = feedback(G, H)

8. Mar 27, 2014

milesyoung

I think you're missing the point. Check your algebra:
\begin{align} G(s) &= \frac{K}{(s + 1)(10s + 1)(20s + 1)} = \frac{K}{\frac{10}{10} \frac{20}{20} (s + 1)(10s + 1)(20s + 1)} = \frac{\frac{1}{200} K}{(s + 1)(s + \frac{1}{10})(s + \frac{1}{20})} \end{align}
MATLAB trick:
Code (Text):

s = tf('s');
K = 0.1;
G = K/((s + 1)*(10*s + 1)*(20*s + 1));

Also, system type is given by the number of free integrators (poles at the origin) of your open-loop function. You usually don't iterate over steady-state expressions to determine it. I guess it must be part of your assignment.

You could try to find your systems closed-loop poles by analytically solving its characteristic equation $1 + G(s) = 0$, but that can be rather difficult, depending on polynomial order. If you really want an analytical solution, I'd suggest you get familiar with the Routh–Hurwitz stability criterion.