Go to Post Stand up and cheer for yourselves and others. That is FIRST, don't change it. - Steve W [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 22-05-2007, 12:07
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,521
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Has anyone posted their autonomous code from 2007?

Step 1: Drive forward X Feet. (PID loop with wheel encoders).
Step 2: Wait for Camera Lock. (Kevin Watson's camera code modified to only search at a specific tilt - angle for better speed).
Step 3: Based on the PWM value of the tilt servo we used a lookup table to determine how much we needed to drive.
Step 4: Based on the angle of the pan servo we used a PID loop with the kit Gyroscope to turn to the correct angle
Step 5: We drove forward the amount named in Step 3.
Step 6: Release tube and back up.

You will notice we used a counter for timing some of the events - things like backing up, or making sure the robot stopped. We could have used the encoders to do it, but this was this year's quick and dirty. We had started doing it this way when we realize the other way would be more accurate. Next year we'll just check encoder values and potentiometer values instead of time values - it will help save some time.

Some tricks that we used: We knew that each field would be different, and we knew the camera would get knocked around a bit during the competition. To compensate, we added an "offset" value to both the distance and the turn angle that we would determine by actually running the robot.

Prior to them allowing us to calibrate on the field, we used the practice matches to calibrate. If we stopped 5 inches short, we'd add 5 inches to the offset to drive.

We adjusted the turning offset on the practice field by having the robot turn left and checking how far we were off, then turn right.

The key for us to get the camera to sustain a good lock was to shield the servo cables from all power sources, and then get the lock while the robot was stationary.

This was obviously preceded by an enormous amount of work on the robot to adjust gains, work around deadbands, etc to get it to drive the distance we told it and the angle we told it. Our robot couldn't drive less than 1 foot accurately, and couldn't turn less than 2 degrees accurately. Anything over those values and we were within an inch and within about 1/2 a degree of being dead on.

Hopefully this code helps some teams. Please - if you do take ideas from it give us some credit. Our egos are in desperate need of help after not making it to Atlanta
Attached Files
File Type: txt auton.txt (12.0 KB, 104 views)

Last edited by Tom Line : 22-05-2007 at 12:12.
 


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
Has everyone posted their Storyboards? Kevin Thorp 3D Animation and Competition 12 20-02-2007 08:40
Does anyone has code for accelerometer? sjung9442 Programming 2 30-01-2006 21:37
Has anyone recieved their Autodesk package phi.naught Inventor 29 06-12-2005 15:41
Has anyone craked the code yet Jeremy General Forum 2 09-01-2004 14:12
Has anyone else finished their entry? ComBBAT_Albrot 3D Animation and Competition 3 28-02-2002 07:27


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

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