Code covered by the BSD License  

Highlights from
Logiciels temps réel

Logiciels temps réel

by

 

Real-time software concerning the domains of the signal processing, feedback and regulation

estimflux(u)
    function y = estimflux(u)
%#eml

persistent x;
if isempty(x)
    x=[0;0];
end;
udq=u(1:2);
idq=u(3:4);
idq_der=u(5:6);
omega=u(7);
Rs=3.5;
Ls=0.3;
Rr=0.4;
Lr=0.068;
Msr=0.12;
p=2;
Te=5e-4;
Tr=Lr/Rr;
Rsr=Rs+Rr*(Msr/Lr)^2;
sigma=1-Msr^2/(Ls*Lr);
K1=0.565;
K2=-0.1;
K=[K1,-K2;K2,K1];
A=[-1/Tr,-omega;omega,-1/Tr];
C=(Msr/Lr)*A;
Y=udq-Rsr*idq-sigma*Ls*idq_der;
x_der=idq*Msr/Tr+K*(Y-C*x)+A*x;
x=x+x_der*Te;
y=x;

Contact us