Pololu Orangutan X2 User Manual
Page 7
![background image](/manuals/570388/7/background.png)
If you want to run your X2 in joint motor mode, you should connect one terminal of your motor to the two M1
outputs and the other terminal of your motor to the two M2 outputs.
It is important to note that current sensing is not possible in joint motor mode. The Set Current Limits command
(192—
) will have no effect in joint motor mode and the Get Average Motor Current command
) will not return anything meaningful.
Values sent: motor mode (1 bit)
command byte = 214 | motor mode bit
3.a.02. Command 128: Independent Motor Brake (inB = inA)
Effect: Causes the specified motor to immediately brake high (inA bit = 1) or low (inA bit = 0) with the desired
PWM
Values sent: motor (1 bit), inA (1 bit), PWM (8 bits)
command byte = 128 | (motor bit << 2) | (inA bit << 1) | MSB of PWM
data byte = 7 lower bits of PWM byte
3.a.03. Command 136: Independent Motor Drive (inB = ~inA)
Effect: Causes the specified motor to immediately drive forward (inA bit = 0) or reverse (inA bit = 1) with the
desired PWM
Values sent: motor (1 bit), inA (1 bit), PWM (8 bits)
command byte = 136 | (motor bit << 2) | (inA bit << 1) | MSB of PWM
data byte = 7 lower bits of PWM byte
3.a.04. Command 232: Independent Motor Drive with Acceleration (inB = ~inA)
Effect: Causes the specified motor to transition from its current direction and PWM to the desired direction PWM
at a rate determined by its corresponding acceleration setting. If the desired motor direction (forward for inA = 0
and reverse for inA = 1) is the same as the current direction and the desired PWM is less than the current PWM,
the PWM will be set directly to the desired value during the next PWM-update phase of the mega168 main loop
(sometime in the next 10ms). In short, this command will not produce artifical deceleration to slow a motor. The
only time the acceleration comes into play is when the PWM is increasing in a specific direction. If this command
results in a change of direction, the motor is first stopped by braking low at 100% duty cycle for a duration that
can be set using command 188 (
). The PWM is then linearly incremented from zero to the desired
PWM in the desired direction based on the acceleration setting, which can be set using command 208 (
). Acceleration updates to the PWM are performed 100 times per second if possible. It is important to note
that acceleration timing is done using the motor 1 PWM timer, so decreasing motor 1’s PWM frequency below
100Hz will decrease the acceleration update rate.
Values sent: motor (1 bit), inA (1 bit), PWM (8 bits)
command byte = 232 | (motor bit << 2) | (inA bit << 1) | MSB of PWM
data byte = 7 lower bits of PWM byte
Orangutan X2 Command Documentation v1.01
© 2001–2010 Pololu Corporation
3. Low-Level SPI Commands
Page 7 of 27