Shop OBEX P1 Docs P2 Docs Learn Events
quick question on # of servos i can control — Parallax Forums

quick question on # of servos i can control

errolprowseerrolprowse Posts: 3
edited 2010-10-13 04:53 in BASIC Stamp
i need to run 6 servos from my basic stamp, bs2 thats on a boe bot. I know that u can run only 4 if u go by the plugs that are supplied. Can i send a freqout signal to any other i/o ports and have more servos controlled by the bs2??
thanks

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-10-10 22:22
    The short answer is maybe. Servos require a control pulse roughly once every 20ms and this pulse is anywhere from 0.5ms to 2.5ms in width. 6 of these = 15ms. That doesn't leave much time to do anything else. The maybe is that 4-5ms may be enough to do what you need. You don't use FREQOUT ... That won't work. You use PULSOUT. See the "Robotics with the BoeBot" tutorial for more explanation.

    The built-in servo sockets are for convenience. They provide power and ground as well as the control signal (P12-P15). For others, you can provide connections on the little breadboard. Parallax carries some male 0.1" header pins that are the same length on both sides, one side for the breadboard and the other for the servo connector. You have to provide jumper wires to Vss, Vin, and two other I/O pins. It doesn't matter which ones.
  • errolprowseerrolprowse Posts: 3
    edited 2010-10-10 22:34
    ohhh thats right, i totally forgot its pulsout
    so what u mean is that if all the servos are going at the same time it may be sluggish?? im making an arm with standard servoes and i hope to copy this arm for a final project in school:
    http://www.youtube.com/watch?v=zZwnyZPkylk&feature=related
    do u think it could handle that type of load at the same time?
    can i have two servos doing the same motion and connected to the same signal pin?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-10-10 23:08
    You can have two servos controlled by the same control signal, but they have to be connected to the same I/O pin. A PULSOUT only outputs a pulse on a single I/O pin.

    If you miss the 20ms time limit, there's a little bit of slop allowed, but eventually the servo will get tired of waiting and will turn itself off. The motor will be unpowered and may slip if there's a load on it. Once it gets another control pulse, it will turn itself on, but that may cause the servo to jitter as it turns off and on repeatedly.

    Most people with much more than 4 servos will use some kind of external servo controller. Something as simple as a ServoPAL can help by continuing to issue control pulses while the Stamp is busy and will handle 2 servos using one I/O pin. A Propeller Servo Controller can handle up to 16 servos and can do ramping (smooth changes), all autonomously. You can even program it like any Propeller to do everything or certainly more than just controlling the servos.

    On the other hand, you could (like I said) control 6 servos with a Stamp if you're doing very little with them, not reading more than 1 or 2 simple sensors and doing only very simple and quick control decision making.
  • errolprowseerrolprowse Posts: 3
    edited 2010-10-11 14:09
    thanks! i understand, exactly what i needed too
  • ercoerco Posts: 20,256
    edited 2010-10-11 16:09
    The most I've had is 3 servos going in a robot arm, that worked perfectly. I posted at http://forums.parallax.com/showthread.php?t=125811 The software has to smoothly weave through all the pulsouts in the right order. I think a BS2 can control more (possibly 6) servos before serious glitching occurs. Where you may run into trouble is reading 6 pots simultaneously in addition to controlling the 6 servos. RCtime (typically used to read pot positions) is a slow command and gets slower with the wrong (higher value) RC values.

    Per Mike, each servo likes a pulse each 20 milliseconds, and strange things can happen if your pulses are stretched out longer. FYI, I have found that digital servos shut down from fewer pulses before analog ones do.

    If you REALLY want to duplicate the arm in that video, another option is to eliminate the processor completely and make 6 identical LM556 circuits that each read one pot and output a pulse string to drive one servo. That would definitely work and it's cheap, but it is a fixed analog circuit that will require individual pot & servo hardware calibration; obviously there is no software to tweak.

    You might want to review the similar thread at http://forums.parallax.com/showthread.php?t=124396 and/or check in with Gramps.
  • CampeckCampeck Posts: 111
    edited 2010-10-13 04:53
    erco wrote: »

    If you REALLY want to duplicate the arm in that video, another option is to eliminate the processor completely and make 6 identical LM556 circuits that each read one pot and output a pulse string to drive one servo. That would definitely work and it's cheap, but it is a fixed analog circuit that will require individual pot & servo hardware calibration; obviously there is no software to tweak.

    To expand on this you could have the BS2 controlling a digital potentiometer which changes the pulse train of the 555's/556's. I love digipots! I use them in everything from high power RGB faders to DC motor speed controllers with the BS2. Definitely helps to build circuits that you can offload some of the processing power onto.
Sign In or Register to comment.