i further developed the hover mode. The current solution uses the Pressure difference as input for a PID controller telling what to do in therory (some kind of climb rate needed is beeing calculated)
If we are too high, the decent rate rate will only get half the influence than while climbing, cause the thrust release and the gravitation are stronger while loosing height.
This info is then fed into a second PID controller using the accelerometer data from z axis to further tune the output. (loosing a lot of height rapidly should cause this PID to increase thrust even more)
Currently this output oscillates around zero and this rate is the thrust needed, and added or subtracted around a ground hoverParameter (actually 42800)
There are several parameters tunable via the gui, making it quite easy to test different values.
I am currently playing around to get some reliable parameters, cause different situations make it quite hard to predict all of these:
Hovering around ground needs less thrust at all while starting hovering during flight needs an extremely fast response, to have hovering thust actually.
I would love to see if you folks could do some code review, and play around with parameters too.
currently the most important ones are:
thrust_kp
thrust_ki
thrust_kd
thrust_il
climb_rate_kp
climb_rate_ki
climb_rate_kd
climb_rate_il
There is also a stabilizer.debug parameter which will cause not to distribute power, but just calculate, which is quite nice together with the log output of the pc-client, just to see if your values are ok.
If the flie does not behave like desired, have a look into the logged variables, especially the pressure difference is sometimes strange, since in that moment where you press the button the value differrences from the current a lot, causing a completely wrong calculation, either the fly drops like a stone or it raises ... if you are playing around, just disable hover mode and reenable it, to get a new desired pressure.
Thr source can be found here:
https://bitbucket.org/phiamo/crazyflie- ... r_mode_pid
https://bitbucket.org/phiamo/crazyflie- ... hover_mode
Since i needed to change the comm protocol to also transmit hover changes (current implementation changes the desired pressure) you need the hover pc-client to control the hover firmware.
Also the hover mode PC client introduces a hover switch to be configured and a hover axis to be configured, while the switch is obvious to turn hovering on and off, the new axis should once make us abled to let the flie climb or decent.
Hopefully we will find some values satisfieng all needs or improve the code further

Have Phun