Your first trouble: Electro-Magnetic Interference
It makes sense to deal with potential magnetic interference during the hardware assembly. I have read many theories on where the interference might be coming from. Some blame the motors, others blame ESC. I can only confirm that moving the ESC’s as far away from the controller as possible only increased the interference during the compassmot procedure. BTW, compassmot procedure is not compulsory, however it is highly recommended for All-In-One controllers. I have tried to ignore the initially high reading and tested the quad anyway. The result you can see in this video.
The main source of this phenomenon is DC wires that feed the ECS’s as well as power distribution board. You can refer to this article for more details. As it is often the case, power distribution board is located directly underneath the controller. E.g. in the frame that I was assembling (Turnigy Talon V2) the power distribution board is normally mounted on the other side of the flight controller holes, so that the 2 are separated by short nylon spacers only.
I have taken the power board out of the cavity of the frame, cut the ECS wires really short twisted them (as shown in the picture) and soldered directly to the board. I have also placed the whole arrangement under the frame so that the distance to compass was maximised.

Firmware
In my previous article I have mentioned the firmware uploading tool (Flashtool) that MegapirateNG developed for our convenience. It does a good job as well as the firmware itself. However once you have faced the problems of magnetic interference and realised that they are too significant to overcome, using the external compass might become the only option for you. Why is it so? Why these controllers were designed so that the compass is useless and could it be that something changes to worse in the firmware? – All these are interesting questions and I shall try and compile some theories together at the end of this article.
It is necessary to mention that original software that you have uploaded with the Flashtool does not have an option of disabling the on-board compass. You can it try yourself in the MissionPlanner, go to Config/Tuning==>Standard Params and try to disable the on-board compass. It does not work, does it?
Nevertheless, if you feel confident with programming and can modify the code so that it uses the external compass only, please do so. Otherwise, you can use the hex file kindly provided by Peter King. You can visit his website www.droneshop.biz, go to the footer of the main page and click the link Google Docs link for our files & Parameters for all our models and radio setups. Have a look at all the stuff that he makes, I am personally impressed with the configurator idea for custom builds.
!UPDATE! Firmware 3.1.5 modified for external compass (HK Multiwii and Megapirate AIO Boards only)
You are about to download a ZIP file that contains 2 modified HEX files by Megapirate. One is suitable for a CPPM transmitter/receiver, another one shall be used with a normal transmitter/receiver pair. Both files have external compass option enabled (onboard compass is disabled). Use with Megapirate/Multiwii Hobbyking AIO flight controller only (or corresponding Crius Boards). This files can be flashed to the controller by using Mission Planner software (available from the download section of 3D Robotics website) |
|
| |
Download |
You can upload the hex file using MissionPlanner and FTDI board (Initial Setup=>Upload Firmware). This is essentially the same as re-flashing the controller.
Compass calibration
I have covered compass, accelerometer and radio calibration in my other article, so please follow those instructions. You should erase the EEPROM. Re-run all the setups and make sure that all the receiver channels (Throttle, Rudder etc.) are connected to the right inputs (most likely different to your previous setup – ouch, that hurts). By the way if you ever dealt with CPPM, please update us on how to re-arrange the channels.
Important! When calibrating the compass on Neo-7M Hobbyking unit (external compass), set ROTATION_PITCH_180 in the drop-out box beside “Manual” in compass calibration screen.
Of cause, the natural question at this point is: why do we have to go to this extent, re-flash and re-calibrate the unit, change the variables, etc? Can’t we just calibrate both compasses together and still use the original Megapirate firmware? These are legitimate questions and I shall appreciate your feedback if anyone ones to volunteer and try it out. There is no way you can reliably determine that Rotation Pitch shall be 180° on the Neo-7M compass unless your firmware knows to work with the external compass only. So that is where I am now.
Compassmot
My advice: don’t skip the compassmot. Get the interference within 30% by modifying you hardware. Otherwise you’ll end up with “Toilet Bowling” or lose your machine altogether.
After all the preparation described above, my compassmot was under 12%.
A good video on compassmot is below. The only comment I would make on this video is: before you go to command line interface screen, disconnect Missionplanner from your multicopter, unplug the muticopter battery, wait for 10 minutes, connect the battery back again and only then click “Connect” in the CLI interface.
Theories and rumours
First of all, yes Multiwii and Megapirate AIO boards are old technology and they have been in the market for quite a while. They are 8-bit systems and the amount of code that you can control them with is limited. MegapitateNG have officially departed from 8-bit systems and they develop their own F4BY controller (32-bit). As you can see in release notes to 3.0.1 firmware, compass calibration and compassmot are significantly more important than before. This (in my opinion) means that algorithms had to be trimmed down in order to make space for additional code.
On the other hand, do we have a decent 32-bit controller with robust firmware available? – Probably not, yet. So we are destined to cope with old technology and pick up the crumbs of other peoples’ dead projects for now. Please share your thoughts below.

I'm wonder[censored]g if you have [censored] code for [censored] firmware hex files that has [censored] changes [censored] disable [censored] [censored]ternal compass and enable [censored] external [censored]? I have m[censored]e a number of o[censored]r changes [censored] [censored] codebase I use for my dr[censored] so can't use [censored] hex files you supplied.
Sorry, I didn't get a [censored]ification [censored] h[censored] been replied [censored]. I don't need [censored] hex file, I can compile my own firmware. I need [censored] know what code [censored] change!
Cheers,
Trav
[censored] follow[censored]g file has [censored] be changed if you are runn[censored]g an external compass: libraries\AP_[censored]ertialSensor\AP_[censored]e rtialSensor_MPU6000_I2C.cpp
Change:
//#def[censored]e DISABLE_[censored]TERNAL_MAG [censored] #def[censored]e DISABLE_[censored]TERNAL_MAG
[censored] [censored][censored]ation:
http://docs.megapirateng.com/documentation/tipsntricks
[censored] [censored] code w[censored] is [censored] [censored]ternal compass referenced such that I can change it? Like [censored] o[censored]r commenter I have m[censored]e o[censored]r changes [censored] code elsew[censored] that means I can't use [censored] pre compiled hex file.
it is [censored] reason that you don't rank hi [censored] google.
But you can fix [censored] issue fast. T[censored] is a [censored]ol that rewrites content like human, just [censored] [censored] google:
mif[censored]lo's [censored]ols
So if it is right, i can re[censored] my article at [censored]:
am [censored][censored]g [censored] [censored]b page dailly and take good [censored][censored]ation from [censored] every day.
high [censored] google. But you can fix [censored] issue fast.
T[censored] is a [censored]ol that rewrites articles like human, just [censored] [censored] google: mif[censored]lo's [censored]ols
fɑzer blogg[censored]g .
a article about [censored] best gynecological cl[censored]ic [censored]dress [censored] Hanoi.
Hope you re[censored] and feedback [censored] review [censored] me. Tks. [censored] is my article l[censored]k:
http://bit.ly/2STmuTE
content so probably it is [censored] reason that
you don't rank hi [censored] google. But you can fix [censored] issue fast.
T[censored] is a [censored]ol that creates articles like human, just
[censored] [censored] google: mif[censored]lo's [censored]ols
I have jo[censored]ed [censored] feed aand stay up foor look[censored]g for [censored] of [censored] fantastic post.
Also, I have shared [censored] skte [censored] my social networks
Feel free [censored] [censored] my [censored] - VPS: https://who[censored]c.org
board and I [censored] f[censored]d It truly useful & it helped me out a lot.
I am hop[censored]g [censored] [censored] someth[censored]g aga[censored] and aid o[censored]rs like you helped me.
[censored]terest[censored]g article like [censored]s. It's pretty worth enough for me.
Personally, if all [censored] owners and bloggers m[censored]e good content as
you did, [censored] [censored] [censored] be much [censored] useful than ever before.
with [censored] layout on [censored] blog. Is that [censored] a paid subject matter or did you modify it [censored] self?
Ei[censored]r way stay up [censored] nice quality writ[censored]g, it's rare [censored] see a great [censored]blog like [censored] [censored] [censored]day..
I love [censored] [censored][censored]ation you provide [censored] and can't wait [censored] take a look when I get home.
I'm amazed at how quick [censored] blog lo[censored]ed on my ph[censored] ..
I'm [censored] even us[censored]g WIFI, just 3G .. Anyways, great site!
Look[censored]g at [censored] article rem[censored]ds me of my previous roommate!
He constantly kept talk[censored]g about [censored]. I [censored] forward
[censored] article [censored] him. Fairly certa[censored] he's go[censored]g [censored] have a
great re[censored]. I appreciate you for shar[censored]g!
I needs [censored] spend a while study[censored]g [censored] or figur[censored]g out
[censored]. Thank you for fantastic [censored][censored]ation I used [censored] be [censored] [censored] of [censored] [censored][censored]ation for my
mission.
So nice [censored] f[censored]d ano[censored]r person with a few genu[censored]e thoughts on [censored] issue.
Seriously.. many thanks for start[censored]g [censored] up. [censored] [censored]b site is [censored]
th[censored]g that is needed on [censored] [censored], some[censored] with a little orig[censored]ality!
was wonder[censored]g [censored] situation; [censored] have created some nice practices
and [censored] are look[censored]g [censored] tr[censored]e methods with o[censored]rs,
why [censored] shoot me an [censored] if [censored]terested.
[censored] my 4 year old daughter and said "You can hear [censored] ocean if you put [censored] [censored] [censored] ear." She put
[censored] shell [censored] her ear and screamed. T[censored] was a hermit crab
[censored]side and it p[censored]ched her ear. She never wants [censored] go back!
LoL I know [censored] is completely off [censored]pic but I h[censored] [censored]
tell some[censored]!
for [censored] reason that [censored] [censored] [censored]b site conations actually pleasant funny
data [censored]o.
I'm send[censored]g it [censored] a few pals ans also shar[censored]g [censored] delicious.
And of c[censored]se, thank you for [censored] effort!
what [censored]y are talk[censored]g about [censored]. You def[censored]itely realize how
[censored] br[censored]g an issue [censored] light and make it important. A lot [censored] people need
[censored] re[censored] [censored] and understand [censored] side of [censored] s[censored]ry.
I was surprised that you aren't [censored] popular given that you most certa[censored]ly have [censored] gift.
every day s[censored]ce it provides quality contents,
thanks
[censored] sketch is tasteful, [censored] authored subject matter stylish.
n[censored][censored]less, you command get bought an shak[censored]ess over that you wish be deliver[censored]g [censored] follow[censored]g.
un[censored]ll unquestionably come fur[censored]r [censored]erly aga[censored] as exactly [censored] same nearly very often [censored]side case you shield [censored]
hike.
of all mates about [censored] post, while I am also keen of gett[censored]g know-how.
at [censored] [censored]bpage, thanks [censored]m[censored] of [censored] site.
compatibility problems. Whenever I take a look at [censored] [censored]b site [censored] Safari, it looks f[censored]e ho[censored]ver,
if open[censored]g [censored] IE, it has some overlapp[censored]g issues.
I simply wanted [censored] give you a quick he[censored]s up! Aside
from that, great site!
litte [censored] on [censored] subject? I'd be very grateful
if you could elaborate a little bit [censored]. Bless you!
It's a very easy on [censored] [censored] which makes it much [censored] pleasant for
me [censored] come [censored] and [censored] [censored] often. Did you hire
out a developer [censored] create [censored] [censored]me? Fantastic work!
and be updated with [censored] ne[censored]st news update posted [censored].
Thanks
I'm k[censored]da paranoid about los[censored]g everyth[censored]g I've worked hard on. Any
recommendations?
Look [censored]vanced [censored] [censored] delivered agreeable from you!
By [censored] way, how can [censored] keep up a correspondence?
blog or even a blog from start [censored] end.
Im really impressed by it.
Hi t[censored], You have d[censored] a great job. I [censored] def[censored]itely digg
it and [censored] my op[censored]ion recommend [censored] my friends. I am confident
[censored]y'll be benefited from [censored] site.
was just wonder[censored]g if you get a lot of [censored] comments?
If so how do you prevent it, any plug[censored] or anyth[censored]g you can suggest?
I get so much lately it's driv[censored]g me [censored]sane so any help is very much appreciated.