%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Programme helico.m %%% %%%%%%%%%%%%%%%%%%%%%%%%%% clear all; close all %% Grandeurs caractéristiques du système % Longueurs Lb1=0.286; Lb2=0.893; Lc=0.281; L1=0.052; L2=0.207; L3=0.034; Lh=0.177; L=Lb2-L2; Lprim=L1+L3; % Masses m1=0.1257; m2=0.5578; mc=1.8215; mh=1.4109; % Coefficients de frottement fe=0.23; ft=0.005; fl=0.15; % Divers alpha=21.3/180*pi; g=9.81; K1=0.465; K2=-0.46; %% Centres de gravité x1=-L2-Lb1*cos(alpha)/2; y1=-L1+Lb1*sin(alpha)/2; x2=Lb2/2-L2; y2=-L1; xc=-L2-Lc*cos(alpha); yc=-L1+Lc*sin(alpha); %% Calcul du point d'équilibre Theta0=0.3; a=m1*x1*y1+m2*x2*y2+mc*xc*yc-mh*L*Lprim; b=-fl*cos(Theta0)/sin(Theta0); c=g*(m1*x1+m2*x2+mc*xc+mh*L); delta=b^2-4*a*c; V0=(-b-sqrt(delta))/(2*a); Ug0=(mh*Lh*sin(Theta0)*cos(Theta0)*V0^2+fl*V0/(L*sin(Theta0))-2*K2)/(2*K1); Ud0=(-mh*Lh*sin(Theta0)*cos(Theta0)*V0^2+fl*V0/(L*sin(Theta0))-2*K2)/(2*K1); %% Paramètres issus de la linéarisation du système autour de epsilon0=0, Theta0=0.3, V0 % Moments d'inerties J_epsilon=m1*(x1^2+y1^2)+m2*(x2^2+y2^2)+mc*(xc^2+yc^2)+mh*(L^2+Lprim^2+Lh^2*sin(Theta0)^2); J_theta=mh*Lh^2; J_lambda=m1*x1^2+m2*x2^2+mc*xc^2+mh*(L^2+Lh^2*cos(Theta0)^2); J_epsilon_lambda=mh*Lh^2*cos(Theta0)*sin(Theta0); % Coefficients de Coriolis C_epsilon_theta=2*mh*Lh^2*sin(Theta0)^2*V0; C_epsilon_lambda=-2*(m1*x1*y1+m2*x2*y2+mc*xc*yc-mh*L*Lprim)*V0; C_theta_lambda=2*mh*Lh^2*V0*sin(Theta0)*cos(Theta0); % Gains d'angles k_epsilon1=(m1*(x1^2-y1^2)+m2*(x2^2-y2^2)+mc*(xc^2-yc^2)+mh*(L^2-Lprim^2-Lh^2*sin(Theta0)^2))*V0^2-g*(m1*y1+m2*y2+mc*yc-mh*Lprim); k_epsilon3=K1*Lh*(Ug0-Ud0)-Lprim*(K1*(Ud0+Ug0)+2*K2)*sin(Theta0); k_theta1=L*(K1*(Ud0+Ug0)+2*K2)*sin(Theta0); k_theta2=mh*Lh^2*cos(2*Theta0)*V0^2; k_theta3=L*(K1*(Ud0+Ug0)+2*K2)*cos(Theta0); % Gains de commande k_u1=K1*L*cos(Theta0); k_u2=K1*Lh; k_u3=K1*L*sin(Theta0); %% Système linéarisé % Matrices pour le système linéarisé J=[J_epsilon 0 -J_epsilon_lambda; 0 J_theta 0; -J_epsilon_lambda 0 J_lambda]; M=[-k_epsilon1 -fe -k_theta1 -C_epsilon_theta C_epsilon_lambda; 0 C_epsilon_theta -k_theta2 -ft -C_theta_lambda; -k_epsilon3 -C_epsilon_lambda k_theta3 C_theta_lambda -fl]; N=[k_u1 k_u1; -k_u2 k_u2; k_u3 k_u3]; % Solution du système linéarisé matrice_pour_A=inv(J)*M; matrice_pour_B=inv(J)*N; %% Représentation d'état A=[0 1 0 0 0; matrice_pour_A(1,:); 0 0 0 1 0; matrice_pour_A(2,:); matrice_pour_A(3,:)]; B=[0 0; matrice_pour_B(1,:); 0 0; matrice_pour_B(2,:); matrice_pour_B(3,:)]; C=[1 0 0 0 0; 0 0 0 0 1]; D=[0 0; 0 0]; bicoptere=ss(A,B,C,D);