Feedback-loop with jrk 21v3


For my project I have been using one of your Pololu Jrk 21v3 USB Motor Controller with Feedback (Fully Assembled).

All is good so far-- We tried to feed the device via Rx line with “sin waves”. we got pretty smooth sinusoidal motion from motor.

Now we have trouble using the feedback loop.

I tried both potentiometer, and also D.C power supply to feed the FB line. But so far i got no success on get the feedback loop going.

In Plots from utility configuration, I can change the feedback signal’s values. Which may indicate that the wiring is right. The Error, and scale feedback change accordingly as well.

However, whenever I activate the feedback loop, motor stop rotating. I tried different configurations, but I had no success so far.

Could you please help me figure out the problem? Which channels I need to use on Jrk for feedback loop control? What does “the analogue input from FB port” means to Jrk?

in manual, it is mentioned that it reads as a position. But I did not exactly grasp what does exactly meant?

Thanks for reading this,

Hello, Farhad.

It sounds like you have mostly set up your feedback system correctly, but probably have not set your PID coefficients. Please see the “Setting up your system” section of the jrk user’s guide for help on setting and tuning the PID constants. Alternatively, if you just want something quick, try setting P=2, D=0, I=0.

If you continue to have trouble, please see the FAQ entitled “Why is the Jrk not driving my motor?” here:

Once you get the motor to move, there is also a 50% chance you will need to check the “Invert feedback direction” checkbox to actually make things work correctly.

If you still can’t get it to work, please post your jrk settings file and some screenshots of the Plots window to show us what is happening.


Hi David,

Thanks a lot for advice-- It is working right now. I have a question that maybe basic, but it is critical to us to answer it.

We are setting the analogue target signal to the constant value (RX port). The FB/AUX ports are hooked up to a potentiometer.

It is mentioned in manual that if we set a target to a certain analogue value, controller reads it as a position.

Does it mean that whenever it reaches that target (position), motor stops/ changing direction?

I am guessing that it reads the values as a speed, and whenever it reaches that speed it runs at that target speed value.

Please let me know which scenario is correct,


I recommend reading the “PID Calculation Overview” section of the the jrk user’s guide. That explains the basic algorithm the jrk is using to decide what speed to run the motor at, based on the input and feedback. If you still have questions after reading that, let me know.

The jrk doesn’t just stop the motor after it reaches the target position once. At all times, it actively monitors its inputs and drives the motor with the goal of making the Target equal to the Scaled Feedback.



Thanks David-- I think the feedback loop is working now, and the jrk is trying to maintain the specific target position.

Now we are trying to communicate with the jrk in Labview environment. I wonder if you have seen any prior projects

that used National instrument’s Labview to communicate with Jrk?

I will appreciate any inf. that could help me get this started.


I have seen lots of projects that communicate with the Maestro Servo Controller from labview, and the concepts involved in getting that to work at the same as for the jrk. Try searching this forum (and Google) for something like “Maestro labview”. Basically you just have to learn how to send bytes to a serial port from labview by reading NI’s documentation, and then learn what bytes you want to send to the jrk by reading the jrk user’s guide, and put the two together. Also, remember to set the jrk’s Input Mode to serial and set the Serial Mode to USB Dual Port.



Thanks for the response-- I will work on it.

I have another question. In our project we need to control 10 motors at the same time.

I wonder if this is even possible by using 10 different Jrk?

All the Jrks should be connected to one computer, right?

How computer will distinguish between one Jrk to another?

Please let me know if you have any inf. using multiple Jrks in one system.

Thank you,

Yes, you can control ten motors with 10 jrks. There is nothing preventing you from scaling up the system.

You can connect all the jrks to the same computer, but there is nothing forcing you to. You could use multiple computers if you wanted.

There are two options. One option is to connect all the jrks to the computer using USB. Then the computer can distinguish between jrks using the serial number built into them. Each jrk will be assigned a different COM port number by Windows.

Another option is to learn about the jrk’s serial interface and daisy chain them as described in the “Daisy-Chaining” section of the jrk user’s guide. If you do that, you wouldn’t be able to control the jrks using the Jrk Configuration Utility because that requires a direct USB connection. However, you could send individually-addressed serial commands to each of them. Or you could use the Compact Protocol in order to send the same command to every jrk at once. Please read the “Serial Interface” section of the jrk user’s guide in order to understand these options.


Hi again,

I just closed the control feedback loop with encoder. We are inputting the sin wave and expecting the motor

consistently go back and forth. For about 20 strokes it does as expected, however after a while the motion becomes

jerky, and in some cases it slows down in the middle of cycle.

I am guessing i might choose wrong PID factors? or our sin wave’s zero is not completely aligned with software’s zero

(wrong offset)?

I would be glad to hear any thoughts/suggestions.


I thought you were using a potentiometer. Did you switch to using an encoder instead? What feedback mode is your jrk actually in?

Yes, I suspect the PID constants are not chosen well. The “Setting Up Your System” section of the jrk user’s guide has some good advice about how to tune your PID constants, though they are tailored to be people whose feedback mode is “Analog”.

You can generally debug this type of thing by looking at the Plots window of the Jrk Configuration Utility (just click on the graph). It shows you all the variables that are going into the jrk’s computations.


Hi Dave,

Did you switch to using an encoder instead?

Yes-- we switched to use encoder. It provides output analogue signals.

What feedback mode is your jrk actually in?

Analogue voltage.

I chose some variables that it seems to be working properly. cilia is going back and forth between two positions. But
I still have this feeling that I am shooting in a dark. I am still not 100% percent sure if Jrk interpret the input analogue voltage as “velocity”, or “position”?
I ran some experiments to verify this, but I get mixed responses from Jrk…
I am pretty sure that feedback loop is based on position since whenever i turn the motor, the encoder output signal changes with position.

The answer to this question would help us a lot. I have another question: if we want to connect 10 Jrks to a computer-- how can we start running all 10 of them at the same time?

Thanks for your helps,

The point of the jrk is that it tries to make the Feedback variable equal to the Target variable. If the analog feedback voltage you are giving to the jrk represents a position, then the Feedback variable represents a position, so the Target variable also represents a position.

To connect 10 jrks to a computer, you could simply get a few USB hubs and connect all the jrks to the computer using USB.

Alternatively, you could make a more complicated setup which is described in the Daisy Chaining section of the jrk user’s guide. Just keep in mind that you will not be able to use the Jrk Configuration Utility with that setup because it requires a direct USB connection.


Hi David,

The system is working fine by using one Jrk, and encoder.

The only question that we could not answer yet is about the case of multiple jrks.

If we get USB hubs and connect all the jrks to computer, how could we start all of them at the same time?

it is critical in our case that all motors start working at the same time…

I figured daisy-chaining them would take care of that issue, but we would not be able to

use the program to control each one of them. Is that right?

Thanks for your helps,

How precisely do you need to start the jrks? A computer would probably be able to start all of them within a few tens of milliseconds if they are connected by USB. Also, the length of your PID period matters, because the default is 10 ms and the jrks’ PID periods will not be synchronized.

The jrk configuration utility can only control jrks that are connected to the computer via USB.


In order of ms/tens of seconds would be alright.

I was more concerned about program if it sends the command to one jrk at the time, or it can trigger all of them by one command?

Thanks for your helps,

Yes, if you write your program correctly, you can get all the commands to be sent pretty close to the same time.


Thanks for quick response-- So program needs to be modified for that application.