WICHTIG: Der Betrieb von goMatlab.de wird privat finanziert fortgesetzt. - Mehr Infos...

Mein MATLAB Forum - goMatlab.de

Mein MATLAB Forum

 
Gast > Registrieren       Autologin?   

Partner:




Forum
      Option
[Erweitert]
  • Diese Seite per Mail weiterempfehlen
     


Gehe zu:  
Neues Thema eröffnen Neue Antwort erstellen

Zustandsregler - Ackermann - kein einschwingen - Simulink

 

kyriel
Forum-Newbie

Forum-Newbie


Beiträge: 3
Anmeldedatum: 12.03.16
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 12.03.2016, 21:46     Titel: Zustandsregler - Ackermann - kein einschwingen - Simulink
  Antworten mit Zitat      
Hi Leute,

ich habe mit Hilfe von MATLAB mir einen Rückführvektor berechnen lassen der das System leider nicht stabilisiert. Ich weiss nicht woran es liegt. Vllt kann mir Jmd. von euch einen Tipp geben.

Es geht um ein Dreifachpendel. Ich habe dafür das mathematische Modell aufgestellt und es auf die Form: \dot x=f(x,u) gebracht. Das habe ich nun linearisiert um eine Ruhelage: Gelenk1 oben, Gelenk2 unten, Gelenk3 oben. Mit der linearisierten Dynamikmatrix und dem linearisierten Eingangsvektor und ensprechender Polvorgabe habe ich mit dem Befehl:acker(A,b,pol) mit einen Rückführvektor berechnet.

Im Anhang befinden sich die Initialisations- und Simulinkdatei.

Ich habe versucht in den Dateien so gut mir möglich war zu kommentieren.

VG

P.s. bin Neuling - bitte habt Nachsicht, falls ich die allg. Beschreibungsform noch nicht getroffen habe.

Code:
%--------------------------------------------------------------
%Systemzustände definieren
%--------------------------------------------------------------
syms x1;    %Wagenposition
syms x2;    %Wagengeschwindigkeit
syms x3;    %Winkel von Gelenk 1
syms x4;    %Winkelgeschwindigkeit von Winkel1
syms x5;    %Winkel von Gelenk 2
syms x6;    %Winkelgeschwindigkeit von Winkel2
syms x7;    %Winkel von Gelenk 3
syms x8;    %Winkelgeschwindigkeit von Winkel3
syms u;      %Beschleunigung


%--------------------------------------------------------------
% Modellparameter
%--------------------------------------------------------------
%Pendelarm 1
l12      = 0.323; %Länge zwischen Pendelarm 1 und 2
ls1     = 0.2121; %Abstand bis zum Schwerpunkt Gelenk 1
mG1     = 0.8083; %Masse Gelenk 1
J_G1xx   = 0.013; %Massenträgheitsmoment Gelenk 1
kG1     = 0.0297; %Reibungskonstante von Gelenk 1

%Pendelarm 2
l23      = 0.4190; %Länge zwischen Pendelarm 2 und 3
ls2     = 0.2929; %Abstand bis zum Schwerpunkt Gelenk 2
mG2     = 1.0040; %Masse Gelenk 2
J_G2xx   = 0.0235; %Massenträgheitsmoment Gelenk 2
kG2     = 0.000; %Reibungskonstante von Gelenk 1

%Pendelarm 3
ls3     = 0.2276; %Abstand bis zum Schwerpunkt Gelenk 3
mG3    = 0.5080; %Masse Gelenk 3
J_G3xx   = 0.0165; %Massenträgheitsmoment Gelenk 3
kG3     = 0.0003; %Reibungskonstante von Gelenk 3
g        = 9.8144; %Gravitationskonstante

par_pendel = [l12 ls1 mG1 J_G1xx kG1 l23 ls2 mG2 J_G2xx kG2 ls3 mG3 J_G3xx kG3 g]; %Parametervektor für Simulinkmodell
%--------------------------------------------------------------
%System mit x_dot=f(x,u)
%--------------------------------------------------------------
f1=[x2;
  u;
  x4;
  ((((2*l12*l23*ls2.^2-2*l12*l23.^2*ls2)*ls3.^2*(x6).^2*sin(2*x7-x5-x3)+(g*l12*l23*ls2-g*l12*l23.^2)*ls3.^2*sin(2*x7-2*x5+x3)+(u*l12*l23*ls2-u*l12*l23.^2)*ls3.^2*cos(2*x7-2*x5+x3)+(g*l12*l23.^2-g*l12*l23*ls2)*ls3.^2*sin(2*x7-2*x5-x3)+(u*l12*l23*ls2-u*l12*l23.^2)*ls3.^2*cos(2*x7-2*x5-x3)+(2*g*l12*l23*ls2-2*g*l12*ls2.^2)*ls3.^2*sin(2*x7-x3)+(2*u*l12*l23*ls2-2*u*l12*ls2.^2)*ls3.^2*cos(2*x7-x3)+(2*l12.^2*ls2.^2-2*l12.^2*l23*ls2)*ls3.^2*(x4).^2*sin(2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J_G3xx*l23.^2*ls1.^2)*mG1+4*J_G1xx*J_G2xx*ls3.^2+4*J_G1xx*J_G3xx*l23.^2+4*J_G2xx*J_G3xx*l12.^2)*mG3+(2*J_G3xx*l12.^2*ls2.^2-2*J_G3xx*l12.^2*ls2.^2*cos(2*x5-2*x3))*mG2.^2+(4*J_G3xx*ls1.^2*ls2.^2*mG1+4*J_G1xx*J_G3xx*ls2.^2+4*J_G2xx*J_G3xx*l12.^2)*mG2+4*J_G2xx*J_G3xx*ls1.^2*mG1+4*J_G1xx*J_G2xx*J_G3xx)];

%--------------------------------------------------------------
%Linearisierung und Zustandsrückführung
%--------------------------------------------------------------

%------------------------------Ruhelagen------------------------
xv = {x1,x2,x3,x4,x5,x6,x7,x8,u}; %xv-Zustandsliste
xs000 = {0,0,0,0,0,0,0,0,0};    %xs000 dedeutet:Winkel1 oben, Winkel 2 oben, Winkel 3 oben
xs100 = {0,0,pi,0,0,0,0,0,0};   %xs100 dedeutet:Winkel1 unten, Winkel 2 oben, Winkel 3 oben
xs010 = {0,0,0,0,pi,0,0,0,0};  
xs001 = {0,0,0,0,0,0,pi,0,0};
xs110 = {0,0,pi,0,pi,0,0,0,0};
xs011 = {0,0,0,0,pi,0,pi,0,0};
xs101 = {0,0,pi,0,0,0,pi,0,0};
xs111 = {0,0,pi,0,pi,0,pi,0,0};

xs999 = {1,2,3,4,5,6,7,8,1};

x0_pendel = [0 0 0 0 pi 0 0 0]; %Anfangszustand für Simulinkmodell

rl=xs011;
%------------------------------Polvorgabe-----------------------
pol2 =[-2,-2,-1.64,-5.38,-1.04+6.8*1i,-1.04-6.8*1i,-1.35,-8.97]; %Wunscheigenwerte für RL xs010
pol3 =[-2,-1,-1.008+4.56i,-1.008-4.56i,-7.81,-1.03+8.25i,-1.03-8.25i,-4.54]; %Wunscheigenwerte für RL xs011
%----------------------------------------------------------------

x=[x1;x2;x3;x4;x5;x6;x7;x8]; %Zustandsvektor
A=jacobian(f2,x); %f(x,u) nach vektor x ableiten - ergibt Dynamikmatrix
b=jacobian(f2,u); %f(x,u) nach u ableiten ergibt - Eingangsvektor


A_RL = double(subs(A,xv,rl)) %Linearisierte Dynamikmatrix in RL-xs
b_RL = double(subs(b,xv,rl)) %Linearisierter Eingangsvektor in RL-xs
%hier werden die Symbole x1...x9 in double umgewandelt -> die Ruhelage um
%die linearisiert wird, stehen in xv mit den Werten von rl

% -----------------------Ackermann------------------------------
 k1=acker(A_RL,b_RL,pol2) %Zustandsrückführvektor nach Ackermann
% ---------------------------LQR--------------------------------
 Q=eye(8)*3; %Geschwindigkeit mit der die einzelnen Zustände gegen Null getrieben werden
 R=1; %R=skalar falls ein Eingang;Je größer DiaMatrix desto kleiner Stellgröße -> desto langsamer Regelung
 k2=lqr(A_RL,b_RL,Q,R)


Dreifachpendel_ini.m
 Beschreibung:

Download
 Dateiname:  Dreifachpendel_ini.m
 Dateigröße:  22.85 KB
 Heruntergeladen:  557 mal
dreifach_Pendel_sim.slx
 Beschreibung:

Download
 Dateiname:  dreifach_Pendel_sim.slx
 Dateigröße:  20.03 KB
 Heruntergeladen:  518 mal
Private Nachricht senden Benutzer-Profile anzeigen


kyriel
Themenstarter

Forum-Newbie

Forum-Newbie


Beiträge: 3
Anmeldedatum: 12.03.16
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 13.03.2016, 23:14     Titel: Solved
  Antworten mit Zitat      
Problem gelöst. Man muss den Ausgang um die linearisierte Ruhelage abziehen.
Private Nachricht senden Benutzer-Profile anzeigen
 
Neues Thema eröffnen Neue Antwort erstellen



Einstellungen und Berechtigungen
Beiträge der letzten Zeit anzeigen:

Du kannst Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.
Du kannst Dateien in diesem Forum posten
Du kannst Dateien in diesem Forum herunterladen
.





 Impressum  | Nutzungsbedingungen  | Datenschutz | FAQ | goMatlab RSS Button RSS

Hosted by:


Copyright © 2007 - 2024 goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks

MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.