Go to Post FIRST competitions are a microcosm of real world engineering projects. - KenWittlief [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 26-01-2006, 20:08
Shadow31's Avatar
Shadow31 Shadow31 is offline
The Line Between Insanity & Despair
AKA: ???
FRC #1405 (Falcons Robotics)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Rochester, NY
Posts: 4
Shadow31 is an unknown quantity at this point
Send a message via AIM to Shadow31
Autonomous speed

We're trying to look at autonomous code and we're trying to figure out how much time we need to move the robot to travel 19.5 feet. Does anyone know how fast the autonomous loop executes? How many milliseconds?
  #2   Spotlight this post!  
Unread 26-01-2006, 20:10
Validius's Avatar
Validius Validius is offline
There is a shadow following me.....
AKA: Mark Ratering
FRC #1549 (Washtenuts)
Team Role: College Student
 
Join Date: Feb 2005
Rookie Year: 2005
Location: South Lyon
Posts: 159
Validius will become famous soon enoughValidius will become famous soon enough
Send a message via AIM to Validius
Re: Autonomous speed

Quote:
Originally Posted by Shadow31
We're trying to look at autonomous code and we're trying to figure out how much time we need to move the robot to travel 19.5 feet. Does anyone know how fast the autonomous loop executes? How many milliseconds?
If you look at main.c you will see this code:


if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{ /* I'm slow! I only execute every 26.2ms because */
/* that's how fast the Master uP gives me data. */
Process_Data_From_Master_uP(); /* You edit this in user_routines.c */


if (autonomous_mode) /* DO NOT CHANGE! */
{
User_Autonomous_Code(); /* You edit this in user_routines_fast.c */
}
}
Process_Data_From_Local_IO(); /* You edit this in user_routines_fast.c */
/* I'm fast! I execute during every loop.*/
}

From this one could conclude that it loops every 26.2ms because it is within the slow loop area.
__________________
When a sociaty comes to believe that human life is not inherently worth living, it is a slippery slope to the gas chamber. You wind up on a low road that twists past Columbine and leads toward Auschwitz.

-Peggy Noonan

Last edited by Validius : 26-01-2006 at 20:35.
  #3   Spotlight this post!  
Unread 26-01-2006, 21:55
devicenull devicenull is offline
Robot? We need a robot?
no team
 
Join Date: Sep 2004
Rookie Year: 1234
Location: n/a
Posts: 359
devicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nice
Re: Autonomous speed

While pure timing works, I wouldn't recommend it. You loose accuracy as your battery dies, or your transmissions become easier/harder to work with. The other way to do that would be with encoders, which take a little more to set up, but should be more accurate.
  #4   Spotlight this post!  
Unread 27-01-2006, 10:42
BrianR BrianR is offline
Registered User
AKA: Brian Roehl
FRC #1525 (Warbots)
Team Role: Electrical
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Deerfield, IL
Posts: 79
BrianR has a spectacular aura aboutBrianR has a spectacular aura about
Send a message via AIM to BrianR
Re: Autonomous speed

Quote:
Originally Posted by devicenull
While pure timing works, I wouldn't recommend it. You loose accuracy as your battery dies, or your transmissions become easier/harder to work with. The other way to do that would be with encoders, which take a little more to set up, but should be more accurate.
Another option is to measure your distance based on the camera. If you are already tracking the green light with your camera, it only requires a bit of trig to figure out your distance of travel based off of servo movement.
  #5   Spotlight this post!  
Unread 27-01-2006, 22:28
steveg's Avatar
steveg steveg is offline
Livin' the Dream
AKA: Stephen Guerrera
no team
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Boston, MA
Posts: 70
steveg is a splendid one to beholdsteveg is a splendid one to beholdsteveg is a splendid one to beholdsteveg is a splendid one to beholdsteveg is a splendid one to beholdsteveg is a splendid one to beholdsteveg is a splendid one to beholdsteveg is a splendid one to behold
Send a message via AIM to steveg
Re: Autonomous speed

Quote:
Originally Posted by Validius
If you look at main.c you will see this code:


...

From this one could conclude that it loops every 26.2ms because it is within the slow loop area.
Yeah, but if you look at User_Autonomous_Code() you'll see that it enters a while loop there that loops fast until autonomous mode is over, where is returns back to the slow loop.
  #6   Spotlight this post!  
Unread 27-01-2006, 23:01
zachriggle zachriggle is offline
Registered User
FRC #1940
 
Join Date: Jan 2006
Location: Michigan
Posts: 37
zachriggle is infamous around these parts
Re: Autonomous speed

Do you have any pointers/tutorials/docs on how one would go about doing this? Dead reckoning is the only thing that I can think of, aside from using the accelerometer and an electronic compass (fricken expsensive, $60 :-\... and no, my Team doesn't have external funding).
  #7   Spotlight this post!  
Unread 27-01-2006, 23:22
Goldeye Goldeye is offline
Registered User
AKA: Josh Hecht
FRC #0694 (Stuypulse)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: New York
Posts: 145
Goldeye has a spectacular aura aboutGoldeye has a spectacular aura aboutGoldeye has a spectacular aura about
Send a message via AIM to Goldeye
Re: Autonomous speed

You're provided with an "electronic compass", or rather, a Yaw Rate Gyro. It's part of the sensor strip that has the accelerometer and gear tooth counters attached.
Look around on the forums here for explanations on how to use it.
In combination with encoders (either binary encoders like the provided gear tooth counters or quadrature encoders, which also determine direction), you can determine your position decently.
__________________
Team 694

2005 Championship - Galileo Semifinalist
2005 New York - Regional Chairmans Award
2005 New York - Semifinalist (Thanks 1257,1340)
  #8   Spotlight this post!  
Unread 27-01-2006, 23:43
zachriggle zachriggle is offline
Registered User
FRC #1940
 
Join Date: Jan 2006
Location: Michigan
Posts: 37
zachriggle is infamous around these parts
Re: Autonomous speed

Woah, rewind.

I've been confused as (heck) with everyone talking about ADC's, and various encoders. Please, /please/ explain to me what is mean by all of this. I, by all means, consider myself a very compitent coder (probably too much so). However, I've never dealt with this sort of stuff before (I do systems security in Linux\Windows\*BSD environments).

How would I use this YRG as a compass? Would I have to zero it out at the beginning of every match (so that, on its starting block, it knows that to one side is its side, and on the other side, it must score against)?

What's this 'encoder' stuff everyone speaks of? I'm confused as per the concept, as well as what the HECK a quadrature encoder is.

In addition, where/how do I mount the GTS in order for it to count gears? I don't understand how they're supposed to work, so I can't make much use of them. The guy-in-charge-of-the-operation is too busy just trying to get the launcher mechanism finished and on the chassis to explain this stuff to me (Pretty soon, we might just end up with a very expensive RC Car).
  #9   Spotlight this post!  
Unread 28-01-2006, 00:10
Donut Donut is offline
The Arizona Mentor
AKA: Andrew
FRC #2662 (RoboKrew)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Goodyear, AZ
Posts: 1,313
Donut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond repute
Re: Autonomous speed

First, for all teams thinking of traveling distances based purely on dead reckoning from timing, I would recommend against it. My team has not been able to get distance sensors working either year and has tried this both years; it is inaccurate, varies by battery voltage and other factors, and takes alot of testing and tweaking to get it somewhat close to right.

The gear tooth sensors this year were deisgned so they could be mounted directly into the transmissions provided in the kit (there are pictures in the Guidlines and Tips section that show where the sensors should be mounted). Wiring diagrams and instructions are also available. If you do not use the provided transmissions, you will have to find your own way of mounting the gear tooth sensors and putting them close enough to a gear to read it. The sensors basically sense when a gear tooth is in their magnetic field, and this information can be used to find distance traveled. Using timers, you can also develop ways to find speed.
  #10   Spotlight this post!  
Unread 30-01-2006, 01:25
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
Re: Autonomous speed

Just another point of view. We tried driving our robot in autonomous w/o sensor data and it is fairly impossible. Sending a signal to your victors for a particular speed doesn't mean your robot will go the same speed every time. As mentioned before, battery voltage and drive train variances will effect the outcome every time making prediction and accuracy hit or miss. Turning only makes the error worse.

As you are a competent programmer I would recommend acquiring Kevin Watsons code (if you aren't using EasyC) which can be used quickly to get your kit sensors working. Explore these forums some more for various descriptions on what encoders are. Very simply though, encoders is a generic term for a sensor that can count (people feel free to correct me if I'm wrong!). There are few different ways to do this. Optical encoders use a beam of light, usually infrared, that when broken generates a signal (think garage door opener safty device). You can imagine that if reflective strips are placed at periodic intervals on a wheel and an optical encoder is focused at the wheel while it is spinning, an on/off signal will be generated that is proportional to the speed of the wheel. Depending on the application, this can be used as a way determine distance travelled. I believe the KOP this year has such encoders.

A simple mechanical encoder would be a momentary switch device that would signal when activated (think pegs on a wheel depressing a switch).

Now we have the KOP gear tooth counter which is an electromagnetic encoder that works on the Hall Effect which is why it also known as the Hall Effect sensor. It simply generates a signal when its surrounding magnetic field is disrupted which is why it works as a gear tooth counter. The caveat is that since it is based on magnetics, whatever it is counting needs to be ferrous. It just needs to be mounted in close proximity to the meshing face of the gears (1-2mm). As mentioned before, if you are using the KOP transmissions, they already have pre-drilled holes to mount the sensor on the face plate where the motors are mounted. The Tips sheet shows the picture. Just make sure the TAPERED part of the holes are facing OUT not IN, or it wont align properly. Also make sure that nylon washers are used to mount the gear tooth sensors or you'll short it out.

Encoders are a simple way of getting distance travelled. Not perfect, but ok. You loose accuracy due to slippage and missed counts, but this is the way to implement dead reckoning. Timing in this scenario isn't really dead reckoning because you don't know what speed your going or what direction.

Now for a quick yaw rate gyro explanation. Again, Kevin Watson has code for gyros (how he does all this I'll never know). As the name implies, yaw rate gyros send a signal proportional to how fast it is turning. In our case, since 5 volts is the base line, 2.5 volts means no turning, >2.5 means one way, <2.5 means the other way. Kevin's code handles all the initialization and timing and integration and junk that makes it useful. Or you can use easyC which has the code built into the WPlib library. Either way the work has already been done.

Soooo if you get the gear tooth counter installed you can get distance. If you get the gyro installed you can get direction. I think I've rambled on long enough. I hope I was some help and didn't confuse anyone.
  #11   Spotlight this post!  
Unread 30-01-2006, 14:45
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 487
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: Autonomous speed

Last year, my team's autonomous mode was written at the very last minute, used only time, and worked reliably. However, we didn't try to drive anyplace.

Our arm was controlled by a pneumatic ram attached to a solenoid that had three positions: 1)In, 2)Out, and 3)All ports blocked. We would turn it to "out", wait a second or so, then set it to "all ports blocked". Since we would always start with the same pressure no matter how much power we had in our battery, it was consistent in how far it traveled and would knock off a tetra from one of the corner goals.
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
A Warning to Human Players During Autonomous The Lucas General Forum 21 07-04-2005 02:29
Autonomous loop speed BillyJ Programming 6 08-03-2005 14:10
PID control loops - closed loop feedback KenWittlief Technical Discussion 56 26-04-2004 21:27
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11


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

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