TReX Jr Motor Controller

I’m working with a TReX Jr motor controller running firmware 1.3.
The Set Motor command is not behaving per the documentation:

0xC0 – 0xC3: set motor 1
0xC8 – 0xCB: set motor 2
This command takes one data byte and returns nothing. It immediately sets the speed of the
specified motor equal to the data byte and the motor direction based on the two least significant
bits of the command byte. The direction bits work as follows:
00 = brake low (command 0xC0/0xC8)
01 = reverse (command 0xC1/0xC9)
10 = forward (command 0xC2/0xCA)
11 = brake low (command 0xC3/0xCB)

When I send the motor controller the 0xC1 or 0xC2 commands there is definitely a response byte being returned. The response byte appears to always be a 0xFF.

Can you please explain this behavior?

Hello.

Could you tell me more about how you are sending commands to the TReX jr? What device are using to send the serial commands? How are you reading the return bytes? Do the motors move when you send the command bytes?

Grant

Hello Grant, I am using Serial communication mode (TTL) with an Arduino as the controller. The motors controller responds correctly to the command and motor goes to the desired speed.
But I just retested and now I am not seeing any data returned from the set motor command.
So either I had a bug in my code or the issue when away when I changed some of the settings on the TrexJr.
So at this point I will report back if I can recreate the issue.

Can I ask another question?
With regard to setting a current limit (configuration parameter 0x13), the documentation states:
**Note: **
the current limits are seven-bit parameter that are used to represent eight-bit values as
follows:
current limit parameter value = desired current limit / 2

What is the scale for these values, i.e. what current does value 0x7F represent?
Are these increments of 40ma to match the current read command?

Thank you!
-Paul

The units for “desired current limit” match the units for the value returned by a get current command (40 mA). As noted though, the “current limit parameter” is set to half of the “desired current limit”, so the actual current limit is incremented by 80 mA:

Current Limit = 80 mA * 7-bit current limit parameter value

Grant

Thanks Grant! I think the documentation could be a bit more clear on the current limit parameter…