Thread: Swirve Drive
View Single Post
  #2   Spotlight this post!  
Unread 20-01-2011, 09:59
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,276
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Swirve Drive

Quote:
Originally Posted by flamingtoaster View Post
This year my team is using a swirve drive on the robot. I am a first year programmer and doi not know how to program this. I know I need to make a custom drive, has anyone done this in the past and have any ideas on how to get this to work?
There are two major components to controlling swerve drives.

1.) Wheel Angle: First you need to calculate the desired wheel angle, this will depend on exactly how you are going to control it but most likely you will have to take the X and Y values and use trig to calculate the desired angle (Tan=Opposite/Adjacent). You will also need to calculate the current angle, for this you will need some kind of sensor (likely a potentiometer). Once you have the desired and actual angles you can use a PID loop (there are functions written for this in both labview and C++) to adjust the angle. There are whitepapers here on CD that describe the process of tuning PID loops.

2.) Wheel Speed, this can be calculated more directly. You can calculate the desired speed from the X and Y components of the joystick (Pythagorean Theorem) and you can map that to wheel speed.

This is the simplest way to do swerve drive and it doesn't take into account turning. To give you more guidance we really need to know what you are using to control the bot and how the swerve drive is set up. Anytime you are looking to program something that is complicated it is important to break it into smaller functions and attack each independently.

If you have more questions feel free to post them.
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)
Reply With Quote