Go to Post Life can be painfully short and you never know how things could change in an instant. It never hurts to say thank you. - Karthik [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-03-2007, 02:58
JimGRobot JimGRobot is offline
Registered User
AKA: Jim
FRC #1388 (Eagle Robotics)
Team Role: Mentor
 
Join Date: Nov 2006
Rookie Year: 2005
Location: Arroyo Grande, CA
Posts: 29
JimGRobot is just really niceJimGRobot is just really niceJimGRobot is just really niceJimGRobot is just really nice
Simple dead-reckoning autonomous

This message is a little late, and I suspect there are other similar posts, I just couldn't find them...

Anyway, I have watched hundreds of competition videos, and participated in 2 regionals, and I was very surprised at how few robots attempted any sort of autonomous operations. I have to admit that when I first looked at Rack 'n' Roll autonomous, I thought that anything other than scoring had no value in the game.

However, after watching a lot of games, I came to the conclusion that even just driving forward and blocking the path between the rack and the wall could delay the opposing alliance enough to get some extra scoring done before they start pushing your alliance robots around.

What I hope to do with this post is give some teams a little push, and some helpful information to get going with a simple autonomous program.

The first step is calculating the wheel RPMs needed to achieve the desired distance and turn. I have attached an Excel spreadsheet that tries to help with this. It is not 100% accurate, but I think close enough, but I haven't tested these numbers on an actual robot.

The next step is measuring the wheel RPM. I picked up a LASER tachometer on eBay for about $30, and it does a great job of mesuring wheel speeds. Here is where I got mine, you might find others: (eBay is acting up right now and I can't provide a link, but here is a good search string "digital laser photo tach os".

The third step is adding some sequencing code to your robot program. If you're using EasyC is should be easy to output a value to the motors, wait a little bit, then turn them off. If you're using MPLAB, I have attached a short C file that can be #included in the user_routines_fast.c file, right above the User_Autonomous() function. Inside of this function, call Autonmous_Tick() where it says "put your code here".

This file implements a simple state machine for sequencing through some steps that output to PWMs, or anything else you want. It is a simple version that can be used in a number of applications.

I hope this all makes sense, and that it helps get some teams to try autonomous operations, even this late in the game.

Good luck.
Attached Files
File Type: xls WheelSpeedCalculator.xls (19.5 KB, 80 views)
File Type: c AutoDropIn-Calibrate.c (3.8 KB, 89 views)
  #2   Spotlight this post!  
Unread 30-03-2007, 03:25
theycallhimtom theycallhimtom is offline
Registered User
AKA: Tom Conerly
FRC #1540 (The Flaming Chickens)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Lake Oswego, Oregon
Posts: 52
theycallhimtom has a spectacular aura abouttheycallhimtom has a spectacular aura abouttheycallhimtom has a spectacular aura about
Send a message via AIM to theycallhimtom Send a message via MSN to theycallhimtom
Re: Simple dead-reckoning autonomous

Good post. I think that many teams could put just a little work into a simple autonomous mode and get some benefit. As he said something as simple as driving forward and blocking an area can be helpful.

There is one thing I would like to point out. From my experience calculating RPMs has not worked. In theory it should work, but it doesn't. For simply going straight there is still the issue of getting up to speed and slowing back down. Attempting to calculate the desired motor values to any reasonable degree of accuracy is impossible. Turning creates even more significant error. There really is no good way to calculate how far the robot should go based on motor values from the code.

The easiest way to go forward some distance or rotate some angle (without sensors, encoders or a gyro would make it a lot easier) is just trial and error. Try driving forward for 2 seconds, if that is too far then try 1.5 seconds and keep on narrowing it down until your happy with it. An example would be:

Code:
void autonomousFunction(void){
    static int timer = 0;//Note: this function is called ~38 times a second
                              //So divide timer by 38 to get time in seconds
    if(timer < 38*2){ //go forward for 2 seconds change this depending on how 
                           // far the robot goes
        LEFTMOTOR=RIGHTMOTOR=255;
    }else{
        LEFTMOTOR=RIGHTMOTOR=127;
    }
    timer++;
}
There is a small bonus for autonomous even with dead reckoning. You can get closer to the rack, get to the far side of the field to play defense, or block someone with a scoring autonomous. Heck even using dead reckoning to score works occasionally, and it is a lot easier than working with the camera.
__________________
rankmaniac
2007 San Diego Motorola Quality Award
2007 Pacific Northwest Chairmans Award
2007 Pacific Northwest Finalist (2nd Seeded Team)
  #3   Spotlight this post!  
Unread 30-03-2007, 04:07
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: Simple dead-reckoning autonomous

Don't know if it's related to dead-reckoning atuonomous, but our autonomous went like this:

Code:
if(ARM_LEVEL < CHUTE LEVEL)
    pwm03=240;;
else
    pwm03=127;
And we used by putting our robot in front of the chute and it really helped because our arm took time to rise or lower itself so it saved us time in the teleoperated mode.
  #4   Spotlight this post!  
Unread 30-03-2007, 14:58
BenThompson BenThompson is offline
Registered User
FRC #0237 (Sie-H20-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2007
Location: Watertown, CT
Posts: 18
BenThompson is on a distinguished road
Send a message via AIM to BenThompson
Re: Simple dead-reckoning autonomous

I agree that more teams should try to get autonomous into their bots. Even if it's nothing complex, you can still use it to get ready for the teleoperated period. Also, on the issue of how far the bot goes, I think a trial and error type thing works best, like Tom said. For the actual autonomous code, I find that a simple counter works best:

Code:
int autonomous_counter = 0;

void User_Autonomous_Code(void) {

...

autonomous_counter++;
if(autonomous_counter < value) {
	do_something;
}
else if(autonomous_counter < second_value) {
	do_something_else;
}
And basically just increment the counter each loop and check what its value is. For teams who don't know, the processor loops every 26.2 ms, or approximately 38 times per second.

Just wanted to add my two cents into this. If more teams added even simple autonomous programs that prepared them for teleloperated period, then autonomous would be a lot more interesting to watch.
  #5   Spotlight this post!  
Unread 30-03-2007, 15:06
popnbrown's Avatar
popnbrown popnbrown is offline
FIRST 5125 HOTH Lead Mentor
AKA: Sravan S
FRC #5125 (Hawks on the Horizon)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Illinois
Posts: 367
popnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond repute
Re: Simple dead-reckoning autonomous

right now to save our operator some time, we have our arm opening up moving up, and our claw do the same thing. Really pissed that the camera didint work I was excited at first about it.
  #6   Spotlight this post!  
Unread 30-03-2007, 16:57
bcieslak
 
Posts: n/a
Re: Simple dead-reckoning autonomous

Team 1675 just updated their autonomous programming tool - AutoFlex2..no more messy cables and dangling laptops.

With a couple mods to your code, you basically push a record button on your OI then drive for 15 seconds. Whatever you recorded is what your robot will do during the autonomous mode. The input commands are stored in the RC's internal EEPROM.

Just go to the practice field, hit the record button, drive up to the rack and score the goal. Now its in memory. Make sure you start from the same position out on the playing field.

Its quick and easy. It takes about 15 minute to integerate into your code and learn to use.

We have modified a version of the default code you can use as an example for modifying your code along with some documentation.
Drop us an email at K9WIS@yahoo.com or stop buy our pit in Atalnta we'll have you up and runnning in no time.

Brian
Team 1675

PS it also works with VEX...
  #7   Spotlight this post!  
Unread 30-03-2007, 20:05
Teched3 Teched3 is offline
Hodge1
FRC #0175 (BuzzRobotics)
Team Role: Mentor
 
Join Date: Apr 2006
Rookie Year: 1996
Location: Connecticut
Posts: 319
Teched3 has much to be proud ofTeched3 has much to be proud ofTeched3 has much to be proud ofTeched3 has much to be proud ofTeched3 has much to be proud ofTeched3 has much to be proud ofTeched3 has much to be proud ofTeched3 has much to be proud ofTeched3 has much to be proud of
Smile Re: Simple dead-reckoning autonomous

Just to help a little in undersanding why so many robots may look as if they are not doing autonomous, I offer the following information:

When the camera is scanning for the light, and can't find it, our robot is programmed to stay put. In my opinion, many of the teams are trying hard to get autonomous to work, and could easily program dead reckoning. However, that's not the challenge - getting the camera to work in guiding the robot to a score is. Winning isn't necessarily related to who scores the most points. Hopefully camera calibration on the playing field will help to make this work. It's how we learn to get better. As an aside, I cannot understand how FIRST expects us to go through our practice matches on thursday without calibration opportunity and a chance to try it out, and then compete on Friday in Qualification matches on Friday on a calibration setting that hasn't been tried on the field.



Quote:
Originally Posted by JimGRobot View Post
This message is a little late, and I suspect there are other similar posts, I just couldn't find them...

Anyway, I have watched hundreds of competition videos, and participated in 2 regionals, and I was very surprised at how few robots attempted any sort of autonomous operations. I have to admit that when I first looked at Rack 'n' Roll autonomous, I thought that anything other than scoring had no value in the game.

However, after watching a lot of games, I came to the conclusion that even just driving forward and blocking the path between the rack and the wall could delay the opposing alliance enough to get some extra scoring done before they start pushing your alliance robots around.

What I hope to do with this post is give some teams a little push, and some helpful information to get going with a simple autonomous program.

The first step is calculating the wheel RPMs needed to achieve the desired distance and turn. I have attached an Excel spreadsheet that tries to help with this. It is not 100% accurate, but I think close enough, but I haven't tested these numbers on an actual robot.

The next step is measuring the wheel RPM. I picked up a LASER tachometer on eBay for about $30, and it does a great job of mesuring wheel speeds. Here is where I got mine, you might find others: (eBay is acting up right now and I can't provide a link, but here is a good search string "digital laser photo tach os".

The third step is adding some sequencing code to your robot program. If you're using EasyC is should be easy to output a value to the motors, wait a little bit, then turn them off. If you're using MPLAB, I have attached a short C file that can be #included in the user_routines_fast.c file, right above the User_Autonomous() function. Inside of this function, call Autonmous_Tick() where it says "put your code here".

This file implements a simple state machine for sequencing through some steps that output to PWMs, or anything else you want. It is a simple version that can be used in a number of applications.

I hope this all makes sense, and that it helps get some teams to try autonomous operations, even this late in the game.

Good luck.
  #8   Spotlight this post!  
Unread 30-03-2007, 22:31
Kims Robot's Avatar Unsung FIRST Hero
Kims Robot Kims Robot is offline
Onto a New Chapter...
AKA: Kim O'Toole Eckhardt
no team
 
Join Date: Aug 2004
Rookie Year: 1996
Location: Framingham, MA
Posts: 1,467
Kims Robot has a reputation beyond reputeKims Robot has a reputation beyond reputeKims Robot has a reputation beyond reputeKims Robot has a reputation beyond reputeKims Robot has a reputation beyond reputeKims Robot has a reputation beyond reputeKims Robot has a reputation beyond reputeKims Robot has a reputation beyond reputeKims Robot has a reputation beyond reputeKims Robot has a reputation beyond reputeKims Robot has a reputation beyond repute
Send a message via AIM to Kims Robot
Re: Simple dead-reckoning autonomous

Quote:
Originally Posted by popnbrown View Post
right now to save our operator some time, we have our arm opening up moving up, and our claw do the same thing. Really pissed that the camera didn't work I was excited at first about it.
Not sure what you mean about "the camera didnt work". Several teams in Boston got their cameras to somewhat work (if only they would have turned off all the LED banners!! ugh!). When the rack was properly rotated, we had our camera working, just never had quite enough time testing to get it working perfectly.

To be honest, Im not sure why more teams didnt just try dead reckoning autonomous... with a consistant autonomous, even if you dont make it on all the time, there isnt much to loose... you get closer to the rack and closer to keeping your opponents from your side of the field.
__________________
~kim~
Kimberly O'Toole Eckhardt <3
Principal Systems Engineer & Program Manager
History - Team 176, Team 229, Team 1511, FIRST Volunteer!!
My new FIRST Photography Hobby & Angry Eric's Fan Page
Excellence - is the result of caring more than others think is wise, risking more than others think is safe, dreaming more than others think is practical, and expecting more than others think is possible.
  #9   Spotlight this post!  
Unread 30-03-2007, 23:06
gburlison gburlison is offline
Mentor
FRC #0662 (Rocky Mountain Robotics)
Team Role: Mentor
 
Join Date: Sep 2002
Rookie Year: 2000
Location: Colorado Springs, CO
Posts: 245
gburlison is a name known to allgburlison is a name known to allgburlison is a name known to allgburlison is a name known to allgburlison is a name known to allgburlison is a name known to all
Re: Simple dead-reckoning autonomous

Quote:
Originally Posted by Teched3 View Post
Just to help a little in undersanding why so many robots may look as if they are not doing autonomous, I offer the following information:

When the camera is scanning for the light, and can't find it, our robot is programmed to stay put. In my opinion, many of the teams are trying hard to get autonomous to work, and could easily program dead reckoning. However, that's not the challenge - getting the camera to work in guiding the robot to a score is. Winning isn't necessarily related to who scores the most points. Hopefully camera calibration on the playing field will help to make this work. It's how we learn to get better. As an aside, I cannot understand how FIRST expects us to go through our practice matches on thursday without calibration opportunity and a chance to try it out, and then compete on Friday in Qualification matches on Friday on a calibration setting that hasn't been tried on the field.
I agree completely, even after calibration, our camera has a lot of problems finding the lights on the field. Prior to shipping, we almost had autonomous working. Our problems were more mechanical than programming because we were having problems overstressing the gearbox. So here we are at the Colorado Regional and even after calibration, most of the time our camera just scans and it never finds the light. So our robot just sits there scanning until the 15 seconds is over.
__________________
Gordon Burlison - Mentor
662/Rocky Mountain Robotics
"Every silver lining's got a Touch of grey - Robert Hunter"
"No sense in being pessimistic, it wouldn't work anyway"
  #10   Spotlight this post!  
Unread 31-03-2007, 20:18
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Simple dead-reckoning autonomous

We would have done something at WMR, but a simple "d'oh!" bug with auton selection, which screwed up driving, scared off the mechanical mentors (which outnumber the EE/CS mentor 5:1) from even entertaining the idea.

Fortunately, after losing the semifinals I spent some time fixing it, so I can now add a arbitrary dead recon in little time.

For example, I find that WildStang's autonomous is getting in the way. And they consistently hang on the left/right side. We see we're playing against them in the next match. So I can write an auton to crash into them, and maybe even drop a keeper in front of them. (Warning to 111: If it wasn't for that bug, this may have been a true story.)

OT: How is it scored if two keepers are dropped on the same leg?
  #11   Spotlight this post!  
Unread 31-03-2007, 21:16
theycallhimtom theycallhimtom is offline
Registered User
AKA: Tom Conerly
FRC #1540 (The Flaming Chickens)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Lake Oswego, Oregon
Posts: 52
theycallhimtom has a spectacular aura abouttheycallhimtom has a spectacular aura abouttheycallhimtom has a spectacular aura about
Send a message via AIM to theycallhimtom Send a message via MSN to theycallhimtom
Re: Simple dead-reckoning autonomous

Quote:
<G13> KEEPER advantage - KEEPERS that have been SCORED can not be covered by another GAME PIECE and can not be negated by a SPOILER. Any GAME PIECE placed in a HANGING position on the same SPIDER LEG after a KEEPER (including another KEEPER) will be ignored when determining the match score. In all other aspects, KEEPERS are treated the same as RINGERS.
So whoever places the keeper first gets the points.
__________________
rankmaniac
2007 San Diego Motorola Quality Award
2007 Pacific Northwest Chairmans Award
2007 Pacific Northwest Finalist (2nd Seeded Team)
  #12   Spotlight this post!  
Unread 03-04-2007, 13:47
ericand's Avatar
ericand ericand is offline
Registered User
AKA: Eric Anderson
FRC #3765 (Terrabots)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: St. Paul, MN
Posts: 148
ericand is a jewel in the roughericand is a jewel in the roughericand is a jewel in the rough
Re: Simple dead-reckoning autonomous

I was impressed that some teams in Las Vegas had non-scoring auto modes. I think it is cool that teams take what they can do and make the best of it.

One team I saw had a defensive blocking auto mode, where it drove all the way around the rack and crossed in front of the opponent's home zone (attempthing to disrupt an auto mode score there. Another team which we had trouble with (in auto-mode) would repeatedly bump the rack (causing the spider legs to sway, making scoring difficult).
  #13   Spotlight this post!  
Unread 03-04-2007, 15:38
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,554
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: Simple dead-reckoning autonomous

I have to wonder. How many teams complaining that their camera was having trouble finding the light were trying to:

1. Find the light from the starting position.
2. Find the light while moving.

We noticed early on that tracking the light while the robot was moving at a decent speed, or even finding the light from the starting position was generally problematic.

We solved it by driving up to about 6 feet away then stopping and getting a single fix from the camera. We forced the camera to only search across 1 tilt level and had it on a vastly increase pan-speed.

That single fix gave us both the amount we needed to turn, and the distance we had to travel to score.

Early on, we actually did it in two steps - we turned first then got our second fix to get the distance. It was slightly more accurate (1-2 inches) than geting the distance then turning - but we need to speed it up to avoid the defense in West Michigan.
  #14   Spotlight this post!  
Unread 03-04-2007, 15:42
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,554
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: Simple dead-reckoning autonomous

I have to wonder. How many teams complaining that their camera was having trouble finding the light were trying to:

1. Find the light from the starting position.
2. Find the light while moving.

We noticed early on that tracking the light while the robot was moving at a decent speed, or even finding the light from the starting position was generally problematic.

We solved it by driving up to about 6 feet away then stopping and getting a single fix from the camera. We forced the camera to only search across 1 tilt level and had it on a modified pan-speed with a lower confidence interval.

That single fix gave us both the amount we needed to turn, and the distance we had to travel to score.

At first, we decided to get the turn angle, turn, then get the distance to drive. However, we would occasionally lose our camera lock during the turn so we went to do both at the same time.
  #15   Spotlight this post!  
Unread 16-05-2007, 21:16
Benedictine1 Benedictine1 is offline
Robo Nazzi
AKA: Adria Hogan
FRC #1033 (Holy Rollers)
Team Role: Coach
 
Join Date: May 2002
Rookie Year: 2003
Location: Richmond, VA
Posts: 4
Benedictine1 is an unknown quantity at this point
Re: Simple dead-reckoning autonomous

could we get that "teach/run" code from you? I am the team coach, so I might ask some questions about implementing it, but I think it could really help!
Thanks
Closed Thread


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
Autonomous: CMUCam or dead reckoning? Andrew Blair Rules/Strategy 18 26-02-2005 19:36
dead reckoning st28 Programming 1 24-02-2004 11:34
Dead Reckoning Ryan Cumings Programming 3 24-02-2004 10:57
A DEAD reckoning program rcubes85 Programming 5 19-03-2003 14:21
Probably already covered, but curious, Dead-reckoning or no? Dave Technical Discussion 3 11-01-2003 01:14


All times are GMT -5. The time now is 01:20.

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