State Machine
The system always exists in one of the predefined states, also known as modes. These modes are represented internally as numeric state variables.
You can access the current mode through the /mode
variable located at the root level.
Mode Name | Mode Number | Description |
---|---|---|
MODE_ERROR | 0 | Controller is in an error state. Either /driver/error or /common/error is non-zero. |
MODE_OVERVOLTAGE | 80 | Generator stopped due to motor voltage exceeding battery voltage. Controller unable to regulate current. |
MODE_MAX_TRIALS | 81 | Generator stopped after reaching the maximum number of startup attempts. |
MODE_PAUSE | 82 | Generator is in pause mode between startup attempts. |
MODE_DISARMED | 90 | Generator is disarmed. Turn input off, then back on to reset. |
MODE_STOPPED | 91 | Generator is stopped. Switch is turned off. |
MODE_PULLBACK | 100 | Generator is starting; pullback is currently in progress. |
MODE_STARTING | 101 | Generator is currently starting. |
MODE_RUNNING_NOLOAD | 110 | Generator is running without load. |
MODE_RUNNING | 111 | Generator is running and actively generating power. |
MODE_OVR | 200 | Driver is overridden via CAN or the run command. |