Go to Post From what I've seen in FIRST, teams that copy generally always learn something from it, and if they don't, the copy they produce is of much lower quality than the original. - TheOtherGuy [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

 
Reply
Thread Tools Rate Thread Display Modes
  #61   Spotlight this post!  
Unread 28-12-2011, 15:35
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,097
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: WCD vs. Swerve

Quote:
Originally Posted by JamesTerm View Post
Oh and each vector is divided by 4.
Just to be clear: There is a divide-by-4 (which divides all 4 terms) in the original equations I posted:

Quote:
omega = ((sFR*cos(atan2(W,L)+pi/2-aFR)+sFL*cos(atan2(-W,L)+pi/2-aFL)
+sRL*cos(atan2(-W,-L)+pi/2-aRL)+sRR*cos(atan2(W,-L)+pi/2-aRR))/4)/
(sqrt(L^2+W^2)/2);

Reply With Quote
  #62   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
  #63   Spotlight this post!  
Unread 30-12-2011, 12:37
Siri's Avatar
Siri Siri is offline
Dare greatly
AKA: 1640 coach 2010-2014
FRC #2641 (PCCR; Refs & RIs)
Team Role: Coach
 
Join Date: Jan 2008
Rookie Year: 2007
Location: PA
Posts: 1,634
Siri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond repute
Send a message via ICQ to Siri
Re: WCD vs. Swerve

Quote:
Originally Posted by JamesTerm View Post
I have a question for you... (or anyone else that can answer)... Does your robot work in a way where you can submit desired angles to each wheel independently? (I presume that is what the *independent* means in your statement).
Technologically, yes. We do not have inputs on the Driver's Station that can literally say, "right-front at 40deg", "left-rear at 60deg", etc, but in theory we have both the hardware and the programming input & feedback to move any wheel at any angle and speed (limited by motors/gearboxes) we'd like. Really we just steer in "modes", e.g. crab, snake, and some useful spins (who's radius we can control).

Quote:
Originally Posted by JamesTerm View Post
If so, how do you sense when the rotation has reached its angle? potentiometer? IIRC Bomb Squad uses windows motors on each wheel to control the swerve. From what I have heard, other teams use a rod to swerve both front wheels the same amount, and can then have a manual control setup doing it this way.
Our swerve rotation is controlled by Banebot RS-540's on 256:1 4-stage planetary gearboxes, one per module. (We used window motors last year.) We use Vishay encoders (981HE0B4WA1F16) which we can hand-adjust every once in a while as needed. This works quite well (way better than the Cherry AN8's), though the PID isn't perfect yet and the backlash is especially obvious in autonomous.

More: Team 1640's LogoMotion Drive Train
__________________

Last edited by Siri : 30-12-2011 at 12:41. Reason: fixed the link
Reply With Quote
  #64   Spotlight this post!  
Unread 30-12-2011, 14:06
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 Siri View Post
Thanks very much for this link... I hope our team will be brave enough to try something like this for off-season.

It seems like that swerve-drive teams are of a rare breed.
Reply With Quote
  #65   Spotlight this post!  
Unread 30-12-2011, 18:22
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,097
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: WCD vs. Swerve


Quote:
Originally Posted by JamesTerm View Post
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
Interesting simulation, and a potentially useful teaching tool.

Couple of questions:

1) why did you restrict steering to 270 degrees

2) it would be helpful if you would add some sort of indicator on each wheel to show which direction it is spinning*.


* yes, I see the red and green. these indicate which is the forward and reverse direction for the wheel, not which way the wheel is actually spinning at the moment.


Reply With Quote
  #66   Spotlight this post!  
Unread 30-12-2011, 19:33
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


Couple of questions:

1) why did you restrict steering to 270 degrees

2) it would be helpful if you would add some sort of indicator on each wheel to show which direction it is spinning*.

[/i]
I did the 270 to handle using potentiometers at 1:1 ratio. I can easily remove this but Id want to understand what reliable sensor could allow free movement.

As for direction of the wheels there are treads " <-- that rotate where height is portraited by white on top and gradient to dark grey on bottom. Unfortunately the wmv quality makes this difficult to see... I should put the mp4 of this on you tube at some point.
Reply With Quote
  #67   Spotlight this post!  
Unread 30-12-2011, 19:41
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,097
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: WCD vs. Swerve


Quote:
Originally Posted by JamesTerm View Post
Id want to understand what reliable sensor could allow free movement.
See the comment about Vishay encoders here:

http://www.chiefdelphi.com/forums/sh...9&postcount=63

others here:

http://www.chiefdelphi.com/forums/sh...75&postcount=3


Reply With Quote
  #68   Spotlight this post!  
Unread 30-12-2011, 23:18
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 Siri View Post
Really we just steer in "modes", e.g. crab, snake, and some useful spins (who's radius we can control).
I just finished watching a video we shot of our 8th match at the championship... we played defense against your red alliance. It is neat to see this swerve robot in action it was able to out maneuver our attempts to block. The only weakness was when switching from forward to strafe delayed the robot enough for the tank drive (perpendicular) to be able to catch up, but then a rotating maneuver put an end to that.

Who knows... maybe in 2012 we'll be on the same alliance.
Reply With Quote
  #69   Spotlight this post!  
Unread 30-12-2011, 23:22
Andrew Lawrence
 
Posts: n/a
Re: WCD vs. Swerve

Quote:
Originally Posted by JamesTerm View Post
Who knows... maybe in 2012 we'll be on the same alliance.
And that's what I love about FIRST.
Reply With Quote
  #70   Spotlight this post!  
Unread 31-12-2011, 11:26
Siri's Avatar
Siri Siri is offline
Dare greatly
AKA: 1640 coach 2010-2014
FRC #2641 (PCCR; Refs & RIs)
Team Role: Coach
 
Join Date: Jan 2008
Rookie Year: 2007
Location: PA
Posts: 1,634
Siri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond repute
Send a message via ICQ to Siri
Re: WCD vs. Swerve

Quote:
Originally Posted by JamesTerm View Post
I just finished watching a video we shot of our 8th match at the championship... we played defense against your red alliance. It is neat to see this swerve robot in action it was able to out maneuver our attempts to block. The only weakness was when switching from forward to strafe delayed the robot enough for the tank drive (perpendicular) to be able to catch up, but then a rotating maneuver put an end to that.

Who knows... maybe in 2012 we'll be on the same alliance.
Yes, this drove me crazy from the driver's station all season. (Especially when the defense is so unrelenting!) We've been working on it for over a year now. I don't think it's inherent, but it's at least been stubborn. We're hoping to beat it this season. We'll see how it works when we play with each other at Champs!
__________________
Reply With Quote
  #71   Spotlight this post!  
Unread 31-12-2011, 12:43
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 Siri View Post
Yes, this drove me crazy from the driver's station all season. (Especially when the defense is so unrelenting!)
I've been thinking... it makes no sense to talk about the video without sharing it... so here it is:

www.termstech.com/files/WCDvsSwerve.wmv

I apologize on the low framerate... I REALLY need to find a free way to share high quality media (The original is AVCHD 1080i)... I'll look into this soon.

Check out towards the last 15 seconds when we attempt to block you for minibot deployment... cool stuff.
Reply With Quote
  #72   Spotlight this post!  
Unread 31-12-2011, 12:46
Chris is me's Avatar
Chris is me Chris is me is offline
no bag, vex only, final destination
AKA: Pinecone
FRC #0228 (GUS Robotics); FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Glastonbury, CT
Posts: 7,718
Chris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond repute
Send a message via AIM to Chris is me
Re: WCD vs. Swerve

Quote:
Originally Posted by Siri View Post
Yes, this drove me crazy from the driver's station all season. (Especially when the defense is so unrelenting!) We've been working on it for over a year now. I don't think it's inherent, but it's at least been stubborn. We're hoping to beat it this season. We'll see how it works when we play with each other at Champs!
Try instantaneously reversing direction as you switch to strafe and start turning the wheels. That way, instead of arcing into the defender, or waiting for the wheels to finish spinning before moving, you arc backwards and give yourself a bit of space.
__________________
Mentor / Drive Coach: 228 (2016-?)
...2016 Waterbury SFs (with 3314, 3719), RIDE #2 Seed / Winners (with 1058, 6153), Carver QFs (with 503, 359, 4607)
Mentor / Consultant Person: 2170 (2017-?)
---
College Mentor: 2791 (2010-2015)
...2015 TVR Motorola Quality, FLR GM Industrial Design
...2014 FLR Motorola Quality / SFs (with 341, 4930)
...2013 BAE Motorola Quality, WPI Regional #1 Seed / Delphi Excellence in Engineering / Finalists (with 20, 3182)
...2012 BAE Imagery / Finalists (with 1519, 885), CT Xerox Creativity / SFs (with 2168, 118)
Student: 1714 (2009) - 2009 Minnesota 10,000 Lakes Regional Winners (with 2826, 2470)
2791 Build Season Photo Gallery - Look here for mechanism photos My Robotics Blog (Updated April 11 2014)
Reply With Quote
  #73   Spotlight this post!  
Unread 31-12-2011, 14:18
Siri's Avatar
Siri Siri is offline
Dare greatly
AKA: 1640 coach 2010-2014
FRC #2641 (PCCR; Refs & RIs)
Team Role: Coach
 
Join Date: Jan 2008
Rookie Year: 2007
Location: PA
Posts: 1,634
Siri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond reputeSiri has a reputation beyond repute
Send a message via ICQ to Siri
Re: WCD vs. Swerve

Quote:
Originally Posted by Chris is me View Post
Try instantaneously reversing direction as you switch to strafe and start turning the wheels. That way, instead of arcing into the defender, or waiting for the wheels to finish spinning before moving, you arc backwards and give yourself a bit of space.
That's really interesting, thanks. We'll work back through the driver movements. I'm told at least part of the pause is in the code, but paying attention to inertia never hurts.

James: Thanks, I was hoping you had the video to share. We don't have any championship video. Could I try to find a way to get the higher resolution version?
__________________
Reply With Quote
  #74   Spotlight this post!  
Unread 31-12-2011, 14:27
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: WCD vs. Swerve

Just wondering, is there such thing as an "East Coast Drive"?
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
Reply With Quote
  #75   Spotlight this post!  
Unread 31-12-2011, 16:45
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 Siri View Post
That's really interesting, thanks. We'll work back through the driver movements. I'm told at least part of the pause is in the code, but paying attention to inertia never hurts.
Pause in the code? I think I may throw an idea to you that can help with that! First let me show you my code snip of what I do here:

Code:
void Swerve_Robot::InterpolateThrusterChanges(Vec2D &LocalForce,double &Torque,double dTime_s)
{
	//Now the new UpdateVelocities was just called... work with these intended velocities
	for (size_t i=0;i<4;i++)
	{
		const double IntendedDirection=GetIntendedVelocitiesFromIndex(i+4);
		double SwivelDirection=IntendedDirection;  //this is either the intended direction or the reverse of it
		const Ship_1D &Swivel=m_DrivingModule[i]->GetSwivel();
		const double LastSwivelDirection=Swivel.GetPos_m();
		double DistanceToIntendedSwivel=LastSwivelDirection-SwivelDirection;
		NormalizeRotation(DistanceToIntendedSwivel);
		DistanceToIntendedSwivel=fabs(DistanceToIntendedSwivel);

		if ((DistanceToIntendedSwivel>PI_2) || (SwivelDirection>Swivel.GetMaxRange()) || (SwivelDirection<Swivel.GetMinRange()) )
		{
			SwivelDirection+=PI;
			NormalizeRotation(SwivelDirection);
			double TestIntendedFlipped=IntendedDirection+PI;
			NormalizeRotation(TestIntendedFlipped);

			//If we flipped because of a huge delta check that the reverse position is in range... and flip it back if it exceed the range
			if ((SwivelDirection>Swivel.GetMaxRange()) || (SwivelDirection<Swivel.GetMinRange()) ||
				(TestIntendedFlipped>Swivel.GetMaxRange()) || (TestIntendedFlipped<Swivel.GetMinRange()))
			{
				SwivelDirection+=PI;
				NormalizeRotation(SwivelDirection);
			}
		}
		//Note the velocity is checked once before the time change here, and once after for the current
		//Only apply swivel adjustments if we have significant movement (this matters in targeting tests)
		if ((fabs(LocalForce[0])>1.5)||(fabs(LocalForce[1])>1.5)||(fabs(m_DrivingModule[i]->GetDrive().GetPhysics().GetVelocity()) > 0.05))
			m_DrivingModule[i]->SetIntendedSwivelDirection(SwivelDirection);
		const double IntendedSpeed=GetIntendedVelocitiesFromIndex(i);

		//To minimize error only apply the Y component amount to the velocity
		//The less the difference between the current and actual swivel direction the greater the full amount can be applied
		double VelocityToUse=cos(DistanceToIntendedSwivel)*IntendedSpeed;

		m_DrivingModule[i]->SetIntendedDriveVelocity(VelocityToUse);
		m_DrivingModule[i]->TimeChange(dTime_s);

		const double CurrentVelocity=m_DrivingModule[i]->GetDrive().GetPhysics().GetVelocity();
		const double CurrentSwivelDirection=Swivel.GetPos_m();
		//if (i==0)
		//	DOUT4("S= %f %f V= %f %f",CurrentSwivelDirection,SwivelDirection,CurrentVelocity,VelocityToUse);

		//Now to grab and update the actual swerve velocities
		//Note: using GetIntendedVelocities() is a lesser stress for debug purposes
		#if 1
		m_Swerve_Robot_Velocities.Velocity.AsArray[i+4]=CurrentSwivelDirection;
		m_Swerve_Robot_Velocities.Velocity.AsArray[i]=CurrentVelocity;
		#else
		m_Swerve_Robot_Velocities=GetIntendedVelocities();
		#endif
	}

	__super::InterpolateThrusterChanges(LocalForce,Torque,dTime_s);
}
Check out this line in particular:

Code:
		//To minimize error only apply the Y component amount to the velocity
		//The less the difference between the current and actual swivel direction the greater the full amount can be applied
		double VelocityToUse=cos(DistanceToIntendedSwivel)*IntendedSpeed;
Let me explain this line here... Imagine if you will the one scene where you where strafing us and then want to move folward... Let's assume for the sake of arguement the driver was pushing staight forard (this will help visualize the solution)... During each frame that transitions the angle from 90 to 0 degrees (where 0 is forward)... ANY Y component of the vector will be executed with a tradeoff of minimal error. In this case the robot would slightly arc on the X component to give you the most Y you can have during the transition. It should be also noted that it also will determine the correct + or - direction of the wheels as well (no branching Yay!). I hope this makes sense... In my demo when I strafe and rotate at the same time... the key for this success is this line of code where every opportunity to fulfill the x component of the vector will happen.


Quote:
Originally Posted by Siri View Post
James: Thanks, I was hoping you had the video to share. We don't have any championship video. Could I try to find a way to get the higher resolution version?
I will talk with my friend Jeremy tonight about this. I did resubmit the wmv file with a lower 320x240 and found that framerate is much better, so if you have the 640x480... go back to the link and try it again... It looks good on a phone too.

I'll keep you posted... I WILL get this to you somehow!
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 23:37.

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