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

[MOG,DEF,P_tachy]=def_2_boucles(MOGi,sn1,sd1,sn2,sd2,DEFi)
function [MOG,DEF,P_tachy]=def_2_boucles(MOGi,sn1,sd1,sn2,sd2,DEFi)

NUM=[1];
DEN=[1];
P_tachy=ones(9,2);
te=DEFi(1);
DEF=DEFi;
MOG=MOGi;
if sn1(end)~=';'
    sn1=[sn1,';'];
end;
if sd1(end)~=';'
    sd1=[sd1,';'];
end;
if sn2(end)~=';'
    sn2=[sn2,';'];
end;
if sd2(end)~=';'
    sd2=[sd2,';'];
end;
test1=findstr(sn1,'NUM=');
if isempty(test1)
    MOG(4,5)=uicontrol(gcf,'style','text',...
        'unit','normalized',...
        'position',[0.1 0.5 0.8 0.05],...
        'backgroundcolor','w',...
         'foregroundcolor','r',...
         'string','DEFINIR LES COEFFICIENTS PAR NUM=...',...
         'fontunits','normalized','fontsize',0.5,'fontweight','bold');
    pause(1)
    delete(MOG(4,5)); 
    return;
else
    try
        eval(sn1);
    catch
        MOG(4,5)=uicontrol(gcf,'style','text',...
            'unit','normalized',...
            'position',[0.1 0.5 0.8 0.05],...
            'backgroundcolor','w',...
            'foregroundcolor','r',...
            'string','ERREUR DE PROGRAMMATION !',...
            'fontunits','normalized','fontsize',0.5,'fontweight','bold'); 
        pause(1)
        delete(MOG(4,5)); 
        return;
    end;
end;
test2=findstr(sd1,'DEN=');
if isempty(test2)
    MOG(4,6)=uicontrol(gcf,'style','text',...
        'unit','normalized',...
        'position',[0.1 0.3 0.8 0.05],...
        'backgroundcolor','w',...
        'foregroundcolor','r',...
        'string','DEFINIR LES COEFFICIENTS PAR DEN=...',...
        'fontunits','normalized','fontsize',0.5,'fontweight','bold');
    pause(1)
    delete(MOG(4,6)); 
    return;
else
    try
        eval(sd1);
    catch
        MOG(4,6)=uicontrol(gcf,'style','text',...
            'unit','normalized',...
            'position',[0.1 0.3 0.8 0.05],...
            'backgroundcolor','w',...
             'foregroundcolor','r',...
             'string','ERREUR DE PROGRAMMATION !',...
             'fontunits','normalized','fontsize',0.5,'fontweight','bold'); 
        pause(1)
        delete(MOG(4,6)); 
        return;
    end;
end;
NUM1=NUM;
DEN1=DEN;
Hr=tf(NUM1,DEN1);
Hdr=c2d(Hr,te,'tustin');
[NUM1Z,DEN1Z]=tfdata(Hdr,'v');
test1=findstr(sn2,'NUM=');
if isempty(test1)
    MOG(4,5)=uicontrol(gcf,'style','text',...
        'unit','normalized',...
        'position',[0.1 0.5 0.8 0.05],...
        'backgroundcolor','w',...
        'foregroundcolor','r',...
        'string','DEFINIR LES COEFFICIENTS PAR NUM=...',...
        'fontunits','normalized','fontsize',0.5,'fontweight','bold');
    pause(1)
    delete(MOG(4,5)); 
    return;
else
    try
        eval(sn2);
    catch
        MOG(4,5)=uicontrol(gcf,'style','text',...
            'unit','normalized',...
            'position',[0.1 0.5 0.8 0.05],...
            'backgroundcolor','w',...
        'foregroundcolor','r',...
        'string','ERREUR DE PROGRAMMATION !',...
        'fontunits','normalized','fontsize',0.5,'fontweight','bold'); 
        pause(1)
        delete(MOG(4,5)); 
        return;
    end;
end;
test2=findstr(sd2,'DEN=');
if isempty(test2)
    MOG(4,6)=uicontrol(gcf,'style','text',...
        'unit','normalized',...
        'position',[0.1 0.3 0.8 0.05],...
        'backgroundcolor','w',...
        'foregroundcolor','r',...
        'string','DEFINIR LES COEFFICIENTS PAR DEN=...',...
        'fontunits','normalized','fontsize',0.5,'fontweight','bold');
    pause(1)
    delete(MOG(4,6)); 
    return;
else
    try
        eval(sd2);
    catch
        MOG(4,6)=uicontrol(gcf,'style','text',...
            'unit','normalized',...
        'position',[0.1 0.3 0.8 0.05],...
        'backgroundcolor','w',...
        'foregroundcolor','r',...
        'string','ERREUR DE PROGRAMMATION !',...
        'fontunits','normalized','fontsize',0.5,'fontweight','bold'); 
        pause(1)
        delete(MOG(4,6)); 
        return;
    end;
end;
NUM2=NUM;
DEN2=DEN;
Hg=tf(NUM2,DEN2);
Hdg=c2d(Hg,te,'tustin');
[NUM2Z,DEN2Z]=tfdata(Hdg,'v');
P_tachy=meme_longueur(NUM1,DEN1,NUM1Z,DEN1Z,NUM2,DEN2,NUM2Z,DEN2Z);
lance_correcteur_2_boucles;



Contact us