7.7. Error handling

This section documents how the Jrk G2 handles error conditions that can stop the motor.

Error variables and commands

The Jrk has a 16-bit “Error flags halting” variable, and each error condition corresponds to a bit in this variable. If the bit is 1, the error is currently stopping the motor. The Jrk has commands for reading variables over serial, I²C, and USB, and these commands can clear the bits in the “Error flags halting” variable as a side effect of reading it . (This is only useful for latched errors, and does not apply to the “Awaiting command” bit.) You can also use the “Clear errors” button in the “Errors” tab of the configuration utility software to do this.

The Jrk also has a 16-bit “Error flags occurred” variable that records which errors have a occurred since the last time the variable was cleared, including disabled errors. The bits in this variable correspond to the same errors as the bits in the “Error flags halting” variable. The Jrk has commands for reading variables over serial, I²C, and USB, and these commands can clear the “Error flags occurred” variable as a side effect of reading it. The Jrk configuration utility constantly reads this variable and clears it in order to update the occurrence counts in the “Errors” tab.

For more information about the Jrk’s error-related variables and commands, see Section 10 and Section 11.

Error response options

The Jrk’s response to the different errors can be configured. Each error has up to three different available settings:

  • Disabled: The Jrk will ignore this error and never set the corresponding bit in the “Error flags halting” variable. You can still determine whether the error is occurring by checking the “Occurrence count” column in the configuration utility, or by issuing a command to read the “Error flags occurred” variable.
  • Enabled: When this error happens, the Jrk will set the corresponding bit in the “Error flags halting” variable, which causes the motor to stop. When the error stops happening, the error bit will be set to 0, and the motor can restart.
  • Enabled and latched: When this error happens, the Jrk will set the “Error flags halting” bit for this error and also activate the “Awaiting command” error. The error bit will stay set until the Jrk receives a command to clear the “Error flags halting” variable. You will need to resolve the error, clear the “Error flags halting” variable, and also send a command to clear the “Awaiting command” error before the Jrk will drive the motor again.

Each error has a “Hard stop?” option that determines whether the Jrk will respect deceleration limits while stopping the motor in response to that error. The “No power” and “Motor driver error” errors are always hard stop errors. The Jrk does not respect deceleration limits for hard stop errors.

Errors

Each error condition corresponds to a bit in the “Error flags halting” and “Error flags occurred” variables. Bit 0 is the least-significant bit. The Jrk uses little-endian byte order, so the first byte of each variable contains bits 0 through 7, and the second byte contains bits 8 through 15.

  • Bit 0: Awaiting command
    This error occurs when the Jrk starts up if its input mode is “Serial / I²C / USB”, and it serves to prevent the Jrk from driving the motor before it receives a command. This error also occurs when the Jrk receives a “Stop motor” command and when a latched error occurs. Any version of the “Set target” command, the “Force duty cycle target” command, or the “Force duty cycle” command will clear this error.
  • Bit 1: No power
    This error occurs when the Jrk detects that the motor power supply on VIN is too low to drive the motor. If this error occurs, check your power supply and power connections.
  • BIt 2: Motor driver error
    This error occurs when one of the motor driver’s fault conditions is triggered, and the motor driver shuts down the motor and reports the error to the Jrk’s microcontroller. This error can be caused by the motor driver’s over-temperature or over-current conditions. It can also occur when motor power is connected but its voltage is not high enough.
  • Bit 3: Input invalid (RC input mode only)
    This error occurs if the input mode is “RC” and the signal on the RC pin is not valid (see Section 7.3).
  • Bit 4: Input disconnect
    This error occurs when the input is above the “Input error maximum” or below the “Input error minimum” settings, which can be set in the “Input” tab of the configuration utility. Additionally, when the “Detect disconnect with power pin (SCL)” option is enabled in analog input mode, the Jrk will set this error if it detects that the analog input is disconnected using the SCL pin (see Section 7.3).
  • Bit 5: Feedback disconnect
    This error occurs when the feedback is above the “Feedback error maximum” or below the “Feedback error minimum” settings, which can be set in the “Feedback” tab of the configuration utility. Additionally, when the “Detect disconnect with power pin (AUX)” option is enabled in analog feedback mode, the Jrk will set this error if it detects that the analog feedback input is disconnected using the AUX pin (see Section 7.4).
  • Bit 6: Soft overcurrent
    This error occurs when the soft motor current limit is exceeded (see Section 7.6).
  • Bit 7: Serial signal error
    This is a hardware-level error that occurs when a serial byte received on the RX line does not have a stop bit in the expected place. This can occur if you are sending commands to the Jrk at the wrong baud rate.
  • Bit 8: Serial overrun
    This is a hardware-level error that occurs when the RX receive buffer is full. This error should not occur during normal operation.
  • Bit 9: Serial RX buffer full
    This is a firmware-level error that occurs when the firmware’s buffer for bytes received on the RX line is full and a byte from RX has been lost as a result. This error should not occur during normal operation.
  • Bit 10: Serial CRC error
    This error occurs when the Jrk is running with CRC enabled and the cyclic redundancy check (CRC) byte at the end of a command packet is incorrect (see Section 12).
  • Bit 11: Serial protocol error
    This error occurs when the Jrk receives an incorrectly formatted or nonsensical command packet over serial or I²C. For example, if the command byte does not match a known command or an unfinished command packet is interrupted by another command packet, this error occurs.
  • Bit 12: Serial timeout error
    When the serial timeout setting is enabled (non-zero), this error occurs whenever the timeout period has elapsed without the Jrk receiving a valid serial, USB, or I²C command that clears the timeout. This error can be used to make sure the Jrk shuts down if the software controlling it crashes. The commands that can clear the timeout are: any version of the “Set target” command, the “Stop motor” command, the “Force duty cycle target” command, the “Force duty cycle” command, and any command that clears “Error flags halting”.
  • Bit 13: Hard overcurrent
    This error occurs when the hard motor current limit is exceeded (see Section 7.6). The “Hard overcurrent threshold” setting can be used to allow for a limited amount of hardware current limiting before triggering this error. This error only applies to the Jrk G2 18v19, 24v13, 18v27, and 24v21.

The ERR line

If the “Error flags halting” bit for an error other than the “Awaiting command” error is set, the Jrk will drive its ERR line high, which also turns on the red LED. The ERR line is normally pulled down, and it has a 220Ω series resistor.

Related Products

Jrk G2 18v19 USB Motor Controller with Feedback
Jrk G2 24v13 USB Motor Controller with Feedback
Jrk G2 18v27 USB Motor Controller with Feedback
Jrk G2 24v21 USB Motor Controller with Feedback
Jrk G2 21v3 USB Motor Controller with Feedback
Jrk G2 21v3 USB Motor Controller with Feedback (Connectors Soldered)
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors