phyphox Forums

Full Version: Calculate the traveled angle from the gyro
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello Everyone,
i'd like to set up a custom experiment to improve the workflow.
But I don't fully understand the complex editor and need some help to make the right connections.

My Experiment:
My phone lies on the axis of a motor. With the Gyroscope Experiment I get the rate of rotation.
Now I would like to expand this experiment to plot the traveled angle.

In formulas it looks like this:

1. w [rad/s] -> p [°/s] ->DONE
p = w/(2*PI)*360

2. p [°/s] -> a [°] (absolute angle) -> IN PROGRESS
a = p * (actual time - last time) + last a

actual time is the time of the latest measurement
last time is the time of the last measurement
last a is the last calculated a

Where I need help:
- How to calculate (get) the timestamp of the last measurement (last time)?
- How to feed the second formula with the last calculated angle (last a)?

In the graph it would display the traveled angle (y-axis) and the time (x-axis)
I.e. "The motor reached 90° after 10s"

In Excel the formulas work fine and it seems to be very precise.

Thank you for all the help!
Hello,
you may try to use already built in function "integrate" to get the angle by integrating gyro output.
The sampling rate is constant (given by the phone you use) and you can scale the final integration with the period used.
Hope this is helpful.
You could find an example on counting “turns” that you could adapt: https://phyphox.org/forums/showthread.php?tid=1334 (or copy the required bits – best with a text editor)…
(10-09-2023, 08:50 PM)Jens Noritzsch Wrote: [ -> ]You could find an example on counting “turns” that you could adapt: https://phyphox.org/forums/showthread.php?tid=1334 (or copy the required bits – best with a text editor)…

Thank you for your reply! This is a very nice example for what I want to do. It should be easy to modify the formulas.
It works for my purpose now.
I only modified the formulas to get the angle instead of turns.