A Smartphone is initially in the position indicated as follow
We move it, and get the next gyro reading.
How can you estimate your final position graphically?
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.
Sign up to join this communityA Smartphone is initially in the position indicated as follow
We move it, and get the next gyro reading.
How can you estimate your final position graphically?
Here's a copy of your image:
This must be rotational accelerations, it can't be rotational speed because you don't get that information from a gyroscope.
Assuming it is actually rotational acceleration and not rotational speed then along the Y axis you rotate slowly, then faster and faster. At T=1 you stop rotating faster and just keep rotating as if your object is in space for one second. And as it is rotating along its Y axis, it begins to ramp up its rotation in Z axis. I made an animation for this because it hurts my brain to visualize this. Blender is your friend.
Integrating acceleration to get speed and then again to get position works... if you use quaternions, so doing it individually as I've shown it in the animation is a lie. But lies makes it easier to think.
Here are the values for the angles, I eyeballed it.
Y angle is in green, Z angle is in blue.
Because the inputs you gave are simply 1 for some time (or some other constant, I don't care, I'll call it 1), and during that time you get \$\int 1~dx=x+c\$ which gives you the rotational speed, and then you do \$\int (x+c)~dx=\frac{x^2}{2}+cx+d\$ to get rotational angle. Notice how sensitive it is to errors, it will drift easily if you try to compute it.
According to comments it might actually be a rate gyro that outputs speed and not acceleration, meaning that it is not just a gyroscope, there is a gyroscope and some extra parts already integrating the acceleration to give you the speed. I'll keep the first half because there are still gyroscopes out there that gives rotational acceleration.
So assuming that the output is rotational speed, then we get the rotational position simply by integrating once. I don't know what the amplitude of those square waves are, but let's call their height for k. Then we acquire the rotational position with this equation: \$\int k~dx=kx+c\$, it is a straight line.
Here's an animation where I've set kx to be equal to 90° after one square, it could be some other angle, it depends on the time and the value of k, both of which are unknown to me.
Here are the local angles:
Y angle is in green, Z angle is in blue.
Local information:
I actually didn't use this data because Blender uses global angles, but locally this is what happens.
Global information:
At T=1 to T=2 the phone doesn't rotate along the global Z axis, it actually rotates along the global X axis. And now it depends on what rotation system you are in, XYZ, XZY, YXZ, YZX, ZXY, ZYX, the order matters. XYZ is pretty common which means that first you rotate some angle around X, then some angle around Y, and last some angle around Z.
Now it gets tricky, because first you rotate along Y axis and then X axis, if it would've been X axis first and then Y axis it would've been very simple because then it's XYZ. But we're rotating in Y axis afterwards anyways so XYZ or ZYX is equally annoying. This smells very much like a homework problem.
This is the format for the text below (rotational x position, rotational y position, rotational z position).
But okay, at T=1, global angle of the phone (0°, 90° 0°) becomes (90°, 90° 90°) which doesn't change the orientation of the phone at all. But this global change aligns the axis so when you rotate along the local Z axis you are actually rotating along the global Y axis and get to (90°, 0° 90°) at T=2. And then from T=2 the local Y axis is now aligned with the global Z axis, and this ends up with (90°, 0° 180°) at T=3.
The local angles doesn't tell you anything really. Given the local rotation position of (0°, 180° 90°) I can't work out anything. Because I can't tell from this information that there was a gap between where we rotated in the local Z axis.
However, given the global angles of (90°, 0° 180°) AND knowing that the order of rotations are XYZ, then I can tell exactly what orientation the phone is in. First you rotate the phone 90° in the global X axis, then 0° in the global Y axis, and finally 180° in the global Z axis.
It gets much easier if you just hand off the problem to the computer and let it compute everything with quaternions. Then you won't get a headache.
You integrate angular velocity over time to get angular displacement. But then you run into the issue of the order of rotations. After all, readings are coming in on all three axis simultaneously so how do you know which order to apply the rotations in? Luckily, as time intervals decrease towards zero, angular velocities on each axis approach being applied simultaneously. But your waveforms were not constructed for that complication to ever be an issue.