Monitor and Tune PX4 Host Target Flight Controller with Simulink-Based Plant Model

1 回表示 (過去 30 日間)
There's a question regarding the following figure on this documentation page: https://www.mathworks.com/help/supportpkg/px4/ref/simulator-plant-model-example.html
As stated in the documentation, "the Quad_Plant_top model and px4Demo_FlightController_top model run in lockstep with each other", however, why's the simulation time of the left model (plant) two times that of the right model (controller)?
This simulation time doubling can also be observed, if you try the example yourself.

採用された回答

Abhishek GS
Abhishek GS 2020 年 11 月 11 日
Hi Yingao,
This is a good question. Yes, the the Quad_Plant_top model and px4Demo_FlightController_top model run in lockstep with each other. However, the TCP Read from Host Target block in Quad_Plant_top model, is set to read 50 bytes of data at each sample time. This is not enough to read all the data sent from the controller model. Hence, the plant model has to run 2 times to get all required HIL* messages from the controller and then respond.
Playing around with the TCP Read from Host Target block should ensure the time matches in both the controller and plant model. But rest assured that they are in lockstep. This can be noticed while pausing the using the step through functionality in the plant model.
Thanks,
Abhishek
  1 件のコメント
Yingao Zhang
Yingao Zhang 2020 年 11 月 12 日
Thank you so much for your accurate reply, Abhishek. I'm looking forward to the correction of this problem in upcoming MATLAB releases.

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

その他の回答 (0 件)

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by