PD control matlab coding

5 ビュー (過去 30 日間)
perry
perry 2016 年 6 月 11 日
コメント済み: kushal doshi 2020 年 6 月 22 日
I am given program to do 2 things
1) stabilise the quadcopter at a height of 0
2) give the quadrotor a step input of 1 meter
well, I get stuck even for the first task
I think I should use the formula
if true
g=9.81
m=0.81 %the mass of quadcopter
K_p=1
K_v=10
e=z_des-z
u = m * [diff(diff(z_des))+K_p*e+K_v*diff(e)+g]
The following is the cap screen of the code. I have problem on how to assign the z (current height) and z_des (desired height) from the vector s and s_des so that I could use that to calculate the e (error) = z_des-z

回答 (1 件)

Ragupathi S
Ragupathi S 2019 年 3 月 14 日
I am also doing the same course. I am also facing your issue. But I found simple thing for hover control that is stabilizing quad at height 0. Simply multiply mass(m) and acceleration due to gravity(g) and put that as input of Thrust (u)
  1 件のコメント
kushal doshi
kushal doshi 2020 年 6 月 22 日
hey i am doing the same course and i am stuck how to stabilize at height 0 can you mail me the code you uses to achive it.
@kushalydoshi@gamil.com

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeQuadcopters and Drones についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by