PID data conversion

Firmware/software/electronics/mechanics
Post Reply
AAtef92
Beginner
Posts: 2
Joined: Wed Dec 05, 2018 6:12 pm

PID data conversion

Post by AAtef92 » Wed Dec 05, 2018 6:24 pm

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!

whoenig
Expert
Posts: 285
Joined: Mon Oct 27, 2014 2:55 am

Re: PID data conversion

Post by whoenig » Fri Dec 14, 2018 5:50 am

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.)

Post Reply