PDA

View Full Version : using computers for robots



Carter05
08-25-2008, 12:48 PM
I'm currently doing robotics with regular microcontrollers specifically the atmega 640. Would it be a huge jump for me to migrate over to using a full computer for my robot brains? I already know C and some C#. From the little reading I've done seems to be rather intimidating. How do you go about controlling a robot with a computer? Are there any quick start tutorials or any websites that would get me started in the right direction? Thanks!

Adrenalynn
08-25-2008, 01:22 PM
Hi Carter, welcome to the TRC!

It's actually trivially easy. Here's a decent tutorial here: http://forums.trossenrobotics.com/showthread.php?t=2283

In a nutshell, your computer talks to either a motor controller that can do serial, or to a servo controller that talks to a motor controller that can do PWM. Boom. Bob's Your Uncle. Probably the simplest robotics concept you'll find. :)

Hephaistos
08-25-2008, 01:33 PM
The nice thing about using PC's with robots is that it can be as easy or as difficult as you want to make it. You could take some plywood, a couple of wheels, casters, motor controllers and a laptop and be up and running pretty cheaply and easily.

Using the Phidget devices (http://www.trossenrobotics.com/Phidgets.aspx) Trossen sells makes it very straightforward to interface a PC to robot hardware. The link Adrenalynn posted is a great one and here's another one: Introduction to PC Based Robotics (http://forums.trossenrobotics.com/showthread.php?t=2299). The nice thing about using devices like these is that they can grow with you. So as your bot advances, you can reuse all "bridgeware" devices and just keep adding to it.

Plus, keep asking questions, there are a lot of very nice and very skilled people on this forum to help out.

Adrenalynn
08-25-2008, 01:34 PM
Thanks, Hephaistos - that was the link I originally went looking for.

Hephaistos
08-25-2008, 01:35 PM
Thanks, Hephaistos - that was the link I originally went looking for.

That's very funny, because the link you posted was the one I was looking for! Go us !! : )

Carter05
08-25-2008, 01:52 PM
Thanks for the super quick help guys. I'll be sure to ask more questions in the future!

Carter05
08-25-2008, 02:10 PM
Another question after reading some more. as far as the programming goes, do I just create my own application and interface? If so, how do I get the bot to be autonomous? Like with the Atmel 640 I just download the program and go, how would I do the same thing with this?

Adrenalynn
08-25-2008, 02:36 PM
You would download the program and go. :)

The PC is "no different" than the ATMEGA (good choice of ATMEGA too, imho). The ATMEGA runs a program, and so does the PC. If you're writing code on the AVR that says "if I bump the left sensor, fire the right wheels", you would do exactly the same on the PC.

Hephaistos
08-25-2008, 02:40 PM
Another question after reading some more. as far as the programming goes, do I just create my own application and interface? If so, how do I get the bot to be autonomous? Like with the Atmel 640 I just download the program and go, how would I do the same thing with this?

I'm not sure exactly what you're using with the Atmega640 to get it to just "download and go." However, as far as how you could add some behavior to a robot using a PC, RoboRealm (http://www.roborealm.com/tutorials.php) has some great software that allows you to do a lot of navigation using a webcam. From what I understand, it's pretty easy to use.

Here are a couple of books to check out:

http://ecx.images-amazon.com/images/I/517UNzlpUtL._SL500_BO2,204,203,200_PIsitb-dp-500-arrow,TopRight,45,-64_OU01_AA240_SH20_.jpg
Robot Programmer's Bonanza (http://www.amazon.com/Robot-Programmers-Bonanza-John-Blankenship/dp/0071547975/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1219692570&sr=8-1)

http://ecx.images-amazon.com/images/I/51LIJX1Z1tL._SL500_BO2,204,203,200_PIsitb-dp-500-arrow,TopRight,45,-64_OU01_AA240_SH20_.jpg
Robot Programming : A Practical Guide to Behavior-Based Robotics (http://www.amazon.com/Robot-Programming-Practical-Behavior-Based-Robotics/dp/0071427783)

Also, something you might want to consider is re-using your Atmega640 as a "sensor port" for your PC. What I mean by this is that you could write a program and download it to your 640 that basically sends its sensor readings back to the PC every so often (or on-demand by your program running on the PC). It could also accept commands from the PC to control servos or switches as well.

This approach is not as simple as just buying some phidgets, plugging them in and going, but it does save you from having to purchase new hardware. However, it also means that you're going to need to write a program to run on the 640 that waits for commands from the PC, processes them, performs some operation, and then respond back (not that hard, but not as simple as a Phidget either).

Adrenalynn
08-25-2008, 02:44 PM
That's exactly what I use my 640 (Axon by Society of Robots) for. It's also what the TRAMP will be using for its main analog inputs and sensor pre-processing.

Roborealm (http://www.roborealm.com) is an awesome app. Great for prototyping vision algorithm chains too. Very fast to get something up and running and no programming "required", although desirable.

In many ways, I'd say that talking to the 640 from the PC is easier than talking to phidgets. Almost none of the overhead learning curve. But then I spent an entire life as a C programmer... ;)

Carter05
08-25-2008, 03:11 PM
That's exactly what I have, the Axon. I think I'm starting to understand now. Thanks again for all your help!

Ah! had a brain wave! If I can control the axon from the computer. I could use the axon to control tons of servos and a regular micro ITX for vision and roborealm and stuff! awesome!

Adrenalynn
08-25-2008, 03:23 PM
Exactly! Now you have it!

In The TRAMP, we're using the Axon to acquire sensor input from a multitude of environmental and discreet sources, streaming that information to the MiniITX, which in turn does what it does as well as streaming the data up to the server to go into the online database.

Or that's the plan, anyway. ;) I can help you with code on the Axon side if you have any questions.

Carter05
08-25-2008, 04:48 PM
What is this TRAMP project you are talking about? How are you getting data to the miniITX?
I'd love to see the source for the axon you have so far, or examples if the previous is not possible. Thanks in advance!

darkback2
08-26-2008, 12:49 AM
I have a confession to make. I have never made a robot that didn't have a laptop or pc attached to it. with the exception of lego robots...and RC robots which I later attached a pc to. I don't have the first clue how to make a robot using anything else.

For starters I would suggest using phidgets. I use a phidget 0/0/4 and couple it with a vantec electronic speed controller for my wheeled robots, and for my legged robots...I make those too now! I'm using an SSC-32...which in my humble opinion is the way to go for legged robots. I use a sony vaio VGN-180 UX...though I'm probably one of the only ones here doing that. A lot of people seam to be going for the Pico ITX...

Seriously though phidgets 0/0/4 (servo controller) and 8/8/8 (sensor interface)...yeah you get it.

DB

ooops
08-26-2008, 09:07 AM
What is this TRAMP project you are talking about? How are you getting data to the miniITX?


Group project Here (http://forums.trossenrobotics.com/showthread.php?t=2173)

robot maker
08-30-2008, 03:06 PM
another great use of using a on board computer,is that you can add video,voice and remote desktop control,small downside is takes a little more room and power,but with the new pico-itx board its cuts down on power and size,also you have more processing speed and memory
programming is hard for some,pda is another way to go also for small robots and they have a special c programming for palm
using a laptop uses alot of power comparing to itx boards and added weight,and a cd rom thats not really needed,cd rom is only when you need to add software,to cut down on power using itx board is no floppy,no cd rom,no screen and use solid state drive or mmc card to ide
for using small memory cards to save space use programs to reduce windows xp like XPLITE
THUMB STYLE wireless lan usb adapters are faily cheap
also with most servo control boards ,motor controllers,and alot other pic or avr boards there is roborealm to control them,mostly plug and play



I'm currently doing robotics with regular microcontrollers specifically the atmega 640. Would it be a huge jump for me to migrate over to using a full computer for my robot brains? I already know C and some C#. From the little reading I've done seems to be rather intimidating. How do you go about controlling a robot with a computer? Are there any quick start tutorials or any websites that would get me started in the right direction? Thanks!

Adrenalynn
08-30-2008, 03:09 PM
CDROM and floppy draw zero current when not in use, with the exception of bootup and searching drives - at which time they use a tiny amount of current to spin the empty drive up and report it empty.

Using an MMC card or thumb drive without first disabling the OS' paging is a good way to have a dead MMC card or thumb drive in a day or two...

robot maker
08-30-2008, 03:23 PM
near zero but adds some called idle current ,but adds weight that meens it draws more torque and power,not alot of weight but all adds up and puts a drain on the battery,i have found out on cd rom it has 50 ma idle current or more,besides bootup and searching current
i never see the need for it,since its only loading the software maybe once and there are thumb drives to add software updates and changes or wireless lan,plus takes up space even with flat cd roms they have out
i dont think a thumb drive is good as a harddrive use,mostly not ide like hardrives amd mmc adapters are,also need to pick the right mmc card to work with a mmc to ide adapter

CDROM and floppy draw zero current when not in use, with the exception of bootup and searching drives - at which time they use a tiny amount of current to spin the empty drive up and report it empty.

Using an MMC card or thumb drive without first disabling the OS' paging is a good way to have a dead MMC card or thumb drive in a day or two...

Adrenalynn
08-30-2008, 03:34 PM
Nope. No idle current to an unused CD in a modern laptop. Measure it. The hardware cuts 'em off. Obvious measure to raise your battery runtime, and since that's a major marketing checkbox item...

And again: If you don't turn off paging, MMC is dead. ALL MMC. 110%. Period. End of discussion.

robot maker
08-30-2008, 03:40 PM
i dont use paging,but never check to see it ruins mmc cards ,i have one in mine running perfect 8 gig mmc card zero problems,i think in most sites on using a mmc card instead of harddrive it says to turn off paging
in cd rom on compter i checked but not on laptop so you may be right


Nope. No idle current to an unused CD in a modern laptop. Measure it. The hardware cuts 'em off. Obvious measure to raise your battery runtime, and since that's a major marketing checkbox item...

And again: If you don't turn off paging, MMC is dead. ALL MMC. 110%. Period. End of discussion.

Adrenalynn
08-30-2008, 04:25 PM
I give up. Hopefully people will seek more than one source of information.

robot maker
08-30-2008, 05:31 PM
here is a very good link on using a cf card instead of a hardrive,tells how to tuning up windows and more,
http://www.thinkwiki.org/wiki/Compact_Flash_boot_drive
it tells you the advantages and disadvantages, my favorate is transcend 300x

link on booting operating systems off a compact flash card
http://www.addonics.com/support/faqs/faq-bootcf.asp
this most likely the best info i found for it

sam
08-31-2008, 03:30 PM
Thanks for the second link. I bookmarked it in case I want to buy a pico ITX.

I hope it will work with a USB flash drive, will it? I guess I have to have some wires to connect it to the computer.

robot maker
08-31-2008, 04:03 PM
i dont think it does,but ide to flash card adapter is very cheap
second link has lots of them that do work,i think some computer will read and boot from flash drive
need to check your bios to see if it can be done
good things are great about using a flash card instead of 2.5 laptop harddrive
size is a little smaller,about half the weight and power is alot less,mostly because it uses memory chip instead of a motor,then there is vibration problems,if to much on hardrive it will not work
then i think read time is alot faster,write time slower a little.first link gives you good bad about using flash drive ,but it the best for robots
make shore you what they said about disable the page or your memory will get fried
like adrenalynn said


Thanks for the second link. I bookmarked it in case I want to buy a pico ITX.

I hope it will work with a USB flash drive, will it? I guess I have to have some wires to connect it to the computer.

Adrenalynn
08-31-2008, 08:36 PM
Most any modern computer (last four or five years) will boot from USB. Anything that will boot from USB will boot from a thumb drive.

The reason for turning off your paging file is the same reason for not recording video or audio or any realtime streaming to it: Flash memory has a very limited number of write cycles. Once you read the end - phhht! it's gone.

So don't use anything that will pound on the drive.

robot maker
08-31-2008, 10:39 PM
transcend 300x i bought has 1,000,000 write cycles,and double the speed of my sata drive
latter on i like to go to solid state drive


Most any modern computer (last four or five years) will boot from USB. Anything that will boot from USB will boot from a thumb drive.

The reason for turning off your paging file is the same reason for not recording video or audio or any realtime streaming to it: Flash memory has a very limited number of write cycles. Once you read the end - phhht! it's gone.

So don't use anything that will pound on the drive.

Adrenalynn
09-01-2008, 12:03 AM
1 million write cycles will be gone in a matter of days if you're streaming video to it.

robot maker
09-01-2008, 12:44 AM
mmmmm i didnt know that,but i noticed that alot of robot builders and laptop users are using them with out any problems
best way to find out is place one inside a robot design and run tests and see what happens
working on one that uses video,web cam and getting ready to install the itx board using a intel d945 board,will post any problems that comes up or how well it works


1 million write cycles will be gone in a matter of days if you're streaming video to it.

i was looking at sata drives and comparing them to solid state drives and i see that MTBF IS ALOT HIGHER AND WRITE/READ access times is alot higher, one is 3,600,000 MTBF hours, write 60gb/sec and read 45gb/sec and its like that from alot of companies that make them,i like transcend
on sata notebook drives 300,000 MTBF hours,so solid state drives look very good for robots