Go to Post Either way, I'll stay a FIRSTer for life. =) - Adare180 [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 01-10-2013, 23:37
Aaron.Graeve Aaron.Graeve is offline
Registered User
FRC #1477 (Texas Torque)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: College Station, Texas
Posts: 103
Aaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to all
Re: Plotting Location w/ Accellerometer Project

Quote:
Originally Posted by Invictus3593 View Post
Haha, he gave the ac = (Vt2)/r equation to use in the case that we were turning, which would throw off our real location; I guarantee you I don't drive in circles! If we updated the rotational acceleration every 10ms and took the average acceleration for that period, do you think would this be a short enough interval to be able to plot location semi-accurately? ...
I suspect 10ms will be a short enough time, but that depends on a few hardware specific circumstances (gyro float and accelerometer responsiveness come to mind). Your team's driving style may also play a role in customizing the algorithm. I am interested to see how this will turn out. Also, have you considered encoders on your drivetrain? I hazard a guess that 2 encoders and a gyro can produce a position close enough for your needs.
__________________

2016:
Alamo, Bayou, and Lone Star Regional FTAA
2015:
Dallas, Alamo, Bayou, and Lone Star Regional FTAA
2014:
Alamo, Dallas, and Lone Star Regional FTAA
Alamo Regional Robot Inspector
2013:
Einstein Champion and 2013 World Champion (Thanks 1241 & 610), Galileo Division Champion, Razorback Regional Winner, Alamo Regional Semifinalist, Bayou Regional Semifinalist, Lone Star Regional Quarterfinialist
2012:
Curie Division Semifinalist, Lone Star Regional Finalist, Bayou Regional Winner, Alamo Regional Winner
Reply With Quote
  #2   Spotlight this post!  
Unread 02-10-2013, 01:17
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: Plotting Location w/ Accellerometer Project

Quote:
Originally Posted by Aaron.Graeve View Post
I suspect 10ms will be a short enough time, but that depends on a few hardware specific circumstances (gyro float and accelerometer responsiveness come to mind). Your team's driving style may also play a role in customizing the algorithm. I am interested to see how this will turn out. Also, have you considered encoders on your drivetrain? I hazard a guess that 2 encoders and a gyro can produce a position close enough for your needs.
I was thinking the same thing, if the accelerometer proves to be unreliable (which is what it's looking to be), encoders + a definition of how wide the wheels are can give an accurate representation of how far the robot has moved, theoretically, and the gyro can give orientation.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-10-2013, 07:04
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Plotting Location w/ Accellerometer Project

I was looking for a decent app on the iPhone that would work to experiment with. The closest I can come to is one called Vibration. I was using it to measure how the cell phone buzzed and compare that to an external accelerometer reading.

Anyway, the app will show the three axes and it calibrates to subtract out gravity at the initial orientation. If you leave the phone sitting still and run a five second recording, you should get relatively flat lines and that's expected. The integrated area should be zero.

If you run the app and move the phone to the left and right, you'll see similar cancellation. But it probably won't quite zero. Next, during a sample recording, walk from your chair to the front door. Each step looks like a heartbeat, on each axis. And yeah, they sort of cancel out, but where is my predictor of my acceleration that tells me how far I walked. It is a tiny bump at the beginning of that heartbeat signal.

Then run a sample and simply tilt the device a bit. You'll see that a five or ten degree tilt offsets the line quite a bit. And worse, it stays there for the entire sample. The integration of the tilt is huge.

Anyway, if you can find the app, or something similar, it is helpful in understanding why IMUs are hard. After all, if it was easy, the phone or Garmin would do this instead of or in addition to GPS.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 02-10-2013, 09:53
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: Plotting Location w/ Accellerometer Project

Quote:
Originally Posted by Greg McKaskle View Post
I was looking for a decent app on the iPhone that would work to experiment with. The closest I can come to is one called Vibration. I was using it to measure how the cell phone buzzed and compare that to an external accelerometer reading.

Anyway, the app will show the three axes and it calibrates to subtract out gravity at the initial orientation. If you leave the phone sitting still and run a five second recording, you should get relatively flat lines and that's expected. The integrated area should be zero.

If you run the app and move the phone to the left and right, you'll see similar cancellation. But it probably won't quite zero. Next, during a sample recording, walk from your chair to the front door. Each step looks like a heartbeat, on each axis. And yeah, they sort of cancel out, but where is my predictor of my acceleration that tells me how far I walked. It is a tiny bump at the beginning of that heartbeat signal.

Then run a sample and simply tilt the device a bit. You'll see that a five or ten degree tilt offsets the line quite a bit. And worse, it stays there for the entire sample. The integration of the tilt is huge.

Anyway, if you can find the app, or something similar, it is helpful in understanding why IMUs are hard. After all, if it was easy, the phone or Garmin would do this instead of or in addition to GPS.

Greg McKaskle
Dang, I just tried it out. So i guess the accelerometer route is a dead end.

What do you think of the encoder idea? I mean, you don't have to worry about gravity or forces or anything with them, just rotations of the wheels.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-10-2013, 10:19
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Plotting Location w/ Accellerometer Project

Quote:
Originally Posted by Invictus3593 View Post
Dang, I just tried it out. So i guess the accelerometer route is a dead end.

What do you think of the encoder idea? I mean, you don't have to worry about gravity or forces or anything with them, just rotations of the wheels.
If you're using a properly-programmed true swerve drive*, you can compute position and orientation of the vehicle from the encoders on the wheels. But this introduces a different set of errors due to the dynamic response of the steering and wheel speeds in response to rapid changes in command. And all it takes to throw the computation off is one good bump that changes the orientation of the vehicle.

If you're using a skid-steer drivetrain, the relationship between the powered-wheel encoder readings and the actual vehicle movement during turns gets muddied considerably in ways that may not be easily predictable. Probably not a good solution.


*ie independent steering and drive for each wheel, with properly programmed steering angle and wheel speed for each wheel.

Last edited by Ether : 02-10-2013 at 11:17.
Reply With Quote
  #6   Spotlight this post!  
Unread 02-10-2013, 11:06
Mike Bortfeldt Mike Bortfeldt is offline
Registered User
FRC #1126 (& 1511)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Rochester, NY
Posts: 119
Mike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud of
Re: Plotting Location w/ Accellerometer Project

While not accelerometer related, there have been a number of posts over the years describing issues with the "drift" associated with gyros over time and the error this causes when calculating field position. One method I've experimented with that seems to work well to compensate/eliminate most of this error utilizes two gyros. A high rate gyro for most turns (250 to 500 deg/sec), and a low rate gyro (30 deg/sec) for higher accuracy in slow curves and determining when the robot is stationary (for zero compensation). With the higher resolution of the low rate gyro, it is much easier to determine when you can automatically adjust the zero point. This method does break down when the robot is in continuous motion, but typically there are periods of time within a match (and certainly before the match starts), where the gyro can update its zero point. During bench testing, I was able to achieve a heading drift of under 2 degrees per hour when stationary. The heading calculation algorithm would automatically switch between the gyros at a 20 deg/sec rate (67% of full scale of the low rate gyro).

Mike
Reply With Quote
  #7   Spotlight this post!  
Unread 02-10-2013, 23:25
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: Plotting Location w/ Accellerometer Project

Quote:
Originally Posted by Ether View Post
If you're using a properly-programmed true swerve drive*, you can compute position and orientation of the vehicle from the encoders on the wheels. But this introduces a different set of errors due to the dynamic response of the steering and wheel speeds in response to rapid changes in command. And all it takes to throw the computation off is one good bump that changes the orientation of the vehicle.

If you're using a skid-steer drivetrain, the relationship between the powered-wheel encoder readings and the actual vehicle movement during turns gets muddied considerably in ways that may not be easily predictable. Probably not a good solution.


*ie independent steering and drive for each wheel, with properly programmed steering angle and wheel speed for each wheel.
What about tank drive? Would it totally throw everything off?


Quote:
While not accelerometer related, there have been a number of posts over the years describing issues with the "drift" associated with gyros over time and the error this causes when calculating field position. One method I've experimented with that seems to work well to compensate/eliminate most of this error utilizes two gyros. A high rate gyro for most turns (250 to 500 deg/sec), and a low rate gyro (30 deg/sec) for higher accuracy in slow curves and determining when the robot is stationary (for zero compensation). With the higher resolution of the low rate gyro, it is much easier to determine when you can automatically adjust the zero point. This method does break down when the robot is in continuous motion, but typically there are periods of time within a match (and certainly before the match starts), where the gyro can update its zero point. During bench testing, I was able to achieve a heading drift of under 2 degrees per hour when stationary. The heading calculation algorithm would automatically switch between the gyros at a 20 deg/sec rate (67% of full scale of the low rate gyro).
I'm not too familiar with gyros. Do you have any sample code I could take a look at?
Reply With Quote
  #8   Spotlight this post!  
Unread 03-10-2013, 00:02
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,517
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Plotting Location w/ Accellerometer Project

Quote:
Originally Posted by Invictus3593 View Post
What about tank drive? Would it totally throw everything off?

I'm not too familiar with gyros. Do you have any sample code I could take a look at?
The gyro+encoder routine is one that many teams currently use for autonomous. However, over time the errors due to wheel slip, collisions, and gyro drift make it inaccurate enough that you can't really depend on it through the match.

Polar coordinates lend themselves to this use (angle + distance).
Reply With Quote
  #9   Spotlight this post!  
Unread 03-10-2013, 09:34
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Re: Plotting Location w/ Accellerometer Project

Quote:
Originally Posted by Tom Line View Post
The gyro+encoder routine is one that many teams currently use for autonomous. However, over time the errors due to wheel slip, collisions, and gyro drift make it inaccurate enough that you can't really depend on it through the match.

Polar coordinates lend themselves to this use (angle + distance).
We have a constant problem with it climbing, as has been previously said in this tread. To account for the, we had a driver control of a gyro reset. While doing that would defeat the whole project idea, you could use your last calculated point as your new origin and go from there, no?
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."
Reply With Quote
  #10   Spotlight this post!  
Unread 03-10-2013, 09:52
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: Plotting Location w/ Accellerometer Project

Quote:
Originally Posted by Tom Line View Post
The gyro+encoder routine is one that many teams currently use for autonomous. However, over time the errors due to wheel slip, collisions, and gyro drift make it inaccurate enough that you can't really depend on it through the match.
Quote:
Originally Posted by faust1706
We have a constant problem with it climbing, as has been previously said in this tread. To account for the, we had a driver control of a gyro reset. While doing that would defeat the whole project idea, you could use your last calculated point as your new origin and go from there, no?
In past years when we needed high accuracy during turns and/or expect collisions or other sources of wheel slip or orientation change, we put the encoders on non-driven follower wheels. We put the wheels in line with the drive wheel, usually on a swing-arm and spring loaded them to keep in contact with the floor. The VEX omni wheels work great for this. In fact, doing it this way allowed us to remove the gyro, which was nice.
__________________
-
An ounce of perception is worth a pound of obscure.
Reply With Quote
  #11   Spotlight this post!  
Unread 03-10-2013, 13:12
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: Plotting Location w/ Accellerometer Project

Quote:
Originally Posted by Chris Hibner View Post
...we put the encoders on non-driven follower wheels. We put the wheels in line with the drive wheel, usually on a swing-arm and spring loaded them to keep in contact with the floor. The VEX omni wheels work great for this. In fact, doing it this way allowed us to remove the gyro, which was nice.

From what everyone is saying about Gyros (the slipping and such), it sounds like this method of plotting position would be the most accurate

The next challenge would be plotting the position on a sort of mini-map on the driver's screen. How do you guys think one would go about accomplishing this? One would have to be able to map the location in scale to the diagram's width and height, right? Or is there a less CPU-intensive method?

I'd be willing to try and write up a separate program, but it'd be cool to get it on the dashboard, if possible

ps: thank you guys for all your help!
Reply With Quote
  #12   Spotlight this post!  
Unread 03-10-2013, 13:54
Aaron.Graeve Aaron.Graeve is offline
Registered User
FRC #1477 (Texas Torque)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: College Station, Texas
Posts: 103
Aaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to all
Re: Plotting Location w/ Accellerometer Project

I think the mini-map idea both has merit and is not overly CPU-intensive. I suppose it would be similar to teams that use line overlays in aligning their shooter. If you keep the total x and y components (or r and theta, whichever floats your boat) as variables stored on the robot, it should be a relatively easy task to use those values to add a point image overlay to a stock background map on the dashboard. The overlay would probably not be that taxing, provided you are careful with your implementation.
__________________

2016:
Alamo, Bayou, and Lone Star Regional FTAA
2015:
Dallas, Alamo, Bayou, and Lone Star Regional FTAA
2014:
Alamo, Dallas, and Lone Star Regional FTAA
Alamo Regional Robot Inspector
2013:
Einstein Champion and 2013 World Champion (Thanks 1241 & 610), Galileo Division Champion, Razorback Regional Winner, Alamo Regional Semifinalist, Bayou Regional Semifinalist, Lone Star Regional Quarterfinialist
2012:
Curie Division Semifinalist, Lone Star Regional Finalist, Bayou Regional Winner, Alamo Regional Winner
Reply With Quote
  #13   Spotlight this post!  
Unread 03-10-2013, 20:01
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: Plotting Location w/ Accellerometer Project

Quote:
Originally Posted by Aaron.Graeve View Post
I think the mini-map idea both has merit and is not overly CPU-intensive. I suppose it would be similar to teams that use line overlays in aligning their shooter. If you keep the total x and y components (or r and theta, whichever floats your boat) as variables stored on the robot, it should be a relatively easy task to use those values to add a point image overlay to a stock background map on the dashboard. The overlay would probably not be that taxing, provided you are careful with your implementation.
I just tried to write up a point overlay in the dashboard like you said using the IMAQ Point overlay vi, but I can't seem to get it to actually plot a few points on the image, do you have any examples?

Quote:
Back in 2008, we did a demo of a robot called Nitro. It had three omni wheels and used the NI Motion planning SW to calculate trajectories. Anyway, for our demo we built a path builder and a path display using the picture control. You could also do this in an XY graph. Those are both pretty performant, especially the XY graph.
Do you have any sample code left?

Last edited by Invictus3593 : 03-10-2013 at 23:48.
Reply With Quote
  #14   Spotlight this post!  
Unread 03-10-2013, 14:32
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Plotting Location w/ Accellerometer Project

Quote:
Originally Posted by Chris Hibner View Post
In past years when we needed high accuracy during turns and/or expect collisions or other sources of wheel slip or orientation change, we put the encoders on non-driven follower wheels. We put the wheels in line with the drive wheel, usually on a swing-arm and spring loaded them to keep in contact with the floor. The VEX omni wheels work great for this. In fact, doing it this way allowed us to remove the gyro, which was nice.
Chris,

You might want to point out that 3 follower wheels are required if the vehicle has strafing capability.

Also, with 2 followers it is important to realize that they cannot discriminate among the three motions illustrated in the attachment (showing three skid-steer vehicles each with a different center of rotation). This can be mitigated by placing the followers so that the midpoint between them is on the center of rotation of the vehicle.


Attached Thumbnails
Click image for larger version

Name:	2 omni followers.png
Views:	15
Size:	12.2 KB
ID:	15255  

Last edited by Ether : 03-10-2013 at 16:05.
Reply With Quote
  #15   Spotlight this post!  
Unread 03-10-2013, 17:31
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Plotting Location w/ Accellerometer Project

Back in 2008, we did a demo of a robot called Nitro. It had three omni wheels and used the NI Motion planning SW to calculate trajectories. Anyway, for our demo we built a path builder and a path display using the picture control. You could also do this in an XY graph. Those are both pretty performant, especially the XY graph.

Greg McKaskle
Reply With Quote
Reply


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 09:56.

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