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

preview_player
Показать описание
Calibration basics, min/max calibration, azimuth calculation …
↓↓↓ Complete description, time index and links below ↓↓↓

In part 2 (link below) we read every bit of raw data, respectively, status information the QMC5883L provides and used its interrupt pin instead of just polling the data in fixed intervals. We’re ready now to do something useful with that data.

As we learned in “The Basics” (link below) you need to calibrate your 3-axis magnetometer. So we start with some calibration theory and implement a simple calibration method. And in the end we calculate a compass direction (azimuth).

00:00 Intro – calibration and azimuth calculation
00:48 Axes revisited – three orthogonal magnetic sensors
03:18 Why calibration – sensor, hard iron and soft iron errors
06:28 Goal of calibration – a certain flux creating a perfect sphere
08:46 Correction matrix – sophisticated calibration, hard to do
11:47 Scaled biases – an easier, good enough way to calibrate
14:00 Fourth version – scaled biases calibration for X, Y and Z values
19:03 Experiments – underwhelming for 3 axes, kinda usable for 1
23:30 Azimuth calculation – two values, trigonometry and arctan2
31:37 Fifth version – compass direction around Z-axis (up and down)
35:00 Wrap-up – we’ll have to revisit the correction matrix, bye

#arduino #compass #magnetometer #i2c #microcontroller #tutorials #tutorial #how-to #robertssmorgasbord
Рекомендации по теме
Комментарии
Автор

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)

mikelopez
Автор

Thank you, good video, and very good explanation

gabriellopez
Автор

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.

העבד
Автор

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?

anguinan
Автор

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

markingle
Автор

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

jaydipkavaiya