Labview with Jrk 12v12 USB Motor Controller with Feedback

Hi there,

I wish to know if it is possible to let me know where I can get the list of serial commands in order for me to control Jrk 12v12 USB Motor Controller with LABVIEW via Virtual COM Port.

Many Thanks.
Walter.

Hello, Walter.

I moved your thread to the “Motor controllers/drivers and motors” subforum, which seemed more appropriate.

You can find a list of serial commands available for the jrk controllers in the “Using the Serial Interface” section of its user’s guide. Please note that you will need to set the jrk’s serial mode to be either “USB Dual Port” or “USB Chained” so that it can accept commands from the USB virtual COM port. For more details on the jrk’s serial modes, see the “Serial Modes” section of the guide.

- Amanda

Noted. Thanks a lots Amanda

Walter Lee

Hello Amanda S,

I hope you can help me.

I managed to interface LABVIEW with Jrk 12v12 controller but once I issued this command to controller below

For example,
Pololu Protocol = 0xAA, device number, 0x61,magnitude
AA0B 617F

I noticed that the target control range for actuator limit to 2048 - 4080 (0 - 127 = magnitude). Hence If I would like to have more flexible control in wider range i.e. 0 - 4095 ( magnitude?), what should I need to do? Please advice

Many Thanks/
Walter.

You can use the Set Target High Resolution command, which lets you set a 12-bit target, instead of the Set Target Low Resolution commands. You can find more details on that command in the “Motor Control Commands” section of the jrk user’s guide.

- Amanda

Thanks alot Amanda.

Finally, working now.

At First attempt,

BUT, I have problem regarding the READ Serial,

  1. I am trying to GET Error Flags Occurred below,
    For example to acquired any ERROR message,

    0xAA, device number, 0x35

    Hence

    AA0B 35

    I don’t see any output result.

  2. I also try on Variable Reading Commands,
    For example, to acquired Scaled Feedback using two bytes

    0xAA, device number, read variable command byte with MSB clear

    Hence

    AA0B A7

    Also, don’t see any output result.

Then,

  1. I sent this command below which combination of 1 and 2

    0xAA, device number, 061, magnitude, GET Error Flags Occurred, variable Reading Commands

    AA0B 617F A733

Hence

  From above 1, 2 and 3 = No result. 

So, Not sure am I done anything wrong? Please advice.

At Second attempt,

Put a timing on READ Serial and noticed some value shown below after acquisition,

AA0B 617F A7 or AA0B 607F A7

  1. Actuator Forward = 4000
  2. Actuator Reverse = 300F

Hence ,

I am not sure,

Both values above are in HEX? and Scaled Feedback?

Furthermore those both values are not consistent;can be 4200 and 2B0F, 4300 and 2C0F & etc. This is consider correct behavior?

Please advice.

Many Thanks.
Walter.

Your variable reading command in point 2 (“AA0B A7”) is wrong. For the Pololu protocol version of the Variable Reading command, you need to clear the MSB of the read variable command byte as stated in its documentation, so the 0xA7 should instead be a 0x27. Your method of combining commands in point (3) is not correct, and furthermore it would be best to just focus on doing one command at a time until you can get the command to work. I suggest reading the “Using the Serial Interface” section of the user’s guide to better understand how to use the jrk serial commands.

Anyway, your Get Error Flags Occurred command looks correct, so it seems like the main issue is that you are unable to receive data from the jrk through your program. Can you try sending the Get Error Flags Occurred command to the jrk using the Pololu Serial Transmitter Utility and seeing if the jrk responds? Please make sure that the configuration utility for the jrk is closed, since having the software open will cause the command to give unreliable responses. This is noted in the command’s description under the “Error Reporting Commands” section of the user’s guide.

- Amanda

Amanda,

Using Pololu Serial Transmitter v1.3

  1. Get Error Flags Occurred,
    Sent = 0xAA 0x0B 0x35
    received: 00 ’ 00 ’ -> I guess it is correct :slight_smile:

  2. Variable Reading Commands,
    Sent = 0xAA 0x0B 0x27
    received: 2F ‘/’ 0F ‘’ -> Not sure it is correct?:roll_eyes:

    Where,
    According to “Using the Serial Interface” section of the user’s guide, I assume
    0xA7 = 0x27
    0xA5 = 0x25
    0xA3 = 0x23
    0xA1 = 0x21
    Correct me if I am wrong , please :confused:

  3. For the combination commands, would you mind to give me a few examples?

    For example
    Moving forward,
    0xAA 0x0B 0x61 0x7F 0x35 0x27

    I sent as above command; I can see the actuator is moving forward but I don’t see any received data?

Many Thanks.
Walter

It sounds like you are not sure how to interpret the two bytes you are receiving back from the variable reading command. You can find a description of the two-byte response in the variable reading commands section of the user’s guide, which states:

In your returned response, 0x2F is the least-significant byte and 0x0F the most-significant, so if you reorder those bytes, you get [0x0F 0x2F], which converts to 3,887 in decimal. (If you want details on how to do the conversion, you can do an Internet search for “converting HEX to decimal”.)

As for your third point, the first part of your example sequence, [0xAA 0x0B 0x61 0x7F], is a valid serial command, so the jrk is able to process it, which explains why you see your actuator moving. The next two bytes (0x35 and 0x27) in that sequence are seen as data bytes, since their most-significant bits (MSbs) are not set to indicate to the jrk that they are a separate and new command, and are not recognized as part of the first (or Set Target Low Resolution Forward) command. The “Command Protocols” section of the jrk user’s guide explains all of this. Each command in your byte string must follow the format of whichever protocol you are using so that it is recognized as a valid command. A proper command string for your example is [0xAA 0x0B 0x61 0x7F 0xAA 0x0B 0x35 0xAA 0x0B 0x27] (notice how each command is in the Pololu Protocol format).

Alternatively, if you are only sending these serial commands to one jrk, you can use the compact protocol for all your commands. So the three commands in your example could be sent like this: [0xE1 0x7F 0xB5 0xA7].

- Amanda

Yes Amanda. You are correct that I am not sure how to interpret the two bytes :slight_smile:

Anyway, I am able to receive correct response in decimal correctly as well controlling using both protocols.

BTW, Do you want me to share the LABVIEW code in the forum? If yes please do let me know.

Many Thanks.
Walter.

Awesome! I’m glad the problem is resolved; thanks for letting us know. Also, yes, please share your code. I’m sure others on the forum would be interested in seeing it.

- Amanda

Not a problem, Amanda. Thanks a lot for your help :slight_smile:

Kindly refer to the attachment.

Many Thanks…
Walter.
POLOLU_CONTROL.vi (29.0 KB)

1 Like