You are on page 1of 2

>> %SISTEMA MECANICO

>>
>> m=2;
>> b=10;
>> k=25;
>> H=tf(1,[m b k])

H =

1
-----------------
2 s^2 + 10 s + 25

Continuous-time transfer function.

>> step(H)
Warning: MATLAB has disabled some advanced graphics rendering features by switching
to software OpenGL. For more
information, click here.
>> %-------control
>> figure(1)
>> rlocus(H)
>> kp=269; % proporcional
>> HLC1=feedback(kp*H,1)

HLC1 =

269
------------------
2 s^2 + 10 s + 294

Continuous-time transfer function.

>> figure(2)
>> step(H,HLC1)
>> %-------------control
figure(1)
rlocus(H)
kp=269; %proporcional
HLC1=feedback(kp*H,1)

HLC1 =

269
------------------
2 s^2 + 10 s + 294

Continuous-time transfer function.

>> 200

ans =

200

>> kp=200;
>> HLC1=feedback(kp*H,1)

HLC1 =
200
------------------
2 s^2 + 10 s + 225

Continuous-time transfer function.

>> figure(2)
>> step(H,HLC1)
>>
>> kd=20; % deriv
>> HLC2=feedback(tf([kd kp],1)*H,1)

HLC2 =

20 s + 200
------------------
2 s^2 + 30 s + 225

Continuous-time transfer function.

>> figure(2)
>> step(H,HLC1,HLC2)
>> kd=10;
>>
>> ki=400;
>> GPID=tf([kd kp ki],[1 0];
GPID=tf([kd kp ki],[1 0];
|
Error: Unbalanced or unexpected parenthesis or bracket.

Did you mean:


>> GPID=tf([kd kp ki],[1 0]);
>> HLC3=feedback(GPID*H,1)

HLC3 =

10 s^2 + 200 s + 400


----------------------------
2 s^3 + 20 s^2 + 225 s + 400

Continuous-time transfer function.

>> figure(3)
>> step(HLC2,HLC3)
>>

You might also like