View Single Post
  #4   Spotlight this post!  
Unread 10-08-2013, 21:58
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Measuring angle relative to the floor

Quote:
Originally Posted by GuyM142 View Post
I'd like to use a sensor to measure [angle, relative to ground]. I don't know whether to use a gyro or an accelerometer to do that.
I think the answer is either one, though in different cases. The "best" approach would be to use both and combine the information from both sensors using a filter. This is probably overkill for what you're doing, though.

In general, over short periods of time (seconds to a couple of minutes) gyros are good sensors for measurement of angle. They're differential sensors (they only measure change in angle), though, so they suffer from two disadvantages: 1. they're susceptible to accumulated error and 2. you have to set the initial angle through some other means.

Accelerometers are somewhat complementary to gyros. As [Ether] says, you can get an absolute measure of angle relative to the local gravity vector, but this only gives a good reading when the sensor is not otherwise accelerating (practically, this means when the sensor is stationary) - under other conditions, the reading has noise introduced into the reading by the other accelerations. If the angle being measured isn't changing too quickly, and the system isn't under a constant acceleration, you can get a better measure by averaging the angle reading over time, and all the transient accelerations will more or less cancel out. This is called low-pass filtering.

Kalman filters and complementary filters work by essentially combining these two sources of data in ways that allow each to counteract the other's short-comings, creating a better estimate of the current angle.

Since you're probably only interested in tracking the angle for a few seconds and you can start with the knowledge that the robot is flat on the floor, (tl;dr) the gyro is probably the best sensor for your application.

P.S. Another approach would be to use distance sensor(s) (I would probably use infrared) pointed downwards from the bottom of your chassis to measure the distance from the ground, which you could then use to get an estimate of the robot angle.
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote