Crazyflie w/Flow v2 deck is randomly unstable

Firmware/software/electronics/mechanics
Post Reply
iscoyd
Beginner
Posts: 8
Joined: Mon Mar 04, 2019 7:42 am

Crazyflie w/Flow v2 deck is randomly unstable

Post by iscoyd »

I got the Flow Deck v2 for Crazyflie 2.1 and have been trying out a few Python scripts from the crazyflie-lib-python/examples folder, notably motion_commander_demo.py. I modified this script to make the Crazyflie fly in a rectangle, where at each waypoint it hovers for 3 seconds before moving to the next one. After the final waypoint it stops. The program itself is extremely simple consisting of sequential functions time.sleep(3) --> mc.forward(0.8) --> time.sleep(3) --> mc.right(0.5) --> time.sleep(3) --> mc.back(0.8) --> time.sleep(3) --> mc.left(0.5 --> time.sleep(3) --> mc.stop().

The problem is this: On some runs, it works perfectly, rising up stably, moving smoothly and hovering at waypoints before finally landing. However on the very next run it will rise and start wobbling after 2-3 seconds which becomes uncontrollable and finally results it in crashing. I've verified that the drone is well balanced, and am completely mystified by why it performs some runs perfectly but wobbles/crashes on others. Same drone, same program, very next run.

Any pointers would be appreciated! Thanks.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyflie w/Flow v2 deck is randomly unstable

Post by arnaud »

Hi,

The main thing I can think about is lightning condition: the flow is looking down and tracking the floor, if patterns on the floor do not have enough contrast and the flow sees the Crazyflie shadow, it will result in instability (though i more often see the crazyflie flying away in that case).

Does all your test have the same lightning condition?
iscoyd
Beginner
Posts: 8
Joined: Mon Mar 04, 2019 7:42 am

Re: Crazyflie w/Flow v2 deck is randomly unstable

Post by iscoyd »

Hi Arnaud, yes you were right -- thanks for the pointer. it seemed that it was indeed the pattern on the floor that may have been the problem. I was doing my earlier testing on a carpet that had a pattern of alternating light and dark colors (approx 5-10 cm each color) which may have been fooling the Crazyflie, especially when taking off. I'd noticed that most of the instability was when taking off. Once airborne it seemed to be more stable.I changed my testing area to a hallway with wooden floor, where there was sufficient texture in the wood grain but not a radical change in color, and was able to get it to perform its maneuvers satisfactorily each time.

I did observe that with the Flow Deck v2, Crazyflie has good height stability (probably that is because what the Flow Deck is designed for) but the x, y positioning is only so-so. I'm expecting that the Loco-positioning deck or the Lighthouse deck would make the x, y positioning better. Would you agree? Do you have any numbers on the precision of the Loco-positioning deck or Lighthouse deck?

Last question: Can one install both the Flow Deck and the Lighthouse Deck on the same Crazyflie -- the former at the bottom and the latter on top? Or is it just one or the other? How accurate are Loco-positioning Deck/Lighthouse Deck for height measurements?

Thanks for your help!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyflie w/Flow v2 deck is randomly unstable

Post by arnaud »

Take-off using the flow can be noisy at time, this is a known but and there might be ways to make things better but they are yet to be investigated.

The FlowV2 is using a time-of-flight optical distance sensor to control the height, this sensor has very good precision which explains the good Z positioning performance. In X-Y the flow is using an optical flow sensor looking at how the ground is moving bellow, this is a relative sensor so it is possible to get X-Y drift. Though we have observed very good performance of the flow sensor, what do you mean by 'so-so' in X-Y? This is the kind of stability we get with the flow alone (this is a test of the multiranger deck): https://drive.google.com/file/d/1Ns9SOw ... sp=sharing. The loco-positioning-system give about +/-20cm of absolute accuracy and a couple of cm of relative accuracy. I do not have many experimental measurement for the lighthouse yet but it is within mm of precision (when the Crazyflie is on the floor I get less than a millimeter of noise in XYZ), the absolute precision of lighthouse is yet to be tested, we know that we are not using all the calibration data from the basestation.

I have never tested but it should be possible to have lighthouse and flow together, there is no electrical/communication incompatibility. Though I would expect lighthouse to give you in X/Y/Z the kind of performance you get with the flow in Z so there might not be a lot of benefits using them together in terms of performance. The only use case I can think about is if you want to get out and then back again from the space tracked with lighthouse but one potential problem I saw using flow and LPS is that if there is too much inconsistency between the reading of the two systems, the Crazyflie tends to 'flip', it could happen very easily in that case.
iscoyd
Beginner
Posts: 8
Joined: Mon Mar 04, 2019 7:42 am

Re: Crazyflie w/Flow v2 deck is randomly unstable

Post by iscoyd »

Hi Arnaud, thanks for your detailed reply! I'm thinking that instead of using Flow Deck I'll use the Multi-ranger deck instead mounted on the bottom (upside down) and the Lighthouse deck mounted on top -- con you confirm that this configuration will work? How many Vive Base Stations would I need for precise X-Y-X positioning of the Crazyflie w/Lighthouse deck?

Since Multi-ranger measures distance up to 4 m as well as lateral proximity it seems to be a superset of the Flow Deck. What is the Multi-ranger deck's accuracy/precision in measured distance for any of its proximity sensors? The Lighthouse would be for precise X-Y-Z positioning in open space. The application I'm building involves tracking surfaces at a close but safe distance.

Thanks for your help!
iscoyd
Beginner
Posts: 8
Joined: Mon Mar 04, 2019 7:42 am

Re: Crazyflie w/Flow v2 deck is randomly unstable

Post by iscoyd »

Hi Arnaud, never mind my previous question about using Multi-ranger deck mounted on the bottom. I realized that it can be mounted only on the top (per the Crazyflie accessories page).

But it does bring up another question: If I want to do precise proximity detection to objects & surfaces with the multi-ranger deck, as well as precise 3D positioning in the room with the Lighthouse deck, am I correct that it is not possible? Or is there a way to do it?

As always, thanks for your help!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyflie w/Flow v2 deck is randomly unstable

Post by arnaud »

You currently need 2 base station V1 for positioning with the lighthouse deck, see the wiki page for current state/limitation and the doc on how to setup the system that discuss what hardware is required: https://wiki.bitcraze.io/doc:lighthouse:index

As for the multiranger, it should also be compatible with the lighthouse deck, though the lighthouse deck needs to be on the very top which means that you will loose the top measurement of the multiranger. front/left/back/right will work fine. Using the long pins you can setup both deck on top of the battery. setting up the multiranger on the bottom does not seems to work for mechanical reason (one of the sensor is colliding with the Crazyflie programming connector).
Post Reply