Cyclic redundancy check (crc) error detection – Pololu Simple User Manual
Page 84
ID Name
Type
Description
Units
30
Max Speed
Forward
unsigned
16-bit
Maximum allowed motor speed in the forward direction (0 to
3200).
internal units
31
Max
Acceleration
Forward
unsigned
16-bit
Maximum allowed motor acceleration in the forward direction
(0 to 3200; 0 means no limit).
Δspeed per
update period
32
Max
Deceleration
Forward
unsigned
16-bit
Maximum allowed motor deceleration from the forward
direction (0 to 3200; 0 means no limit).
Δspeed per
update period
33
Brake Duration
Forward
unsigned
16-bit
Time spent braking (at speed 0) when transitioning from
forward to reverse.
ms
36
Max Speed
Reverse
unsigned
16-bit
Maximum allowed motor speed in the reverse direction (0 to
3200).
internal units
37
Max
Acceleration
Reverse
unsigned
16-bit
Maximum allowed motor acceleration in the reverse direction
(0 to 3200; 0 means no limit).
Δspeed per
update period
38
Max
Deceleration
Reverse
unsigned
16-bit
Maximum allowed motor deceleration from the reverse
direction (0 to 3200; 0 means no limit).
Δspeed per
update period
39
Brake Duration
Reverse
unsigned
16-bit
Time spent braking (at speed 0) when transitioning from
reverse to forward.
ms
The Simple Motor Controller uses an internal system of units, labeled internal units in the above
tables, where 3200 represents the maximum possible motor speed in the forward direction, 0 represents
a stopped motor, and -3200 represents the maximum possible motor speed in the reverse direction. The
RC and analog channel inputs are scaled from their raw units into this internal “-3200 to +3200” unit
system using the channel calibration settings.
6.5. Cyclic Redundancy Check (CRC) Error Detection
For certain applications, verifying the integrity of the data you are sending and receiving can be very important.
Because of this, the Simple Motor Controller has optional 7-bit cyclic redundancy checking, which is similar to a
checksum but more robust as it can detect errors that would not affect a checksum, such as an extra zero byte or bytes
out of order.
Cyclic redundancy checking can be enabled by selecting a CRC Mode of “Commands only” or “Commands and
responses” in the Input Settings tab of the Simple Motor Control Center. In CRC mode, the Simple Motor Controller
expects an extra byte to be added onto the end of every Binary-mode command packet (CRC error checking is not
available when the serial mode is “ASCII”). The most-significant bit of this byte must be cleared, and the seven least-
significant bits must be the 7-bit CRC for that packet. If this CRC byte is incorrect, a CRC Error will occur and the
command will be ignored. The Simple Motor Controller will append a CRC byte to the data it transmits in response
to serial commands if the CRC mode is “Commands and responses”.
A detailed account of how cyclic redundancy checking works is beyond the scope of this document, but you can
find more information using
. The CRC computation is
Pololu Simple Motor Controller User's Guide
© 2001–2014 Pololu Corporation
6. Using the Serial Interface
Page 84 of 101