This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Calculate the traveled angle from the gyro
#1
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!
Reply
#2
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.
Reply
#3
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)…
Reply
#4
(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.
Reply
#5
It works for my purpose now.
I only modified the formulas to get the angle instead of turns.


Attached Files
.phyphox   gyroscope_angle.phyphox (Size: 28.27 KB / Downloads: 217)
Reply


Forum Jump: