Shop OBEX P1 Docs P2 Docs Learn Events
USB PSC at 38.4 - dropped frames? — Parallax Forums

USB PSC at 38.4 - dropped frames?

K.C.K.C. Posts: 2
edited 2007-11-09 22:59 in Robotics
Hello,

I have written a C# application to send commands to the PSC. At 2400 baud, the servo responds as expected, but if I'm updating all 16 channels (assuming a single PSC), I'm limited to roughly two position updates every second. If I take it up to 38400 baud, which I seem to do successfully (VER command is successful), it seems to start dropping frames. The servo eventually stops responding and I eventually have to reset the PSC. Now, if I only send a single channel's worth of data, there is no problem. More than 1 channel, it gets flaky. 16 channels, it tanks.

Anyone know of any tricks to sending position commands at 38400? I'm doing the exact same thing I'm doing at 2400 baud.

Thanks!

K.C.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-09 22:32
    The PSC is not as fast as you might think. Probably the best way to handle this is to check in the C# application whether the servo position has changed from the last update and simply not send the update if nothing has changed. Two position updates a second are really 32 updates a second.

    You could use a Propeller as a servo controller and it could easily keep up with updates at 38.4kBaud or faster and up to 28 servos.
    The routines for servo control and a full duplex serial channel already exist. All you'd need is the "glue" for the PSC command interpretation.
  • K.C.K.C. Posts: 2
    edited 2007-11-09 22:59
    Thanks for the reply, Mike.

    The application does actually wait until there is a change in the data states before sending an update to the hardware. The potential is there for the users to have 10 or more state changes/second, as they're used to this with other [noparse][[/noparse]non-servo] hardware. It may just be that they have to limit themselves when using a PSC.

    Part of what confuses me is that the PSC supports 38.4, but the PSC only seems to respond correctly at 2400 (when sending the full 16 channels). My test sequence sends updates at 1-second intervals for about 5 seconds, so I'm not exactly pushing the envelope here.
Sign In or Register to comment.