Mini ssc protocol – Pololu Simple User Manual

Page 61

Advertising
background image

remaining bytes in the command packet are the same as the compact protocol command packet you would send, with
one key difference: the compact protocol command byte is now a data byte for the command 0xAA and hence must
have its most significant bit cleared
. Therefore, the command packet is:

0xAA

(170)

device

number

command byte (with MSB

cleared)

[data byte

1]

[data byte

2]

[data byte

n]

10101010

0XXXXXXX

0XXXXXXX

[0XXXXXXX] [0XXXXXXX] … [0XXXXXXX]

For example, if we want to set the motor speed to 3200 (full speed) forward, we could send the following byte
sequence:

Hex notation:

0xAA,

0x0D,

0x05,

0x00,

0x64

Decimal notation:

170,

13,

5,

0,

100

The byte 0x05 is the Set Motor Forward command (0x85) with its most significant bit cleared.

Mini SSC Protocol

The Simple Motor Controller also responds to the Scott Edwards Mini SSC protocol, a simple, three-byte serial
protocol commonly used by servo controllers. This protocol allows you to control up to 254 different motors by
chaining multiple motor controllers together. Since it only takes three serial bytes to set the speed of one motor, this
protocol is good if you need to send many commands rapidly to multiple motor controllers. The Mini SSC protocol
is to transmit 0xFF (255 in decimal) as the first (command) byte, followed by a Device Number byte and an 8-bit
motor speed byte. If you think of the available motor speeds as ranging from -127 to +127, the motor speed byte is
this signed speed value offset by 127. Therefore, A speed byte of 0 results in full-speed reverse, a speed byte of 127
results in speed 0 (motor stopped), and a speed byte of 254 results in full-speed forward. The command packet is:

0xFF (255) device number (0-254) speed byte (0-254)

11111111

XXXXXXXX

XXXXXXXX

For example, if we want to set the speed of device 13 to approximately half-speed forward (63+127=190), we could
send the following byte sequence:

Hex notation:

0xFF,

0x11,

0xBE

Decimal notation:

255,

13,

190

The Device Number byte and Speed byte can be any value except 255, though the Simple Motor Control center
will not let you set the controller’s Device Number to a value greater than 127. If the Device Number byte matches
the motor controller’s device number or if the Device Number byte is 254, the motor controller will respond to the
command (all controllers respond to Mini SSC commands addressed to Device Number 254).

The Simple Motor Controller identifies the Pololu, Compact, and Mini-SSC protocols on the fly when
configured in Binary serial mode; you do not need to use a configuration parameter to identify which
of these three protocols you are using, and you can freely mix commands in the three protocols.

Pololu Simple Motor Controller User's Guide

© 2001–2014 Pololu Corporation

6. Using the Serial Interface

Page 61 of 101

Advertising