Canandcolor Faults

Canandcolor.Faults are a series of flags sent with the Canandcolor’s status frame that indicate if the device is experiencing an issue. This API presents faults in two formats: active and sticky faults.

Active faults are updated every time a status frame is sent, and thus if an issue is resolved it will update the fault flag accordingly. This is useful for issues that can be transient, such as undervoltage faults (which occurs during a brownout)

Sticky faults do not automatically clear when set to true. For example, if a Canandcolor briefly undervolts, due to a brownout, but normal power is later restored, the undervoltage fault will still be set to true. Sticky faults must be cleared by the user.

Fetching Faults

// Get a Canandcolor object with CAN ID 0
Canandcolor canandcolor = new Canandcolor(0);

// Fetch this Canandcolor's active faults
Canandcolor.Faults faults = canandcolor.getActiveFaults();

// Fetch this Canandcolor's sticky faults
Canandcolor.Faults sticky = canandcolor.getStickyFaults();
// Define a Canandcolor object with CAN ID 0
Canandcolor canandcolor{0};

// Fetch this Canandcolor's active faults
CanandcolorFaults faults = canandcolor.GetActiveFaults();

// Fetch this Canandcolor's sticky faults
CanandcolorFaults sticky = canandcolor.GetStickyFaults();
How to clear sticky faults
canandcolor.clearStickyFaults();
canandcolor.ClearStickyFaults();

Types Of Faults

Power Cycle

The Power Cycle fault is set to true when the encoder powers on. By clearing sticky faults on initialization, this flag can be used to determine if the encoder has rebooted.

CAN ID Conflict

The CAN ID Conflict flag is set to true when the device detects another device with the same CAN ID. While available in the API, you should check the physical device for the LED flashing blue (which indicates a detected CAN ID conflict). Alchemist should be used to configure the different devices to avoid CAN ID conflicts.

CAN General Error

The CAN General Error flag is set to true if the encoder detects a problem with its ability to recieve CAN packets, or other issues with the CAN bus. Generally, this indicates an issue with the CAN wiring.

Out Of Temperature Range

The Out Of Temperature Range flag is set to true if the encoder detects its temperature is outside the safe operating range of 0-70 degrees Celsius. This is a potential problem if the motor is operating in very close physical proximity to a motor, such as mounted on its casing or the front plate where heat is generally dissipated. Otherwise it is unlikely to see this error during normal use.

Hardware Fault - Proximity

A Hardware Fault indicates the device has detected a problem during operation. This fault is thrown if an issue has occured with the proximity ranging sensor.

Hardware Fault - Color

A Hardware Fault indicates the device has detected a problem during operation. This fault is thrown if an issue has occured with the color sensor.

Undervolt

The Undervolt flag is set to true if the device detects an undervoltage (brownout) condition during operation. As a note, this fault very rarely trips, as a severe undervoltage condition that can cause this fault is likely to also reset the encoder (see: Power Cycle fault)