Azzera filtri
Azzera filtri

シミュレーションする​モデルの変更をするに​はどうすればよいです​か?

5 visualizzazioni (ultimi 30 giorni)
隆浩 鈴木
隆浩 鈴木 il 11 Nov 2023
大学でMATLAB/Simulinkを用いて研究している大学生です.
添付させていただく,ドローンのアニメーションに関するプログラムの110行から157行にかけてドローンのモデルが記述されていると思うのですが,このモデルの一部を変更したいのですがやり方が分からないので教えていただきたいです.
具体的には,モータの1,3を,ブレードにくっついたまま,共にある角度だけ回転するような,チルト機構を付けたいです.
自分で行ったときは,円の部分だけがチルトしてしまったりして,うまくいっていません.(例として60度傾けようとした)
以下に,110行から157行のコードを添付させていただきます.mファイルがアニメーションに関するプログラムの全体です.
また,ベースとなっているシステムのURLも添付させていただきます.
何卒アドバイス宜しくお願い致します。
https://jp.mathworks.com/matlabcentral/fileexchange/48053-quad-sim
% Construct rotor representations
N = [d 0 h].';% m1 rotor center [X Y Z]
E = [0 -d h].';% m4 rotor center
W = [0 d h].';% m2 rotor center
S = [-d 0 h].';% m3 rotor center
Nr = circlePoints(N, r, 10); Nr = [Nr Nr(:,1)]; % Rotor blade circles
Er = circlePoints(E, r, 10); Er = [Er Er(:,1)];
Wr = circlePoints(W, r, 10); Wr = [Wr Wr(:,1)];
Sr = circlePoints(S, r, 10); Sr = [Sr Sr(:,1)];
% Motors connecting to center of blade circles
mN = [d,d;
0,0;
h,0];
mE = [0,0;
-d,-d;
h,0];
mW = [0,0;
d,d;
h,0];
mS = [-d,-d;
0,0;
h,0];
% Construct body plot points
bNS = [ d, -d;
0, 0;
0, 0]; %For drawing the body "X" shape
bEW = [ 0, 0;
d, -d;
0, 0];
% Body (HUB) Squares
Top = [ a/2, 0,-a/2, 0;
0, b/2, 0,-b/2;
c/2, c/2, c/2, c/2];
Bot = vertcat(Top(1:2,:),-Top(3,:)); % Bot is same as top just below the center of mass
NEB = [ a/2, a/2, 0, 0;
0, 0, b/2, b/2;
c/2,-c/2,-c/2, c/2]; % By the way... north east is actually north west from above since x is north and y is east :P
NWB = [ a/2, a/2, 0, 0;
0, 0,-b/2,-b/2;
c/2,-c/2,-c/2, c/2];
SEB = -NWB;
SWB = -NEB;
phi = A(1,4);
the = A(1,5);
psi = A(1,6);

Risposte (0)

Categorie

Scopri di più su シミュレーション in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!