Go to Post This 6 weeks of work, sweat, thinking, designing, building, talking, discussing, turning wrenches, wiring, programming, drawing on chalk boards, eating pizza, drinking mountain dew, with the students - is what the FIRST experience is really about. - meaubry [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 22-02-2011, 00:14
Geek 2.0 Geek 2.0 is offline
Registered User
FRC #0107
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2008
Location: Holland, MI
Posts: 120
Geek 2.0 will become famous soon enough
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?
  #2   Spotlight this post!  
Unread 22-02-2011, 10:28
Geek 2.0 Geek 2.0 is offline
Registered User
FRC #0107
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2008
Location: Holland, MI
Posts: 120
Geek 2.0 will become famous soon enough
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?

Last edited by Geek 2.0 : 22-02-2011 at 10:35.
  #3   Spotlight this post!  
Unread 22-02-2011, 11:03
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
  #4   Spotlight this post!  
Unread 22-02-2011, 11:41
Geek 2.0 Geek 2.0 is offline
Registered User
FRC #0107
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2008
Location: Holland, MI
Posts: 120
Geek 2.0 will become famous soon enough
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......
  #5   Spotlight this post!  
Unread 22-02-2011, 12:11
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: Correcting Travel Direction

Quote:
Originally Posted by Geek 2.0 View Post
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.



Last edited by Ether : 22-02-2011 at 12:19.
  #6   Spotlight this post!  
Unread 22-02-2011, 13:15
Geek 2.0 Geek 2.0 is offline
Registered User
FRC #0107
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2008
Location: Holland, MI
Posts: 120
Geek 2.0 will become famous soon enough
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...
  #7   Spotlight this post!  
Unread 22-02-2011, 13:28
MrForbes's Avatar
MrForbes MrForbes is offline
Registered User
AKA: Jim
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Sierra Vista AZ
Posts: 6,025
MrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond repute
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
  #8   Spotlight this post!  
Unread 22-02-2011, 13:38
Geek 2.0 Geek 2.0 is offline
Registered User
FRC #0107
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2008
Location: Holland, MI
Posts: 120
Geek 2.0 will become famous soon enough
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.
  #9   Spotlight this post!  
Unread 22-02-2011, 13:44
MrForbes's Avatar
MrForbes MrForbes is offline
Registered User
AKA: Jim
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Sierra Vista AZ
Posts: 6,025
MrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond repute
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.
  #10   Spotlight this post!  
Unread 22-02-2011, 14:54
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: Correcting Travel Direction

Quote:
Originally Posted by Geek 2.0 View Post
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.


  #11   Spotlight this post!  
Unread 22-02-2011, 15:00
Geek 2.0 Geek 2.0 is offline
Registered User
FRC #0107
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2008
Location: Holland, MI
Posts: 120
Geek 2.0 will become famous soon enough
Re: Correcting Travel Direction

Quote:
Originally Posted by Ether View Post
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.
  #12   Spotlight this post!  
Unread 22-02-2011, 15:14
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Correcting Travel Direction

Quote:
Originally Posted by Geek 2.0 View Post
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?
  #13   Spotlight this post!  
Unread 22-02-2011, 15:30
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: Correcting Travel Direction

Quote:
Originally Posted by Geek 2.0 View Post
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?


  #14   Spotlight this post!  
Unread 22-02-2011, 16:23
Geek 2.0 Geek 2.0 is offline
Registered User
FRC #0107
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2008
Location: Holland, MI
Posts: 120
Geek 2.0 will become famous soon enough
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...
  #15   Spotlight this post!  
Unread 22-02-2011, 16:48
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: Correcting Travel Direction

Quote:
Originally Posted by Geek 2.0 View Post
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.


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 23:32.

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