The MPU-9250 is an impressive IMU (Inertial Measurement Unit) sensor: For 5 bucks you get "9 axes": A three axes accelerometer, a three axes gyro and a three axis magnetometer (compass).
But dealing with the sensor is anything but easy! It just gives you raw values, you need to do a lot to get a stable angle calculation.
And the only Node-RED node existing is not working anymore on newer node.js versions!
Thus, I decided to start my last winter project for 2020/21: We will go step by step into the integration of the MPU-9250 in Node-RED:
we will use a special note to be able to use Python in Node-RED
we will read out registers, create objects in Python and hand them back to Node-RED
we will combine high and low bytes to words
we will calibrate the accelerometer sensor, using the 15 bit offset registers
we will perform some trigonometry to calculate the rotation angle
we will create a dashboard in Node-RED to get our readings and results
This is part 3:
Today is "angle calculation day". We will create our dashboard and calculate the roll and pitch axis, using our raw values and some equations!
We will base on our theory of part 1, arctangent but as we want to cover 360° we need the atan2 function of the math library.
Fascinating? For sure. Let's go!
Recommended links:
• Understanding Sensor Fusion and Tracking, ... ||| great explanation from Mathworks about IMU. Best I know!
https://www.nxp.com/docs/en/applicati... ||| Application Node from NXP about Tilt Sensing
• 9-Axis IMU LESSON 6: Determine Tilt From 3... ||| Tutorials about tilt calculation of IMUs
На этой странице сайта вы можете посмотреть видео онлайн MPU-9250 with Python in Node-RED #3: Angle Calculation "Basic" using the atan2 function. длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь raspberry4sailing 13 Февраль 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 3,876 раз и оно понравилось 39 зрителям. Приятного просмотра!