beautypg.com

Serial parameters and commands, A. configuration parameters, Device id – Pololu Qik 2s12v10 User Manual

Page 19: Pwm parameter, Shut down motors on error, Section 5.a

background image

5. Serial Parameters and Commands

5.a. Configuration Parameters

The qik 2s12v10 has twelve configuration parameters that are saved in non-volatile memory, which means that
once set, these parameters will retain their values even if the unit is powered off. Commands 0x83 and 0x84 are
used to read and write these parameter values, respectively (see

Section 5.d

). Please note that the memory used to

store these parameters is only rated for approximately 100,000 erase/write cycles, so you should avoid putting set-
parameter
commands within loops that are executed many times a second; it is intended that these parameters will
initially be configured as desired and then only changed occasionally. The parameters are numbered as follows:

0:

Device ID

default value: 10
allowed values: 0 – 127
This parameter determines which device ID the unit responds to when the Pololu protocol is used. You should
only have one qik on your serial line at a time when setting this parameter.

1:

PWM Parameter

default value: 0 (high-frequency, 7-bit mode—PWM frequency of 19.7 kHz)
allowed values: 0 – 5
This parameter determines resolution and frequency 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. a speed of 127 results in full voltage
to the motors) and 8-bit resolution when set (i.e. a speed of 255 results in full voltage to the motors). A PWM with
7-bit resolution has twice the frequency of one with 8-bit resolution.

Bits 1 and 2 give you additional control over the PWM frequency. When combined with the resolution bit, PWM
parameter can be set to the following six values:

• 0 = 7-bit resolution, high-frequency (PWM frequency of 19.7 kHz, which is ultrasonic)

• 1 = 8-bit resolution, high-frequency (PWM frequency of 9.8 kHz)

• 2 = 7-bit resolution, medium-frequency (PWM frequency of 2.5 kHz)

• 3 = 8-bit resolution, medium-frequency (PWM frequency of 1.2 kHz)

• 4 = 7-bit resolution, low-frequency (PWM frequency of 310 Hz)

• 5 = 8-bit resolution, low-frequency (PWM frequency of 150 Hz)

Using a PWM parameter of zero produces the highest PWM frequency of approximately 20 kHz, which is outside
the range of human hearing and can help make your motors quieter. Using lower frequencies has the benefit of
decreasing power losses due to switching.

2:

Shut Down Motors on Error

default value: 1 (stop motors on any serial error)
allowed values: 0 – 7
This parameter controls whether motors M0 and M1 are stopped in response to the various error conditions that
can occur. The three least-significant bits of the parameter let you specify whether the motors are stopped if a
serial error occurs, a motor-over-current error occurs, or a motor-fault error occurs:

• bit 0: if this bit is set, stop motors M0 and M1 when any serial error occurs.

Qik 2s12v10 User's Guide

© 2001–2012 Pololu Corporation

5. Serial Parameters and Commands

Page 19 of 33