Serial control of jrk 21v3 standalone

Hello.

Could you double check that you have the “Input mode” set to “Serial” and that the “Serial interface” is set to the appropriate setting? This should be “USB dual port” when using our Serial Transmitter Utility and one of the UART modes when using your microcontroller.

If this does not help, could you post your jrk’s settings file and the command bytes that you are sending? You can save the settings file by opening the “File” menu and selecting "Save settings file . . . " in the Jrk Configuration Utility.

-Brandon

Brandon, Thankyou you led me to the answer and here’s what’s up,

I was gonna post the whole doggone settings file but after fooling around, once you pointed me to the Dual port mode, I was able to send the Compact Protocol Commands E1 7F command to send forward all the way and the E0 7F command to send reverse all the way. E1 00 only sent the device to half scale. That’s the low resolution plan.

I can’t get the device to move with the Pololu language commands like AA 11 00 00 all that does is send back a ‘received: 00’ weird. So the Pololu commands don’t work but the Compact protocol works.

So, the low resolution commands you send as I noted above (with the E0 and E1 commands) for {-2048 to +2048}. For the high resolution range of {0-4095} you send the commands beginning with C0.

Therefore if I follow the path in the manual that says this, then all is well:

"For example, if you want to set the target to 3229 (110010011101 in binary), you could send the following byte
sequence:
in binary: 11011101, 01100100
in hex: 0xDD, 0x64
in decimal: 221, 100

so here’s my C code and it works, it does what I need:

void MotorConrolRoutine (WORD target)
{
    target={this particular dynamic variable in my code}; // here I can set the target between 0 and 4095 
    serialBytes[0] = 0xAA; // you'd send this first for the Pololu commands
    serialBytes[1] = 11;  // then this is the device numba, not needed for Compact code
    serialBytes[2] = 0xC0 + (target & 0x1F); // Command byte holds the lower 5 bits of target (plus the 3 high bits of 110 <-thus the beginning of the C0, getit?
    serialBytes[3] = (target >> 5) & 0x7F;   // Data byte holds the upper 7 bits of target (plus the cleared MSB as per specs).

//ConsolePut(serialBytes[0]);
//ConsolePut(serialBytes[1]); These I commented out because the Pololu commands are useless.
ConsolePut(serialBytes[2]);// So the shifted and ANDED code is sent out in 2 bytes
ConsolePut(serialBytes[3]);
}

You set me on the right track, I knew I needed your help, and that was easy, huh?

Thanks, bro, I owe ya one. :mrgreen:

Here I am using one of my Cool Node Output nodes hardwired to the jrk12v12 and the actuator plugs into the box.

To read more about the Cool Node Output node, goto CoolNodes.com

The microcontroller in the circuit is a 3.3V logic chip. The Jrk12v12 is a 5 Volt logic chip. The bread boarded opamp is simply a comparator circuit to level shift the 3.3 volt TX output high to a 5 volt level high for the RX input on the Jrk.

P.S. the Cool Nodes system, is all my design, and there’s a lot more to come.

I am glad to hear that you were able to get it working. Thank you for letting us know.

The jrk should work seamlessly with either protocol. It looks like you might be sending the wrong bytes for the Pololu protocol. To set the target to zero using the “Set Target High Resolution” command, you should be sending 0xAA, 0x0B, 0x40, 0x00, instead of sending 0xAA, 0x0B, 0x00, 0x00. You might be able to change serialBytes[2] to be equal to 0x40 + (target & 0x1F) if you wanted to try getting it working with the Pololu protocol.

Also, thanks for sharing your Cool Nodes with us; they look neat.

-Brandon

Final note on this:

The UART, detect baud rate didn’t work for me either.

I had to set it to UART, fixed baud rate: 19200 :unamused:

I noticed in your previous post, when you talked about using the compact protocol, you did not include the byte 0xAA, which is needed for the jrk to auto-detect the baud rate. This is described in the “Command Protocols” section of the user’s guide. When you tried using the auto-detect baud rate feature, did you send the byte 0xAA before sending any other commands?

-Brandon