beautypg.com

D. general analog information, E. safe-start mode, D. general analog information 4.e. safe-start mode – Pololu TReX Jr User Manual

Page 14

background image

The TReX Jr measures the width of RC servo pulses with 12-bit resolution and an accuracy of 1 us. The raw channel
value is provided as a 12-bit number in units of 0.4 us, so a raw channel value of 2500 can be physically interpreted
as a pulse width of 2500×0.4 =1500 us. Servo pulse widths typically range from 1 ms to 2 ms, with a neutral value
of 1.5 ms. This would correspond to raw channel values of 2500, 5000, and 3750, respectively. The TReX Jr can
handle pulse widths as short as 0.5 ms (raw channel value 1250) and as long as 2.5 ms (raw channel value 6250). If
a channel reading is considered to be an error, the raw channel value will be 0xFFFF (65535 in decimal). Errors
result from pulse widths outside the acceptable range and from pulse trains with frequencies outside of the
acceptable range. If a signal ceases on a channel, that channels value will stop updating until approximately 150 ms
elapse, at which point the channel’s raw value will become 0xFFFF. It will remain as such until valid signals are
once again detected on the line.

As a safety feature, you can designate channels as required using the “required channels” configuration parameter.
If a required channel goes for more than 500 ms without receiving a valid RC servo pulse and the TReX Jr is in RC
mode, the TReX Jr will enter safe-start mode (see Section 4.e). By default, the TReX Jr only requires channel one.

If you are not using all five channels, you can optionally ignore unused channels via the “ignored channels”
configuration parameter. Ignored channels are treated as fixed at their neutral values (no matter what signals their
lines receive).

4.d. General Analog Information
When the channel inputs are analog voltages, the update rate of the channel values is approximately 50 Hz (each
channel updates every 20 ms or so). Each channel’s value is the result of a 16-sample average of analog-to-digital
conversions.

The TReX Jr measures analog voltages with 10-bit resolution. The raw channel value is provided as a number
ranging from 0 to 1023, where 0 corresponds 0 V and 1023 corresponds to 5 V. Your channel source can be as
simple as the output of a potentiometer whose inputs are the channel’s associated power (make sure the BEC jumper
is in place) and ground connections.

Unlike with RC signals, the TReX Jr has no way of telling if a channel is receiving a valid analog signal. A
disconnected channel will still produce a result when run through the analog-to-digital converter. This poses two
potential problems:

1. If your analog signal source gets disconnected from your TReX Jr, the TReX Jr could drive the motors in
unexpected and potentially dangerous ways. Because of this, please be very careful when operating the TReX
Jr in analog mode.

2. Unused channels can impact behavior of the TReX Jr in undesirable ways. You may not plan on using the
flip or override channels, but leaving them disconnected could result in their floating to a value that would
enable flipped mode or serial override. One solution to this problem is to use the “ignored channels”
configuration parameter to set unused analog channels as ignored. The TReX Jr considers ignored channels to
be fixed at their neutral positions. An alternate, purely hardware-based solution would be to short any unused
motor channels to a used one and to tie any unused “enable” channels (4 or 5) to Vcc (the 5-volt line). By
shorting unused motor channels to a used one, you should be able to get past the safe-start portion of the
TReX’s start-up routine.

4.e. Safe-Start Mode
When the TReX Jr starts up in either RC or analog mode, it first enters safe-start mode. In this mode, the three
motors are shut down and are unaffected by the channel inputs. The TReX Jr lets you know its in this mode by
rapidly flashing its green status LED. To exit this mode, the following conditions must all be simultaneously met:

Pololu TReX Jr User's Guide

© 2001–2009 Pololu Corporation

4. RC/Analog in Detail

Page 14 of 23