Revolute Joint measure angle / normalize

7 views (last 30 days)
Tobias Schindler
Tobias Schindler on 27 Mar 2019
Answered: Steve Miller on 28 Oct 2021
The angle of the revolute joint in the inverted pendulum on a chart example (using the sensing option of the revolute joint) is either 0-> -infinity or 0 -> infinity depending on the rotational direction (cw, ccw).
I want to measure the angle in an normalized way so that the position of the pendulum with respect to a world frame (e. g. as an angle from 0->2*pi or from -pi->pi). Standard procedures such as using mod(2*pi) do not work since the revolute joint angles of the sensing port are not unique.
Using the transform sensor did not yield a solution, because i was only able to get the angle between the frame and some reference frame which also has non unique representations for different positions of the pendulum (e.g. the "absolute position" as seen in the mechanics explorer pi/4 and 3/2 pi are encoded as the same measurement values of the transfor sensor [pi/4] due to only measureing the difference.
tl;dr: How to measure the angle between the pendulum and the chart in a normalized way which is independend of rotational direction in the Simulink example "control of an inverted pendulum on a chart".

Answers (1)

Steve Miller
Steve Miller on 28 Oct 2021
Hi Tobias,
I believe there is a solution using the mod block. See screenshot below and attached model.
--Steve

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!