Go to Post It looks very simple to build, and I like simplicity. - Nick Lawrence [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 04-01-2013, 15:08
Jonathan L. Jonathan L. is offline
Programmer alumnus, mentor, and CSA
FRC #1094 (Channel Cats)
 
Join Date: Jan 2013
Rookie Year: 2011
Location: St. Louis MO
Posts: 78
Jonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the rough
1094 Swerve Drive code

The attached is a version of Swerve Drive code we've been working on.


It includes:

If a wheel is turned in a certain direction, say forward, and we want that wheel to go back and left the wheel will turn 45 degrees to the right and spin backwards.

If there is a known limit to how many times a wheel can turn around, say because of wires getting tangled up otherwise, we can set a software limit to it (this is optional).

If in a match you move the center of the wheel on your robot (maybe in closer to the center of the robot) and you know where the wheel is, the program can calculate for the change in position.

You can use 3, 4, 5 etc. number of wheels on the robot.


How is it controlled?

X and Y axis from a joystick are combined to find the direction and speed that the robot will crab. Another axis (what I call the Z axis) is used to find in what direction and speed the robot will spin. (If you can make code to get these inputs that's fine for auto-mode or whatever.)

So for example if you have a joystick with twist; left and right axis is X, forward and back is the Y, and twist is Z...

To move forward and turn to the right you would push the joystick forward and twist to the right.

If you want to control the robot a different way you may be able to manipulate the numbers around.



This program will output the direction the wheels should turn to and the motor speed they should turn; I'm leaving it up to you to get the wheel to the direction to be pointed in.



Note:

I have not tested this on a robot since we don't have the hardware yet, but on screen it looks good so far.
Attached Files
File Type: zip Swerve Drive.zip (101.2 KB, 64 views)
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 17:59.

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