Understanding Sequencing/Aborting Commands

First off - I have had a GREAT experience with this board. I absolutely love it.

I use a Mac, so I wrote my own little application in Processing to send commands over to the board, and it’s working like a charm, over XBee and everything :slight_smile:

I just want to make sure I am understanding something - I apologize in advance if this is a really dumb question.

I wrote a rudimentary creep gait for my robot by hard-coding in sequences of movements, and then sending out the commands over serial using a timer. It works, but due to an error in my program’s timer, I discovered that in some cases, commands are being sent while the board’s is still moving. I noticed because the stop command, which positions the bot in a neutral position was not responding immediately.

Am I correct to understand that if I send the board a bunch of commands at once - for instance:

#0 P500 T1000\n
#0 P2500 T3000\n
#0 P1500 T2000\n

These commands will all run, one after another? If I am interpreting what I am seeing correctly, this is the case.

If so, how can I abort all scheduled moves, and send a new position.

For instance, in the above example, what if 500ms after I send those three commands, I send another one:

#0 P750 T1000\n

Hopefully my question is clear - if not please let me know. Thanks for this product, it is amazing!

Hi,

Here are some answers concerning your questions:

If all three of those commands are sent to the SSC-32U without any pauses in-between them, then only the last one will likely have time to be executed at all. Simply put, whenever the SSC-32U receives a command for a specific channel, it will set that as its new goal. This cancels any other move command for that channel. You can read more about the command set in the SSC-32U manual on pages 24-26.

As mentioned above, the simple act of send a new move command for a channel will cancel the previous move command on that channel.

As a side note, if you send position 0 to a servomotor, it will put the control signal to “LOW” (or 0 V DC), which will make it unpowered and able to move freely (with no resistance).

Sincerely,

Thank you so much for your reply!

That clears things up for me. Looks like my problem is somewhere in my program :confused:

I think what I need to do is have the control system poll the board to see if it is finished moving before sending any other commands, so I can be sure that the bot is ready.

Thanks again!