View Single Post
  #5   Spotlight this post!  
Unread 11-08-2013, 08:14
GuyM142's Avatar
GuyM142 GuyM142 is offline
Registered User
AKA: Guy
FRC #3339 (BumbleBee)
Team Role: Mentor
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 156
GuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really nice
Re: Measuring angle relative to the floor

Quote:
Originally Posted by RyanCahoon View Post
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.
Thank you for the detailed answer!
I will try to do it with a gyro, and I'll try to look for some filtering guides online just to make my programming skills a bit better
Anyway, do you have some information about filters which I can start with?
Reply With Quote