JRK G2 21V3 feedback direction is inverted sometimes without any user input at startup

Hello dear JRK users and pololu advisors,
I’m using JRK G2 21V3 for controlling the fuel actuator of a diesel engine. I’m reading the shaft proximity sensor pulse signal and using this as the feedback input to JRK. The pulses are counted perfectly. However, when I first power on the JRK and its configuration utility on PC, from time to time at startup, the feedback direction is inverted without any user interaction and it leads to driving the output to %100 duty cycle (which means overspeed in my application) since JRK thinks that the engine is speeding up in the opposite direction. I could not detect the root cause. But it seems that it is fixed somehow when
a) I reload settings from utilty software to device
b) set the target to 2048
and
c) power off and on motor supply voltage input to JRK.
Once fixed it never inverts its direction during normal operation. My observation is that this problem happens randomly at board power up.

Could there be a bug in the firmware? What can cause the feedback direction to be inverted at startup?

Hello, have you seen the troubleshooting techniques mentioned here?

Hello.

I am sorry to hear you are having problems with your Jrk G2 21v3 controller. Could you post a copy of your Jrk G2 settings file? You can save a copy of your settings file from the “File” drop-down menu of the Jrk G2 Configuration Utility while the controller is connected.

Also, could you post a screenshot of the “Status” tab of your Jrk G2 Configuration Utility during normal operation, as well as a screenshot of it when the problem is occurring?

Brandon

Hello BrandonM,

Somehow I managed to reproduce the error. My observation is that the feedback is inverted at board startup when target is set to 0 (default initial value). If I set the target to 2048 then the feedback direction becomes normal (as expected). I took the pictures of the plot windows for the two cases. In these trials the engine is shaft is rotated by means of the starter motor up to 80-100rpm (rotates only in forward direction) and you can observe the feedback signal in the figures. In the first image the target is ‘0’ and the feedback direction is inverted(Could this be a bug in the firmware?). In the second case the target is set to 2048 and after that you can see the feedback direction becomes normal (forward direction). I circumvent this problem by setting the target to 2048 at board startup.

I couldn’t get the settings file for the moment. However I’ll upload it as soon as I get access to my computer at work.


Have you had a chance to get the settings file yet? The main thing I wanted to confirm from it was that you are in frequency feedback mode. If you are, then everything in your screenshots looks like the normal documented behavior to me. You can find more information about the expected behavior under the “Frequency feedback on FBT” heading of the “Analog/frequency feedback handling” section of the Jrk G2 user’s guide.

Brandon

Hello Brandon,
Thanks for the promt reply. I had some technical problems on getting the settings file out of my work pc but finally I managed to do that. Please find the settings file in the attachment.

jrk_g2_21v3_settings.txt (2.0 KB)

I’m using frequency feedback mode (counting the pulses) and the engine only rotates in single forward direction (target between 2048 and 4095). According to the last sentence of “7.4-Frequency feedback on FBT” section in the user guide, I notice that it is the normal behavior (feedback is in the negative direction when the target is less than 2048). However I cant really comprehend the rationale behind this behavior. Why the feedback direction is in the negative direction (virtually inverted) when target is set to a value less than 2048 although the ‘invert feedback flag’ is ‘false’?

If you set the target to something less than 2048, it means you want the motor to turn in the reverse direction. The Jrk is unable to detect the direction of the motor’s motion from the feedback in Frequency feedback mode, so it just infers the direction of motion from the target you set.

So, doing it that way is necessary for the PID algorithm to function properly. Otherwise, you could run into situations that the PID algorithm wouldn’t be able to handle (for example, with a target less than 2048 and a feedback greater than 2048) since it’s based on minimizing the difference between the feedback and target values.

Brandon