Go to Post Don't fight bureaucratic morons... embrace them! Humour and publicity will take care of the rest. - 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
  #2   Spotlight this post!  
Unread 13-02-2004, 11:03
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Robot Drifting

Quote:
Originally Posted by AsimC
Our team is having trouble with our robot drifting to the right while driving straight. We feel that is because one drill motor is running in reverse. I know there is a way to compensate for in in the programming but im not really sure how to do it. Would the Current Sensors help in programming the motors? Any suggestions or examples of code would be very helpful to us. Thanks alot.
The easiest way to do this is to have to enocders on the dirve wheels. FIgure out using those how much faster the one motor is turning than the other. From that figure out how much of a reduction in PWMs you need to make them balance and store that value in a #define. Use the define as an addition/subtraction to what you would normally be putting out on the fast side. If the difference between the motors ever changes, just change the #define value, recompile, and download.

Here is a quick example:
Code:
// Somewhere t the top of the file. Comp is short for compensation
// This is the amount of difference in PWMs that makes the motors approzimatly even
#define COMP_SPEED 15
 
 
// In some function that use the motors.
// Go forward. pwm02 is on the slow side
pwm01 = 255;
pwm02 = 255 - COMP_SPEED;
 
// At some later point in the function.
// Go in reverse.
pwm01 = 0;
pwm02 = 0 + COMP_SPEED; // The 0 isn't nessecary, it's just there to illustrate the point
That isn't the optimal solution, of course. The best idea is to have your program monitoring the enocoders and if it sees one side going faster than the other when it shouldn't be, it autonomatically corrects. But, that is more complicated and you should be able to get away with the first solution.
__________________


Last edited by Ryan M. : 13-02-2004 at 11:05.
 


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
Controlling a FIRST robot with a Lego RCX Controller? archiver 2001 5 24-06-2002 04:19
NEW robot club archiver 2001 0 24-06-2002 03:15
Are you willing to let others take picture of your robot? Ken Leung Robot Showcase 21 10-04-2002 22:50
Kamikaze Robot Strategy... Joe Johnson Rules/Strategy 30 07-04-2002 21:42
Calling all Lawyers... ...Define "all parts" Joe Johnson General Forum 10 13-03-2002 15:12


All times are GMT -5. The time now is 00:02.

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