-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAG AKM8975 being detected as HMC5883 with crazy sensor values #2619
Comments
The AK8975 driver is not enabled for the SPRACINGF3 FC in version 1.8. Please try this using the right driver or |
You sure? It looks like it's enabled to me in SPRACINGF3/target.h, plus I already compiled my own driver and didn't get anywhere with it. Setting it to auto just makes it select HMC5883 as before, and manually setting it to AK8975 causes it to not detect it at all. I'm almost starting to think I have some weird mislabeled clone chip. But here's my status and bootlog from the firmware you linked.
|
Odd. Indeed it was enabled in master but it has been disabled in the development branch. I don't know what is going on. Could be that the driver is broken and has been disabled for the next release. I can't test this myself since I do not own this magnetometer.
|
Huh, weird. Either way, I don't think this chip is actually an AK8975 if it's being detected as a HMC5883. They have different i2c addresses, so there should be no way that it works and detects it when set to HMC5883, yet it does. Also, I just checked and betaflight is detecting it as HMC5883 too.
After some calibrating in betaflight the values seem to be good as well. I took pic while moving it around a bit. |
Huh, interesting. I'll have to try this since I kinda gave up on this board. What is the purpose of that chip anyway? |
takes the gps data and the mag data and combines them into one signal for what maker FC board i don't know. |
Hi, I have the same module as eeprommemory (NEO-M8N with compass - see picture above) and did not remove strange chip between AKM chip and I2c bus, FCC controller I am using is OMNIBUS F4V3. With independent program I found out that AKM8975 mag chip is emulating HMC5883 (or strange chip is doing i2c logical translation to HMC5883 registers) so that is why it is detected as HMC5883. Unfortunately emulation (translation) is not perfect (calibration does not work as HMC5883 and mode changes are not correctly implemented). So I modified source driver for HMC5883 not to use calibrating parameters and readout of data is now correct. Only problem that remain is that after calibration of compass in GUI you have to power down Flight controller because chip does not recognize command for exiting calibration mode and thus remain in undefined state (power down after calibration resolves the issue). The part of HMC5883 driver file which you have to modify is included. I suspect that problems with QMC5883 which is at HMC5883 I2c address can be solved on similar way. I agree that software mod is not the greatest thing , but it opens several dilemmas. Driver part mod HMC5883: static bool hmc5883lRead(magDev_t* magDev)
} |
I have the same M8N GPS module as eeprommemory with the AK8975 chip attached to my Matek F405 OSD board and wasnt detecting any magnetometer at first. So I added a couple 2k pull-up resistors to SDA and SDL. The magnetometer was then being detected as an HMC5883 producing garbage results similar to bkacjios. Fortunately seeing your post I cut away that unknown chip and rewired as eeprommemory showed and bingo, INAV now detects an AK8975 and I get stable results. AmbaCamba you should consider giving it a go because it means you dont have to live with hacked software or unusual calibration procedures. Thanks to all of you guys and long live GOOGLE search! |
What gauge wire did you use, and do you have any tips for doing that mod? I tried, but I didn't have any wire small enough, so I sorta gave up on it. |
Yeah eeprommemory makes it look easy, whereas I think I only got it done by luck! Removing the chip was easy to start...I just cut the chip's arms with a fine wire cutter then used a soldering iron to clear the pads. I laid down the first wire to re-connect SDA from the magnetometer to the output again using the wire I cut off from my 1/4 watt resistor I used for the pull-ups. Then I laid a tiny bit of electricians tape over the the top so I could then set down the next wire to link SDL back again. As I said it wasnt pretty! I could only manage to solder those wires (which are as wide as the pad!) by cleaning the pads of all excess solder, then pre-tinning the wire and finally just heating the pad and wire together to get a join. Frankly, given the fact my wire wasnt insulated, and I needed to use electricians tape, I should have used much finer wire by taking something like a 28awg multistrand wire and just using one of the strands! I think eeprommemory used lacquered wire and if I had the inclination I would have found that somewhere by raiding an old motor or tiny transformer. But honestly, I don't know how he stripped the end to allow him to solder it. However he did it, it looks great. The only reason I attempted it was because, like you, I had run out of options.... Tomorrow I'll try and get a picture and you can see how ugly my "solution" was! |
thinner the wire the easier it is to solder. |
This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help. |
I did the hardware fix. It took me 5 min. I have not tested it outside, but the sensor page looks much better and I see changes as I move my drone around or put a magnet near it. I did have to re-calibrate my mag in iNav. |
I did same hardware mod, the worst part was tu put the 2 connections for SDA and SCL in place, however it is working now - without adding additional pullups resistors for I2C. I did find out the resistors are actually there - R3 and R4 (10kOhms both) but that stupid chip (I removed) did block them to outside bus. Also the GPS power LED stop working for some reason after mod, but the GPS and Mag is fine (catch 10+ satelites in 30s on cold start) One additional note - it is working for me on Omnibus F3 FC with iNav 1.8. Fpr some reason it did not work with iNav 1.9 or higher - looks like AK8975 mag is ommited for my target. |
This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help. |
Automatically closing as inactive. |
INAV/SPRACINGF3 1.8.0 Nov 1 2017 / 06:21:53 (912d131)
FC - https://www.amazon.com/gp/product/B01MS3X1BF
GPS - https://www.amazon.com/gp/product/B077DC7WDB
Behavior
So I just installed a UBLOX NEO-6M into my SP Racing F3 board, and am having a bit of an issue with the external magnetometer. On the GPS chip you can clearly see it's marked as an AKM 8975, yet in iNav only seems to be able to work with it when it's set to HMC5883.
I guess this would be fine if the sensor wasn't spewing out crazy values. I also checked that I'm getting 0 I2C errors as well, so you would think everything is working as it should.
I'm not really sure what to do now. This is my first time ever installing a GPS and using iNav, so I'm a little lost.
Update:
For whatever reason, the magnetometer works great in betaflight. The values seem reasonable and I'm able to calibrate it.
The text was updated successfully, but these errors were encountered: