Shop OBEX P1 Docs P2 Docs Learn Events
Parallax Servo Controller — Parallax Forums

Parallax Servo Controller

Tony BoersmaTony Boersma Posts: 41
edited 2007-03-19 19:26 in BASIC Stamp
I have a question about the PSC. If when using with a BS2, will the program stop at the PSC line until all of the communications have been sent and then resume?
Basically do I need to account for the time delay when writing my code?
Thanks
Tony

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-07 16:44
    I'm not quite sure what you're asking. The BS2 communicates with the PSC using the SERIN and SEROUT statements. These are not buffered. In other words, the BS2 can't continue to the statement after the SEROUT until the data has been transmitted. That doesn't mean that the PSC has completely acted on the data, just that the Stamp finished sending it. You do need to account for the time the Stamp spends sending the data to the PSC.
  • slamerslamer Posts: 52
    edited 2007-03-08 03:41
    Ya Mike.

    ·From what·I have tried (so far).· Once you send the serial data to the PSC board·it will send the signal you sent to the output channels for each servo (or whatever)·until you tell it to stop or shut off the power. About the time EVA ran over my foot·I figured that out and then had to add a (Woah·Nelly please stop now sub-routine). Basically send the PSC and·each servo a pulse width of 750 or so (since they· servo's·were modified for continious rotation) The PSC is a cool little board and it can solve a lot of timing problems. But like everything that I've worked with you have to ponder every little step.

    Of course·I usually learn new things from Trial and Terror. My larger robots have left me with several scars from the lessons they taught me.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    undefinedundefinedundefinedundefinedSteven Kirk Nelson (slamer)

    Team K.I.S.S
    Build Safe, Build Mean, Build Strong!
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-08 03:59
    Yep, that's what it's designed to do. You tell it to go and it does so until you tell it to stop. For standard servos, this is ideal since they'll maintain position that way without further attention. For continuous rotation servos, as you've noticed, they'll maintain velocity without further attention. For those, it would certainly be nice to be able to set a "time to go" and have the controller automatically "idle" the servo after that.

    I'll put a plug in for the Propeller which can do that sort of thing very easily.
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-03-08 14:24
    1. Yes, when you do a SEROUT to the PSC, the BS2 waits until the SEROUT is complete before continuing to execute the next instruction.

    2. Having told the PSC to move a servo to a particular position, you don't need to tell the PSC again, unless you want to move to a different position. That's why people use the PSC, to offload this 'time critical' refresh from the BS2 to the PSC.
  • Tony BoersmaTony Boersma Posts: 41
    edited 2007-03-19 17:07
    Thanks.

    I believe the first reply was exactly what I was looking for. Now, just wondering if I sent a command to all 16 at one time, for a BS2 approx. how long would that take?

    Thanks,

    Tony
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-19 19:26
    Tony,
    It mostly depends on the number of characters to be sent and the Baud involved. Each character takes 10 bit times, so 9600 Baud transmits about 960 characters a second or a little more than 1ms per character. 2400 Baud is 1/4 that speed or about 4ms per character. Tracy Allan's website (www.emesystems.com) has a note describing the approximate execution times for a variety of PBasic statements for several Stamp models. Have a look.
    Mike
Sign In or Register to comment.