PX4 Controler Synthesis and Testing

Hi,

I’m a controls student looking to design custom attitude and position controllers for the PX4. These controllers will be intended for a small fixed wing aircraft. I see the simulation guides discussed in https://dev.px4.io/ , however these only discuss software-in-the-loop and hardware-in-the-loop-testing and don’t discuss controller synthesis.

For instance, how do research labs such as ETH in The Monospinner: a controllable flying vehicle with a single moving part - YouTube synthesize controllers from matlab or simulink, implement them on their PX4, and then verify that the firmware is in fact working properly?

Essentially my question boils down to: How can I write my own custom flight controller and verify (preferably HIL?) that it is stable for one of the prebuilt airframes included in the PX4 firmware before going out and trying to physically fly it?

Is the Simulink PX4 PSP the best place to start? PX4 Autopilots Support from UAV Toolbox - Hardware Support - MATLAB & Simulink

Thanks!

You can either use the PX4 BSP or use Simulink coder to generate the controller and integrate it into your own app.

This is what our group and the lab of Davide Scaramuzza are doing.