Go to Post ... Better to treat everything like it's about to explode and be wrong than the other way round. - Bongle [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #41   Spotlight this post!  
Unread 29-12-2011, 16:34
JamesTerm's Avatar
JamesTerm JamesTerm is offline
Terminator
AKA: James Killian
FRC #3481 (Bronc Botz)
Team Role: Engineer
 
Join Date: May 2011
Rookie Year: 2010
Location: San Antonio, Texas
Posts: 298
JamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to behold
Re: WCD vs. Swerve

Quote:
Originally Posted by Ether View Post
Just to be clear: There is a divide-by-4 (which divides all 4 terms) in the original equations I posted:

Yes... I've changed my equation to do the divide last, as this is more efficient. One thing I wanted to point out is that these equations can work with linear velocity instead of angular, but more importantly which ever it is all the variables must be the same... This caught me off guard in my debugging as my RCW needed to be converted to linear velocity, and my omega needed to be converted back:

So I do this
Code:
	//const double R = sqrt((L*L)+(W*W));
	const double R = GetWheelDimensions().length();

	double RCW=GetAngularVelocity(); //in radians
	double RPS=RCW / Pi2;
	RCW=RPS * (PI * R);  //R is really diameter

//and this:
	AngularVelocity=(omega / (PI * D)) * Pi2;
I have made a better demo today after fixing a lot of bugs from the first one here:
http://www.termstech.com/files/SwerveDriveDemo2.wmv


I was able to use similar equations for the tank drive:

Code:
	m_LeftLinearVelocity = FWD + RCW;
	m_RightLinearVelocity = FWD - RCW;

	//const double FWD = (LeftLinearVelocity*cos(1.0)+RightLinearVelocity*cos(1.0))/2.0;
	const double FWD = (LeftLinearVelocity + RightLinearVelocity) / 2.0;
	//const double STR = (LeftLinearVelocity*sin(0.0)+ RightLinearVelocity*sin(0.0))/2.0;
	const double STR = 0.0;

	const double omega = ((LeftLinearVelocity) + (RightLinearVelocity*-1))/2.0;
And so now the tank drives much better too!
Reply With Quote
 


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 19:15.

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