Magnetometer/compass - hardware connection, full software setup, and calibration in Betaflight
Vložit
- čas přidán 29. 07. 2024
- This video is a comprehensive overview of how to connect, set, and calibrate the compass component in order to get the best-desired results in Betaflight. But it is also addressed to those who want to know more information about magnetic sensors or about Betaflight.
--------------------------------------------------------------------------------------------------------------------------------------------------------------
00:00 - Introduction
01:22 - Magnetometers & Betaflight
02:13 - Hardware connections
02:58 - Betaflight settings
08:19 - Calibrating the magnetometer
08:51 - Final words
--------------------------------------------------------------------------------------------------------------------------------------------------------------
If you have some ideas for my channel, requests, questions, etc., please leave a comment down below or write to me on my email.
--------------------------------------------------------------------------------------------------------------------------------------------------------------
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣ → bit.ly/3arWvOq
╠╗║╚╝║║╠╗║╚╣║║║║║═╣ I Really Appreciate Your Support!
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝ - Věda a technologie
Exactly what is needed. Connected M8Q-5883 to Mamba Basic F405 and didn't see the magnetometer. When setting "set mag_i2c_device=1" everything worked! Thanks!
THANK YOU!!! I've been struggling with getting my compass to work correctly for almost a year now, and your tutorial just made it happen.
If you like it smash the like button, if other videos from my channel doesn't like you smash two time the dislike button - but overall subscribe! ;-)
Excellent job! 😀
If your magnetometer is placed in a specific position be aware of "MAG Alignment" drop down box in the GUI. Go to the Configuration tab in Betaflight Configurator, you will see a section on the right called "Board and Sensor Alignment". At the bottom of that section you will see a "MAG Alignment" setting.Or you can do by using the CLI commands:
align_mag = CUSTOM
mag_align_roll = xxxx
mag_align_pitch = xxxxx
mag_align_yaw = xxxxx
and in the end calibrate.
if/when you have time, i would love a redo of this video for betaflight 4.5 since a lot has changed, thanks a lot!
Thaaankksss !!
what if I do not have separate SDA and SCL pads?
thx for your tutorial. In betaflight 4.3.0 mag_declination got removed because its unused....
Thank you! Please suppors as you can ...
Hey, I appreciate this information. The magnetometer never seems to show with any FC, or when there is clearly a device using it like a GPS and Compass combined. I just tried entering the settings you guided me to use with the JBF7 v2 with BF 4.3.1. "Magnetic declination" is not recognized as a valid command. Anyway, I entered what I thought were the correct settings and BF is saying that I now have 8 i2c errors. I made the mistake of not saving a dump before I started this. After 4&1/2 years you would think I know better. I did save a "diff all" though, so I am going to reflash and put my settings back in. How can I know what is correct with regard to what you are doing?
same experience here
Quick question does the cli commands need to be given I betaflight 4.4? When I inputed them it didn't recognize the mag declination command? thanks
You must downloading a software version for your FMU that does have the magnetometer part incorporated.
The new "cloud build" option allows you to select the different components you want to incorporate.
Reading their documentation I found: "For those missing a barometer: You can try any or all of BARO_MS5611 BARO_SPI_MS5611 BARO_BMP280 BARO_SPI_BMP280 BARO_BMP388 BARO_SPI_BMP388 BARO_LPS BARO_SPI_LPS BARO_QMP6988 BARO_SPI_QMP6988 BARO_DPS310 BARO_SPI_DPS310 BARO_BMP085 BARO_2SMBP_02B BARO_SPI_2SMBP_02B in the custom defines input box."
The link is here:
betaflight.com/docs/release/Betaflight-4.4-Release-Notes
for good quality, you must adjust the sensor yourself.
align_mag = CUSTOM
mag_align_roll = xxxx
mag_align_pitch = xxxxx
mag_align_yaw = xxxxx
and calibrate after setting the correct location
thx
do you have to enter different coordinates every time you travel somewhere?
Yes if you want to have an accurate determination.
I just re-flashed the board and the 8 i2c errors are still present. Since I don't know what the original settings were (my mistake) I don't really know what to do. What would you suggest?
I’m unfamiliar with JBF7 V2 but searching on the web (you have a very nice FMU !!!!), I found that the I2C port is shared with UART 3. So, first, disable UAR3 from the port configuration. At this point, I do not know if it is enough to activate the I2C port - maybe additional steps are required. Also, from the internet, I found that your board has a barometer - I intuit that the barometer is connected to the I2C bus (it is possible to use SPI also). So, what would I try if I were in your shoes: 1. disable UAR3, 2. Disconnect the magnetometer from I2C, 3. Set mag_bustype = NONE, 4. Set mag_hardware = NONE, 4. set mag_spi_device = 0, 5. set mag_i2c_device = 1 (for barometer). Now, use the status in CLI to see if the barometer is detected. If it is not possible to work on the SPI bus or to activate the I2C bus additional steps are required.
@@i3Drones i didnt get option for magnetic declination as a valid command either, getting a i2c error, after doing a status command in cli, using a brainfpv radix2 with a matek m8q-5883 gps
@@RuderalisFPV first your barometer is detected?
Beitian Dual BN-220 GPS are compas?
No, BN-220 has no compass. More, the Bn-220 is not so grate GPS - you have a study here: czcams.com/video/QfwV7NP5BI8/video.html
hello, i have BLITZ Mini F7 and M8Q when i type declination i have an error. Any ideas ?
Please tell me the error, may be based on this I can help you.
@@i3DronesError IN set: INVAILD NAME###
@@_mr_hyde_ I think the problem is that you missed a letter in the command: set mag_declination. I think INVAILD NAME means that BF received a non-existent command.
HMC5883L...why not support on drone...hard to fine compass module with original ic...i cant fine to buy HMC5883
You have links here:
www.optimusdigital.ro/ro/senzori-senzori-inertiali/5187-modul-busola-digitala-qmc5883l.html
ardushop.ro/en/electronics/233-3-axes-magnetic-field-sensor-hmc5883.html
@@i3Drones im from malaysia...many online product come from china 🥴...posible for buy from US,but its much different price...
thanks for link 👍
Commend not work on BF4.4 and controller Blitz F7 (Chimera7 V2 Pro O3)
I haven't tested the controls in BF 4.4, but the controls should work without problems.
The only problem I see is downloading a software version for your FMU that does not have the magnetometer part incorporated.
The new "cloud build" option allows you to select the different components you want to incorporate.
Reading their documentation I found: "For those missing a barometer: You can try any or all of BARO_MS5611 BARO_SPI_MS5611 BARO_BMP280 BARO_SPI_BMP280 BARO_BMP388 BARO_SPI_BMP388 BARO_LPS BARO_SPI_LPS BARO_QMP6988 BARO_SPI_QMP6988 BARO_DPS310 BARO_SPI_DPS310 BARO_BMP085 BARO_2SMBP_02B BARO_SPI_2SMBP_02B in the custom defines input box."
The link is here:
betaflight.com/docs/release/Betaflight%204.4%20Release%20Notes
Hi I have been having a lot of trouble setting up compass MQ8 - 5883
With Mamba Mk4 F722
i have tried all your settings still no luck!
Any suggestions would be appreciated
It's far too vague what you're telling me. I can't figure out the problem.
First, check once again if the hardware connections are correctly done. SDA (controller) SDA (magnetometer) & SCL (controller) SCL (magnetometer). Check also the power lines.
Searching on the web I found this issue: I2C is not working on dedicated pins - so, follow the remaping procedure presented there:
github.com/iNavFlight/inav/issues/6441
@@i3Drones thanks for the reply, this may be above my level as i am a newbie! will give it a go. Will it work ok with the MAMBAF722_2022B as this is a different fimware to the I2C. My Baro works fine atm i just cannot get the compass to show up?
@@theandymann4433 if I guess, it is possible to have a problem with set mag_i2c_device - try different values 1, 2, 3 or 4, it is the only one parameter that I do not understand completely. But, first power up the drone.
Hmc5883l nu fjnctioneaza, deci sunt disperat am remapat tot firele ok totul ok
Buna! Vezi ca in noua abordare trebuie sa selectezi componentele pe care vrei sa le utilizezi inainte de a construi imaginea care va rula pe drona. Deci, ai facut asa ceva?
Just confirming, Betaflight 4.4 does not have magnetometer support?
The new "cloud build" option allows you to select the different components you want to incorporate.
Reading their documentation I found: "For those missing a barometer: You can try any or all of BARO_MS5611 BARO_SPI_MS5611 BARO_BMP280 BARO_SPI_BMP280 BARO_BMP388 BARO_SPI_BMP388 BARO_LPS BARO_SPI_LPS BARO_QMP6988 BARO_SPI_QMP6988 BARO_DPS310 BARO_SPI_DPS310 BARO_BMP085 BARO_2SMBP_02B BARO_SPI_2SMBP_02B in the custom defines input box."
The link is here:
betaflight.com/docs/release/Betaflight-4.4-Release-Notes
@@i3Drones you're a genius. I'm an idiot
@@myoung2761 I'm not a genius, I have a little more experience then you. Please like and subscribe.
@@i3Drones Definitely earned my sub! How would I set magnetic declination on betaflight 4.4.1? I get an invalid command error when typing it in CLI
@@myoung2761 Up to now, I do not install 4.4.1. - may be in this weekend - may be it is the same problem, select the build with compass.
unfortunately i am getting this error: # set mag_i2c_device=1
###ERROR IN set: INVALID NAME: mag_i2c_device=1###
had to manually chose magnetometer when flashing firmare, if anyone has the same issue
@@shotbyarian yes, in cloud you must choose the magnetometer.
@@i3Drones unfortunately the magnetometer is still greyed out for me even if i try all the different ic2 devices (0-4), any idea why? flywoo m10 mini w compass
@@shotbyarian it is possible to connected incorrectly or to a I2C port unchecked by the Betaflight. So, first search for a hardware issue.
I have M8Q-5883 does not connect to Kakute H7, Betaflight 4.4.no command command from your video is entered, gives an error, what to do?
I haven't tested the controls in BF 4.4, but the controls should work without problems.
The only problem I see is downloading a software version for your FMU that does not have the magnetometer part incorporated.
The new "cloud build" option allows you to select the different components you want to incorporate.
Reading their documentation I found: "For those missing a barometer: You can try any or all of BARO_MS5611 BARO_SPI_MS5611 BARO_BMP280 BARO_SPI_BMP280 BARO_BMP388 BARO_SPI_BMP388 BARO_LPS BARO_SPI_LPS BARO_QMP6988 BARO_SPI_QMP6988 BARO_DPS310 BARO_SPI_DPS310 BARO_BMP085 BARO_2SMBP_02B BARO_SPI_2SMBP_02B in the custom defines input box."
The link is here:
betaflight.com/docs/release/Betaflight-4.4-Release-Notes