## 3 Algorithms for Microcontroller  
The TMS320F28002x (see Figure 1a) microcontroller receives a control signal from the upper-level control system and generates a feedback pulse with a 250 ns delay after each edge. The duration of the feedback pulse equals 700 ns. This signal allows us to verify the correct operation of the communication interface between the microcontroller and the upper-level control system. The control input signal and the driver feedback signal in normal operation are shown in Figure 2a,b. In normal operation mode without faults, the microcontroller sends the high-state logical signal \"Enable\" to the driver chip (see Figure 1b). In this case, the control signal is not blocked, and the driver chip performs the control of the IGBT. The driver chip forms the voltage transients required for the transistor to turn on and off. If a failure occurs, the control signal is blocked by the logical signal \"Enable\", and the feedback pulse is set with a duration depending on the type of fault (Figure 2c-e). The driver chip is unlocked when the control signal corresponds to the \"turn off\" state and fault conditions do not occur. The software of the microcontroller makes a conclusion about the occurrence of failure based on measurements of gate voltage, gate current, collector voltage, and +15 V voltage supply, as shown in Figure 1b. In the case of a fault related to the breaking of the gate circuit of the transistor, the control signal is blocked, and a feedback pulse with a duration of 1 us is produced, which corresponds to Figure 2c. The normal operation of the gate circuit is validated by measuring the gate voltage and current with analog circuit #4 and analog circuit #1 (see Figure 1b). The reference gate voltage is 15 V in the case of the conducting state and -9 V for the turned-off state. At the instance of time when the driver changes the state of the transistor, a gate current pulse occurs. The appearance of the current pulse is detected by an internal analog comparator in the microcontroller. If the comparator triggering level is exceeded, a software flag is set. The presence of the flag is checked by the software and indicates the  
Figure 1: IGBT gate driver: (**a**) photo and (**b**) functional diagram. opening or closing of the transistor. If there is no flag from the comparator, then the gate circuit of the IGBT is disconnected. The collector voltage value is measured by the embedded ADC using analog circuit #2 and analog circuit #3 (see Figure 1b). The measurement of the collector voltage by analog circuit #2 makes it possible to control the appearance of short circuits while the transistor is switching on. This voltage is specified in [19] for hard short-circuiting during the turn-on phase. If the voltage exceeds the reference value of 51 V after 7 us, a short circuit is detected by software. Analog circuit #3 detects the overload current by measuring the collector voltage corresponding to the I-V characteristic of the IGBT in the conducting state. In the case of exceeding the reference collector voltage, the control signal is blocked, and a feedback pulse with a duration of 9 us is produced, as shown in Figure 2d. The voltage supply, +15 V, is monitored by analog circuit #5 (see Figure 1). If the voltage supply is out of range, it is triggered by the embedded analog comparator, the IGBT control signal is blocked, and the feedback signal is held up until the power is stabilized within acceptable limits, as shown in Figure 2e. The main structure of the software is implemented by a finite-state machine. The finite-state machine has two states, \"on\" and \"off\", which correspond to the on and off states of the IGBT control signal. Also, each state has substates with functions that correspondingly monitor the measured values. The functions and transition conditions of the finite-state machine are shown in Figure 3. In all substates, the voltage supply, +15 V, is monitored. The transition to the next substate is triggered by the corresponding hardware timers of the microcontroller.