function [Vref,ws,x,werr] = V_f_controleur(Vb,wr_ref,wr,x_old,werr_old) global dt wb Ki = 5.6; Kp = 0.6; wr_ref = wr_ref/wb; wr = wr/wb; werr_old = werr_old/wb; werr = wr_ref - wr; x = x_old + dt/2*Ki*( werr_old + werr ); % Bloc de saturation pour x if x > 0.03 x = 0.03; elseif x < -0.03 x = -0.03; end y = Kp*werr + x; % Bloc de saturation pour y if y > 0.03 y = 0.03; elseif y < -0.03 y = -0.03; end delta = y + wr; ws = delta * wb; % Bloc de saturation pour delta if delta > 1 delta = 1; elseif delta < -1 delta = -1; end Vref = delta * Vb;