AttitudeController frequency vs RateController frequency

Discussions about all things Bitcraze
Post Reply
naiveHobo
Beginner
Posts: 5
Joined: Wed Feb 12, 2020 10:58 pm

AttitudeController frequency vs RateController frequency

Post by naiveHobo »

For a cascaded PID controller, the update frequency of the inner loop is generally kept as twice that of the outer loop.

Referring to the crazyflie-firmware (https://github.com/bitcraze/crazyflie-firmware), I found out that in the PID controller update loop, a single condition controls the update of both the attitude and the rate controller.

How is the rate controller running at twice the frequency of the attitude controller?

I have opened an issue regarding this in the crazyflie-firmware repository as well:
https://github.com/bitcraze/crazyflie-f ... issues/552
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: AttitudeController frequency vs RateController frequency

Post by tobias »

Running the attitude controller at the same frequency as the rate controller will not make it worse, however there might be room to save up some CPU by lowering the attitude update rate.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: AttitudeController frequency vs RateController frequency

Post by kimberly »

Hi! I also answered your question on the github issue :)
Post Reply