Friday, December 8, 2006

Simplified Free-Body Diagram



This is a free-body diagram for a robot that can balance in a single plane (i.e. forward and back only). The circle represents the "otolith" while the rectangles represent the sensors, which are mounted 90 degrees apart. In case you aren't familiar with free-body diagrams, it's basically just a device to keep a physics problem from getting too confusing. There are only three forces on the otolith--W the weight force, N1 and N2 the "normal" forces, i.e. the reaction forces from the ball pressing on the sensors.

T1 + T2 = 90
N1*sin(T1) = N2*sin(T2)
N1*cos(T1) + N2*cos(T2) = W

So combining the first and second equation:
N1*sin(T1) = N2*sin(90-T1)
N1*sin(T1) = N2*cos(T1)

sin(T1)/cos(T1) = N2/N1
tan(T1) = N2/N1


Therefore T1 = arctan(N2/N1). When the system is balanced, T1 should be 45, so the angle of tilt A = T1 - 45 = arctan(N2/N1) - 45.

(I could have done this with a single sensor, but then I'd have to deal with two more complexities. First, I'd have to set the otolith so that when balanced it is pressing the touch sensor about halfway so I can detect tilts in both directions. Second, I'd have to use the W vector in the derivation, which means I'd have to introduce real world units into the Lego program rather than simply using the readings them as-is. Two sensors lets me avoid that and also doubles the measurable tilt range.)

No comments: