Society of Robots - Robot Forum

General Misc => Misc => Topic started by: Admin on March 02, 2007, 08:31:41 PM

Title: The $50 Robot, Part 3 is up!
Post by: Admin on March 02, 2007, 08:31:41 PM
Took me forever, but here it is:
http://www.societyofrobots.com/step_by_step_robot_step3A.shtml

Its three full pages of yummy robot brain goodness . . .

Im still having various issues getting the thing to work properly, but today I got it to rotate a servo with some crude code. The LED on my circuit board isnt working, not sure if my code is wrong, or I fried something when I accidently reversed power and ground on the board (oops :P). Havent fully debugged this yet . . . just trying to get it all up before I go on my big trip!

Still working on the programming part . . . having issues working around all the bugs in the software (such as AVR Studio). I also havent made the sensors yet, so I will add on to Step 3C when I do.

If anyone finds mistakes when making the robot, message me ASAP so I can fix it!
Title: Re: The $50 Robot, Part 3 is up!
Post by: ed1380 on March 02, 2007, 09:41:54 PM
Looks great. I would never be able to do something like that without detailed instructions. Luckily we have you. keep up the great work
Title: Re: The $50 Robot, Part 3 is up!
Post by: SomeSaba on March 02, 2007, 10:19:15 PM
WoW! Part 3 is amazing, ive been to hundred of websites, this is so clear and helpful. I've been planning my circuit for my sumbot for a few weeks now, and you jsut made my day, everything is so clear!

Thank you so much!
Title: Re: The $50 Robot, Part 3 is up!
Post by: Sam_Charette on March 02, 2007, 10:37:49 PM
Definitely nice!  It's already helped me to understand more about the microcontrollers.  'Course, the part about using a resistor to keep the LED from frying would have been more useful to me a couple of days ago :D
Title: Re: The $50 Robot, Part 3 is up!
Post by: trigger on March 02, 2007, 11:07:35 PM
Very good job.  *Applause*  Thanks for finishing this up before heading out on your trip! 

Some notes from an EE guy (not to criticize your great work :D - really these are minor points, and as always, feel free to correct me if I'm wrong  ;D):

1. You might as well leave the 7805 out because it's not doing much. You've got 4.8 nominal volts (actually about 5.2) going into a standard regulator with a 2 volt dropout voltage in the middle of its current range. What that means is that you need at least 7 volts input at all times for this thing to output a fairly steady 5. Actually, a better solution is to use an LM2940 or the like, which is a low-dropout voltage regulator (LDO). It has an input-output differential of about .3 volts at 500 mA current draw. Even still, 4 AA NiMHs won't cut it--you need 5 (or 6, because there aren't any 5 AA cases  :P). The AVR will probably still work with the 4AAs, but with servos running it's risky. Plus the ADC will be noisy due to the unregulated voltage. Oh, btw, if you use an LM2940, you should have a cap (>22uF) on the output as well as the input because it's more sensitive.

2. As for the prototype board, I'm using this one for a very similar circuit right now:
http://www.radioshack.com/product/index.jsp?productId=2102845&cp=&sr=1&origkw=breadboard&kw=breadboard&parentPage=search
The nice thing about this one is that it has two buses down the middle and conductive strips that cut down soldering work. For example, stick your atmega in the middle and then two rows of female headers on either side, and there's much less soldering to do. And I think this board is the same size or close to the one you're using.
Title: Re: The $50 Robot, Part 3 is up!
Post by: Admin on March 02, 2007, 11:33:08 PM
doh! yet another mistake I made :-\
I tested it with 6V, thinking its fine, and thinking that 1.2V*4=6V . . . blaaaaah. Perhaps people will have to either use a 6V RC pack, or a 9V battery to power the microcontroller with the 4 cells powering the servos . . .

Writing this tutorial has been such an educational experience for me . . .

For my particular circuit, that prototyping board would not have saved time as the bus is in the wrong spot :-\
Title: Re: The $50 Robot, Part 3 is up!
Post by: trigger on March 02, 2007, 11:52:22 PM
doh! yet another mistake I made :-\
I tested it with 6V, thinking its fine, and thinking that 1.2V*4=6V . . . blaaaaah. Perhaps people will have to either use a 6V RC pack, or a 9V battery to power the microcontroller with the 4 cells powering the servos . . .

Writing this tutorial has been such an educational experience for me . . .

For my particular circuit, that prototyping board would not have saved time as the bus is in the wrong spot :-\

Well, as I said, I can't criticize your work. You obviously put a lot of effort into this, and it's going to help a lot of people. You gave me some ideas too. :) I hope I can be helpful in some small way without sounding rude (because I certainly do not mean to be). 

If you use an LDO, you won't have to use two different supplies. Here's what you do--if you have 6 AAs (7.2 volts nominal), you can feed that into an LM2940 for mcu power and connect a couple power diodes (e.g., 1N4001) in series between the unregulated voltage and your servos. That drops the voltage to around 6 volts (depending on temperature and current draw of course), allows your servos to pull more current quickly (which the LM2940 will not be so good at), and gives some back-emf protection for your power supply.
Title: Re: The $50 Robot, Part 3 is up!
Post by: Admin on March 03, 2007, 12:03:33 AM
you (and everyone else) has my full permission to fully criticize my work to the fullest :P
I only want the best and most correct info on SoR . . .
Title: Re: The $50 Robot, Part 3 is up!
Post by: trigger on March 03, 2007, 12:06:59 AM
you (and everyone else) has my full permission to fully criticize my work to the fullest :P
I only want the best and most correct info on SoR . . .

Well, one thing's for sure. You won't hear me ever say a peep about mechanical stuff. I had to build a case once for my senior project. I shudder at the memories. Can you say, "measure once, cut twice?"  ;)
Title: Re: The $50 Robot, Part 3 is up!
Post by: ed1380 on March 03, 2007, 12:24:22 AM
So pretty much any one of these will work? http://www.digikey.com/scripts/DkSearch/dksus.dll?Criteria?Ref=883&Site=US&Cat=33424294
Title: Re: The $50 Robot, Part 3 is up!
Post by: Hal9000 on March 03, 2007, 06:45:18 AM
Even though it's bleedin' obvious (or is it?)......

What is happening with the servos with remotre control you put in on the 2nd part of the series?

Are these now removed from the equation?

Title: Re: The $50 Robot, Part 3 is up!
Post by: Somchaya on March 03, 2007, 09:53:42 AM
Great job on part 3!

Just a comment: on part 3b, where you show the soldering.. it wasn't 100% clear to me how the soldering on the back went, i.e which pin to which pin. You might want to edit the picture so bright lines are overlayed on the soldering so that it's clearer?
Title: Re: The $50 Robot, Part 3 is up!
Post by: ed1380 on March 03, 2007, 10:53:38 AM
Did you click on the pictures?
Title: Re: The $50 Robot, Part 3 is up!
Post by: Admin on March 03, 2007, 10:56:49 AM
Quote
So pretty much any one of these will work? http://www.digikey.com/scripts/DkSearch/dksus.dll?Criteria?Ref=883&Site=US&Cat=33424294
not really, cause the pinouts would be different, and the programming would be different . . . i had to pick a microcontroller that has free programming software, has a good share of analog and digital pins, was popular and has a lot of source code available, didnt have too many pins to make soldering a pain, has a cheap programmer, and was ultra cheap itself - a hard task!

Quote
Even though it's bleedin' obvious (or is it?)......

What is happening with the servos with remotre control you put in on the 2nd part of the series?

Are these now removed from the equation?
the servos stay, the remote control goes, the batteries section I need to fix . . . i always make my robots remote control first so that i can test out the mechanical systems before building the electrical systems.

Quote
it wasn't 100% clear to me how the soldering on the back went, i.e which pin to which pin. You might want to edit the picture so bright lines are overlayed on the soldering so that it's clearer?
If you reference the schematic, you dont even need the pictures to make the board. Click on the pictures for a full res close-up with overlayed colored lines :P
Title: Re: The $50 Robot, Part 3 is up!
Post by: Sam_Charette on March 03, 2007, 11:45:44 AM

Click on the pictures for a full res close-up with overlayed colored lines


Now that is REALLY nice!
Title: Re: The $50 Robot, Part 3 is up!
Post by: ed1380 on March 03, 2007, 03:27:31 PM
I'm lost now. Can you link to the exact one you picked?
Title: Re: The $50 Robot, Part 3 is up!
Post by: Admin on March 03, 2007, 03:35:06 PM
Ok I made some changes in a few places to account for my battery mistake. I now designed it so people can take two directions: a 6V+ battery pack (easy), or 4.8V batteries with holder and 9V battery (more complicated but cheaper).

I also added a way to recharge your batteries on the cheap.

Hopefully I didnt make it too confusing with all the options . . .

I will be adding more to Step 3C as I run more tests in the programming step.

Quote
I'm lost now. Can you link to the exact one you picked?
About half of the soldering images have close-ups. For example:
http://www.societyofrobots.com/images/sbs_connect5_large.JPG
Title: Re: The $50 Robot, Part 3 is up!
Post by: trigger on March 03, 2007, 04:16:04 PM
Ok I made some changes in a few places to account for my battery mistake. I now designed it so people can take two directions: a 6V+ battery pack (easy), or 4.8V batteries with holder and 9V battery (more complicated but cheaper).

It looks really good.
Title: Re: The $50 Robot, Part 3 is up!
Post by: ed1380 on March 03, 2007, 04:49:19 PM
Quote
Quote
So pretty much any one of these will work? http://www.digikey.com/scripts/DkSearch/dksus.dll?Criteria?Ref=883&Site=US&Cat=33424294

not really, cause the pinouts would be different, and the programming would be different . . . i had to pick a microcontroller that has free programming software, has a good share of analog and digital pins, was popular and has a lot of source code available, didnt have too many pins to make soldering a pain, has a cheap programmer, and was ultra cheap itself - a hard task!
Can you link to the exact controller that you bought, because there are many variations of it on digikey
Title: Re: The $50 Robot, Part 3 is up!
Post by: Admin on March 03, 2007, 05:13:28 PM
The reason I haven't listed parts yet officially is that I want to finish the project first and verify everything works. Better the mistake come out of only my wallet and time and not everyone elses :P

The microcontroller Im using is:
ATmega8-16PC
listed as digikey part # ATMEGA8-16PC-ND
Title: Re: The $50 Robot, Part 3 is up!
Post by: Brandon121233 on March 03, 2007, 07:20:18 PM
I enjoy the humor
Quote
I'm willing to bet a 3 year old can understand this enough to build the circuit . . . (apologies to all 3 year olds reading this tutorial)
that kept me laughing for a minute or two
Title: Re: The $50 Robot, Part 3 is up!
Post by: Karodo on March 06, 2007, 11:53:46 AM
This tut is just great.  I can't tell you how happy it makes me to see how it's progressing.  Very entertaining, very informative, and great documentation.  Thank you so much.
Title: Re: The $50 Robot, Part 3 is up!
Post by: Admin on March 06, 2007, 09:42:15 PM
Ok, I finally finished part 3 of the tutorial. I added the sensor assembly part, and put it all onto the robot:
http://www.societyofrobots.com/step_by_step_robot_step3C.shtml

I also did a major upgrade to the photoresistor tutorial to go with The $50 Robot:
http://www.societyofrobots.com/schematics_photoresistor.shtml


As for programming, still working on that part . . . been running into tons of issues and still working out the bugs . . .
Title: Re: The $50 Robot, Part 3 is up!
Post by: JesseWelling on March 07, 2007, 01:32:02 AM
Hey admin, if you every want to run a RTOS on an AVR I can show you what i've done with the AVRLib and FreeRTOS.org .
But you would need an atmega64 or better. Right now my finished AVR project sits at 35k with -Os compiling with a very basic reflex AI that also takes commands as a I2C slave, but the RTOS kernel can fit into about 19k, so you might beable to work with a atmeaga32, if you don't need all the comunication stuff I have built in. I've also been working on that server project which runs in conjunction with this on Linux (still testing). I'd have to modify it to talk to a normal PC over serial instead of i2c to make it usefull to most people though, or people could just get a uart<->i2c bridge from philips, but I havn't look at that very well....
Title: Re: The $50 Robot, Part 3 is up!
Post by: Admin on March 07, 2007, 06:56:51 AM
well, my robot fish uses an atmega644 and i plan to do tons of uart stuff on it including bootloading

im not entirely sure why i want an RTOS (you are speaking to a mechanical engineer, remember? :P). what advantages would i have with it?

since im leaving this weekend for my 6 week trip i wont have time to really look into it until late April . . .
Title: Re: The $50 Robot, Part 3 is up!
Post by: polar bear6 on March 07, 2007, 03:39:17 PM

since im leaving this weekend for my 6 week trip i wont have time to really look into it until late April . . .

if you are leaving for 6 weeks, who are going to take care of all us SoR n00bs? ??? ??? :'( :'(
Title: Re: The $50 Robot, Part 3 is up!
Post by: Admin on March 07, 2007, 04:10:52 PM
the collective  :P

Actually i was hoping jonhylands, jessewelling, and dunk could handle the majority of it. These are the guys I go to when I have questions :P

Ill log in weekly to make sure all is well.

In three or four years you 'n00bs' will be an army of robot experts :D
(phase 2 of my build robots to take over the world plan)
Title: Re: The $50 Robot, Part 3 is up!
Post by: dunk on March 07, 2007, 05:39:32 PM
and you aren't worried we won't have the world all nicely taken over for ourselves before you get back?
verrry trusting of you Admin.
o, can i borrow the keys to your Secret World Domination Base while you are gone?

dunk.
Title: Re: The $50 Robot, Part 3 is up!
Post by: polar bear6 on March 08, 2007, 12:57:18 PM
too late, he dropped them by at my house this morning.
i mean, he flew with his private jet to norway and gave them to me.
the world of robotics and world domination isnt for slowpokes...
Title: Re: The $50 Robot, Part 3 is up!
Post by: Admin on March 10, 2007, 09:48:06 PM
so its done:
http://www.societyofrobots.com/step_by_step_robot.shtml

i had some trouble with part 4 with the $10 programmer so im not entirely happy with the tutorial. but im leaving on my trip tomorrow morning so i wont be able to improve it till late april . . . :-\

enjoy!
Title: Re: The $50 Robot, Part 3 is up!
Post by: Sam_Charette on March 10, 2007, 11:21:12 PM
Even with your difficulties, I think you did a great job.  It's a great tutorial all around :)

The only thing I'll say, as pedantic as it is, is that IDE is Integrated Develoment Environtment, not Developer's.

(it's sad that I noticed that, isn't it? ;) )
Title: Re: The $50 Robot, Part 3 is up!
Post by: ed1380 on March 11, 2007, 08:11:51 PM
It seams all 4 parts are done. True?