Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Servo Controller USB controlled by switches? — Parallax Forums

Propeller Servo Controller USB controlled by switches?

phil_lightphil_light Posts: 7
edited 2010-02-05 15:35 in Propeller 1
Hi, I'm completely green to this. I'm simply asking if what I want to do is possible.

I want to control 9 servos. I only need all 9 servos to move from position a to position b and back again (where a & b are identical distances/positions for all 9 servos) by either button push or switch flip. In other words, I'd like to have a control panel with cheap switches on it for each of the 9 servos, and when I flip servo 8's switch, it travels from a to b. Flip the switch to the opposite position and have the servo travel from b to a.

Could I use the Propeller Servo Controller USB product to do this or am I over complicating my needs? I've never even messed with servos before, so there quite possibly is a low tech way to do what I want to do. I'm just trying to figure out where to start.

Thanks!

Comments

  • John AbshierJohn Abshier Posts: 1,116
    edited 2010-02-03 17:32
    The Propeller Servo Controller USB would work for 8 servos. It has 16 IO pins. You need 18 IO pins, 9 for switches and 9 to controll the servos. A protoboard would work. You could use the Servo32v7 object in the library that comes with the Propeller Tool to control the servos. A very short Spin program could read the switches and send commands to the Servo32v7 object to move the servos.

    John Abshier
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-03 18:14
    A real low tech way to do this would be to use 9 SPDT switches that would each connect a servo's control line to one of two pulse sources, one putting out pulses for position a and the other putting out pulses for position b. Each pulse source could be built with an LM556 dual timer. You could also use the USB Servo Controller to do this with two channels going and the switches selecting between the two channels. You'd use the USB connection to start up each channel and you could even store the values for each channel in the EEPROM in the Servo Controller so that those channels start up at the proper positions when the power is turned on so you don't need the USB connection once it's configured properly. Read the Servo Controller documentation for a description of the commands needed to do this.

    Post Edited (Mike Green) : 2/3/2010 6:19:35 PM GMT
  • JonnyMacJonnyMac Posts: 9,208
    edited 2010-02-03 18:37
    Keep in mind that the Propeller on the PSC gets its power from the USB port or the Serial header; if you're using it stand-alone (like I will be, shortly), you need to provide 5v to the R pin on the Serial header.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • phil_lightphil_light Posts: 7
    edited 2010-02-03 18:53
    Mike, That's an interesting idea (SPDT switches) switching pulse sources.

    Just as a little background, this is for a model railroad, and I'm looking at using cheap servos to control the turnouts (switching track) on the railroad. There is a product in the hobby called a tortoise switch machine, which is essentially a prepackaged servo with a preset travel distance built in that is controlled by a toggle switch. They're on the order of $15 each minus switches, and I need 9 of them. I'm just exploring whether it's feasible to save a little cash and learn something new by using cheap servos and building a controller for them. So I'm trying to build the switch machines for less than around $140.

    I'm off to research more now. Thanks for the help guys!
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-03 19:45
    I'd go for the Propeller Protoboard. You'll need 1K resistors to put in series between the I/O pins and the servo control signal lines (to dampen noise). You'll need SPST switches. I'd use 10K pullup resistors to 3.3V at the I/O pins and 1K series resistors between the I/O pins (and pullups) and the switches with the other terminal of the switches connected to ground.

    My reasoning on this is that most of the software is already done (the servo driver) and is essentially what's used in the Servo Controller. Reading the switches and moving the servos is pretty easy stuff. You'll use 18 out of 28 uncommitted I/O pins leaving 10 for all kinds of stuff. At the very least, you could add a display or 9 LEDs or 9 red/green LEDs or track sensors or whatever. If you want to get fancy and save I/O pins for other tasks, you could wire up the 9 switches into a 3x3 matrix and only use 6 I/O pins to scan it.
  • phil_lightphil_light Posts: 7
    edited 2010-02-03 20:14
    Mike, I think I'm following you so far. I noticed that the propeller protoboard says it has 4 "sockets" for servos. Does that mean powering the servos via the board itself right? which I wouldn't really need since I'd be powering the servos via another power source and just using the protoboard to control the signal wire from the servos. I was actually thinking the same thing with the LEDs. I think the protoboard makes more sense.

    The only thing I can see as a potential issue (correct me if I'm wrong) is that using the same pulse to control any or all of the servos requires pretty accurate placement/positioning of the servos right?

    I might just buy some stuff and start learning/experimenting. I'm sure I can put the board to use in one way or another.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-03 20:27
    The Protoboard just has 4 partially prewired areas for connecting servos. The power line can be connected to the 5V regulator or the unregulated input voltage. In your case, you might as well set up your own servo connectors and ignore the ones on the board.

    For adjusting a servo where several might be fed by the same control pulse, you'd just position the servo to some known position (usually at 1.5ms), remove the servo "horn" used to attach whatever mechanical linkage you're using, turn it to some other position, then reattach the "horn" to the servo shaft. The servos have spline shafts, so they're not infinitely adjustable, but most mechanical arrangements have some "slop" in them.

    By all means experiment. The Protoboard is fairly cheap and, if you get the USB version, all you need is the free software and a source of power to start with it.
  • cm5299cm5299 Posts: 12
    edited 2010-02-03 20:51
    phil_light said...
    Mike, I think I'm following you so far. I noticed that the propeller protoboard says it has 4 "sockets" for servos. Does that mean powering the servos via the board itself right? which I wouldn't really need since I'd be powering the servos via another power source and just using the protoboard to control the signal wire from the servos. I was actually thinking the same thing with the LEDs. I think the protoboard makes more sense.

    The only thing I can see as a potential issue (correct me if I'm wrong) is that using the same pulse to control any or all of the servos requires pretty accurate placement/positioning of the servos right?

    I might just buy some stuff and start learning/experimenting. I'm sure I can put the board to use in one way or another.
    In addition to working for what you are describing, you could also install switches to throw combinations of track switches. Maybe only have one switch control a crossover instead of two.
  • phil_lightphil_light Posts: 7
    edited 2010-02-03 21:29
    cm5299 said...
    In addition to working for what you are describing, you could also install switches to throw combinations of track switches. Maybe only have one switch control a crossover instead of two.

    Exactly what I was thinking. I could have blocks of switches that normally switch to route trains based on typical routing. All of these things are why I'm thinking that building something vs buying some "dumb" switches is a good investment. Even if it ends up costing as much, I'll get a lot more out of it. Especially in terms of knowledge/learning. It seems very doable, so I'm going to do some more research and hopefully some experimenting soon. I'm reading the propeller manual right now.

    I'm sure I'll be around asking questions. Seems like a great forum!

    Post Edited (phil_light) : 2/3/2010 9:38:26 PM GMT
  • cm5299cm5299 Posts: 12
    edited 2010-02-03 21:34
    phil_light said...
    cm5299 said...
    In addition to working for what you are describing, you could also install switches to throw combinations of track switches. Maybe only have one switch control a crossover instead of two.

    Exactly what I was thinking. I could have blocks of switches that normally switch to route trains based typical routing. All of these things are why I'm thinking that building something vs buying some "dumb" switches is a good investment. Even if it ends up costing as much, I'll get a lot more out of it. Especially in terms of knowledge/learning. It seems very doable, so I'm going to do some more research and hopefully some experimenting soon. I'm reading the propeller manual right now.

    I'm sure I'll be around asking questions. Seems like a great forum!
    I am pretty new with the propeller. If you haven't already found these, check them out:

    Here's a "master thread" of topics on the prop.
    http://forums.parallax.com/forums/default.aspx?f=25&m=335240

    Here is a book I liked better than the "manual".
    http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/PELabsFunBook-v1.1.pdf
    I found it easier to understand when getting started.
  • hover1hover1 Posts: 1,929
    edited 2010-02-03 22:46
    Jon, while you spot on about providing 5VDC to the board, and connecting it to the "R" pin on the Serial Input header, it may have some confusion·to the casual viewer.

    To reinforce what Jon said, 5VDC needs to go to the center pin of J2. That's J2 on the schematic, it's not silkscreened on the board. This is the 6 pin header above the P0-P7 header which is the 24 pin header. It's actually called "Vext" on the schematic.

    The attached pictures show my standalone board with·6VDC 1.8A input soldered directly to the bottom of the servo·power input terminals, and a 5 volt LDO regulator screwed into the terminal block with the output lead wire wrapped and connected to the Vext on the serial input.·Just wanted to make sure no one connected 5VDC input to any of the "P" out "R" buss.·· center terminals of the "P Servo Out" connectors.

    Jim
    JonnyMac said...
    Keep in mind that the Propeller on the PSC gets its power from the USB port or the Serial header; if you're using it stand-alone (like I will be, shortly), you need to provide 5v to the R pin on the Serial header.

    Post Edited (hover1) : 2/4/2010 12:04:02 AM GMT
  • Nick McClickNick McClick Posts: 1,003
    edited 2010-02-04 06:09
    What about something like the Simple Servo Tester? It just uses a 555 to generate the servo pulse. That only controls 2 servos, but you could extend the concept to control more.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Forums RSS Feed!

    Gadget Gangster - Share your Electronic Projects
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-04 06:18
    Nick, thanks for mentioning the Servo Tester. Two of those would make a perfect source for the two streams of control pulses to be selected by SPDT switches for the "low tech solution".
  • phil_lightphil_light Posts: 7
    edited 2010-02-04 11:51
    Nick, Thanks! I actually found that yesterday after Mike mentioned using a dual timer to create the pulses. I'll probably need some help integrating that circuit into my project. I get the concept(s), just not 100% clear on the implementation.
  • phil_lightphil_light Posts: 7
    edited 2010-02-04 15:01
    This was intriguing too. http://www.gadgetgangster.com/find-a-project/56?projectnum=159

    I'm thinking now that if I could just modify this gadget to allow me to select a specific servo to switch, I could avoid the 9 spdt switches. Any thoughts?

    I feel like someone who wants to build a cabinet, but the only tools I've even heard of are a hammer and a screwdriver, and I'm not really sure how to use them. You guys know all the tools and how to use them.
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2010-02-04 15:54
    I have a pretty cool servo controller that has 16 servo outputs based on a 74HC595. I posted the object on the obex about two months ago. If you want more info, PM me.
    I might have missed it somewhere in the thread but just in case I didn't, the USB spec calls for only 500mA of available current for the device. Although some hubs and computers are a little more generous, running all those servos simultaneously with only 500mA will be ugly.

    Jim-

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Signature space for rent!
    Send $1 to CannibalRobotics.com.

    Post Edited (CannibalRobotics) : 2/4/2010 4:00:27 PM GMT
    1001 x 862 - 526K
  • phil_lightphil_light Posts: 7
    edited 2010-02-05 15:18
    I wanted to thank you guys for your thoughts on this. It seems that someone has already been down this exact route, and their product is priced at a point it doesn't make sense to reinvent the wheel. If anyone is interested here's the product:

    http://www.tamvalleydepot.com/products/octopusservodriver.html
  • hover1hover1 Posts: 1,929
    edited 2010-02-05 15:35
    That look's like it was custom made for you! The good news is, it uses a Parallax SX chip! And it's programable. Good luck with it.
    Jim
Sign In or Register to comment.