Shop OBEX P1 Docs P2 Docs Learn Events
mass-servo controller with potentiometers as inputs!! — Parallax Forums

mass-servo controller with potentiometers as inputs!!

munkamunka Posts: 5
edited 2011-06-21 18:06 in Robotics
Hello Forums,

I've been able to successfully duplicate this project:

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

Which is controlling a servo using a basic stamp and a potentiometer. Basically turning the dial on the potentiometer changes the angle of the servo.

My version of this is that I am using a ADC to measure the output of the potentiometer then it's only a few lines of code to make the servo match the angle of the potentiometer. (I'm not really sure how they are using "two capicators" to do the same thing.)



So here is my problem: I want to do this on a massive scale, with 32 servos, and 32 potentiometers as inputs to control the servos. I am familiar with some Basic Stamp Programming, and I've already bought a Board of Education. I'm wondering if I should cut my losses and invest in the Propeller Servo Controller board, which can control 16 servos. If y'all think I could just stick with the basic stamp, what else will I need? I looked up I/O expansion boards, and I've got a couple of ADCs.

Also, I should mention that all the servos and potentiometers don't need to go to the same board. Its OK if I just buy more boards, and have no inter-communication between them.

PS: Is it possible to connect two servos together and have them always do the same thing by stripping the wires on both and solder them together?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-06-16 10:42
    One Stamp can control 3 to 4 servos using an external ADC as you've done. More than that and the Stamp starts to run out of time to do all the work it has to before the next servo control pulse has to be produced.

    A Propeller Servo Controller can control 16 servos at the same time and you can connect two of them together to control 32 servos. You can also build your own servo controller using a Propeller Protoboard or any of the similar Propeller boards and one Propeller can easily control 16 servos using the same software as the Propeller Servo Controller. By going this route, you can attach two 8-channel ADCs as well to the Propellers so each can handle 16 pots and 16 servos.

    Yes, it's possible to connect two servos in parallel so they both do the same thing. You'd essentially connect the ground, +power, and control lines of each to the other. Rather than strip and soldering the wires together, I'd buy some matching 0.1" header pin strips and break off two sets of 3 along with some 0.1" socket strips and break off one set of 3, then solder all of them in parallel. That way you wouldn't have to hack the servo cables.
  • ercoerco Posts: 20,256
    edited 2011-06-16 10:55
    You can even do it without a processor, if all you're doing is reading pots & driving servos accordingly. One pot and one LM555 IC in a "servo tester" circuit, such as http://www.aaroncake.net/circuits/servocon.asp will get you going.

    32 servos? Quite a project! What are you making? You're even more industrious than this guy: http://www.youtube.com/watch?v=-XChu20hTxU
  • munkamunka Posts: 5
    edited 2011-06-16 11:01
    erco wrote: »
    You can even do it without a processor, if all you're doing is reading pots & driving servos accordingly. One pot and one LM555 IC in a "servo tester" circuit, such as http://www.aaroncake.net/circuits/servocon.asp will get you going.

    32 servos? Quite a project! What are you making? You're even more industrious than this guy: http://www.youtube.com/watch?v=-XChu20hTxU

    I think I'd prefer to use some kind of processor, but I might try out that circuit and see how that works.

    I'm basically doing the same thing, except mine will be better ;)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-06-16 11:02
    A Propeller can control up to 32 servos individually.

    The problem of trying to control 32 servos with one Prop is there wont be any pins left for data input.

    If you share data and clock pins on your ADCs you'd still need a total of six pins(assuming four ADC chips) to monitor the your pots. That leaves you with 26 pins for servo control.

    I wonder if one could drive a 595 shift register accurately enough to control servos? Probably. That would free up all sorts of pins.

    I think no matter what, you'll need some extra chips to drive 32 servos with a Prop if you want to be able to provide input.

    Duane
  • munkamunka Posts: 5
    edited 2011-06-16 11:04
    Mike Green wrote: »
    One Stamp can control 3 to 4 servos using an external ADC as you've done. More than that and the Stamp starts to run out of time to do all the work it has to before the next servo control pulse has to be produced.

    A Propeller Servo Controller can control 16 servos at the same time and you can connect two of them together to control 32 servos. You can also build your own servo controller using a Propeller Protoboard or any of the similar Propeller boards and one Propeller can easily control 16 servos using the same software as the Propeller Servo Controller. By going this route, you can attach two 8-channel ADCs as well to the Propellers so each can handle 16 pots and 16 servos.

    Yes, it's possible to connect two servos in parallel so they both do the same thing. You'd essentially connect the ground, +power, and control lines of each to the other. Rather than strip and soldering the wires together, I'd buy some matching 0.1" header pin strips and break off two sets of 3 along with some 0.1" socket strips and break off one set of 3, then solder all of them in parallel. That way you wouldn't have to hack the servo cables.

    That sounds great. It definitely sounds like I need the Prototype board!!! Thanks for the response!
  • munkamunka Posts: 5
    edited 2011-06-18 13:33
    The great part about this is the really easy software :P

    Its less than 50 lines


    ' program to test out eight servo-potentiometer combos!!!

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    GOSUB declare_things

    Main:
    FOR channel = 0 TO 7 STEP 1
    GOSUB GetADC 'get pot pos
    ' DEBUG "ch", DEC1 channel ,"=", DEC Result ,CR 'display info
    PULSOUT channel+12, 250 + (result */ Cnts2SvPos) 'set servo pos
    NEXT
    GOTO Main
    END



    declare_things:
    'ADC STUFFS
    '
    [ I/O Definitions ]

    CS PIN 0 ' Chip Select (MCP3204.10)
    Clock PIN 1 ' Clock (MCP3204.13)
    DataOut PIN 2 ' Dout on ADC (MCP3204.12)
    DataIn PIN 3 ' Din on ADC (MCP3204.11)

    '
    [ Constants ]

    Cnts2SvPos CON $002F ' x 750/4095 (To servo position)
    Offset CON 24 ' for ADC

    '
    [ Variables ]

    channel VAR Nib ' Channel selection
    result VAR Word ' adc conversion results
    'initalize
    HIGH CS
    RETURN 'end declare_things

    GetADC:
    LOW CS
    SHIFTOUT DataIn, Clock, MSBFIRST, [ Offset | channel ]
    SHIFTIN DataOut, Clock, MSBPOST, [result\13]
    HIGH CS
    RETURN
  • kwinnkwinn Posts: 8,697
    edited 2011-06-18 21:27
    Four 8 bit latches would let you control 32 servos with 12 pins, and 4 '595's would let you do it with 4 pins but might require some PASM coding unless the '595 object could be used.

    Come to think of it there is a 32 servo object in the OBEX. Perhaps that would work.

    Servo32v7
    Control up to 32 servos without external hardware.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-06-20 19:20
    Along the line of what Duane mentions ... "I wonder if one could drive a 595 shift register accurately enough to control servos? Probably. That would free up all sorts of pins." ... here is the original Servo32 link.

    Top Thread
    Thread #5 - Inro to driving 32 Servos with a Propeller
    Thread #20 - A proposed method for communicating into the Propeller if all 32 lines were used
    Thread #35 - 96 Servos per Propeller is about the upper limit.
    Thread #48 - Demo to drive 96 servo's (using 2 COG's) or 48 servo's (using 1 COG)
    Thread #58 - Just when we thought 48 Servo's was the limit for 1 COG.... here comes 144 Servo's!!


    munka,

    I would suggest maybe using the PSC (Parallax Servo Controller) or rolling your own with a single implementation of the 48 Servo Driver mentioned in thread #48. Either would leave more than half of the I/O's available for reading your POT's - should not be difficult to multiplex your POT's with a few ADC's
  • munkamunka Posts: 5
    edited 2011-06-21 10:59
    Along the line of what Duane mentions ... "I wonder if one could drive a 595 shift register accurately enough to control servos? Probably. That would free up all sorts of pins." ... here is the original Servo32 link.

    Top Thread
    Thread #5 - Inro to driving 32 Servos with a Propeller
    Thread #20 - A proposed method for communicating into the Propeller if all 32 lines were used
    Thread #35 - 96 Servos per Propeller is about the upper limit.
    Thread #48 - Demo to drive 96 servo's (using 2 COG's) or 48 servo's (using 1 COG)
    Thread #58 - Just when we thought 48 Servo's was the limit for 1 COG.... here comes 144 Servo's!!


    munka,

    I would suggest maybe using the PSC (Parallax Servo Controller) or rolling your own with a single implementation of the 48 Servo Driver mentioned in thread #48. Either would leave more than half of the I/O's available for reading your POT's - should not be difficult to multiplex your POT's with a few ADC's

    Thanks for the response!!! This thread is helping me make a vast improvement from my original plans!! :)

    Maybe I'm an idiot, but what does it mean, in the 48-servo schematic, when it says "D1, D2... and Zone 1, or Zone 2...."? **** note! I just saw this "http://forums.parallax.com/attachment.php?attachmentid=41207&d=1144804382" is this the un-abbreviated version of your schematic? That seems to be what I need to make!!!

    Finally, this will do in place of the 573, right? http://www.parallax.com/StoreSearchResults/tabid/768/List/0/SortField/4/ProductID/229/Default.aspx
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-06-21 18:06
    munka,

    The schematic I think you want is here ...

    http://forums.parallax.com/showthread.php?84187-Will-the-servos-Parallax-sells-work-from-a-pulse-directly-from-the-Propeller&p=581714&viewfull=1#post581714

    ...Alternatively I would suggest using two of the Propeller Servo Controller

    The CORE Code inside of the Propeller Servo Controller uses the Servo32 object which also uses similar code structure to set the servo's as the Servo96 object mentioned above,

    For power management to the Servo's you need to make sure you can adequately drive 8 servo's at the same time... under a heavy load a single servo can pull upwards of 1 amp when trying to move into position. Idle power to the servo is usually 150mA or less. For 48 Servo's if you can deliver a 10 Amp supply you will be in good shape.
Sign In or Register to comment.