clc
clear
close all

s = tf('s');

G = 10/(((1+0.1*s)^2)*(1+0.001*s))

G = zpk(G)
G.DisplayFormat = 'Frequency'
G

kg = 10;

%wc = getGainCrossover(G,1)

%[m,f] = bode(G,wc)
%bode(G)
%figure(2)
%W = feedback(G,1)
%bode(W)


%C proporzionale-integrale
C = 4.25*((s+1))/s  %bw = 100
%C = ((s+1))/s


%%C solo integrale, ki/s

%%C = 0.5/s

%solo proporzionale
%C = 1

L = C*G



bode(L)
wc = getGainCrossover(L,1)
[m,f] = bode(L,wc)
dfm = f + 180
% 
W = feedback(L,1);
figure(2)
bode(W)

%figure(3)
%step(W)
