QST QMC5883L 3-Axis Digital Compass and Arduino MCU - The Details (3)

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ม.ค. 2025

ความคิดเห็น • 18

  • @mikelopez9893
    @mikelopez9893 2 ปีที่แล้ว +3

    As always, thanks for your efforts in preparing these videos. For me, this is very much "a touch of nostalgia for the old folks." It takes me back to doing my first degree (Maths) in the UK in the 1960s. The language of choice then for all the cool kids was FORTRAN IV and the space race was very much in the public eye. Naturally, we did a lot of calculations calculating orientation and motion in 3D space. In addition to Matrices and Vectors, Quaternions were an important part of the toolkit for efficient calculation. It is strange for me to realize that the 1960s are more that half a century ago. Nowadays, of course, I'd use C++ for such calculations, but that hadn't been invented then (not even C or its predecessor BCPL). Moreover, an Arduino could easily out-perform most of the main-frame computers of that era so it's easily up to the job of what you are doing. Thanks again for taking me on a trip down memory lane!
    Regards,
    Dr Miclael (someone born in the first half of the 20th Century)

    • @robertssmorgasbord
      @robertssmorgasbord  2 ปีที่แล้ว +1

      As always, you are very welcome! And I have to thank you for your most interesting and extensive comments! In part 4 I will cheat a little bit and do the calculations for the matrix calibration on a PC. At it's core it's taking a calibration dataset (in my case 3512 points, created by doing 14 360° rotations in 14 different orientations) and spits out a bias matrix and offset vector. After applying those your data should approximate a sphere in 3-D space. A bit too much computation for the Arduino and a bit too much math for TH-cam (though there are specialized math channels). But ... in part 5 I will do some kind of circular (modulo) median calculation on the Arduino for filtering purposes (at least that's my current plan).

  • @gabriellopez785
    @gabriellopez785 ปีที่แล้ว

    Thank you, good video, and very good explanation

  • @העבד
    @העבד ปีที่แล้ว +1

    I recently got one of these chips, your series has helped me quite a bit, I happen to notice that this specific chip (QMC5883l) seems to output data in big endian format (when I try to read using little endian - the values are not stable when the chip is stationary) despite the datasheet implying little endian.

    • @robertssmorgasbord
      @robertssmorgasbord  ปีที่แล้ว +3

      And then there's the order thy bytes and the bits within the bytes are transferred via I2C ... It has been a while, but I seem to remember that I also ran into that big/small endian problem.

  • @markingle8980
    @markingle8980 8 หลายเดือนก่อน

    Thanks for the information on the QMC5883L config and calibration! Will your code compile on Arduino 2.0?

    • @robertssmorgasbord
      @robertssmorgasbord  8 หลายเดือนก่อน

      I have no idea. I'm still on 1.8.19. One thing I know is that Arduino no longer wants you to use their "boolean" type and that you should use the standard C++ "bool". But replacing that in the code shouldn't be a problem.

    • @markingle8980
      @markingle8980 8 หลายเดือนก่อน

      @@robertssmorgasbord Thanks! I had to also add Arduino.h to eliminate most of the compile errors. There were several others as well. I think its best to use 1.8.19....I am having all sorts of issues with 2.0 so I recommend to stick with 1.8.19 as long as you can.

  • @anguinan
    @anguinan 3 หลายเดือนก่อน

    thanks for this explanation, it really covered the basics I wanted to understand from this device! I question though, shouldn't the measure of X (and Y) be altered when you tilt the device? If we put the device, say 45° from xy plane, the x sensor would be "far away" from the north and as a consequence it would change the value of alpha, isn't it?

    • @robertssmorgasbord
      @robertssmorgasbord  3 หลายเดือนก่อน +1

      You're absolutely right! To compensate for that you must measure the tilt of your compass chip, using for example an accelerometer, and then apply even more math! Some day I'll make a video about that, but if you wanna read up un the subject ahead of that have a look at www.infineon.com/dgdl/Infineon-AN2272_PSoC_1_Sensing_Magnetic_Compass_with_Tilt_Compensation-ApplicationNotes-v04_00-EN.pdf?fileId=8ac78c8c7cdc391c017d0731b0d05573 (full math) or www.instructables.com/Tilt-Compensated-Compass/ (a bit easier to digest).

    • @anguinan
      @anguinan 3 หลายเดือนก่อน

      @@robertssmorgasbord thanks for the reply. Looks hard than I though, mostly for the fact that you need to align the accelerometer with the compass, I think, in the Z axis, so this way tilt reference to ground should match between devices.

    • @robertssmorgasbord
      @robertssmorgasbord  3 หลายเดือนก่อน +1

      @@anguinan Your welcome! And yes, the math and the additional calibration for the accelerometer is not trivial.

  • @BaconElijah-w3w
    @BaconElijah-w3w 4 หลายเดือนก่อน

    McKenzie Via

    • @robertssmorgasbord
      @robertssmorgasbord  3 หลายเดือนก่อน

      Matterhorn Through 🤣 (I'm starting to like this game)

  • @jaydipkavaiya6854
    @jaydipkavaiya6854 ปีที่แล้ว

    Thank you for detailing in QMC5883l can I get Version5 code sample so I Can find Magnetic Heading or your Email so I can chat over there. Please

    • @robertssmorgasbord
      @robertssmorgasbord  ปีที่แล้ว +2

      You're welcome! All versions are available on my Google drive drive.google.com/drive/folders/12kyof0Hg6CITjcA6A3DgAFln-HouaEX8?usp=sharing