2

Author Topic: Computer to multiple servos or sensors  (Read 2057 times)

0 Members and 1 Guest are viewing this topic.

Offline dcole07Topic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Computer to multiple servos or sensors
« on: February 27, 2007, 09:26:37 PM »
How do you go from USB or some other port on a computer to servos, if the number of servos is greater than the number of pins.

Like using port numbers (80,21...) in the programming..
Do you use a microprocessor as a middle man to some how check where it needs to go? How does the process work in detail?

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: Computer to multiple servos or sensors
« Reply #1 on: February 28, 2007, 02:10:09 AM »
Most definitely yes, you will need a microprocessor like a pic,avr or arm to interface between a computer and servos.

Heres probably what it will look like:
Computer USB<---->USB to Serial adapter<---->MicroProcessor<---->as many servo's as the MicroProcessor can Handle
or alternately:
Computer Serial<---->RS-232 to TTL level Shifter<---->MicroProcessor<---->as many servo's blah blah blah

So the general Idea is you could come up with any protocol you wanted to use.
You could transfer straight binary numbers or transfer ASCII or any combination of both.
So to move servos you have to send pulses from .5 milliseconds to 2.5 milliseconds.
If you encode that as 500 to 2500 it can be encoded with unsigned 16 bit integers.
So say you have 6 servos. So you could send ASCII A,B,C,D,E,F or G followed by the
16 bit integer (wich would be two bytes) and an escape character( like a . or a : or anything)
to flush the buffer. Or you could send all ASCII and use actual returns to help flush your buffers.

Hope that answered some questions. If you have any other Specific questions don't be afraid to ask.
Some companies also sell Serial to servo contraptions already made:
http://www.pololu.com/products/pololu/#servcon
« Last Edit: February 28, 2007, 02:20:58 AM by JesseWelling »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Computer to multiple servos or sensors
« Reply #2 on: February 28, 2007, 11:11:16 AM »
if by chance you wanted to make your own usb servo controller, dunk wrote up this tutorial:
http://www.societyofrobots.com/member_tutorials/node/25

 


Get Your Ad Here