Go to Post It means Dave Lavery isn't on the Game Design Committee this year. If he were, you probably would have found a banana instead. - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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 20-03-2010, 11:06
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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
tank drive mecanum algorithm

Here's a way to program tank drive on mecanum bot so that you can tune the joystick sensitivity to all three motions (fwd/rev, turn, stafe) independently:

Let Kf, Kt, and Ks be the tuning parameters (0 to +1) for the forward/reverse, turn, and strafe motions, respectively.

Let X1 and Y1 represent the joystick outputs for the driver's left-hand joystick;

Let X2 and Y2 represent the joystick outputs for the driver's right-hand joystick.

When each joystick is pushed forward, its Y output should be positive. When the joystick is pushed to the right, its X output should be positive. If not, add code to invert the sign if necessary.

Let W1, W2, W3, and W4 be the front left, front right, rear left, and rear right wheels, respectively. ("left" and "right" in this context means "port" and "starboard", respectively)



Calculate the following:

Yf = (Y1 + Y2)/2

Yt = (Y1 - Y2)/2


Now calculate the four wheel speed commands:

W1 = Kf*Yf + Kt*Yt + Ks*X1

W2 = Kf*Yf - Kt*Yt - Ks*X1

W3 = Kf*Yf + Kt*Yt - Ks*X1

W4 = Kf*Yf - Kt*Yt + Ks*X1



Now normalize the wheel speed commands:

Let Wmax be the maximum absolute of the four wheel speed commands. If Wmax is greater than 1, then divide each of the four wheel speed commands by Wmax.


Finally, send each of the four normalized wheel speed commands to the respective wheels.
  #2   Spotlight this post!  
Unread 20-03-2010, 11:37
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
Re: tank drive mecanum algorithm

I'm not trying to judge or anything, but why have a tank drive mecanum?

I guess if you are using joysticks that don't have twist this would be nice, but don't the kit joysticks have twist? Joystick 2's only purpose is to provide twist input (unless you count the average for forward). Joy1 gets used for strafe input.

I think the sensitivity vars are nice, but can be used for single joystick input just as well.
__________________
I don't need a signature.
  #3   Spotlight this post!  
Unread 20-03-2010, 12:06
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: tank drive mecanum algorithm

Quote:
Originally Posted by TubaMorg View Post
I'm not trying to judge or anything, but why have a tank drive mecanum?
for teams whose drivers are accustomed to, and prefer, tank drive.

Quote:
don't the kit joysticks have twist?
Not in the veteran kit.


Quote:
I think the sensitivity vars are nice, but can be used for single joystick input just as well.
the point of the post was to show how to separate the variables when using tank drive so that individual sensitivities could have their own tuning parameters.

With a 3-axis joystick this isn't necessary since the normal mapping of 3-axis joystick functions to robot motions is already separated.


~
  #4   Spotlight this post!  
Unread 20-03-2010, 12:12
Travis Hoffman's Avatar Unsung FIRST Hero
Travis Hoffman Travis Hoffman is offline
O-H
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Engineer
 
Join Date: Sep 2001
Rookie Year: 2001
Location: Warren, Ohio USA
Posts: 4,047
Travis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond repute
Re: tank drive mecanum algorithm

Quote:
Originally Posted by TubaMorg View Post
I'm not trying to judge or anything, but why have a tank drive mecanum?

I guess if you are using joysticks that don't have twist this would be nice, but don't the kit joysticks have twist? Joystick 2's only purpose is to provide twist input (unless you count the average for forward). Joy1 gets used for strafe input.

I think the sensitivity vars are nice, but can be used for single joystick input just as well.
Some teams prefer the additional human-controlled maneuverability tank driving can deliver. Cut away all the code in between the driver's hands and the robot, go pure "motor = joystick", and some people can extract even more performance out of a robot. I know I personally prefer tank drive.
__________________

Travis Hoffman, Enginerd, FRC Team 48 Delphi E.L.I.T.E.
Encouraging Learning in Technology and Engineering - www.delphielite.com
NEOFRA - Northeast Ohio FIRST Robotics Alliance - www.neofra.com
NEOFRA / Delphi E.L.I.T.E. FLL Regional Partner
  #5   Spotlight this post!  
Unread 20-03-2010, 12:57
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: tank drive mecanum algorithm

Quote:
Originally Posted by Travis Hoffman View Post
Cut away all the code in between the driver's hands and the robot, go pure "motor = joystick", and some people can extract even more performance out of a robot.
I assume what you mean by "pure motor=joystick" is that each joystick degree of freedom (axis) controls one and only one motor.

For a tank-drive non-mecanum robot with only 2 drive motors (one for the left wheels and 1 for the right wheels), this certainly makes sense.

But for a robot with 4 mecanum wheels (and 1 motor per wheel), "pure motor=joystick" would require 4 joystick inputs.

I seriously doubt if any driver has developed the mental agility to individually and directly control each wheel command for a mecanum-wheeled robot.

That is why I presented the mapping of the 2 standard tank-drive joystick commands, plus 1 additional joystick command for strafe, to the 4 mecanum wheels via 3 intermediate variables which separate out the 3 robot degrees of freedom (fwd/rev, strafe, turn), so they can be tuned independently.

~
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tank Drive vs. Omni Directional Drive jamie_1930 General Forum 9 24-01-2010 22:50
crab drive vs. mecanum drive system superbotman Technical Discussion 33 06-01-2010 03:09
Tank Drive Sauce Programming 1 05-01-2009 18:50
pic: Jester Drive:Mecanum Wheel Drive Train Ken Delaney 357 Technical Discussion 64 29-03-2006 22:16


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

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