A.08. command 188: set brake duration, Section 3.a.08 – Pololu Orangutan X2 User Manual

Page 9

Advertising
background image

command byte = 208 | motor bit

data byte = 7-bit acceleration (MSB always zero)

3.a.08. Command 188: Set Brake Duration

Effect: Sets the duration the specified motor spends braking low at 100% duty cycle when issued an acceleration
command (228—

Section 3.a.06

or 232—

Section 3.a.04

) that results in a change of direction. The brake duration

value is in tens of milliseconds, so a value of 1 will result in a brake duration of 10 ms and a value of 127 will
result in a brake duration of 1.27 seconds. A brake duration value of 0 causes the motor to switch direction with
no braking in between. Brake duration is a seven-bit value.

This command does not save the brake duration value to EEPROM, however it can be saved by issuing a separate
EEPROM-write command (240—

Section 3.d.02

) that stores the value at the appropriate address (11 for motor 1,

12 for motor 2). It is possible to safely store 8-bit values at these location if you need longer brake durations than
1.27 seconds.

Note: this command is bugged in firmware version 1.00 and has no effect, but it has been fixed in version 1.01.

Values sent: motor (1 bit), brake duration (7 bits)

command byte = 188 | (motor bit << 1)

data byte = 7-bit brake duration (MSB always zero)

3.a.09. Command 212: Set Number of Current Sense Samples in Averages

Effect: This setting determines how many current sense samples will be in each motor’s current average. These
averages are what the Get Currents command (216—

Section 3.a.12

)) returns. Each motor’s current average is a

running average that is updated every other ADC conversion. The ADC can perform conversions at approximately
10 kHz, which means each motor’s current average is updated at approximately 5 kHz. The previous X samples
are stored in memory, and the average returned is the average of those X most recent samples. This setting
determines the value of X. The values are sent as three-bit, base-two exponents, meaning that the largest sample
size allowed per average is 2

7

(128) while the smallest is 2

0

(1).

It is important to note that current sensing is not possible in joint motor mode. As such, this command has no effect
when running in joint motor mode. It is also important to note that current sensing is only possible when using a
motor driver daughter board that has VNH2SP30s (the VNH3SP30 does not provide current sense feedback).

This command does not save this setting to EEPROM, however it can be saved by issuing separate EEPROM-
write commands (240—

Section 3.d.02

) that store the values at the appropriate addresses (3 for motor 1, 4 for

motor 2). The values stored in EEPROM should be the actual number of samples to average, not the exponents.
For example, if you are sending an exponent of 5 for motor 1 to the mega168 via this command, you should send
a value of 2

5

(32) to be stored in byte 3 of the mega168’s EEPROM. The value you store must be a power of two.

Values sent: motor 1 current sense samples exponent (3 bits), motor 2 current sense samples exponent (3 bits)

command byte = 212

data byte = (motor 2 current sense samples exponent << 3) | motor 1 current sense samples exponent

Orangutan X2 Command Documentation v1.01

© 2001–2010 Pololu Corporation

3. Low-Level SPI Commands

Page 9 of 27

Advertising