Go to Post It sounds like "whirr" if you do it right, and "clack clack grunge snap @$@%^!!" if you don't. - dtengineering [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 27-01-2009, 17:40
ellisk ellisk is offline
Registered User
FRC #1540
 
Join Date: Dec 2008
Location: Vancouver, WA
Posts: 41
ellisk is on a distinguished road
Re: Using encoders for traction control help

Hi, thanks for the suggestions. Here's what I'm currently using, and it seems to work better than my other algorithms, but still very poorly (worse than no correction at all ).

Here is the algorithm:
Code:
// transVel: the velocity according to the wheels (transmission)
// omniVel: the velocity of the robot (off the omni wheels)
// realWheel: the PWM value currently being sent to the wheel (not currently used)
// desiredWheel: the PWM value the joystick says the wheel should be
// maxSpeed: the maximum velocity of the robot
float correctForSlip(float transVel, float omniVel, float realWheel, float desiredWheel, float maxSpeed)
{
	// make sure that there's enough of a difference
	const float slipThreshold = 30.0;
	if (fabs(transVel - omniVel) < slipThreshold)
		return desiredWheel;

       // We are slipping.
	
	// calculate what speed we are saying we should go at
	// This should be whatever the omni wheels say
	float correctSpeed = omniVel / maxSpeed;

        // at this point, we can return correctSpeed
        // however, this makes it really jerky, so we this following instead:
	// Average them, to still give the drivers some control
	return (desiredWheel + correctSpeed) / 2.0;
}
In short, it sees if it's slipping, and if so, it converts the velocity of the robot into a PWM value (float correctSpeed = omniVel / maxSpeed; ) and then averages that with the desired PWM value according to the joystick.

So, the step I'm stuck on is the "Limit commanded_speed based on maximum acceleration to prevent slipping" step from Abwehr's algorithm. Does anyone know of any better ways of limiting the commanded speed?

Thanks,
-Kevin
 


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
Implementing Traction Control for an advantage in the 2009 game DonRotolo Programming 143 27-02-2009 11:53
Help for Better Understanding of Shaft Encoders Xufer Programming 2 08-01-2007 23:14
Autonomous using encoders Mr.G Programming 11 17-01-2006 03:34
Using Shaft Encoders D.Viddy Programming 7 14-12-2004 18:27
Traction Control Algorithm Mr. Lim Programming 3 20-01-2004 14:26


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

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