Error/Status codes

General discussion of using Roboclaw motor controllers
Locked
fausto.tromba
Posts: 37
Joined: Wed Jul 31, 2019 7:24 am
Error/Status codes

Post by fausto.tromba »

HI
My Motor control is MCP236.
Using the serial command "ReadError" I get the following error code:

When the Voltage fo the Battery is low: 524288.
When the Voltage fo the Battery is high: 262144.

From the user manual on page 75, it should be 0x0400 and 0x0800.

Can you explain to me how to decode the number that I got?

Thanks

Fausto
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Error/Status codes

Post by Basicmicro Support »

Yes. Additional warning/error states were needed for the new error limits for velocity and position modes. Unused bits are reserved for future use so we don't have to change this command again in the future.

The first two bytes are now the warning status bits(16bit word)
#define WARN_NONE 0x00
#define WARN_OVERCURRENTM1 0x01
#define WARN_OVERCURRENTM2 0x02
#define WARN_MBATHIGH 0x04
#define WARN_MBATLOW 0x08
#define WARN_TEMP 0x10
#define WARN_TEMP2 0x20
#define WARN_S4 0x40 //HOME, LIMITF, LIMITR
#define WARN_S5 0x80 //HOME, LIMITF, LIMITR

The second two bytes are now the error status bits(16bit word):
#define ERROR_NONE 0x0000
#define ERROR_ESTOP 0x0001
#define ERROR_TEMP 0x0002
#define ERROR_TEMP2 0x0004
#define ERROR_MBATHIGH 0x0008
#define ERROR_LBATHIGH 0x0010
#define ERROR_LBATLOW 0x0020
#define ERROR_FAULTM1 0x0040
#define ERROR_FAULTM2 0x0080
#define ERROR_SPEED1 0x0100 //M1 speed limit error
#define ERROR_SPEED2 0x0200 //M2 speed limit error
#define ERROR_POS1 0x0400 //M1 position limit error
#define ERROR_POS2 0x0800 //M2 position limit error
#define ERROR_MBATLOW 0x4000 //Flag indicates motors are free wheeling due to under voltage but is not a latching error
#define ERROR_MBATHIGH_HYST 0x8000 //Flag indicates motors are in braking state due to an over voltage, but is not a latching error

The new speed and position limits can be set in the respective screens in Motion Studio.

Unfortunately, the manual lags behind these changes by several months usually. If you have any questions on the changes until then please contact support@basicmicro.com.

Note this applies to both Roboclaw and MCP lines of controllers.

Locked