Canandcoder Faults

CanandcoderFaults are a series of flags sent with the Helium Canandcoder’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 Helium Canandcoder 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 canandcoder object with CAN ID 0
Canandcoder canandcoder = new Canandcoder(0);

//Fetch this canandcoder's active faults
Canandcoder.Faults faults = canandcoder.getActiveFaults();

//Fetch this canandcoder's sticky faults
Canandcoder.Faults sticky = canandcoder.getStickyFaults();
using namespace redux::sensors::canandcoder;
//Get a canandcoder object with CAN ID 0
Canandcoder canandcoder{0};

//Fetch this canandcoder's active faults
CanandcoderFaults faults = canandcoder.GetActiveFaults();

//Fetch this canandcoder's sticky faults
CanandcoderFaults sticky = canandcoder.GetStickyFaults();
How to clear sticky faults
canandcoder.clearStickyFaults();
canandcoder.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

A Hardware Fault indicates the device has detected a problem during operation. For the Helium Canandcoder, this generally will indicate that the device is unable to communicate with the on board magnetic field sensors.

Magnet Out Of Range

The Magnet Out Of Range fault is set to true if the device is unable to detect the magnet that it is supposed to be reading. This flag will always match the encoder’s LED being set to a red color (which indicates no detected magnet). Most often, this is due to the magnet being too far away from the surface of the encoder.

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)