Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Plotting Location w/ Accellerometer Project (http://www.chiefdelphi.com/forums/showthread.php?t=119806)

Ether 02-10-2013 09:18

Re: Plotting Location w/ Accellerometer Project
 
Quote:

Originally Posted by Invictus3593 (Post 1294107)
Using trapezoidal integration, would that eliminate the errors?

Not with the accelerometer and gyro that come in the KoP. They're not accurate enough. The problem is the double integration (to get from accel to position). The small errors in the accel and gyro signal get integrated. The errors accumulate. After a short period of time, your computed position drifts away from your true position. The gravity problem Greg mentioned also contributes to errors in the accel signal in the plane of interest (the floor).

Quote:

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!
The method I described applies to 2D motion in the plane of the floor, so it applies to turning (be it circular or not) as well as linear motion. The a=v2/r is not required.


Quote:

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?
You can answer this question by simulating a simple example in Excel or LabVIEW or Maxima or Octave or SciLab or any CAS tool or programming language of your choice. Assume you have a vehicle traveling in a perfect circle of radius R at a constant speed S. Then you know what the true ax and ay components of the acceleration are at any point in time. Do the numerical integration using those perfectly correct numbers. You should get almost perfect circular motion. Now introduce a small error into those ax and ay numbers, to reflect errors expected in the KoP gyro and accelerometer, and do the integration. You'll probably get something like a spiral instead of a circle.


Quote:

I've read that with robotic probes that go into caves and such, they use this kind of plotting system, an accelerometer and a gyro
I don't know about the probes you are referring to, but if they use only an accelerometer and gyro to compute position they're probably much more expensive (and accurate) than those in the KoP.


Quote:

Or is there anther way to do it without the problems you describe?
Placed properly, 3 unpowered omni follower wheels, each with an encoder, could theoretically be used to compute both position and rotational orientation -- without the need for a gyro or accelerometer. That would have a different set of problems.



Invictus3593 02-10-2013 09:53

Re: Plotting Location w/ Accellerometer Project
 
Quote:

Originally Posted by Greg McKaskle (Post 1294142)
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.

Ether 02-10-2013 10:19

Re: Plotting Location w/ Accellerometer Project
 
Quote:

Originally Posted by Invictus3593 (Post 1294167)
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.

Mike Bortfeldt 02-10-2013 11:06

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

Invictus3593 02-10-2013 23:25

Re: Plotting Location w/ Accellerometer Project
 
Quote:

Originally Posted by Ether (Post 1294172)
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?

Tom Line 03-10-2013 00:02

Re: Plotting Location w/ Accellerometer Project
 
Quote:

Originally Posted by Invictus3593 (Post 1294294)
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).

faust1706 03-10-2013 09:34

Re: Plotting Location w/ Accellerometer Project
 
Quote:

Originally Posted by Tom Line (Post 1294297)
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?

Chris Hibner 03-10-2013 09:52

Re: Plotting Location w/ Accellerometer Project
 
Quote:

Originally Posted by Tom Line (Post 1294297)
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.

Invictus3593 03-10-2013 13:12

Re: Plotting Location w/ Accellerometer Project
 
Quote:

Originally Posted by Chris Hibner (Post 1294345)
...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!

Aaron.Graeve 03-10-2013 13:54

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.

Ether 03-10-2013 14:32

Re: Plotting Location w/ Accellerometer Project
 
1 Attachment(s)
Quote:

Originally Posted by Chris Hibner (Post 1294345)
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.



Greg McKaskle 03-10-2013 17:31

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

Invictus3593 03-10-2013 20:01

Re: Plotting Location w/ Accellerometer Project
 
Quote:

Originally Posted by Aaron.Graeve (Post 1294373)
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?

Tom Line 04-10-2013 17:36

Re: Plotting Location w/ Accellerometer Project
 
Quote:

Originally Posted by Greg McKaskle (Post 1294410)
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

That's what we did in 2009 with our "PPS", or Pi-Positioning System. We could added waypoints and it would calculate the angle and distance, and feed that to our bot.

Wildstang has us all beat though, because they did it back in 2003 with their StangPS. You can find an archived thread here:

http://www.chiefdelphi.com/forums/ar...p/t-20273.html

Youtube Video here:

http://www.youtube.com/watch?v=SfDDq_4Hz6I

It's a bit different because it's crab, but much of it is applicable to tank to, since it's all angle + distance.

Ether 04-10-2013 17:43

Re: Plotting Location w/ Accellerometer Project
 
Quote:

Originally Posted by Tom Line (Post 1294606)
That's what we did in 2009 with our "PPS", or Pi-Positioning System. We could added waypoints and it would calculate the angle and distance, and feed that to our bot.

Wildstang has us all beat though, because they did it back in 2003 with their StangPS.

Here's the inverse problem. Instead of calculating the necessary trajectory to get to a desired point and heading, calculate the position if you know the 3 DoF motions of the robot over time.

http://www.chiefdelphi.com/forums/sh...d.php?t=120022




All times are GMT -5. The time now is 01:32.

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