Go to Post Defense will be everybody's part time job, not their career. - Wayne TenBrink [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: 3 votes, 3.67 average. Display Modes
  #1   Spotlight this post!  
Unread 09-15-2011, 03:55 PM
lapley3539 lapley3539 is offline
Registered User
AKA: Lauren Apley
FRC #3539 (Byting Bulldogs)
Team Role: Mechanical
 
Join Date: Sep 2011
Rookie Year: 2011
Location: Romeo, MI
Posts: 1
lapley3539 is an unknown quantity at this point
Help with Swerve Drive Programming??

Our team wants to try out swerve drive before season starts, that way we have another drive system to use for the 2012 game if needed. Any help with the coding?
Reply With Quote
  #2   Spotlight this post!  
Unread 09-15-2011, 04:41 PM
buildmaster5000 buildmaster5000 is offline
Trying to program the swerve drive
AKA: Alex
FRC #2421 (Rolling Thunder Robotics)
Team Role: Alumni
 
Join Date: May 2009
Rookie Year: 2009
Location: Northern Virginia
Posts: 207
buildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud of
Re: Help with Swerve Drive Programming??

Two resources: Ether's paper on omnidirectional drive trains here and to use polar coordinates while keeping things a simple as possible.
__________________
-Alex



2010 Washington DC Regional: Engineering Excellence Award
Reply With Quote
  #3   Spotlight this post!  
Unread 11-08-2011, 02:40 PM
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: Help with Swerve Drive Programming??

Quote:
Originally Posted by lapley3539 View Post
Our team wants to try out swerve drive before season starts, that way we have another drive system to use for the 2012 game if needed. Any help with the coding?

If it would help i could post my code for swerve drive...

Problems you may face are:

It is field centric so you need a gyro (you may be able to rewrite i can help you)
we used window motors (dont know what you plan on doing)


I will gladly help you. Im Matt from team 228 Gus robotics i have been programming for 2 1/2 years now and am getting pretty good at it.

Here is our swerve bot from 2010:
http://team228.org/media/pictures/view/6721
http://team228.org/media/pictures/view/6202


the thing that makes this robot special is the field centric controls no matter the orientation of the robot forwards is always forwards. you may want to try it,
But do let me know if you would like my help
Reply With Quote
  #4   Spotlight this post!  
Unread 11-10-2011, 10:07 AM
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: Help with Swerve Drive Programming??

I apologize if I'm looking at this wrong way, but it seems rather simple from my understanding.
Code:
Servos[1-4].set(joystick.getDirectionDegrees());
Motors[1-4].set(joystick.getMagnitude+/-joystick.getTwist());
Of course you'll need to do some adjusting for the servos and a the twist, but I think that's all that needs to be done.
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 11-10-2011, 10:54 AM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,997
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: Help with Swerve Drive Programming??

Quote:
Originally Posted by kinganu123 View Post
I apologize if I'm looking at this wrong way, but it seems rather simple from my understanding.
Code:
Servos[1-4].set(joystick.getDirectionDegrees());
Motors[1-4].set(joystick.getMagnitude+/-joystick.getTwist());
Assuming "servos" are the steering motors, it looks like you are pointing all the wheels in the same direction. Here on CD that's usually referred to Crab drive, not swerve.

With the motors, it looks like you are trying to do skid-steer.

So, it looks like Crab Drive with skid steering.

Quote:
Of course you'll need to do some adjusting for the servos and a the twist, but I think that's all that needs to be done.
The problem of figuring out the theoretically correct speed and steering angle for each of the 4 wheels for any given desired vehicle motion is called "inverse kinematics". The derivation of the formulas for this is interesting but not beyond the reach of high school mathematics. The formulas themselves are straightforward.

If you could make each wheel instantaneously go to its theoretically correct speed and steering angle, swerve would be simple. But there are dynamics involved. It takes time to steer the wheel and change its speed. During this transition time, the vehicle may do unexpected and/or undesired things.

So the real problem in implementing a competent swerve drive is how to control each wheel to obtain predictable operation and acceptable response to driver commands. There are threads (and technical papers) discussing this problem.






Last edited by Ether : 11-10-2011 at 11:24 AM.
Reply With Quote
  #6   Spotlight this post!  
Unread 11-10-2011, 04:31 PM
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: Help with Swerve Drive Programming??

Quote:
Originally Posted by Ether View Post
If you could make each wheel instantaneously go to its theoretically correct speed and steering angle, swerve would be simple. But there are dynamics involved. It takes time to steer the wheel and change its speed. During this transition time, the vehicle may do unexpected and/or undesired things.

So the real problem in implementing a competent swerve drive is how to control each wheel to obtain predictable operation and acceptable response to driver commands. There are threads (and technical papers) discussing this problem.
wow, didn't think about that. yikes, makes it so much harder than it sounds.
Thanks for info! Definitely gonna look into it now
__________________
Reply With Quote
  #7   Spotlight this post!  
Unread 12-30-2012, 11:25 AM
mlyhoops mlyhoops is offline
Registered User
AKA: Matthew Yamamoto
FRC #1197 (TorBots)
Team Role: Alumni
 
Join Date: Dec 2012
Rookie Year: 2012
Location: Torrance
Posts: 16
mlyhoops is an unknown quantity at this point
Re: Help with Swerve Drive Programming??

Quote:
Originally Posted by ProgrammerMatt View Post
If it would help i could post my code for swerve drive...

Problems you may face are:

It is field centric so you need a gyro (you may be able to rewrite i can help you)
we used window motors (dont know what you plan on doing)


I will gladly help you. Im Matt from team 228 Gus robotics i have been programming for 2 1/2 years now and am getting pretty good at it.

Here is our swerve bot from 2010:
http://team228.org/media/pictures/view/6721
http://team228.org/media/pictures/view/6202


the thing that makes this robot special is the field centric controls no matter the orientation of the robot forwards is always forwards. you may want to try it,
But do let me know if you would like my help
Hey ProgrammerMatt, can you help my team with the swerve drive too? we really want to be able to make that kind of drive but we haven't been able to because the coding is too complicated for us. If you can help us, please email me at mlyhoops@gmail.com
Thank you!
Reply With Quote
  #8   Spotlight this post!  
Unread 12-31-2012, 04:29 PM
Patrick Chiang Patrick Chiang is offline
Programming
FRC #3070 (Team Pronto)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Seattle
Posts: 162
Patrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to all
Re: Help with Swerve Drive Programming??

Quote:
Originally Posted by mlyhoops View Post
Hey ProgrammerMatt, can you help my team with the swerve drive too? we really want to be able to make that kind of drive but we haven't been able to because the coding is too complicated for us. If you can help us, please email me at mlyhoops@gmail.com
Thank you!
You should post more details about your particular problem here. Would be nice if you could show us what you have so far too.
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 08:12 AM.

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