# IMC-based PID Controller for unstable system

1. Nov 7, 2015

### Maylis

1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution
I'm working on parts (c) and (d) now, but I will show my work for (a) and (b) for completeness.

(a)
Starting with the process transfer function

$$g_{p} = \frac {-1.43}{s^{2}+3.687s-7.177}$$

The denominator is factorized,

$$g_{p} = \frac {-1.43}{(s-1.399)(s+5.086)}$$

$$= \frac {-1.43}{-1.399(\frac {-1}{1.399}s+1)5.086(\frac {1}{5.086}s+1)}$$

$$g_{p} = \frac {0.201}{(-0.715s+1)(0.197s+1)}$$

where $\tau_{1}= -0.715$ and $\tau_{2} = 0.197$. The first time constant makes the process unstable. A singularity occurs at

$s = \frac {1}{\tau_{1}} = \frac {1}{0.715} = 1.399$
-------------------------------------------------------------------------------------------------------------------------------------------------
(b)
$$f(s) = \frac {\gamma s + 1}{(\lambda s + 1)^{n}}$$
The controller must be semi-proper with an unstable system.
-------------------------------------------------------------------------------------------------------------------------------------------------
(c)

The invertible part of the process transfer function is found,

$$\tilde {g_{p-}} = \frac {0.201}{0.197s+1}$$
with a filter
$$f = \frac {\gamma s+1}{5s+1}$$
$$q = \tilde {g_{p-}}^{-1}f = \frac {0.197s+1}{0.201} \cdot \frac {\gamma s+1}{5s+1}$$

The controller transfer function is determined,

$$g_{c} = \frac {q}{1-q \tilde {g_{p-}}}$$

$$= \frac { \frac {0.197s+1}{0.201} \frac {\gamma s+1}{5s+1}}{1 - \frac {0.201}{0.197s+1} \cdot \frac {0.197s+1}{0.201} \cdot \frac {\gamma s+1}{5s+1} }$$

$$= \frac {\frac {0.197s+1}{0.201} \cdot \gamma s+1} {(5- \gamma)s}$$

$$= 4.975 \bigg [ \frac {0.197 \gamma s^{2}+(0.197+ \gamma)s + 1}{(5- \gamma)s} \bigg ]$$

Which is of the form of an ideal PID controller,

$$g_{c,PID} = k_{c} \bigg [ \frac {\tau_{I} \tau_{D} s^{2} + \tau_{I}s + 1}{\tau_{I}s} \bigg ]$$
Therefore, for the $\tau_{I}$ term to be equal, $5- \gamma = 0.197+ \gamma$, so $\gamma = 2.402$.

$$g_{c} = 4.975 \bigg [ \frac {0.473s^{2}+2.599s+1}{2.599s} \bigg ]$$
$k_{c} = 4.975$, $\tau_{I} = 2.599$, $\tau_{D} = 0.473/2.599 = 0.182$
-------------------------------------------------------------------------------------------------------------------------------------------------
(d)

And the inputs to the PID controller

However, my output and manipulated inputs look totally wrong, this controller is not working at all!

So I am wondering if I may have done part (c) incorrectly.

2. Nov 7, 2015

### Maylis

I might as well post my work for the next set, which asks to make the controller transfer function semiproper

(e) & (f)
$$q = \frac {0.197s+1}{0.201} \cdot \frac {\gamma s + 1}{(5s+1)^{2}}$$
So here is my controller transfer function worked out
$$g_{c} = \frac { \frac {0.197s+1}{0.201} \cdot \frac {\gamma s + 1}{(5s+1)^{2}}}{1 - \frac {0.201}{0.197s+1} \cdot \frac {0.197s+1}{0.201} \cdot \frac {\gamma s+1}{(5s+1)^{2}}}$$

$$= 4.975 \bigg [ \frac {0.197 \gamma s^{2} + (0.197 + \gamma)s + 1}{25s^{2} + (10-\gamma)s} \bigg ]$$
$$= 4.975 \bigg [ \frac {0.197 \gamma s^{2} + (0.197 + \gamma)s + 1}{(10- \gamma)s( \frac {25}{10-\gamma}s + 1)} \bigg ]$$
Which is of the form
$$g_{c} = k_{c} \bigg [ \frac { \tau_{I} \tau_{D} s^{2} + \tau_{I} s + 1}{\tau_{I} s(\tau_{F}s+1)} \bigg ]$$
So $10 - \gamma = 0.197 + \gamma$, so $\gamma = 4.902$,
This reduces to
$$4.975 \bigg [ \frac {0.966 s^{2} + 5.099s + 1}{5.099s( 4.904s + 1)} \bigg ]$$
Where $\tau_{F} = 4.904$ and $\tau_{D} = 0.966/5.099 = 0.189$
Then I make a new model in simulink

And my output is still diverging

So it seems neither of these controllers are working

Last edited: Nov 7, 2015
3. Nov 7, 2015

### Hesch

I think you have a sign-error in (c).

kc must be negative because kp is negative.

Otherwise you will have a positive feed-back in your control-loop.

4. Nov 7, 2015

### Maylis

It means something might have gone wrong in (b)? Because when I take out the -1.399, it makes the numerator positive

5. Nov 7, 2015

### Hesch

I don't know. I've just sketched a root locus and can see that the rightmost pole ( s = 1.399 ) will cause a root moving to the right if kc → +∞.
But if you let kc → -∞, the root will move to the left ( toward the stable area ).

6. Nov 8, 2015

### Maylis

I don't think I made a sign error, but it's possible that the $k_{p}$ is the problem statement is wrong. Another classmate had the same issue as me, we have not resolved it.

7. Nov 9, 2015

### Hesch

Well, anyway you can see, that if you follow the circulation path in the loop, the sign will be positive. You are not allowed to change the sign of the transferfunction ( -1.43 ) because it can be due to some inverting amplifier in the hardware, or whatever. But you may change the sign of the PID-controller: You are the one to make that decision.

Try it out, see what happens! Don't make a problem out of that.

8. Nov 9, 2015

### Maylis

This is what the grad student responded with in response to the sign of kc and kp being different
Also, I changed the sign of the PID controller, and all that happened was a divergence in the opposite direction.

Last edited: Nov 9, 2015
9. Nov 9, 2015

### Hesch

The grad student says: Be careful with logic like this.
Well, then be careful. Know what you are doing.

By inserting a PID-controller in the loop, you will increase the system order by 1 ( 3. order characteristic equation ). I don't have the "tools" to handle that right now, calculating the optimal zero/pole/amplification. But for simplification, try to set PID = -7 ( just a P-controller ).

The characteristic equation for the system will be: ( s + 1.092 )( s + 2.595 ) = 0.
Thus it must be stable.