Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Correcting Travel Direction (http://www.chiefdelphi.com/forums/showthread.php?t=92652)

Geek 2.0 22-02-2011 00:14

Correcting Travel Direction
 
On a mecanum drive base, is there a way to correct for driving direction? For instance, if I want to go 40 degrees to the left of straight, how can I correct any error? I know encoders would be ideal, but is this possible with an accelerometer?

I could use an integrator on an accelerometer to get velocity, but that's not always very accurate. Any other ideas?

Geek 2.0 22-02-2011 10:28

Re: Correcting Travel Direction
 
Perhaps I need to elaborate a bit. I don't mean to be a bother, and I know that people have talked about correcting mecanum drive, but I just want to expand on this.

I would assume that to use an accelerometer to correct for travel direction, one must integrate the accelerometer readings to get velocity to get heading. Does anyone have any hints on this, or is it just integrating? Do I want to filter in case of collisions or other such things? How or when should I calibrate? How do I account for drift?

Alan Anderson 22-02-2011 11:03

Re: Correcting Travel Direction
 
Using accelerometers on FRC robots to derive position is a hard problem. So hard, in fact, that I don't know of any teams who have reliably solved it. I wouldn't even attempt it. Closed-loop control of the wheel speeds using encoders is easy.

Geek 2.0 22-02-2011 11:41

Re: Correcting Travel Direction
 
I understand that position is difficult, but what about velocity?

Unfortunately, wheel encoders are impossible at this point, due to our design. Also, there's no time to tune 4 PID loops for velocity......

Ether 22-02-2011 12:11

Re: Correcting Travel Direction
 
Quote:

Originally Posted by Geek 2.0 (Post 1028923)
On a mecanum drive base, is there a way to correct for driving direction? For instance, if I want to go 40 degrees to the left of straight, how can I correct any error? I know encoders would be ideal, but is this possible with an accelerometer?

I could use an integrator on an accelerometer to get velocity, but that's not always very accurate. Any other ideas?

Use a gyro.

Take your desired heading angle and subtract the gyro angle from that. Do a little math on the result and run it through a PID.

What you do with the PID output depends on what you mean by "I want to go 40 degrees to the left of straight".

For example, if you want the robot to stay pointed in the commanded direction, the output of the PID would drive the mec's rotation command.



Geek 2.0 22-02-2011 13:15

Re: Correcting Travel Direction
 
We already have a gyro for facing direction, but a gyro does not help with travel direction, correct? I might be wrong about this...

MrForbes 22-02-2011 13:28

Re: Correcting Travel Direction
 
Is this for autonomous? or for driving in teleop? If it's autonomous, you might want to make use of line sensors or camera targets instead. For adding rotation encoders, look for creative ways to drive them using belts, small wheels, etc

Geek 2.0 22-02-2011 13:38

Re: Correcting Travel Direction
 
It's for driving in Teleop. Our robot doesn't drive all that straight when strafing, and I was hoping to correct with the accelerometer.

MrForbes 22-02-2011 13:44

Re: Correcting Travel Direction
 
As Alan said, good luck. It's a tough problem.

Look at team 488 robot, I think they added encoders to little wheels that move on the floor. you could use two Vex omni wheels, oriented 90 degrees to each other, to get feedback on how the robot is moving in both directions.

Might have trouble implementing it in one day though.

Ether 22-02-2011 14:54

Re: Correcting Travel Direction
 
Quote:

Originally Posted by Geek 2.0 (Post 1029249)
We already have a gyro for facing direction, but a gyro does not help with travel direction, correct? I might be wrong about this...

Again, it depends on what you mean by "travel direction".

You could use the gyro to rotate the vehicle to point to and hold a particular direction, and then issue a robot-centric "straight forward" command.


Quote:

It's for driving in Teleop. Our robot doesn't drive all that straight when strafing, and I was hoping to correct with the accelerometer.
That's a different problem statement from what you said earlier ("40 degrees to the left of straight").

When you say "Our robot doesn't drive all that straight when strafing" do you mean

a) It drives in a straight line, but not perfectly perpendicular to the robot's fore/aft axis, or

b) It rotates as it strafes, and travels along a curved path, or

c) something else?

The problem solution depends on the problem.



Geek 2.0 22-02-2011 15:00

Re: Correcting Travel Direction
 
Quote:

Originally Posted by Ether (Post 1029326)
When you say "Our robot doesn't drive all that straight when strafing" do you mean

a) It drives in a straight line, but not perfectly perpendicular to the robot's fore/aft axis, or

b) It rotates as it strafes, and travels along a curved path, or

c) something else?

The problem solution depends on the problem.


If the travel direction is different than the facing direction, such as strafing left and right while facing forward, it does not always drive in the given direction.

Alan Anderson 22-02-2011 15:14

Re: Correcting Travel Direction
 
Quote:

Originally Posted by Geek 2.0 (Post 1029330)
If the travel direction is different than the facing direction, such as strafing left and right while facing forward, it does not always drive in the given direction.

That didn't answer the question.

Does the robot rotate as it strafes, or does it maintain its orientation?

Ether 22-02-2011 15:30

Re: Correcting Travel Direction
 
Quote:

Originally Posted by Geek 2.0 (Post 1029330)
If the travel direction is different than the facing direction, such as strafing left and right while facing forward, it does not always drive in the given direction.

Does it drive in a curved path or a straight path?

Does it always do pretty much the same thing each time for a given command, or does it do one thing one time and another thing another time?



Geek 2.0 22-02-2011 16:23

Re: Correcting Travel Direction
 
I'm not 100% sure, because I'm not with the robot right now, but if I remember correctly it's straight but in the wrong direction. We are correcting facing direction with the gyro, so that's not a problem. What are the significances of that, might I ask? We're new to mecanum, so we're not up to par with all the tips and tricks to get it working properly...

Ether 22-02-2011 16:48

Re: Correcting Travel Direction
 
Quote:

Originally Posted by Geek 2.0 (Post 1029369)
if I remember correctly it's straight but in the wrong direction.

OK. Now, does it always do pretty much the same thing each time for a given command, or does it do one thing one time and another thing another time? (There's a reason I keep asking this).


Quote:

if I remember correctly it's straight but in the wrong direction. What are the significances of that, might I ask?
Many factors could cause this behavior, including friction, free play, alignment, motor tolerances, wiring, and software. To get to the root cause would require time and patience, things which I'm guessing you probably don't have right now.




All times are GMT -5. The time now is 03:43.

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