Solutions to the Equations Describing the Behavior of a Phase-Shifting Transformer Kathleen O’Brien December 9, 1999 NUMERICAL ANALYSIS FOR ENGINEERING MEAE-4960H02 Table of Contents List of Symbols Used 3 Introduction 5 Problem Description 5 Formulation 7 Numerical Approaches Flux and Voltage Equations Saturation (B-H) Curve 10 11 Results 11 Error Analysis 15 Discussion and Conclusions 16 References 17 Appendices 18 2 List of Symbols u o = the permeability of free space ur = the permeability of either the magnetic path or leakage path material url = permeability of leakage material l mean length of either the magnetic path or leakage material path A = the cross-sectional area of either the magnetic core or the leakage path material. Np = primary turns per phase (same for all primary windings) Ns = secondary turns per phase (same for all secondary windings) Nshift = shift turns per phase (same for all shift windings) Rm = magnetizing reluctance vac = voltage from input phase a to input phase c vba = voltage from input phase b to input phase a vcb = voltage from input phase c to input phase b rac = resistance from input phase a to input phase c rba = resistance from input phase b to input phase a rcb = resistance from input phase c to input phase b iac = current between input phase a and input phase c iba = current between input phase b and input phase a icb = current between input phase c and input phase b ac = flux between input phase a and input phase c ba = flux between input phase b and input phase a cb = flux between input phase c and input phase b vas = voltage from secondary phase a to neutral vbs = voltage from secondary phase b to neutral vcs = voltage from secondary phase c to neutral ras = resistance from secondary phase a to neutral rbs = resistance from secondary phase b to neutral rcs = resistance from secondary phase c to neutral ias = current between secondary phase a and neutral ibs = current between secondary phase b and neutral ics = current between secondary phase c and neutral as = flux between secondary phase a and neutral bs = flux between secondary phase b and neutral cs = flux between secondary phase c and neutral 3 vashift = voltage across shift winding a vbshift = voltage across shift winding b vcshift = voltage across shift winding c rashift = resistance of shift winding a rbshift = resistance of shift winding b rcshift = resistance of shift winding c iashift = current through shift winding a ibshift = current through shift winding b icshift = current through shift winding c ashift = flux through shift winding a bshift = flux through shift winding b cshift = flux through shift winding c 4 Introduction Today there are many pieces of widely used electronic equipment that produce harmonics. These harmonics are known to cause serious operational problems. By integrating phase shifting into a transformer with single or multiple outputs, substantial reduction of triplen, 5th and 7th harmonics can be achieved. The net result is that the electrical distribution system becomes electromagnetically compatible with the electronic loads (e.g. personal computers) it has to supply. Traditional electrical system design had very little need to deal with harmonics because the loads typically designed for were linear in nature. Over the years, as more and more research and practical experience was gathered with linear loads, the design process became more and more predictable. With the proliferation of variable speed drives, electronic ballasts, personal computers and other electronic equipment, electrical system design strategies need to be adjusted. Because in many cases a major portion of the loads today are nonlinear in nature, the loading due to harmonics created by these loads must also be taken into consideration. Phase-shifting transformers of different configurations have been used for decades in industrial and computer facilities to treat harmonics produced by loads that are balanced and connected phase to phase e.g. 5 th, 7th, 11th, 13th harmonics. This paper describes a numerical solution to equations describing the behavior of a delta/wye phase-shifting transformer. A dynamic model of a 3-phase, multiple secondary phase-shifted, delta/wye transformer was developed. In order to incorporate the effects of saturation in the core of the transformer, curve fitting was done to obtain an equation used to describe the relationship between the B (magnetic field) and the H (magnetic field intensity) fields. The goal of this project was to numerically solve the equations describing the dynamic behavior of the transformer and obtain graphs of voltage versus time which closely match the expected results. This paper will describe the procedure used to solve these equations. It will include a discussion of the errors involved as well as analyses of both the results and the methods used. Problem Description The three-phase secondary of this transformer is to be phase-shifted relative to the input by 20 degrees. In order to achieve this effect, the transformer windings are applied to the core in an unusual way in that a shift winding is added to the transformer. This winding can be applied to either the primary or the secondary. In this case, I chose to apply it to the secondary. This was an arbitrary choice. 5 A shift winding is applied to each of the three phases. Each shift winding is connected to the secondary winding of another phase. This results in a flux in each phase of the secondary which is phase shifted from the input. This can be seen more clearly in Figure 1 and Figure 2 which show the electrical and magnetic connections of the transformer. out a out b in a Vas Vac Vbs Vashift Vba Vbshift n in c in b Vcb Vcshift Vcs out c PRIMARY ONE SECONDARY Figure 1: Electrical Connection Diagram in a in b Vac in c Vba Vas Vcb Vbs Vcs out b out a out c Vashift Vbshift Vcshift n Figure 2 - Magnetic diagram (note that the arrows indicate the direction of the induced flux) 6 In order to solve the equations describing the dynamic behavior of the transformer and obtain graphs of voltage versus time it was necessary to use transformer voltage and magnetic equations, including Faraday’s law and Ampere’s law, to describe the behavior of the transformer. The model uses standard transformer parameters. Since I needed data describing these parameters in order to obtain a realistic solution and in order to have something to compare my results to, I obtained some data from a transformer vendor. I found data describing the number of primary, secondary, and shift winding turns and resistance values, magnetic and leakage path lengths, cross sectional areas of the core and leakage paths, permeability of magnetic core and leakage materials, and a magnetization curve of the core material. Formulation The voltage equations for this model can be written as follows: Primary winding set: d N dt ac ac d vba rba iba N ba ba dt d vcb rcb icb N cb cb dt Secondary winding set: d vas ras ias N as as dt d vbs rbs ibs N bs bs dt d vcs rcs ics N cs cs dt vac rac iac 7 Shift winding set: d N ashift dt ashift d rbshift ibshift N bshift dt bshift d rcshift icshift N cshift dt cshift vashift rashift iashift vbshift vcshift The flux equations for this model can be written as follows: Core primary set: ac ba cb N ac N ba N ashift iashift iac N as ias Nac iac Rm Rm Rm Rlac Nbshift ibshift iba Nbs ibs Nba iba Rm Rm Rm Rlba N N cshift icshift icb N cs ics Ncb icb Rm Rm Rm Rlcb cb Core Secondary set: as bs cs N as N ashift iashift ias N ac iac Nas ias Rm Rm Rm Rlas N bs N Nbshift ibshift ibs Nba iba Nbs ibs Rm Rm Rm Rlbs N cshift icshift ics N cb icb Ncs ics Rm Rm Rm Rlcs cs 8 Core shift set: ashift bshift cshift N N ashift iashift Rm bshift N ibshift Rm cshift icshift Rm N N N ashift iashift ias N ac iac Rm Rm Rlashift as Nbshift ibshift ibs Nba iba Rm Rm Rlbshift bs N N cshift icshift ics N cb icb Rm Rm Rlcshift cs The reluctances are calculated using the general equation below. R l u0 ur A There are nine voltage equations and nine flux equations. These equations must be solved simultaneously. The voltage equations are first-order ordinary differential equations. The flux equations are algebraic equations. The problem is complicated by the fact that the flux, current, and voltage vary with time. In solving this set of equations, I assumed that I knew both the input voltage and the output current (an ideal current sink). This leaves 18 equations and 18 unknowns. The equations were originally written assuming linear operation, neglecting the effects of saturation in the core. Saturation has an effect on the permeability of the core and therefore on the magnetizing reluctance. Magnetizing reluctance is used in the flux equations and therefore has a direct effect on the results. I decided to add this effect both because it is important and because it is interesting from a numeric point-of-view. This was done by picking points off of the magnetization curve of the core material and curve-fitting them to obtain an equation that would accurately describe the B-H curve. To incorporate saturation into the model, the following magnetic equations are used in conjunction with the curve-fitting approach: B u0 ur H B A Ni H l 9 Using these equations allows a few different methods for checking the magnetization curve. Numerical Approaches Voltage and Flux Equations Solving the voltage and flux equations proved to be an extremely difficult task. The problems I encountered were due to a few things: 1. The number of equations to be solved was high. 2. The equations were of different types (algebraic and differential). 3. The solutions and inputs vary with time, creating the need for computationally intensive code. I started with Matlab and attempted to solve the flux equations symbolically and then apply those results to the voltage equations by simple substitution. This would give me nine first-order differential equations. I wanted to use the RungeKutta Method for Systems of Differential Equations from chapter 5 of the text to solve these equations. I would need to set up a time-loop to obtain solutions at enough points to get accurate plots of voltage vs. time. I was able to find symbolic solutions to the flux equations and to substitute those solutions into the voltage equations to obtain nine first-order differential equations. I then attempted to use the Runge-Kutta Method for Systems of Differential Equations to solve these nine equations. I used initial conditions of zero, as would be the case in initially applying voltage to the transformer. I was not able to obtain a useful result. The program either froze or gave me an error message for an internal function in one of the Matlab toolboxes. I then tried to use the “dsolve” function that is described on pages 323 and 324 of the text. This seemed to work, but it took too long to solve to be practical. One time point took over a half an hour to solve, and I needed at least a few hundred for a good solution. I then looked at some different software. I tried a software package called Saber, which allows the user to write code (in a language called MAST) for the solution of both algebraic and differential equations and then solve them simultaneously over time. Since this was exactly what was needed, I entered all of the equations and tried again. After some debugging and some research into exactly how the equations where solved, I was able to get what I consider to be some good results. Although the code used to solve the differential equations is encrypted and I was not able to alter it, the documentation that accompanies the software states that the solutions are obtained by calling a C-routine using the RungeKutta method. I do not know why this routine was able to solve the equations at a much faster rate. 10 Saturation (B-H) Curve I used Matlab to find an appropriate polynomial to describe the saturation effects in the transformer. This was done by picking points off of the magnetization (BH) curve of the core material and curve-fitting them to obtain an equation that would accurately describe the B-H curve. I used the ‘polyfit’ and ‘polyval’ functions in Matlab to do this. I also tried to use Newton’s Interpolatory DividedDifference Formula from chapter 3 of the text. However, this gave results which did not come close to matching the actual magnetizations curve for the core. Although I originally thought of the saturation issue as secondary to the main problem, it became an interesting issue. The magnetization (B-H) curves for transformer cores are usually very steep. This was the case here. Because of the inherent steepness of the curve, it was not easy to find an equation that could accurately describe it. It quickly became clear that the equation would be of a high order. This is acceptable to a point, but leads to problems when the equation must be evaluated during each time-step as it is used to calculate the magnetizing reluctance. Because of these issues, I was forced to compromise between an order which would give a lot of accuracy and one which could be evaluated in a timely manner. After several trial runs, I chose an 8th order equation to serve this purpose. Results The transformer was designed to have a ratio of .129. It was supposed to have a primary voltage of 3396 V line-to-neutral and a secondary voltage of 437 V lineto-neutral. It was designed to shift by –20 degrees. The results are in the form of plots based on time. Figure 3 shows the primary voltage with the secondary voltage laid on top of it. In this figure you can see that the voltages are approximately correct and that there is a noticeable phase-shift between the input and output. 11 Figure 3: Primary and Secondary Voltages Figure 4 shows the primary and secondary voltages for phase A only. This is done to get an accurate calculation of the phase shift. 12 Figure 4: Primary and Secondary Voltages for Phase A Figure 5 shows the magnetization curve represented by the curve-fit that was done. 13 B vs. H 2 1.5 1 B (Tesla) 0.5 0 -0.5 -1 -1.5 -2 -300 -200 -100 0 H (A/m) 100 200 300 Figure 5: Curve-fit of magnetization data In order to put this into the transformer model, I had to solve for ur (permeability of the core). Figure 6 shows the results of this. 14 4 3 Permeability vs. B x 10 2.5 2 1.5 ur 1 0.5 0 -0.5 -1 -1.5 -2 -1.5 -1 -0.5 0 B 0.5 1 1.5 2 Figure 6: ur vs. B Error Analysis The voltage plots gave me results that were about 5% different from what I expected. I attribute that mostly to the lack of accuracy in the magnetization curve. Although there are several other possible sources of error such as the fact that I ignored leakage effects and hysteresis effects, and to the fact that real transformers have variations in the ratings of the components. I think that 5% error is fairly acceptable in this case. The magnetization curve matched the data for the core fairly closely. It would have been more accurate, of course, had I used a higher order equation. This added to the complexity and therefore to the length of time it took to get a solution. When the equation obtained by the curve-fit is evaluated, Matlab allows the user to see the error bounds at each step. For this case, the minimum error bound was +/- .57 and the maximum was +/- .78. This is a large error, but I could not find a more accurate curve-fit that would allow the voltage and flux equations to be evaluated with reasonable speed. 15 Discussion and Conclusions The results for this project came out fairly well. The solution seemed to match the expected results. However, I believe that the project could have been made much easier and more rewarding if I had planned better. I should have chosen a simpler set of equations to solve. I would have preferred a simpler set of equations with more time to investigate different numerical methods for solving them. Because of the complexity of these equations I was left with only one available method. I would have liked to have chosen several methods and to have taken the time to compare those methods. 16 References Burden, R., and Faires, J.D., Numerical Analysis, Sixth Ed., Brooks/Cole Publishing Company, Pacific Grove, CA, 1997. Guru and Hiziroglu, Electric Machinery and Transformers, Second Ed., Oxford University Press, New York, NY, 1988. Kreyszig, Erwin, Advanced Engineering Mathematics, Third Ed., John Wiley and Sons, New York, NY, 1972. Olsun Transformers, Phase-Shifting Transformer Parameters, Fax 17 Appendices A. Code for B-H Curve Fit (with results as comments) % B-H curve %Define B and H vectors B=[-1.7 -1.7 -1.7 -1.65 -1.6 -1.55 -1.5 .4 -.2 0 .2 .4 .6 .8 1 1.2 1.4 1.45 1.5 H=[-300 -240 -180 -150 -127 -90 -75 -50 2 2.5 3 5 7 25 50 75 90 127 150 180 240 order=8 -1.45 -1.4 -1.2 -1.0 -.8 -.6 1.55 1.6 1.65 1.7 1.7 1.7]; -25 -7 -5 -3 -2.5 -2 -1.5 0 1.5 300]; %order of equation desired %Fit into an equation (H as a function of B) [p,s]=polyfit(H,B,order); [Bgraph,delta]=polyval(p,H,s); Hgraph=H; %Find the Derivative (dB/dH) Mult=[order:-1:0]; Preder=Mult.*p; Der=Preder(:,1:order); %Evaluate for values of H preur=polyval(Der,H); %Divide by uo to get ur only ur=preur/(4e-7*pi); %Fit into an equation (ur as a function of B) eqn=polyfit(B,ur,order); %Evaluate for values of B f=polyval(eqn,B); %This plots permeability vs. B plot(B,f) title('Permeability vs. B') ylabel('ur') xlabel('B') %This will plot B vs. H figure plot(H,B) title('B vs. H') ylabel('B (Tesla)') xlabel('H (A/m)') %This will plot permeability vs. B %plot(B,ur) %ylabel('ur') %xlabel('B') 18 %test to see if this method of finding a derivative works %B=[-1 0 1] %H=[-100 0 100] %p=polyfit(H,B,1); %Mult=[1 0] %PreD=Mult.*p; %Der=PreD(:,1) %Coefficients for ur as a function of B (8th order polynomial, descending) % 3.666417656132491e+03 2.434872013692225e+04 -1.716999686421038e-10 - % 9.846624911062185e-10 1.634443854047623e-09 4.274136410855257e+04 - % -2.159666828973363e+04 2.523839057413041e+04 6.842255905983909e-10 %Coefficients for B as a function of H (8th order polynomial, descending) % -1.938028737605247e-34 6.605923063965146e-29 -1.369495361495544e-16 % 2.387241071265011e-11 1.307688202372934e-06 -5.813297199300107e-24 - % 1.041641795984777e-19 1.952394285266943e-16 2.978512509933560e-02 - 19 B. Transformer Code # Single 3-phase Delta/ Wye, Secondary Phase-shifted -20 degree Transformer # Kathleen O'Brien -- NAE # This program models a single, 3-phase Delta primary/ phase-shifted wye secondary # transformer. It transforms a 3-phase generated source voltage to a three-phase # output voltage shifted in phase by -20 electrical degrees. # # Saturation effects included. # # i(x)p = current into phase (a,b,c) primary winding # i(x)s = current out of phase (a,b,c) of secondary winding # Np = primary turns per phase (same for all primary windings) # Ns = secondary turns per phase (same for all secondary windings) # Nshift = shift turns per phase (same for all shift windings) # r = windings resistance per phase # Rm = magnetizing reluctance # Rl = leakage reluctance # l = mean length of magnetic path # A = cross-section area # url = permeability of leakage material # ur = permeability of core # uo = permeability of free space # phshft = change in phase angle between primary and secondary voltages resulting # from shift winding voltage (in degrees) element template minus_delta_y_sec_phshft_xfmr ina inb inc outa outb outc n electrical ina, inb, inc, outa, outb, outc, n unit {"Tesla-m2","Webers","flux"} phi { electrical vshifta, vshiftb, vshiftc branch vac = v(ina,inc), iac = i(ina->inc) # primary input V,I branch vba = v(inb,ina), iba = i(inb->ina) branch vcb = v(inc,inb), icb = i(inc->inb) branch # secondary branch branch vac_out output V vba_out vcb_out = v(outa,outc) = v(outb,outa) = v(outc,outb) branch vas = v(outa,vshiftc),ias = i(outa->vshiftc) secondary coil V,I branch vbs = v(outb,vshifta),ibs = i(outb->vshifta) branch vcs = v(outc,vshiftb),ics = i(outc->vshiftb) # 20 branch V,I branch branch vashift = v(vshifta,n),iashift = i(vshifta->n) # shift coil vbshift = v(vshiftb,n),ibshift = i(vshiftb->n) vcshift = v(vshiftc,n),icshift = i(vshiftc->n) var phi phi_ashift, phi_ac, phi_ba, phi_cb, phi_as, phi_bs, phi_cs, phi_bshift, phi_cshift var nu B, H val nu Rlp, Rls, Rm, Rlshift, rac, rba, rcb, ras, rbs, rcs, rashift, rbshift, rcshift, Nshift, Np, Ns, rshift, lp, ls, lshift, lm, url, ur, A, Al number pi, uo parameters { pi uo = 3.1415962 = 4*pi*1e-7 } values { Nshift Np = Ns = A = Al = lp = ls = lshift lm = url = = 16 514 30 .021 .01 1 1 = 1 5.22 1 ##### magnetizing curve saturation effect ##### ur =3.666417656132491e+03*B**8 -1.716999686421038e-10*B**7 2.434872013692225e+04*B**6 +9.846624911062185e-10*B**5 +4.274136410855257e+04*B**4 -1.634443854047623e-09*B**32.159666828973363e+04*B**2+ 6.842255905983909e-10*B +2.523839057413041e+04 ############################################### Rlp = lp/(uo*url*Al) Rls = ls/(uo*url*Al) Rlshift = lshift/(uo*url*Al) Rm = lm/(uo*ur*A) rac rba rcb ras = = = = 1.452 1.452 1.452 .0142 21 rbs = .0142 rcs = .0142 rashift = .0076 rbshift = .0076 rcshift = .0076 } equations { iac: vac iba: vba icb: vcb = rac*iac + d_by_dt(Np*phi_ac) = rba*iba + d_by_dt(Np*phi_ba) = rcb*icb + d_by_dt(Np*phi_cb) ias: vas ibs: vbs ics: vcs = ras*ias + d_by_dt(Ns*phi_as) = rbs*ibs + d_by_dt(Ns*phi_bs) = rcs*ics + d_by_dt(Ns*phi_cs) # voltage # expressions iashift: vashift = rashift*iashift + d_by_dt(Nshift*phi_ashift) ibshift: vbshift = rbshift*ibshift + d_by_dt(Nshift*phi_bshift) icshift: vcshift = rcshift*icshift + d_by_dt(Nshift*phi_cshift) phi_ac: phi_ac = (Np*iac)/Rm + (Ns*ias)/Rm - (Nshift*iashift)/Rm + (Np*iac)/Rlp # flux phi_ba: phi_ba = (Np*iba)/Rm + (Ns*ibs)/Rm - (Nshift*ibshift)/Rm + (Np*iba)/Rlp # expressions phi_cb: phi_cb = (Np*icb)/Rm + (Ns*ics)/Rm - (Nshift*icshift)/Rm + (Np*icb)/Rlp phi_as: phi_as + (Ns*ias)/Rls phi_bs: phi_bs + (Ns*ibs)/Rls phi_cs: phi_cs + (Ns*ics)/Rls = (Ns*ias)/Rm + (Np*iac)/Rm - (Nshift*iashift)/Rm = (Ns*ibs)/Rm + (Np*iba)/Rm - (Nshift*ibshift)/Rm = (Ns*ics)/Rm + (Np*icb)/Rm - (Nshift*icshift)/Rm phi_ashift: phi_ashift = (Nshift*iashift)/Rm - (Ns*ias)/Rm (Np*iac)/Rm + (Nshift*iashift)/Rlshift phi_bshift: phi_bshift = (Nshift*ibshift)/Rm - (Ns*ibs)/Rm (Np*iba)/Rm + (Nshift*ibshift)/Rlshift phi_cshift: phi_cshift = (Nshift*icshift)/Rm - (Ns*ics)/Rm (Np*icb)/Rm + (Nshift*icshift)/Rlshift ########################################### # H: B = (uo*ur)*H B: B = phi_ac/A H: H = Np*iac/lm ########################################### } } 22 C. Symbolic Expressions Obtained for the Current Equations. %iac = (phi_ac*Rm-Ns*ias+Nshift*iashift)/Np/(Rlp+Rm)*Rlp %iba =(phi_ba*Rm-Ns*ibs+Nshift*ibshift)/Np/(Rlp+Rm)*Rlp %icb =(phi_cb*Rm-Ns*ics+Nshift*icshift)/Np/(Rlp+Rm)*Rlp %ias =-(-phi_as*Rm+Np*iac-Nshift*iashift)/Ns/(Rls+Rm)*Rls %ibs =-(-phi_bs*Rm+Np*iba-Nshift*ibshift)/Ns/(Rls+Rm)*Rls %ics =-(-phi_cs*Rm+Np*icb-Nshift*icshift)/Ns/(Rls+Rm)*Rls %iashift =(phi_ashift*Rm+Ns*ias+Np*iac)/Nshift/(Rlshift+Rm)*Rlshift %ibshift =(phi_bshift*Rm+Ns*ibs+Np*iba)/Nshift/(Rlshift+Rm)*Rlshift %icshift =(phi_cshift*Rm+Ns*ics+Np*icb)/Nshift/(Rlshift+Rm)*Rlshift 23