Disable onboard Mag to use ext Mag
Disable onboard Mag to use ext Mag
Does anyone know if it is possible to disable the onboard Mag IC & connect an external Mag using I2C port?
Megapirates lets you do this but I don't see this option in Config.h of MW 2.3.
Cheers..B
Megapirates lets you do this but I don't see this option in Config.h of MW 2.3.
Cheers..B
Re: Disable onboard Mag to use ext Mag
Maybe I should move to software dev
Re: Disable onboard Mag to use ext Mag
Without a complete schematic its hard to say but it is possible.
The only way I know of that is a sure thing is to remove the on-board mag chip. Then wire the new mag onto the I2C bus.
If the new mag chip uses a different I2C address then just change the I2C mag address in the multiwii code.
You also need to ensure that the orientation of the new mag chip is correct and/or change the code to get the correct orientation.
The only way I know of that is a sure thing is to remove the on-board mag chip. Then wire the new mag onto the I2C bus.
If the new mag chip uses a different I2C address then just change the I2C mag address in the multiwii code.
You also need to ensure that the orientation of the new mag chip is correct and/or change the code to get the correct orientation.
Re: Disable onboard Mag to use ext Mag
I read that latest version of Megapirates you can disable onboard I2C Mag in Config.h & use an external I2C.
It would be great if someone could do the same with MW code.
I don't feel comfortable removing surface mount IC from my Crius AIOP. I'm guessing that chip &or board would be damaged in process.
It would be great if someone could do the same with MW code.
I don't feel comfortable removing surface mount IC from my Crius AIOP. I'm guessing that chip &or board would be damaged in process.
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: Disable onboard Mag to use ext Mag
Just thinking out loud here, if the MAG is connected via mpu6050 aux, you MAYBE able to remark that out in the def.h
and to set the MAG in the Config file.
Code: Select all
#define MPU6050_I2C_AUX_MASTER // MAG connected to the AUX I2C bus of MPU6050
and to set the MAG in the Config file.
Code: Select all
/* I2C magnetometer */
//#define HMC5843
//#define HMC5883
//#define AK8975
//#define MAG3110
Re: Disable onboard Mag to use ext Mag
You can solve it by use a external Mag that use another I2C adress.
HMC5843 and HMC5883 use the same address and can not be combined.
APM have a solder jumper on the board.
You need to remove it from the board or cut some traces to disconnect it.
MAG3110 & AK8975 use totally different addresses and can be combined with the other.
HMC5843 and HMC5883 use the same address and can not be combined.
APM have a solder jumper on the board.
You need to remove it from the board or cut some traces to disconnect it.
MAG3110 & AK8975 use totally different addresses and can be combined with the other.
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: Disable onboard Mag to use ext Mag
If the MAG is connected via the mpu6050 AUX, then it is not connected on the main i2c bus, just disabling the aux master should do the trick. It will just sit there and draw power but not do anything.
Re: Disable onboard Mag to use ext Mag
copterrichie wrote:If the MAG is connected via the mpu6050 AUX, then it is not connected on the main i2c bus, just disabling the aux master should do the trick. It will just sit there and draw power but not do anything.
Would be wonderful if it was that easy.
But I tested on my AIO board direct and HMC5883 is still answering..
Sorry it don't seem to work for me anyway.
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: Disable onboard Mag to use ext Mag
PatrikE wrote:Would be wonderful if it was that easy.
But I tested on my AIO board direct and HMC5883 is still answering..
Sorry it don't seem to work for me anyway.
Did you try remarking the following out for your board?
Code: Select all
#define MPU6050_I2C_AUX_MASTER // MAG connected to the AUX I2C bus of MPU6050
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: Disable onboard Mag to use ext Mag
If the MAG is still answering, then it is connected directly to the i2c bus and not to the mpu6050 aux.
Re: Disable onboard Mag to use ext Mag
Yes i commented MPU6050_I2C_AUX_MASTER in def.h in CRIUS_AIO_PRO_V1 board defines.
I guess it's not connected thru I2C_AUX_MASTER then.
I have one more AIO but can't test it until tomorrow.
Or actually i think i have a V2 board.
http://www.rctimer.com/product_765.html
There may be some difference between them.
I guess it's not connected thru I2C_AUX_MASTER then.
I have one more AIO but can't test it until tomorrow.
Or actually i think i have a V2 board.
http://www.rctimer.com/product_765.html
There may be some difference between them.
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: Disable onboard Mag to use ext Mag
My mistake, it is not that easy. Here is some information from the datasheet, seem if the mpu6050 is not in the master mode, it is in the pass-thru and this explains why the MAG still answered up.
Sorry
Sorry
Auxiliary I2C Serial Interface
The MPU-60X0 has an auxiliary I2C bus for communicating to an off-chip 3-Axis digital output magnetometer or other sensors. This bus has two operating modes:
I2C Master Mode: The MPU-60X0 acts as a master to any external sensors connected to the auxiliary I2C bus
Pass-Through Mode: The MPU-60X0 directly connects the primary and auxiliary I2C buses together, allowing the system processor to directly communicate with any external sensors.
Re: Disable onboard Mag to use ext Mag
Well it was worth a try..
Re: Disable onboard Mag to use ext Mag
Thanks for trying guys.
Just a thought- can Passthru on MPU6050 be disabled off so that Atmel 2650 can't receive data from the onboard Mag chip or are there only two modes to I2C setting?
Somehow MP are doing this as they run their code on same Crius AIOP & turn off onboard Mag with a line of code.
Just a thought- can Passthru on MPU6050 be disabled off so that Atmel 2650 can't receive data from the onboard Mag chip or are there only two modes to I2C setting?
Somehow MP are doing this as they run their code on same Crius AIOP & turn off onboard Mag with a line of code.
Re: Disable onboard Mag to use ext Mag
Hi Guys,
Finally found the answer by searching many forums. On my Crius AIOP V2 there are two jumper pads (SJ2 & SJ3) associated with the onboard mag chip.
Cutting the links totally removes Mag IC from !2C bus.
Cheers..B
Finally found the answer by searching many forums. On my Crius AIOP V2 there are two jumper pads (SJ2 & SJ3) associated with the onboard mag chip.
Cutting the links totally removes Mag IC from !2C bus.
Cheers..B
Re: Disable onboard Mag to use ext Mag
brewski wrote:Hi Guys,
Finally found the answer by searching many forums. On my Crius AIOP V2 there are two jumper pads (SJ2 & SJ3) associated with the onboard mag chip.
Cutting the links totally removes Mag IC from !2C bus.
Cheers..B
And were you then able to use an external MAG on the I2C bus?
And which one did you use? I am going to put my GPS and MAG on a mast away from the noise, or as much as possible.
Re: Disable onboard Mag to use ext Mag
I came accross the same dilema ... too muche noise around the onboard mag on my mutiwii pro so i hacked of the onboard mag or should i say gently teased it of with a stanley blade
then i undefined this line in def.h (not config.h)
#define MPU6050_I2C_AUX_MASTER // MAG connected to the AUX I2C bus of MPU6050
Then defined my external mag in config.h like so
/* I2C magnetometer */
//#define HMC5843
#define HMC5883
//#define AK8975
//#define MAG3110
now i have an external mag on the multiwii pro (im not worried about not having the on board one as it was mainly a pain
pics
The onboard mag ...gone !!!
The external mag and orientation plugged into the 3.3v i2c pins(this is the external mag https://www.sparkfun.com/products/10530 )
then i undefined this line in def.h (not config.h)
#define MPU6050_I2C_AUX_MASTER // MAG connected to the AUX I2C bus of MPU6050
Then defined my external mag in config.h like so
/* I2C magnetometer */
//#define HMC5843
#define HMC5883
//#define AK8975
//#define MAG3110
now i have an external mag on the multiwii pro (im not worried about not having the on board one as it was mainly a pain
pics
The onboard mag ...gone !!!
The external mag and orientation plugged into the 3.3v i2c pins(this is the external mag https://www.sparkfun.com/products/10530 )
Re: Disable onboard Mag to use ext Mag
Hi Rusty,
My ext mag board arrived today so I cut the SJ3 (RHS) track on Crius AIOP V2.
I then modified the MW 2.3 Navi b7 def.h (not config.h).
Under #if defined Crius_aiop_pro_V2_v1 uncomment (//) out line-
#define MPU6050 _12C _AUX_MASTER //MAG
Save & then upload to your FC.
Connect the ext Mag board to the I2C port ensuring that you have connected as follows provided your Mag board has on board 3.3 regulator-
Gnd- Black
+5(VCC)- Red
SDA- Yellow
SCL - Green
Calibrate Mag using MW Config ( 360 degrees in all axis) rotate mag board to ensure accurate using compass. Check that there are no I2C errors over at least 10 minutes.
From what I have read the ext Mag should be mounted as far away from magnetic fields as possible. This means as far from motors, DC cables to ESCs, distribution board & any steel screws or mounts as you can get. Commercial quads mount Mag board on legs or on mast. I'm guessing that they are right & will buy one of the masts I,ve seen on EBay. Could also mount GPS up there away from interference as well but pretty accurate already.
My ext mag board arrived today so I cut the SJ3 (RHS) track on Crius AIOP V2.
I then modified the MW 2.3 Navi b7 def.h (not config.h).
Under #if defined Crius_aiop_pro_V2_v1 uncomment (//) out line-
#define MPU6050 _12C _AUX_MASTER //MAG
Save & then upload to your FC.
Connect the ext Mag board to the I2C port ensuring that you have connected as follows provided your Mag board has on board 3.3 regulator-
Gnd- Black
+5(VCC)- Red
SDA- Yellow
SCL - Green
Calibrate Mag using MW Config ( 360 degrees in all axis) rotate mag board to ensure accurate using compass. Check that there are no I2C errors over at least 10 minutes.
From what I have read the ext Mag should be mounted as far away from magnetic fields as possible. This means as far from motors, DC cables to ESCs, distribution board & any steel screws or mounts as you can get. Commercial quads mount Mag board on legs or on mast. I'm guessing that they are right & will buy one of the masts I,ve seen on EBay. Could also mount GPS up there away from interference as well but pretty accurate already.
Re: Disable onboard Mag to use ext Mag
I have been successful in completely disabling the onboard mag. I am now trying to enable the mag on my uBlox 6M GPS module but cannot find the chip information. Does anyone happen to know this? Or how to get it working?
Re: Disable onboard Mag to use ext Mag
Norvaguy wrote:I have been successful in completely disabling the onboard mag. I am now trying to enable the mag on my uBlox 6M GPS module but cannot find the chip information. Does anyone happen to know this? Or how to get it working?
You should go to site where you bought it & look for specs. If HK look under Files Tab for the product. Besides finding out exactly what Mag IC it uses you also need to find out if I2C bus is running on 3.3 or 5V to match the port on your FC.
Re: Disable onboard Mag to use ext Mag
brewski wrote:Norvaguy wrote:I have been successful in completely disabling the onboard mag. I am now trying to enable the mag on my uBlox 6M GPS module but cannot find the chip information. Does anyone happen to know this? Or how to get it working?
You should go to site where you bought it & look for specs. If HK look under Files Tab for the product. Besides finding out exactly what Mag IC it uses you also need to find out if I2C bus is running on 3.3 or 5V to match the port on your FC.
Thanks for the reply. I went and did more looking and stumbled across a picture that had the compass leads off the uBlox 6M plugged into the 3DR Telemetry port. That did the trick. I had been plugging it into a serial port the other times.
Re: Disable onboard Mag to use ext Mag
Any serial port will work provided you configure it in GPS settings in Config.h
Re: Disable onboard Mag to use ext Mag
I have the MW Pro. Would onboard mag problems explain why my copter would rotate 5-10 degrees immediately upon take-off, even before it cleared the grass on the lawn? Or why the copter would do the opposite what the TX sticks do? The last two times I've flown this is what's happened. Something is wrong... I'm debating replacing the FC with a different controller. But after finding some other posts and reading this thread I'm thinking maybe I should just replace the gps with a UBLOX/Mag unit and disable the onboard mag. Thoughts?
Re: Disable onboard Mag to use ext Mag
Are you flying with mag enabled? If so, simple test.. turn it off and see if it still happens.
Re: Disable onboard Mag to use ext Mag
That's a good point Arakon. But I'm still attending the school of hard knocks so I use head free all the time (which means I need mag). If I try hard enough I can convince myself that is is the mag 'cause it's had some strange symptoms and they seem to be getting worse. Yesterday it took off straight, I had baro and head free turned on, I rolled it to the left 30 deg. maybe more, then tried to level it as it went speeding by but instead it rolled more to the left and into the ground. So now I'm waiting on parts again.
If the mag thought North was really South (with head free on) would that explain the reverse in the controls? This board has has some hard knocks.
If the mag thought North was really South (with head free on) would that explain the reverse in the controls? This board has has some hard knocks.
Re: Disable onboard Mag to use ext Mag
Generally, using an onboard mag means that the mag sensor is pretty close to the power wiring. The power wiring creates a magnetic field, which will confuse the mag, sometimes completely.
The more throttle, the stronger the interference.. which is why you see it rotate on takeoff.
And honestly, there is no "needing" headfree mode. How will you learn to fly properly otherwise?
Headfree is a nice idea, but there are a lot of things that can mess with the mag, and that will make headfree actually a lot worse than flying without it.
Same goes for baro, baro is nice for filming/mission mode or to fly FPV without having to worry about the ground, but it has no place in normal flying since it completely messes up throttle response in an emergency.
The more throttle, the stronger the interference.. which is why you see it rotate on takeoff.
And honestly, there is no "needing" headfree mode. How will you learn to fly properly otherwise?
Headfree is a nice idea, but there are a lot of things that can mess with the mag, and that will make headfree actually a lot worse than flying without it.
Same goes for baro, baro is nice for filming/mission mode or to fly FPV without having to worry about the ground, but it has no place in normal flying since it completely messes up throttle response in an emergency.
In the very early days head free can be useful if the beginner loses orientation you can hit head free mode and pulling back on the right stick beings it back home (seen it used on APM equipped quads like this)
Other than that I would say avoid it as will make it al lot harder to learn to fly the machine.
Other than that I would say avoid it as will make it al lot harder to learn to fly the machine.
Re: Disable onboard Mag to use ext Mag
A Loiter type mode would be great for beginners. Just centre sticks & quad stays in place.
Re: Disable onboard Mag to use ext Mag
Thanks for all the input! Yeah, learning to fly without mag is on my list now, you've convinced me. I'm still learning what NOT to do, it's been a steep and frustrating curve. Eventually I want to do aerial photography/filming so having mag and baro working well is something I'll want (I assume).
I'm leaning towards the Quanum LEA-6H from HK to replace the onboard mag. I hope that means I'll have better GPS too. Thoughts on this would be appreciated.
But hmm... maybe I could try flying without mag while I wait for the new one? It's easy to get disoriented though.
I'm leaning towards the Quanum LEA-6H from HK to replace the onboard mag. I hope that means I'll have better GPS too. Thoughts on this would be appreciated.
But hmm... maybe I could try flying without mag while I wait for the new one? It's easy to get disoriented though.
-
- Posts: 51
- Joined: Thu Jul 10, 2014 2:13 pm
Re: Disable onboard Mag to use ext Mag
brewski wrote:A Loiter type mode would be great for beginners. Just centre sticks & quad stays in place.
Isn't That what PH is suposed to do.
Re: Disable onboard Mag to use ext Mag
That's why you start out slow.. don't move it far away from you until you get a feeling for the directions. Small stick movements, unless you are racing, there's no need to ever push the stick far into one direction.
Re: Disable onboard Mag to use ext Mag
Hoppsan_84 wrote:brewski wrote:A Loiter type mode would be great for beginners. Just centre sticks & quad stays in place.
Isn't That what PH is suposed to do.
From what I have read it is more. You can fly around and if sticks centred quad will hold position using current GPS position as well as hold height. Great for beginners & photography.