# Steady state error of control system on MATLAB

1. Apr 20, 2012

### geft

Given the following system (d(t)=0), I'm supposed to calculate the steady state error for unit step and unit ramp inputs respectively.

Basically, the open-loop transfer function of the system is
$$\frac { 3s+0.5 }{ s({ s }^{ 2 }+3s+8) }$$
The closed-loop system is
$$\frac { 3s+0.5 }{ { s }^{ 3 }+{ s }^{ 2 }+11s+0.5 }$$
I found the values of the steady-state errors, but the problem is that the numbers don't match with the simulation. I'm pretty sure there is something wrong with my code since the errors for both step and ramp responses are close to 0. The calculations show 0.5 and infinity respectively.

Here is my working and plots.

Here is my code:
Code (Text):
sys1 = 3 + tf(0.5.*[1], [1 0]);
sys2 = tf([1], [1 3 8]);
sys = feedback(sys1*sys2, 1)

subplot(1,2,1)
step(sys)
hold on
step(tf(1))
hold off

sys3 = tf([1], [1 0]);
subplot(1,2,2)
step(sys*sys3)
title('Ramp Response')
hold on
step(sys3)
hold off