Go to Post Heidi's best picture ever - and she didn't even have to Photoshop this one! - dlavery [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
  #16   Spotlight this post!  
Unread 16-01-2011, 12:18
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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: Holonomic Control System

Quote:
Originally Posted by SudoSammich View Post
I didn't set out to re-invent the wheel, but it came to that after a small series of events. Basically, our cRio is stuck on last year's bot, so we're using the '07 robot controller and player station mounted to a piece of plywood. As such, I'm writing in C, not LabVIEW (our normal programming language at this point is Java anyway, but I assume there's a class for that as well). And I'm sure it's capable of two dimensional movement while spinning, I just haven't put forth the energy into performing those calculations yet. Good to know that there's a class waiting for me when we transition to this year's real bot though.
Hey, if you'd mentioned that earlier, I would have posted this for you:

Code:
// 3-axis joystick interface to an omni drive 
// with robot-centric driver interface


// first define your driver interface,
// in this case a 3-axis joystick:


forward = -Y;   // push joystick forward to go forward
right = X;      // push joystick to the right to strafe right
clockwise = Z;  // twist joystick clockwise turn clockwise


// here is where you would put any special shaping of the joystick
// response curve, such as deadband or gain adjustment


// now apply the inverse kinematic tranformation
// to convert your vehicle motion command 
// to 4 wheel speed commands:

front_left = forward + clockwise + right;
front_right = forward - clockwise - right;
rear_left = forward + clockwise - right;
rear_right = forward - clockwise + right;


// finally, normalize the wheel speed commands
// so that no wheel speed command exceeds magnitude of 1:

max = abs(front_left);
if (abs(front_right)>max) max = abs(front_right);
if (abs(rear_left)>max) max=abs(rear_left);
if (abs(rear_right)>max) max=abs(rear_right);

if (max>1) 
  {front_left/=max; front_right/=max; rear_left/=max; rear_right/=max;}


// you're done. send these four wheel commands to their respective wheels
... it's C code for fully holonomic operation of your omni bot.


If you want to add the gyro angle for field-centric control, it only adds a small amount of complexity:

Code:
// 3-axis joystick interface to an omni drive 
// with gyro (field-centric driver interface)


// first define your driver interface,
// in this case a 3-axis joystick:


forward = -Y;   // push joystick forward to go forward
right = X;      // push joystick to the right to strafe right
clockwise = Z;  // twist joystick clockwise turn clockwise


// here is where you would put any special shaping of the joystick
// response curve, such as deadband or gain adjustment


// use the gyro angle for field-centric control
// "theta" is the gyro angle, measured CCW from the zero reference

forward' = forward*cos(theta) - right*sin(theta);

right' = forward*sin(theta) + right*cos(theta);


// now apply the inverse kinematic tranformation
// to convert your vehicle motion command 
// to 4 wheel speed commands:

front_left = forward' + clockwise + right';
front_right = forward' - clockwise - right';
rear_left = forward' + clockwise - right';
rear_right = forward' - clockwise + right';


// finally, normalize the wheel speed commands
// so that no wheel speed command exceeds magnitude of 1:

max = abs(front_left);
if (abs(front_right)>max) max = abs(front_right);
if (abs(rear_left)>max) max=abs(rear_left);
if (abs(rear_right)>max) max=abs(rear_right);

if (max>1) 
  {front_left/=max; front_right/=max; rear_left/=max; rear_right/=max;}


// you're done. send these four wheel commands to their respective wheels


Last edited by Ether : 16-01-2011 at 13:02.
  #17   Spotlight this post!  
Unread 16-01-2011, 13:42
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 751
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: Holonomic Control System

Last year we did a kiwi drive. In order to understand the MATH behind the drive system, we did some research first, and found this whitepaper.

http://www.frcsoft.com/forums/index....ads&showcat=29

Hopefully, you'll see some value to this as well as we did. We also upload and share all of our robot code on frcsoft.com as well.

Good luck this season.
Chris
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
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 03:52.

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