Go to Post The robots are the attracting force, the common interest that brings us all together - sanddrag [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-01-2011, 09:48
Jogo Jogo is offline
Registered User
FRC #0353 (Pobots)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2007
Location: NY
Posts: 83
Jogo is on a distinguished road
Integrating the Accelerometer

I was wondering if anyone has had success integrating the accelerometer output to obtain velocity.

For programming this in LabVIEW, does anyone know of any ways to maintain a consistent dt? Or any way to smooth out inconsistencies in the accelerometer output?

Thanks!
  #2   Spotlight this post!  
Unread 16-01-2011, 10:09
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,722
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Integrating the Accelerometer

For maintaining a constant period I'd suggest using a Timed Structure.

Here's a brief white paper illustrating the differences between different ways of timing a loop: http://team358.org/files/programming...Everything.PDF
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #3   Spotlight this post!  
Unread 16-01-2011, 10:41
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: Integrating the Accelerometer

Can I ask how you are going to use the velocity?

Is it for a transmission, or autonomous, or something else?
__________________
"Never let your schooling interfere with your education" -Mark Twain
  #4   Spotlight this post!  
Unread 16-01-2011, 10:45
Jogo Jogo is offline
Registered User
FRC #0353 (Pobots)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2007
Location: NY
Posts: 83
Jogo is on a distinguished road
Re: Integrating the Accelerometer

Thanks Mark, that's really helpful.

@lineskier
It would be for autonomous.
  #5   Spotlight this post!  
Unread 16-01-2011, 12:22
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,559
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Integrating the Accelerometer

You can use the gyro library to take advantage of the integration built in to the fpga.
  #6   Spotlight this post!  
Unread 16-01-2011, 12:22
Jogo Jogo is offline
Registered User
FRC #0353 (Pobots)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2007
Location: NY
Posts: 83
Jogo is on a distinguished road
Re: Integrating the Accelerometer

Actually, would it be too ridiculous to double integrate to get displacement? Or would too much error rack up.
  #7   Spotlight this post!  
Unread 16-01-2011, 12:38
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: Integrating the Accelerometer

Quote:
Originally Posted by Jogo View Post
Actually, would it be too ridiculous to double integrate to get displacement? Or would too much error rack up.
It depends on the accuracy you want, within a foot or two, I suspect it may be okay, anything less probably not.

Can I ask how well you did in autonomous in '10?

Right now I'm assuming your idea is to tell the robot to drive forward 10ft rather than the typical drive forward 10 seconds
__________________
"Never let your schooling interfere with your education" -Mark Twain

Last edited by mwtidd : 16-01-2011 at 12:42.
  #8   Spotlight this post!  
Unread 16-01-2011, 12:54
billbcc91 billbcc91 is offline
Mentor
AKA: Bill Phillips
FRC #2960
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2010
Location: Beverly Hills, MI
Posts: 11
billbcc91 is on a distinguished road
Re: Integrating the Accelerometer

I've tried double integration of accelerometer data for my job (design engineer at automobile company.) The integration was done after a data acquisition, not on-the-fly. I get very inconsistent results depending on the size of any zero-offsets. Consequently for measuring small distances (at 60 Hz or higher) I tend to go more for string potentiometers or laser gaging. I was trying to measure small displacements though, so the prior poster may be spot-on for distances on the scale of 1 foot.

For measuring the larger distances of this game, you may want to go for an infra-red or sonic range finder. Those are allowable while laser is not.

For autonomous last year we simply used dead reckoning. We tuned it in using trial and error. The controller is programmed to apply "X" volts of power to the drive motors for "Y" seconds. This is easiest for driving straight ahead, but you could program some turns in too.
  #9   Spotlight this post!  
Unread 16-01-2011, 13:04
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Integrating the Accelerometer

For measuring distance driving forward, you will likely get far better data with less work by using encoders on the drive gearboxes than you will from double integration of accelerometer data.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
  #10   Spotlight this post!  
Unread 16-01-2011, 13:07
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Integrating the Accelerometer

Assuming you are driving with wheels, encoders can get you almost exactly where you want to go. They measure the exact rotational travel the wheels move, and from there you can calculate your exact displacement and velocity. They (along with the gyro) are my favorite autonomous navigation sensors.

Edit: Beaten to it.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack

Last edited by apalrd : 16-01-2011 at 13:07. Reason: beaten to it
  #11   Spotlight this post!  
Unread 16-01-2011, 13:10
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: Integrating the Accelerometer

Quote:
Originally Posted by apalrd View Post
Assuming you are driving with wheels, encoders can get you almost exactly where you want to go. They measure the exact rotational travel the wheels move, and from there you can calculate your exact displacement and velocity. They (along with the gyro) are my favorite autonomous navigation sensors.

Edit: Beaten to it.
Or use the camera so location is never an issue. Encoders and gyros require correct orientation of the robot from the start. This year there is nothing to square your robot against. For this game, I think that a compass may be helpful to zero the gyro at the start. Then encoders should be sufficient for driving straight for a certain distance.
__________________
"Never let your schooling interfere with your education" -Mark Twain
  #12   Spotlight this post!  
Unread 16-01-2011, 13:12
Jogo Jogo is offline
Registered User
FRC #0353 (Pobots)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2007
Location: NY
Posts: 83
Jogo is on a distinguished road
Re: Integrating the Accelerometer

Thanks for the feedback.

As far as encoders...I don't really know how well those will do because we are using mecanum.
  #13   Spotlight this post!  
Unread 17-01-2011, 02:18
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Integrating the Accelerometer

Quote:
Originally Posted by billbcc91 View Post
For autonomous last year we simply used dead reckoning. We tuned it in using trial and error. The controller is programmed to apply "X" volts of power to the drive motors for "Y" seconds. This is easiest for driving straight ahead, but you could program some turns in too.
FYI, dead reckoning includes navigation using any measurements that are relative (i.e. encoders and gyros). See here.

A new feature of the CAN Jaguar will make the approach you used last year more repeatable than it used to be without the dependency on wiring and mechanically attaching encoders. The mode is called "Voltage" mode in the CANJaguar implementation. It allows you to specify the actual voltage you want to output to the motors, instead of the percentage of the input voltage (the way PWM works). This means that even as your battery voltage varies based on less charged batteries or different aged batteries, etc, the Jaguar will compensate for the input voltage and keep the output the same each time. This does mean that you should avoid requesting voltages from the Jaguar that will only exist in a fully charge battery (such as 12.5V).

You can also use this mode with RobotDrive by configuring the MaxOutput parameter.

-Joe
  #14   Spotlight this post!  
Unread 17-01-2011, 02:26
Slix Slix is offline
Registered User
AKA: Peter Kowalczyk
FRC #2115 (NightMares)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: Mundelein, IL
Posts: 31
Slix is an unknown quantity at this point
Re: Integrating the Accelerometer

Quote:
Originally Posted by Jogo View Post
Thanks for the feedback.

As far as encoders...I don't really know how well those will do because we are using mecanum.
I have the same question. Will encoders work for measuring distance while using mecanum wheels?

I'm also worried about having the robot correctly oriented so that gyro angle zero is exactly perpendicular to the front of the field. Otherwise, we wouldn't get perfect results.. is this going to be a huge problem for autonomous?
  #15   Spotlight this post!  
Unread 17-01-2011, 02:48
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Integrating the Accelerometer

Quote:
Originally Posted by Slix View Post
I have the same question. Will encoders work for measuring distance while using mecanum wheels?
They can work, but they are much less tolerant of the robot from not being flat and lumps in the carpet, etc. Your driver will naturally compensate for these things, but the sensor just measures what's really happening.

Also note that the encoder is measuring the wheel rotations, which for mecanum wheels does not directly translate into distance = circumference * rotations. You will have to invert the mecanum control equations to make sense of the 4 wheel position channels.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:41.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi