Design and Simulation of SPWM using PYTHON

DOI : 10.17577/IJERTV9IS090347

Download Full-Text PDF Cite this Publication

Text Only Version

Design and Simulation of SPWM using PYTHON

Jutla Praveen Kumar

Dept of Electrical & Electronics Engineering, Power Electronics, GPREC

G. Pulla Reddy Engineering College (Autonomous): Kurnool

Abstract:- This paper explains how an open-source PYTHON- SPYDER tool used to develop the Sine PWM in PYTHON environment. This open source tool is a Scientific PYTHON Development Environment, includes many number of key features to create a SPWM for a two level inverter system. Along with the regular general-purpose array-processing package – numpy and object- oriented API for GUI systems – matplotlib another supporting package which works with the numpy is – scipy are used for the generation of the SPWM for a two level inverter. The results are compared with the MATLAB/Simulink results. The PYTHON- SPYDER offers significant advantages over other approaches. It provides easy and fast simulation time and less complex coding than the other simulation tool packages.

Keywords:- PYTHON, SPWM (Sinusoidal Pulse Width Modulation), MATLAB simulation (SPWM)

INTRODUCTION

This explains the how to generate a SPWM in PYTHON environment using the open- source PYTHON- SPYDER tool. The open source tool is a scientific PYTHON Development Environment, it includes many number of key features SPWM for a two level inverter system. In todays world most of the appliances and machines work on AC power. In the absence of AC power, there should be some way to the convert DC power to AC power. This conversion is done by the power electronic circuit called the Inverter.

These devices find wide appliances in the uninterruptable Power Supplies (UPS), adjustable speed AC drives, induction heating. Before going to simulation of SPWM in PYTHON the simulation of SPWM are simulated in the MATLAB whether checking the simulation is going to be same or different.

PYTHON is open source, high-level programming language developed by the Guido van Rossum in the late1980s and presently administrated by the PYTHON software foundation. It came from the ABC language that he helped create early on in his career. [4] Text book Eric Matthes, PYTHON Crash Course, 2ndEdition.

PYTHON is a powerful language that you can use to create the games, write GUIs, and develop web appliances. PYTHON is an Object-Oriented language that allows the users to manage and controls the data structures or objects to create and run programs. Everything in PYTHON is, in fact, first class. All objects, data types, functions, methods, and classes take equal positions in PYTHON.

Programming languages are created to satisfy the needs of programmers and users for an effective tool to develop applications that impact lives, life styles, economy and society. Basically the PYTHON are having some general-purpose and array- processing package and Numpy and Object- Oriented API for GUI systems- Matplotlib another some supporting package tools for generate of the SPWM for the two level inverter.

The simulation results and block diagram for the SPWM in the MATLAB and simulation results of the SPWM in PYTHON as shown in below

Simulation of SPWM in MATLAB

Continuous

Continuous

powergui

NOT N

NOT N1

NOT N2

+

v

v

Vab

v

v

+

Vbc

+v

line voltages

g

C

g

C

+

+

>= –

Va c

>=

Vb c1

>=

Vc c2

carrier

g

C

g

C

g

C

g

C

s1 s3 s5

m

E

m

E

m

E

m

E

DC

m

E

m

E

g

C

g

C

m

E

m

E

g

C

g

C

s4 s2 s6

Vca

m

E

m

E

R R1

v

v

+ R2

g

C

g

C

Vao

v

v

+

m

E

m

E

Vbo

– v

Van

v

v

+

Vbn

v

v

+

Vcn

phase voltages

v

v

+

Vno

common mode

voltage

v

v

+

Vco

pole voltages

Fig: 1 SPWM

The parameters which are used in the simulation of SPWM in the MATLAB are shown in the below. The simulation diagram of SPWM consists of the mainly the three sine waves and a have to compare sine wave with carrier wave so one carrier wave block is connected in the simulation and three relational operators are connected to the mosfet gate which acts as the switches for the simulation. The switches are connected again to the sine wave voltage manipulated as the pole voltages, phase voltages, line to line voltages. In the simulation have to mention the a continous (powergui) block and also mention required parameters in the MATLAB before the executing the simulation. In the simulation Runge katta method is used for the simulation of SPWM and type is fixed-step

There are several techniques of Pulse Width Modulation (PWM). In this design, the Sinusoidal Pulse Width Modulation (SPWM) technique has controlling the inverter as it can

directly control the inverter output voltage and output frequency according to the sine functions.

Sinusoidal pulse width modulation (SPWM) is widely used in the power electronics to power so that a sequence of voltage pulses can be generated by the on and of power switches.

Simulation Parameters

Repeating sequence: Time values [0 0.5/2000 1/2000];

Output values [-1 1-1]

Sine [A; B; C] = phase displacement [0; 2*pi/3; 4*pi/3] Configuration parameters:

Type: – fixed-step, step size: 1e-6 Solver: ode-4 (Runge-katta)

OUTPUT

The fig: 2 shows that the carrier pulse is compared with the reference pluse with time(sec). In the graph shows that it start range from the (-1 to 1) in the comparison of the carrier pulse and the reference plus.

1

0.5

0

-0.5

0.01

0.

02

0.03

0.04

0.05 0.06

0

.07

0.08

0.

09

0.1

0

.01

0.

02

0.03

0

.04

0.05 0.06

0

<>.07

0

.08

0.

09

0.1

0.01

0.

02

0.03

0.04

0.05 0.06

0

.07

0.08

0.

09

0.1

0

.01

0.

02

0.03

0

.04

0.05 0.06

0

.07

0

.08

0.

09

0.1

-1

0

1

0.8

0.6

0.4

0.2

0

0

Time(sec)

Fig: 2 Carrier plus Reference and pulses

From the simulation of the SPWM used in the MATLAB the following fig: 3 show the how to get the pole voltages.

Which start at range of the (0 to 600) on y-axis and the x-axis start at (0 to 1) as shown

600

Vao(v)

Vao(v)

400

200

0.01

0.02

0.

03

0.04

0.05

0.06

0.07

0.08

0.09

0.1

0.01

0.02

0.

03

0.04

0.05

0.06

0.07

0.08

0.09

0.1

0.01

0.02

0.

03

0.04

0.05

0.06

0.07

0.08

0.09

0.1

0.01

0.02

0.

03

0.04

0.05

0.06

0.07

0.08

0.09

0.1

0

0

600

Vbo

Vbo

400

200

0

0

600

Vco(v)

Vco(v)

400

200

0

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1

Time(sec)

Fig: 3 pole voltages (Vao, Vbo, Vco)

Then the above fig: 4 shows the line voltages of SPWM and are compared with (VAB, Vbc, and Vca). The line voltages are measured from the any of the two from the three lines and start at a range from the (-500 to 500) as shown in the below.

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

0.09

0.1

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

0.09

0.1

0.01

0.02

0.03

0.04

Ti

0.05

me(sec)

0.06

0.07

0.08

0.09

0.1

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

0.09

0.1

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

0.09

0.1

0.01

0.02

0.03

0.04

Ti

0.05

me(sec)

0.06

0.07

0.08

0.09

0.1

500

Vab(v)

Vab(v)

250

0

-250

-500

0

500

Vbc(v)

Vbc(v)

250

0

-250

-500

0

500

Vca(v)

Vca(v)

250

0

-250

-500

0

Fig: 4 Line to Line voltages (Vab, Vbc, Vca)

Then the following fig: 5 shows the phase voltages of the SPWM Used in the MATLAB simulink. The sine models are connected with the neutral phases and compared to get the phase voltages and are mentioned below.

500

Van(v)

Van(v)

250

0

-250

-500

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1

500

Vbn(v)

Vbn(v)

250

0

-250

-500

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1

500

Vcn(v)

Vcn(v)

250

0

-250

-500

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1

Time(sec)

Fig: 5 Phase voltages (Van, Vbn, Vcn)

Simulation of SPWM in PYTHON

The design and simulation SPWM in PYTHON are mentioned and the program also mentioned that the contains some packages and modulus so that we can get the better simulation result The python contains the many tools and that are used in the design and simulation SPWM used in the PYTHON programming

Then the fig: 6 (a) shows the input sine waves which starts from the x axis time in seconds where as the y- axis is voltages therefore the input sine waves start form the [-1 to 1] which in shown below.

(a)

The fig: 6 (b) shows the modulated sine waves which are obtained from the input sine waves. Range starts from the [0 to 1] in the SPWM used in the PYTHON.

(b)

Fig: 6 (a) Input sine waves. (b) Modulated sine waves

Fig: 7 Pulses voltages (A, B, C)

The pulses voltages of the SPWM used in the PYTHON of the three phases (A, B, C) are shown in the below fig: 7 pulses voltages (A, B, C). The sine waves of the three phases which start from the [0 to 1] below the simulation figure

Fig: 8 Pole voltages (A, B, C)

The pole voltages of the three sine waves of the SPWM are simulated in the PYTHON. Then three sine waves which starts form the [0 to 500] are shown in the below simulation results shown in the below fig: 8

Fig: 9 Line to Line voltages (Vab, Vbc, Vca)

The Line to Line voltages of three sine waves of SPWM are simulated in the PYTHON as shown in the below simulation results fig: 9.The line voltages means the measuring the any two of the three voltage lines.

Fig: 1.1 Phase voltages (Van, Vbn, Vcn)

The Phase voltage mean that will measured between the any Line to Neutral voltager Neutral to Line. Then the Phase voltages are the voltages across the Phases. The phase voltages of the three sine waves of the SPWM are simulated in the PYTHON.

The results fig: 1.1 Phase voltage (Van, Vbn, Vcn). The phase voltages of the three sine waves of SPWM which start form the values (0 to 300). And also the time in seconds is placed on the x-axis and the A phases are placed on the y-axis.

Then the Phase voltages of the three sine wave are combined then the result of the three sine waves start at the range of the ( 0 to 300) as shown in the below fig:1.2. Then the three sine waves of the SPWM having the time in seconds on the x- axis and also the magnitude shown on the y- axis. The phase voltages are to three sine waves are maintained same range and equal magnitude as shown in the below

Fig: 1.2 All phase voltages

CONCLUSION AND FUTURE SCOPE

Conclusion

The OpenSource PYTHON-SPYDER tool is used to develop the Sinusoidal Pulse Width Modulation in PYTHON environment. It includes many features to develop the SPWM with regular general- purpose array- processing package-numpy and object oriented GUI systems. Matplotlib another supporting package like Spicy are used to generating the SPWM simulation.

The results of SPWM in both MATLAB and PYTHON are presented for discussion. The obtained results of SPWM from python are easy compare with MATLAB. The PYTHON offers significant features are like it provides fast and easy simulation time and less complex coding than other simulation tool packages.

Future scope

The OpenSource PYTHON-SPYDER tool can used for developing SVPWM and other DPWM schemes also.

REFERENCES

  1. M.H.Rashid, Power Electronics: Circuits, Devices, and Applications, 3rd edition, 2004.

  2. N. Mohan, T. Undeland, and W. Robbins, Power Electronics, Converters, Applications, and Design, 2nd edition. New York, NY, USA: Wiley, ch.8.

  3. M. H. Rashid Power Electronics Handbook, 3rd edition. New York, NY, USA: Academic, 2001.

  4. Text book Eric Matthes, PYTHON Crash Course, 2nd Edition; A Hands on, Project Based Introduction to programming

  5. P. K. Chaturvedi, S. Jain, and P. Agarwal, Reduced switching loss pulse width modulation technique for three- level diode clamped inverter. IET Power Electron. Vol.4, no.4, pp. 393-399, Apr. 2011.

  6. F. Vargas- Merino, M. J. Meco- Gutierrrez, J. R. Herida- Larrubia, and A Ruiz Gonzalez, Low switching PWM strategy using a carrier wave regulated by the slope of a trapezoidal modulator wave, IEEE Trans. Ind. Electron, vol. 56, no. 6, pp. 2270-2274, Jun. 2009.

Leave a Reply