Manual

pulled low through the LED). If shutdown-on-error configuration parameter is set to 1, motors M0 and M1 will
be stopped as a safety precaution when any of these errors occurs (see Section 5.c).
5.c. 0x83 & 0x84: Get & Set Configuration Parameter
The qik has four configuration parameters that are saved in non-volatile memory, and uses commands 0x83 and
0x84 to read and write these parameter values, respectively. The parameters are numbered as follows:
Configuration Parameters
0: Device ID
This parameter determines which device ID the unit will respond to when the Pololu protocol is used. It has
a default value of 9 (0x09 in hex) and can be set to any value from 0 – 127. When setting this parameter, you
should only have one qik on your serial line at a time.
1: PWM Parameter
This parameter determines frequency and resolution of the pulse width modulation (PWM) signal used to
control motor speed. Note that setting this parameter while the motors are running causes them to stop.
The least significant bit (bit 0) selects for 7-bit resolution when cleared (i.e. full motor speed is 127) and 8-bit
resolution when set (i.e. full motor speed is 255). A PWM with 7-bit resolution has twice the frequency of
one with 8-bit resolution.
Bit 1 of this parameter selects for high-frequency mode when cleared and low-frequency mode when set.
Using high-frequency mode puts the PWM frequency outside the range of human hearing if you are also in
7-bit mode (or very close to it if you are in 8-bit mode), which can help you decrease motor noise. Using low
frequency mode has the benefit of decreasing power losses due to switching.
The default value for this parameter is 0 (high-frequency 7-bit mode, resulting in a PWM frequency of
31.5 kHz).
Valid values for this parameter are:
0 = high-frequency, 7-bit mode (PWM frequency of 31.5 kHz, which is ultrasonic)
1 = high-frequency, 8-bit mode (PWM frequency of 15.7 kHz)
2 = low-frequency, 7-bit mode (PWM frequency of 7.8 kHz)
3 = low-frequency, 8-bit mode (PWM frequency of 3.9 kHz)
2: Shutdown Motors on Error
When this parameter has a value of 1, both motors M0 and M1 are stopped as a safety precaution whenever
an error occurs; otherwise, if this parameter has a value of 0, errors will not affect the motors. For more
information on the various types of errors that can occur, see Section 5.b. This parameter has a default value
of 1 (shut down the motors on any error) and valid values for this parameter are 0 or 1.
3: Serial Timeout
When this parameter has a value of 0, 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 (assuming the
shutdown motors on error parameter set to a value of 1).
The timeout duration is specified in increments of 262 ms (approximately a quarter of a second) and is
calculated as the lower four bits (which are interpreted as a number from 0 – 15) times two to the upper three
Qik 2s9v1 User's Guide © 2001–2012 Pololu Corporation
5. Serial Commands Page 16 of 24