Using Bode plots in Schematic Editor to troubleshoot converter design issues

This user how-to guide is related to C-HIL: Field-oriented control of PMSM using Texas Instruments TMS320F2808 card. All tests in document are done without using the TI card.

Introduction

In electric drive applications, rectifiers are prone to DC voltage overshoot issues. In this case, we will attempt to test the potential occurance of these issues using an uncontrolled Three-Phase Diode Rectifier, as shown in Figure 1. The input impedance can be calculated and introduced in the model by a Bode diagram. This peak of the DC link voltage can lead to burning of the diodes in the three-phase diode rectifier and burning of the IGBTs in the Three-phase two-level inverter/rectifier if they are not rated for overshoot voltages.

The main purpose of this application note is to show a possibility to include Python-specific libraries to resolve issues with designing the power converter.

This how-to guide is related to C-HIL: Field-oriented control of PMSM using Texas Instruments TMS320F2808 card. All tests in the document are done without using the TI card.

Model description

The model of the rectifier part of the drive system is presented in image below.

Simulation

Figure 1. Rectifier part of the DRIVE
Figure 2. Overshoot with default parameters

Using the Model Initialization function in the code block below, we can generate a Bode diagram using the scipy and matplotlib python libraries. The most important functions from the scipy library are scipy.signal.TransferFunction and scipy.signal.bode.

The model initilization script is shown below:

# Numpy module is imported as 'np'
# Scipy module is imported as 'sp'
import matplotlib.pyplot as plt
          
#parameters that chan be changeable
Rprech = 0
Ts = 100e-6
R = 0.1
L = 0.0011
C = 0.0022
RloadAnalys = 100
          
#Solution no. 1: fix with inductor
#L = C * R**2 *0.9**2
#mdl.info(L)
         
#Solution no. 2: fix with capacitor
#fsw = 100
#C = 1/(2*np.pi*0.3*fsw)**2/L
#mdl.info("C = {} F".format(C))
          
#Solution no. 3: add precharge resistor Q = 0.707
Rprech =np.sqrt(2)*(np.sqrt(L/C)-1/np.sqrt(2)*R)
mdl.info("Rprech = {} ohm".format(Rprech))
          
#bode diagram analysis
# resonant frequecny
f0 = 1/(2*np.pi*np.sqrt(L*C)) 
mdl.info("f0 = {} Hz".format(f0))
w0 = 2*np.pi*f0
          
# absolute Q factor
Qab = 1/(R+Rprech)*np.sqrt(L/C)
mdl.info("Qab = {}".format(Qab)) 
Qdb = 20 * np.log10(Qab)
# Q factor in db         
          
#bode plot using sp.signal.lti function
s1 = sp.signal.lti([1],[1/w0**2,1/(w0*Qab),1])
w, mag, phase = sp.signal.bode(s1)
         
# Bode magnitude plot
#plt.figure()
plt.semilogx(1/(2*np.pi)*w, mag)
# Bode phase plot
plt.figure(1,1)
plt.semilogx(1/(2*np.pi)*w, phase)
plt.show()        
Figure 3. Bode diagram of input transfer parameters

From this Bode diagram and from calculation, we get f 0 = 1 2 π L a C d c = 102.3   H z . We can see that the switching resonant frequency and the switching frequency of the diode bridge (100Hz) is almost the same. This implies there will be some resonance and overshoot in DC voltages. The switching frequency also cannot be changed because of the use of a diode rectifier. Instead, changing the parameters of input impedance is necessary. Since increasing model resistance (R) will lead to increased losses, it is better to focus on the inductor by decreasing the quality (Q) factor.

In this section we explore two possible solutions for addressing the voltage overshoot on the DC link: decreasing the inductance and increasing the capacitance.

Solving the issue decreasing the inductance

First let’s try to find the input transfer function. The transfer function is defined from the circuit in Figure 1

G s =   1 1 + s R 1 C d c + s 2 L a C d c

An alternative standard, normalized form of the transfer function is:

G ( s ) = 1 1 + s Q ω 0 + s ω 0 2

The parameter Q is called the quality factor of the circuit, and is a measure of the dissipation in the system. The parameter represents the resonant angluar frequency.

From the input transfer function, we can find the resonant frequency which is:

f 0 = 1 2 π L a C d c

Now it is easy to find the Q factor with the following formula:

Q = 1 R 1 L a C d c

The result of this analysis will give us the value of the inductor to reduce the Q factor. Let’s try to decrease value of the inductor by half. In Figure 4, we can see that we manage to decrease the overshoot of the DC voltage.

Figure 4. Overshoot with decreasing inductance by half

Now, let’s try to decrease inductance to one third. In Figure 5, we can see that we manage to decrease the DC voltage (Cdc) below our 400V target.

Figure 5. Overshoot with decreasing inductance by triple

A second-order Butterworth filter (i.e., continuous-time filter with the flattest passband frequency response) has an underdamped quality factor of 0.707. Therefore, to reduce overshoot in the voltage of the DC capacitor you need to set the Q factor to 0.707. Now, let’s try to calculate the inductor. The equation is L a c = C d c R 1 2 Q 2 where we can calculate L a c =   1.782 e - 05 .

In Figure 6, we can see that we manage to fix this issue.

Figure 6. Issue fixed with calculated inductance

In the Bode diagram in Figure 7, we can see that we manage to decrease the Q factor.

Figure 7. Bode diagram of input transfer function with decreased inductance

Solving the issue with increasing the capacitor

While in theory decreasing the inductance solves the problem, it is often not practical, since inductors are much more expensive then capacitors. Additionally, if the inductance in the model is due to the source inductance (i.e. grid impedance), it is impossible to change it. In these cases, we can instead change the value of the capacitor. This is done by moving the resonant frequency far from the switching frequency. For example, by setting f 0 = 0.3 f s w :

C d c = 1 2 π 0.3 f s w 2 L a =   0.0255   F

With this new capacitor, we get attenuation to the switching frequency. In Figure 8, you can find the new Bode diagram:

Figure 8. Bode diagram with new value of capacitor

In Figure 9, we can see the new response of voltage on the DC link. By increasing the DC capacitor, we can see that response is a little bit slower than when we changed the inductance.

Figure 9. Response of voltage on the DC link

Pre-charge circuit

Overvoltage on DC-link can be resolved using pre-charge circuit. As is showed in Figure 10 you can see implementation of pre-charge circuit.

Figure 10. DC-link pre-charge circuit

In this case, the pre-charge resistor can be calculated by setting the Q factor:

Q = 1 2

The following is the calculation for R p r e c h :

Q = 1 R 1 + R p r e c h L a C d c = 1 2

R p r e c h =   2L a C d c - R 1

The Figure 11shows the pre-charge resistor effects caused by reducing the Q factor. The Figure 12 shows the response of voltage on DC-link. It is important to note that in this case there is a reduced peak of incoming current on the AC side of rectifier.

Figure 11. Bodes diagram with pre-charge circuit
Figure 12. Voltage response with pre-charge circuit

Using this approach, we manage to troubleshoot issues in the design of the various converters and applications in power electronics, and specifically to avoid voltage overshoot on the DC link. In Figure 12, you can see a high peak of the inductor current. To reduce this current, we need to define a different value of the pre-charge resistor. The resistance of the pre-charge circuit is chosen based on the capacity of the load and the desired pre-charge time. The pre-charge surge current reaches 1/e of its initial value after a time of:

T   =   R p r e c h     C

The current is reduced to a manageable value after approximately a time of 5 * T.

R p r e c h = T 5 C

Figure 13. Test of pre-charge circuit with new resistor.

Here we can see how we manage to decrease inrush current.

Figure 14. Bode plot with new resistor

In practice, if the design allows, having the option to solve overvoltage by placing a larger capacitor, would likely be a cheaper option than adding the pre-charge circuit. Based on these results, we can envision a way that this would be possible.

Table 1. Minimum requirements
Files
Typhoon HIL files

examples\models\hardware in the loop\ti pmsm sensored foc

ti pmsm sensored foc.tse,

ti pmsm sensored foc.cus,

20140220_pmsm3_1_TMS3202808.out,

settings.runx

Minimum hardware requirements
No. of HIL devices 1
HIL device model HIL402
Device configuration* 1

Test Automation

We don’t have a test automation for this example yet. Let us know if you wish to contribute and we will gladly have you signed on the application note!

Authors

[1] Simisa Simic