Software Based Programmable IGBT IPM Dead-Time Insertion Module Using 16-bit Micro Controller for BLDC Motor Control Application with 3-Phase Sinusoidal and Trapezoidal Drive

Motor control application, especially for medium to high power implementation, will benefit the most with the compactness and robustness of an Integrated Power Module of Insulated Gate Bipolar Transistor also known as IGBT IPM. Nevertheless, implementation motor control with a general purpose micro-processor without any advance timer functionality with IGBT IPM will be challenged by the Dead-Time switching requirement in its power switching implementation. Further, a combined sinusoidal and trapezoidal drive of a motor control is also believed will provides a better control performance in term of lower torque ripple and higher motor top speed. This paper proposed a low-cost alternative to address the requirement by implementing a software based dead time functionality using the low cost 16-bit micro controller board with capability of serving up sinusoidal drive as well as trapezoidal drive for motor control application.


Introduction
Brushless DC Motor (BLDC) has been the powerhouse behind the rapid progress in electric powered vehicle, due to its high power to weight ratio and the level of efficiency that it could achieve. Unlike a brushed DC motor which utilized mechanical conductive brush to mechanically and electrically synchronized the commutation process, the BLDC requires a computer based electronic motor control to provides the precisely timed power in each its phase input in order to commutate properly. A computer controlled Pulse Width Modulation (PWM) power switching is use as a means of control mechanism which typically utilized power Mosfet for low to mid-level power requirement or IGBTs in the high power arrangement.
The insulated gate bipolar transistor, generally known as IGBT, plays crucial role in high power switching due to its high current-carrying capacity which simplifies the implementation of high power motor control system. In an IGBT motor control system, every phase output is constructed from two IGBTs which acts as a high switch and a low side switch. In its operation the Half-Bridge operates by connecting its output line to High or low power supply rail driven by appropriates driver signals in its gate control.
Further, Insulated Gate Bipolar Transistor Intelligent Power Module (IGBT IPM), an advanced hybrid power device that combine high speed, low loss IGBTs with optimized gate drive and protection circuitry also available. Highly effective over-current and short-circuit protection is realized through the use of advanced current sense IGBT chips that allow continuous monitoring of power device current. System reliability is further enhanced by the IPM's integrated over temperature and under voltage lock out protection. Compact, automatically assembled Intelligent Power Modules are designed to reduce system size, cost, and time to market (Mitsubishi, 1996).
The IPMs built-in gate drive and protection circuits protect it from many of the operating modes that would violate the Safe Operation Area (SOA) of non-intelligent IGBT modules. A conventional SOA definition that characterizes all possible combinations of voltage, current, and time that would cause power device failure is not required. Those safe protection area includes Switching SOA, Short Circuit SOA by the implementation of Over Current, short circuit and over temperature integrated protection inside the module. a vault signal output, is also provides, which then can be used to as a mean of control input for the control unit of the switching.
Like all other electronic devices, IGBT devices are not ideal, which in its switching action has a finite turn-on and turn-off time. Thus in a half-bridge configuration, a specific time of off-state for both IGBT Switch prior to turn On is required and called as a Dead-Time (Choi, J.W.;Sul, S.K,1994) (Zhang, J.;Fang, L , 2009) . The Dead time is a state where at a specific given time, both switch in the same half-bridge configuration, both the high side and the low side is turned off, to avoids the shoot-though condition where both the high side and low side IGBT both in turned ON condition due to turn-off and turn-on delay. The shoot through in which both high side and low side IGBT is conducting in the same time will short circuit the supply rail.
Every manufacturer will provide the recommended Dead-time parameter specific for their IGBT devices, for an example Mitsubishi had recommended a Dead-Time in a value greater than 2.5µS in their Arm shoot-through blocking time parameter for their PM150CSD060 Integrated Power Module (Mitsubishi, 1996).
The integration of Dead-Time requirement, especially for motor control application introduce another level of complexity in the PWM signal generation. Despite there are some small number of specific processor with advance Timer functionality which capable in generating dead-time timing in its complementary output, most cheaper general processor requires external dead time insertion hardware or sacrificing processor resources by implementing through software logic.
The introduction of Dead time between complimentary PWM signal driver, will introduce disturbance known as dead-time-effect. Where as in the case of a single pulse switching, the effect is not very obvious in a speed control system with a low carrier frequency and low performance requirement. However, when the motor operates at low speed and high switching frequency, the accumulated dead-time effect will cause the voltage and current to contain a large number of harmonic components, and will generate a zero-current-clamping phenomenon (Ji, Yi et al., 2019). The speed regulation and dead-time effect causes the motor to generate a large pulsating torque and additional loss, and The greater the switching frequency is, the more adverse this phenomenon is (Ji, Yi et al., 2019).
Several strategies to compensate the dead time effect have been proposed (Choi, J.W.;Sul, S.K ,1994). The current research on the dead-time compensation focused on the voltage feed-forward and current feedback compensation. Through the error analysis between the inverter reference voltage and the output voltage. In general, classification of the dead-time compensation methods is divided into three methods: time compensation method; average voltage compensation method; and other methods, which use existing mature modulation technologies. Among these, the time compensation method is most widely used, with other methods using closed loop control (Ji, Yi et al., 2019).
There are currently several gate driver integrated circuit with hardware programmable dead-time-insertion, some examples are the International Rectifier IRS25091SPbF and IXYS IX21844 which has a feature of build in programmable Dead-time insertion up to 5µS through selection of resistor. However, as those hardware requires a manufacturing of a specific board to host it and physical resistor replacement to change the desired dead-time period, for low volume and interconnection to popular general processor board the associated effort and cost is not preferable.
Further, on the software side, while there are also a motor control specific processor such as STM32F100xx series which already includes the Advance control timer which already capable of producing 6 Channel complementary PWM with build in Dead-Time, S. Nuratch (S. Nuratch, 2017) had demonstrated that a cheaper 16-Bit micro controller is capable to be programmatically functioning as a dead time insertion module for Half bridge DC-to-DC converter operation. With this capability, it is believed that the uses of 16-Bit low cost micro controller will expand the selection of popular general processor to be used as motor controller. Further, a delayed complementary reset RS flips-flop within FPGA also has been proposed to provides a dead time insertion function with less programmability outside design period (Yassen V. Gorbounov & Zdravko A. Iliev, 2017). This paper proposed a software based programmable 3-phase IGBT IPM Dead-Time insertion using 3 16-bit micro-controller board with program written in Arduino IDE. Further, the Arduino promini board is selected for this study due to its low prize, low-power and small footprint while still providing the same processing power and speed compared to the higher end module. With 16Mhz AT-Mega328 processor, with 32KB of flash, 1 KB EEPROM and 2 KB SRAM and 2 external interrupt channel, the humble cheapest Arduino promini is having the same processing power as higher end board such Arduino UNO and Nano.
The proposed Dead-time insertion module will be designed to also able to accommodate both sinusoid drive and its SPWM switching modulation as well as the trapezoidal drive PWM modulation with seamless transitional operation for both modes, while also observing a Fault signal from IPM IGBT module as a part of dead-time effect mitigation strategy.

Proposed Programmable IGBT IPM Dead-Time Insertion Module
The proposed module software will be designed to provides a programmable dead time while accommodating two methods of PWM motor control implementation of trapezoidal drive mode as well as sinusoidal drive mode. Designed to immediately responding to the PWM input state change, the interrupt delay logic invocation will be selected for real-time response of PWM state changes.
There are two PWM implementation method with respect to the relationships of the phases being modulated (Anuja Namboodiri, Harshal S. (2014), those methods are: Unipolar PWM whereas only one phase is being modulated with PWM while the other phase functioning as return line and the Bipolar PWM whereas all phase is being modulated. While Sinusoidal BLDC motor controller requires a bipolar PWM method, Yasin Bektas, N. Fusun Oyman Serteller suggested that a hybrid bipolar-starting and unipolar-running method is used to provide high speed with high starting torque, especially when the motor is loaded. As a result, a bipolar starting and unipolar-running driving circuit is thought to combine advantages of bipolar and unipolar driving (Yasin Bektas & N. Fusun Oyman Serteller, 2011). The proposed model will be implementing the hybrid one through the modified unipolar PWM (Libor Prokop, 2011) with the implementation of additional enable input.

Dead-Time Insertion Concept
BLDC Motor control utilize PMW power switching as means of control either by using Sinusoidal wave or Trapezoidal wave. For every phase of the motor, the PWM power switching is implemented by two complementary power switch arrange in half-bridge configuration.  As illustrated in figure 2., the half bridge configuration of power switch and its operational truth table constructed with two power switch Q and Q'. Acting as the switch that connect the output to the positive side power supply, Q is called the High Side Switch and consequently the Q' is called the Low Side Switch.
Due to a finite turn-Off and turn-On time of both Q and Q', there is a possibility a NOT ALLOWED condition that Q and Q' is still conducting at same time despite one the gate control already turned-off, hence a sufficient time delay is required that both Q and Q' is Turned-Off before transitioning to HIGH Output state of any switch. As the PWM transitioning its state from LOW to HIGH and vice versa, the associated transition LOW to HIGH in one of the complementary switch Q or Q' is delayed for a specific amount of time. This delay, will allow the associated switch to fully turned Off before its complementary switch commanded to turn On.
A module that take a PWM input and provides such functionality of providing complimentary PWM output with dead time is called as dead time insertion module.

Software Based Programmable IGBT IPM Dead-Time Insertion Module Using 16-bit Micro Controller
Sinusoidal drive motor control performance surpassed the trapezoidal control especially in low speed commutation and start up process. The trapezoidal commutation generates torque ripples at low speeds and is relatively efficient in the high speed range, the sinusoidal commutation provides smooth operation at low speeds, but it is inefficient in high speed range (R. Krishnan, 2001), (Lee, S., Lemley, T., & Keohane, G., 2009) Low end BLDC motor control mostly uses a trapezoidal drive for their simplicity as well higher rotational speeds, while the higher end BLDC motor control uses sinusoidal drive uses the sinusoidal one for the smoothness of operation. However, as the processing requirement of sinusoidal generation is high, sinusoidal drive motor will have lower top speed compared with the trapezoidal one.  Figure 4, illustrated 3-phase 120-point SPWM output and its relation to BLDC hall position sensor, in typical sinusoidal motor control application. As sinusoidal motor controller application uses SPWM or SVPMW modulation continuously, all phase will be continuously pulse-width modulated with varying sinusoidal wave over time. Therefore, on the sinusoidal motor controller application, the dead time insertion module on every phase will be continuously functioning as all phase will continuously producing the associated sinusoid wave.
This is not the case for trapezoidal motor controller, As the commutation sequence for every phase consist of 3 states, those state are HIGH, LOW and FLOAT in which the phase output is disconnected from both positive and negative power supply. Unlike the sinusoidal one, on the trapezoid motor controller, the speed regulation mechanism will use PWM modulation on HIGH state only to regulate the motor speed, while the LOW state will be connected continuously to negative power supply. Therefore, trapezoidal drives will only require the Dead Time insertion function in its HIGH phase state, and no dead-time function in LOW state, in addition to that, the trapezoidal drive requires a FLOAT state transition whereas which both High Side and Low Side switches are turned off during Phase state transition between HIGH to LOW and vice versa. Therefore, the respective Q and Q' complementary control signal for All three phases are as shown in figure 6.  Vol. 13, No. 2;2020 While inserting a dead time for the SPWM requires continuous operation between each SPWM pulse state transition, the trapezoid drive mode will require additional input signal to represent the FLOAT state in which both Q and Q' not conducting as part of the commutation sequence. The proposed software based dead time insertion module will accommodate both drives mode through the implementation of dead time insertion function while still providing an enable input to turn both switch off to with respect to the third state in the trapezoidal drive mode. By controlling the enable input, the motor control application then could utilize both sinusoidal as well as trapezoidal programmatically in its commutation sequence.
The proposed design of the Dead Time Insertion module is based on a concept of a programmable fix delay software logic that separates a single ended real-time PWM input signal and providing delayed turned-on complementary output signal using blocking interrupt function. The blocking interrupt single loops takes 0.68µS to completed, which then becoming the single time unit in Dead-time insertion delay period. Multiple delay unit to achieve the desired dead time period is configurable in DeadTimeUnit parameter which will governs how long the Dead-time should occur in the block of 0.68µS.
The block diagrams bellows illustrated the configuration of 3-channel Dead Time insertion module using 3 ATMega328 16MHz each having a PWM input signal as well as sinusoid enabled input. As it could be seen for fig. 7, For each channel, a single ended PWM signal is connected for each respected phase and connected to two interrupt port which was programmed to detect either a FALLING or RISING edge interrupt, the complementary outputs Q and Q' for each channel will be provided as complementary output with the designed dead time delay inserted between each state transition. Despite the external interrupt channel of Atmega328 is capable of sensing CHANGE interrupt, the separation of both interrupt processing is designed to expedite the interrupt processing time by removing the FALLING/RISING detection logic processing time as if it was implemented by CHANGE interrupt.
The Dead Time delay itself is then implemented by a specific of direct-to-port data write of LOW-LOW for both complementary output in N-times specific loop cycle, in whereas N is the multiplication factor times 0.68µS to achieve the targeted Dead-time delay.
The proposed design of the Dead-Time insertion module is having two mode of operation i.e. enable and disable mode. In the enable mode, the module will continuously insert dead time delay for every state changes in the PWM input. Where as in the disable mode, the module will stop inserting dead time and turned off both complementary output. Mode selection changes is synchronized to be only effective after Dead-time insertion process by state mode polling method, with its value observed on every interrupt service routine process. The output state of the module for both modes are as follows: a. Enabled mode in enable mode, the FALLING and RISING edge interrupt, as the detection point for PWM input state change, will toggle the output state changes through two step. The first step is to turn Q off in the event of FALLING or Q' in the event of RISING edge interrupt and wait until a specific delay time expires.
Step two turn the respective output On, i.e. Q' for FALLING event and Q for RISING event.
The state diagram of each channel Dead time insertion module with regards to FALLING and RISING interrupt to its Q and Q' complimentary output state are as show in figure 8. The disable mode is used to provides the third state or the FLOAT state whereas both Q and Q' gate input will be driven to LOW to disconnect the both switch. The disable mode status is pooled and served in immediately after every interrupt processing, enable status also checked in the beginning of every interrupt service routine.
Regardless of the FALLING or RISING interrupt event, or at the status pooling point, the both Q and Q' will be immediately turned off if enable status was found to be disable (Off). The state diagram of the trapezoidal/SPWM disable mode are as follows: Figure 9. Disable mode state diagram With two mode of operation, the interrupt service routine for both FALLING and RISING interrupt are as describe in fig. 10. The enable status pooling its self is executed in the Main() loop of the program, executed continuously while the module is not serving any interrupt service request. Figure 10. Flowchart of RISING and FALLING interrupt service routine Implemented on Arduino promini with two external interrupt wired to detects the FALLING and RISING edge exclusively for faster interrupt processing, and a pooling based input for enabling/disabling the SPWM mode the theoretical timing diagram are as follows: Figure 11. Timing diagram The program was written in Arduino IDE 1.8.7 resulting a 4882 bytes of binaries code and using 165 bytes of dynamic memory and burned directly to its flash program storage spaces through serial port. The programmable dead-time insertion period is implemented through a deadTimeUnit parameter configurable prior the compilation time.
With the proposed design, the dead time insertion module could be used directly for sinusoidal SPWM motor controller, moreover it could also be used in trapezoidal motor controller by utilizing the enable input in its commutation sequence. The ability for to user both sinusoid as well as trapezoid method in its operation, offers the potential for motor control application to combined both sinusoid method for smoother starts up and low speed commutation, and uses trapezoid for higher rotational speed.

Results
Using high speed digital oscilloscope, it has been observed that the complementary output of the proposed Dead-Time insertion module with N=5 multiplication factor or 3.4µS Dead Time period had works flawlessly in separating two complementary output by the designated period given a 1.470KHz PWM signal with a duty cycle of 61%.   figure 14, of the same output signal, with 4µS per DIV also shows that the interrupt logic is also working as expected by providing the designed Dead-Time Delay between two complementary output as shown in the following screenshot. Nevertheless, it is clearly that the 1µS rise time had added additional dead time delay which is already 29% of the dead time its self. Figure 14. An 0.1Hz SPWM pulse train at PWM Frequency 2.941KHz at 4µS per DIV With a simulated trapezoid mode, as shown in fig. 15, the proposed solution also was found to be working as expected in the trapezoid drive mode (disable mode

Discussion
The proposed Software based programmable IGBT IPM Dead-Time insertion module using 16-bit microcontroller for BLDC motor control application has demonstrated to be able to produce complementary PWM output with dead time insertion both for sinusoidal and trapezoidal drive mode. Written in Arduino IDE, the program is easily ported to other Arduino 16-bit micro-controller which offering the opportunity as a low cost solution to be used for dead-time insertion for general purposes micro-controller without any advance timer function to drive IGBT IPM module in motor application. The highly available at a very low cost, small foot print 16Mhz 16-bit micro-controller board has been shown to serve the purpose of PWM transition event processing with its precession and clock speed. Further, the modularity of one PWM channel per micro-controller design, also offers a cost effectively implemented for 1 or 2 phase motor implementation.
The proposed module is also capable in operating for both sinusoidal as well as trapezoidal drive mode which offering an alternative to combine both drive modes for smoother and higher motor rotational speed for BLDC motor control application using generic micro-controller. The synchronized transition from sinusoidal in low speed to trapezoidal in higher rotational speed operation and vice versa, has been found to be working seamlessly within motor operation range up to 12.000 electrical RPM. Therefore, the proposed solution is capable to be functioning in hybrid sinusoid and trapezoidal motor commutation operation.
Despite to the fact that the proposed solution is able to function as expected, the draw-back of the design with a blocking interrupt service is that no interrupt will be served while ones is being served, and as the interrupt will executes in the duration of specific Dead-Time Period. Therefore, to mitigate the effect the safe operation of this module are based on the rule that no PWM pulse with duty cycle smaller than Dead-Time Period is allowed. This restriction is also applied to duty cycle near maximum as the falling edge will also trigger a Dead-time insertion interrupt, no PWM pulse with the duty cycle bigger that 100% period -Dead time period is allowed to assure all PWM pulse transition is served by system.
Obviously the limitation, will also affect the selection of PWM frequency available as the higher the PWM frequency, the more significant the non-useable PWM value in sinusoidal mode.
Further, the 0.68µS delay unit per loop cycle, limits the availability of possible to a discrete selection of a dead-time as multiplication of delay unit. Nevertheless, as the delay is implemented programmatically, there is no 5µS upper limit imposed for the maximum date time insertion as in typical in the hardware solution.