View Single Post
  #3   Spotlight this post!  
Unread 13-01-2008, 03:29
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: doing double integration to getdistance traveled

Quote:
Originally Posted by eccmaster View Post
Has anybody been able to do double integration with readings from the accelerometer in the kop? How do you do double integration in easy c?
The key to the integration is precise, interrupt-driven timing.

When you take the acceleometer output, you can use the formula vf = vf + (a * t) every time through the program loop. If you use precise timing, you know the set time interval, you know the acceleration, and you know the initial velocity (this was vf the previous time through the loop), so you can solve for the new final velocity.

From here, we plug this into the distance formula of df = df + (vf * t). This formula finds out how far the robot would have traveled at velocity vf for time t, and then adds that onto the previous distance.

With a dual-axis accelerometer, you will need two separate sets of these equations, one for both the x and y dimensions.
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.