Go to Post Someone want to channel their inner Mark Leon and do the math? - Billfred [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
  #1   Spotlight this post!  
Unread 11-02-2008, 22:36
Lynx34's Avatar
Lynx34 Lynx34 is offline
SEVENTEEN...!
FRC #1716 (Redbird Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Ashwaubenon, WI
Posts: 12
Lynx34 is on a distinguished road
Attempting to Drive Straight with Gear Tooth Sensors and Gyroscope

Team 1716 is attempting for the first year to use feedback (specifically gear tooth sensors and a gyroscope) in order to drive perfectly straight (for either hybrid mode or when the joysticks are in close proximity in teleoperated, assuming that the driverwants to go straight).

We are using easyC and have tried using a proportional adjustment set in a loop to alter the motor outputs in a tank drive setup. Specifically, when the joysticks are within 5 values of each other, the the "drivestraight" subroutine is activated. At this time the gear tooth sensors start counting. The following code is a sample of the algorithm.

if (gt_left > gt_right) // compares the gear tooth sensors
{
left_motor = 127 + ((left_joystick - 127) / (gt_left / gt_right));
right_motor = right_joystick;
}
else if (gt_right > gt_left)
{
right_motor = 127 + ((right_joystick - 127) / (gt_right / gt_left));
left_motor = left_joystick;
}

In this subroutine, the gear tooth sensors are re-zeroed every half second. Our current result is a large arcing curve to the right (though sometimes when we've changed the code its consistently to the left) when going forward, but a nearly perfect straight drive when going in reverse.

Of course, our worst case scenario is to simply switch poles on our joysticks and drive backwards, but with the way we're distributing weight, we'd rather not.

We've done some reading on PID loops as a solution to such a problem, and as far as we can tell, we have the "P" part down, but cannot quite comprehend the I or D sections as to what they do or how to implement them.

We also have a gyroscope mounted that we tried to include but with little success. If it helps anyone help us, it is mounted and fully operational, so it can be used.

We appreciate any help given to us. Also, we apologize for using easyC.
 


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
Help with the Kit Gear Tooth sensors Keo-san Programming 9 20-02-2007 08:07
Gryo, Camera, Accelorometer, Ultrasonic, and Gear Tooth Sensors in one program EHaskins Programming 8 22-05-2006 12:08
where can we buy hall effect sensors or gear tooth sensors amirjpl Electrical 3 13-02-2006 11:02
Gear Tooth Sensors et1337 Electrical 7 28-01-2006 22:48
Accelerometer vs Gear Tooth Sensors zdeswarte Electrical 4 22-01-2005 15:35


All times are GMT -5. The time now is 23:49.

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