An inverter comprising: an inverter controller configured to operate a plurality of switches (SW1 to SW4) to provide an alternating current to an output; and at least one surge protection device (101a, 101b) for limiting a voltage on a direct current link of the inverter, the at least one surge protection device (101a, 101b) being characterized by: a first variable resistance component coupled to the direct current link of the inverter; a second variable resistance component coupled to the direct current link of the inverter; a first sensing resistor selectively connected in parallel to the first variable resistance component by a first switching component; a second sensing resistor selectively connected in parallel to the second variable resistance component by a second switching component; a first detection device configured to measure a voltage across the first sensing resistor; a second detection device configured to measure a voltage across the second sensing resistor; a direct current link voltage sensor coupled to the direct current link of the inverter; and a control circuit including a failure sensing logic configured to detect a failure in the first and second variable resistance components (90a, 90b) being series-connected elements in response to voltage information from the variable resistance components (90a, 90b) and voltage information from the first and second detection devices (94a, 94b) for the voltage across the sensing resistors (92a, 92b), wherein the failure sensing logic is configured to selectively connect the second sensing resistor using the second switching component and calculate a conduction voltage for the first variable resistance component as a difference between the voltage across the second sensing resistor measured by the second detection device and the voltage output of the direct current link voltage sensor. an inverter controller configured to operate a plurality of switches (SW1 to SW4) to provide an alternating current to an output; and at least one surge protection device (101a, 101b) for limiting a voltage on a direct current link of the inverter, the at least one surge protection device (101a, 101b) being characterized by: a first variable resistance component coupled to the direct current link of the inverter; a second variable resistance component coupled to the direct current link of the inverter; a first sensing resistor selectively connected in parallel to the first variable resistance component by a first switching component; a second sensing resistor selectively connected in parallel to the second variable resistance component by a second switching component; a first detection device configured to measure a voltage across the first sensing resistor; a second detection device configured to measure a voltage across the second sensing resistor; a direct current link voltage sensor coupled to the direct current link of the inverter; and a first variable resistance component coupled to the direct current link of the inverter; a second variable resistance component coupled to the direct current link of the inverter; a first sensing resistor selectively connected in parallel to the first variable resistance component by a first switching component; a second sensing resistor selectively connected in parallel to the second variable resistance component by a second switching component; a first detection device configured to measure a voltage across the first sensing resistor; a second detection device configured to measure a voltage across the second sensing resistor; a direct current link voltage sensor coupled to the direct current link of the inverter; and a control circuit including a failure sensing logic configured to detect a failure in the first and second variable resistance components (90a, 90b) being series-connected elements in response to voltage information from the variable resistance components (90a, 90b) and voltage information from the first and second detection devices (94a, 94b) for the voltage across the sensing resistors (92a, 92b), wherein the failure sensing logic is configured to selectively connect the second sensing resistor using the second switching component and calculate a conduction voltage for the first variable resistance component as a difference between the voltage across the second sensing resistor measured by the second detection device and the voltage output of the direct current link voltage sensor.