Take Off Drift Issue

All discussions related to the Loco Positioning system
Post Reply
Barry
Beginner
Posts: 28
Joined: Tue Apr 06, 2021 9:19 am

Take Off Drift Issue

Post by Barry »

Dear all,

I have made a new drone using the bolt. While when I run the example: flowsequenceSync.py.

During the takeoff, the drone drifts too much. But when I try to decrease the flying time during the takeoff, the drift issue will be mitigated. It looks like the drone will take off much faster than before. When I use the Xbox controller to control the drone using the hover mode, the drone could stable hover without drift. My question is:

How can I solve the issue to run the example I mean slowly take off without too much drift?

Origonal code:

Code: Select all

for y in range(10):
            cf.commander.send_hover_setpoint(0, 0, 0, y / 25)
            time.sleep(0.1)
Modified one:

Code: Select all

for y in range(4):
            cf.commander.send_hover_setpoint(0, 0, 0, y / 10)
            time.sleep(0.1)
Could someone help me, I would appreciate your answer.

Cheers!
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Take Off Drift Issue

Post by tobias »

Can you let us know your setup? My guess is that you are using a flow v2 deck and no absolute positioning system?

One issue with the flow deck is that it is kind of "blind" below 8 cm from the ground so the takeoff is "open loop", until the Flow deck starts to get flow measurements. Also close to the ground you get high turbulence which doesn't help the situation. This effect can be improved a bit by having a well balanced and tuned drone. Thus if the drone is flown manually and only thrust is applied when taking off it should go straight up.
Barry
Beginner
Posts: 28
Joined: Tue Apr 06, 2021 9:19 am

Re: Take Off Drift Issue

Post by Barry »

Thanks tobias,

I was only equipped with the flow deck on the crazyflie bolt. I have made some modifications to the flowdeck_v1v2.c and zranger2.c

In flowdeck_v1v2.c, I set useAdaptiveStd = true and set OULIER_LIMIT 200

In zranger2.c, I set:

Code: Select all

static const float expPointA = 6.0f;
static const float expStdA = 0.0060f; // STD at elevation expPointA [m]
static const float expPointB = 10.0f;
static const float expStdB = 0.5f;    // STD at elevation expPointB [m]
The drone is now better than before but there sometimes appears the drift issue in my room. I used some gray cushions on the ground. Do you have any ideas on solving the drift issue except I put some colorful ground patterns?

You said that below 8cm, the flow deck is blind, but as for the crazyflie. I have one crazyflie in my lab. The flow deck we mount on the crazyflie is actually super close to the ground right. But it can still fly very stable. So the question is: for the larger drone I made using the bolt, should I make some higher landing skids to prevent the drift issue?

The drone setup is shown as below:
Attachments
333.jpeg
222.jpeg
111.jpeg
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Take Off Drift Issue

Post by tobias »

Do you have any ideas on solving the drift issue except I put some colorful ground patterns?
More features on the floor will probably improve the situation. This should also be true when it is close to the floor.
So the question is: for the larger drone I made using the bolt, should I make some higher landing skids to prevent the drift issue?
It is worth a try. As it is now it looks very close to the ground. The code could also be improved I think. Right now I think we use the flow values even though it is close to the ground. Possibly ignoring values if they are below e.g. 5 cm would improve things.
Barry
Beginner
Posts: 28
Joined: Tue Apr 06, 2021 9:19 am

Re: Take Off Drift Issue

Post by Barry »

Right now I think we use the flow values even though it is close to the ground. Possibly ignoring values if they are below e.g. 5 cm would improve things.
Thanks, tobias. So how can I modify the code to ignoring values below some heights?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Take Off Drift Issue

Post by tobias »

I suggest doing it in the measurement model for flow, mm_flow.c. You could try and simply return from the function if height is below 0.1m.

Code: Select all

// Saturate elevation in prediction and correction to avoid singularities
  if ( this->S[KC_STATE_Z] < 0.1f ) {
      return;
  } else {
      z_g = this->S[KC_STATE_Z];
  }
this->S[KC_STATE_Z] is the height estimate.
Post Reply