View Full Version : Getting Fancy with Sensors
Hi, we're a rookie team and we're not done autonomous mode, but since we have over 3 weeks until our regional, I'm taking the time to work on autonomous mode. Now, I don't want to go overboard with sensors for autonomous but I want to know what kind of stuff is available at a local Radioshack that may be useful to autonomous. I already picked up a few switches and a potentiometer. I may pick up another potentiometer though. Also, I might pick up a few infrared phototransistors. Are these analog or digial sensors? Any other neat gizmos to pick up? I've got to admit, I love playing around with all these sensors. Hehe, "Captain, sensors are picking up a spatial anomoly! We should shut down the warp drive!!!" lol. :p
ejthe4th
06-03-2004, 00:15
our team is using a whole load of sensors for auton_mode =1. one of the first sensors we used is the banner light sensors. they came standard in the kit, they give off a digital signal.
their wiring schematic is on page 18 of section 5 "The Robot". the Blue wire goes to ground, Brown goes to +12V (from a 20Amp breaker on the fuse bus, it does not connect to the +5V on the robot controller). the black and white wires are the signal wires, one is NC (normally closed) and the other is NO (normally open) there is a schematic on the side of the sensor that helps explain it. you should only need to hook up one of the black or white wires, not both (it's your pick). these sensors can tell the difference between light and dark, it will either "see" a light or it won't, nothing between (good for line following to finding a line)
have you tried using the current sensors that are provided in the kit? we've had quite a bit of "fun" testing these...we wanted to know how many amps the motors could pull, so we put the 'bot agains the wall, i climbed on and we went "full speed ahead", the motors got really hot, the wheels slowly spun, burning 2 tread marks into our school's carpeting, and pulling 40 amps per motor...we only tested this once.
if you need any help with these i'll try and help, just e-mail me
hahaha... I wish I could have seen it. A Robotics dude climbing onto his poor robot and getting ready to hangon for a wild ride but instead recieving some burnout.
KenWittlief
06-03-2004, 10:19
Personally I think the most usefull one you can get is the gyro sensor, it will allowyou to measure if your bot is turning, or how much its turning, or how far its actully turned
I cant imagine doing auton mode without it - most bots, if you turn the motors on, they drift to one side or another, and when you turn its hard to dead recon to a new heading
the gyro resolves all those problems with excellent accuracy
only thing is, its not a simple device to use - but if you have 3 weeks you can get one and play with it on your EDU bot - the best source I found is Avent (electronics distributor) - they had them in stock last time I checked for $50
search on 'gyro' or 'yaw rate' here in CD and you will find several threads on the subject, and how to use them - I think the part number (top of my head) is ADRSX150EB- something like that - its in the other threads.
deltacoder1020
06-03-2004, 13:10
a small note, apparently the banner sensors distributed in this year's KOP do not have the schematic on the side... last year's did.
Astronouth7303
06-03-2004, 20:13
Yes, And this year's aparently have a better range (Ask Biff).
You pulled only 40 amps? We manged to pull 140. :ahh:
Yes, And this year's aparently have a better range (Ask Biff).
You pulled only 40 amps? We manged to pull 140. :ahh:
Also, anyone know where we can get encoders? What kind of stores do we check at. Also, we do we get extra infrared sensors from? The infrared phototransistors have terrible range.
deltacoder1020
06-03-2004, 22:16
Digi-Key sells encoders, you could check with them (chances are Radioshack doesn't have them in stock ;))
We are using an extreme amount of sensors. We have ultra-sonic sensors in the front bumper of our robot to detect distance to the stairs. Then, we have two gyro's to detect X motion as well as Z direction motion. Also, we have light sensor, wheel-encoders to count wheel rotations to sense distance traveled. We have numerous potentiometers and countless limit switches. (over 15). Sensors can be very usefull this year.
Our robot is really fairly light on the sensor side. We have some to prevent damaging certain components, but the only other things that we have are two encoders on the wheels. I wish we had more...
I hope that next year they'll let me use the gyros. They'll be much more fun than counting ticks on a stupid encoder. ;)
Astronouth7303
07-03-2004, 16:16
:Pick up jaw: You have space left for anything? I'm not sure the RC has that many ports on it!
Random Dude
07-03-2004, 17:13
:Pick up jaw: You have space left for anything? I'm not sure the RC has that many ports on it!
Well, they could be using an external micro for the sensor IO. Thats how I'd do it atleast.. collect and process all the data externally, and just ship it back in a nice neat format to the RC.
That way you don't need to waste cycles on the RC integrating the gyros, and counting the encoders, etc...
I hope that next year they'll let me use the gyros. They'll be much more fun than counting ticks on a stupid encoder. ;)
We're having great success with "counting ticks on a stupid encoder".
jacob_dilles
07-03-2004, 17:25
We're having great success with "counting ticks on a stupid encoder".
not only did we have great sucess, but we can control turning, distance and speed down to 1/4", and its shorter, faster, and simpler then writing a gyrp algortiom. 2 intrupts, 2 banner sesors, 2 wheels, 2 variables. lol thats it.
Well, they could be using an external micro for the sensor IO. Thats how I'd do it atleast.. collect and process all the data externally, and just ship it back in a nice neat format to the RC.
That way you don't need to waste cycles on the RC integrating the gyros, and counting the encoders, etc...
for next year im working right now on a pic16F84 in basic (yea i know; shush up) to integrate the gyros (2x) 2 banner sensors (for the wheels) and a compass. it will output the data in rs232 format as (speed)-(direction) every time its polled, and a (time)-(distance) may get built it soon. i might might write a white paper on it if i can pass history :(
edit: once agein, my education is interfering with my schooling
Yeah, it works fine, I just don't like them because of the relative unreliabilty of them. For instance, it's impossible for us to autonomously make it up onto the platform and turn toward the bar because we bounce some. At least with gyros, they don't mess up if a wheel slips or you get hit from the side or something like that.
Anyway, encoders do work. :)
ultramrw21
07-03-2004, 21:35
Our team really hasn't found that much use in a lot of sensors, all we have is a photovoltic at the bottom of the robot. Thats really all we needed.
KenWittlief
07-03-2004, 23:33
Our team really hasn't found that much use in a lot of sensors, all we have is a photovoltic at the bottom of the robot. Thats really all we needed.
how successfull has your auton mode been so far this year? what % of the time are you getting the release ball down, or whatever your primary auton objective is?
velocipenguin
08-03-2004, 02:43
for next year im working right now on a pic16F84...
Might I suggest switching to a PIC 16F628? It has almost the same pinout as the 16F84 and can be programmed with the same hardware, but has a hardware USART, D/A conversion, more I/O lines, and a lot more program memory. For some reason, it's also cheaper.
...in basic (yea i know; shush up) to integrate the gyros (2x) 2 banner sensors (for the wheels) and a compass.
I rather suspect a 16F84 will choke on something that complex. You won't be able to use interrupts to deal with the wheel encoders, because the 16F84 only has one external interrupt line. Are you using digital gyros, or analog ones with a pile of serial ADCs?
ultramrw21
08-03-2004, 18:51
Actuallly, we've been very successful. We have been able to knock off both 10 point balls. The photovoltic sensor reads the white line right in front of the balls. The only obstacle is making sure the drivers that set the robot before a match know the exact angle at which to set it.
jacob_dilles
08-03-2004, 19:09
Might I suggest switching to a PIC 16F628? It has almost the same pinout as the 16F84 and can be programmed with the same hardware, but has a hardware USART, D/A conversion, more I/O lines, and a lot more program memory. For some reason, it's also cheaper.
I rather suspect a 16F84 will choke on something that complex. You won't be able to use interrupts to deal with the wheel encoders, because the 16F84 only has one external interrupt line. Are you using digital gyros, or analog ones with a pile of serial ADCs?
as i have it now, there are 3 protoboards, 2 wirewraps and a white breadboard with 2 pic 16f84's (one intrupts per) and a basic stamp 2. its tearably iniffecent, and can only be polled about twice a second.
i am extrealy eager to learn how to do anything else, but im stuck here with a bunch of mechanic-style guys and a zero tollerence electronics budget. at home i have a MEL "Epic" programer and the Pic Basic Pro software... http://www.melabs.com/ any advice on better pics would be GREAT. 16f628 i will look into tonight. much thanks...
Astronouth7303
09-03-2004, 13:51
You do know that you didn't have to ship the RC with the bot, right? Even if you did, You could still use the EDU. Plus, the EDU doesn't need 10 pounds of stuff to turn on
You do know that you didn't have to ship the RC with the bot, right? Even if you did, You could still use the EDU. Plus, the EDU doesn't need 10 pounds of stuff to turn on
We didn't ship the RC. However, we need a 12V battery to start it. Can we use a car battery just for testing purposes or should we buy a 12V battery for the bot?
Random Dude
09-03-2004, 15:20
We didn't ship the RC. However, we need a 12V battery to start it. Can we use a car battery just for testing purposes or should we buy a 12V battery for the bot?
Any 12v battery will work. Though, I'd be sure to put a fuse on it "Just in case"...
You do know that you didn't have to ship the RC with the bot, right? Even if you did, You could still use the EDU. Plus, the EDU doesn't need 10 pounds of stuff to turn onI knew it, but I wasn't there the day they shipped the robot and it left, carrying the RC with it. At least we were 'done' with our programming... ;)
jacob_dilles
09-03-2004, 16:37
Hi, we're a rookie team and we're not done autonomous mode, but since we have over 3 weeks until our regional, I'm taking the time to work on autonomous mode. Now, I don't want to go overboard with sensors for autonomous but I want to know what kind of stuff is available at a local Radioshack that may be useful to autonomous. I already picked up a few switches and a potentiometer. I may pick up another potentiometer though. Also, I might pick up a few infrared phototransistors. Are these analog or digial sensors? Any other neat gizmos to pick up? I've got to admit, I love playing around with all these sensors. Hehe, "Captain, sensors are picking up a spatial anomoly! We should shut down the warp drive!!!" lol. :p
ALL switches = digital (well not exactly, theres resistor switch chains...)
potentiometer = analouge
phototransistors = digital
*other toys you can get at the shack*
photoresistors / css cells = analouge
opto-couples = digital
current sensors (K.O.P.) = analouge
gyro chip (K.O.P.) = analouge
hall effect sensor = digital
any questions on how any of these work or how to code them feel free to ask me (pm, aim, msn, icq, irc... lol)
Yeah, it works fine, I just don't like them because of the relative unreliabilty of them. For instance, it's impossible for us to autonomously make it up onto the platform and turn toward the bar because we bounce some. At least with gyros, they don't mess up if a wheel slips or you get hit from the side or something like that.
Anyway, encoders do work. :)
We use the ultra-sonic sensors to travel to the stairs, the gyro's to detect when we reach the stairs, and then wheel encoders while we move up the stairs. It takes the un-reliability of the ultra-sonic sensors out when we move up the stairs by using the wheel encoders.
We use the ultra-sonic sensors to travel to the stairs, the gyro's to detect when we reach the stairs, and then wheel encoders while we move up the stairs. It takes the un-reliability of the ultra-sonic sensors out when we move up the stairs by using the wheel encoders.
Well, we've pretty much finalized our autonomous mode setup and we've written up the code. These are the following "sensors" we're using:
2 * Optical Sensors
3 * Infrared Sensors
2 * Potentiometers
4 * Current Sensors
2 * Switch
Now, I've tried to make sure that the autonomous mode code is full proof so that it will work even given the mechanical imperfections of our bot such as drift and motor backdriving. Essentially, it should be plug and play or at least I hope it should. Programming for Windows is one thing but programming for a robot is a completely different animal . Being a rookie team, none of know if anything we do will work. We sent in the bot 95% complete.
I commented for almost every single line of code and I wrote up an "Autonomous Mode Manual" so that I can very quickly figure out problems if any do arise. I've broken down autonomous mode into a 6 stage process with feedback so we would know which stage the robot is executing.
We use the ultra-sonic sensors to travel to the stairs, the gyro's to detect when we reach the stairs, and then wheel encoders while we move up the stairs. It takes the un-reliability of the ultra-sonic sensors out when we move up the stairs by using the wheel encoders.I like it. Can I have your robot? ;)
velocipenguin
10-03-2004, 11:51
i am extrealy eager to learn how to do anything else, but im stuck here with a bunch of mechanic-style guys and a zero tollerence electronics budget. at home i have a MEL "Epic" programer and the Pic Basic Pro software... http://www.melabs.com/ any advice on better pics would be GREAT. 16f628 i will look into tonight. much thanks...
Just so you know, Microchip offers free samples of many of their parts (including microcontrollers) through their web site. It's a great way to get small numbers of PICs for prototyping or experimental purposes.
Just so you know, Microchip offers free samples of many of their parts (including microcontrollers) through their web site. It's a great way to get small numbers of PICs for prototyping or experimental purposes.
Yeah, they mailed me a couple 18F8520 PICmicroŽ microcontrollers from Thailand for free. Haven't had time to play with them yet though.
Astronouth7303
10-03-2004, 15:02
Well, this week ought to be more interesting than VCU, autonomous wise. No offense to 33 or anyone else. It's just when large numbers of teams do nothing...
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.