View Single Post
  #2   Spotlight this post!  
Unread 04-04-2010, 21:37
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Using antiderivative to find velocity from acceleration

Quote:
Originally Posted by Luke Pike View Post
I have a quick question.

Last week my calculus class started teaching antiderivatives. If there is a function A(t) which gives acceleration as a function of time, then it's antiderivative is a function V(t) which gives velocity as a function of time (the antiderivative of that would be position), plus a constant C of course.

Now suppose we have an accelerometer sensor on a robot. If I can take the numerical antiderivative (if I can even do that), would that give me the velocity of the robot at that time (assuming the robot started off not moving)?
Yes, you can easily calculate the velocity from the acceleration. You do the exact same thing when you use a "gyro" on the robot to calculate your heading (the "gyro" actually is an angular velocity sensor, and you calculate the angle via the antiderivative (more accurately called an "integral").

To calculate an integral (i.e. anti-derivative) in software you do the following:

velocity = velocity + acceleration*sample_time;

You perform the above calculation over and over at a fast rate. "sample_time" is the time since the last time you took an acceleration reading.
__________________
-
An ounce of perception is worth a pound of obscure.
Reply With Quote