beautypg.com

Serial timeout, Motor m0 acceleration, Motor m1 acceleration – Pololu Qik 2s12v10 User Manual

Page 20

background image

• bit 1: if this bit is set, stop motors M0 and M1 when any motor-over-current error occurs.

• bit 2: if this bit is set, stop motors M0 and M1 when any motor-fault error occurs.

When this parameter has a value of 7, both motors M0 and M1 are stopped as a safety precaution whenever
any error occurs; conversely, if this parameter has a value of 0, no error causes the motors to stop. For more
information on the various types of errors that can occur, see

Section 5.c

.

3:

Serial Timeout

default value: 0 (serial timeout disabled)
allowed values: 0 – 127
When this parameter has a value of zero, the serial timeout feature is inactive. Otherwise, the value of this
parameter controls how much time can elapse between receptions of valid command packets before a serial
timeout error is generated. This can be used as a general safety feature to allow the qik to identify when
communication with the controlling device is lost and shut down the motors as a result. Note: The shut-down-
motors-on-error
parameter must have bit 0—its serial error shut down bit—set for the timeout error to turn off the
motors.

The timeout duration is specified in increments of 250 ms (a quarter of a second) and is calculated as the four
least-significant bits (which are interpreted as a number from 0 – 15) times the quantity 2 to the three most-
significant bits (which are interpreted as a number from 0 – 7) power. If the four least-significant bits are called L
and the three most-significant bits are called M, the equation for the length of the timeout duration would be:

timeout = 0.25 seconds * L * 2

M

= L * 2

M-2

seconds

For example, if the timeout parameter is set as 0x5E (01011110 in binary), we have that L = 1110 (binary) = 14
(decimal) and M = 101 (binary) = 5 (decimal), which results in a timeout duration of:

• 0.25s * 14 * 2

5

= 112 seconds.

The maximum timeout duration (arising from a parameter value of 127) is 8 minutes and the minimum timeout
duration (arising from a parameter value of 1) is 250 ms.

4:

Motor M0 Acceleration

5:

Motor M1 Acceleration

default value: 0 (controlled speed ramping disabled)
allowed values: 0 – 127

When one of these parameters has a value of zero, acceleration control of the associated motor is inactive.
Otherwise, the M0 and M1 acceleration parameters control the rate at which the the M0 and M1 speeds are
allowed to increase over time, respectively. These parameters provide a great way to smooth out your motor
control and reduce current spikes caused by sharp increases in motor speed or changes in motor direction.

When acceleration control is active, a set-motor command tells the qik your desired target direction and speed.
One of three cases can then occur:

• If the target speed is lower than the motor speed and the target direction matches the current direction, the
motor speed is immediately set to the target speed.

• If the target speed is higher than the motor speed and the target direction matches the current direction, the
qik linearly ramps the motor speed up to the target speed by adding the value of the associated acceleration
parameter to the speed every 40 ms.

Qik 2s12v10 User's Guide

© 2001–2012 Pololu Corporation

5. Serial Parameters and Commands

Page 20 of 33