It shoots straight up when I switch to PosHold

I just put together a new camera quad.
It’s the 3DR DIY frame with a Pixhawk running 3.5.2 and Ublox M8N GPS.
I have rock solid GPS reception (# of sats and low HDOP), calibrated magnetometers (two of them) and hovers at exactly half throttle when in stabilized mode. I have a problem though that I noticed from the first flight and cant find a solution no matter how much I searched on the web.
The first time I switch from stabilized mode to PosHold mode the quad shoots up in the sky. I do not know if it would have stopped at any point cause I switch immediately back to stabilize to regain control and bring it back to safe altitude. The same happens the second time I try to switch PosHold but now the climb lasts much shorter and after a few meters it hovers at steady altitude the way it is supposed to.
I am attaching the log file*naEGsf3ADxuOxiauOG9bLW6fA8QZuKaYp1L7Jwl49dK/20170829181022.bin here in hope that someone can diagnose the problem and steer me to the right direction. The phenomenon occurs approx at line 13895 and I have noticed there that while BARO.Alt spikes up the way it supposed to during fast climbing the CTUN.Alt parameter goes down… Is this the reason my quad suddenly shoots up? What does CTUN.Alt mean? Is it a glitch and if so why does it occur only when I switch to PosHold and only the first time?
I have read somewhere that the buzzer can interfere with Pixhawk operation. The buzzer does emit a loud beep when I change flight modes. If that is the case though why does it happen only the first and second time and never again in the same flight? VibeX, VibeY and VibeZ values graph low as well as Clip0,1,2 which are all zero.
Please, help I am completely baffled here.

Here is the strange thing - two times you’ve enabled PosHold, two times there is a spikes with AccZ.
Moreover, the first and second IMU’s has opposite directions. It is unclear how this is possible.

I have not checked the logs myself but according to what @sergbokh found I assume that the buzzer is mounted too close to the Autopilot. The buzzer induces vibrations. Move the buzzer further away - or switch it off for testing. Then it should be solved.

Every mode change affects this.Whichever graph I plot I can clearly see the spikes.

I’d move the buzzer (or remove it) too.

Thank you so much guys for your answers!

I will disconnect the buzzer and take a test flight as soon as I come home from work.

What about those GPS-2, GPS-0 and EKF_Primary-1 error flags though around the time of the first mode switch?


Same thing.It just shows there’s a disturbance at that time.And not all error flags are useful to non devs. :rofl:

Back from work and it is raining so no flight.

But it seems you guys nailed it!

I did three short tests switching back and forth with the quad on my desk.
Look at attached images. The first two were with the buzzer located on the frame next to Pixhawk the last one is with the buzzer hanging loose from it’s cable.

I will attach the buzzer somewhere else with thick double sided tape and run a few more desk tests before attempting a flight.


Here are the results - buzzer mounted on two layers of double sided foam tape.

The numbers on the output scale are much lower only decimals maxing out at +/-0.3

but NKF3.IVD moves constantly up and down crossing the 0 point. Is this the way it is supposed to be? It does the fluctuations do not seem to corellate to buzzer tones when switching modes.


That looks better.I don’t know if it’s vibrations or electronic noise that’s the problem.Possibly both.So insulating it and getting it as far away as possible from the FC is the way to go.

Will do a test flight tomorrow and report here. Thank You! :slight_smile:


It flew and it was rock solid all the time while I switched through modes both via Taranis Tx and Tower App. It was literally parked in a spot in the sky!

Unfortunately the 3S, 3500mAh, 30C battery packs I had for this project do not seem to cut the mustard. I get only 5 mins of hovering time before the voltage sags down to 10.5v for 10 secs and the low battery alarm trigger a RTL.

It’s a heavy ship apparently with a 3D Mini Pro gimbal, Vtx, telemetry, etc… I have a parallel power cable to try two packs, but I am afraid the extra weight will result in even shorter flight time despite the double capacity…