MATLAB: Stable response for an unstable system

positive polestable responseunstable system

I have a stable system transfer function wich I'm trying to control with a PID controller. The funcion is:
2.494e-008 s^4 + 8.735e-010 s^3 - 5.82e-016 s^2
-------------------------------------------------
s^6 + 0.05155 s^5 + 0.001775 s^4 + 4.491e-005 s^3
and I'm trying to control it with this PID:
9e006 s^2 + 8e006 s + 8e5
-------------------------------------
s
When I do that, I obtain an unstablesystem transer function, with one pole with positive real part, but when I simulate it for a step, I get a stable response. Anyone know what's going on?
G(1)=tf([2.494e-008 8.735e-010 -5.82e-016 0 0],[1 0.05155 0.001775 4.491e-005 0 0 0]);
Kp=8e6;
Ki=8e5;
Kd=9e6;
l=tf([Kd Kp Ki],[1 0]);
n=feedback(l*G(1),1);
step(n,t)
I get this plot as a response: http://tinypic.com/r/1fv6sp/8
Which is great, but does not match the transfer function.

Best Answer

I have computed the poles of the closed-loop system by executing the following command in the MATLAB command line.
>> [z,p,k] = zpkdata(n);
>> p{:}
Note that I use the function zpkdata (See Documentation) to read the poles of the system. The results are shown below
ans =
0.0000 + 0.0000i
0.0000 + 0.0000i
-0.0670 + 0.4265i
-0.0670 - 0.4265i
-0.1071 + 0.0000i
-0.0350 + 0.0000i
0.0000 + 0.0000i
It seems that there are no eigenvalues with positive real parts.
Even if the system is unstable, it does not necessarily mean its step response will diverge. Here is an example
>> A = [1 1; 0 -1]; B = [0;1]; C= [0, 1]; D=0;
>> sys = ss(A,B,C,D);
>> step(sys)
The step response is convergent. However, the system is unstable since A contains 1 as an eigenvalue.