Ticket #5452: TestIndexReduction4.mo

File TestIndexReduction4.mo, 7.7 KB (added by Francesco Casella, 5 years ago)
Line 
1within ;
2model TestIndexReduction4
3 extends Modelica.Icons.Example;
4 import Modelica.Constants.pi;
5 import Modelica.Electrical.MultiPhase.Functions.factorY2DC;
6 constant Integer m=3 "Number of phases";
7 parameter Modelica.SIunits.Voltage VNominal=400
8 "Nominal RMS voltage per phase";
9 parameter Modelica.SIunits.Frequency fNominal=50 "Nominal frequency";
10 parameter Modelica.SIunits.Resistance RGrid=10e-3 "Grid choke resistance";
11 parameter Modelica.SIunits.Resistance RLoad=1 "Load resistance";
12 parameter Modelica.SIunits.Inductance LGrid=500e-6 "Grid choke inductance";
13 parameter Modelica.SIunits.Voltage VDC=factorY2DC(m)*VNominal/sqrt(3) "Theoretical DC voltage";
14 parameter Modelica.SIunits.Capacitance CDC=5e-3 "DC capacitor";
15 parameter Modelica.SIunits.Torque TLoad=161.4 "Nominal load torque";
16 parameter Modelica.SIunits.AngularVelocity wLoad=1440.45*2*pi/60 "Nominal load speed";
17 parameter Modelica.SIunits.Inertia JLoad=0.29 "Load's moment of inertia";
18 Modelica.Electrical.MultiPhase.Sources.SineVoltage sineVoltage(
19 final m=m,
20 final phase=-Modelica.Electrical.MultiPhase.Functions.symmetricOrientation(
21 m),
22 final freqHz=fill(fNominal, m),
23 final offset=zeros(m),
24 final startTime=zeros(m),
25 final V=fill(VNominal*sqrt(2/3), m)) annotation (Placement(transformation(
26 extent={{-10,-10},{10,10}},
27 rotation=270,
28 origin={-80,-30})));
29 Modelica.Electrical.MultiPhase.Basic.Star star(m=m) annotation (Placement(
30 transformation(
31 extent={{-10,-10},{10,10}},
32 rotation=270,
33 origin={-80,-60})));
34 Modelica.Electrical.Analog.Basic.Ground ground annotation (Placement(
35 transformation(origin={-80,-90}, extent={{-10,-10},{10,10}})));
36 Modelica.Electrical.Machines.Sensors.CurrentQuasiRMSSensor gridCurrent
37 annotation (Placement(transformation(
38 extent={{-10,10},{10,-10}},
39 rotation=270,
40 origin={-80,0})));
41 Modelica.Electrical.MultiPhase.Basic.Resistor resistor(
42 final m=m,
43 final R=fill(RGrid, m),
44 final T_ref=fill(20, m),
45 final alpha=zeros(m),
46 final T=fill(20, m)) annotation (Placement(transformation(
47 extent={{-10,-10},{10,10}},
48 rotation=90,
49 origin={-80,30})));
50 Modelica.Electrical.MultiPhase.Basic.Inductor inductor(m=m, final L=fill(
51 LGrid, m)) annotation (Placement(transformation(
52 extent={{-10,-10},{10,10}},
53 rotation=90,
54 origin={-80,60})));
55
56 Modelica.Electrical.PowerConverters.ACDC.DiodeBridge2mPulse rectifier
57 annotation (Placement(transformation(extent={{-68,60},{-48,80}})));
58 Modelica.Electrical.Analog.Basic.Capacitor capacitor(v(fixed=true, start=VDC),
59 C=CDC) annotation (Placement(transformation(
60 extent={{-10,-10},{10,10}},
61 rotation=270,
62 origin={-30,70})));
63 Modelica.Electrical.PowerConverters.DCAC.MultiPhase2Level inverter
64 annotation (Placement(transformation(extent={{-10,-10},{10,10}}, origin={0,
65 70})));
66 Modelica.Blocks.Sources.Ramp ramp(height=fNominal,
67 startTime=0,
68 duration=1.2)
69 annotation (
70 Placement(transformation(extent={{-10,-10},{10,10}},
71 origin={-20,-50})));
72 Modelica.Electrical.Machines.Utilities.VfController vfController(
73 final m=m,
74 VNominal=VNominal,
75 fNominal=fNominal,
76 EconomyMode=true) annotation (Placement(transformation(
77 extent={{-10,-10},{10,10}},
78 rotation=90,
79 origin={0,-20})));
80
81 Modelica.Electrical.Machines.SpacePhasors.Blocks.ToSpacePhasor toSpacePhasor
82 annotation (Placement(transformation(
83 extent={{-10,-10},{10,10}},
84 rotation=90,
85 origin={0,10})));
86 Modelica.Electrical.PowerConverters.DCAC.Control.PWM pwm(uMax=VDC, f=2000)
87 annotation (Placement(transformation(
88 extent={{-10,-10},{10,10}},
89 rotation=90,
90 origin={0,40})));
91 Modelica.Electrical.MultiPhase.Basic.Resistor resistor1(
92 final m=m,
93 final R=fill(RLoad, m),
94 final T_ref=fill(20, m),
95 final alpha=zeros(m),
96 final T=fill(20, m)) annotation (Placement(transformation(
97 extent={{10,-10},{-10,10}},
98 rotation=180,
99 origin={44,70})));
100 Modelica.Electrical.MultiPhase.Basic.Delta delta
101 annotation (Placement(transformation(extent={{34,36},{54,56}})));
102equation
103 connect(vfController.u, ramp.y)
104 annotation (Line(points={{0,-32},{0,-50},{-9,-50}},
105 color={0,0,127}));
106 connect(toSpacePhasor.u, vfController.y)
107 annotation (Line(points={{0,-2},{0,-9}}, color={0,0,127}));
108 connect(pwm.u, toSpacePhasor.y)
109 annotation (Line(points={{0,28},{0,21}}, color={0,0,127}));
110 connect(inverter.fire_p, pwm.fire_p)
111 annotation (Line(points={{-6,58},{-6,51}}, color={255,0,255}));
112 connect(inverter.fire_n, pwm.fire_n)
113 annotation (Line(points={{6,58},{6,51}}, color={255,0,255}));
114 connect(capacitor.p, inverter.dc_p) annotation (Line(points={{-30,80},{-20,80},
115 {-20,76},{-10,76}}, color={0,0,255}));
116 connect(capacitor.n, inverter.dc_n) annotation (Line(points={{-30,60},{-20,60},
117 {-20,64},{-10,64}}, color={0,0,255}));
118 connect(rectifier.dc_p, capacitor.p) annotation (Line(points={{-48,76},{-40,76},
119 {-40,80},{-30,80}}, color={0,0,255}));
120 connect(rectifier.dc_n, capacitor.n) annotation (Line(points={{-48,64},{-40,64},
121 {-40,60},{-30,60}}, color={0,0,255}));
122 connect(sineVoltage.plug_n, star.plug_p)
123 annotation (Line(points={{-80,-40},{-80,-50}}, color={0,0,255}));
124 connect(star.pin_n, ground.p)
125 annotation (Line(points={{-80,-70},{-80,-80}}, color={0,0,255}));
126 connect(resistor.plug_n, inductor.plug_p)
127 annotation (Line(points={{-80,40},{-80,50}}, color={0,0,255}));
128 connect(inductor.plug_n, rectifier.ac)
129 annotation (Line(points={{-80,70},{-68,70}}, color={0,0,255}));
130 connect(resistor.plug_p, gridCurrent.plug_p)
131 annotation (Line(points={{-80,20},{-80,10}}, color={0,0,255}));
132 connect(gridCurrent.plug_n, sineVoltage.plug_p)
133 annotation (Line(points={{-80,-10},{-80,-20}}, color={0,0,255}));
134 connect(inverter.ac, resistor1.plug_p)
135 annotation (Line(points={{10,70},{34,70}}, color={0,0,255}));
136 connect(resistor1.plug_p, delta.plug_p)
137 annotation (Line(points={{34,70},{34,46}}, color={0,0,255}));
138 connect(delta.plug_n, resistor1.plug_n)
139 annotation (Line(points={{54,46},{54,70}}, color={0,0,255}));
140 annotation (experiment(
141 StopTime=0.1,
142 Interval=5e-05,
143 Tolerance=1e-06), Documentation(
144 info="<html>
145<p>
146This is a model of a complete inverter drive comprising:
147</p>
148<ul>
149<li>a grid model and a line choke</li>
150<li><a href=\"modelica://Modelica.Electrical.PowerConverters.ACDC.DiodeBridge2mPulse\">a diode rectifier</a></li>
151<li>a buffer capacitor</li>
152<li><a href=\"modelica://Modelica.Electrical.PowerConverters.DCAC.MultiPhase2Level\">a switching inverter</a></li>
153<li><a href=\"modelica://Modelica.Electrical.PowerConverters.DCAC.Control.PWM\">a pulse width modulation</a></li>
154<li><a href=\"modelica://Modelica.Electrical.Machines.Utilities.VfController\">a voltage/frequency characteristic</a></li>
155<li>the reference frequency ramped up</li>
156<li>an induction machine with squirrel cage</li>
157<li>a load inertia and quadratic speed dependent load torque (like a fan or pump)</li>
158</ul>
159<p>Please note: Be patient, two switching devices cause many event iteratons which cost performance.</p>
160<p>Note that due to the voltage drop the voltage at the machine can't reach the full voltage which means torque reduction.</p>
161<p>Default machine parameters are adapted to nominal phase voltage 400 V and nominal phase current 25 A.</p>
162</html>"),
163 uses(Modelica(version="3.2.3")));
164end TestIndexReduction4;