1
$\begingroup$

I am using MATLAB Simulink's toolbox for Parrot Minidrones, which have an ultrasound an optical flow sensor built-in. Whenever I am trying to let the drone hover in position, it drifts into one direction (always the same direction). The strange thing is that the drone knows it is drifting, but nothing is happening to correct it:

enter image description here

The drift only seems to occur horizontally, vertically the drone is not drifting. An overview of the relevant part of the PID implementation can be found here. I have tried tweaking some values, but it does not seem to improve. Does anyone have any tips for what the issue might be?

Edit: graph of roll, pitch & yaw

enter image description here

$\endgroup$
4
  • 1
    $\begingroup$ you have no Integral compensator for the pitch. Is this ok ? $\endgroup$
    – Ben
    Sep 15 '20 at 12:49
  • $\begingroup$ @Ben that could be the issue, I assumed that the integral compensator for tau would do the job on its own $\endgroup$ Sep 15 '20 at 13:31
  • $\begingroup$ The rool seems stable enough.. $\endgroup$
    – Ben
    Sep 15 '20 at 13:32
  • $\begingroup$ Do you have the equations that convert pitch, roll and yaw to x, y and z? $\endgroup$
    – Ben
    Sep 15 '20 at 14:28
1
$\begingroup$

Your controller controls pitch and roll. However, in the graph you showed us we only see x,y and z.

Could you add the plot for pitch and roll? I'm not an expert in aircraft control, but I think you can have a constant pitch and roll and still move in the x,y,z plane.

I'll edit my answer as soon as you give more info.

Edit : You roll seems stable, you could try adding an integral component to your pitch roll controller.

$\endgroup$
1
  • $\begingroup$ Thanks, I have added a graph. $\endgroup$ Sep 15 '20 at 13:30
0
$\begingroup$

Try increasing the I coefficient in PID; otherwise retune the whole thing by setting D and I to zero and then increasing P until the threshold at which it goes unstable (oscillates at a constant amplitude rather than grows) then set it to half that value as an initial estimate (in all cases it should have an offset with P alone)...then increase I slowly and you should see the offset go to zero--- if you want to optimize from here, increase I to find the threshold of instability and then set I to half that value; you should see significant ring-down but have the best rise time. Then slowly increase D to eliminate the ring-down.

$\endgroup$
2
  • $\begingroup$ Not sure. The controller controls pitch and roll. You could technically have a stable pitch and roll and still move... $\endgroup$
    – Ben
    Sep 15 '20 at 12:53
  • $\begingroup$ @Ben yes good point! $\endgroup$ Sep 15 '20 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.