Go to Post FIRST is the most glorious test of the mind. Anyone can run a marathon or get a slam-dunk. It takes guts to admit you are a nerd that enjoys six weeks off non-stop stress, and actually thrives on it. - kws4000 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 18-01-2015, 05:34
landinw's Avatar
landinw landinw is offline
Registered User
AKA: Bill Landin
FRC #2377 (C-Company)
Team Role: Mentor
 
Join Date: Sep 2010
Rookie Year: 2010
Location: Pasadena, MD
Posts: 11
landinw is an unknown quantity at this point
H-Drive Programming

Our drive team is developing a H-Drive system with omnis this year (4 corners and 2 across). Anyone have any tips on how to best program this so it can be driven with a single joystick. We're using Java.
Reply With Quote
  #2   Spotlight this post!  
Unread 18-01-2015, 08:51
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: H-Drive Programming

Quote:
Originally Posted by landinw View Post
Our drive team is developing a H-Drive system with omnis this year (4 corners and 2 across). Anyone have any tips on how to best program this so it can be driven with a single joystick.
That depends on what you want the drivetrain to do, and whether your joystick is 2 axis or 3 axis, and what motors and gear ratios you intend to use for the sideways motors.

Provide a little more detail.



Without knowing what you want the drive to do, one suggestion for a 2-axis joystick would be to program it in two separate modes, with the desired mode selectable using a botton or buttons.

ModeA could be simple tank or arcade driver interface (sideways motors not used). ModeB could be strafe mode (power only the 2 sideways motors and leave the corner ones unpowered).


Last edited by Ether : 18-01-2015 at 08:57.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-01-2015, 09:39
landinw's Avatar
landinw landinw is offline
Registered User
AKA: Bill Landin
FRC #2377 (C-Company)
Team Role: Mentor
 
Join Date: Sep 2010
Rookie Year: 2010
Location: Pasadena, MD
Posts: 11
landinw is an unknown quantity at this point
Re: H-Drive Programming

Thanks for the reply.

We will have a 3-axis joystick available. Guidance we have is that going forward/backward (y-axis) the corner wheels would do the driving, going left/right (x-axis) the cross wheels would do the driving and turning in place (z-axis) the motors would work together to "twist" the bot. We'll be using CIMs, but don't have info on gearing.

We're just getting started dissecting this problem but thought I'd reach out to see what others with experience had to say.

Thanks again.
Reply With Quote
  #4   Spotlight this post!  
Unread 21-01-2015, 13:32
TheMkrage TheMkrage is offline
Head Programmer
AKA: Matthew Krager
FRC #3309 (Friarbots)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Huntington Beach, CA
Posts: 2
TheMkrage has a spectacular aura aboutTheMkrage has a spectacular aura aboutTheMkrage has a spectacular aura about
Re: H-Drive Programming

Hi!
My team's off-season project was to build an H-Drive drive train. Our drive train is controlled by an XBox controller where the Y-Axis of the left joystick controls vertical movement, the X-Axis of the left joystick controls horizontal movement through the strafe wheel, and the X-Axis of the right joystick controls turning.
If you are attempting to use a single joystick, I suggest you use a three axis joystick. A two axis joystick with separate modes may work, but it prohibits some movements that are possible when using H-Drive. For example, with a two axis joystick, you could never strafe while moving forward or strafe while turning. You will never be able to move diagonally or turn while strafing with separate modes. A three axis joystick would allow you do this.
I also believe another aspect to take into account is how responsive the drivers can be with separate modes. Separate modes may require more practice to be used successfully because the driver has to remember which mode he or she is in. It is just another button to worry about when the driver already has enough on his or her mind. A three axis joystick would eliminate this problem.
Another thing to take into account when programming H-Drive is maintaining a constant angle when strafing. The point of strafing is to add horizontal movement without having to turn. Without code to fix for this, your robot will most likely arc when it is strafing. To eliminate this, I used a PID Loop (well a PD loop) that's main function was to keep the robot facing towards one angle. Of course this is only activated when you are strafing or moving forward and strafing (which would move you diagonally)

Hope this helped
Reply With Quote
  #5   Spotlight this post!  
Unread 21-01-2015, 13:49
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,080
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: H-Drive Programming

Quote:
Originally Posted by landinw View Post
Thanks for the reply.

We will have a 3-axis joystick available. Guidance we have is that going forward/backward (y-axis) the corner wheels would do the driving, going left/right (x-axis) the cross wheels would do the driving and turning in place (z-axis) the motors would work together to "twist" the bot. We'll be using CIMs, but don't have info on gearing.

We're just getting started dissecting this problem but thought I'd reach out to see what others with experience had to say.

Thanks again.
https://gist.github.com/schreiaj/c3356a23dc3a8e33c574 Code that I put together as a general solution to omni drives, it works for H drive as is. Code has been tested using a chassis weighted to 100lbs. It drifts (correct with Gyro) but does correct things.

Math's based on this paper (http://people.idsia.ch/~foerster/200...t_preprint.pdf)
__________________




.
Reply With Quote
  #6   Spotlight this post!  
Unread 21-01-2015, 23:54
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: H-Drive Programming

I figure I might as well throw in my two cents. The code (at least for my team's untested implementation) will look a lot like RobotDrive's mecanumDrive_Polar/Cartesian.
  1. You want to take the joystick degrees and break it up into x and y vectors (kind of like what you do in physics).
  2. Use the magnitude to compute the size of the x and y vectors.
  3. Divide by the original x and y vectors so that you can bring your magnitudes back to a scale of -1 to 1. Without this last step, you robot won't be able to go diagonal at max speed.
__________________
Reply With Quote
  #7   Spotlight this post!  
Unread 22-01-2015, 00:19
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,723
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: H-Drive Programming

Quote:
Originally Posted by kinganu123 View Post
I figure I might as well throw in my two cents. The code (at least for my team's untested implementation) will look a lot like RobotDrive's mecanumDrive_Polar/Cartesian.
  1. You want to take the joystick degrees and break it up into x and y vectors (kind of like what you do in physics).
  2. Use the magnitude to compute the size of the x and y vectors.
  3. Divide by the original x and y vectors so that you can bring your magnitudes back to a scale of -1 to 1. Without this last step, you robot won't be able to go diagonal at max speed.
If you extend or emulate mecanumDrive, you will also want to make some adjustments for the different amount of force you are capable of providing in each direction. If you turned all four tank wheels forward, and the two strafe wheels to the right, you wouldn't go off in a 45-degree angle right of forward, but a 26-degree angle right of forward (assuming equal weight loading on each wheel and equivalent wheels all around, ignoring differences in roller cross-friction). For a classic 5-wheel H-drive with the same assumptions, the answer would be only 14 degrees from forward.

Last edited by GeeTwo : 22-01-2015 at 00:21. Reason: Add 5-wheel case
Reply With Quote
  #8   Spotlight this post!  
Unread 22-01-2015, 11:33
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: H-Drive Programming

Huh, I did not think about that at all! Looks like I'll have to bring the programmers back to the white board.
__________________
Reply With Quote
  #9   Spotlight this post!  
Unread 23-01-2015, 08:09
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,723
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: H-Drive Programming

Quote:
Originally Posted by kinganu123 View Post
Huh, I did not think about that at all! Looks like I'll have to bring the programmers back to the white board.
And that is why I'd rather post my design early than keep it secret.
Reply With Quote
  #10   Spotlight this post!  
Unread 23-01-2015, 17:43
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: H-Drive Programming

Quote:
Originally Posted by GeeTwo View Post
And that is why I'd rather post my design early than keep it secret.
Wait, where is this said post? I think we got it be using a ratio relative to the x-axis, but I would like to know if there is a better way. Our way is hacky, but should do the trick.
__________________
Reply With Quote
  #11   Spotlight this post!  
Unread 24-01-2015, 23:13
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,723
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: H-Drive Programming

Quote:
Originally Posted by kinganu123 View Post
Wait, where is this said post? I think we got it be using a ratio relative to the x-axis, but I would like to know if there is a better way. Our way is hacky, but should do the trick.
No, I am not familiar with anyone else having emulated HolonomicDrive with an H-drive. I was just remarking that the value of sharing and getting more eyes on your idea usually has better payoff than keeping it secret does.

I can think of several solutions to this issue, none of them perfect. They pretty much come down to variations on:
  1. Accept the fact that left to right strafing is at a lower speed and work through it in driver practice
  2. Reduce the power on the tank drives (not recommended as an only solution; you'd be giving up the reasons for selecting H).
  3. allow some way to switch between these two, or one of these and regular tank-drive or tank-drive-plus-strafe (or any three or four)
Reply With Quote
  #12   Spotlight this post!  
Unread 26-01-2015, 00:20
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: H-Drive Programming

So we ended up doing is making our own Gaussian function to adjust the y speed based upon the angle of the x and y vectors from the joysticks. The major downside is that we won't be able to go diagonally at "full speed," but as you said, this may be something we'll just have to accept.
We should be able to actually test this approach on tomorrow and I'll try to update this post with the result.
__________________
Reply With Quote
  #13   Spotlight this post!  
Unread 26-01-2015, 00:56
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: H-Drive Programming

Quote:
Originally Posted by kinganu123 View Post
So we ended up doing is making our own Gaussian function to adjust the y speed based upon the angle of the x and y vectors from the joysticks.
Gaussian function?


Reply With Quote
  #14   Spotlight this post!  
Unread 26-01-2015, 01:12
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,723
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: H-Drive Programming

Quote:
Originally Posted by Ether View Post
Gaussian function?
Does sound strange. From context, I believe they're planning to "amplify" the strafe by a factor of four at low values so that response is essentially isotropic, and use a Gaussian taper on the strafe axis so that at large values of strafe they're back at a multiplier of one so that response on the main drive axis is four times as good as on the strafe axis.
Reply With Quote
  #15   Spotlight this post!  
Unread 27-01-2015, 19:30
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Quote:
Originally Posted by GeeTwo View Post
Does sound strange. From context, I believe they're planning to "amplify" the strafe by a factor of four at low values so that response is essentially isotropic, and use a Gaussian taper on the strafe axis so that at large values of strafe they're back at a multiplier of one so that response on the main drive axis is four times as good as on the strafe axis.
Yes, exactly this.
So I wasn't there when we actually tested the drive train, but from my understanding, it seems like we are having dinner center of gravity issues that essentially messes with it values, so we're going to wait for the elevator to be put on before we do more extensive testing and tuning. But it went reasonably well for the most part.
__________________
Reply With Quote
Reply


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 00:41.

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