A.07. command 208: set acceleration, Section, A.07 – Pololu Orangutan X2 User Manual

Page 8

Advertising
background image

3.a.05. Command 144: Joint Motor Operation (inA1 = inB1 = in1; inA2 = inB2 = in2)

Effect: Use dual motor drivers together as a single, more powerful motor driver. The settings of in1 and in2
determine if the effect is brake low, forward, or reverse at thedesired PWM. This command sets motor to the
specified state immediately. It is not possible to brake high in joint motor mode. It is also not possible to take
advantage of current-sensing while in joint motor mode. Joint motor control works by PWMing the low output
side while holding the other side constantly high. Here is how it performs the following actions:

• Joint brake (in1 = in2): both H-bridges alternate between high impedance and driving low at the same
synchronized duty cycle.

• Joint “forward” (in1 = 0, in2 = 1): H-bridge 1 alternates between high impedance and driving low while
H-bridge 2 drives high.

• Joint “reverse” (in1 = 1, in2 = 0): H-bridge 2 alternates between high impedance and driving low while
H-bridge 1 drives high.

The red/green LEDs on the daughter motor-driver board will not function in joint motor mode, nor will current-
sensing. To run your X2 in joint motor mode, you should connect one side of your motor to the two M1 outputs
and the other side of your motor to the two M2 outputs.

Values sent: in1 (1 bit), in2 (1 bit), PWM (8 bits)

command byte = 144 | (in1 bit << 2) | (in2 bit << 1) | MSB of PWM

data byte = 7 lower bits of PWM byte

3.a.06. Command 228: Joint Motor Drive with Acceleration (in2 = ~in1)

Effect: See “Independent Motor Drive with Acceleration” (

Section 3.a.04

) command. Joint Motor Drive uses the

dual motor drivers together as a single, more powerful motor driver. When operating in joint motor mode, settings
for operation are determined by “motor 1” (motor bit = 0) settings while “motor 2” settings are ignored.

Values sent: in1 (1 bit), PWM (8 bits)

command byte = 228 + (in1 bit << 1) + MSB of PWM

data byte = 7 lower bits of PWM byte

3.a.07. Command 208: Set Acceleration

Effect: Sets for the specified motor the acceleration used by the motor acceleration commands 228 (

Section

3.a.06

) and 232 (

Section 3.a.04

). While accelerating, the net effect is that the PWM is incremented by the

acceleration value every 100 ms. In reality, the updates will usually be increments of the one tenth the acceleration
value applied every 10 ms. The acceleration value for each motor is specified by a seven-bit number and will
change the duty cycle twice as quickly in seven-bit PWM mode as in eight-bit PWM mode. An acceleration value
of zero is treated as infinite acceleration and will simply set the PWM equal to the target PWM when the motor-
handling portion of the mega168’s main loop is executed sometime in the next 10ms.

This command does not save the acceleration values to EEPROM, however they can be saved by issuing separate
EEPROM-write commands (240—

Section 3.d.02

) that store the values at the appropriate addresses (9 for motor

1, 10 for motor 2). It is possible to safely store 8-bit values at these location if you need even higher accelerations
than 127.

Values sent: motor acceleration (7 bits), motor (1 bit)

Orangutan X2 Command Documentation v1.01

© 2001–2010 Pololu Corporation

3. Low-Level SPI Commands

Page 8 of 27

Advertising