Pololu TReX User Manual

Pololu TReX User's Guide © 2001–2013 Pololu Corporation
Pololu TReX User's Guide
1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Contacting Pololu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.a. Motor and Power Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.b. Signal Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.c. Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.d. LED Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.e. Automatic Calibration for Your RC/Analog Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4. RC/Analog in Detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.a. Channel Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.b. Channel Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.c. General RC Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.d. General Analog Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.e. Safe-Start Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5. The Serial Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.a. Serial Communication Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.b. Serial Command Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.c. Serial Command List and Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.d. Configuration Parameter List and Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.e. Cyclic Redundancy Check (CRC) Error Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.f. CRC-Generation Algorithm in C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.g. Resetting the Serial Communication Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6. Updating the TReX's Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
http://www.pololu.com/docs/0J1/all Page 1 of 24
Pololu TReX User's Guide © 2001–2013 Pololu Corporation

1. Overview

The TReX Dual-Motor Controller [http://www.pololu.com/catalog/product/777] is a versatile DC motor controller designed to seamlessly blend autonomous and human control of small- and medium-sized robots. The TReX can control two bidirectional and one unidirectional motor via three independent control interfaces: radio control (RC) servo pulses, analog voltage, and asynchronous serial (RS-232 or TTL). It uses five input channels to receive the RC or analog control signals. When operating in RC or analog mode, the five channels function as follows:
Channel 1: motor 1 speed and direction or, if in mix mode, turn left/right
Channel 2: motor 2 speed and direction or, if in mix mode, go forward/reverse
Channel 3: auxiliary (unidirectional) motor speed
Channel 4: can be used to enable “flipped mode”, which allows invertible robots to be controlled as normal when they are inverted
Channel 5: determines whether the motors are controlled by the channel inputs or the serial interface; this channel allows you to switch between autonomous and human control at will
The serial interface can switch instantly with one of the other two interfaces, allowing mixed autonomous and remote control. For example, a robot could be configured to run autonomously most of the time, but a human operator could override the autonomous function if the robot gets stuck or into a dangerous situation. If the serial mode is selected as the primary interface, high-resolution measurements of all five channel input signals (be they RC pulses or analog voltages) are made available to the autonomous robot controller, allowing for complex and unlimited mixing of operator control and sensor input. For example, the TReX would be a great motor controller for a line-following robot whose overall speed is controlled by an RC throttle, or an RC car with sensors that autonomously dodges obstacles in its path as you drive it around.
1. Overview Page 2 of 24
Pololu TReX User's Guide © 2001–2013 Pololu Corporation

2. Contacting Pololu

You can check the TReX motor controller page [http://www.pololu.com/catalog/product/777] for additional information. We would be delighted to hear from you about any of your projects and about your experience with the TReX 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 3 of 24
Pololu TReX User's Guide © 2001–2013 Pololu Corporation

3. Getting Started

TReX input/output connection points
Getting started with your TReX can be as simple as connecting power, your motors, and your RC or analog control signals (see Section 3.a and Section 3.b). Configure your jumpers for RC or analog mode (see Section 3.c) and you’re good to go. While it’s running, the TReX will communicate with you via its LEDs (see Section 3.d). Once you have all your connections in place, we recommend your first step be to calibrate your TReX for your particular RC or analog controller (see Section 3.e).

3.a. Motor and Power Connections

The TReX receives its power through the VIN/GND connector terminals. VIN should be between 6 and 16 V and your power source must be able to supply the current your motors will be drawing. The TReX can supply peaks of 30 A and up to a continuous 13 A to each of its two bidirectional motors. Performance will depend the on actual system and its ability to dissipate heat. The TReX’s bottom motor driver board is designed to help heat flow away from the VNH2SP30 motor driver chips, but addition of a heat sink and good air flow will further improve performance. The TReX can supply up to 15 A (continuous) to the auxiliary motor.
There are several different ways to connect motors to your TReX:
Option 1:
3. Getting Started Page 4 of 24
Pololu TReX User's Guide © 2001–2013 Pololu Corporation
TReX motor connections (single battery)
The figure above demonstrates how to connect two bidirectional motors and a unidirectional auxiliary motor to your TReX, all powered by the same battery. Note that the auxiliary motor is driven by permanently connecting one lead to power while the board PWMs the other lead between high impedance and ground. You must connect your battery’s ground directly to the lower port of the auxiliary motor’s connection block if you plan to use the auxiliary motor. Otherwise, the auxiliary motor could attempt to pull too much current through the TReX itself, thereby damaging the unit. The auxiliary motor’s other lead connects to the upper port of its connection block. You will need to connect a diode across the auxiliary motor’s terminals as shown below. Failing to do so will adversely affect the performance of your TReX and could result in permanent damage to the device. Take great care to ensure you do not solder the diode in backwards! You should not solder a diode to your bidirectional motors.
You may find it beneficial to solder 0.1uF capacitors across all of your motors’ terminals. This will decrease the noise put out by your motors and can improve performance of your TReX. You can further decrease the noise put out by your motors by keeping their leads as short as possible and twisting them around each other in a helix.
Option 2:
3. Getting Started Page 5 of 24
Pololu TReX User's Guide © 2001–2013 Pololu Corporation
TReX motor connections (separate battery for the auxiliary motor)
It is possible to power the auxiliary motor with a second, separate 0 – 24 V battery, as shown above. To do so, connect that battery’s ground to the lower of the two auxiliary motor connection block ports. Connect one of your auxiliary motor’s leads to the upper connection block port and connect the other of your motor’s leads directly to the battery’s positive side. You will still need to solder a diode across your auxiliary motor’s terminals.
Option 3:
TReX joint-motor connection
Lastly, you can use both motor 1 and 2 outputs to control a single, more powerful (up to 25 A continuous) bidirectional motor by connecting it as shown above. One of the motor’s terminals connects to both of motor 1’s outputs while the other of the motor’s terminals connects to both of motor 2’s outputs. In order to use your TReX in this way, you must use the serial interface to set the TReX to “joint motor mode”. In this mode, the single bidirectional
3. Getting Started Page 6 of 24
Pololu TReX User's Guide © 2001–2013 Pololu Corporation
motor is considered “motor 1”. The motor speed/direction indicator LEDs will not work in this mode, nor will current sensing or channel mixing. Although it is not shown in the figure above, you can additionally control an auxiliary motor while running in “joint motor mode”.

3.b. Signal Connections

RC/analog signals should connect to the interior of the three channel columns, which are located on the left side of the board; this connection is represented by the white wire in the figure below.
The middle column is connected to the TReX’s regulated power (Vcc) through the “+=Vcc” (BEC) jumper and will provide 5 V to your RC receiver or analog controller when this jumper is in place. This connection is represented by the red wire in the figure below. If you want to power your RC receiver or analog controller from a source other than the TReX, make sure you remove the BEC jumper.
Warning: This middle Vcc column is tied to the output of a linear voltage regulator, so current output
is limited by thermal dissipation. The regulator will only be able to safely supply a maximum of 100 mA when VIN is 16 V (it has a 1-W power dissipation rating). This is typically sufficient for powering an analog joystick or RC receiver, but it is insufficient for powering servos. If you want to connect servos to some of your RC receiver channels, you must power your RC receiver separately and disconnect the BEC jumper. Attempting to use the TReX’s regulated Vcc line to power servos can permanently damage the TReX.
The exterior column is ground and is represented by the black wire in the figure below. Your input source and the TReX must share a common ground, even if you are powering your input source from something other than the TReX. You only need to make a single ground connection.
TReX RC/serial input signal connections
In addition to RC/analog connections, you can connect the TReX to either an RS-232 (COM) or logic-level (TTL) serial port. Note that you should not simultaneously have both RS-232 and TTL connected. The figure above depicts the two possible serial connections. The serial pins are labeled from the perspective of the TReX, meaning you should connect the TReX’s TX or SO line to your target’s receive line (the green wire in the figure above); your TReX’s RX
3. Getting Started Page 7 of 24
Pololu TReX User's Guide © 2001–2013 Pololu Corporation
or SI line should connect to your target’s transmit line (the orange wire in the figure above). On a DB9 connector, pin 2 is your computer’s receive line and pin 3 is your computer’s transmit line.
Warning: It is very important that you do not connect your TReX’s TTL pins (SO and SI) to an
RS-232 port. RS-232 serial communication signals range from -12 to +12 V, which is well outside the 0 – 5 V expected on those lines. Only the COM pins (TX and RX) are designed to handle RS-232 voltages.

3.c. Jumper Settings

The TReX comes with four blue shorting blocks as shown in the picture below. These jumpers let you affect some aspects of its behavior without serial configuration commands. Note that we recommend you always power off your TReX before changing jumpers (other than the mix jumper, which can be changed at any time). This is not strictly necessary, but it is the safest practice.
TReX jumpers
Channel-Mix (a.k.a. Single-Stick) Jumper: When this jumper is in place, the TReX operates in single-stick mode. Channel 1 is treated as turn left/right while channel 2 is treated as forward/reverse. When this jumper is off, channel 1 directly controls motor 1 and channel 2 directly controls motor 2. This jumper may be added or removed on the fly.
Battery Elimination Circuit (BEC, a.k.a. +=Vcc) Jumper: When this jumper is in place, the middle column of channel input pins is connected to Vcc (5 V). You can use this jumper to power your RC receiver or analog controller through your TReX. If your RC receiver is powered via another source, you must leave this jumper off.
3. Getting Started Page 8 of 24
Loading...
+ 16 hidden pages