View Single Post
  #10   Spotlight this post!  
Unread 17-02-2012, 10:56
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Smile Re: Help! RobotDrive Error in all 3 languages

Quote:
Originally Posted by DavidGitz View Post

I suspect that you have one or more of the following problems: a) You still have binding issues in your drive-train b) Bad weight distribution on your wheels c) Not all wheels contacting the ground.
I would add d) drive motors (like CIMS) do not run at the same speeds forwards vs backwards for the same absolute value of PWM request. So many robots have a tendency to have a drift to one side. (lots of threads about that out there in SEARCH-land I bet) Adding a small constant bias solves many of the effects of a + b + c + d.

I'm hacking this in pretty fast, but it should get you going ...
Code:
#define SIDE_BIAS 0.1   // TBD from experimentation
#define NEUTRAL_DEADBAND 0.17  // maybe less - experiment
.
.
. 
		while (IsOperatorControl())
		{
                       float yStick = stick.GetY();    //as opposed to stick->GetY(); ....not sure
                       float xStick = stick.GetX();

                       if( (yStick > -NEUTRAL_DEADBAND) && 
                           (yStick < NEUTRAL_DEADBAND )   )
                       { // in the Y deadband ... spin only so no bias to spin
                           yStick = 0. ;  
                       }
                       else // translating fwd/rev add the bias to the spin axis
                       {
                           xStick += SIDE_BIAS ; // set sign correctly, here
                           xStick = (xStick > -1.) ? xStick : -1. ; // keep in range
                           xStick = (xStick < 1.) ? xStick :  1. ;
                       }
              
			//myRobot.ArcadeDrive(stick); // drive with arcade style 

                        // using squared inputs has a smoothing effect on handling
                        myRobot.ArcadeDrive(yStick,xStick,true) ; 

			Wait(0.005); // wait for a motor update time
		}
...something like that....

For better drift compensation, try a yaw rate sensor as feedback to a proportional control of the SIDE_BIAS value

Thanks,
Eric

PS JAG firmware upgrade instructions:

http://www.usfirst.org/sites/default...ructions02.pdf
__________________

Don't PANIC!
S. P. A. M.

Last edited by EricS-Team180 : 17-02-2012 at 11:04.