Angular Deviation from the Vertical Axis

Typically: "How do I... ", "How can I... " questions
Post Reply
Essembly
Posts: 5
Joined: 24 Jul 2020, 10:24

Angular Deviation from the Vertical Axis

Post by Essembly »

Good day. I am working on Self-balancing robot project which is a simple rectangular body on two wheels. I have to develop a way to calculate angular deviation (theta) of the robot from vertical axis as well as the rate of change of this deviation (dtheta/dt). Here is a pic: https://imgur.com/ID1Auun

While I was working only in 1 axis, this job was easily fulfilled with getObjectOrientation function as I just read the asbolute value of beta angle. But now I want the robot to balance in any orientation (around Z), and hence if we turn him 90deg, his beta anlge will read 0 while his alpha angle will give us the actual angle devition.

I simply want an algorithm that gives the angle deviation of the robot with respect to the vertical (Z axis) where the angle is negative if the wheels are further than his body's COG and the angle is positive when the wheels are behind his body's COG. My experiements with the accelerometer showed very noize results so I would rather prefer a solution that doesn't require it. Thank you in advance!

Essembly
Posts: 5
Joined: 24 Jul 2020, 10:24

Re: Angular Deviation from the Vertical Axis

Post by Essembly »

RESOLVED: Let me know if anyone wants to see my code.

shreyas7738
Posts: 19
Joined: 30 Dec 2020, 15:32

Re: Angular Deviation from the Vertical Axis

Post by shreyas7738 »

Hey I am working on similar project and would like to know how you solved the problem.

Post Reply