Go to Post Were going to nationals!?! Did anyone think of telling me this? - Beta Version [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-04-2015, 21:37
FrankenmuthK's Avatar
FrankenmuthK FrankenmuthK is offline
Registered User
FRC #5215
 
Join Date: Jan 2015
Location: United States
Posts: 34
FrankenmuthK is an unknown quantity at this point
Swerve drive

Need help programming a swerve drive!!
Reply With Quote
  #2   Spotlight this post!  
Unread 09-04-2015, 21:44
z_beeblebrox's Avatar
z_beeblebrox z_beeblebrox is offline
Custom User Title
AKA: Cal
FRC #4183 (Bit Buckets)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Cambridge MA
Posts: 811
z_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond repute
Re: Swerve drive

Is there a specific issue you need help with?

If you have more general questions about swerve drive software, I'd suggest checking out Team 1640's website or searching Chief Delphi.
__________________
2012 Utah Regional Rookie All-Star
2013 Phoenix Regional Judge's Award for "design process and prototyping"
2014 Hub City Regional Quality Award, Arizona Regional Excellence in Engineering Award
2015 Arizona East Regional Creativity Award, Winner
2016 Arizona North Regional Finalist, Arizona West Excellence in Engineering Award, Finalist
Reply With Quote
  #3   Spotlight this post!  
Unread 09-04-2015, 22:01
FrankenmuthK's Avatar
FrankenmuthK FrankenmuthK is offline
Registered User
FRC #5215
 
Join Date: Jan 2015
Location: United States
Posts: 34
FrankenmuthK is an unknown quantity at this point
Re: Swerve drive

Quote:
Originally Posted by z_beeblebrox View Post
Is there a specific issue you need help with?

If you have more general questions about swerve drive software, I'd suggest checking out Team 1640's website or searching Chief Delphi.
I want to program it as an offseason project, but I have no idea where to begin
Reply With Quote
  #4   Spotlight this post!  
Unread 09-04-2015, 22:02
MaGiC_PiKaChU's Avatar
MaGiC_PiKaChU MaGiC_PiKaChU is offline
Drive Coach
AKA: Antoine L.
FRC #3360 (Hyperion)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Sherbrooke
Posts: 608
MaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond repute
Re: Swerve drive

Quote:
Originally Posted by FrankenmuthK View Post
I want to program it as an offseason project, but I have no idea where to begin
I did it this season... you should start with only one wheel, with its position (360 degrees)

if you have specific questions, PM me!
__________________
2012 - 3360 - Junior member
2013 - 3360 - Lead Programmer, Human player
2014 - 3360 - Lead Programmer, Human player
2015 - 3360 - Lead Programmer, Driver
2016 - 3360 - Mentor, Drive coach



Reply With Quote
  #5   Spotlight this post!  
Unread 10-04-2015, 09:29
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Swerve drive


There are at least 8 aspects of swerve programming

1) position control of wheel steering angle

2) velocity control of wheel speed

3) driver interface

4) inverse kinematics

5) special handling of large wheel angle changes

6) limiting total steering angle

7) field-centric control

8) programmed maneuvers and/or special modes

As Antoine suggested, position control of wheel steering angle is a good place to start. It will require an angle sensor and some sort of closed-loop control.

Velocity control of wheel speed should also be closed-loop for best results, but you may be able to get away with just controlling voltage to the drive motors.

Driver interface requires some soul-searching. Do you want to give the driver low-level direct control of the 3 degrees of freedom of the vehicle (forward/reverse speed, left/right speed, spin CW/CCW speed)? Or do you want to make the driver interface more abstract (e.g. turning radius and arc speed).

Inverse kinematics is the name for the computation you need to do to convert the driver commands to 4 pairs of wheelspeed/wheelangle commands. This computation is well understood and documented in many papers and published software. Make sure you code this properly so that all changes in steering angle are coerced to the range +/-180 degrees: You don't want to rotate the wheel 359 degrees clockwise when rotating 1 degree counterclockwise would achieve the same result.

Depending on the design of your swerve hardware, you may also need/want to do some special handling of changes in steering angle command between 90 and 180 degrees. For example, if there's a sudden command to increase the steering angle of a wheel by 135 degrees, you might instead decrease the angle by 45 degrees and reverse the speed of the wheel.

Depending on the design of your swerve hardware, you may also need to do some special handling to limit the total steering angle to whatever the wires can tolerate. You'll have to program the software to keep track of the total steering angle of each wheel, and have the software look for opportunities to "unwind" a wheel when its wheel speed is zero (or nearly zero).

Field-centric control is optional (driver preference) but should be straightforward to implement once everything else is working. But make sure your gyro is working properly first. The gyro "zero" position should align with your wheel steering encoder "zero" position (typically "zero" is straight forward), and both the gyro and wheel steering encoder should have the same direction of rotation (e.g. both are positive in the clockwise direction).

Finally,you may want to add some programmed maneuvers to the driver interface. For example, the driver presses a button and the robot quickly backs up and rotates 180 degrees. You may also want to add buttons to allow the driver to select different modes.


In addition to all the above, you may need/want to add acceleration limiting (both linear and centripetal) if the game involves top-heavy robots carrying unsteady loads.



Last edited by Ether : 10-04-2015 at 09:54.
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 21:31.

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