Using Simulink as an external plant model for an existing controller
5 views (last 30 days)
I'm unsure how to approach this task, using Simulink Real-Time, Simulink Coder "external mode" or something else. Looking for guidance. We are going to modify an existing UAV autopilot (ArduPilot), which for now will be running on an Ubuntu platform (later on PixHawk). We need a realistic plant model to test control model changes. We have talented controls engineers who can create a realistic plant model in Simulink. We'd like to run the existing autopilot code on Linux and have it communicate using TCP or UDP on Ethernet with a running instance of Simulink somewhere else (e.g. on Windows, but could be on the same Linux machine). The autopilot provides control inputs to the plant model to move control surfaces, spin motors, etc, and the plant model responds in real-time with, for example, lateral accelerations, angular velocities, changes in latitude, and longitude, etc. Reading documentation on-line, I'm not sure which products to use. I can create code in ArduPilot to send/receive whatever packets are necessary, but I don't know how to enable the Simulink side of this. Any ideas?
Pablo Romero on 20 Dec 2018
You can use Aerospace Blockset to model your UAV plant model. Then, you can run this model on a desktop computer or on a Speedgoat target for real-time simulation, and communicate with your autopilot hardware via the built-in Ethernet communication and the available TCP/UDP send and receive blocks.
In further stages of your project, you might be interested in more specific aerospace communications that you can also find in this link.
Hope this helps.