필터 지우기
필터 지우기

how calculate the drone upward position value of r with body rates(p,q,r) by integration

조회 수: 6 (최근 30일)
the available value is p q r from the bus creator the drone upward position should be calculated by means of integration of positions to find r value

답변 (1개)

Aman Banthia
Aman Banthia 2023년 10월 7일
Hi Venkata,
I understand that you are trying to calculate the upward position of a drone using body rates (p, q, r) provided by a bus creator. However, the body rates represent angular velocities - roll rate (p), pitch rate (q), and yaw rate (r) - not linear velocities or positions.
The body rates (p, q, r) represent the angular velocities of the drone about the body-fixed axes. The “r” value in this context is the yaw rate, or the rate of change of the drone's orientation about the vertical axis.
If you want to calculate the upward position of the drone, you would typically need the vertical velocity, not the yaw rate. The vertical velocity could be obtained by integrating the vertical acceleration (after subtracting gravity) if such data is available.
However, if you want to calculate the total change in yaw angle (which is different from the upward position), you can do this by integrating the “r” value over time. In MATLAB, this can be done using the ‘cumtrapz’ function, which computes the cumulative trapezoidal numerical integration. Here is a basic example:
% Assuming “r” is a vector of yaw rates and “t” is a vector of corresponding times[PG2] [AB3]
yaw_angle = cumtrapz(t, r);
This will give you a new vector, “yaw_angle”, which represents the total yaw angle at each point in time.
Please refer to the following MATLAB Documentation to know more about the following:
Hope the above suggestions help you.
Best regards,
Aman Banthia

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by