Magnetometer/compass - hardware connection, full software setup, and calibration in Betaflight

Sdílet
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

Komentáře • 59

  • @alexeysushko
    @alexeysushko Před rokem +2

    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!

  • @thematerwelon178
    @thematerwelon178 Před rokem +2

    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.

    • @i3Drones
      @i3Drones  Před rokem

      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! ;-)

  • @Fedablio
    @Fedablio Před rokem

    Excellent job! 😀

    • @i3Drones
      @i3Drones  Před rokem +1

      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.

  • @shotbyarian
    @shotbyarian Před 5 měsíci

    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!

  • @felipee4319
    @felipee4319 Před 11 měsíci

    Thaaankksss !!

  • @doro4414
    @doro4414 Před měsícem

    what if I do not have separate SDA and SCL pads?

  • @OneTakeFPV
    @OneTakeFPV Před 11 měsíci +3

    thx for your tutorial. In betaflight 4.3.0 mag_declination got removed because its unused....

    • @i3Drones
      @i3Drones  Před 11 měsíci

      Thank you! Please suppors as you can ...

  • @gregstewart4692
    @gregstewart4692 Před rokem +1

    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?

  • @allwrightadventures6675

    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

    • @i3Drones
      @i3Drones  Před rokem

      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

  • @levshx
    @levshx Před rokem

    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

  • @a_fry
    @a_fry Před 10 měsíci

    do you have to enter different coordinates every time you travel somewhere?

    • @i3Drones
      @i3Drones  Před 10 měsíci

      Yes if you want to have an accurate determination.

  • @gregstewart4692
    @gregstewart4692 Před rokem

    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?

    • @i3Drones
      @i3Drones  Před rokem

      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.

    • @RuderalisFPV
      @RuderalisFPV Před rokem

      @@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

    • @i3Drones
      @i3Drones  Před rokem

      @@RuderalisFPV first your barometer is detected?

  • @dantanase
    @dantanase Před 10 měsíci

    Beitian Dual BN-220 GPS are compas?

    • @i3Drones
      @i3Drones  Před 10 měsíci

      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

  • @_mr_hyde_
    @_mr_hyde_ Před rokem

    hello, i have BLITZ Mini F7 and M8Q when i type declination i have an error. Any ideas ?

    • @i3Drones
      @i3Drones  Před rokem

      Please tell me the error, may be based on this I can help you.

    • @_mr_hyde_
      @_mr_hyde_ Před rokem

      @@i3DronesError IN set: INVAILD NAME###

    • @i3Drones
      @i3Drones  Před rokem

      ​@@_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.

  • @ourchannel8215
    @ourchannel8215 Před 4 měsíci

    HMC5883L...why not support on drone...hard to fine compass module with original ic...i cant fine to buy HMC5883

    • @i3Drones
      @i3Drones  Před 4 měsíci +1

      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

    • @ourchannel8215
      @ourchannel8215 Před 4 měsíci

      @@i3Drones im from malaysia...many online product come from china 🥴...posible for buy from US,but its much different price...
      thanks for link 👍

  • @maciejmotylinsky
    @maciejmotylinsky Před rokem

    Commend not work on BF4.4 and controller Blitz F7 (Chimera7 V2 Pro O3)

    • @i3Drones
      @i3Drones  Před rokem

      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

  • @theandymann4433
    @theandymann4433 Před rokem

    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

    • @i3Drones
      @i3Drones  Před rokem

      It's far too vague what you're telling me. I can't figure out the problem.

    • @i3Drones
      @i3Drones  Před rokem

      First, check once again if the hardware connections are correctly done. SDA (controller) SDA (magnetometer) & SCL (controller) SCL (magnetometer). Check also the power lines.

    • @i3Drones
      @i3Drones  Před rokem +1

      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

    • @theandymann4433
      @theandymann4433 Před rokem

      @@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?

    • @i3Drones
      @i3Drones  Před rokem

      @@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.

  • @Mitternacht63729
    @Mitternacht63729 Před 2 měsíci

    Hmc5883l nu fjnctioneaza, deci sunt disperat am remapat tot firele ok totul ok

    • @i3Drones
      @i3Drones  Před 2 měsíci

      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?

  • @kimeunsankim8859
    @kimeunsankim8859 Před 10 měsíci

  • @myoung2761
    @myoung2761 Před rokem

    Just confirming, Betaflight 4.4 does not have magnetometer support?

    • @i3Drones
      @i3Drones  Před rokem

      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

    • @myoung2761
      @myoung2761 Před rokem

      @@i3Drones you're a genius. I'm an idiot

    • @i3Drones
      @i3Drones  Před rokem +1

      @@myoung2761 I'm not a genius, I have a little more experience then you. Please like and subscribe.

    • @myoung2761
      @myoung2761 Před rokem

      @@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

    • @i3Drones
      @i3Drones  Před rokem

      @@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.

  • @shotbyarian
    @shotbyarian Před 5 měsíci

    unfortunately i am getting this error: # set mag_i2c_device=1
    ###ERROR IN set: INVALID NAME: mag_i2c_device=1###

    • @shotbyarian
      @shotbyarian Před 5 měsíci

      had to manually chose magnetometer when flashing firmare, if anyone has the same issue

    • @i3Drones
      @i3Drones  Před 5 měsíci +1

      ​@@shotbyarian yes, in cloud you must choose the magnetometer.

    • @shotbyarian
      @shotbyarian Před 4 měsíci

      @@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

    • @i3Drones
      @i3Drones  Před 3 měsíci

      @@shotbyarian it is possible to connected incorrectly or to a I2C port unchecked by the Betaflight. So, first search for a hardware issue.

  • @TheZerocul
    @TheZerocul Před rokem

    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?

    • @i3Drones
      @i3Drones  Před rokem

      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