Shop OBEX P1 Docs P2 Docs Learn Events
Parallax psc 16 channel servo controller — Parallax Forums

Parallax psc 16 channel servo controller

StampNut2StampNut2 Posts: 224
edited 2008-02-06 00:38 in Robotics
Hello, Would anyone here be able to help me with a project I am doing involving the use of 6 servo's with a BS2P40 and Parallax'a psc 16 channel servo controller. I am building a Wall-E Robot with U/S ping using Pan/tilt servo's, Mattracks and servo's, Front door on Wall-E and a general use of his arms, maybe just up and down movement.
Could anyone please post sample code that I could use for operating 6 servo's. Thanks for your time.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never give up when things go wrong, Just work them out.

robosapienv2-4mem8.page.tl/

Comments

  • Sadao Fujiwara-sanSadao Fujiwara-san Posts: 31
    edited 2008-01-31 20:02
    if you give me some info about the bot like what it does i may be able to help

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sadaao Fujiwara-san




    Never offend people with style when you can offend them with substance
    Sam Brown··············

    ·
  • StampNut2StampNut2 Posts: 224
    edited 2008-02-04 17:36
    StampNut2 said...
    Hello, Would anyone here be able to help me with a project I am doing involving the use of 6 servo's with a BS2P40 and Parallax'a psc 16 channel servo controller. I am building a Wall-E Robot with U/S ping using Pan/tilt servo's, Mattracks and servo's, Front door on Wall-E and a general use of his arms, maybe just up and down movement.
    Could anyone please post sample code that I could use for operating 6 servo's. Thanks for your time.

    Would anybody be willing to help me on this coding for the psc 16 channel controller. I know there is sample code on Parallax's site for PC operation, But would like sample code for BS2P40 direct operation. Thanks again.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never give up when things go wrong, Just work them out.

    robosapienv2-4mem8.page.tl/
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-04 17:44
    The USB PSC and the Serial PSC are essentially the same except for the serial interface. The documentation for the serial version has sample code for use with a Stamp. The only difference between using a BS2 and a BS2p40 as far as you're concerned is the value of the Baud constant used in the SERIN/SEROUT statements. The Parallax Basic Manual gives the proper values in the chapter on SERIN/SEROUT.
    Go to the webstore page for the PSC and look for the links for the documentation and the sample code.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-02-04 20:39
    I think to make Mike’s post a bit more clear…The USB and Serial PSC are identical. They both work as a Serial PSC and have the same connectors. The USB version simply adds a USB connector as well. It can therefore accept serial data from a line-level device or a USB port (configured for VCP).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • StampNut2StampNut2 Posts: 224
    edited 2008-02-05 07:14
    Thanks for your time guys, I realize the USB and serial are the same, I was just asking if anyone would know how to code 6 servo's, Would this fit into the 20ms timing frame using the psc instead of directly from the BS2P40.
    Thanks again for your time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never give up when things go wrong, Just work them out.

    robosapienv2-4mem8.page.tl/
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-05 15:14
    The PSC takes over responsibility for the repeated control pulses. Once the PC or Stamp or whatever sends the pulse width and optional ramp timing to the PSC, the PSC handles everything. The PC or Stamp doesn't have to do anything further unless a different servo position is needed. This is true whether 1 or 16 servos are in use.
  • StampNut2StampNut2 Posts: 224
    edited 2008-02-05 17:54
    Mike Green: So what you are saying is that the PSC is similar to a co-Processor in that it off loads work from the stamp leaving it to do other processes!. So can you advise me if I wanted to control 6 servo's, ! U/S ping and 3 Gd2P12 I/R sensors the stamp can handle this within the 20 ms timing?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never give up when things go wrong, Just work them out.

    robosapienv2-4mem8.page.tl/

    Post Edited (StampNut2) : 2/5/2008 5:59:27 PM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-02-05 18:53
    StampNut2 -

    Yes, that is EXACTLY what it does, and is the purpose for using it.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There is no pleasure in having nothing to do;
    the fun is in having lots to do, and not doing it!
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-05 19:03
    If you use a PSC or ServoPAL or other co-processor, there is no longer a 20ms cycle required. The Stamp can trigger the PING and wait for the response, go on to read the I/R sensor values, do whatever processing you want to do with the information, then send new position or speed information to the PSC and the PSC will change the timing of the pulses that it has been sending out every 20ms or so.
  • StampNut2StampNut2 Posts: 224
    edited 2008-02-05 21:14
    Cool guys, That is what I wanted to know, Thank you. One more question if you guys do not mind answering, What is the maximum amount of sensors that a BS2P40 stamp can handle within the 20ms cycle, I guess that it would depend on whether it is reading ALL sensors at the same time OR just one at a time? This is what I am building at present. Wall-E from the up and coming movie in June.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never give up when things go wrong, Just work them out.

    robosapienv2-4mem8.page.tl/

    Post Edited (StampNut2) : 2/5/2008 9:27:34 PM GMT
    127 x 127 - 3K
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-05 21:34
    How many sensors depends on what you have to do to get a sensor to work. Check out www.emesystems.com for a discussion of execution speed for the various Stamps (and lots of other useful information). You are unlikely to be able to read more than one sensor at a time since (again) the Stamp is a single threaded processor.

    For complex, overlapping sensing and control, you can't beat the Propeller. It's got 8 independent processors each of which can do a lot. One of them can control up to 32 servos like the PSC. Another can handle the PING. Another can handle IR distance sensing. Another can provide floating point. One can talk to a PC over a wireless link. One can be the main processor and handle overall control. That still leaves two.

    You could use one of those to drive an SD memory card and one to play back sound ... like .WAV files.
  • StampNut2StampNut2 Posts: 224
    edited 2008-02-05 21:39
    M'mmmm. I have been tempted to buy a prop, It's just that I have two BSP40's and would like to use it, But, I am willing to invest in a prop if I have to. Can you advise me Mike other than the prop chip what board would suit my application for the prop chip and any other accessories that I may need to get this project under way.. Thanks.
    Also how easy or not is it to program the prop for those sensors and servos.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never give up when things go wrong, Just work them out.

    robosapienv2-4mem8.page.tl/

    Post Edited (StampNut2) : 2/5/2008 9:44:23 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-05 23:52
    If want something like a BSp40 in size and function, I'd get a USB PropStick because it has the 3.3V regulator and EEPROM (and programming interface) right on the module like the BSp40. If you want to build up on a board like the Super Carrier board, I'd get a Protoboard. It's cheaper too, but is larger than what you could build up from a PropStick.

    Have a look at the Propeller Object Exchange. It already has "objects" for servo control and the PING. I think there was something for the IR sensors too, but I'm not sure.
  • StampNut2StampNut2 Posts: 224
    edited 2008-02-06 00:38
    Thanks again for your help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never give up when things go wrong, Just work them out.

    robosapienv2-4mem8.page.tl/
Sign In or Register to comment.