Shop OBEX P1 Docs P2 Docs Learn Events
servo controller help — Parallax Forums

servo controller help

Roboticsmaster128Roboticsmaster128 Posts: 32
edited 2012-02-14 14:05 in Robotics
I need to find a servo controller that can handle more than 2 servos and runs on the basic stamps,or if you can find me a guide how to build one that would be fine too.
«13

Comments

  • ercoerco Posts: 20,255
    edited 2012-01-19 17:16
    http://www.pololu.com/catalog/product/1350

    Runs up to 6 servos and you might not even need a Stamp. You can program scripts directly into it. Read the literature on it. Excellent value for $20.

    Parallax makes great servo controllers, too. Here's a 16-servo PSC on Ebay ending in 4 hours, currently ~$16: http://www.ebay.com/itm/350523738632?ssPageName=STRK:MEBIDX:IT&_trksid=p3984.m1426.l2649
  • Roboticsmaster128Roboticsmaster128 Posts: 32
    edited 2012-01-19 19:40
    Do you now if each of them can be programmed in pbasic?
  • Mike GreenMike Green Posts: 23,101
    edited 2012-01-19 19:53
    The servo controllers are not really programmable. You use them with some kind of Stamp board (with PBasic) or other microcontroller and the Stamp sends commands to the controller using standard asynchronous serial I/O (SEROUT). The Parallax Propeller Servo Controller is actually a Propeller board that comes pre-programmed with an excellent servo controller program that is open-source (in Spin) and can be modified by the user using the standard Propeller programming tools, but you don't have to touch it.
  • Roboticsmaster128Roboticsmaster128 Posts: 32
    edited 2012-01-19 19:58
    Problem with your idea, mike green, is that I have not learned propeller yet,but if you do find a board that is a programable pbasic board then please tell me!
  • ercoerco Posts: 20,255
    edited 2012-01-19 20:13
    The Maestro is programmable, there's a nice GUI. 6 I/Os for servos, inputs or outputs.

    From Pololu: The Micro Maestro is a highly versatile servo controller and general-purpose I/O board in a highly compact (0.85"
  • Roboticsmaster128Roboticsmaster128 Posts: 32
    edited 2012-01-19 20:17
    Programable in pbasic?
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-19 21:29
    If you take a minute to look at the documentation for the Propeller Servo Controller you'll see many examples of commanding it in PBASIC, and using it with the BASIC Stamp 2, just as Mike said.

    The "Propeller" part of the name comes from the fact that it has a Propeller on it as the brains. You can use any microcontroller to run, or even run it from your PC.

    -- Gordon
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-19 21:38
    Mike Green wrote: »
    The servo controllers are not really programmable.

    Just as a general note, most of them are indeed just controllers, but there are several that are also "programmable" in that they will record or store servo motions. These include the Pololu boards Erco mentions, a servo recorder from ServoCity, and some others I've seen but forgotten about. The Pololu controllers are probably the most advanced, as they use their own scripting language that's similar to Prof Braino's beloved Forth.

    -- Gordon
  • al1970al1970 Posts: 64
    edited 2012-01-19 23:39
    Hi:

    Since I am on a parallax site; I won't name names. Just about any microcontroller can run 8 or more servos with serial input to run them; without any help. You can even add cheap R.C. using "onshine" (transmitter) rec. modules to the same microcontroller. Are you trying to build a servo robot?

    Al
  • Roboticsmaster128Roboticsmaster128 Posts: 32
    edited 2012-01-20 06:35
    I have a question,can you put more than four servos on the basic stamp board of education
  • Mike GreenMike Green Posts: 23,101
    edited 2012-01-20 06:53
    Theoretically, you could control 4 or 5 servos with a Basic Stamp (whether using a Board of Education or some other board). Practically speaking, that's all the Stamp could do ... no sensors, no decision making, etc. There just isn't enough time left over to reliably do anything else. The 5 servo control pulses could take 5 x 2 ms to produce (= 10ms out of a control cycle of 20ms). The remaining 10ms would quickly be absorbed by a few other statements at a rate of 150us to 1ms or more per statement. You could add a pair of ServoPALs to your Stamp to take over the most time consuming part of the servo control and your Basic Stamp could easily handle 4 or 5 servos.
  • ercoerco Posts: 20,255
    edited 2012-01-20 09:53
    I hope to find time this weekend to test a BS2's ability to drive multiple servos. High time we answered this question. It's been a while since I destructive-tested the BS2's quadrature encoder reading ability. :)

    http://www.youtube.com/watch?v=VmNc_V5jdPE
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-20 10:29
    As Mike and others have pointed out, you don't need to be able to program the Propeller to use it as a servo controller.

    If you were careful with how you powered the servos, you should be able to use the servo control program in a QuickStart board. The BS2 would just send serial (I assume) commands to the QS which would then move the servos where you wanted them.

    I haven't looked at the servo controller's code, but I'd be surprised if it wouldn't work from a QuickStart board. It should be possible to drive 31 servos (with a modified version of the servo controller code) from a QuickStart board (leaving one pin for communication).

    The price of Parallax's Servo Controller is reasonable and it would make it easier to power the servos if you were to use it. Either way, you should be able to use a Prop as a slave device without needing to learn to program it.
  • ercoerco Posts: 20,255
    edited 2012-01-20 11:38
    Duane Degn wrote: »
    It should be possible to drive 31 servos (with a modified version of the servo controller code) from a QuickStart board (leaving one pin for communication).

    You're on, Duane! I'll see how many servos a BS2 can run, you see how many a QS board can do. Something along these lines (using "another" processor) is my goal:

    http://www.youtube.com/watch?v=HSLktpOkrGs
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-20 12:26
    erco wrote: »
    You're on, Duane! I'll see how many servos a BS2 can run, you see how many a QS board can do. Something along these lines (using "another" processor) is my goal:

    http://www.youtube.com/watch?v=HSLktpOkrGs

    Great, this will be fun!

    So does each servo need to move at a different rate? I'm not sure I have 31 servos without using continuous rotation servos too (at least not until my recent HobbyKing order arrives).

    What should we do? Have each servo oscillate at a different rate with continuous servos changing speeds with different accelerations?

    Edit: If the QS doesn't need to communicate with anything, I might be able to have 32 servos moving. Now if I could use some 595 shift registers, then you'll really see something!
  • ercoerco Posts: 20,255
    edited 2012-01-20 12:58
    My goal in that video was just to have each servo constantly moving out of sync. I have downstream plans to make a snake and I'll need an undulating motion...

    There's this annoying servo controller on Ebay: http://www.ebay.com/itm/JP-Serial-Servo-Controller-Module-34ch-Stamp-Basic-Picaxe-and-Arduino-/170767045519?pt=Radio_Control_Parts_Accessories&hash=item27c282538f

    it claims to control 34 servos, but the video embedded only moves one at a time or big groups together. I'm not too impressed by that one. Might just be the programming, but no way to tell.
  • ercoerco Posts: 20,255
    edited 2012-01-20 13:12
    Duane Degn wrote: »
    Now if I could use some 595 shift registers, then you'll really see something!

    Sure, but that would be cheatin'... :)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-20 13:12
    I think the limitation you see in the video is caused by the Arduino. It can only compute and send one command at a time. The controller itself should be able to do whatever it's told.

    I think at 119200 bps one should be able to send it a lot of instructions to it.
  • ercoerco Posts: 20,255
    edited 2012-01-20 13:36
    I'd say a good benchmark would be to move the servos out of sync over their complete range of motion, which will probably be bigger than 1-2 ms. That's typically only about the middle 90 degrees for many servos.

    Per Mike's comment #12, on a BS2 this exercise is purely academic to see how many servos can be controlled. It won't be particularly useful since there isn't any time for any other calculations, but an interesting diversion nonetheless. I'm sure the quality of the servos makes a difference as well; I'm sticking with my bag of China Ebay 9-gram cheapies for now.

    And I'm not above bit banging if it helps the BS2 cause in any way. :)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-20 13:55
    Having a Prop control 32 servos is also just an academic exersize. Normally you'd want some sort of input to tell the servos how you want them to move. I suppose you could store some sort of script in the EEPROM -- no, that wont work, I doubt you'd have access to the EEPROM with a servo attached to those pins. You'd have to store any moves you want the servos to make in RAM. There might be some practical application for a bunch of servos moving without receiving any input, but I can't think of one.
  • Roboticsmaster128Roboticsmaster128 Posts: 32
    edited 2012-01-20 16:50
    the problem with the parallax propeller servo controller is the dificulty of getting the comands from the boe board to the propeller board is just way to dificult for me to understand unless i could be taut how to programm that kind of programming in some way
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-20 17:00
    erco wrote: »
    My goal in that video was just to have each servo constantly moving out of sync. I have downstream plans to make a snake and I'll need an undulating motion...

    Thirty or so servos shouldn't be a problem for a Prop. It'll be a big problem for the battery on your robot. You do NOT want to command all those servos to move at once. The proper way to do is move each one separately. Otherwise the battery just can't handle all the simultaneous current draw.

    You actually don't want each servo out of sync (positionally) with one another. Like a sine wave the segments just repeat X times for the given length. At most you could taper off the segments toward the rear, but those segments simply describe a shallower sine wave than the wave before it.

    This one is said to handle 84 servos -- that's one big snake:

    http://www.robot-electronics.co.uk/htm/sd84tech.htm

    -- Gordon
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-20 17:12
    erco wrote: »
    Might just be the programming, but no way to tell.

    It's the programming for the demo. Like all serial servo controllers you send it a couple of bytes specifying the servo number, position, and transit speed (if so able). That chip has a max serial comm speed of 19.2k, but even at that it's just a couple of bytes per servo, so things are fast. You can do the math to see how long it takes to send the required bytes for each servo to the controller, but guaranteed it's faster than your snake needs it to be.

    Be sure to thoroughly read the docs of whatever controller you use. It MUST allow you to set the transit speed. You don't want to have to do that in your microcontroller, especially if you're using a BS2.

    So you know, my snake has 10 segments, is controlled only by an Arduino (position and transit speed), and has sufficient -- but not great -- time left over for other things. Everything is hardware interrupt driven, and of course hardware timer driven for the servo PWM. There are no blocking delays in the code, and that's the key to making this stuff work.

    -- Gordon
  • ercoerco Posts: 20,255
    edited 2012-01-20 17:19
    Oh, I'd never resort (stoop) to using a servo controller. If I don't program all the servos myself, it's cheating.

    I just pointed that controller out for others who may not wish to follow my long and circuitous route.
  • al1970al1970 Posts: 64
    edited 2012-01-20 23:35
    Hi Mike:

    Most of the times I agree with your answer but not this time. It is very misleading. It does not take 10 ms to produce 5 2 ms pulses in just software. It is the time you need to route the timing pulses to lots of servos is one of the factors that limit how many servos you can run at one time. I can very easily run 8 servos on a low cost microcontroller with time left over to do other things.
    The formula 5 servos x 2 ms = 10ms just is not true for microcontrollers. Your formula may be true for the BS2; I don't know, I never used one.

    "There just isn't enough time left over to reliably do anything else. The 5 servo control pulses could take 5 x 2 ms to produce (= 10ms out of a control cycle of 20ms). The remaining 10ms would quickly be absorbed by a few other statements at a rate of 150us to 1ms or more per statement."

    Al
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-21 02:10
    al1970 wrote: »
    The formula 5 servos x 2 ms = 10ms just is not true for microcontrollers. Your formula may be true for the BS2; I don't know, I never used one.

    Al, I looked back at Mike's post. I thought he was pretty clear about discribing the issues with a Basic Stamps. I'm sure many other microcontroller can handle more servos but the Basic Stamp has to wait for the pulse to complete before continuing its execution. So the "5 servos x 2 ms = 10ms" is true for a Basic Stamp. There actually some overhead so a 2ms pulse will take longer than 2ms.

    I don't see how Mike's post was in the least bit misleading. He was clearly talking about Basic Stamps not microcontrollers in general.
  • TtailspinTtailspin Posts: 1,326
    edited 2012-01-21 09:34
    the propeller board is just way to dificult for me to understand unless i could be taut how to programm that kind of programming in some way
    Hey Roboticsmaster128, while these guys are distracted with the BS2, Let me offer a short tour of the dark side...
    >>>The Dark Side<<< especially note the servo control section toward the bottom of the page.
    You may be suprised the Propeller is so easy to learn and use...

    -Tommy
  • Roboticsmaster128Roboticsmaster128 Posts: 32
    edited 2012-01-21 12:50
    Even though propeller looks easy to learn,Im not even done learning the full pbasic yet so I'm just still looking for a basic stamp microcontroller
    That can hold a lot of servos.
  • TtailspinTtailspin Posts: 1,326
    edited 2012-01-21 13:24
    ...still looking for a basic stamp micro controller That can hold a lot of servos.
    You will only find speculation and doubt... come to the dark side for fulfillment and truth...
    Basic stamps can only speculate about maybe 15 or 16 servos... the dark side offers 32 servos...

    Embrace the dark side, Do not fear the change, change the fear instead...;)


    -Tommy
  • ercoerco Posts: 20,255
    edited 2012-01-22 20:13
    The BS2 ran 8 servos just fine. No one is more pleasantly surprised than me! :)

    Dare I try TEN? TWELVE? THIRTEEN?
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    W0=400
    W1=469
    W2=538
    W3=607
    W4=676
    W5=745
    W6=814
    W7=883
    x CON 5
    a:
    PULSOUT 0,W0
    PULSOUT 1,W1
    PULSOUT 2,W2
    PULSOUT 3,W3
    PULSOUT 4,W4
    PULSOUT 5,W5
    PULSOUT 6,W6
    PULSOUT 7,W7
    
    W0=W0+x:IF W0>950 THEN W0=400
    W1=W1+x:IF W1>950 THEN W1=400
    W2=W2+x:IF W2>950 THEN W2=400
    W3=W3+x:IF W3>950 THEN W3=400
    W4=W4+x:IF W4>950 THEN W4=400
    W5=W5+x:IF W5>950 THEN W5=400
    W6=W6+x:IF W6>950 THEN W6=400
    W7=W7+x:IF W7>950 THEN W7=400
    
    GOTO a
    
Sign In or Register to comment.