Jrk controller ignores device number

Hi,

I’m a first time user of Jrk controllers. Now I’m trying out the device number function, but it seems my jrk controller keeps ignoring the specified device number in the command. Here are the details of what I’m trying:

  1. the jrk controller is connected to the PC via USB, with the device number set to the default 11

  2. The jrk controller is identified by the PC as shown in the Windows Device Manager

  3. the Pololu serial transmitter v1.3 is used to send out a simple command (set target value to 3229) to the command port (COM5):

Despite that a wrong device number (99 instead of the set 11) is used. The jrk controller still always responses.

I have really no clue why this is happening (((

I have read about a similar problem on the forum:

But I believe I’m not making the same mistake.

Can someone pls help me out?

Thanks in advance.

Cong

Hello, Cong.

You are making the same mistake as the customer in the thread you linked to. Since you are trying to use the Pololu Protocol but did not clear the most significant bit of the command byte, the last two bytes of your command are a valid Compact Protocol command, and any jrk that sees that command will respond to it. Your command byte is 221 (0xDD) right now. To clear the most significant bit, you would decrease it by 128 to get 93 (0x5D).

It looks like you are trying to send a Set Target command. The jrk user’s guide specifies that the series of bytes you need to send for a Set Target command using the Pololu Protocol is:

0xAA, device number, 0x40 + target low 5 bits, target high 7 bits

So the third byte needs to be 0x40 plus the lowest 5 bits of the target value. This means that the maximum valid value for the third byte is 0x40 + 0x1F, which is 0x5F.

–David

Hi David,

Thanks for the quick reply! It’s working now!

It turned out that I was following the (setting target value to 3229) example in the user manual blindly:


without realizing that it added 0xC0 instead of 0x40

Thanks!

Cong