The VESC firmware defines fault codes in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/vedderb/bldc/llms.txt
Use this file to discover all available pages before exploring further.
mc_fault_code enum in datatypes.h. When a fault occurs the motor is stopped and the fault is latched until the controller is restarted or the fault is cleared. Fault data (current, voltage, duty cycle, RPM, temperature, and DRV status) is logged alongside the fault code.
COMM_GET_VALUES or via the VESC Tool real-time data view.Fault categories
FAULT_CODE_NONE (0)
FAULT_CODE_NONE (0)
FAULT_CODE_OVER_VOLTAGE (1)
FAULT_CODE_OVER_VOLTAGE (1)
l_max_vin.Triggered when the measured DC bus voltage rises above the configured maximum (default 57 V). This commonly happens during aggressive regenerative braking when the battery cannot absorb the returned energy.Resolution:- Increase
l_max_vinif the hardware supports higher voltages. - Add a braking resistor or increase battery capacity to absorb regen energy.
- Reduce braking current limits (
l_current_min). - Check for a loose or high-impedance battery connection that causes voltage spikes.
FAULT_CODE_UNDER_VOLTAGE (2)
FAULT_CODE_UNDER_VOLTAGE (2)
l_min_vin.Triggered when the DC bus voltage drops below the configured minimum (default 8 V). Causes include a discharged battery, an undersized supply, or large instantaneous current demand.Resolution:- Charge or replace the battery.
- Check wiring and connector resistance — voltage sag under load increases with resistance.
- Reduce peak current demands (
l_current_max,l_in_current_max). - Verify battery cut limits (
l_battery_cut_start,l_battery_cut_end) are set appropriately.
FAULT_CODE_DRV (3)
FAULT_CODE_DRV (3)
- Read
drv8301_faultsfrom the logged fault data to identify the specific DRV sub-fault. - Check that the gate driver VCC supply is present and stable.
- If the DRV is in over-current mode, check motor wiring for shorts and adjust
m_drv8301_oc_adj. - Allow the hardware to cool if the fault is thermally driven.
FAULT_CODE_ABS_OVER_CURRENT (4)
FAULT_CODE_ABS_OVER_CURRENT (4)
l_abs_current_max.This is a hard absolute current limit (default 130 A) checked against the unfiltered phase current. It fires faster than the software current limiting loop and is intended to protect the hardware from destructive current peaks.Resolution:- Lower
l_abs_current_maxto a value within the hardware rating. - Reduce
l_current_maxso the operating current is well below the absolute limit. - Check for motor phase shorts or incorrect motor parameters (resistance/inductance) that cause current runaway.
- If using FOC, verify the current controller gains (
foc_current_kp,foc_current_ki) are not too aggressive.
FAULT_CODE_OVER_TEMP_FET (5)
FAULT_CODE_OVER_TEMP_FET (5)
l_temp_fet_end.Current limiting begins at l_temp_fet_start (default 85 °C) and the motor is shut off at l_temp_fet_end (default 100 °C).Resolution:- Improve thermal management: heatsink, airflow, or thermal paste.
- Reduce continuous current limits.
- Check that the temperature sensor is correctly placed and calibrated.
- Verify
l_temp_fet_startandl_temp_fet_endare set to values the hardware can sustain.
FAULT_CODE_OVER_TEMP_MOTOR (6)
FAULT_CODE_OVER_TEMP_MOTOR (6)
l_temp_motor_end.Current limiting begins at l_temp_motor_start (default 85 °C) and the motor is shut off at l_temp_motor_end (default 100 °C). Requires a temperature sensor connected to the motor thermistor input.Resolution:- Reduce continuous current or duty cycle.
- Improve motor cooling.
- Verify the correct sensor type is configured (
m_motor_temp_sens_type) and the sensor is functional. - If no motor sensor is fitted, disable the motor temperature protection by setting the sensor type to
TEMP_SENSOR_DISABLED.
FAULT_CODE_GATE_DRIVER_OVER_VOLTAGE (7)
FAULT_CODE_GATE_DRIVER_OVER_VOLTAGE (7)
- Check the gate driver power supply components for damage.
- Verify the input voltage is within the hardware specification.
- Inspect bootstrap capacitors and diodes.
FAULT_CODE_GATE_DRIVER_UNDER_VOLTAGE (8)
FAULT_CODE_GATE_DRIVER_UNDER_VOLTAGE (8)
- Check that the gate driver VCC supply is present and within specification.
- Inspect bootstrap capacitors — they may be damaged or incorrectly sized.
- Verify PWM frequency is not so high that bootstrap capacitors cannot charge between cycles.
FAULT_CODE_MCU_UNDER_VOLTAGE (9)
FAULT_CODE_MCU_UNDER_VOLTAGE (9)
- Check the 3.3 V regulator and its input supply.
- Inspect for short circuits on the 3.3 V rail.
- Check for excessive current draw on the 3.3 V rail from connected peripherals.
FAULT_CODE_BOOTING_FROM_WATCHDOG_RESET (10)
FAULT_CODE_BOOTING_FROM_WATCHDOG_RESET (10)
- This fault is informational on boot — it clears once normal operation resumes.
- If it occurs repeatedly, check for LispBM scripts or custom applications that may be blocking execution.
- Update to the latest firmware, as watchdog resets are often caused by bugs in older releases.
FAULT_CODE_ENCODER_SPI (11)
FAULT_CODE_ENCODER_SPI (11)
- Inspect the SPI wiring (MOSI, MISO, SCK, CS) for loose connections or shorts.
- Verify the encoder supply voltage.
- Check that the correct encoder type is selected in
m_sensor_port_mode. - Reduce SPI cable length or add series termination resistors to reduce reflections.
FAULT_CODE_ENCODER_SINCOS_BELOW_MIN_AMPLITUDE (12)
FAULT_CODE_ENCODER_SINCOS_BELOW_MIN_AMPLITUDE (12)
- Check encoder power supply and signal wiring.
- Verify
m_encoder_sin_amp,m_encoder_sin_offset,m_encoder_cos_amp, andm_encoder_cos_offsetmatch the encoder’s actual output. - Check for shielding on signal cables to reduce noise.
FAULT_CODE_ENCODER_SINCOS_ABOVE_MAX_AMPLITUDE (13)
FAULT_CODE_ENCODER_SINCOS_ABOVE_MAX_AMPLITUDE (13)
- Re-run the sin/cos encoder calibration.
- Verify the signal conditioning resistor dividers match the expected voltage range.
- Inspect for noise coupling that creates false peaks.
FAULT_CODE_FLASH_CORRUPTION (14)
FAULT_CODE_FLASH_CORRUPTION (14)
- Re-flash the firmware using VESC Tool or ST-Link.
- Ensure the power supply is stable during firmware updates.
- If the fault persists after re-flashing, the flash memory may be damaged.
FAULT_CODE_HIGH_OFFSET_CURRENT_SENSOR_1 (15) / _2 (16) / _3 (17)
FAULT_CODE_HIGH_OFFSET_CURRENT_SENSOR_1 (15) / _2 (16) / _3 (17)
- Run the DC calibration routine from VESC Tool (
conf-dc-calin LispBM or the motor setup wizard). - Check the current sense amplifier supply voltage.
- Inspect for damaged current shunt resistors or op-amps.
- Verify
foc_offsets_current[0/1/2]are set correctly — default is 2048.0 for all three.
FAULT_CODE_UNBALANCED_CURRENTS (18)
FAULT_CODE_UNBALANCED_CURRENTS (18)
- Check all three phase connections for continuity.
- Re-run DC calibration to re-zero the current sensor offsets.
- Inspect motor windings for shorts or open circuits between phases.
FAULT_CODE_BRK (19)
FAULT_CODE_BRK (19)
- Identify the source of the BRK signal — check gate driver FAULT pin state.
- Review the gate driver fault register via
FAULT_CODE_DRVif that fault is also present. - Inspect hardware connections to the timer BRK input.
FAULT_CODE_RESOLVER_LOT (20) / _DOS (21) / _LOS (22)
FAULT_CODE_RESOLVER_LOT (20) / _DOS (21) / _LOS (22)
| Code | AD2S1205 Output | Meaning |
|---|---|---|
RESOLVER_LOT | LOT | Loss of tracking — the resolver is moving too fast for the converter to follow |
RESOLVER_DOS | DOS | Degraded output signal — the resolver signal amplitude is too low |
RESOLVER_LOS | LOS | Loss of signal — no resolver signal detected |
- Check resolver wiring (excitation output and sin/cos inputs).
- For LOT: reduce motor speed or increase the AD2S1205 bandwidth setting.
- For DOS/LOS: check the resolver supply voltage and signal cable integrity.
FAULT_CODE_FLASH_CORRUPTION_APP_CFG (23)
FAULT_CODE_FLASH_CORRUPTION_APP_CFG (23)
app_configuration) did not match. The firmware falls back to default application settings.Resolution:- Save the application configuration from VESC Tool to rewrite a valid configuration to flash.
- If the fault recurs, verify power supply stability during saves.
FAULT_CODE_FLASH_CORRUPTION_MC_CFG (24)
FAULT_CODE_FLASH_CORRUPTION_MC_CFG (24)
mc_configuration) did not match. The firmware falls back to default motor settings.Resolution:- Save the motor configuration from VESC Tool to rewrite a valid configuration.
- Run motor detection again to restore tuned parameters.
FAULT_CODE_ENCODER_NO_MAGNET (25)
FAULT_CODE_ENCODER_NO_MAGNET (25)
- Verify the magnet is correctly installed on the motor shaft, centered over the encoder IC.
- Check the axial gap between the magnet and the encoder — it must be within the encoder’s specified range.
- Ensure the magnet has not demagnetized (high temperature or shock can cause this).
FAULT_CODE_ENCODER_MAGNET_TOO_STRONG (26)
FAULT_CODE_ENCODER_MAGNET_TOO_STRONG (26)
- Increase the axial gap between the magnet and the encoder IC.
- Use a weaker magnet with a field strength within the encoder’s specification.
FAULT_CODE_PHASE_FILTER (27)
FAULT_CODE_PHASE_FILTER (27)
foc_phase_filter_disable_fault = true. Enable it only when the phase filter hardware is known to be functional.- Verify the phase voltage filter components (RC network) are present and correctly valued.
- If the hardware does not have phase filters, set
foc_phase_filter_enable = false.
FAULT_CODE_ENCODER_FAULT (28)
FAULT_CODE_ENCODER_FAULT (28)
- Check encoder wiring and power supply.
- Consult the encoder’s datasheet for the specific error condition.
- Inspect the logged
info_strfield in the fault data for additional detail.
FAULT_CODE_LV_OUTPUT_FAULT (29)
FAULT_CODE_LV_OUTPUT_FAULT (29)
- Check for a short circuit or excessive load on the LV output.
- Verify the connected load is within the LV output current specification for the hardware variant.
- Inspect the power switch or MOSFET controlling the LV output.
Fault data fields
When a fault is logged, thefault_data struct records context that helps diagnose the root cause:
