DIY Octo flies away during Loiter and RTL

I am very new to this whole hobby so pls be patient with me. I was given a Octocopter with 570kv motors, 13x6.5 props, APM 2.6, Ublox GPS. The previous owner built it and maiden it. Flew very badly. Gave it to me. Since then I have lifted the compass and GPS module off the main platform. Completed 4 flights so far. In Stabilise mode it flies very well, very little inputs to keep her in the hover. At times it seems that it is in the loiter mode. The second that I select Loiter or RTL mode the craft drifts off to the left or right rapidly. Once during the last flight I selected loiter mode and it held for about 30 secs then drifted off again. I recovered took it further out then activated RTL. It went though the sequence perfectly landing in front of me and shut down. Re armed and took off. Tried Loiter and RTL again and everything went south again.
I have been trying to make head or tails of the .log and .bin files but it is going right over my head.

Please could someone be so kind as to point me in the right direction.
Thank you

1st thing is to post your log file here so anyone can have a look to see what might be happening.

Are those metal containers around the GPS and Compass?
What versions of FirmWare and Ground Station are you using?
Have you done all the calibrations, especially compass?

Hi Mike. Thanks for the reply. No they are not metal just painted plastic. All calibration was done correctly. North shows north on the Mission Planner. I am trying to get the correct flight log file. As soon as I get it I will post it.

Ok I seem to have located the .log and .bin files for this flight. Attached. Thanks in advance Mike.2016-11-10 12-43-45.bin (723.9 KB)
2016-11-10 12-43-45.log (1.6 MB)

Hello Rory,
In your logs are some errors: “EKF_CHECK-2”, “EKF_CHECK-0” and “FAILSAFE_EKF-1”. And your copter went into landing mode sometimes because of the errors I assume.
Do you calibrated your compass after you mounted it on the mast. You should have.
What compass module do you use? Did you check the orientation? Is it really rolled 180°?

btw. Is it the latest firmware for the APM2.6? And what about EKF on the APM2.6?
Many questions… sorry :wink:


In just looking your GPS values the hdop does not get below 1.5 which is no good and should cause a GPS mode rejection.
Could the ‘wandering off’ you see actually be the copter NOT going into the GPS mode you think but rather staying Stab or Alt Hold?

There is a lot of sudden jumping in sats and hdop.
A loose connection?
Is the paint on those containers around your GPS metalised?

You need to set it up outside connected to a GCS and watch your GPS performance.
It seems to be the issue.

Thanks so much guys. I will remove the GPS and compass from their containers and mount them open. I am a bit concerned about the amount of EMP that the ECSs are causing during higher throttle settings. As you can see the APM is right in the middle of them and not very high off the board. Could this be an issue as well? Will carry out the changes, test fly and let you know what happens.
Thank you very much for all the help.

Hi Patrick
Did check the firmware and it is the latest. I did recalibrate after I moved the compass and GPS. Ok I have no idea what EKF is. I will google that now quickly.

I have just noticed something odd. The “Y” arrow is facing to the rear of the copter and the “X” arrow to the left. If you are in Data mode in Mission Planner is show correctly Ie copter is facing north and HUD comp shows north??!!!
Hope this helps.

I just found this site:

In my opinion your compass_orient parameter(roll 180) is wrong, but anyhow the HUD is right…
Please have a look in the “Notes:” section.
My guess would be yaw90 or yaw270 to be correct.


Thanks Patrick. You hit the nail on the head. gote to test fly again today and the drone is perfect.
thanks for all the help guys.


Happy flying! :slight_smile: