quadcopter vertical dynamics modelling

조회 수: 1 (최근 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 CenterFile Exchange에서 Dynamic System Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by