quadcopter vertical dynamics modelling

2 ビュー (過去 30 日間)
almaz ham
almaz ham 2015 年 2 月 18 日
Hello. I try to get state-space model of my quadcopter vertical motion under gravity.
I can't simulate effect of gravity. For this i try to add matrix K to my state-space model, but without success. There is no difference if i use:
sys = idss(A,B,C,D,K,x0,timestep)
or
sys = ss(A,B,C,D,timestep)
Result same. There is code:
clear all
timestep = 0.002;
m = 0.0027;
g = 9.81;
T_hover = 20000;
Kt = g*m/T_hover;
A = [1 timestep ; 0 1];
B = [+(Kt/m)*(timestep^2)/2 ; +(Kt/m)*timestep];
K = [ -(g)*(timestep^2)/2 ; -(g)*timestep];
C = [1 0];
D = [0];
x0 = [0; 0];
sys = idss(A,B,C,D,K,x0,timestep)
length = 2000;
inputm = zeros(length,1);
inputm(300:500) = 25000;
t = 0:timestep:(length-1)*timestep;
[y_m,t_m,x_m] = lsim(sys,inputm,t,x0);
subplot(2,1,1);
plot(inputm);
title('input thrust');
ylim([-1000 26000]);
subplot(2,1,2);
plot(x_m);
legend('coordinate','speed');
Maybe i missed something obvious. Help me please.

回答 (0 件)

カテゴリ

Help Center および File ExchangePulse and Transition Metrics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by