PX4 - Simulink quaternion outputs are NAN after applying integration

1 回表示 (過去 30 日間)
Davood Asadi
Davood Asadi 2021 年 8 月 24 日
回答済み: Davood Asadi 2021 年 9 月 1 日
Hello every one
We are trying to upload a controller on the Pixhawk 4 or cube using PX4 and simulink (Matlab 2021a) and test it on the testbed. The problem is when applying PID on the quaternion outputs (because of using integration) will have NAN on the outputs. In fact, to control the Euler angles we need to have some thing like a PID controller on the Euler angles. Have anyone encountered suh a problem or have any suggestion about how to apply the PID controller to control the Euler angles since we were not able to use the gyro sensor also for deriving the Euler angles with using the Quarternions.
Best wishes

採用された回答

Davood Asadi
Davood Asadi 2021 年 9 月 1 日
Thanks for your kind response.
As we noticed at the beginning of the simulation the output of the quaternion block does not give any output, it means it is not a real zero. Therfore, when it passes through the integration the response it NAN unless it is not solved by introduceing a real zero at the begining of the simulation.
Regards

その他の回答 (1 件)

Kshitij Chhabra
Kshitij Chhabra 2021 年 9 月 1 日
From my understanding, you are not able to get the desired results because of NaN outputs from PID controller as a result of passing Quaternion inputs. As an alternative, you can read the postion and attitude of the vehicle seperately and develop the controller accordingly. An example for the same can be found here.
Or, you could directly look at the simulink model using the following command to get an overview:
open_system('px4demo_PositionController_quadrotor')

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by