|
1 | 1 | within Modelica.Electrical.PowerConverters.Examples.DCAC.PolyphaseTwoLevel; |
2 | 2 | model ThreePhaseTwoLevel_PWM "Test of pulse width modulation methods" |
3 | 3 | extends Modelica.Icons.Example; |
4 | | - import Modelica.Electrical.Polyphase.Functions.factorY2DC; |
5 | 4 | import Modelica.Constants.pi; |
6 | | - parameter Real RMS=1 "Reference RMS Y"; |
7 | | - Modelica.Blocks.Sources.Cosine cosine(f=2, |
8 | | - phase=0, |
9 | | - amplitude=RMS*sqrt(2)) |
10 | | - annotation (Placement(transformation(extent={{-90,10},{-70,30}}))); |
11 | | - Modelica.Blocks.Sources.Sine sine( |
12 | | - amplitude=cosine.amplitude, |
13 | | - f=cosine.f, |
14 | | - phase=cosine.phase) |
15 | | - annotation (Placement(transformation(extent={{-90,-30},{-70,-10}}))); |
16 | | - PowerConverters.DCAC.Control.PWM pwm(uMax=sqrt(2*3), f=100) |
17 | | - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); |
18 | | - PowerConverters.DCAC.Polyphase2Level multiPhase2Level |
19 | | - annotation (Placement(transformation(extent={{-10,40},{10,60}}))); |
20 | | - Modelica.Electrical.Analog.Sources.ConstantVoltage dcPos(V=pwm.uMax/2) |
| 5 | + parameter SI.Voltage V_LL=400 "RMS line-to-line voltage"; |
| 6 | + parameter SI.Voltage V_DC=sqrt(2)*V_LL "Ideal DC volatge"; |
| 7 | + parameter SI.Voltage Vmax=V_DC/sqrt(3) "Max. output voltage"; |
| 8 | + parameter SI.Frequency f_sw=2500 "Switching frequency"; |
| 9 | + parameter SI.Voltage VNom=V_LL/sqrt(3) "Nominal RMS voltage"; |
| 10 | + parameter SI.Frequency fNom=50 "Nominal frequency"; |
| 11 | + parameter SI.Frequency fRef=50 "Reference frequency"; |
| 12 | + Modelica.Blocks.Sources.Constant refFrequ(k=fRef) |
| 13 | + annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); |
| 14 | + Modelica.Electrical.Machines.Utilities.VfController vfController( |
| 15 | + VNominal=VNom, fNominal=fNom, BasePhase=pi/2) |
| 16 | + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); |
| 17 | + Modelica.Electrical.Machines.SpacePhasors.Blocks.ToSpacePhasor toSpacePhasorRef |
| 18 | + annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); |
| 19 | + Modelica.Electrical.PowerConverters.DCAC.Control.PWM pwm( |
| 20 | + pwmType=Modelica.Electrical.PowerConverters.Types.PWMType.SVPWM, |
| 21 | + uMax=Vmax, f=f_sw) |
| 22 | + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, |
| 23 | + rotation=90, |
| 24 | + origin={10,20}))); |
| 25 | + Modelica.Electrical.PowerConverters.DCAC.Polyphase2Level multiPhase2Level |
| 26 | + annotation (Placement(transformation(extent={{0,40},{20,60}}))); |
| 27 | + Modelica.Electrical.Analog.Sources.ConstantVoltage dcPos(V=V_DC/2) |
21 | 28 | annotation (Placement(transformation( |
22 | 29 | extent={{-10,-10},{10,10}}, |
23 | 30 | rotation=270, |
24 | | - origin={-40,70}))); |
25 | | - Modelica.Electrical.Analog.Sources.ConstantVoltage dcNeg(V=pwm.uMax/2) |
| 31 | + origin={-30,70}))); |
| 32 | + Modelica.Electrical.Analog.Sources.ConstantVoltage dcNeg(V=V_DC/2) |
26 | 33 | annotation (Placement(transformation( |
27 | 34 | extent={{-10,-10},{10,10}}, |
28 | 35 | rotation=270, |
29 | | - origin={-40,30}))); |
| 36 | + origin={-30,30}))); |
30 | 37 | Modelica.Electrical.Analog.Basic.Ground ground annotation (Placement( |
31 | 38 | transformation( |
32 | 39 | extent={{-10,-10},{10,10}}, |
33 | 40 | rotation=270, |
34 | | - origin={-50,50}))); |
| 41 | + origin={-40,50}))); |
35 | 42 | Modelica.Electrical.Polyphase.Sensors.PotentialSensor potentialSensor |
36 | | - annotation (Placement(transformation(extent={{20,40},{40,60}}))); |
37 | | - Modelica.Blocks.Math.Harmonic harmonic(f=cosine.f, k=1) |
38 | | - annotation (Placement(transformation(extent={{60,40},{80,60}}))); |
| 43 | + annotation (Placement(transformation(extent={{30,40},{50,60}}))); |
| 44 | + Modelica.Blocks.Math.Harmonic harmonic(f=fRef, k=1) |
| 45 | + annotation (Placement(transformation(extent={{70,40},{90,60}}))); |
39 | 46 | Modelica.Electrical.Machines.SpacePhasors.Blocks.ToSpacePhasor toSpacePhasor |
40 | | - annotation (Placement(transformation(extent={{-30,-50},{-10,-30}}))); |
| 47 | + annotation (Placement(transformation(extent={{-20,-50},{0,-30}}))); |
| 48 | + Modelica.Blocks.Sources.RealExpression rotationAngle(y=vfController.x) |
| 49 | + annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); |
41 | 50 | Modelica.Electrical.Machines.SpacePhasors.Blocks.Rotator rotator |
42 | | - annotation (Placement(transformation(extent={{0,-50},{20,-30}}))); |
43 | | - Modelica.Blocks.Sources.Constant const(k=cosine.f) |
44 | | - annotation (Placement(transformation(extent={{-60,-80},{-40,-60}}))); |
45 | | - Modelica.Blocks.Continuous.Integrator integrator(k=2*pi) |
46 | | - annotation (Placement(transformation(extent={{-30,-80},{-10,-60}}))); |
47 | | - Modelica.Blocks.Continuous.Filter filter[2]( |
| 51 | + annotation (Placement(transformation(extent={{10,-50},{30,-30}}))); |
| 52 | + Modelica.Blocks.Continuous.Filter filter2[2]( |
48 | 53 | each init=Modelica.Blocks.Types.Init.InitialOutput, |
49 | | - each analogFilter=Modelica.Blocks.Types.AnalogFilter.CriticalDamping, |
50 | | - y_start={cosine.amplitude,cosine.phase}, |
| 54 | + each analogFilter=Modelica.Blocks.Types.AnalogFilter.Bessel, |
| 55 | + y_start={VNom*sqrt(2),0}, |
51 | 56 | each order=2, |
52 | | - each f_cut=0.5*cosine.f) |
53 | | - annotation (Placement(transformation(extent={{30,-50},{50,-30}}))); |
| 57 | + each f_cut=0.5*fRef) |
| 58 | + annotation (Placement(transformation(extent={{40,-50},{60,-30}}))); |
54 | 59 | Modelica.Electrical.Machines.SpacePhasors.Blocks.ToPolar toPolar |
55 | | - annotation (Placement(transformation(extent={{60,-50},{80,-30}}))); |
| 60 | + annotation (Placement(transformation(extent={{70,-50},{90,-30}}))); |
56 | 61 | equation |
57 | 62 | connect(pwm.fire_p, multiPhase2Level.fire_p) |
58 | | - annotation (Line(points={{-29,6},{-6,6},{-6,38}}, color={255,0,255})); |
| 63 | + annotation (Line(points={{4,31},{4,38}}, color={255,0,255})); |
59 | 64 | connect(pwm.fire_n, multiPhase2Level.fire_n) |
60 | | - annotation (Line(points={{-29,-6},{6,-6},{6,38}}, color={255,0,255})); |
61 | | - connect(dcNeg.n, multiPhase2Level.dc_n) annotation (Line(points={{-40,20}, |
62 | | - {-20,20},{-20,44},{-10,44}}, |
| 65 | + annotation (Line(points={{16,31},{16,38}}, color={255,0,255})); |
| 66 | + connect(dcNeg.n, multiPhase2Level.dc_n) annotation (Line(points={{-30,20},{ |
| 67 | + -10,20},{-10,44},{0,44}}, |
63 | 68 | color={0,0,255})); |
64 | | - connect(dcPos.p, multiPhase2Level.dc_p) annotation (Line(points={{-40,80}, |
65 | | - {-20,80},{-20,56},{-10,56}}, |
| 69 | + connect(dcPos.p, multiPhase2Level.dc_p) annotation (Line(points={{-30,80},{ |
| 70 | + -10,80},{-10,56},{0,56}}, |
66 | 71 | color={0,0,255})); |
67 | 72 | connect(dcPos.n, ground.p) |
68 | | - annotation (Line(points={{-40,60},{-40,50}}, color={0,0,255})); |
| 73 | + annotation (Line(points={{-30,60},{-30,50}}, color={0,0,255})); |
69 | 74 | connect(ground.p, dcNeg.p) |
70 | | - annotation (Line(points={{-40,50},{-40,40}}, color={0,0,255})); |
71 | | - connect(cosine.y, pwm.u[1]) annotation (Line(points={{-69,20},{-60,20},{-60, |
72 | | - -1},{-52,-1}}, color={0,0,127})); |
73 | | - connect(sine.y, pwm.u[2]) annotation (Line(points={{-69,-20},{-60,-20},{-60, |
74 | | - 1},{-52,1}}, color={0,0,127})); |
| 75 | + annotation (Line(points={{-30,50},{-30,40}}, color={0,0,255})); |
75 | 76 | connect(multiPhase2Level.ac, potentialSensor.plug_p) |
76 | | - annotation (Line(points={{10,50},{20,50}}, color={0,0,255})); |
| 77 | + annotation (Line(points={{20,50},{30,50}}, color={0,0,255})); |
77 | 78 | connect(toSpacePhasor.y, rotator.u) |
78 | | - annotation (Line(points={{-9,-40},{-2,-40}}, color={0,0,127})); |
79 | | - connect(potentialSensor.phi, toSpacePhasor.u) annotation (Line(points={{41,50}, |
80 | | - {50,50},{50,-20},{-40,-20},{-40,-40},{-32,-40}}, color={0,0,127})); |
81 | | - connect(const.y, integrator.u) |
82 | | - annotation (Line(points={{-39,-70},{-32,-70}}, color={0,0,127})); |
83 | | - connect(integrator.y, rotator.angle) |
84 | | - annotation (Line(points={{-9,-70},{10,-70},{10,-52}},color={0,0,127})); |
| 79 | + annotation (Line(points={{1,-40},{8,-40}}, color={0,0,127})); |
| 80 | + connect(potentialSensor.phi, toSpacePhasor.u) annotation (Line(points={{51,50}, |
| 81 | + {60,50},{60,-20},{-30,-20},{-30,-40},{-22,-40}}, color={0,0,127})); |
85 | 82 | connect(potentialSensor.phi[1], harmonic.u) |
86 | | - annotation (Line(points={{41,50},{58,50}}, color={0,0,127})); |
87 | | - connect(rotator.y, filter.u) |
88 | | - annotation (Line(points={{21,-40},{28,-40}}, color={0,0,127})); |
89 | | - connect(filter.y, toPolar.u) |
90 | | - annotation (Line(points={{51,-40},{58,-40}}, color={0,0,127})); |
| 83 | + annotation (Line(points={{51,50},{68,50}}, color={0,0,127})); |
| 84 | + connect(rotator.y, filter2.u) |
| 85 | + annotation (Line(points={{31,-40},{38,-40}}, color={0,0,127})); |
| 86 | + connect(filter2.y, toPolar.u) |
| 87 | + annotation (Line(points={{61,-40},{68,-40}}, color={0,0,127})); |
| 88 | + connect(pwm.u, toSpacePhasorRef.y) |
| 89 | + annotation (Line(points={{10,8},{10,0},{-9,0}}, |
| 90 | + color={0,0,127})); |
| 91 | + connect(vfController.y, toSpacePhasorRef.u) |
| 92 | + annotation (Line(points={{-39,0},{-32,0}}, color={0,0,127})); |
| 93 | + connect(refFrequ.y, vfController.u) |
| 94 | + annotation (Line(points={{-69,0},{-62,0}}, color={0,0,127})); |
| 95 | + connect(rotationAngle.y, rotator.angle) |
| 96 | + annotation (Line(points={{-39,-60},{20,-60},{20,-52}}, color={0,0,127})); |
91 | 97 | annotation (experiment( |
92 | | - StopTime=2, |
| 98 | + StopTime=0.1, |
93 | 99 | Interval=0.001, |
94 | | - Tolerance=1e-05), |
| 100 | + Tolerance=1e-06), |
95 | 101 | Documentation(info="<html> |
96 | 102 | <p> |
97 | | -A reference space vector (formed by real part = cosine and imaginary part = sine) of length √2*RMS and frequency 2 Hz is applied. |
98 | | -The resulting switching patterns are applied to a three-phase twolevel bridge with switching frequency 100 Hz, fed by DC voltage = √2*√3*1 |
99 | | -where 1 is the theoretical maximum voltage from terminal to neutral. |
| 103 | +A reference space vector (formed by a vfController and a transformation to space phasor) is applied. |
| 104 | +The resulting switching patterns are applied to a three-phase twolevel bridge, fed by DC voltage. |
100 | 105 | The resulting voltages with reference to midpoint of the DC voltage are measured. |
101 | 106 | </p> |
102 | 107 | <p> |
103 | 108 | The RMS of the first harmonic of the first of these voltages is calculated. |
104 | | -Please note that the value of the first harmonic is valid after the first period (i.e. 0.5 s). |
| 109 | +Please note that the value of the first harmonic is valid after the first period. |
105 | 110 | </p> |
106 | 111 | <p> |
107 | 112 | Furthermore, these three voltages are transformed to the corresponding space phasor. |
108 | 113 | Note that the zero component is not zero, indicating the shift of the neutral with respect to the midpoint of the DC voltage. |
109 | 114 | </p> |
110 | 115 | <p> |
111 | | -The space phasor is rotated to the coordinate system rotating with 2*π*2 Hz. |
| 116 | +The space phasor is rotated to the coordinate system rotating with reference frequency. |
112 | 117 | To suppress the influence of switching, real and imaginary part of the rotated phasor are filtered. |
113 | 118 | The polar representation of this rotated and filtered phasor are calculated. |
114 | 119 | </p> |
115 | 120 | <p> |
116 | | -Please note that the filter has a settle time depending on the filter parameters. |
| 121 | +Please note that the filter has a settle time depending on the filter parameters and causes a delay (phase shift). |
| 122 | +</p> |
| 123 | +<h4>Note</h4> |
| 124 | +<p> |
| 125 | +Intersective PWM without additional measures (e.g. over-modulation or injection of 3<sup>rd</sup> harmonic) achieves lower voltages (√3 / 2) |
| 126 | +than space vector PWM, in this example 200 V RMS comapred to 230.94 V RMS. |
117 | 127 | </p> |
118 | 128 | </html>")); |
119 | 129 | end ThreePhaseTwoLevel_PWM; |
0 commit comments