Page 1 of 1

PID data conversion

Posted: Wed Dec 05, 2018 6:24 pm
by AAtef92
Hello Everyone,

I am trying to study crazyflie firmware and more specifically, the PID inner loop which is "Rate_PID", I understand it depends on the the angular velocities generated from the gyrometer after they are multiplied by the rotation matrix to have the world frame values.

My questions are:
1- I dont understand how the system make use of the the modified values of the three axis angular velocities generated from the RATE_PID, and convert them back to PWM waves fed to the 4 motors. I mean what kind of equations?
2- Would someone please point to which files the implementation of such conversion takes place, also for the rotation matrix multiplication part?

Thank you so much!

Re: PID data conversion

Posted: Fri Dec 14, 2018 5:50 am
by whoenig
The conversion to PWM happens in the power distribution module: https://github.com/bitcraze/crazyflie-f ... c#L76-L107.

There are several controller options in the firmware - which one are you referring to? The "newest" is a nonlinear controller (see https://github.com/bitcraze/crazyflie-f ... ellinger.c). The code also has a reference to a scientific paper which has all the equations (and the code uses a similar notation.)