INDI Controller on PX4


I’m currently working on the adaptation of an Incremental Non-Linear Dynamic Inversion controller on PX4.

I found this existing module : (The branch “master” is the source code and “att_indi” the main code repository).

However it needs an adapted version of QGroundControl to run and relies on PX4 from 2016 …

I tried to adapt it for the existing PX4, looking for alternatives for the topics which don’t exist any more (such as multirotor_motor_limits, actuator_controls, control_state, mc_att_ctrl_status, multirotor_motor_limits …) but it has not been successful. It shows errors namely with FlightTask and StickTiltXY.

If you have any suggestions on how to do the adaptation of such an old module that was not designed for the same architecture OR if you have any tips for replacing the existing attitude controller by an INDI one, please feel free to share it.

I think basically you need to figure out which controller you want to replace, and then disable it in the build and plug your controller in.

Now, my first question would be at what level of the cascaded control loop your controller would fit in? E.g. is it at the lowest rate loop level, or higher level like attitude, velocity, or position? Or all of them together?

The overall goal is to have a low level controller. But from what I’ve seen in different paper, for the altitude control along z axis, it can be as simple as a proportional derivative (PD) controller as an outer-loop controller. The INDI controller will generate the commands to the actuators based on virtual input, which is the desired angular acceleration generated in outer-loop.

Hello, I also try to run the INDI controller on PX4. I transplanted it with reference to this module( [GitHub - lei-ss/indi: use paparazzi indi attitude controler (simple) in px4 firmware). However, but the code after transplantation was simulated in gazebo(sitl), the drone could not take off and just kept shaking on the ground. I get matrix g1 from the gazebo log with PID controller. Use the esc rpm to calcuate actuators and angular acceleration to calculate increment. Would you like to share your current progress and can you give me some suggestions on this issue?

1 Like

you can check the frequency at which the filter block is run and whether the time constant when differentiating the angular velocity is correct

I also referred to the code at GitHub - lei-ss/indi: use paparazzi indi attitude controler (simple) in px4 firmware in GITHUB, replaced the angular velocity loop in PX4, added INDI, and the running frequency is 800Hz. Most of the code is implemented in the rate_control.cpp file. It includes angular acceleration calculation and can run normally in gazebo simulation, but there is strong jitter on the real F450 rack. Can you give me some suggestions or discuss it together?

As you said, is there a time lag between the angular acceleration feedback and the motor speed feedback in the real world? The filter does not completely align the two.The INDI control output is not control the current moment?

Now,the vehicle can take off, but shaking in air. And motor speed oscillates violently between stall and maximum speed. I subscribe the angular velocity and angular acceleration in rate_control.cpp file. The filter is from the LowPassFilter2p class, the running frequency is 250Hz. The angular velocity and angular acceleration is calculated and filtered in vehicleangularvelocity.cpp and the motor rpm is filtered in rate_control.cpp. Will this have any impact?
Ps. The filter on rates and acceleration is not same as the filter on motor rpm in my code. cutoff frequency is 8hz(motor rpm) and 20hz(rates). If same, the vehicle can not take off.
can you give me some advise?

Additionally, I ignore the G2 matrix. I think in gazebo G2 is not useful, but I try adding G2 and see the effect.

G2 can be ignored first and has little impact.

It may be that your INDI G parameter settings are unreasonable. The INDI I run in gazebo is also 250HZ. My parameters are angle ring P6.8 D 10 INDI G1P: 0.26, G1Q: 0.20, G1R: 0.095. G2 can be set to 0 I set 1.05,
In addition, the strange thing is that I don’t need to modify the parameters of the actual drone and it can run very well in gazebo.

My output filter and angular acceleration filter are both 8HZ low-pass filters.,Can you give me an email address so that I can give you the code and you can compare it with your code analysis?

Sure, my email is Looking forward to you email.

Hello, I also want to implement INDI control on PX4 recently, but after modifying the rate_control.cpp code according to the reference, the effect of running on Gazebo is that the drone cannot take off normally, sometimes the body shakes significantly or rolls over directly. Can I refer to your relevant code to compare where there are errors on my end? This is my email: Looking forward to your letter!