For a project I am building and programming my own flight controller. I have seen the implementation of a single loop PID controller. But after doing some more research I've found that a cascading PID controller could be used for improved performance.
For so far I was able to create the single loop PID for the angle stabilization. This PID controller input uses RC values with Euler angles calculated IMU as feedback controller. But when I was thinking about the implementation of the rate stabilization controller, some information I couldn't work out.
The inner rate stabilization loop should be faster than the outer angle stabilization loop. This way the rate stabilization has a higher refresh rate that should keep the quadcopter more stable.
If I am using a fixed loop frequency of 400 Hz, and both PID controller are in the same while(1)
loop, there is no speed difference between the inner and outer loop?
So if this is correct it means to use a cascaded loops both loops should be programmed on an other core (multi core programming)? Or is there a way that cascaded loops should work within the same while(1)
loop?