Jrk 21v3 and USB Chain

Hi guys !

I am a very happy user of two Jrk 21v3 motor controllers. This is a wonderful product!
However, I tried without success to control two controllers through a single USB connection using the Configuration utility.
First off all, is it supported by the utility?

This is my current setup:


I changed the id of the second controller so they have both unique ids. The first one (connected to the PC) is set up in USB chain mode.
For the second one I tried all modes without success.

According to the diagram in the documentation (pololu.com/docs/0J38/4.a) I should be able to send command through the USB to both controllers
using this setup. Do I have to write my own application to do that?

Thanks in advance for your help,

Chelmi.

Hello,
Serial control is not supported by the configuration utility. The configuration utility uses custom USB commands, while serial control is for people who want to write their own software to send commands over a COM port (similar to how you use most other motor controllers). Serial chaining is useful because it allows multiple Pololu devices, including non-USB devices, to share a single COM port provided by the jrk’s drivers.

If you do not want to write your own software, you should probably connect the two jrks to different USB ports or use a USB hub, then open two copies of the configuration utility.

If you are interested in writing custom software using a COM port, you have connected the jrks correctly. You should set the primary one to “USB chained” mode and the other to “UART” mode, and decide whether you want to use fixed baud rate (recommended) or auto-baud rate detection (if you suspect trouble with your baud rate settings). Then you need to write a program to send serial commands as specified in the user’s guide to the COM port provided by the primary jrk.

Note that you can also just configure the two jrks in the same way and connect each separately to different USB ports, without connecting them directly to each other. They would then have different COM ports, which might be simpler or harder for you, depending on what language you are programming in.

I should also mention that our USB Software Development Kit does not yet support the jrk, but we are planning to add jrk support to it soon. From what you said in your post, I do not think this would be useful to you, but if you do actually want to write code that uses our custom USB interface, which would give you a few small advantages in terms of detecting errors, identifying jrks dynamically as they are added and removed, and so on, you can bug us to add support for the jrk.

-Paul

I think Paul wrote is response while I was writing this…

Hello chelmi. I’m glad you are enjoying the jrk! The Jrk Configuration Utility does not have the ability to control two jrks simultaneously with the wiring you made above. But there are several ways you could control two jrks from a computer.

Controlling two Jrks with two USB cables

If you want to control two Jrks from your computer, one option is to get two USB cables and connect both Jrks to the computer at the same time. Then you can run two copies of the Jrk Configuration Utility and control them that way. With this wiring, you could also put the Jrks in to “USB Dual Port” mode and use the jrk’s respective Command Ports (virtual serial ports created on your computer by the Jrks) to control the Jrks. With this wiring, you get two USB-to-serial adapters in your project; i.e. you can use the Jrk’s respective TTL Serial ports to communicate with some extra serial devices.

This method gives you the most control over your project because you have lots of different options for controlling the two Jrks and you get two USB-to-serial adapters for free.

Controlling two Jrks with USB Dual Port

Alternatively, you can wire the system as shown in your picture above. The master jrk (the one with the USB cable) should be in “USB Dual Port” serial mode so it accepts commands from the Command Port and the slave jrk should be in “UART” serial mode so it accepts TTL serial commands. This allows you to send commands to the master Jrk using either the Jrk Configuration Utility OR the Command Port. To control the other Jrk, you would have to use the master jrk’s TTL Serial Port, which acts like a USB-to-Serial adapter in dual port mode.

This method allows you to have compact installations because you don’t need multiple USB cables and it lets you use the faster compact serial protocol (instead of the Pololu Protocol) because the Jrks are not on the same serial port.

Controlling two Jrks with USB Chained Mode

Alternatively, you can wire the system as shown in your picture above and use USB Chained Mode. The master jrk (the one with the USB cable) should be in “USB Chained Mode” serial mode so it accepts commands from the Command Port and the slave jrk should be in “UART” serial mode so it accepts TTL serial commands. This allows you to send commands to the master Jrk using the Jrk Configuration Utility, and you can use the Command Port to send commands to both Jrks.

This method allows you to have compact installations because you don’t need multiple USB cables and it gives you the simplicity of controlling both Jrks from one virtual serial port, which might make it easier to write your program.

How to use the Command Port or the TTL Port
Two of the solutions above require you to send some serial commands on a virtual serial port (either the Command Port or the TTL Port). To do this, you would have to run the Pololu Serial Transmitter or write your own program to send and receive bytes on the port. If you want to write your own program, I recommend the freely available .NET framework and its included SerialPort class, but there are other programs like LabView and MatLab that support serial ports.

-David