Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Abaddon on April 11, 2007, 01:13:28 AM

Title: microcontroller or a usb controller?
Post by: Abaddon on April 11, 2007, 01:13:28 AM
Hello all, new to the forum! I've been interested in robotics for a while and I finally decided to take it up as a hobby. I've researched the material as best as I can but I still have a question that I need help with.

I'm planning on making an interactive robotic art project for my university. I'm working on a touch screen interface that allows control of servos. I figured I could write a program and have that control servos directly through a usb servo controller. However I also need to be able to have sensors. All of the usb controllers I have seen don't seem to have I/O ports on them. Can a microcontroller be used to directly control servos as well as take in sensor readings or do I need to have both a usb controller and a microcontroller in order to have both direct control of servos and sensors?
Title: Re: microcontroller or a usb controller?
Post by: nanob0t on April 11, 2007, 04:09:20 AM
It depends on more of what you want.

A usb connection will be reliable and fast.  The programming will probably be minimum, because there is undoubtedly some program out there for this.  If not, then you have huge amounts of processing speed and such behind it.  The biggest problem is it will not be portable and will require a usb port to work.  It also has the possibility to run without internal batteries.  You will need to have the usb connection 'talk' with something that has I/O pins so you can get the data everywhere.

A microcontroller is a lot more work.  You will have to program/debug everything into it.  You will also have to find one suitable for your project.  A microcontroller can be used to control servos by it sending a pulse through the servos' pulse pin.  The pulse pin is usually Yellow, Orange, or White.  With a microcontroller you are going to need an internal power source, probably batteries of some source, but you will have the convience of portability.

That's all I have.  It's early in the morning so some is probably messed up  ::)
Title: Re: microcontroller or a usb controller?
Post by: Jeff on April 11, 2007, 08:21:01 AM
now first I'm definitly biased toward microcontrollers because I think thats the Fun way.  But having said that lots of microcontrollers are specifically designed to read sensors and control things like servos. So I would say if you have the time give it a go with a microcontroller :-)

peace
  Jeff
Title: Re: microcontroller or a usb controller?
Post by: Abaddon on April 11, 2007, 04:00:50 PM
Thanks for the speedy replies! I should have been more specific with my project. It's going to be a stationary, kiosk style display. I have no need for it to be mobile and it doesn't really require any level of autonomy. Users will be able to press different combinations of on screen buttons in order to move an armature around and the screen will also display sensor information gathered from the armature. I understand that microcontrollers are a necessity for autonomous control and that servo controllers are not. My only question is how can I have both sensor inputs as well as direct servo control? Can a microcontroller be used to directly control servos or do I need a microcontroller for the sensors and a usb controller for the servos?


OK, I think I found my answer. If a microcontroller is slaved to a host computer do you have direct control of the servos? Is this a common feature for most microcontrollers? Sorry for my possibly noobish questions  ;D
Title: Re: microcontroller or a usb controller?
Post by: dunk on April 11, 2007, 05:18:45 PM
so yes, microcontrollers can controll servos and read sensors.
and yes, microcontrollers can be controlled from a PC (usually over the serial port).
they won't do it without a fair bit of microcontroller programming though. there would be a steep learning curve.

if you want to learn how to programme microcontrolers and you aren't in a hurry then this would be a very educational path for you.

if on the other hand you want the quickest route to your goal (and don't mind throwing a bit of money at it) then you might be better looking into PC I/O (Input/Output) boards for reading your sensors.

a 3rd option might be hacking regular PC input devices like mice/joysticks/etc for input and stick with your USB servo controller for controlling those.

dunk.
Title: Re: microcontroller or a usb controller?
Post by: nanob0t on April 12, 2007, 11:22:18 AM
You can make your project by hooking your computer to a microcontroller.  A microcontroller can directly control a servo.  Two of the wires are used for power, a negative and a positive.  You can send a pulse to the servo wire and depending on the length, the servo will move. 

You can also connect a sensors I/O pin to a microcontroller and send/recieve data.  I do not know your intended design, but I will make an example for sake of simplicity.

You have a servo and a light sensor.  When the light is on, the microcontroller pulses to the servo to remain at 0 degrees.  Say the light is turned off and in your program you can have a line of code that sends a new length pulse to the servo moving it to 180 degrees.  Now your sensor is at 180 degrees due to the microcontroller maintaining the circuit.

If you are looking to have a display, then yes, I would use a computer.  You can connect your computer to the microcontroller and the microcontroller can wait for an input from the computer. 

Well, the bell rang.  I'll elaborate more if you need it.