I've got a 6DOF IMU and have, using some trig and and a few references such as ADI's app note: https://www.analog.com/en/app-notes/an-1057.html successfully implemented some Arduino/C code to calculate pitch, roll, and "tilt" angle for any given attitude.
Now, I would like to be able to detect about which axis the IMU is being rotated (in its own reference frame). So, picture grabbing one corner of the board on which the IMU is mounted and just lifting it up. This will rotate the IMU, and if I lift straight up, it should rotate in a plane, about that plane's perpendicular.
I would like to find the projection of that perpendicular into the XY plane of the IMU.
I should probably be able to figure this out, but am a bit stuck on it. Then also, all of the search terms I'm using don't readily distinguish the typical pitch and yaw examples of which there are many!