Confused about the onboard controller

Firmware/software/electronics/mechanics
Post Reply
binx
Beginner
Posts: 11
Joined: Tue Feb 07, 2017 4:42 am

Confused about the onboard controller

Post by binx »

Hi guys,

I am working with the CFs recently, I have installed crazyflie_ros to control the CF with optitrack. But when I want tot go further, I am really confused about the onboard controller. I think I have understood all the code about the ground controller, but I don't know how onborad controller works. I hope anyone could give me some directions about that.

Thanks,
Bin
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Confused about the onboard controller

Post by arnaud »

Without more precision for the question I am not sure what to say about the onboard controller. I am trying to describe the high level as I see it.

In The Crazyflie we have a Kalman filter that estimates the quadcopter state (position and orientation) and then we have the position and attitude controller that generates the control command for the motor to correct the state. Everything is orchestrated by the stabilizer loop that call the algorithms and pass structures around: https://github.com/bitcraze/crazyflie-f ... #L111-L130

When working with a motion capture system you can push the quadcopter position to the Crazyflie using the external position port, this allows to send position update to the Kalman filter and to use the internal PID controller for position control.

The controller is abstracted behind the function call "stateController(&control, &setpoint, &sensorData, &state, tick);". It takes setpoint, sensors values and the current state as an input and outputs the control structure for the motors. Currently the PID controller is the default implementation but more are coming soon (there is already a couple of better controller that will be merged soon in master).

I hope I dissipate some of the confusions, if not please tell us where we can precise more.
Post Reply