Pololu Qik 2s9v1 User Manual

Qik 2s9v1 User's Guide © 2001–2012 Pololu Corporation
Qik 2s9v1 User's Guide
1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Contacting Pololu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3. Connecting the Qik . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.a. Power and Motor Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.b. Logic Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.c. Included Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.d. Jumpers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.e. Indicator LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.f. Board Dimensions and Mounting Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4. Serial Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.a. TTL Serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.b. Baud Rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.c. Command Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5. Serial Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.a. 0x81: Get Firmware Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.b. 0x82: Get Error Byte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.c. 0x83 & 0x84: Get & Set Configuration Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.d. 0x86 & 0x87: Motor M0 & M1 Coast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.e. 0x88 – 0x8F: Set Motor Forward/Reverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6. Cyclic Redundancy Check (CRC) Error Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
6.a. CRC Computation in C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7. Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8. Arduino Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
http://www.pololu.com/docs/0J25 Page 1 of 24
Qik 2s9v1 User's Guide © 2001–2012 Pololu Corporation

1. Overview

The qik 2s9v1 is Pololu’s second-generation dual serial motor controller. The compact board allows any microcontroller or computer with a serial port (external RS-232 level converter required) or USB-to-serial
adapter [http://www.pololu.com/catalog/product/391] to drive two small, brushed DC motors with full direction and
• high-frequency PWM to eliminate switching-induced motor shaft hum or whine
• a robust, high-speed communication protocol with user-configurable error condition response
• visible LEDs and a demo mode to help troubleshoot problematic installations
• reverse power protection on the motor supply (not on the logic supply)

Main Features of the Qik 2s9v1

• Simple bidirectional control of two DC brush motors.
• 4.5 V to 13.5 V motor supply range.
• 1 A maximum continuous current per motor (3 A peak).
• 2.7 V to 5.5 V logic supply range.
• Logic-level, non-inverted, two-way serial control for easy connection to microcontrollers or robot controllers.
• Optional automatic baud rate detection from 1200 bps to 38.4 kbps;
• Two on-board indicator LEDs (status/heartbeat and serial error indicator) for debugging and feedback.
• Error output to make it easier for the main controller to recover from a serial error condition.
• Jumper-enabled demo mode allowing initial testing without any programming.
• Optional CRC error detection eliminates serial errors caused by noise or software faults.
• Optional motor shutdown on serial error or timeout for additional safety.

Specifications

Motor channels: 2
Motor supply voltage: 4.5 – 13.5 V
Continuous output current per channel: 1 A
Peak output current per channel: 3 A
Auto-detect baud rate range: 1200 – 38400 bps
Fixed baud rate: 38400 bps
Available PWM frequencies: 31.5 kHz, 15.7 kHz, 7.8 kHz, 3.9 kHz
Logic supply voltage: 2.7 – 5.5 V
Reverse voltage protection?: Y (on motor supply only)
Motor driver: TB6612FNG

Important safety warning

This product is not intended for young children! Younger users should use this product only under adult supervision. By using this product, you agree not to hold Pololu liable for any injury or damage related to
1. Overview Page 2 of 24
Qik 2s9v1 User's Guide © 2001–2012 Pololu Corporation
the use or to the performance of this product. This product is not designed for, and should not be used in, applications where the malfunction of the product could cause injury or damage. Please take note of these additional precautions:
• This product contains lead, so follow appropriate handling procedures, such as not licking the product and washing hands after handling.
• Since the PCB and its components are exposed, take standard precautions to protect this product from ESD (electrostatic discharge), which could damage the on-board electronics. When handing this product to another person, first touch their hand with your hand to equalize any charge imbalance between you so that you don’t discharge through the electronics as the exchange is made.
• Review the instructions carefully before making any electrical connections, and do all wiring while the power is turned off. Incorrect or reversed wiring could cause an electrical short or unpredictable behavior that damages this product and the devices it is connected to.
• This product is designed to be connected to motors, which should be operated safely. Wear safety glasses, gloves, or other protective equipment as appropriate, and avoid dangerous situations such as motors spinning out of control by designing appropriate safeguards and limits into your projects.
1. Overview Page 3 of 24
Qik 2s9v1 User's Guide © 2001–2012 Pololu Corporation

2. Contacting Pololu

You can check the qik 2s9v1 dual serial motor controller page [http://www.pololu.com/catalog/product/1110] for additional information. We would be delighted to hear from you about any of your projects and about your experience with the qik motor controller. You can contact us [http://www.pololu.com/contact] directly or post on our
forum [http://forum.pololu.com/]. Tell us what we did well, what we could improve, what you would like to see in
the future, or anything else you would like to say!
2. Contacting Pololu Page 4 of 24
Qik 2s9v1 User's Guide © 2001–2012 Pololu Corporation

3. Connecting the Qik

Connecting to the qik can be as simple as hooking up logic and motor power, your motors, and RX. Many applications can leave the jumpers off and the remaining logic connections—TX, ERR, and RESET—disconnected.
The qik connections are shown above, and most of the pins are labeled on the back side of the motor controller. All square pads are ground.

3.a. Power and Motor Connections

3. Connecting the Qik Page 5 of 24
Qik 2s9v1 User's Guide © 2001–2012 Pololu Corporation
The qik motor controller takes two power inputs: motor power supplied via the VMOT and GND pins at the bottom of the board and logic power supplied via the VCC and GND pins at the top of the board.

Motors and Motor Power

The qik can independently drive up to two bidirectional brushed DC motors, referred to as M0 and M1. The two terminals of each motor should be connected to the qik as shown above. Variable speed is achieved with 7-bit or 8-bit pulse width modulated (PWM) outputs at a frequency of 31.5 kHz, 15.7 kHz, 7.8 kHz, or 3.8 kHz. The highest achievable frequency of 31.5 kHz is ultrasonic, which can result in quieter motor control. Lower frequencies might make the motors louder, but they can decrease power losses due to switching and affect the relationship between PWM duty cycle and motor RPM. The resolution and frequency can be set via the qik’s PWM configuration parameter (see Section 5.c).
The motor direction convention used in this document is that “forward” corresponds to grounding the - pin while PWMing the + pin between V held at ground while - is PWMed between V drive and brake when the direction is “forward” or “reverse”. Variable speed control is achieved by varying the fraction of the cycle that the motor outputs are driving. Full speed arises when the motor outputs are driving 100% of the time (one motor output is held at V outputs are driving 0% of the time (both outputs are held at ground). See Section 5.e for more information on the motor commands.
In addition to forward and reverse, the qik 2s9v1 can set its motors to “coast” (i.e. the motor shafts will rotate freely) mode by configuring the motor driver outputs as high-impedance. See Section 5.d for more information.
and ground. “Reverse” is the same as forward but with the outputs flipped: + is
MOT
and ground. As a result, the motor is rapidly alternating between
MOT
and the other at ground), and full braking arises when the motor
MOT
The motor voltage must be between 4.5 and 13.5 V, and your motor power source must be capable of supplying the current your motors will draw. The qik 2s9v1 motor controller uses the TB6612FNG dual motor driver, which is capable of supplying a continuous 1 A per motor channel, with a peak output of 3 A per channel. Continuous performance is a function of how well you can keep the motor driver cool; addition of a heat sink or increased air flow over the board can allow the driver to output higher currents without overheating. The driver has thermal protection that causes it to shut down when it detects that it is overheating, but it is not a good idea to rely upon this thermal protection to prevent damage to the unit that can be caused by using it out of spec.

Logic Power

The logic voltage must be between 2.7 and 5.5 V and must be capable of supplying more than 15 mA (the logic draws less current at lower voltages and when the LEDs are off). Voltages that fall below 2.7 V trigger a brown­out and cause the device to reset. Note that the voltage on the qik’s serial input must not exceed Vcc.
While it is possible to use the same power source for both your motors and logic, we do not recommend this. Motors typically add noise to the motor power rail, and this noise can negatively impact the functioning of the device if it is introduced to the logic power rail. If you want to use the same power source for both motors and logic, you should decouple the two by using large capacitors and/or a regulator. Even if you use separate power supplies for your motors and logic, you should take whatever steps you can to limit electrical noise from your motors. For example, solder 0.1 uF capacitors across your motor terminals (as shown in the diagram above); using three capacitors per motor (one across the terminals and one from each terminal to the motor can) results in maximum noise suppression. You can further decrease motor noise by keeping your motor leads as short as possible and twisting the motor leads around each other in a helix.
3. Connecting the Qik Page 6 of 24
Qik 2s9v1 User's Guide © 2001–2012 Pololu Corporation
Note: Even if your motor and logic power sources share a common ground, make sure you connect your motor power supply’s ground to the GND pin just above the VMOT pin. This ground pin is designed to handle the higher currents that your motors will draw; the ground pin above the VCC pin is not intended for high currents.

3.b. Logic Connections

Serial Lines

The qik requires a logic-level (0 – Vcc), non-inverted serial input connected to its serial receive line, RX, and it can handle baud rates from 1200 – 38,400 bps. This type of serial is often referred to as TTL and is an interface method commonly used by microcontrollers. The voltage on this pin should not exceed the supplied logic power voltage, Vcc. The qik provides logic-level, non-inverted serial output on its serial transmit line, TX, in response to commands that request information. Information requests always result in the transmission of a single byte per request. If you aren’t interested in receiving feedback from the qik, you can leave this line disconnected.
Note that these lines are not compatible with RS-232 serial, which is inverted and uses voltages that would be out of spec (e.g. -12V to 12V). To connect the qik to an RS-232 port, you must use a converter such as our 23201a
serial adapter [http://www.pololu.com/catalog/product/126], or a level shifter and inverter.

Reset

The reset line, RST, is an active-low input, which means that it resets the qik when driven low. This pin is internally pulled to Vcc, so many applications can leave this pin disconnected.

Error

The error line, ERR, is an output that is connected to the red error LED and drives high (Vcc) in response to an error (which in turn lights the LED). Once an error occurs, the pin outputs high until a serial command is issued to read the error byte, at which point the pin goes to a high-impedance state that is pulled low through the LED. This allows you to connect the error lines of multiple qiks to the same digital input. Please note, however, that doing this will cause the error LEDs of all connected qiks to turn on whenever one qik experiences an error; the ERR output of the qik experiencing the error will drive the LEDs of any other qiks it is connected to, even though they are not experiencing error conditions themselves. For more information on the possible error conditions, please see Section 5.b. If you don’t care about error detection, you can leave this pin disconnected.
3. Connecting the Qik Page 7 of 24
Qik 2s9v1 User's Guide © 2001–2012 Pololu Corporation

3.c. Included Hardware

The qik ships with a 16×1 straight 0.100" male header strip [http://www.pololu.com/catalog/product/965], a 12×1
right angle 0.100" male header strip [http://www.pololu.com/catalog/product/967], and two red shorting blocks
[http://www.pololu.com/catalog/product/971]. This hardware gives you several options when it comes to making
connections to your qik.
For the most compact installation, you can solder wires directly to the qik pins themselves and skip using the included hardware. For less permanent connections, you can break the 16×1 straight header strip into a 12×1 piece and two 2×1 pieces. You can optionally solder the 2×1 pieces into the jumper pins, and you can solder the 12×1 header strip of your choice into the qik control pins. You can then make your own cables that have female
headers [http://www.pololu.com/catalog/category/50] on them and plug these onto the male headers on your qik, or you
can simply plug your qik into a breadboard. Using the right angle header allows for a compact profile or for vertical mounting into a breadboard; using the straight header allows for breadboarding as shown in the picture below.
3. Connecting the Qik Page 8 of 24
Loading...
+ 16 hidden pages