Go to Post Well our closest regional is a Hawaii, it's a bit hard for us to drive 8000km (5000 miles) across the pacific... - timytamy [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 15-01-2011, 11:57
SudoSammich SudoSammich is offline
A pretty big deal...
AKA: Corey
FRC #0514 (Entropy)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2007
Location: Miller Place
Posts: 31
SudoSammich is an unknown quantity at this point
Holonomic Control System

For the first time our team is experimenting with holonomic drive (4 omnis placed at 45 degree angles relative to the frame) and it has fallen to me to code the movement. I have a system in place, but it came to my attention after the initial code was written that different people have different opinions as to how the joystick movements should coorelate to robot movement. As such I'm reaching out to teams who have done this in the past...how'd you guys do it?

At the moment we've got a two joystick design. One stick changes position but not orientation. The robot maintains "front" while moving in whatever direction the joystick tells it to. The second stick controls spin while maintaining position (they won't mix at the moment). This was the first control method that came to mind for me since it allows us to make use of all three degrees of freedom to the greatest extent, but our coach believes that it won't be natural after our years of straight drivetrains.

The other suggested method of control is one sticck that drives much as arcade has in the past, but accompanied by a second stick for strafing to take advantage of our added range of motion. Our coach thinks this will be more natural as a transition, but I don't think it has the same potential since we won't be able to strafe will moving forward.

So for teams who've been successful in the past, how did yours move? Did you find any particular strengths or weaknesses in the control system? Features you wished you'd had? Thanks in advance for the help!
  #2   Spotlight this post!  
Unread 15-01-2011, 12:36
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
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
For the first time our team is experimenting with holonomic drive (4 omnis placed at 45 degree angles relative to the frame) and it has fallen to me to code the movement. I have a system in place, but it came to my attention after the initial code was written that different people have different opinions as to how the joystick movements should coorelate to robot movement. As such I'm reaching out to teams who have done this in the past...how'd you guys do it?

At the moment we've got a two joystick design. One stick changes position but not orientation. The robot maintains "front" while moving in whatever direction the joystick tells it to. The second stick controls spin while maintaining position (they won't mix at the moment). This was the first control method that came to mind for me since it allows us to make use of all three degrees of freedom to the greatest extent, but our coach believes that it won't be natural after our years of straight drivetrains.

The other suggested method of control is one sticck that drives much as arcade has in the past, but accompanied by a second stick for strafing to take advantage of our added range of motion. Our coach thinks this will be more natural as a transition, but I don't think it has the same potential since we won't be able to strafe will moving forward.

So for teams who've been successful in the past, how did yours move? Did you find any particular strengths or weaknesses in the control system? Features you wished you'd had? Thanks in advance for the help!
Some of the more popular driver interfaces for omni & mecanum are:

1) 3-axis joystick. Y controls fwd/rev, X controls strafe, Z (twist axis) controls rotation.

2) Halo. 2 2-axis joysticks. Y1 controls fwd/rev, X1 controls strafe, X2 controls rotation.

3) Arcade plus strafe. 2 2-axis joysticks. Y1 controls fwd/rev, X1 controls rotation, X2 controls strafe.


Quote:
(they won't mix at the moment)
I'm trying to make sense out of the above. Did you add extra code to purposely zero-out the first joystick when the second one is giving a command (or vice versa)? If so, why did you think that was necessary?



  #3   Spotlight this post!  
Unread 15-01-2011, 12:39
thefro526's Avatar
thefro526 thefro526 is offline
Mentor for Hire.
AKA: Dustin Benedict
no team (EWCP, MAR, FRC 708)
Team Role: Mentor
 
Join Date: Aug 2006
Rookie Year: 2005
Location: New Jersey
Posts: 2,599
thefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond repute
Send a message via AIM to thefro526 Send a message via MSN to thefro526
Re: Holonomic Control System

Quote:
Originally Posted by Ether View Post
Some of the more popular driver interfaces for omni & mecanum are:

1) 3-axis joystick. Y controls fwd/rev, X controls strafe, Z (twist axis) controls rotation.

2) Halo. 2 2-axis joysticks. Y1 controls fwd/rev, X1 controls strafe, X2 controls rotation.

My personal favorite from the little I've played with Omni-Drive Prototypes is Solution 1. It's probably the easiest and most straight forward way to team someone how to drive and Omni-Drive.

Solution 2 also works extremely well - especially if you've got a bunch of gamers on your team.
__________________
-Dustin Benedict
2005-2012 - Student & Mentor FRC 816
2012-2014 - Technical Mentor, 2014 Drive Coach FRC 341
Current - Mentor FRC 2729, FRC 708
  #4   Spotlight this post!  
Unread 15-01-2011, 12:42
Chris is me's Avatar
Chris is me Chris is me is offline
no bag, vex only, final destination
AKA: Pinecone
FRC #0228 (GUS Robotics); FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Glastonbury, CT
Posts: 7,684
Chris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond repute
Send a message via AIM to Chris is me
Re: Holonomic Control System

Solution 1 (3 axis) is somewhat difficult to use because you may find yourself twisting the joystick slightly during normal operation - the "twist" motion isn't too intuitive for me personally.

Solution 2 (one stick for motion one for reorientation) is my personal favorite.

With all control systems, the number one rule is driver preference. What they feel best with is what they get.
__________________
Mentor / Drive Coach: 228 (2016-?)
...2016 Waterbury SFs (with 3314, 3719), RIDE #2 Seed / Winners (with 1058, 6153), Carver QFs (with 503, 359, 4607)
Mentor / Consultant Person: 2170 (2017-?)
---
College Mentor: 2791 (2010-2015)
...2015 TVR Motorola Quality, FLR GM Industrial Design
...2014 FLR Motorola Quality / SFs (with 341, 4930)
...2013 BAE Motorola Quality, WPI Regional #1 Seed / Delphi Excellence in Engineering / Finalists (with 20, 3182)
...2012 BAE Imagery / Finalists (with 1519, 885), CT Xerox Creativity / SFs (with 2168, 118)
Student: 1714 (2009) - 2009 Minnesota 10,000 Lakes Regional Winners (with 2826, 2470)
2791 Build Season Photo Gallery - Look here for mechanism photos My Robotics Blog (Updated April 11 2014)
  #5   Spotlight this post!  
Unread 15-01-2011, 12:52
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
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 Chris is me View Post
Solution 1 (3 axis) is somewhat difficult to use because you may find yourself twisting the joystick slightly during normal operation - the "twist" motion isn't too intuitive for me personally.

Solution 2 (one stick for motion one for reorientation) is my personal favorite.

With all control systems, the number one rule is driver preference. What they feel best with is what they get.
Ditto what Chris said about #1 and #2 and driver preference.

Since this is your first experience with holonomic, I hesitate to bring this up, but some have found that using the gyro as a fixed-angle reference to provide "field-centric" control (sometimes aka "driver-centric control") provides a superior driver experience with a quicker learning curve.


  #6   Spotlight this post!  
Unread 15-01-2011, 13:47
MotorHead's Avatar
MotorHead MotorHead is offline
Programming Mentor
AKA: Jeff Beltramo
FRC #1922 (OZ-Ram)
Team Role: Coach
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Concord, NH
Posts: 68
MotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to behold
Re: Holonomic Control System

Quote:
Originally Posted by Ether View Post
Ditto what Chris said about #1 and #2 and driver preference.

Since this is your first experience with holonomic, I hesitate to bring this up, but some have found that using the gyro as a fixed-angle reference to provide "field-centric" control (sometimes aka "driver-centric control") provides a superior driver experience with a quicker learning curve.

We ran mecanum last year as well and very pleased with it. As stated above, solution #1 is what we went with. Early there was a problem with inadvertent spinning of the robot, so we programmed a deadband to avoid spurious rotations. We also found we had to limit the rate of rotation. If we spun at max speed, this is when gyro error would creep in. I forget the response limit of the gyro, but it was obvious we were exceeding it. I would also concur with adding switches (joystick or other hardware) that allow re-zeroing and canceling gyro compensation completely. Drivers didn't use it often, but it did prove convenient a few times.
__________________
Jeff Beltramo
Team #1922
Concord, New Hampshire

  #7   Spotlight this post!  
Unread 16-01-2011, 10:07
SudoSammich SudoSammich is offline
A pretty big deal...
AKA: Corey
FRC #0514 (Entropy)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2007
Location: Miller Place
Posts: 31
SudoSammich is an unknown quantity at this point
Re: Holonomic Control System

Quote:
Originally Posted by Ether View Post

I'm trying to make sense out of the above. Did you add extra code to purposely zero-out the first joystick when the second one is giving a command (or vice versa)? If so, why did you think that was necessary?
I wasn't entirely sure how it would mix. I programmed it in the method that I first came up with, which consisted of converting the joystick inputs to a polar coordinate scale (rotated 45 degrees) and mapped each set of motors across from one another to either the X or Y coordinate of the point (respectively). This doesn't exactly lead to an easy blend with spinning as far as I can tell. While it's something I'll probably try to tackle later, it's not done YET.

Quote:
Originally Posted by Thxe View Post
Also, I would STRONGLY recommend that you look into using a gyro to compensate for robot rotation. Basicly, when you push the movement stick forward, the robot knows how it is oriented and will always move away from you. Likewise, when you move the stick left, it will always go left relative to the control station. This takes just a few minutes to get used to, and is extremely natural after that. If you go with this it is very important to have a button that turns it off also because sometimes the gyro gets messed up.
I saw a system similar to that several years ago with swerve drive actually. We're tossing on a gyro for the camera anyway, so I don't see any reason we wouldn't at least attempt that system if you say your drivers were successful with it.

And thanks all for the responses, I've been thinking CD was down for a few days now when my Droid wouldn't access it XD.
  #8   Spotlight this post!  
Unread 16-01-2011, 11:38
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
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:
Quote:
Originally Posted by Ether
I'm trying to make sense out of the above. Did you add extra code to purposely zero-out the first joystick when the second one is giving a command (or vice versa)? If so, why did you think that was necessary?
SudoSammich replied:
I wasn't entirely sure how it would mix.
The drivetrain you described in your original post (4 omnis placed at 45 degree angles relative to the frame) is holonomic, which means it can perform fore/aft (Y), right/left (X), and rotate (Z) motion simultaneously, if the inverse kinematic calculation for wheel speeds is done correctly.

Quote:
I programmed it in the method that I first came up with, which consisted of converting the joystick inputs to a polar coordinate scale (rotated 45 degrees) and mapped each set of motors across from one another to either the X or Y coordinate of the point (respectively). This doesn't exactly lead to an easy blend with spinning as far as I can tell. While it's something I'll probably try to tackle later, it's not done YET.
You don't have to re-invent the wheel (sorry for the pun) if you don't want to. The FRC-provided software development environment contains library functions for the omni drive you described. In LabVIEW for example, using the Cartesian Holonomic vi, all you have to do is wire your Y, X, and Rotate inputs into the vi, and it does all the math. If you have a gyro, there is an input on the vi for that too, so you can have field-centric control.



  #9   Spotlight this post!  
Unread 16-01-2011, 11:50
SudoSammich SudoSammich is offline
A pretty big deal...
AKA: Corey
FRC #0514 (Entropy)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2007
Location: Miller Place
Posts: 31
SudoSammich is an unknown quantity at this point
Re: Holonomic Control System

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.
  #10   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,077
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.
  #11   Spotlight this post!  
Unread 16-01-2011, 12:04
Jogo Jogo is offline
Registered User
FRC #0353 (Pobots)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2007
Location: NY
Posts: 83
Jogo is on a distinguished road
Re: Holonomic Control System

Ether--

According to the inverse kinematics solution (http://www.simbotics.org/files/first...irectional.pdf), The wheel speeds are also functions of the distance between the wheels and the center of the robot...the labview VI doesn't seem to account for this. Any suggestions? I'm assuming all the axis probably will need to be scaled anyway.
  #12   Spotlight this post!  
Unread 16-01-2011, 12:13
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
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 Jogo View Post
Ether--

According to the inverse kinematics solution (http://www.simbotics.org/files/first...irectional.pdf), The wheel speeds are also functions of the distance between the wheels and the center of the robot...the labview VI doesn't seem to account for this. Any suggestions? I'm assuming all the axis probably will need to be scaled anyway.
You are correct, but the only degree of freedom that is affected by the wheelbase and trackwidth dimensions as far as the inverse kinematic calculation is concerned is the "rotate" command, and this can safely be tuned empirically to a suitable value (by multiplying the joystick rotate command by a scale factor, for example).

I posted a paper (see link below) which goes into more technical detail showing how the wheel positions affect the calculations, if you are interested. It even covers cases where the wheels are not located equidistant from the chosen centerpoint.

http://www.chiefdelphi.com/media/papers/download/2722

[edit] the above-referenced paper specifically deals with mecanum wheels, but the same principles can be used to analyze holonomic [/edit]


Last edited by Ether : 16-01-2011 at 14:10.
  #13   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: 747
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
  #14   Spotlight this post!  
Unread 15-01-2011, 12:38
brianc217's Avatar
brianc217 brianc217 is offline
Registered User
None #1153
 
Join Date: Feb 2008
Location: Walpole, MA
Posts: 36
brianc217 is an unknown quantity at this point
Re: Holonomic Control System

When we did it in the past (not for competition) we programmed it the first way you said, with one joystick that controls movement and the other to control rotation. This is actually very intuitive since which ever way you move the joystick, that's the direction the robot will move in. Driver's should adapt to the new control method quite easily.
__________________
http://walpolerobotics.org
  #15   Spotlight this post!  
Unread 15-01-2011, 12:42
Jester Jester is offline
Labview Maniac
AKA: Cody Ripley
FRC #3144 (Krypto-Knights)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Oklahoma City, OK
Posts: 22
Jester is an unknown quantity at this point
Re: Holonomic Control System

This year our team is going with a 3-axis joystick, with a twist handle. Logitech sells these for around $30. We got ours at best buy.
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:49.

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