This is a bilingual snapshot page saved by the user at 2024-6-2 16:33 for https://app.immersivetranslate.com/word/, provided with bilingual support by Immersive Translate. Learn how to save?


High Power Converter Technology


Three-phase inverter


Physical experiment report


Name: Chen Yixue

学号:3210100779


Specialized Class: Telecommunications 2102


Instructor: Li Wuhua / Chen Pingping

目录


Abstract 3


1 Principle of the experiment 4

1.1 SPWM4


1.1.1 SPWM fundamentals 4


1.1.2 DSP implementation of SPWM 4

1.2 SVPWM5


1.2.1 Basic idea of SVPWM 5


1.2.2 SVPWM realization method 9


1.2.2.1 Coordinate transformations 9


1.2.2.2 Sector Determination 10


1.2.2.3 Calculation of action time 11


1.2.2.4 Determination of the vector sequence and the point in time at which the bridge arm opens 15

1.2.3 SVPWM的DSP实现18


2 Simulation 22

2.1 SPWM的MATLAB仿真22

2.2 SVPWM的MATLAB仿真24


3 Experimental results and analysis 26


3.1 CCS Project Creation 26


3.2 SPWM Modulation Experiment 27


3.2.1 Output waveforms before and after filtering of EMWM module output 27


3.2.2 IGBT Driving Waveforms 29


3.2.3 Output phase line voltage 30


3.3 SVPWM Modulation Exploratory Experiment 32


3.3.1 Output waveforms before and after filtering of EMWM module output 32


3.3.2 IGBT Driving Waveforms 34


3.3.3 Output phase line voltage 35


4 Problems and solutions encountered during the experiment 38


5 Experimental Thoughts and Takeaways 38

1

摘要


This experimental report firstly elaborates the principle of the experiment, i.e. the basic principle and steps of SPWM (Sinusoidal Pulse Width Modulation) and SVPWM (Space Vector Pulse Width Modulation), which includes key details such as the coordinate transformation, sector judgment, action time calculation and vector sequence The key details such as coordinate transformation, sector determination, action time calculation and vector sequence determination are listed, and the corresponding code snippets of each step are listed; then the implementation methods and steps of SPWM and SVPWM based on DSP are clarified, and the specific codes are summarized.


Next this report shows the experimental simulation implemented in MATLAB, which on the one hand corroborates the feasibility of the aforementioned scheme and on the other hand serves as a comparison with the physical experiment.


In the experimental results and analysis section, the report lists the specific experimental data of the SPWM and SVPWM experiments, including waveforms, oscilloscope measurements, etc., and compares and analyzes the experimental results with the theoretical and simulated values, and also compares and analyzes in detail the results of the SPWM and SVPWM experiments. The experimental results show that the realized SPWM and SVPWM modulation strategies are consistent with the theoretical expectations, and are effective and accurate.


Finally, the report analyzes the problems and solutions encountered during the experiment, such as phase error correction, floating-point operation problems and PWM enable bit setting, and summarizes the gains and feelings in the experiment.

1


1 Experimental principle

1.1 SPWM


1.1.1 SPWM Fundamentals


SPWM is only briefly summarized here. SPWM mainly uses the principle of area equivalence to compare the triangular carrier waveform with the sinusoidal modulating waveform, and sends out the switching control signals according to the comparison results, so that in the same carrier cycle, the waveform area of the output voltage PWM signal is the same as that of its fundamental sinusoidal signal, which makes the output signal equal to the sinusoidal fundamental, and achieves the purpose of optimizing the THD performance of the output voltage. Purpose. In analog control, the carrier waveform is compared with the modulating waveform, while in digital control, the instantaneous value of the modulating waveform at the valley point of the carrier cycle can be taken as the amplitude of the modulating waveform in the whole carrier cycle, and such sampling method is called the regular sampling method, which does not need to solve transcendental equations, and is suitable for use in digital control systems.


1.1.2 DSP implementation of SPWM


The code is implemented as follows:

float theta2,theta3;

void PWM_Cal(void)

{

while (PWMData.theta < 0)

PWMData.theta = PWMData.theta + 2 * PI;

while (PWMData.theta > 2 * PI)

PWMData.theta = PWMData.theta - 2 * PI;


// Generate the phase of the other two phases of the modulating waveform according to theta1, up

theta2=PWMData.theta-2.0*PI/3.0;

theta3=PWMData.theta+2.0*PI/3.0;


// Limit the phase to between 0 and 2PI

while (theta2 < 0)

theta2 = theta2 + 2 * PI;

while (theta2 > 2 * PI)

theta2 = theta2 - 2 * PI;

while (theta2 < 0)

theta3 = theta3 + 2 * PI;

while (theta2 > 2 * PI)

theta3 = theta3 - 2 * PI;


//Modulated waveform output

PWMData.Da =(1+PWMData.ma*sin(PWMData.theta))/2;

PWMData.Db =(1+PWMData.ma*sin(theta2))/2;

PWMData.Dc =(1+PWMData.ma*sin(theta3))/2;


//Over-modulation processing

if(PWMData.Da > 1)

{

PWMData.Da = 1;

}

if(PWMData.Da < 0)

{

PWMData.Da = 0;

}

if(PWMData.Db > 1)

{

PWMData.Db = 1;

}

if(PWMData.Db < 0)

{

PWMData.Db = 0;

}

if(PWMData.Dc > 1)

{

PWMData.Dc = 1;

}

if(PWMData.Dc < 0)

{

PWMData.Dc = 0;

}

}

1.2 SVPWM


In the 1980s, Japanese scholars proposed Space Vector Pulse-Width-Modulation (SVPWM), or vector modulation, in the study of AC motor inverter drive. After more in-depth research, scholars found that when the 3rd harmonic component is superimposed on the sinusoidal modulating signal of SPWM, it can be equated to SVPWM, in other words, SVPWM is actually a special case of SPWM.


1.2.1 SVPWM basic idea


The SVPWM technique originally came from the field of control of three-phase AC motors for flux control of motors. The motor's magnetic chain is a rotating vector with constant amplitude in space, and the purpose of SVPWM is to make the synthetic voltage vector U of the drive voltage of the other three-phase motor also a rotating vector with constant amplitude in space, except that it overruns the electrical angle of the magnetic chain 90° , at which point the motor's magnetic chain rotates continuously in space, driving the AC motor to run. This is the original control objective of SVPWM modulation.


And in the field of inverters, we can find that such a synthetic voltage vector U, which would have been used to drive a three-phase motor and which is constantly rotating in space with constant amplitude, can also be used to generate a three-phase AC voltage. We can create a three-phase axis in the direction of a symmetrical three-phase sine wave in the voltage space as the base of the axis. At this point, the projection of the constantly rotating synthesized voltage vector U of constant amplitude on the three-phase axis is the symmetrical three-phase sinusoidal quantity that we need. Thus the basic purpose of the SVPWM technique is to generate a rotating synthetic voltage vector of constant amplitude in voltage space.


The following is an example of a conventional two-level SVPWM to illustrate its basic principles. The inverter topology is shown below.


Fig. 1 Basic topology of two-level three-phase inverter


If each phase of the upper bridge arm switching general 1, the lower bridge arm switching general 0, the above eight states can be expressed as 100, 110, 010, 011, 001, 101, 111 and 000. from the actual circuit work, the first six states because there is an output voltage, belonging to the effective state of operation. The latter two do not have an output voltage, it will be called invalid working state or zero working state.


Each operating state corresponds to different V aN , V bN , V cN three-phase voltages. Taking the (100) combination as an example, the three-phase phase voltages are calculated as follows:

得到:


Similarly the phase voltages corresponding to the other seven combinations can be obtained and are listed in the table below.


Table 1 Correspondence between switching state and phase voltage


vector symbol

0

0

0

0

0

0

1

0

0

1

1

0

0

1

0

0

1

1

0

0

1

1

0

1

1

1

1

0

0

0


For the phase voltages corresponding to the eight switching combinations, they can be subjected to Clark transform vector synthesis to obtain the corresponding eight fundamental vectors:


Represent the vector in the αβ coordinate system as follows:


Fig. 2 Basic vector diagram of SVPWM


It can be seen that the non-zero vectors have equal amplitudes, all of which are , and the angles differ by 60° respectively. Thus joining the vertices of the six nonzero vectors makes exactly one square hexagon. Two neighboring vectors with sides of the hexagon form an equilateral triangle. There are 6 equilateral triangles in total, call them sectors 1~6 .


It is known that the control objective of SVPWM is to synthesize a rotating voltage vector in space, and this voltage vector with constant amplitude and direction over time is taken as a given reference voltage vector, and. Since the reference vector rotates in space and the eight voltage vectors that can be synthesized at the output of the inverter are uniformly distributed in space, it is considered to approximate the synthesis of the reference voltage vectors at different locations with the eight basic voltage vectors, thus turning the output synthesized voltage vector into a rotating vector with constant amplitude.


The specific synthesis method utilizes the area equivalence principle of PWM, where the rotation of the reference voltage vector is considered approximately constant during each switching cycle, and is approximated by the vectors on the two edges of that small sector at different sectors (nearest vector method). Let the inverter outputs the fundamental vector for the time of one switching cycle Ts, and the time of the remaining time is made up by the two zero vectors. Then for the output result to be equivalent to the reference voltage vector, it is required that they have equal area in Ts, or it can be understood that the vector synthesis rule needs to be satisfied, from which the equation can be listed:


Solving for it yields:


By calculating the corresponding operating state duration in each switching cycle, a synthesized voltage vector with constant amplitude and uniform rotation approximating the reference voltage vector can be obtained, from which a three-phase sinusoidal AC voltage is obtained to realize the inverter. This is the basic realization idea of SVPWM.


1.2.2 SVPWM Implementation Methods


In practice, there are four main steps to realize SVPWM:


1, coordinate transformation: the given reference sine wave will be converted into the coordinates under the required coordinate system.


2, sector judgment: determine the sector in which the reference vector is located, so as to select the adjacent vectors required for synthesis.


3. Calculation of the action time: After picking out the appropriate neighboring vectors, the action time of each vector in the switching cycle is determined according to vector synthesis.


4. Determine the sequence of vectors and thus obtain the turn-on time point of each bridge arm in each switching cycle: Arrange the sequence of vectors appearing in a switching cycle, so as to realize that each bridge arm is turned on and off only once in each switching cycle, thus minimizing the switching loss.


The detailed derivation is elaborated below.


1.2.2.1 Coordinate transformations


In the traditional αβ coordinate system, trigonometric functions need to be calculated. However, since each sector is 60° each, we can find that sector determination and action time calculation of the reference vector will be simpler in the 60° coordinate system. The given reference signals are three sinusoids with a phase difference of 120° , so they should be converted to 60° , i.e., the gh coordinate system. The conversion process is as follows:


Combined with the equal-amplitude Clark transform, there are:

即:


Finish with the program that is:


//Generate three-phase reference wave

va=vrms*sqrt(2)*sin(PWMData.theta);

vb=vrms*sqrt(2)*sin(theta2);

vc=vrms*sqrt(2)*sin(theta3);


//Coordinate transformation to a 60-degree coordinate system.

vg = 2.0 / 3.0 * (va - vb);

vh = 2.0 / 3.0 * (vb - vc);


It can be found that the conversion of the 60° coordinate system is much simpler when done programmatically.


1.2.2.2 Sector Determination


The amplitudes of the non-zero vectors have all been calculated earlier. We can represent them in gh-coordinates by dividing them all by to normalize them.


Fig. 3 Schematic diagram of gh coordinates of basic vectors and vector synthesis


From the above observation, it can be observed that if the reference vector is in sector I, then;


If the reference vector is in sector II, observe that the dividing line between sector II and sector I is:, when the vector is in sector I. Therefore, if the reference vector is in sector II , it needs to be satisfied.


Similarly it can be calculated that if the reference vector is in sector III, we have;


If the reference vector is in sector IV;


If the reference vector is in sector V, then;


If the reference vector is in sector VI;


It can be found that, due to the use of 60° coordinate system, so in the process of sector judgment does not need to appear 3 such values, just simply add and subtract the coordinates to complete the sector judgment, simplifying the calculation process and code writing.


1.2.2.3 Calculation of action time


As shown in Figure 3, if V 1 , V 2 represents two neighboring vectors in a sector, when the reference vector is located in this sector, these two vectors as well as the zero vector are used to synthesize and obtain the reference vector. Let V 1 act as T 1 , V 2 act as T 2 , and the zero vector act as T 0 , then according to the principle of vector synthesis (or it can be understood as the principle of PWM area equivalence), it can be obtained:

(1)


Where V 1g , V 2g for V 1 , V 2 are projected in g-axis, V 1h , V 2h for V 1 , V 2 are projected in h-axis, T s is the switching period (carrier period), and V g , V h are the reference vectors are projected in the g-axis and h-axis.


And if the calculation is obtained, the result is over-modulated as follows:


Next, the actual coordinates are substituted into equation (1) above to calculate the vector action time in different sectors.


Within the first sector:


Substituting into equation (1) yields:


Ditto within the second sector:


Substituting into equation (1) yields:


In the third sector:


Substituting into equation (1) yields:


In sector four:


Substituting into equation (1) yields:


In sector five:


Substituting into equation (1) yields:


In sector six:


Substituting into equation (1) yields:


From this we obtain the required vector action times for each of the six sectors in relation to the gh coordinates of the reference vector, where T 1 , T 2 correspond to the action times of the two neighboring vectors in the counterclockwise direction of the counterclockwise corresponding sector, respectively.


In summary, the individual sectors T 1 , T 2 are summarized as follows:


Table 2 Corresponding vector action times for each sector (counterclockwise order)

扇区1

扇区2

扇区3

扇区4

扇区5

扇区6

T1

T2


It can be found that each sector vector action time is related to the 60° coordinate of the reference vector, and the simple addition or subtraction of coordinates only can also make the code more concise.


The specific code is as follows:


//Determine the sector, and transform all the other sector's phase mapping to the same coordinates as the first sector.


// thus facilitating the calculation of opening times

if(vh>=0 && vg>=0)

{

sec=1;

vgg=vg;

vhh=vh;

}

else if(vh>=0 && vg+vh>=0)

{

sec=2;


vhh=vg+vh;//the nonzero vectors in sectors 2,4,6 appear in the sequence in the reverse order of 1,3,5.


vgg=-vg;//so vgg needs to be exchanged with vhh, i.e. T1 and T2

}

else if(vh>=0 && vg+vh<=0)

{

sec=3;

vgg=vh;

vhh=-vg-vh;

}

else if(vg<=0 && vh<=0)

{

sec=4;

vhh=-vg;

vgg=-vh;

}

else if(vg>=0 && vg+vh<=0)

{

sec=5;

vgg=-vg-vh;

vhh=vg;

}

else

{

sec=6;

vhh=-vh;

vgg=vg+vh;

}


// Calculate the time of action of T0,T1,T2 vectors


//T0 denotes the zero vector time, and T1 denotes the time of action of the vector that first appears during the switching cycle of the seven-segment sequence

T1=vgg*Ts;

T2=vhh*Ts;

T0=Ts-T1-T2;


//Over-modulation processing

if(T0<0.0)

{

Tsum=T1+T2;

T1=T1/Tsum;

T2=T2/Tsum;

T0=0.0;

}


1.2.2.4 Determine the vector sequence and the point in time when the bridge arm is turned on


For the simplicity of the modulation algorithm, to reduce the number of switches to minimize switching losses, and to prevent bridge arm pass-through, we should characterize our vector sequence as follows:


1. Each time the state is switched, only one phase of the bridge arm's switch needs to be actuated.


2. Each bridge arm needs to be opened and closed only once in each switching cycle.


Therefore, we can use a five-segment sequence as well as a seven-segment sequence to fulfill the above requirements. The seven-segment sequence is used in the simulation as well as in the writing of the physical program for this experiment, and the seven-segment sequence also inserts zero vectors in the middle as compared to the five-segment sequence where the zero vectors are arranged uniformly in the beginning and the end phases. The modulated waveforms of the seven-segment sequence for each sector are shown below:


Fig. 4 Seven-segment modulation waveform


and 6 sectors, the switching order of the first three basic vectors is clockwise, i.e., (0,0,0)-(0,1,0)-(1,1,0) in the second sector, (0,0,0)-(0,0,1)-(0,1,1) in the fourth sector, (0,0,0)-(0,1,1)-(0,0,0)-(1,0,1) in the sixth sector.


The T 1 , T 2 calculated in 4.2.2.3 are the basic vectors in counterclockwise order, so for sectors 2, 4, and 6, after calculating their vector action time according to the formula in 4.2.2.3, it is necessary to exchange the values of T 1 , T 2 , so that T 1 , T 2 are in the same order as the seven-segment sequence, which is convenient for calculating the turn-on time of each bridge arm in each switching cycle. cycle. That is, the correspondence is changed to the following table:


Table 3 Corresponding vector action times for each sector (in order of occurrence)

扇区1

扇区2

扇区3

扇区4

扇区5

扇区6

T1

T2


Next calculate the bridge arm opening time.


Fig. 5 Schematic of the time distribution of the seven-segment sequence


In the figure, T k denotes the action time of the first appearing vector, and T k+1 denotes the action time of the later appearing vector, which corresponds to the previously calculated T 1 and T 2 , respectively.T L denotes the turn-on time point of the first turned-on bridge arm in a switching cycle, T M denotes the turn-on time point of the second turned-on bridge arm, and T H denotes the turn-on time point of the last turned-on bridge arm.


Calculations are available:

即:


The code is implemented as follows:


// Calculate the point in time at which each bridge arm turns on during each switching cycle in a seven-segment sequence


//TL,TM,TH are the shortest, middle, and longest time point of bridge arm opening, respectively.

TL=0.25*T0;

TM=TL+0.5*T1;

TH=TM+0.5*T2;


Then combining the different seven-segment sequences within each sector, the relationship between the three ABC bridge arm turn-on time points T a , T b , T c and T L , T M and T H can be obtained for different sectors:


Table 4 The corresponding turn-on time point of each sector

扇区1

扇区2

扇区3

扇区4

扇区5

扇区6

Ta

TL

TM

TH

TH

TM

TL

Tb

TM

TL

TL

TM

TH

TH

Tc

TH

TH

TM

TL

TL

TM


1.2.3 DSP Implementation of SVPWM


We make the three bridge arms ABC corresponding to registers CMPA, CMPB, and CMPC for comparing with the carrier in each switching cycle to generate the required PWM signals to drive the corresponding bridge arms on and off.


In this experiment, the PWM module carrier waveform is a triangle waveform with a value between [0,1], so in order to enable the output of the seven-segment waveform, the comparison logic should be set to output 1 when the register value is less than the carrier waveform, otherwise output 0, as shown in the following figure.


Fig. 6 Schematic diagram of register-carrier comparison


And the relationship between the value of register CMP and T L , T M , T H can be obtained by similar triangles:


Let CL be the register value corresponding to the bridge arm that turns on first during the switching cycle, CM be the register value corresponding to the bridge arm that turns on second, and CH denote the register value corresponding to the bridge arm that turns on last, then it can be calculated:


The code is implemented as follows:


//Calculate the signal of each bridge arm for comparison with the carrier, which can also be interpreted as the corresponding duty cycle of each bridge arm


//CL,CM,CH correspond to TL,TM,TH respectively.


CL=TL/(Ts/2.0)*1.0;//similar triangles and the carrier peak-to-peak value of the DSP's own module is 1

CM=TM/(Ts/2.0)*1.0;

CH=TH/(Ts/2.0)*1.0;


Similarly, similar to the relationship between the ABC three bridge arm turn-on time points T a , T b , T c and T L , T M and T H for different sectors, the relationship between the corresponding register values CMPA, CMPB, CMPC and CL, CM, CH for the ABC three bridge arms for different sectors can be obtained:


Table 5 Register Values for Each Sector

扇区1

扇区2

扇区3

扇区4

扇区5

扇区6

CMPA

CL

CM

CH

CH

CM

CL

CMPB

CM

CL

CL

CM

CH

CH

CMPC

CH

CH

CM

CL

CL

CM


Below is a summary of the DSP code corresponding to each step:


1. Coordinate transformations as well as normalization:


//Generate three-phase reference wave

va=vrms*sqrt(2)*sin(PWMData.theta);//sqrt(2)

vb=vrms*sqrt(2)*sin(theta2);

vc=vrms*sqrt(2)*sin(theta3);


//Coordinate transformation to a 60-degree coordinate system.

vg = 2.0 / 3.0 * (va - vb);

vh = 2.0 / 3.0 * (vb - vc);


//Scalarization, all vectors in the whole coordinate system are divided by vdc* 2/3.


//that is, at this point the fundamental vector amplitude is 1

vg=vg/(vdc * 2.0 / 3.0);

vh=vh/(vdc * 2.0 / 3.0);


2. Judge the sector:


//Determine the sector, and transform all the other sector's phase mapping to the same coordinates as the first sector.


// thus facilitating the calculation of opening times

if(vh>=0 && vg>=0)

{

sec=1;

vgg=vg;

vhh=vh;

}

else if(vh>=0 && vg+vh>=0)

{

sec=2;


vhh=vg+vh;//the nonzero vectors in sectors 2,4,6 appear in the sequence in the reverse order of 1,3,5.


vgg=-vg;//so vgg needs to be exchanged with vhh, i.e. T1 and T2

}

else if(vh>=0 && vg+vh<=0)

{

sec=3;

vgg=vh;

vhh=-vg-vh;

}

else if(vg<=0 && vh<=0)

{

sec=4;

vhh=-vg;

vgg=-vh;

}

else if(vg>=0 && vg+vh<=0)

{

sec=5;

vgg=-vg-vh;

vhh=vg;

}

else

{

sec=6;

vhh=-vh;

vgg=vg+vh;

}


3. Calculation of action time


// Calculate the time of action of T0,T1,T2 vectors


//T0 denotes the zero vector time, and T1 denotes the time of action of the vector that first appears during the switching cycle of the seven-segment sequence

T1=vgg*Ts;

T2=vhh*Ts;

T0=Ts-T1-T2;


//Over-modulation processing

if(T0<0.0)

{

Tsum=T1+T2;

T1=T1/Tsum;

T2=T2/Tsum;

T0=0.0;

}


4. Determine the vector sequence and the point in time when the bridge arm is turned on (thus obtaining the value of the comparison register)


// Calculate the point in time at which each bridge arm turns on during each switching cycle in a seven-segment sequence


//TL,TM,TH are the shortest, middle, and longest time point of bridge arm opening, respectively.

TL=0.25*T0;

TM=TL+0.5*T1;

TH=TM+0.5*T2;


//Calculate the signal of each bridge arm for comparison with the carrier, which can also be interpreted as the corresponding duty cycle of each bridge arm


//CL,CM,CH correspond to TL,TM,TH respectively.


CL=TL/(Ts/2.0)*1.0;//similar triangles and the carrier peak-to-peak value of the DSP's own module is 1

CM=TM/(Ts/2.0)*1.0;

CH=TH/(Ts/2.0)*1.0;


// Determine the value of abc three-phase PWMData.Da/b/c based on the sector, and the seven-segment sequence

switch(sec)

{

case 1:

PWMData.Da=CL;

PWMData.Db=CM;

PWMData.Dc=CH;

break;

case 2:

PWMData.Da=CM;

PWMData.Db=CL;

PWMData.Dc=CH;

break;

case 3:

PWMData.Da=CH;

PWMData.Db=CL;

PWMData.Dc=CM;

break;

case 4:

PWMData.Da=CH;

PWMData.Db=CM;

PWMData.Dc=CL;

break;

case 5:

PWMData.Da=CM;

PWMData.Db=CH;

PWMData.Dc=CL;

break;

case 6:

PWMData.Da=CL;

PWMData.Db=CH;

PWMData.Dc=CM;

break;

}

}


2 Simulation

2.1 SPWM的MATLAB仿真

模型:


Fig. 7 SPWM simulation model


Simulation results:


Fig. 8 SPWM simulation phase voltage 30Vrms/50Hz


Fig. 9 SPWM simulation phase voltage 20Vrms/25Hz


Fig. 10 SPWM simulation phase voltage 5Vrms/5Hz

2.2 SVPWM的MATLAB仿真

模型:


Fig. 11 SVPWM simulation model


Fig. 12 SVPWM simulation phase voltage 30Vrms/50Hz


Fig. 13 SVPWM simulation phase voltage 20Vrms/25Hz


Fig. 14 SVPWM simulation phase voltage 5Vrms/5Hz


Fig. 15 SVPWM simulation saddle wave duty cycle


3 Experimental results and analysis


3.1 CCS Project Creation


In the Demo project, TI's F32028379D hardware configuration are written, only their own rewrite and modulation waveforms related to the PWM2.C this file, to complete the three-phase SPWM modulation as well as SVPWM modulation program writing. The structure PWMStr used in the header file PWM.h contains the following structure members:

typedef struct PWMStr

{

float ma;

float theta;

float Da;

float Db;

float Dc;

} PWMStr;


Where PWMData.ma is the modulation ratio; PWMData.theta is the phase, which is used to generate the reference waveform; and PWMData.Da/Db/Dc is the duty cycle parameter of the output of each phase, i.e., the register value used to compare with the carrier waveform as mentioned before;


Where the values of PWMData.ma and PWMData.theta are provided for assignment by the interrupt program in main.c. The relevant statements are as follows:

ModulationSet.theta = ModulationSet.theta + ModulationSet.fe*2.0*PI/fs;

while (ModulationSet.theta < 0)

ModulationSet.theta = ModulationSet.theta + 2 * PI;

while (ModulationSet.theta > 2 * PI)

ModulationSet.theta = ModulationSet.theta - 2 * PI;

PWMData.ma = ModulationSet.ma;

PWMData.theta = ModulationSet.theta;

PWM_Cal();


ModulationSet.theta increases ModulationSet.fe*2.0*PI/fs each time in the interrupt, i.e., overall, ModulationSet.theta is the value that keeps cycling between [0,2 π ]; each time the interrupt assigns ModulationSet.theta to the PWMData.ma, assigns ModulationSet.ma to PWMData.ma, and then enters the PWM_Cal() function for PWM modulation in one switching cycle to get the PWMData.Da/Db/Dc in one cycle.


So in summary, the overall idea of the project can be summarized: through the interrupt to form ModulationSet.theta, so that it is constantly cycling between [0,2 π ]; modulation is mainly done in the interrupt service, according to the switching frequency (control frequency) given in the main function, each switching cycle into an interrupt, and each time the interrupt through the ModulationSet. theta and ModulationSet.ma to obtain the current value of the reference waveform. Through the current value of the reference waveform, the comparison register value (i.e., duty cycle) of each bridge arm in the switching cycle (PWMData.Da/Db/Dc) is obtained through calculation, and then entered into the EPWM module to generate the PWM control signal.


3.2 SPWM modulation experiment


3.2.1 Output waveforms before and after EMWM module output filtering


The array Scope.Da/Scope.Db/Scope.Dc stores 100 values of PWMData.Da/Db/Dc. The Graph function of CCS allows you to see the output duty cycle values in debug mode to determine if the program is working properly.

数组Scope.Da/Scope.Db/Scope.Dc的Graph如下:

16 Scope.Da对应Graph

17 Scope.Db对应Graph

18 Scope.Dc对应Graph


It can be seen that the generated three-phase modulated wave has the same amplitude and phase difference 120° , which meets the requirements. Next, enter the physical experimental operation.


Output voltage waveforms before and after filtering of the EPWM module output:


Fig. 19 Output voltage waveform before a-phase SPWM filtering


Fig. 20 Output voltage waveform after a-phase SPWM filtering


It can be seen that before filtering, the EPWM module outputs a PWM waveform with a sinusoidal change in duty cycle; after filtering, the switching frequency and above are filtered out, leaving only the signal around the fundamental frequency, which is sinusoidal in shape. Therefore the actual measurement results are in line with the theoretical analysis.


3.2.2 IGBT Driving Waveforms


The main circuit is powered down, the auxiliary power supply is powered up, one probe of the oscilloscope is grounded and clamped to the ground terminal of the drive signal, and one probe clamp is suspended, and the bridge arm is observed for the presence of suitable dead zones in the upper and lower tubes.


The driving waveforms of each phase IGBT are shown below. Among them, channel one (yellow) is the lower tube driving waveform and channel two (blue) is the upper tube driving waveform.


Fig. 21 a-phase SPWM drive waveforms


Fig. 22 b-phase SPWM drive waveforms


Fig. 23 c-phase SPWM drive waveforms


It can be seen that the drive waveforms of each phase have a dead zone, i.e., the upper tube is turned off after a certain period of time before the lower tube is turned on, to prevent the upper and lower tubes from turning on at the same time resulting in a short circuit.


3.2.3 Output phase line voltage


Theoretical calculations:


Set the bus voltage to 75V.


The bus voltage utilization (AC line voltage RMS/DC bus voltage) of the three-phase half-bridge SPWM is:


The bus voltage U d = 75V is obtained:


When the phase voltage (all RMS values below) is 30V, the line voltage 303V is required and calculated:


When the phase voltage is 20V, the required line voltage 203V , is calculated:


When the phase voltage is 5V, the line voltage 53V is required and calculated:


According to the calculation, ModulationSet.ma is assigned to modify the modulation ratio, respectively; in addition, the value of the reference wave frequency ModulationSet.fe is modified to 50Hz, 25Hz, and 5Hz, depending on the different frequencies of the phase voltage to be generated.


The main circuit is powered up and the bus voltage is set to 75V.


Measure the three-phase phase voltage as follows:

24 SPWM相电压30Vrms/50Hz

25 SPWM相电压20Vrms/25Hz


Fig. 26 SPWM phase voltage 5Vrms/5Hz


In the following, the measured values are compared with the theoretical values (using phase a as an example):


theoretical rms

30V

20V

5V


measured rms

28.320V

18.502V

4.962V


theoretical frequency

50Hz

25Hz

5Hz


measured frequency

49.990Hz

25.479Hz

4.9972Hz


It can be found that the measured value is close to the theoretical value and basically conforms to it, but there is a certain error. Analyze the reasons for the error may have:


(1) Oscilloscope frequency measurements and RMS measurements are in error from actual values.


② The existence of dead zones in the upper and lower tube drives during the modulation process affects the quality of the waveforms, making the actual output waveforms not fully compatible with the theoretical values.


③ The PWM signal generated by the DSP is output to the IGBT through the driver circuit with a certain degree of distortion and hysteresis, affecting the quality of the output waveform.


④ The actual output voltage of the signal generator has some error from the nominal value.


⑤ At 30Vrms/50Hz, ma=1.1314>1 , it is in the over-modulation state, the output harmonics increase and tend to square wave state, which affects the quality of output waveform.


In addition, observation of the waveform also reveals that at 30Vrms/50Hz, the output waveform is flatter at the peak and is not a standard sinusoidal shape. This is also caused by over-modulation, where the duty cycle is already greater than 1 at the peak, but the actual duty cycle only goes up to 1 at most, so the actual output at the peak is less than the theoretically required value. This is also consistent with the simulation.


Measure the line voltage V ab as follows:


Fig. 27 SPWM line voltage Vab


It can be found that the RMS value of the line voltage is about 3 times of the corresponding phase voltage, which is basically in line with the sinusoidal shape, with a slight distortion at the peak, which is basically in line with the theoretical calculations and practical requirements.


3.3 SVPWM Modulation Exploratory Experiments


3.3.1 Output waveforms before and after EMWM module output filtering


The array Scope.Da/Scope.Db/Scope.Dc stores 100 values of PWMData.Da/Db/Dc. The Graph function of CCS allows you to see the output duty cycle values in debug mode to determine if the program is working properly.

数组Scope.Da/Scope.Db/Scope.Dc的Graph如下:

28 Scope.Da对应Graph

29 Scope.Db对应Graph

30 Scope.Dc对应Graph


It can be seen that the three-phase modulating wave is a saddle wave with phase difference 120° , which is in line with the theoretical calculation and meets the requirements. Next enter the physical experiment operation.


Output voltage waveforms before and after filtering of the EPWM module output:


Fig. 31 Output voltage waveform before a-phase SVPWM filtering


Fig. 32 Output voltage waveform after a-phase SVPWM filtering


It can be seen that before filtering, the EPWM module outputs a PWM waveform with a duty cycle change; after filtering, the switching frequency and above are filtered out, and only signals around the fundamental frequency are left in the shape of a saddle wave. Therefore the actual measurement results are in line with the theoretical analysis.


3.3.2 IGBT Driving Waveforms


The main circuit is powered down, the auxiliary power supply is powered up, one probe of the oscilloscope is grounded and clamped to the ground terminal of the drive signal, and one probe clamp is suspended, and the bridge arm is observed for the presence of suitable dead zones in the upper and lower tubes.


The driving waveforms of each phase IGBT are shown below. Among them, channel one (yellow) is the lower tube driving waveform and channel two (blue) is the upper tube driving waveform.


Fig. 33 a-phase SVPWM drive waveforms


Fig. 34 b-phase SVPWM drive waveforms


Fig. 35 c-phase SVPWM drive waveforms


It can be seen that the drive waveforms of each phase have a dead zone, i.e., the upper tube is turned off after a certain period of time before the lower tube is turned on, to prevent the upper and lower tubes from turning on at the same time resulting in a short circuit.


3.3.3 Output phase line voltage


According to the calculation, the reference wave RMS variable vrms is assigned as 30V, 20V, 5V, respectively, and the modulation ratio is modified; moreover, the value of the reference wave frequency ModulationSet.fe is modified to 50Hz, 25Hz, 5Hz, according to the different frequencies of the desired generated phase voltages.


The main circuit is powered up and the bus voltage is set to 75V.


Measure the three-phase phase voltage as follows:

36 SVPWM相电压30Vrms/50Hz

37 SVPWM相电压20Vrms/25Hz


Figure 38 SVPWM Phase Voltage 5Vrms/5Hz


In the following, the measured values are compared with the theoretical values (using phase a as an example):


theoretical rms

30V

20V

5V


measured rms

29.463V

18.544V

4.9594V


theoretical frequency

50Hz

25Hz

5Hz


measured frequency

49.997Hz

25.291Hz

4.9979Hz


It can be found that the measured value is close to the theoretical value and basically conforms to it, but there is a certain error. Analyze the reasons for the error may have:


(1) Oscilloscope frequency measurements and RMS measurements are in error from actual values.


② The existence of dead zones in the upper and lower tube drives during the modulation process affects the quality of the waveforms, making the actual output waveforms not fully compatible with the theoretical values.


③ The PWM signal generated by the DSP is output to the IGBT through the driver circuit with a certain degree of distortion and hysteresis, affecting the quality of the output waveform.


④ The actual output voltage of the signal generator has some error from the nominal value.


In addition, as shown in the figure below, comparing the waveforms of SPWM and SVPWM at 30Vrms/50Hz as well as the measured values, it can be found that the output waveform of the SPWM is flatter at the peak, which is not the standard sinusoidal shape, and there is a large distortion, which is due to the over-modulation, and at the peak, the duty cycle is already greater than 1, but the actual duty cycle is only up to 1 at most, and thus the actual output at the peak is less than the the value required by the theory. However, for SVPWM, there is no over-modulation problem, i.e., the DC bus voltage utilization of SVPWM is greater than that of SPWM, so it can be found that SVPWM still ensures a better waveform quality at 30Vrms/50Hz, i.e., when the output is close to the limit. Alternatively, SVPWM can be understood as SPWM for third harmonic injection, which improves the DC bus voltage utilization without affecting the output harmonics and solves the over-modulation problem. The results of simulation also verify this.


Fig. 39 Comparison of SPWM (left) and SVPWM (right) waveforms at 30Vrms/50Hz


Fig. 40 Comparison of SPWM (left) and SVPWM (right) simulated waveforms at 30Vrms/50Hz


4 Problems and solutions encountered during the experiment


1. SPWM output phase error:


During debugging, it was found that the phase difference was not 120° although the duty cycle of each phase was sinusoidal as observed through the scope array. After checking it was found to be in:

theta2=PWMData.theta-2.0*PI/3.0;

theta3=PWMData.theta+2.0*PI/3.0;


The statement incorrectly sets the phase of theta2 and theta3 variables to the phase of theta1 plus 60 degrees and 120 degrees, so that in fact the three phases are only evenly distributed within 180 degrees instead of 360 degrees, thus resulting in an output error. After modification, the debugging is normal.


2, C language float type data calculation problems:


When debugging, I found that the output is always zero, after step by step investigation, I found that after the first float data type is calculated, the subsequent calculations are all zero. After searching and analyzing the information, I realized that in the process of calculating the float data type, the integer in the formula should be written as a decimal, for example, 2 should be written as 2.0. This is because 2 will be recognized as an int integer in the process of compilation, which will lead to the forced conversion of the float type to int type and thus lead to an output value of 0 in all the float types in the program. After changing all the integers in the program from float to decimals, the debugging is back to normal.


3. PWMEN enable bit problem:


During the physical experiment, it was found that although the output saddle wave was normal, the IGBT did not receive a drive signal at both ends. After checking, it was found that the PWMEN enable bit was not set to 1, which led to the PWM was not enabled and could not be output. Therefore, the PWMEN should be modified to 1 after each power-up to enable the PWM. After the modification, the IGBT driver is normal.


5 Experimental Thoughts and Takeaways


This experiment is my first contact with DSP programming, understanding the file structure of DSP project, creating the first CCS project, completing two modulation methods of three-phase two-level circuits SPWM and SVPWM as well as matlab simulation and writing sub-functions of DSP project.


In terms of hardware, under the guidance of the teacher, I further recognized the power electronic circuits commonly used high-power semiconductor devices, inductors, capacitors, bridge stacks, driver chips, etc.; I was impressed that in the beginning I did not understand why after the DSP has already output the PWM signal, the switching tube end should be added to the driver circuit to drive the switching tube. Under the teacher's prompting I realized that it is because the output power of the DSP itself is limited, not enough to directly drive the switching tube, need to be added to the driver circuit to amplify the signal, increase the power, so as to achieve the switching tube drive.


In the course of the experiment, I also further recognized the different ground settings of the power electronic system and the connection between different grounds; recognized the circuit composition of the DSP digital control power electronic system and the working principle of each circuit module. On the basis of software experiments and hardware learning, through the realization of digital control three-phase two-level circuit open-loop experiments, I mastered the basic debugging steps, debugging precautions and debugging methods of digital control power electronics experiments, and was able to proficiently apply the instruments and equipment commonly used in the power electronics experiments, such as DCSource, oscilloscopes, digital multimeters, and so on. At the same time, through the MATLAB simulation experiments and physical experiments, I also better mastered the theory of high-power converter, deepened my knowledge of power electronics, and stimulated my professional interest and sense of innovation.