Hi all. We are working on a quadcopter project and we have a Pixhawk2 flight controller to build with.
Recently we came up with the idea to make some modifications to the 1-level controllers so that the drone can deal with the non-linear dynamics at large angles and do some bold maneuvers.
The basic idea is to transform the plant (drone dynamics) into a desired form by using a transforming matrix, and use fixed PID controllers to control the "plant" with the desired form. Specifically, the four control signals output by the controller (thrust and torques for roll, pitch and yaw ) are multiplied with this transforming matrx and fed into the plant.
For simulation, we linearized the drone dynamics at certain operating points and found the corresponding values for the transforming matrices. As we were doing the simulation and such in MATLAB and Simulink, it was easy just to drag an integrator block from the library. However when really touching the PX4 firmware, we are kind of lost with the implementation.
We are currently following the dev's guide for PX4, but a few tips about where to look at especially in terms of the source code would be appreciated!
A screenshot of the Simulink model with short descriptions is shown below: