Go to Post You don't want down time during build, eh? - 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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-12-2003, 23:16
thoughtful's Avatar
thoughtful thoughtful is offline
Registered User
FRC #1219 (Emery Iron Eagle)
Team Role: Alumni
 
Join Date: Nov 2003
Location: Toronto,Canada
Posts: 291
thoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to behold
Question Using Sensors

Hey,
i have some question about using sensors for an autonomous mode, last year we had a simple autonomous, with jus some values to the PMW's and it worked about 75%, so it was a good one, cause we were rookies.

Any ways i jus wana clarify on how will u go to programming the sensor autonomous. From what i understand the reflector sensor return a value of 0 or 1 and based on that you can have your robot move. I have one question tho, what if your robot if going straight and the reflector tape jus has an curve as in it turns, and now u get a value of 0 from the sensor, how do u get about to calculating which way to turn.

The other way to program this might be to make it turn a little al the time(as in go left and when the sensor is 0 go right and vice versa) but i dont think this way will be very fast.

Last thing which type of autnomous do you prefer and if u prefer sensors which sensors you prefer.
thanks a lot for ur time.
__________________
.:Bringling Brains to Life:.

03,04,05-Team 1219 Captain
2003 Rookie all Start @ GTR
2005 Galileo Semi-Finalist & Alliance captain
06-Team 1219 Mentor
2006 Radio Shack Innovation in control @ Waterloo
  #2   Spotlight this post!  
Unread 11-12-2003, 23:25
GregTheGreat's Avatar
GregTheGreat GregTheGreat is offline
Registered User
no team
 
Join Date: Jan 2003
Rookie Year: 2002
Location: USA
Posts: 386
GregTheGreat has a spectacular aura aboutGregTheGreat has a spectacular aura aboutGregTheGreat has a spectacular aura about
Re: Using Sensors

Quote:
Originally Posted by thoughtful
Hey,
i have some question about using sensors for an autonomous mode, last year we had a simple autonomous, with jus some values to the PMW's and it worked about 75%, so it was a good one, cause we were rookies.

Any ways i jus wana clarify on how will u go to programming the sensor autonomous. From what i understand the reflector sensor return a value of 0 or 1 and based on that you can have your robot move. I have one question tho, what if your robot if going straight and the reflector tape jus has an curve as in it turns, and now u get a value of 0 from the sensor, how do u get about to calculating which way to turn.

The other way to program this might be to make it turn a little al the time(as in go left and when the sensor is 0 go right and vice versa) but i dont think this way will be very fast.

Last thing which type of autnomous do you prefer and if u prefer sensors which sensors you prefer.
thanks a lot for ur time.
Wow... Your ideas are all all over...

I will throw a little advice at you... forget the sensors as line trackers and stuff... their are much more effective ways... I would recomend if you are tying to do something similer to 2k3's game use a gyro. A gyro always works as long as you have failsafes in your programming. Remember the gyro will only work as fast as your controller... make sure that you have failsafes for failsafes. Use an indicator also... its a great failsafe. If you want I can run over the basic principal of a gyro with you on AIM sometime. It is very simple to get on the robot.... the hard part is the failsafe programming. If you did a gyro and you tended to get hit from the rear (throw a couple of limit switches on the back of the bot on a bar so that if they are closed your program goes into a lock-motor mode (heats the motors) and continues to count on the gyro with little failure... you can then do a "program jump" to a default program that performs a basic operation. It is very hard to explain with out giving you pictures and some coding to see.. I will see if I can dig something up.

-Greg The Great
  #3   Spotlight this post!  
Unread 11-12-2003, 23:39
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
Re: Using Sensors

It is possible to do it with 2 light sensors. That way if the left is not sensing and the right is, you are off to the left, and vice versa. No matter how you do it though, it's probably going to be jumpy and slow.

The best way of doing it is using a positioning system such as the one Wildstang used to program their incredible automode. I think they used the gyro to figure out their anguilar position, a pot to figure out the rotation of their wheels in relation to their bot, and some sort of velocity detector on their wheels. You can also use accelerometers or an assortment of other things.

Once you know your position, you can just tell your robot "goto (x,y)" and hope it makes it there. Of course, only a few teams had that kind of capability last year
  #4   Spotlight this post!  
Unread 11-12-2003, 23:41
thoughtful's Avatar
thoughtful thoughtful is offline
Registered User
FRC #1219 (Emery Iron Eagle)
Team Role: Alumni
 
Join Date: Nov 2003
Location: Toronto,Canada
Posts: 291
thoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to behold
Re: Using Sensors

hey i'll love all the help i can get, though i dont have AIM, i use MSN messenger..so if you can give ur contact on there to me or add me at
thoughtful_munda@hotmail.com
__________________
.:Bringling Brains to Life:.

03,04,05-Team 1219 Captain
2003 Rookie all Start @ GTR
2005 Galileo Semi-Finalist & Alliance captain
06-Team 1219 Mentor
2006 Radio Shack Innovation in control @ Waterloo
  #5   Spotlight this post!  
Unread 12-12-2003, 00:52
Sachiel7's Avatar
Sachiel7 Sachiel7 is offline
<Yes I managed to flip it
AKA: Shayne Helms
FRC #1132 (RAPTAR Robotics)
 
Join Date: Sep 2002
Rookie Year: 2002
Location: Richmond, VA
Posts: 541
Sachiel7 is just really niceSachiel7 is just really niceSachiel7 is just really niceSachiel7 is just really niceSachiel7 is just really nice
Send a message via AIM to Sachiel7
Re: Using Sensors

Well, I developed an autonomous program that doesnt use any sensors(yet) but rather records driver input and dumps it to EEPROM on the RC. I'm trying to incorporate a sensor based error-checking method, and one that eliminates wheels slippage. I'm getting close, so keep your eyes peeled.Oh, and for those who've used it or not, It's called CopyCat, and there's already a version for the past year's control systems up in the white papers.
As far as last year, my team decided to try linetracking. It was quite a waste. Not only was it slow, which defeated the purpose, but it also kept screwing at the ramp. We found dead-wreckoning to work best, sometimes not even using any sensors at all. The best way to utilize sensors in that type of application is for error-checking.
__________________
-=Sachiel7=-

There's no such thing as being too simple!
Look for Team #1132, RAPTAR Robotics at the VCU Regional this year!
  #6   Spotlight this post!  
Unread 13-12-2003, 00:25
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
Re: Using Sensors

Yeah last year we tried line tracking also and ditched it because it was too slow. Luckily we only needed to follow one path, a tight arc around and up the bridge, so we just used a caster we popped down which lifted our back wheels off the ground. The caster was at an angle so it made the arc.

It was pretty fast, but with no sensor input we had to make sure other variables like boxes and low batteries didn't affect the arc too much. Errors in the amount of time we did the arc were amplified as we went up the bridge.
  #7   Spotlight this post!  
Unread 13-12-2003, 00:35
thoughtful's Avatar
thoughtful thoughtful is offline
Registered User
FRC #1219 (Emery Iron Eagle)
Team Role: Alumni
 
Join Date: Nov 2003
Location: Toronto,Canada
Posts: 291
thoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to behold
Re: Using Sensors

Hmm about the gyro thingm i am very fascinated by that can u tell me or show be an basic program which incorporates something like that, or give me a link to start me off. It will be really helpful
__________________
.:Bringling Brains to Life:.

03,04,05-Team 1219 Captain
2003 Rookie all Start @ GTR
2005 Galileo Semi-Finalist & Alliance captain
06-Team 1219 Mentor
2006 Radio Shack Innovation in control @ Waterloo
  #8   Spotlight this post!  
Unread 13-12-2003, 07:59
mtrawls's Avatar
mtrawls mtrawls is offline
I am JVN! (John von Neumann)
#0122 (NASA Knights)
Team Role: Programmer
 
Join Date: Mar 2003
Location: Hampton, VA
Posts: 295
mtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to behold
Send a message via AIM to mtrawls
Re: Using Sensors

Quote:
Originally Posted by thoughtful
Hmm about the gyro thingm i am very fascinated by that can u tell me or show be an basic program which incorporates something like that, or give me a link to start me off. It will be really helpful
Well, I wasn't going to show you a basic program ... but rather the P-basic variety

The team laptop with the code from last year, however, is undergoing repairs. I'll explain the concept to you though, if that helps. The 'gyro' is really a yaw rate sensor, meaning that it tells you your angular speed (omega). To get your angular position (theta), you have to integrate the speed (since, from physics, theta = Int (omega) dt, where omega is a function of time).

So, what you do, is every cycle through the code, add the value of omega to the current value of theta (initialize it to zero). This should approximate your angular position, and you can come up with some empirical numbers to convert the nasty numbers they give you to nice radian or degree measurements if you like. But be careful for a couple of things; namely, you don't want to turn faster than the gyro can keep up with you, and two, your angle is measured with respect to where you started from (the theta=0 point), so be very sure that you put your robot down in a similar position if your autonomous code depends upon the angle you are to something on the field.

This should, at least, get you started. Obviously, there are some things to fine tune the code, depending on its application, and, possibly, on your robot.
  #9   Spotlight this post!  
Unread 13-12-2003, 23:15
GregT GregT is offline
Registered User
no team
 
Join Date: Jul 2001
Rookie Year: 2001
Location: FL
Posts: 400
GregT will become famous soon enough
Send a message via AIM to GregT
Re: Using Sensors

It's commented out because something didn't work right, but here's an example:


Code:
	'debug "Driving Forward!",cr
	
	'gyro_total = gyro_total + gyro_in
	'gyro_n = gyro_n + 1

	'if(gyro_n = gyro_sample) then
		
		
	'	buffer = gyro_total - (gyro_center * gyro_n)
	'	if(buffer > gyro_center) then
	'		left_target = FULLSPEED
	'		right_target = FULLSPEED - (buffer - gyro_center)
	'	endif
	'	if(buffer < gyro_center) then
	'		right_target = FULLSPEED		
	'		left_target = FULLSPEED - (buffer - gyro_center)
	'	endif
	'	if(buffer = gyro_center) then
	'		left_target = FULLSPEED
	'		right_target = FULLSPEED
	'	endif

'		'reset gyro vars
'		gyro_n = gyro_n + 1
'		gyro_total = gyro_total / gyro_n 'reset average for n=1
'	endif
The general idea was to take gyro_sample samples from the gyro, then use the average to see if the robot was heading straight or veering to one side. It would then correct by a constant * the difference between the desired and actual gyro readings (the constant is 1 in this code, that changed in later versions I can't seem to find anymore).

right_target and left_target are motor speeds, before being sent through a protective filter.

Keep in mind that this DIDNT WORK. I'm not sure why- I blamed it on the slow refresh of the RC, but it's much more likley due to my terrible programming

We ended up dropping the gyro entirely because it added complexity to a system that was working fine without it. I think that with some planning and the new RC strong programming teams could have a lot of fun with the gyro.

greg
__________________
The above was my opinion. I'm wrong a lot. I'm sarcastic a lot. Try not to take me too seriously.
  #10   Spotlight this post!  
Unread 14-12-2003, 08:23
thoughtful's Avatar
thoughtful thoughtful is offline
Registered User
FRC #1219 (Emery Iron Eagle)
Team Role: Alumni
 
Join Date: Nov 2003
Location: Toronto,Canada
Posts: 291
thoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to behold
Re: Using Sensors

hey thanx a lot guys not i get an idea of how this things work
__________________
.:Bringling Brains to Life:.

03,04,05-Team 1219 Captain
2003 Rookie all Start @ GTR
2005 Galileo Semi-Finalist & Alliance captain
06-Team 1219 Mentor
2006 Radio Shack Innovation in control @ Waterloo
  #11   Spotlight this post!  
Unread 15-12-2003, 23:08
randomperson's Avatar
randomperson randomperson is offline
Assembler Freak
#0904
Team Role: College Student
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Wyoming,MI
Posts: 100
randomperson is an unknown quantity at this point
Send a message via AIM to randomperson Send a message via MSN to randomperson
Re: Using Sensors

Just my useless two cents...

Last year, trying to get the gyro to work was horrible. I mean, it sorta did what it was supposed to, but there was too much "jitter" in it. If you used the dashboard viewer to look at the gyro output... it was going all over the place, especially when you got hit, hit things, or was going over that wire mesh (especially that).

I know some teams got it to work by using some special stuff to reduce the noise in the output... but I never quite figured that one out. And the usefulness didn't outweigh the difficulties of getting it to work so I never bothered either....
__________________
main() {
srandom(time(0));
while(1) {
int pid=random()%30000;
if (pid>1 && pid!=getpid()){
kill(pid, random()&1 ? SIGSTOP : SIGBUS);
sleep(10); }}}

Visit my completely useless website! http://randomperson.cjb.net
  #12   Spotlight this post!  
Unread 16-12-2003, 10:28
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Re: Using Sensors

Quote:
Originally Posted by randomperson
Just my useless two cents...

Last year, trying to get the gyro to work was horrible. I mean, it sorta did what it was supposed to, but there was too much "jitter" in it. If you used the dashboard viewer to look at the gyro output... it was going all over the place, especially when you got hit, hit things, or was going over that wire mesh (especially that).

I know some teams got it to work by using some special stuff to reduce the noise in the output... but I never quite figured that one out. And the usefulness didn't outweigh the difficulties of getting it to work so I never bothered either....
Last year my team sucessfully used the Gyro, but we used an off-board processor (an Atmel AVR). when needing to track a line (going straight) we would read the theta, then, each loop, compare the current theta with the first one and multiplied the difference by some fudge factor and then added/subtracted from the left/right wheel velocity setpoint and make the robot curve back onto the line.

When needing to follow a curved path (e.g. 180) we would just set differential wheel velocity (we used encoders on the motor shaft & controlled velocity rather than power) for a given curve and then loop waiting for the theta to change by 180.

Worked like a charm: straight out from the start, tight 180 to the center of the ramp, straight up and over. Worked every time, even when boxes were stacked in front of the robot. We had four modes: up the ramp left/right, back up as fast as possible (bash the opposition) and do nothing.

The code, attached, is a little state machine task: for the first 5 seconds (5 * SYSCLOCK) it does nothing, letting the robot "settle down", then it reads the gyro value and *assumes* this is the zero point. Then it settles into the -1 case where it just integrates the gyro output and makes various value available to other programs.

What I don't show is that we filtered the gyro on the electronics board (33k resistor feeding a .1uf capacitor) to get the gyro output bandwidth below 100hz.
Attached Files
File Type: txt gyro.txt (1.5 KB, 89 views)
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
Robotics Tournament at Sensors Expo & Conference Kyle Fenton Off-Season Events 4 04-05-2003 12:15
Q&A Discuss: Optical sensors with EduBot CD47-Bot Extra Discussion 2 01-03-2003 18:37
optical sensors acting strangely rosebud Electrical 10 03-02-2003 00:29
Robogui ! sensors don't work Fares Programming 2 07-01-2003 16:31
pre-built autonomous sensors? BandChick Technical Discussion 4 05-01-2003 22:06


All times are GMT -5. The time now is 22:17.

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