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