TRex Jr - Strange LED behaviour?

Hi,
I’ve got a TRex Jr. hooked up to an Acme Systems Fox Board, using the serial console. I have removed all jumpers except the Mix jumper, so when I power on, the blue LED stays on, the red LED blinks 5 times and then stays on. So far so good.
The problem is, whenever I send a command byte to the serial console, the green LED turns on. Then when I send a data byte it turns off again. But nothing else happens. There is no data returned, and the motor LEDs don’t come on either. These are the commands I send:

root@CrisOs:~# setserial /dev/ttyS2 baud_base 19200
root@CrisOs:~# echo -e “\0302” > /dev/ttyS2
root@CrisOs:~# echo -e “\0177” > /dev/ttyS2

The bytes are octal numbers since ‘echo’ requires that. \0302 = 0xC2 or 194, and \0177 = 0x7F or 127. With this command the Motor 1 should start turning forward, but it stays off and the motor LED doesn’t turn on either. All it does is turn the green LED on and then off. Could someone tell me what this means?

Thanks

Hello.

The LED section of the TReX Jr user’s guide explains in detail what the LED patterns mean:

The status LED behavior sounds correct for a two-byte command packet such as “Set M1 Forward”, so it’s not immediately obvious to me why you aren’t getting a response from the motor driver. What are you using as your power source? Do you have a motor connected to the outputs, and if so, what is its stall current? Have you changed any of the TReX Jr’s configuration parameters, such as enabling joint-motor mode? Have you ever been able to successfully talk to the TReX Jr via its serial interface?

- Ben

Hi Ben,
I’ve got 2 motors, they are these: pololu.com/catalog/product/991
They’ve got a 0.42A stall current.
As a power source I’m using a DVE DSA-0101F-05UP Switching Adapter which outputs 2A at 5V. This is the first time I try to get the TRex Jr. to work, I haven’t been able to talk to it before. I haven’t changed anything from the factory configuration.

There are a few things you can try to debug this:

  1. Try sending some other commands, such as 0x81 to read the device signature. Try setting the speed of the auxiliary motor (M3) and see if the yellow M3 indicator LED turns on.

  2. If you have access to an oscilloscope, try looking at the signals you’re sending the TReX Jr to make sure they are what you expect.

  3. Try connecting your TReX to a computer running Windows and using our Pololu Serial Transmitter to send your commands, and see if you can talk to it with our TReX Configurator utility.

- Ben

Hi Ben,
It turned out I was sending formatted text rather than raw bytes. I wrote a simple C program to send the data, and I had to set the serial port to non-canonical mode. This time I got a response to the signature command, all seems to be working well.
Thanks for your help.