Shop OBEX P1 Docs P2 Docs Learn Events
Multiple RC servos simultaneous control — Parallax Forums

Multiple RC servos simultaneous control

mrbillholmrbillhol Posts: 2
edited 2011-07-13 17:03 in General Discussion
I have developed a 3 axis robotic camera arm. I want to control all three RC continuous rotation servos simultaneously, I have the pulse out code snippet but I wonder if the PAUSE function stops all other running code so I am limited to one servo at a time? I am also using a reluctance tooth sensor and doing a continuous count for feedback. the feedback monitoring is eating many cycles.

Currently I am using the Yost Engineering ServoCenter 4.1 board but it runs slow and can't keep up with the tooth count and the 3 axis RC control servos simultaneously.

Comments

  • PublisonPublison Posts: 12,366
    edited 2011-07-13 13:14
    mrbillhol wrote: »
    I have developed a 3 axis robotic camera arm. I want to control all three RC continuous rotation servos simultaneously, I have the pulse out code snippet but I wonder if the PAUSE function stops all other running code so I am limited to one servo at a time? I am also using a reluctance tooth sensor and doing a continuous count for feedback. the feedback monitoring is eating many cycles.

    Currently I am using the Yost Engineering ServoCenter 4.1 board but it runs slow and can't keep up with the tooth count and the 3 axis RC control servos simultaneously.

    It sounds like you are trying to use a Basic Stamp. While a Basic Stamp can control three servos, that' probably the max.

    Looks like you need input also at the same time. The stamp will not do the input and out put at the same time.

    Sounds like you need a Propeller chip.
  • ercoerco Posts: 20,259
    edited 2011-07-13 13:32
    Don't give up on my Stamp just yet! :) A BS2 may well be up to the challenge of controlling 3 REGULAR servos (not CR servos), depending on the application and how much input is needed. Certainly it can check a few switches or read a pot. You'll loop your servos like this:

    a: pulsout 0,750 'servo 1
    pulsout 1,850 'servo 2
    pulsout 2,650 'servo 3
    pause 15
    goto a

    Note that the traditional pause 20 is reduced since each pulsout burns up some time. You may have to reduce below 15.

    Also, you will reduce (or eliminate) that pause with your read input routine, depending on how long that takes. The main idea is to send a pulse to every servo each 20 ms or less.

    The question of how many servos a Stamp can handle comes up all the time. I had 3 servos working just fine here: http://www.youtube.com/watch?v=-Z8lTSX4PHs No input there, granted, but there was certainly time.

    I'll have to hook up 3 servos and 3 control pots just for testing when I get a chance. I suspect it can be done. Dare I hope for 4?

    Edit: I just re-read the OP and saw the CR servo info. Yep, the reluctance encoders (which as you said, must be continuously monitored) are a dealbreaker with CR servos, which require continuous pulsouts. Two ServoPals might help in your application, but no guarantees.

    Regular servos could probably work.

    Multitasking (Propeller or PicAxe 18M2) is the way to go for you.
  • PublisonPublison Posts: 12,366
    edited 2011-07-13 13:38
    erco wrote: »
    Don't give up on my Stamp just yet! :) A BS2 may well be up to the challenge of controlling 3 REGULAR servos (not CR servos), depending on the application and how much input is needed. Certainly it can check a few switches or read a pot. You'll loop your servos like this:

    a: pulsout 0,750 'servo 1
    pulsout 1,850 'servo 2
    pulsout 2,650 'servo 3
    pause 15
    goto a

    Note that the traditional pause 20 is reduced since each pulsout burns up some time. You may have to reduce below 15.

    Also, you will reduce (or eliminate) that pause with your read input routine, depending on how long that takes. The main idea is to send a pulse to every servo each 20 ms or less.

    The question of how many servos a Stamp can handle comes up all the time. I had 3 servos working just fine here: http://www.youtube.com/watch?v=-Z8lTSX4PHs No input there, granted, but there was certainly time.

    I'll have to hook up 3 servos and 3 control pots just for testing when I get a chance. I suspect it can be done. Dare I hope for 4?

    Erco is the master of Stamps and Servos. My input was
  • schillschill Posts: 741
    edited 2011-07-13 15:44
    It seems odd to be using continuous rotation servos for a robot arm. That seems like it's asking for trouble since there are probably definite limits to the angle of rotation for the servos that you don't want to exceed. Do normal servos with 90 or 180 degrees of motion not provide a large enough rotation angle?
  • ercoerco Posts: 20,259
    edited 2011-07-13 17:03
    Agreed, CR's are a strange choice for this application. And I am reluctant to question the reluctance sensor resolution on a metal gear tooth. How many gear teeth, how many degrees per tooth? In a robot arm, you need very fine resolution for accuracy and repeatability.

    @mrbillhol: I glanced at the specs for that YOST board: http://tech.yostengineering.com/servoFolder/servoFolder/servocenterUSB/servocenter41_hardware_manual_mini.pdf

    That looks far more capable than any Stamp can ever hope to be. Are you certain it's not up to your task?

    If you used potentiometers at your joints instead of the reluctance sensor, you'd be done already.That board has analog inputs.
Sign In or Register to comment.