Go to Post Without compromise, engineering would be boring. - Mike Betts [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 06-03-2009, 20:48
dboisvert dboisvert is offline
Registered User
AKA: Dan Boisvert
FRC #2405 (Divided by Zero)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Michigan
Posts: 57
dboisvert is an unknown quantity at this point
Traction Control in Autonomous?

I was wondering how you could integrate Traction Control while you are in autonomous mode.

What Traction Control requires is a constantly updating loop. The way we drive in autonomous is "Turn Motor On" "Wait a few seconds" "Turn motor off"

During those few seconds of waiting does the traction control variables update?

If they dont any ideas?
Reply With Quote
  #2   Spotlight this post!  
Unread 07-03-2009, 00:11
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,050
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: Traction Control in Autonomous?

Something that we've been doing quite successfully is something to this effect:

Code:
double start = GetTime();

while (IsAutonomous())
{
	double time_elapsed = GetTime() - start;

	if (time_elaped < 0.5)
	{
		// time period of 0-0.5 seconds
		speed = .25;
		angle = some_N;
		rotation = some_N;
	}
	else if (time_elapsed < 1)
	{
		// time period of 0.5 to 1 seconds
		speed = .5;
		angle = some_N;
		rotation = some_N;
	}

	// ... and so on until 15 seconds
	
	myDrive.Drive( speed, rotation );
}
Doing it this way allows you to manually say what speed you want it to go at any given point, and as long as you ramp it up slowly you should be good. Clearly having real traction control would be better, but this works well enough for us and gets us out of the reach of the human player.

As a bonus, we use the gyro to get the angle of the robot, and some things that can set the rotation parameter of our bot based on our current angle relative to the field so we can say "point the nose in this direction". Of course we have swerve/crab drive the so rotation stuff is a bit easier to implement since we can specify a heading and a rotation value.
__________________
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
Reply With Quote
  #3   Spotlight this post!  
Unread 07-03-2009, 01:08
brianelite brianelite is offline
Registered User
FRC #2898
 
Join Date: Feb 2009
Location: oregon
Posts: 36
brianelite has a spectacular aura aboutbrianelite has a spectacular aura aboutbrianelite has a spectacular aura about
Re: Traction Control in Autonomous?

We are using a simple ramp to drive in autonomous, of course we are only driving forward and spinning so that simplifies things a bit....
Reply With Quote
  #4   Spotlight this post!  
Unread 07-03-2009, 07:39
ComradeNikolai ComradeNikolai is offline
Registered User
AKA: Nicholas
FRC #2603 (Team Hornet)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Medina, Ohio
Posts: 203
ComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to behold
Re: Traction Control in Autonomous?

How is your code set up for traction control? You may very well be able to take the teleop traction control, put it into a function, and call it separately from both autonomous and teleop.

If you would like an example of code that achieves this, I'd be more than willing to send it to you to analyze. Or, if you sent me your code, I could look over it and give more specific details on how to implement it.

Other than that, if you ramp up to speed, it will work -- traction control is more ideal, but it's not bad.
__________________
I cut myself shaving with Occam's razor.

Reply With Quote
  #5   Spotlight this post!  
Unread 07-03-2009, 11:11
dboisvert dboisvert is offline
Registered User
AKA: Dan Boisvert
FRC #2405 (Divided by Zero)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Michigan
Posts: 57
dboisvert is an unknown quantity at this point
Re: Traction Control in Autonomous?

The traction control is setup using 2 encoders on each side of the bot.

It grabs the data from each encoder then stores it into a variable. If it detects the bots wheels are moving to fast (slipping) then is slows the motor speed down.

It detects slippage like this encoder1 stores variable new / Makes one loop / new becomes old / encoder stores new / compare new to old.

So basically it detects slippage and its suprisingly very accurate & works great for pushing people.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Traction Control- Help!!!! naruto137 NI LabVIEW 0 21-02-2009 13:21
Traction Control Poll Zorkinian Programming 5 13-02-2009 11:06
Implementation of Traction Control keehun Programming 5 10-02-2009 10:02
PID traction Control dpeterson3 C/C++ 5 26-01-2009 21:11
Traction Control Algorithm Mr. Lim Programming 3 20-01-2004 14:26


All times are GMT -5. The time now is 13:55.

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