Page 1 of 1

Hardcoding Altitude Hold

Posted: Thu Aug 31, 2017 12:12 am
by novneeton
Hi guys,

I bought a couple of crazyflies early this month & have been flying them for two weeks now. I did the pid tuning & they were relatively stable only with the barometer. But once the flow deck with the ranging sensor arrived it has been holding height pretty well.

My question is in the windows client on the assisted mode only three options are available:
1. Height Hold (which is what I am using)
2. Hover Mode (which is oscillating too much)
3. Position Hold (did not try)

Altitude Mode is always disabled.

As for my understanding height hold has a pre fed altitude (40cm), which it tries to maintain which is fine but I want to fly it through altitude hold which essentially will try to stabilize the copter at any height that I want (<2m, ranging sensor limit).

a) How can I set the altitude mode from within the code?
b) And how exactly does hover mode work?

Re: Hardcoding Altitude Hold

Posted: Wed Sep 06, 2017 9:28 am
by arnaud
Hi,

We have added a couple of limitation because of the current state of the algorithms:
- Depending of the lightning condition, the VL53 ranging sensor measurement deteriorates very quickly above 1meter
- With the flow sensor, the kalman filter is used and the kalman filter does not use the barometer (yet). Ideally the pressure and range from the vl53 should be merged.

If you want to try altitude hold you can remove the "self._assist_mode_combo.model().item(0).setEnabled(False)" there: https://github.com/bitcraze/crazyflie-c ... ab.py#L628. This will re-enable altitude hold with the zRanger and Flow decks. Be careful with it when flying high though.

If you want to experiment with using the pressure sensor with the flow you can activate it there: https://github.com/bitcraze/crazyflie-f ... lman.c#L73. You will have to be a bit careful when testing, this can make the kalman filter a bit unstable.

Re: Hardcoding Altitude Hold

Posted: Tue Sep 19, 2017 4:53 am
by shreks7
Hi,

I bought a bunch of flow decks to test hover mode, however, the z-distance/height in the Hover mode is oscillating. Even if you give it a little more thrust, it oscillates. The distance is less than 1m.

How to fix this? Do we try to fuse the data from both the sensors? How can we verify if the z-sensor is a good condition or not?

PS - If you watch the official youtube video for Flow Deck, It doesn't oscillate even at higher than 1m.

Re: Hardcoding Altitude Hold

Posted: Tue Sep 19, 2017 1:33 pm
by tobias
From our experience the z-distance with the z-ranger should be pretty stable, at least below 1m. I'm thinking maybe vibrations could cause an oscillating behavior as the accelerometer is also used. You could give our experimental propeller test FW a try.

If you would like to plot the z-ranger value you can do this in the plotting tab and creating a log block with its log parameter range.zrange.