Shop OBEX P1 Docs P2 Docs Learn Events
Adafruit ISM330DLC Gyro SPI P2 driver, yaw pitch roll rotation matrix integration, fixed and float — Parallax Forums

Adafruit ISM330DLC Gyro SPI P2 driver, yaw pitch roll rotation matrix integration, fixed and float

I'm reading the gyro rate outputs at 417hz, creating a rotation matrix, multiplying that times the prior rotation matrix, to create the current rotation matrix, then extracting the yaw, pitch and roll from it.
I'm doing it in fixed point and in floating point to check my work. Floating point was so much easier..
I display an artificial horizon and a heading plot, and output the yaw, pitch and roll in both fixed and float.

Anybody have a better way to show fake decimal point integers on a debug terminal display?

I got a lot of rotation matrix help from this site: https://danceswithcode.net/engineeringnotes/

I want to combine the accelerometer data with the gyro data to create my own IHRS for my drome project.

One of my issues is that when the board is rotated 90 degrees in yaw, the roll axis outputs as pitch, and the pitch axis outputs as roll... you can see this at the end of the youtube video, with yaw around 90, when I "roll" the board, and the artificial horizon shows a pitch change.

https://youtube.com/watch?v=mVMgtbWbE3I

Comments

  • @mwroberts said:
    One of my issues is that when the board is rotated 90 degrees in yaw, the roll axis outputs as pitch, and the pitch axis outputs as roll... you can see this at the end of the youtube video, with yaw around 90, when I "roll" the board, and the artificial horizon shows a pitch change.

    This sounds like your rotation matrix is referenced to the absolute (earth/ground) coordinate system and not to the aircraft frame. I can't tell what the exact problem is as I have no experience with the ISM330. I've used the BNO055 for a similar project and I've also got funny effects with roll and pitch angles. It all stopped and worked perfectly as soon as I got rid of the Euler angles and used quaternions instead.

Sign In or Register to comment.