Go to Post FIRST truly isnt about building robots, but allowing yourself to reach higher and farther than you ever could. - Brandon Holley [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-04-2010, 15:23
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,521
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Programming a Crab Drive System

In playing with the numbers on your spreadsheet, I ran into a couple items I had questions about.

If I put the speed to 1 (full) and the rotation to 1 (full) I get a wheel speed of 2+. I was assuming the full-scale wheel speed was from -1 to 1. Is that not the case?

In addition, when I put in Speed 1, Angle 0, Rotation 1, I get a picture where the two left wheels are 90 degrees from the supposed angle of travel shown in the overall motion. That would seem to me to be physically impossible, as it appears you are trying to literally drag those two wheels sideways.

Let me know if I'm making some incorrect assumptions.
  #2   Spotlight this post!  
Unread 24-04-2010, 16:24
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,058
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Programming a Crab Drive System

Quote:
Originally Posted by Tom Line View Post
If I put the speed to 1 (full) and the rotation to 1 (full) I get a wheel speed of 2+. I was assuming the full-scale wheel speed was from -1 to 1. Is that not the case?
Yes, the wheel speed is -1 to 1. However, the spreadsheet/equations do not account for this at all in that implementation. Our code had a thing like this in it:

Code:
	// only need to scale if speed > 1
	if (highest_speed > 1.0 )
	{
		// scale each speed by the highest speed
		for (int i = 0; i < 4; i++)
			speeds[i] /= highest_speed;
	}
It would just have made the spreadsheet more complicated to implement it that way, so I left it out.

Quote:
Originally Posted by Tom Line View Post
In addition, when I put in Speed 1, Angle 0, Rotation 1, I get a picture where the two left wheels are 90 degrees from the supposed angle of travel shown in the overall motion. That would seem to me to be physically impossible, as it appears you are trying to literally drag those two wheels sideways.
Yes, I think that is how it ends up working, and it is a bit counterintuitive. Generally speaking, I don't think we used high values of rotation and high values of speed particularly often.

Keep in mind that you *cannot* travel in a straight line AND rotate at the same time without some external thing helping you compensate (for instance, a gyro), because you will always be having to adjust things relative to the robot. This is probably where part of the confusion comes from. However, with a gyro and a PID controller, you can make it go in a straight line and rotate at the same time without too much effort.

On the same website, we have our 2009 code posted which has a SwerveDrive.cpp with an implementation of this stuff there. We ended up finding an annoying bug in our implementation though (it had to do with the way that we calculated the shortest path for our servos).. but, I never updated the site with the code. Or maybe I did, I don't recall. But its a useful starting point in any case.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming Issues with Crab Drive System bls0620 Programming 34 28-01-2010 16:38
crab drive vs. mecanum drive system superbotman Technical Discussion 33 06-01-2010 03:09
Programming Crab Drive darthfroggy NI LabVIEW 5 06-04-2009 08:52
Crab Drive Programming!!! HELP!!!!!!!!! Megy698 Programming 6 13-02-2009 07:53


All times are GMT -5. The time now is 03:23.

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