| 1 | package stAsmaPkg1819
|
|---|
| 2 | // Euro Symbol: €
|
|---|
| 3 |
|
|---|
| 4 | package Support
|
|---|
| 5 | model AronSensor "Two port three-phase power sensor"
|
|---|
| 6 | Modelica.Electrical.MultiPhase.Interfaces.PositivePlug pc "Positive plug, current path" annotation (
|
|---|
| 7 | Placement(transformation(extent = {{-110, -10}, {-90, 10}}), iconTransformation(extent = {{-110, -10}, {-90, 10}})));
|
|---|
| 8 | Modelica.Electrical.MultiPhase.Interfaces.NegativePlug nc(final m = 3) "Negative plug, current path" annotation (
|
|---|
| 9 | Placement(transformation(extent = {{90, 12}, {110, -8}}, rotation = 0), iconTransformation(extent = {{90, 10}, {110, -10}})));
|
|---|
| 10 | Modelica.Blocks.Interfaces.RealOutput y(final unit = "W") annotation (
|
|---|
| 11 | Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {-20, -110})));
|
|---|
| 12 | equation
|
|---|
| 13 | for ph in 1:3 loop
|
|---|
| 14 | pc.pin[ph].i + nc.pin[ph].i = 0;
|
|---|
| 15 | pc.pin[ph].v = nc.pin[ph].v;
|
|---|
| 16 | end for;
|
|---|
| 17 | //Aron formula for power (common wire is wire 2):
|
|---|
| 18 | y = pc.pin[1].i * (pc.pin[1].v - pc.pin[2].v) + pc.pin[3].i * (pc.pin[3].v - pc.pin[2].v);
|
|---|
| 19 | annotation (
|
|---|
| 20 | Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}})),
|
|---|
| 21 | Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}), graphics={ Line(points = {{-104, 0}, {96, 0}}, color = {0, 0, 255}), Ellipse(extent = {{-70, 70}, {70, -70}}, lineColor = {0, 0, 0}, fillColor = {255, 255, 255},
|
|---|
| 22 | fillPattern = FillPattern.Solid), Line(points = {{0, 70}, {0, 40}}, color = {0, 0, 0}), Line(points = {{22.9, 32.8}, {40.2, 57.3}}, color = {0, 0, 0}), Line(points = {{-22.9, 32.8}, {-40.2, 57.3}}, color = {0, 0, 0}), Line(points = {{37.6, 13.7}, {65.8, 23.9}}, color = {0, 0, 0}), Line(points = {{-37.6, 13.7}, {-65.8, 23.9}}, color = {0, 0, 0}), Line(points = {{0, 0}, {9.02, 28.6}}, color = {0, 0, 0}), Polygon(points = {{-0.48, 31.6}, {18, 26}, {18, 57.2}, {-0.48, 31.6}}, lineColor = {0, 0, 0}, fillColor = {0, 0, 0},
|
|---|
| 23 | fillPattern = FillPattern.Solid), Ellipse(extent = {{-5, 5}, {5, -5}}, lineColor = {0, 0, 0}, fillColor = {0, 0, 0},
|
|---|
| 24 | fillPattern = FillPattern.Solid), Text(extent = {{-39, -3}, {40, -66}}, lineColor = {0, 0, 0}, textString = "P3"), Line(points = {{-20, -104}, {-20, -66}}, color = {0, 0, 127}, smooth = Smooth.None), Text(origin = {0, 10}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255},
|
|---|
| 25 | fillPattern = FillPattern.Solid, extent = {{-100, 102}, {100, 62}}, textString = "%name")}),
|
|---|
| 26 | Documentation(info = "<html>
|
|---|
| 27 | <p><code><span style=\"font-family: Courier New,courier;\"> Uses the <span style=\"color: #006400;\">Aron formula for power (common wire is wire 2):</span></code></p>
|
|---|
| 28 | <pre><span style=\"font-family: Courier New,courier; color: #006400;\">y=i1*(v1-v2) + i3*(v3-v2)</span></pre>
|
|---|
| 29 | </html>"));
|
|---|
| 30 | end AronSensor;
|
|---|
| 31 |
|
|---|
| 32 | block AVG "Sensor to measure the average value of input"
|
|---|
| 33 | Modelica.Blocks.Interfaces.RealInput u annotation (
|
|---|
| 34 | Placement(transformation(extent = {{-138, -20}, {-98, 20}})));
|
|---|
| 35 | Modelica.Blocks.Interfaces.RealOutput y annotation (
|
|---|
| 36 | Placement(transformation(extent = {{100, -10}, {120, 10}})));
|
|---|
| 37 | Modelica.Blocks.Continuous.Integrator integrator annotation (
|
|---|
| 38 | Placement(visible = true, transformation(extent = {{-60, -10}, {-40, 10}}, rotation = 0)));
|
|---|
| 39 | Modelica.Blocks.Math.Add add(k2 = -1) annotation (
|
|---|
| 40 | Placement(transformation(extent = {{12, -10}, {32, 10}})));
|
|---|
| 41 | Modelica.Blocks.Nonlinear.FixedDelay fixedDelay1(delayTime = 1 / Frequency) annotation (
|
|---|
| 42 | Placement(visible = true, transformation(origin = {-14, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
|---|
| 43 | Modelica.Blocks.Math.Gain gain(k = Frequency) annotation (
|
|---|
| 44 | Placement(transformation(extent = {{52, -10}, {72, 10}})));
|
|---|
| 45 | parameter Modelica.SIunits.Frequency Frequency = 50. "Frequency of signals";
|
|---|
| 46 | equation
|
|---|
| 47 | connect(fixedDelay1.u, integrator.y) annotation (
|
|---|
| 48 | Line(points = {{-26, -26}, {-28, -26}, {-28, 0}, {-39, 0}}, color = {0, 0, 127}));
|
|---|
| 49 | connect(fixedDelay1.y, add.u2) annotation (
|
|---|
| 50 | Line(points = {{-3, -26}, {4, -26}, {4, -6}, {10, -6}}, color = {0, 0, 127}));
|
|---|
| 51 | connect(add.u1, integrator.y) annotation (
|
|---|
| 52 | Line(points = {{10, 6}, {-14, 6}, {-14, -2}, {-39, -2}}, color = {0, 0, 127}));
|
|---|
| 53 | connect(integrator.u, u) annotation (
|
|---|
| 54 | Line(points = {{-62, -2}, {-82, -2}, {-82, 0}, {-118, 0}}, color = {0, 0, 127}));
|
|---|
| 55 | connect(gain.u, add.y) annotation (
|
|---|
| 56 | Line(points = {{50, 0}, {33, 0}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 57 | connect(gain.y, y) annotation (
|
|---|
| 58 | Line(points = {{73, 0}, {110, 0}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 59 | annotation (
|
|---|
| 60 | Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics={ Text(extent = {{104, 70}, {-108, 108}}, textString = "%name", lineColor = {0, 0, 255}), Rectangle(extent = {{-100, 60}, {100, -60}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255},
|
|---|
| 61 | fillPattern = FillPattern.Solid), Text(extent = {{-72, 36}, {80, -20}}, lineColor = {0, 0, 255}, textString = "AVG")}),
|
|---|
| 62 | Diagram(coordinateSystem(extent = {{-100, -40}, {100, 40}})),
|
|---|
| 63 | Documentation(info = "<html><p>
|
|---|
| 64 | This power sensor measures instantaneous electrical power of a singlephase system and has a separated voltage and current path. The pins of the voltage path are <code>pv</code> and <code>nv</code>, the pins of the current path are <code>pc</code> and <code>nc</code>. The internal resistance of the current path is zero, the internal resistance of the voltage path is infinite.
|
|---|
| 65 | </p>
|
|---|
| 66 | </html>", revisions = "<html>
|
|---|
| 67 | <ul>
|
|---|
| 68 | <li><i> January 12, 2006 </i>
|
|---|
| 69 | by Anton Haumer<br> implemented<br>
|
|---|
| 70 | </li>
|
|---|
| 71 | </ul>
|
|---|
| 72 | </html>"),
|
|---|
| 73 | __OpenModelica_commandLineOptions = "");
|
|---|
| 74 | end AVG;
|
|---|
| 75 |
|
|---|
| 76 | block RMS "Sensor to measure the RMS value of input"
|
|---|
| 77 | Modelica.Blocks.Interfaces.RealInput u annotation (
|
|---|
| 78 | Placement(transformation(extent = {{-138, -20}, {-98, 20}})));
|
|---|
| 79 | Modelica.Blocks.Interfaces.RealOutput y annotation (
|
|---|
| 80 | Placement(transformation(extent = {{100, -10}, {120, 10}})));
|
|---|
| 81 | parameter Modelica.SIunits.Frequency Frequency = 50. "Frequency of signals";
|
|---|
| 82 | Modelica.Blocks.Math.Product product annotation (
|
|---|
| 83 | Placement(transformation(extent = {{-58, -8}, {-42, 8}})));
|
|---|
| 84 | Modelica.Blocks.Math.Sqrt sqrt1 annotation (
|
|---|
| 85 | Placement(transformation(extent = {{66, -8}, {82, 8}})));
|
|---|
| 86 | Modelica.Blocks.Math.Abs abs1 annotation (
|
|---|
| 87 | Placement(transformation(extent = {{36, -8}, {52, 8}})));
|
|---|
| 88 | AVG avg(Frequency = Frequency) annotation (
|
|---|
| 89 | Placement(transformation(extent = {{-16, -10}, {4, 10}})));
|
|---|
| 90 | equation
|
|---|
| 91 | connect(abs1.y, sqrt1.u) annotation (
|
|---|
| 92 | Line(points = {{52.8, 0}, {64.4, 0}}, color = {0, 0, 127}));
|
|---|
| 93 | connect(sqrt1.y, y) annotation (
|
|---|
| 94 | Line(points = {{82.8, 0}, {110, 0}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 95 | connect(product.u2, product.u1) annotation (
|
|---|
| 96 | Line(points = {{-59.6, -4.8}, {-66, -4.8}, {-66, 4.8}, {-59.6, 4.8}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 97 | connect(avg.u, product.y) annotation (
|
|---|
| 98 | Line(points = {{-17.8, 0}, {-41.2, 0}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 99 | connect(u, product.u1) annotation (
|
|---|
| 100 | Line(points = {{-118, 0}, {-66, 0}, {-66, 4.8}, {-59.6, 4.8}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 101 | connect(abs1.u, avg.y) annotation (
|
|---|
| 102 | Line(points = {{34.4, 0}, {5, 0}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 103 | annotation (
|
|---|
| 104 | Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics={ Text(extent = {{100, 68}, {-102, 104}}, textString = "%name", lineColor = {0, 0, 255}), Rectangle(extent = {{-100, 60}, {100, -60}}, lineColor = {0, 0, 255},
|
|---|
| 105 | fillPattern = FillPattern.Solid, fillColor = {255, 255, 255}), Text(extent = {{-74, 30}, {80, -14}}, lineColor = {0, 0, 255}, textString = "RMS2")}),
|
|---|
| 106 | Diagram(coordinateSystem(extent = {{-100, -40}, {100, 40}})),
|
|---|
| 107 | Documentation(info = "<html>
|
|---|
| 108 | <p>Sensore per la misura del valore efficace sdi un segnale periodico.</p>
|
|---|
| 109 | <p>Dovendo fare una radice quadrata, a causa di errori di arrotondamento l'argomento della radice può risultare negativo, seppur prossimo a 0; </p>
|
|---|
| 110 | <p>Pertanto è stato frapposto un valore assoluto prima dell'estrazione a radice</p>
|
|---|
| 111 | </html>", revisions = "<html>
|
|---|
| 112 | <ul>
|
|---|
| 113 | <li><i> January 12, 2006 </i>
|
|---|
| 114 | by Anton Haumer<br> implemented<br>
|
|---|
| 115 | </li>
|
|---|
| 116 | </ul>
|
|---|
| 117 | </html>"),
|
|---|
| 118 | __OpenModelica_commandLineOptions = "");
|
|---|
| 119 | end RMS;
|
|---|
| 120 |
|
|---|
| 121 | model DWToI "Delta Omega to I"
|
|---|
| 122 | // follows eq. 12.13 from FEPE Book
|
|---|
| 123 | parameter Modelica.SIunits.Resistance Rr "rotor resistance in stato units";
|
|---|
| 124 | parameter Integer pp "pole pairs";
|
|---|
| 125 | parameter Real Kw "constant Komega of FEPE Book";
|
|---|
| 126 | parameter Modelica.SIunits.Current iMax "maximum calue of rms current";
|
|---|
| 127 | parameter Modelica.SIunits.Inductance Lstray "combined stray inductance";
|
|---|
| 128 | Modelica.SIunits.Current I "current before limitation";
|
|---|
| 129 | Modelica.Blocks.Interfaces.RealInput u annotation (
|
|---|
| 130 | Placement(transformation(extent = {{-140, -20}, {-100, 20}})));
|
|---|
| 131 | Modelica.Blocks.Interfaces.RealOutput y annotation (
|
|---|
| 132 | Placement(transformation(extent = {{100, -10}, {120, 10}})));
|
|---|
| 133 | Modelica.Blocks.Sources.RealExpression I_(y = I) annotation (
|
|---|
| 134 | Placement(transformation(extent = {{-10, -10}, {10, 10}})));
|
|---|
| 135 | Modelica.Blocks.Nonlinear.Limiter limiter(uMax = iMax, uMin = 0) annotation (
|
|---|
| 136 | Placement(transformation(extent = {{42, -10}, {62, 10}})));
|
|---|
| 137 | equation
|
|---|
| 138 | I = sqrt(u ^ 2 * Kw ^ 2 / ((pp * u * Lstray) ^ 2 + Rr ^ 2));
|
|---|
| 139 | connect(I_.y, limiter.u) annotation (
|
|---|
| 140 | Line(points = {{11, 0}, {26, 0}, {40, 0}}, color = {0, 0, 127}));
|
|---|
| 141 | connect(y, limiter.y) annotation (
|
|---|
| 142 | Line(points = {{110, 0}, {86, 0}, {63, 0}}, color = {0, 0, 127}));
|
|---|
| 143 | annotation (
|
|---|
| 144 | Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -40}, {100, 40}})),
|
|---|
| 145 | Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics={ Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 127}, fillColor = {255, 255, 255},
|
|---|
| 146 | fillPattern = FillPattern.Solid), Line(points = {{-62, -62}, {-62, 64}}, color = {0, 0, 127}, smooth = Smooth.None), Line(points = {{-70, 54}, {-62, 66}, {-56, 54}}, color = {0, 0, 127}, smooth = Smooth.None), Line(points = {{-76, -54}, {68, -54}}, color = {0, 0, 127}, smooth = Smooth.None), Line(points = {{-7, -6}, {1, 6}, {7, -6}}, color = {0, 0, 127}, smooth = Smooth.None, origin = {65, -54}, rotation = 270), Line(points = {{-68, -62}, {2, 28}, {54, 28}}, color = {0, 0, 127}, smooth = Smooth.None), Text(extent = {{-50, 68}, {-14, 40}}, lineColor = {0, 0, 127}, textString = "I"), Line(points = {{-69, 27}, {-53, 27}}, color = {0, 0, 127}, smooth = Smooth.None), Text(extent = {{-100, 144}, {98, 106}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255},
|
|---|
| 147 | fillPattern = FillPattern.Solid, textString = "%name")}),
|
|---|
| 148 | version = "",
|
|---|
| 149 | uses,
|
|---|
| 150 | __OpenModelica_commandLineOptions = "");
|
|---|
| 151 | end DWToI;
|
|---|
| 152 |
|
|---|
| 153 | block GenSines "Generates three-phase sine waves"
|
|---|
| 154 | import Modelica.Constants.pi;
|
|---|
| 155 | Modelica.Blocks.Interfaces.RealInput Westar annotation (
|
|---|
| 156 | Placement(transformation(extent = {{-140, 28}, {-100, 68}}), iconTransformation(extent = {{-13, -13}, {13, 13}}, rotation = 0, origin = {-113, 59})));
|
|---|
| 157 | Modelica.Blocks.Interfaces.RealOutput U[3] annotation (
|
|---|
| 158 | Placement(transformation(extent = {{100, -10}, {120, 10}}), iconTransformation(extent = {{100, -10}, {120, 10}})));
|
|---|
| 159 | Modelica.Blocks.Interfaces.RealInput Ustar "RMS phase" annotation (
|
|---|
| 160 | Placement(transformation(extent = {{-140, -60}, {-100, -20}}), iconTransformation(extent = {{-13, -13}, {13, 13}}, rotation = 0, origin = {-113, -59})));
|
|---|
| 161 | Modelica.Blocks.Math.Add add1[3] annotation (
|
|---|
| 162 | Placement(transformation(extent = {{0, 38}, {20, 58}})));
|
|---|
| 163 | Modelica.Blocks.Math.Sin sin[3] annotation (
|
|---|
| 164 | Placement(transformation(extent = {{34, 38}, {54, 58}})));
|
|---|
| 165 | Modelica.Blocks.Continuous.Integrator integrator annotation (
|
|---|
| 166 | Placement(transformation(extent = {{-72, 38}, {-52, 58}})));
|
|---|
| 167 | Modelica.Blocks.Routing.Replicator replicator(nout = 3) annotation (
|
|---|
| 168 | Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {60, 8})));
|
|---|
| 169 | Modelica.Blocks.Math.Product product[3] annotation (
|
|---|
| 170 | Placement(transformation(extent = {{72, 28}, {92, 48}})));
|
|---|
| 171 | Modelica.Blocks.Math.Gain ToPeak(k = sqrt(2)) annotation (
|
|---|
| 172 | Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {60, -22})));
|
|---|
| 173 | Modelica.Blocks.Sources.Constant phase[3](k = 2 * pi / 3 * {0, -1, 1}) annotation (
|
|---|
| 174 | Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {-10, 8})));
|
|---|
| 175 | Modelica.Blocks.Routing.Replicator replicator1(nout = 3) annotation (
|
|---|
| 176 | Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0, origin = {-30, 48})));
|
|---|
| 177 | equation
|
|---|
| 178 | connect(sin.u, add1.y) annotation (
|
|---|
| 179 | Line(points = {{32, 48}, {21, 48}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 180 | connect(product.y, U) annotation (
|
|---|
| 181 | Line(points = {{93, 38}, {102, 38}, {102, 0}, {110, 0}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 182 | connect(product.u2, replicator.y) annotation (
|
|---|
| 183 | Line(points = {{70, 32}, {60, 32}, {60, 19}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 184 | connect(ToPeak.y, replicator.u) annotation (
|
|---|
| 185 | Line(points = {{60, -11}, {60, -4}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 186 | connect(sin.y, product.u1) annotation (
|
|---|
| 187 | Line(points = {{55, 48}, {62, 48}, {62, 44}, {70, 44}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 188 | connect(add1.u1, replicator1.y) annotation (
|
|---|
| 189 | Line(points = {{-2, 54}, {-10, 54}, {-10, 48}, {-19, 48}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 190 | connect(add1.u2, phase.y) annotation (
|
|---|
| 191 | Line(points = {{-2, 42}, {-10, 42}, {-10, 19}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 192 | connect(replicator1.u, integrator.y) annotation (
|
|---|
| 193 | Line(points = {{-42, 48}, {-51, 48}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 194 | connect(integrator.u, Westar) annotation (
|
|---|
| 195 | Line(points = {{-74, 48}, {-82, 48}, {-88, 48}, {-120, 48}}, color = {0, 0, 127}));
|
|---|
| 196 | connect(ToPeak.u, Ustar) annotation (
|
|---|
| 197 | Line(points = {{60, -34}, {60, -34}, {60, -40}, {-120, -40}}, color = {0, 0, 127}));
|
|---|
| 198 | annotation (
|
|---|
| 199 | Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -80}, {100, 80}})),
|
|---|
| 200 | Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics={ Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 127}, fillColor = {255, 255, 255},
|
|---|
| 201 | fillPattern = FillPattern.Solid), Text(extent = {{-100, 144}, {98, 106}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255},
|
|---|
| 202 | fillPattern = FillPattern.Solid, textString = "%name"), Line(points = {{-4, 28}, {8, 48}, {28, 48}, {48, 8}, {70, 8}, {82, 28}}, color = {0, 0, 0}), Line(points = {{-6, 4}, {6, 24}, {26, 24}, {46, -16}, {68, -16}, {80, 4}}, color = {0, 0, 0}), Line(points = {{-8, -16}, {4, 4}, {24, 4}, {44, -36}, {66, -36}, {78, -16}}, color = {0, 0, 0}), Rectangle(extent = {{-88, 10}, {-60, -4}}, lineColor = {0, 0, 0}), Polygon(points = {{-60, 18}, {-34, 4}, {-60, -10}, {-60, 18}}, lineColor = {0, 0, 0})}),
|
|---|
| 203 | Documentation(info = "<html>
|
|---|
| 204 | <p>This class produces a three-phase voltage system to variable-frequency control of an asynchronous motor.</p>
|
|---|
| 205 | <p>The output voltages constitute a three-phase system of quasi-sinusoidal shapes, created according to the following equations:</p>
|
|---|
| 206 | <p>Wel=Wmecc*PolePairs+DeltaWel</p>
|
|---|
| 207 | <p>U=U0+(Un-U0)*(Wel)/Wnom</p>
|
|---|
| 208 | <p>where:</p>
|
|---|
| 209 | <p><ul>
|
|---|
| 210 | <li>U0, Un U, are initial, nominal actual voltage amplitudes</li>
|
|---|
| 211 | <li>Wmecc, Wel are machine (mechanical) and supply (electrical) angular speeds</li>
|
|---|
| 212 | <li>PolePairs are the number of machine pole pairs</li>
|
|---|
| 213 | <li>DeltaWel is an input variable and depends on the desired torque</li>
|
|---|
| 214 | </ul></p>
|
|---|
| 215 | </html>"));
|
|---|
| 216 | end GenSines;
|
|---|
| 217 |
|
|---|
| 218 | block ControlLogic "Follows upper fig. 12.15 from FEPE Book"
|
|---|
| 219 | import Modelica.Constants.pi;
|
|---|
| 220 | parameter Modelica.SIunits.Resistance Rr(start = 0.04) "Rotor resistance";
|
|---|
| 221 | parameter Modelica.SIunits.Resistance Rs(start = 0.03) "Stator resistance";
|
|---|
| 222 | parameter Modelica.SIunits.Voltage uBase(start = 400) "Base phase-to-phase RMS voltage";
|
|---|
| 223 | parameter Modelica.SIunits.Current iMax(start = 150) "Maximum value of RMS current";
|
|---|
| 224 | parameter Modelica.SIunits.AngularVelocity weBase = 314.16 "Base electric frequency";
|
|---|
| 225 | parameter Modelica.SIunits.Inductance Lstray(start = 0.2036 / weBase) "Combined stray inductance";
|
|---|
| 226 | parameter Modelica.SIunits.AngularVelocity wmMax = 314.16 "Maximum mechanical Speed";
|
|---|
| 227 | parameter Integer pp(min = 1, start = 2) "number of pole pairs (Integer)";
|
|---|
| 228 | //La seguente keyword final consente fra l'altro di far scomparire questi parametri dalla maschera.
|
|---|
| 229 | final parameter Real Kw(fixed = true) = uBase / sqrt(3) / (weBase / pp) "Ratio U/Wmecc";
|
|---|
| 230 | Modelica.Blocks.Interfaces.RealInput Wm annotation (
|
|---|
| 231 | Placement(transformation(extent = {{-160, -80}, {-120, -40}}), iconTransformation(extent = {{-13, -13}, {13, 13}}, rotation = 90, origin = {1, -113})));
|
|---|
| 232 | Modelica.Blocks.Interfaces.RealOutput Ustar annotation (
|
|---|
| 233 | Placement(transformation(extent = {{120, -50}, {140, -30}}), iconTransformation(extent = {{100, -70}, {120, -50}})));
|
|---|
| 234 | Modelica.Blocks.Interfaces.RealInput Tstar annotation (
|
|---|
| 235 | Placement(transformation(extent = {{-160, 40}, {-120, 80}}), iconTransformation(extent = {{-13, -13}, {13, 13}}, rotation = 0, origin = {-113, -1})));
|
|---|
| 236 | Modelica.Blocks.Math.Add add annotation (
|
|---|
| 237 | Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {-38, 56})));
|
|---|
| 238 | Modelica.Blocks.Nonlinear.Limiter limWm(limitsAtInit = true, uMax = wmMax, uMin = uBase / sqrt(3) / 100 / Kw) annotation (
|
|---|
| 239 | Placement(transformation(extent = {{0, 50}, {20, 70}})));
|
|---|
| 240 | Modelica.Blocks.Interfaces.RealOutput Westar annotation (
|
|---|
| 241 | Placement(transformation(extent = {{120, 50}, {140, 70}}), iconTransformation(extent = {{100, 50}, {120, 70}})));
|
|---|
| 242 | stAsmaPkg1819.Support.TorqueToDW tauToDW(Rr = Rr, pp = pp, Kw = Kw, Lstray = Lstray, wmBase = weBase / pp) annotation (
|
|---|
| 243 | Placement(transformation(extent = {{-100, 50}, {-80, 70}})));
|
|---|
| 244 | Modelica.Blocks.Math.Gain gain(k = pp) annotation (
|
|---|
| 245 | Placement(transformation(extent = {{62, 50}, {82, 70}})));
|
|---|
| 246 | Modelica.Blocks.Math.Add add1(k1 = Rs, k2 = Kw) annotation (
|
|---|
| 247 | Placement(transformation(extent = {{40, 10}, {60, -10}})));
|
|---|
| 248 | Modelica.Blocks.Nonlinear.Limiter limU(uMax = uBase / sqrt(3), uMin = 0) annotation (
|
|---|
| 249 | Placement(transformation(extent = {{76, -10}, {96, 10}})));
|
|---|
| 250 | Modelica.Blocks.Logical.GreaterThreshold toWeakening(threshold = limU.uMax) annotation (
|
|---|
| 251 | Placement(visible = true, transformation(origin = {66, -36}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
|
|---|
| 252 | Modelica.Blocks.Logical.GreaterThreshold toMaxSpeed(threshold = limWm.uMax) annotation (
|
|---|
| 253 | Placement(visible = true, transformation(origin = {-10, 28}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
|
|---|
| 254 | Modelica.Blocks.Sources.RealExpression toIstar(y = sqrt(Tstar * tauToDW.y / (3 * Rs))) annotation (
|
|---|
| 255 | Placement(transformation(extent = {{-30, -18}, {8, 0}})));
|
|---|
| 256 | equation
|
|---|
| 257 | connect(toMaxSpeed.u, limWm.u) annotation (
|
|---|
| 258 | Line(points = {{-10, 40}, {-10, 40}, {-10, 60}, {-2, 60}, {-2, 60}, {-2, 60}}, color = {0, 0, 127}));
|
|---|
| 259 | connect(limWm.u, add.y) annotation (
|
|---|
| 260 | Line(points = {{-2, 60}, {-12, 60}, {-12, 72}, {-38, 72}, {-38, 67}}, color = {0, 0, 127}, smooth = Smooth.None));
|
|---|
| 261 | connect(Tstar, tauToDW.u) annotation (
|
|---|
| 262 | Line(points = {{-140, 60}, {-122, 60}, {-122, 66}, {-102, 66}}, color = {0, 0, 127}));
|
|---|
| 263 | connect(tauToDW.y, add.u1) annotation (
|
|---|
| 264 | Line(points = {{-79, 60}, {-79, 60}, {-74, 60}, {-74, 44}, {-44, 44}}, color = {0, 0, 127}));
|
|---|
| 265 | connect(add.u2, Wm) annotation (
|
|---|
| 266 | Line(points = {{-32, 44}, {-32, 44}, {-32, 14}, {-110, 14}, {-110, -18}, {-110, -18}, {-110, -60}, {-140, -60}}, color = {0, 0, 127}));
|
|---|
| 267 | connect(Westar, gain.y) annotation (
|
|---|
| 268 | Line(points = {{130, 60}, {106, 60}, {83, 60}}, color = {0, 0, 127}));
|
|---|
| 269 | connect(gain.u, limWm.y) annotation (
|
|---|
| 270 | Line(points = {{60, 60}, {50, 60}, {20, 60}, {21, 60}}, color = {0, 0, 127}));
|
|---|
| 271 | connect(add1.y, limU.u) annotation (
|
|---|
| 272 | Line(points = {{61, 0}, {74, 0}}, color = {0, 0, 127}));
|
|---|
| 273 | connect(limU.y, Ustar) annotation (
|
|---|
| 274 | Line(points = {{97, 0}, {102, 0}, {102, -40}, {130, -40}}, color = {0, 0, 127}));
|
|---|
| 275 | connect(tauToDW.Wm, Wm) annotation (
|
|---|
| 276 | Line(points = {{-102, 54}, {-110, 54}, {-110, -60}, {-140, -60}}, color = {0, 0, 127}));
|
|---|
| 277 | connect(add1.u2, limWm.y) annotation (
|
|---|
| 278 | Line(points = {{38, 6}, {34, 6}, {34, 60}, {21, 60}}, color = {0, 0, 127}));
|
|---|
| 279 | connect(toWeakening.u, limU.u) annotation (
|
|---|
| 280 | Line(points = {{66, -24}, {66, 0}, {74, 0}}, color = {0, 0, 127}));
|
|---|
| 281 | connect(toIstar.y, add1.u1) annotation (
|
|---|
| 282 | Line(points = {{9.9, -9}, {22, -9}, {22, -6}, {38, -6}}, color = {0, 0, 127}));
|
|---|
| 283 | annotation (
|
|---|
| 284 | Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-120, -80}, {120, 80}}, initialScale = 0.1), graphics={ Text(origin = {2, 0}, lineColor = {28, 108, 200}, extent = {{-48, -12}, {18, -22}}, textString = "E' la prima uguaglianza di 12.14 di FEPE")}),
|
|---|
| 285 | Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics={ Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 127}, fillColor = {255, 255, 255},
|
|---|
| 286 | fillPattern = FillPattern.Solid), Line(points = {{-40, -50}, {-40, 76}}, color = {0, 0, 127}, smooth = Smooth.None), Line(points = {{-48, 66}, {-40, 78}, {-34, 66}}, color = {0, 0, 127}, smooth = Smooth.None), Line(points = {{-54, -42}, {90, -42}}, color = {0, 0, 127}, smooth = Smooth.None), Line(points = {{-7, -6}, {1, 6}, {7, -6}}, color = {0, 0, 127}, smooth = Smooth.None, origin = {87, -42}, rotation = 270), Line(points = {{-46, -28}, {24, 40}, {76, 40}}, color = {0, 0, 127}, smooth = Smooth.None), Line(points = {{-47, -23}, {-31, -23}}, color = {0, 0, 127}, smooth = Smooth.None), Text(extent = {{-82, -6}, {-51, -34}}, lineColor = {0, 0, 127}, textString = "Uo"), Text(extent = {{-84, 54}, {-48, 26}}, lineColor = {0, 0, 127}, textString = "Un"), Line(points = {{-47, 39}, {-31, 39}}, color = {0, 0, 127}, smooth = Smooth.None), Text(extent = {{9, -47}, {52, -78}}, lineColor = {0, 0, 127}, textString = "Wn"), Line(points = {{26, -14}, {26, -46}, {26, -36}}, color = {0, 0, 127}, smooth = Smooth.None), Text(extent = {{-100, 144}, {98, 106}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255},
|
|---|
| 287 | fillPattern = FillPattern.Solid, textString = "%name")}),
|
|---|
| 288 | Documentation(info = "<html>
|
|---|
| 289 | <p>This class produces a three-phase voltage system to variable-frequency control of an asynchronous motor.</p>
|
|---|
| 290 | <p>The output voltages constitute a three-phase system of quasi-sinusoidal shapes, created according to the following equations:</p>
|
|---|
| 291 | <p>Wel=Wmecc*PolePairs+DeltaWel</p>
|
|---|
| 292 | <p>U=U0+(Un-U0)*(Wel)/Wnom</p>
|
|---|
| 293 | <p>where:</p>
|
|---|
| 294 | <p><ul>
|
|---|
| 295 | <li>U0, Un U, are initial, nominal actual voltage amplitudes</li>
|
|---|
| 296 | <li>Wmecc, Wel are machine (mechanical) and supply (electrical) angular speeds</li>
|
|---|
| 297 | <li>PolePairs are the number of machine pole pairs</li>
|
|---|
| 298 | <li>DeltaWel is an input variable and depends on the desired torque</li>
|
|---|
| 299 | </ul></p>
|
|---|
| 300 | </html>"),
|
|---|
| 301 | experiment(StopTime = 500, Interval = 0.1));
|
|---|
| 302 | end ControlLogic;
|
|---|
| 303 |
|
|---|
| 304 | model TorqueToDW "Torque to Delta Omega"
|
|---|
| 305 | parameter Modelica.SIunits.Resistance Rr "Rotor resistance in stato units";
|
|---|
| 306 | parameter Integer pp "Pole pairs";
|
|---|
| 307 | parameter Real Kw "Constant Komega of FEPE Book";
|
|---|
| 308 | parameter Modelica.SIunits.AngularVelocity wmBase = 314.16 "Base electric frequency";
|
|---|
| 309 | parameter Modelica.SIunits.Inductance Lstray "Combined stray inductance";
|
|---|
| 310 | //The following is 12.11 of FEPE book, when U1=Kw*W (LS stands for low speed)
|
|---|
| 311 | Modelica.SIunits.Torque Tmax;
|
|---|
| 312 | public
|
|---|
| 313 | Modelica.Blocks.Interfaces.RealInput u annotation (
|
|---|
| 314 | Placement(transformation(extent = {{-140, 40}, {-100, 80}})));
|
|---|
| 315 | Modelica.Blocks.Interfaces.RealOutput y annotation (
|
|---|
| 316 | Placement(transformation(extent = {{100, -10}, {120, 10}})));
|
|---|
| 317 | Modelica.Blocks.Interfaces.RealInput Wm annotation (
|
|---|
| 318 | Placement(transformation(extent = {{-140, -80}, {-100, -40}})));
|
|---|
| 319 | Modelica.Blocks.Interfaces.BooleanOutput tauIsMax annotation (
|
|---|
| 320 | Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = -90, origin = {0, -110})));
|
|---|
| 321 | equation
|
|---|
| 322 | if Wm < wmBase then
|
|---|
| 323 | Tmax = 3 * Kw ^ 2 / (2 * pp * Lstray);
|
|---|
| 324 | else
|
|---|
| 325 | //The following is 12.11 of FEPE book
|
|---|
| 326 | Tmax = 3 * (Kw * wmBase) ^ 2 / (2 * pp * Wm ^ 2 * Lstray);
|
|---|
| 327 | end if;
|
|---|
| 328 | //Se la coppia richiesta supera la massima mi attesto al deltaW
|
|---|
| 329 | //che corrisponde al picco di coppia
|
|---|
| 330 | if u > Tmax then
|
|---|
| 331 | Tmax = 3 * Rr * y * Kw ^ 2 / ((pp * y * Lstray) ^ 2 + Rr ^ 2);
|
|---|
| 332 | // y = Rr / (pp*Lstray);
|
|---|
| 333 | tauIsMax = true;
|
|---|
| 334 | elseif u < (-Tmax) then
|
|---|
| 335 | -Tmax = 3 * Rr * y * Kw ^ 2 / ((pp * y * Lstray) ^ 2 + Rr ^ 2);
|
|---|
| 336 | // y = -Rr / (pp * Lstray);
|
|---|
| 337 | tauIsMax = true;
|
|---|
| 338 | else
|
|---|
| 339 | /* La seguente riga è eq. 12.14 di FEPE Book. Naturalmente essa
|
|---|
| 340 | determina una richiesta di coppia corretta a pieno flusso, zona nella quale
|
|---|
| 341 | vale la 12.14, mentre è approssimata in deflussaggio. Peraltro essendo
|
|---|
| 342 | normalmente il controllo in velocità in retroazione, in questo modello
|
|---|
| 343 | semplificato si accetta questo tipo di delta_omega, che determina una
|
|---|
| 344 | potenza decrescente invece che costante come potrebbe essere.
|
|---|
| 345 | */
|
|---|
| 346 | u = 3 * Rr * y * Kw ^ 2 / ((pp * y * Lstray) ^ 2 + Rr ^ 2);
|
|---|
| 347 | /* Si potrebbe completare il controllo facendo in modo che al di sopra della
|
|---|
| 348 | velocità base si applichi la formula 12.10 di FEPE in cui U1=Kw*wmBase.
|
|---|
| 349 | Al posto di W0 si può mettere Wm+y.
|
|---|
| 350 | Le formule si complicano e quindi per ragioni didattiche non lo facciamo.
|
|---|
| 351 |
|
|---|
| 352 | Si riporta comunque qui sotto un'implementazione provvisoria con coppia
|
|---|
| 353 | valida in tutte le regioni, da ultimare e verificare:
|
|---|
| 354 | */
|
|---|
| 355 | //u=3*(Kw*wmBase)^2*Rr*y/(y^2*pp^2*(Wm+y)^2*Lstray^2+Rr^2*(Wm+y));
|
|---|
| 356 | tauIsMax = false;
|
|---|
| 357 | end if;
|
|---|
| 358 | annotation (
|
|---|
| 359 | Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}})),
|
|---|
| 360 | Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics={ Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 127}, fillColor = {255, 255, 255},
|
|---|
| 361 | fillPattern = FillPattern.Solid), Text(extent = {{-100, 144}, {98, 106}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255},
|
|---|
| 362 | fillPattern = FillPattern.Solid, textString = "%name"), Line(points = {{-67, -26}, {-51, -26}, {-51, -22}, {-49, -15}, {-40, -8}, {18, 25}, {26, 32}, {29, 37}, {29, 42}, {49, 42}}, color = {0, 0, 127}, smooth = Smooth.None), Line(points = {{-66, 8}, {78, 8}}, color = {0, 0, 127}, smooth = Smooth.None), Line(points = {{-12, -44}, {-12, 82}}, color = {0, 0, 127}, smooth = Smooth.None), Line(points = {{-20, 72}, {-12, 84}, {-6, 72}}, color = {0, 0, 127}, smooth = Smooth.None), Text(extent = {{16, 72}, {52, 44}}, lineColor = {0, 0, 127}, textString = "DW"), Line(points = {{-7, -6}, {1, 6}, {7, -6}}, color = {0, 0, 127}, smooth = Smooth.None, origin = {75, 8}, rotation = 270), Text(extent = {{60, -6}, {96, -34}}, lineColor = {0, 0, 127}, textString = "T")}));
|
|---|
| 363 | end TorqueToDW;
|
|---|
| 364 | end Support;
|
|---|
| 365 | annotation (
|
|---|
| 366 | uses(Modelica(version = "3.2.2")),
|
|---|
| 367 | Documentation(info = "<html>
|
|---|
| 368 | <p>Package to simulate asynchronous-machine behaviour, mainly evaluated on start-ups.</p>
|
|---|
| 369 | <p>It contains a Drives subpackage, which illustrates advantage and performance of U/f asma-based drives.</p>
|
|---|
| 370 | <p><br>Drives are fist used with time-domain ASMA models. Then it is seen that for drives Phasor ASMA models are adequate, then they are used.</p>
|
|---|
| 371 | </html>"));
|
|---|
| 372 | end stAsmaPkg1819;
|
|---|