Where is the control part?

Firmware/software/electronics/mechanics
Post Reply
Barry
Beginner
Posts: 28
Joined: Tue Apr 06, 2021 9:19 am

Where is the control part?

Post by Barry »

Dear All,

I am confused about where is the control part of the optical flow. I know there is a kalman_core.c and flowdeck_v1v2.c.

I am sorry that I am not familiar with the firmware. It looks like from the flowdeck_v1v2.c we can get the motion difference in the x and y-direction. But how can we utilize this motion difference to hover the drone?

I used the crazyflie in my house but the lighting condition and ground pattern were not good, so I was wondering if I can modify some parameters in the firmware so as to increase the performance of the optical flow algorithm. In my house, the drift issue is quite serious. And when I commend the drone, send_hover_setpoint(), sometimes the drone will go super fast that beyond the velocity I give.

Can anyone give me some suggestions? I would appreciate that! Thanks!

Cheers!
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Where is the control part?

Post by kristoffer »

Hi!

A good starting point is probably https://www.bitcraze.io/documentation/r ... o-control/
Hopefully it will give you the bigger picture.
But how can we utilize this motion difference to hover the drone?
The easiest way to hover is to use the python lib, check out the https://github.com/bitcraze/crazyflie-l ... nceSync.py example to see how to send setpoints or, if you want to move one abstraction level up take a look at the MotionCommander in this example https://github.com/bitcraze/crazyflie-l ... er_demo.py

It is also possible to do similar stuff from an app in the firmware if you like.
I was wondering if I can modify some parameters in the firmware so as to increase the performance of the optical flow algorithm.
The actual chip driver is here https://github.com/bitcraze/crazyflie-f ... /pmw3901.c
The deck driver is here https://github.com/bitcraze/crazyflie-f ... eck_v1v2.c
It might be possible to do some adaptations in this area, for instance change settings for the camera. Most of the work is done in the chip and the algorithms in the CF firmware mainly compensates for height and tilt.

Commenting out send_hover_setpoint() will not help, this function call sends the actual motion data to the state estimator. If you remove it, the state estimator will only get data from the IMU and the distance sensor on the Flow deck and it will drift pretty quickly.
Post Reply