#11 Sensing Angles - Transform Sensor on Pendulum
- Aurel

- Mar 15, 2022
- 2 min read
During my tries to understand and find a way to measure the angle between the robot and the world, I have found a block which is functioning like a sensor, and it's called a "Transform Sensor": https://uk.mathworks.com/help/physmod/sm/ref/transformsensor.html
While reading about it, I realised this block has a lot of sensing options so I found an example to follow, a double pendulum, where I could apply the Transform Sensor and try it out by connecting it with different parts of the pendulum to learn more about it on a simple mechanism so I can then apply it onto my own robot.
The pendulum example: https://uk.mathworks.com/help/physmod/sm/ug/sense-double-pendulum-motion.html
To import that example, which is alreay built-in the Simscape Multibody, I only wrote in the command prompt "smdoc_double_pendulum" and it opened the double pendulum which I could save for later if I made progress.
I followed the example guide up to a point, where I added my own modifications and obtained the following system (after several trials & errors):

Inside the Transform Sensor I have chosen the "Angle" option:

The result which I have gotten with this combination, is that I could measure the angle between a point, in this case the end part of the pendulum (bottom right in the following figure), and the beginning part of the pendulum, which is fixed (top left in the following figure) and is used as reference:

I have managed to obtain the following simulation result:
The Output graph from the scope returned a graph which was indicating that the angle between the 2 reference axes of up to 45 Degrees:

In conclusion, I believe I have understood how to make use of this for now, and I will try to apply this concept in my system of the self-balancing and will try to measure the angle between the main robot and the actual world frame and see how it behaves in simulation.



Comments