# HELP! Crazy oscillation of drone in position mode

**URL:** <https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789>\
**Category:** Flight Testing & Log Analysis\
**Created:** [May 2, 2019, 1:33am UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789 "2019-05-02T01:33:49Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshua](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@Joshua](https://discuss.px4.io/u/Joshua)\
**Post date:** [May 2, 2019, 1:33am UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789/1 "2019-05-02T01:33:49Z")

</div>

Hi all,

I went to test my drone with pixhawk 4 in position mode and it acted strangely. It works perfectly fine in manual mode but when i switch to position mode, the drone starts twitching in all directions and eventually spins out of control. If anybody knows how to fix this please help!! Thank You!

**Here’s my setup:**

Frame: Storm Anti-gravity 640mm

Motor: T-motor 380KV

ESC: Hobbywing 40A

FCU: Pixhawk 4 + GPS

Telemetry: RFD 868x

Battery: 6s 4000mah

TX/RX : Futaba T14SG

**Flight review from PX4 io:**

I started off with manual and then switched to position (green portion). You can see that the thrust goes up and down which was what i observed during flight where the drone went up and down. I did not touch my transmitter controls at all.

 ![px4%203](https://discuss.px4.io/uploads/default/original/2X/8/8ed1b10b0ecbe1aa3079940814b6b17174ce4462.png)  
 ![px4](https://discuss.px4.io/uploads/default/original/2X/0/053cabedf4ffb2edf63e074c760692e54a7aca9f.png)

---

<div class="post-metadata">

**Author:** ![bkueng](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/2bfe46/32.png) [@bkueng](https://discuss.px4.io/u/bkueng)\
**Post date:** [May 8, 2019, 2:09pm UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789/2 "2019-05-08T14:09:47Z")

</div>

Hi @Joshua  
Can you share the link to the log?  
It’s likely in-air landing detected and you need to make sure you have the hover throttle configured correctly.

---

<div class="post-metadata">

**Author:** ![Joshua](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@Joshua](https://discuss.px4.io/u/Joshua)\
**Post date:** [May 8, 2019, 2:26pm UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789/3 "2019-05-08T14:26:06Z")

</div>

Hi @bkueng here’s the link:  
[https://review.px4.io/plot\_app?log=f755553c-daf1-4b32-a716-d51f817594f5](https://review.px4.io/plot_app?log=f755553c-daf1-4b32-a716-d51f817594f5)

thanks!!

---

<div class="post-metadata">

**Author:** ![Joshua](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@Joshua](https://discuss.px4.io/u/Joshua)\
**Post date:** [May 8, 2019, 2:26pm UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789/4 "2019-05-08T14:26:55Z")

</div>

@bkueng could it also be the gains under parameters or the airframe type?

---

<div class="post-metadata">

**Author:** ![bkueng](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/2bfe46/32.png) [@bkueng](https://discuss.px4.io/u/bkueng)\
**Post date:** [May 8, 2019, 4:06pm UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789/5 "2019-05-08T16:06:09Z")

</div>

It’s indeed in-air land detected. Make sure to configure `MPC_THR_HOVER`, looks like it’s around 25%. But first I’d make sure to balance the vehicle a bit better, it looks imbalanced.  
If you still have problems then, increase `MPC_Z_VEL_I` to about 0.08.  
The tuning gains look ok, you might be able to improve that a bit, but you can do that afterwards.

---

<div class="post-metadata">

**Author:** ![Joshua](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@Joshua](https://discuss.px4.io/u/Joshua)\
**Post date:** [May 10, 2019, 2:12am UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789/6 "2019-05-10T02:12:40Z")

</div>

@bkueng Hmm… my parameter settings for MPC\_THR\_HOVER is set to 50% . I tried reducing MC\_PITCH\_P and MC\_ROLL\_P to 5.5 and it worked. Just that the drone only waits for the drifting then corrects back to its position. Is that normal ?

---

<div class="post-metadata">

**Author:** ![bkueng](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/2bfe46/32.png) [@bkueng](https://discuss.px4.io/u/bkueng)\
**Post date:** [May 14, 2019, 5:17am UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789/7 "2019-05-14T05:17:58Z")

</div>

> [@Joshua](#):
>
> Just that the drone only waits for the drifting then corrects back to its position.

Can you elaborate? Generally reducing tuning gains (too low) will give you a more sluggish behavior.

---

<div class="post-metadata">

**Author:** ![Joshua](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@Joshua](https://discuss.px4.io/u/Joshua)\
**Post date:** [May 16, 2019, 2:26am UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789/8 "2019-05-16T02:26:39Z")

</div>

ok so after i arm and took off in manual mode, I hovered about 3 metres from the ground. I then switched to position mode to test it out. The wind was coming in strong from northeast direction (with ref to drone). The wind pushed the drone off its position by roughly 60cm towards southwest direction and then it corrects itself vigorously. How do I make the drone less sluggish and respond immediately instead of having to my off its locked position and then responding? Thanks!! @bkueng

---

<div class="post-metadata">

**Author:** ![bkueng](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/2bfe46/32.png) [@bkueng](https://discuss.px4.io/u/bkueng)\
**Post date:** [May 16, 2019, 5:50am UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789/9 "2019-05-16T05:50:33Z")

</div>

You need to tune the vehicle, starting with the Rate Controller, up to the Velocity and Position Controller: [https://docs.px4.io/en/config\_mc/pid\_tuning\_guide\_multicopter.html](https://docs.px4.io/en/config_mc/pid_tuning_guide_multicopter.html)

---

<div class="post-metadata">

**Author:** ![Joshua](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@Joshua](https://discuss.px4.io/u/Joshua)\
**Post date:** [May 16, 2019, 6:43am UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789/10 "2019-05-16T06:43:03Z")

</div>

@bkueng so basically trial and error until I get the perfect rates?

---

<div class="post-metadata">

**Author:** ![bkueng](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/2bfe46/32.png) [@bkueng](https://discuss.px4.io/u/bkueng)\
**Post date:** [May 16, 2019, 10:10am UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789/11 "2019-05-16T10:10:27Z")

</div>

If you want to call it that way, but it’s a systematic approach. And it takes some practise.

---

<div class="post-metadata">

**Author:** ![Joshua](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@Joshua](https://discuss.px4.io/u/Joshua)\
**Post date:** [May 17, 2019, 1:46am UTC](https://discuss.px4.io/t/help-crazy-oscillation-of-drone-in-position-mode/10789/12 "2019-05-17T01:46:33Z")

</div>

@bkueng Thanks very much for your help!! I’ll go play with it
