Skip to content
Snippets Groups Projects

WIP: Started furuta implementation

Open Julian Salt requested to merge furuta into julia1
Compare and
3 files
+ 165
0
Compare changes
  • Side-by-side
  • Inline
Files
3
using ControlSystems
"""
Furuta pendulum model
"""
function define_furuta_system()
l=0.413;
M=0.01;
Jp=0.0009;
r=0.235;
J=0.05;
m=0.02;
g=9.81;
x0=[0.1; 0; 0; 0];
phidot_lin=0;
alfa=Jp+M*l^2;
beta=J+M*r^2+m*r^2;
gamma=M*r*l;
epsilon=l*g*(M+m/2);
Afc=[0 1 0 0;
(beta*epsilon+alfa*beta*phidot_lin^2)/(alfa*beta-gamma^2) 0 0 0;
0 0 0 1;
-(gamma*epsilon+alfa*gamma*phidot_lin^2)/(alfa*beta-gamma^2) 0 0 0];
Bfc=[0 -gamma/(alfa*beta-gamma^2)*g 0 alfa/(alfa*beta-gamma^2)*g]';
Cfc=zeros(4,4);
for i = 1:4
Cfc[i,i] = 1;
end
Dfc=zeros(4,1);
ss(Afc,Bfc,Cfc,Dfc)
end
Loading