Está en la página 1de 2

>> %sintonia de controladores metodo Z-N

>> %vector tiempo


>> t=0:0.1:30;
>> s=tf('s');
>> %Funcion de la panta
>> ng=[1];
>> dg=[1 6 5 0];
>> G=tf(ng,dg);
>> clf,rlocus(G);
>> [km,pole]=rlocfind(G)
Select a point in the graphics window
selected_point =
-0.0048 + 2.2371i
km =
29.9797
pole =
-5.9995
-0.0002 + 2.2354i
-0.0002 - 2.2354i
>> wm=max(imag(pole))
wm =
2.2354
>> kc=0.6*km;
>> ti=0.5*2*pi/wm;
>> td=0.125*2*pi/wm;
>> gc=kc*(ti*td*s^2+ti*s+1)/(ti*s);
>> gd=series(G,gc);
>> GT=feedback(gd,1);
>> y1=step(GT,t);
>> GS=feedback(G,1);
>> y2=step(GS,t);
>> plot(t,[y1 y2])
>> grid on
>> title('Sintona del controlador PID')
>> xlabel('Tiempo'),ylabel('Amplitud')
>> kc_p=0.5km;
??? kc_p=0.5km;
|
Error: Unexpected MATLAB expression.
>>
>>
>>
>>
>>
>>
>>
>>

kc_p=0.5*km;
kc_pi=0.45*km;
ti_pi=2*pi/(wm*1.2);
gc_p=kc_p;
gc_pi=kc_pi*(1+1/(ti_pi*s));
gd_p=series(G,gc_p);
gd_pi=series(G,gc_pi);
GT_p=feedback(gd_p,1);

>>
>>
>>
>>
>>
>>

GT_pi=feedback(gd_pi,1);
yp=step(GT_p,t);
ypi=step(GT_pi,t);
plot(t,[yp ypi y1 y2])
legend('P-control','PI-control','PID-control','Sin regulador');

También podría gustarte