Closed loop client control

Firmware/software/electronics/mechanics
Post Reply
msorocky
Beginner
Posts: 7
Joined: Mon Jan 08, 2018 2:46 pm

Closed loop client control

Post by msorocky »

I am trying to control the Crazyflie via the Python client over the CrazyRadio, but I find that open loop control does not lead to satisfactory performance. In particular, I am interested in attitude control, and the ability to maintain a constant position (I don't need it to be able to move to a given position, but I would like it to be stationary when necessary). Are there examples of closed loop control using the Python client? The firmware has PID controllers that I might be able to modify, but I imagine using the Python client is much easier, but I'm struggling to see how to go about that.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Closed loop client control

Post by arnaud »

To close the loop you need extra sensors. The Crazyflie client is sending setpoints in degree to the Crazyflie, for example roll/pitch at 0 degree, then the Crazyflie has a control loop to reach this setpoint using its internal gyroscope and accelerometer. Without extra sensors there is nothing better the client can do (in this context, the human controlling the Crazyflie is an extra sensor and a controller that closes the position loop by the way :-).

You need a sensor that can measure the Crazyflie position or velocity, for example a webcam would do it with some image processing. I have had success using AR marker and opencv for example. If you are interested the code is on Github.

Otherwise you could get the Flow deck for your Crazyflie, it is a camera looking down at the floor and it essencially implements a velocity sensor that allows the Crazyflie to fly stationary. The client can then send sepoints in velocity instead of attitude.
Post Reply