Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: bryan922 on December 18, 2008, 11:32:32 PM

Title: Controlling motors and servos from PC or Mac
Post by: bryan922 on December 18, 2008, 11:32:32 PM
Hey everyone - first post...

I've looked through various websites, books, etc., and I'm a little overwhelmed. I know there's lots of ways to do things, but I don't want to reinvent the wheel when it comes to controlling motors or servos.

Basically, I want my robot brain to be programmed in C on a PC (preferably a Mac though). I don't need any help on C coding - I've got plenty of experience there. I also don't need much help on fabrication, mechanical design, etc.

What I do need help on is to be pointed in the right direction for choosing off the shelf premade boards for controlling motors and servos. Let me give a simple example: I want two servos to provide pan and tilt to a video camera. The servos will take direction from my C code which exists on the PC (or Mac). Presumably, (I'm not sure here), the code communicates to the board via the parallel port, or perhaps a USB port.

So, that would be great if someone could recommend some great (and time tested) products that will allow:

-- Easy plugging in of servos or motors to a motor controller board
-- Easy interfacing to a computer via the parallel port or a USB port
-- Options for power to come from the computer or externally
-- It would also be great if the flexibility of daisy chaining or stacking for the ability to add many more motors/controllers and still communicate through the one port existed
-- Not terribly expensive

Am I right to assume that the Roboduino is a good option? What are other alternatives?

Also, what is the best way to interface miniature video cameras to a PC (or Mac)? What I mean is: I suppose I could buy a webcam and use their software SDKs, but I'd rather not have the plastic shell which a webcam is mounted in. Yes, I might be able to remove the plastic shell, but if a more raw camera is available which can still be interfaced to the PC and its input put into a buffer which can be accessed via program code, that would be great. Any info?

One more question: I'm sure many of you are familiar with the MIT Personal Robots Group. On that site, they mention voice coil-type electromagnetic actuators. Do any of you have experience with these types of actuators? Are they readily available, and do controller boards as described above exist to control them?

Link to actuators at MIT Personal Robots Group: http://robotic.media.mit.edu/projects/hardware/actuators/overview/overview.html
Title: Re: Controlling motors and servos from PC or Mac
Post by: SeagullOne on December 19, 2008, 12:01:25 AM
Hmm...well if you're using a mac, roborealm isn't an option. I'm thinking about using my mac to controll my personal robot, NINA, but using Bootcamp to run windows and, respectively, roborealm...its really too bad roborealm doesn't run on macintosh.  :(

As far as camera software out there is concerned, you might try the CMU cam. You can program your own vision algorithms with C in it, and it plugs into a microcontroller...but it might be a little expensive though.

Anyone else?
Title: Re: Controlling motors and servos from PC or Mac
Post by: bryan922 on December 19, 2008, 12:23:38 AM
Roborealm link here: http://www.roborealm.com/ (making notes to myself)

The CMUcam looks interesting. Link here: http://www.cmucam.org/

Thanks for the info. CMUcam is kind of expensive though, as you said...

Also, I've just recently discovered this site, and it looks like there's lots of good info here. I've just now been reading about the Axon microcontroller. Will it work with a Mac?
Title: Re: Controlling motors and servos from PC or Mac
Post by: darkloaf on December 20, 2008, 10:58:07 AM
Servocity has heaps of good stuff:

Pan and tilt servos:
http://www.servocity.com/html/spt200_pan___tilt_system.html

A Roboduino would be fine, or just get an Arduino with a motor shield:
http://www.ladyada.net/make/mshield/

Think that will do what you need, there are loads of people who have done similar projects to this.

Nick D
Title: Re: Controlling motors and servos from PC or Mac
Post by: MaltiK on December 24, 2008, 06:39:58 AM
http://www.youtube.com/watch?v=X4stWDy-bPA
Title: Re: Controlling motors and servos from PC or Mac
Post by: reSpawn on December 24, 2008, 07:33:50 AM
Also, what is the best way to interface miniature video cameras to a PC (or Mac)? What I mean is: I suppose I could buy a webcam and use their software SDKs, but I'd rather not have the plastic shell which a webcam is mounted in. Yes, I might be able to remove the plastic shell, but if a more raw camera is available which can still be interfaced to the PC and its input put into a buffer which can be accessed via program code, that would be great. Any info?
You said C programming is not something difficult for you. You should take a look at OpenCV for Computer Vision. Getting frames from the camera is easy as loading an video from your pc :)
Title: Re: Controlling motors and servos from PC or Mac
Post by: cooldog on December 24, 2008, 10:08:22 AM
try Phidgets

this will control a servo
http://www.phidgets.com/products.php?product_id=1000

you can also get ones that control motors
Title: Re: Controlling motors and servos from PC or Mac
Post by: bryan922 on December 24, 2008, 11:33:45 AM
Everyone, thanks for the info.

I've settled on the Arduino board for prototyping motor controlling and sensor reading. OpenCV looks interesting.

What I'd really like to find is a USB camera without the webcam plastic shell - something like the CMUCam, which is a candidate, except for the price.
Title: Re: Controlling motors and servos from PC or Mac
Post by: cooldog on December 29, 2008, 06:21:44 PM
take a usb camera out of it's shell
Title: Re: Controlling motors and servos from PC or Mac
Post by: airman00 on December 29, 2008, 10:11:29 PM
What kind of specs for the web cam do you need?
Title: Re: Controlling motors and servos from PC or Mac
Post by: jamort on December 29, 2008, 10:24:39 PM
you could buy a kind of cheap laptop....
also if you have a pretty new mac you can install windows on some now