Pololu Simple User Manual

Page 68

Advertising
background image

ID

Name

Allowed Values

Units

0 or 4

Max Speed Forward

0–3200

0=0%, 3200=100%

1 or 5

Max Acceleration Forward 0–3200 (0=no limit)

Δspeed per

update period

2 or 6

Max Deceleration Forward 0–3200 (0=no limit)

Δspeed per

update period

3 or 7

Brake Duration Forward

0–16384

4 ms

0 or 8

Max Speed Reverse

0–3200

0=0%, 3200=100%

1 or 9

Max Acceleration Reverse 0–3200 (0=no limit)

Δspeed per

update period

2 or 10

Max Deceleration Reverse 0–3200 (0=no limit)

Δspeed per

update period

3 or 11

Brake Duration Reverse

0–16384

4 ms

Note: The Brake Duration units used by this command are 4 ms, which differs from 1 ms units used
by the Brake Duration variables returned by the Get Variable command.

The first limit value byte, limit byte 1, can be computed by taking the full limit value modulo (or “mod”) 128,
which is the same as dividing the value by 128, discarding the quotient, and keeping only the remainder. We
can get the same result using binary math by bitwise-ANDing the limit with 0x7F (127). In C (and many other
programming languages), these operations can be carried out with the following expressions:

limit_byte_1 = limit % 128;

or, equivalently:

limit_byte_1 = limit & 0x7F;

The second limit value byte, limit byte 2, can be computed by dividing the full limit value by 128, discarding the
remainder, and keeping only the quotient (i.e. turn the division result into a whole number by dropping everything
after the decimal point). We can get the same result using binary math by bit-shifting the limit right seven places. In
C (and many other programming languanges), these operations can be carried out with the following expressions:

limit_byte_2 = limit / 128;

or, equivalently:

limit_byte_2 = limit >> 7;

Note that the Hard Motor Limit settings place restrictions on the limit values you can set with this command (see

Section 5.2

for more information on the hard motor limits). The hard limits configured through the Simple Motor

Control Center are considered minimal safety requirements, and the temporary limits cannot be changed in a way
that makes the controller “less safe” than this. This means that the Maximum Speed, Acceleration, and Deceleration
temporary limits cannot be increased beyond their hard-limit counterparts and the Brake Duration limits cannot

Pololu Simple Motor Controller User's Guide

© 2001–2014 Pololu Corporation

6. Using the Serial Interface

Page 68 of 101

Advertising