| 1 | within ;
|
|---|
| 2 | package EHPT "Electric and Hybrid Power train library"
|
|---|
| 3 | //package Propulsion
|
|---|
| 4 | extends Modelica.Icons.Package;
|
|---|
| 5 | //end Propulsion;
|
|---|
| 6 |
|
|---|
| 7 | package MapBased
|
|---|
| 8 | "Contains map-based models of Internal combustion engines and electric drives"
|
|---|
| 9 | extends Modelica.Icons.Package;
|
|---|
| 10 |
|
|---|
| 11 | class Information
|
|---|
| 12 | extends Modelica.Icons.Information;
|
|---|
| 13 | annotation (Documentation(info="<html>
|
|---|
| 14 | <p>The map-based folder contains simple model whose only dynamics is due to their mechanical inertia.</p>
|
|---|
| 15 | <p>The ice model, since implemnts an Internal Combustion Engine, can deliber power, but never absorbs, while the other, two ("oneFlange" and "twoFlange") simulate electric drive trains, i.e. the assembly of an electric machine and the corresponding ACDC converter, can absorb or deliver.</p>
|
|---|
| 16 | <p>The input torque of the ice model is in Newton-metres, whil e in the other cases it is normalised: it is between -1 and +1, where -1 means maximum available torque to be absorbed, +1 to be delivered.</p>
|
|---|
| 17 | <p>All the models come in two versions:</p>
|
|---|
| 18 | <ul>
|
|---|
| 19 | <li>version without "Conn" in the name: they get the input signals from a Real input connector. The input signal indicates a torque request.</li>
|
|---|
| 20 | <li>version with "Conn" in the name: they exchange several quantities through an expandable connector.</li>
|
|---|
| 21 | </ul>
|
|---|
| 22 | <p><br><u>Names and meaning </u>of the pre-defined quantities circulating through the connection bus in the model versions having "Conn" in their names.</p>
|
|---|
| 23 | <p>All the names are composed by two or three parts. The first one indicates the component to which the variable refers, (for instance "ice") the central one which kind of variable it is (for instance "tau" means torque), finally the(optional) third part indicates info about de variable for instance "del" means delivered, i.e.for a power a positivive value indicates that the power is delivered to the outside by the component the variable belongs to, the opposite happens when the third part of the name in "abs" (stands for absorbed). Another exmple is "Norm": this third part of a name indicates that the correspondng quantity is normalised (see above in this info).</p>
|
|---|
| 24 | <p><br><u>Full list</u> of the variables defined or used in the component of the MAP-based folder (other names that are used in the bus in the FullVehicle Examples, will be discussed in the examples themselves):</p>
|
|---|
| 25 | <table cellspacing=\"0\" cellpadding=\"0\" border=\"1\"><tr>
|
|---|
| 26 | <td valign=\"top\"><p><br><i>Nome</i> </p></td>
|
|---|
| 27 | <td valign=\"top\"><p>sender </p></td>
|
|---|
| 28 | <td valign=\"top\"><p>users </p></td>
|
|---|
| 29 | <td valign=\"top\"><p>comment</p></td>
|
|---|
| 30 | </tr>
|
|---|
| 31 | <tr>
|
|---|
| 32 | <td valign=\"top\"><p>iceTauRef </p></td>
|
|---|
| 33 | <td valign=\"top\"></td>
|
|---|
| 34 | <td valign=\"top\"><p><br>Ice</p></td>
|
|---|
| 35 | <td valign=\"top\"><p>torque reference sent to ice through Conn (Nm)</p></td>
|
|---|
| 36 | </tr>
|
|---|
| 37 | <tr>
|
|---|
| 38 | <td valign=\"top\"><p>icePowDel</p></td>
|
|---|
| 39 | <td valign=\"top\"><p>Ice</p></td>
|
|---|
| 40 | <td valign=\"top\"><p> </p></td>
|
|---|
| 41 | <td valign=\"top\"><p>the mechanical power the ice delivers</p></td>
|
|---|
| 42 | </tr>
|
|---|
| 43 | <tr>
|
|---|
| 44 | <td valign=\"top\"><p>iceW</p></td>
|
|---|
| 45 | <td valign=\"top\"><p>Ice</p></td>
|
|---|
| 46 | <td valign=\"top\"></td>
|
|---|
| 47 | <td valign=\"top\"><p><br>ice rotational speed (rad/s)</p></td>
|
|---|
| 48 | </tr>
|
|---|
| 49 | <tr>
|
|---|
| 50 | <td valign=\"top\"><p>genTauNorm</p></td>
|
|---|
| 51 | <td valign=\"top\"></td>
|
|---|
| 52 | <td valign=\"top\"><p><br>OneFlange</p></td>
|
|---|
| 53 | <td valign=\"top\"><p>normalised torque OneFlange must deliver</p><p>It is used in examples in which OneFlange Instance is called "gen"</p></td>
|
|---|
| 54 | </tr>
|
|---|
| 55 | <tr>
|
|---|
| 56 | <td valign=\"top\"><p>genTauLim</p></td>
|
|---|
| 57 | <td valign=\"top\"><p>OneFlange</p></td>
|
|---|
| 58 | <td valign=\"top\"></td>
|
|---|
| 59 | <td valign=\"top\"><p><br>maximum (limit) torque OneFlance must deliver</p><p><br>It is used in examples in which OneFlange Instance is called "gen"</p></td>
|
|---|
| 60 | </tr>
|
|---|
| 61 | <tr>
|
|---|
| 62 | <td valign=\"top\"></td>
|
|---|
| 63 | <td valign=\"top\"></td>
|
|---|
| 64 | <td valign=\"top\"></td>
|
|---|
| 65 | <td valign=\"top\"></td>
|
|---|
| 66 | </tr>
|
|---|
| 67 | <tr>
|
|---|
| 68 | <td valign=\"top\"></td>
|
|---|
| 69 | <td valign=\"top\"></td>
|
|---|
| 70 | <td valign=\"top\"></td>
|
|---|
| 71 | <td valign=\"top\"></td>
|
|---|
| 72 | </tr>
|
|---|
| 73 | <tr>
|
|---|
| 74 | <td valign=\"top\"></td>
|
|---|
| 75 | <td valign=\"top\"></td>
|
|---|
| 76 | <td valign=\"top\"></td>
|
|---|
| 77 | <td valign=\"top\"></td>
|
|---|
| 78 | </tr>
|
|---|
| 79 | <tr>
|
|---|
| 80 | <td valign=\"top\"></td>
|
|---|
| 81 | <td valign=\"top\"></td>
|
|---|
| 82 | <td valign=\"top\"></td>
|
|---|
| 83 | <td valign=\"top\"></td>
|
|---|
| 84 | </tr>
|
|---|
| 85 | <tr>
|
|---|
| 86 | <td valign=\"top\"></td>
|
|---|
| 87 | <td valign=\"top\"></td>
|
|---|
| 88 | <td valign=\"top\"></td>
|
|---|
| 89 | <td valign=\"top\"></td>
|
|---|
| 90 | </tr>
|
|---|
| 91 | <tr>
|
|---|
| 92 | <td valign=\"top\"></td>
|
|---|
| 93 | <td valign=\"top\"></td>
|
|---|
| 94 | <td valign=\"top\"></td>
|
|---|
| 95 | <td valign=\"top\"></td>
|
|---|
| 96 | </tr>
|
|---|
| 97 | <tr>
|
|---|
| 98 | <td valign=\"top\"></td>
|
|---|
| 99 | <td valign=\"top\"></td>
|
|---|
| 100 | <td valign=\"top\"></td>
|
|---|
| 101 | <td valign=\"top\"></td>
|
|---|
| 102 | </tr>
|
|---|
| 103 | </table>
|
|---|
| 104 | </html>"), uses(Modelica(version="3.2.1")));
|
|---|
| 105 | end Information;
|
|---|
| 106 |
|
|---|
| 107 | model MBice "Simple map-based ice model with connector"
|
|---|
| 108 | import Modelica.Constants.*;
|
|---|
| 109 | extends Partial.PartialMBice;
|
|---|
| 110 | parameter Real wIceStart=167;
|
|---|
| 111 | // rad/s
|
|---|
| 112 | Modelica.Blocks.Interfaces.RealInput tauRef
|
|---|
| 113 | "Maximum allowed ICE torque by power train limitations" annotation (
|
|---|
| 114 | Placement(transformation(
|
|---|
| 115 | extent={{-20,-20},{20,20}},
|
|---|
| 116 | rotation=90,
|
|---|
| 117 | origin={-60,-100}), iconTransformation(
|
|---|
| 118 | extent={{-20,-20},{20,20}},
|
|---|
| 119 | rotation=90,
|
|---|
| 120 | origin={-60,-100})));
|
|---|
| 121 | Modelica.Blocks.Interfaces.RealOutput fuelCons "Fuel consumption (g/h)"
|
|---|
| 122 | annotation (Placement(transformation(
|
|---|
| 123 | extent={{-10,-10},{10,10}},
|
|---|
| 124 | rotation=-90,
|
|---|
| 125 | origin={60,-90})));
|
|---|
| 126 | Modelica.Blocks.Nonlinear.Limiter limiter(uMin=0, uMax=1e99) annotation (
|
|---|
| 127 | Placement(transformation(
|
|---|
| 128 | extent={{-10,-10},{10,10}},
|
|---|
| 129 | rotation=90,
|
|---|
| 130 | origin={-60,-16})));
|
|---|
| 131 | equation
|
|---|
| 132 | connect(toG_perHour.y, fuelCons) annotation (Line(
|
|---|
| 133 | points={{26,-57},{26,-57},{26,-64},{60,-64},{60,-90}},
|
|---|
| 134 | color={0,0,127},
|
|---|
| 135 | smooth=Smooth.None));
|
|---|
| 136 | connect(limiter.y, min1.u2) annotation (Line(
|
|---|
| 137 | points={{-60,-5},{-60,54},{-50,54}},
|
|---|
| 138 | color={0,0,127},
|
|---|
| 139 | smooth=Smooth.None));
|
|---|
| 140 | connect(limiter.u, tauRef) annotation (Line(
|
|---|
| 141 | points={{-60,-28},{-60,-100}},
|
|---|
| 142 | color={0,0,127},
|
|---|
| 143 | smooth=Smooth.None));
|
|---|
| 144 | annotation (
|
|---|
| 145 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-80},
|
|---|
| 146 | {100,80}}), graphics),
|
|---|
| 147 | experiment(
|
|---|
| 148 | StopTime=200,
|
|---|
| 149 | __Dymola_NumberOfIntervals=1000,
|
|---|
| 150 | __Dymola_Algorithm="Lsodar"),
|
|---|
| 151 | __Dymola_experimentSetupOutput,
|
|---|
| 152 | Documentation(info="<html>
|
|---|
| 153 | <p>This model belongs to the map-based models of power train components.</p>
|
|---|
| 154 | <p>It models an Internal Combustion Engine, neglecting any dynamics except that related with its rotor inertia.</p>
|
|---|
| 155 | <p>The input signal is the torque request (Nm). </p>
|
|---|
| 156 | <p>The generated torque is the minimum between this signal (negative values are transformed to 0) and the maximum deliverable torque at the actual engine speed, defined by means of a table.</p>
|
|---|
| 157 | <p>From the generated torque and speed the fuel consumption is computed.</p>
|
|---|
| 158 | </html>"),
|
|---|
| 159 | Icon(coordinateSystem(
|
|---|
| 160 | extent={{-100,-100},{100,100}},
|
|---|
| 161 | preserveAspectRatio=false,
|
|---|
| 162 | initialScale=0.1,
|
|---|
| 163 | grid={2,2}), graphics));
|
|---|
| 164 | end MBice;
|
|---|
| 165 |
|
|---|
| 166 | model MBOneFlange "Simple map-based model of an electric drive"
|
|---|
| 167 | extends Partial.PartialMBOneFlange;
|
|---|
| 168 | Modelica.Blocks.Interfaces.RealInput tauRef annotation (Placement(
|
|---|
| 169 | transformation(
|
|---|
| 170 | extent={{-20,-20},{20,20}},
|
|---|
| 171 | rotation=90,
|
|---|
| 172 | origin={0,-88}), iconTransformation(
|
|---|
| 173 | extent={{-20,-20},{20,20}},
|
|---|
| 174 | rotation=90,
|
|---|
| 175 | origin={90,-86})));
|
|---|
| 176 | equation
|
|---|
| 177 | connect(createTau.u2, tauRef) annotation (Line(
|
|---|
| 178 | points={{-28,4},{-40,4},{-40,-56},{0,-56},{0,-88}},
|
|---|
| 179 | color={0,0,127},
|
|---|
| 180 | smooth=Smooth.None));
|
|---|
| 181 | annotation (
|
|---|
| 182 | Diagram(coordinateSystem(
|
|---|
| 183 | extent={{-100,-80},{100,80}},
|
|---|
| 184 | preserveAspectRatio=false,
|
|---|
| 185 | initialScale=0.1,
|
|---|
| 186 | grid={2,2}), graphics),
|
|---|
| 187 | Icon(coordinateSystem(
|
|---|
| 188 | extent={{-100,-100},{100,100}},
|
|---|
| 189 | preserveAspectRatio=false,
|
|---|
| 190 | initialScale=0.1,
|
|---|
| 191 | grid={2,2}), graphics={Line(points={{62,-7},{82,-7}}),Rectangle(
|
|---|
| 192 | fillColor={192,192,192},
|
|---|
| 193 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 194 | extent={{52,12},{100,-8}}),Rectangle(extent={{-70,80},{100,-80}}),
|
|---|
| 195 | Line(points={{-98,40},{-70,40}}, color={0,0,255}),Line(points={{-92,
|
|---|
| 196 | -40},{-70,-40}}, color={0,0,255})}),
|
|---|
| 197 | Documentation(info="<html>
|
|---|
| 198 | <p>The input signal is a torque request (Nm).</p>
|
|---|
| 199 | <p>The maximum available torque is internally computed considering a direct torque maximum (tauMax) and a power maximum (powMax) </p>
|
|---|
| 200 | <p>The requested torque is applied to a mechancal inertia. </p>
|
|---|
| 201 | <p>The model then computes the inner losses and absorbs the total power from the DC input.</p>
|
|---|
| 202 | </html>"));
|
|---|
| 203 | end MBOneFlange;
|
|---|
| 204 |
|
|---|
| 205 | model MBTwoFlange "Simple map-based two-flange electric drive model"
|
|---|
| 206 | extends Partial.PartialMBTwoFlange;
|
|---|
| 207 | Modelica.Blocks.Interfaces.RealInput tauRefInt annotation (Placement(
|
|---|
| 208 | transformation(
|
|---|
| 209 | extent={{-20,-20},{20,20}},
|
|---|
| 210 | rotation=90,
|
|---|
| 211 | origin={0,-114})));
|
|---|
| 212 | equation
|
|---|
| 213 | connect(tauRefInt, createTau.u2) annotation (Line(
|
|---|
| 214 | points={{0,-114},{0,-114},{0,-60},{-34,-60},{-34,-10},{-20,-10}},
|
|---|
| 215 | color={0,0,127},
|
|---|
| 216 | smooth=Smooth.None));
|
|---|
| 217 | annotation (
|
|---|
| 218 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
|
|---|
| 219 | {100,100}}), graphics),
|
|---|
| 220 | Icon(coordinateSystem(
|
|---|
| 221 | extent={{-100,-100},{100,100}},
|
|---|
| 222 | preserveAspectRatio=false,
|
|---|
| 223 | initialScale=0.1,
|
|---|
| 224 | grid={2,2}), graphics={Rectangle(
|
|---|
| 225 | fillColor={192,192,192},
|
|---|
| 226 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 227 | extent={{-100,10},{-66,-10}}),Rectangle(
|
|---|
| 228 | fillColor={192,192,192},
|
|---|
| 229 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 230 | extent={{66,8},{100,-12}}),Rectangle(origin={-25,2}, extent={
|
|---|
| 231 | {-75,74},{125,-74}}),Line(
|
|---|
| 232 | origin={20,-2},
|
|---|
| 233 | points={{-60,94},{-60,76}},
|
|---|
| 234 | color={0,0,255}),Line(
|
|---|
| 235 | origin={-20,-2},
|
|---|
| 236 | points={{60,94},{60,76}},
|
|---|
| 237 | color={0,0,255})}),
|
|---|
| 238 | Documentation(info="<html>
|
|---|
| 239 | <p>The input signal is a torque request (Nm).</p>
|
|---|
| 240 | <p>The maximum available torque is internally computed considering a direct torque maximum (tauMax) and a power maximum (powMax) </p>
|
|---|
| 241 | <p>The requested torque is applied to a mechancal inertia. The inertia is interfaced by means of two flanges with the exterior.</p>
|
|---|
| 242 | <p>The model then computes the inner losses and absorbs the total power from the DC input.</p>
|
|---|
| 243 | </html>"));
|
|---|
| 244 | end MBTwoFlange;
|
|---|
| 245 |
|
|---|
| 246 | model MBiceConn "Simple map-based ice model with connector"
|
|---|
| 247 | import Modelica.Constants.*;
|
|---|
| 248 | extends Partial.PartialMBice;
|
|---|
| 249 | // extends MBOneFlange;
|
|---|
| 250 | parameter Real vMass=1300;
|
|---|
| 251 | parameter Real wIceStart=167;
|
|---|
| 252 | // rad/s
|
|---|
| 253 | SupportModels.Conn conn annotation (Placement(
|
|---|
| 254 | visible=true,
|
|---|
| 255 | transformation(extent={{-8,-62},{32,-102}}, rotation=0),
|
|---|
| 256 | iconTransformation(extent={{-4,-80},{36,-120}}, rotation=0)));
|
|---|
| 257 | Modelica.Blocks.Nonlinear.Limiter limiter(uMin=0, uMax=1e99) annotation (
|
|---|
| 258 | Placement(transformation(
|
|---|
| 259 | extent={{-10,-10},{10,10}},
|
|---|
| 260 | rotation=90,
|
|---|
| 261 | origin={-58,-6})));
|
|---|
| 262 | equation
|
|---|
| 263 | connect(icePow.power, conn.icePowDel) annotation (Line(
|
|---|
| 264 | points={{68,49},{70,49},{70,-68},{12,-68},{12,-82}},
|
|---|
| 265 | color={0,0,127},
|
|---|
| 266 | smooth=Smooth.None), Text(
|
|---|
| 267 | string="%second",
|
|---|
| 268 | index=1,
|
|---|
| 269 | extent={{6,3},{6,3}}));
|
|---|
| 270 | connect(w.w, conn.iceW) annotation (Line(
|
|---|
| 271 | points={{52,33},{52,34},{60,34},{60,-68},{12,-68},{12,-82}},
|
|---|
| 272 | color={0,0,127},
|
|---|
| 273 | smooth=Smooth.None), Text(
|
|---|
| 274 | string="%second",
|
|---|
| 275 | index=1,
|
|---|
| 276 | extent={{6,3},{6,3}}));
|
|---|
| 277 | connect(limiter.y, min1.u2) annotation (Line(
|
|---|
| 278 | points={{-58,5},{-58,54},{-50,54}},
|
|---|
| 279 | color={0,0,127},
|
|---|
| 280 | smooth=Smooth.None));
|
|---|
| 281 | connect(limiter.u, conn.iceTauRef) annotation (Line(
|
|---|
| 282 | points={{-58,-18},{-58,-68},{12,-68},{12,-82}},
|
|---|
| 283 | color={0,0,127},
|
|---|
| 284 | smooth=Smooth.None), Text(
|
|---|
| 285 | string="%second",
|
|---|
| 286 | index=1,
|
|---|
| 287 | extent={{6,3},{6,3}}));
|
|---|
| 288 | annotation (
|
|---|
| 289 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-80},
|
|---|
| 290 | {100,80}}), graphics),
|
|---|
| 291 | experiment(
|
|---|
| 292 | StopTime=200,
|
|---|
| 293 | __Dymola_NumberOfIntervals=1000,
|
|---|
| 294 | __Dymola_Algorithm="Lsodar"),
|
|---|
| 295 | __Dymola_experimentSetupOutput,
|
|---|
| 296 | Documentation(info="<html>
|
|---|
| 297 | <p><b>Simple map-based ICE model for power-split power trains - with connector</b> </p>
|
|---|
| 298 | <p>This model belongs to the map-based models of power train components.</p>
|
|---|
| 299 | <p>It models an Internal Combustion Engine, neglecting any dynamics except that related with its rotor inertia.</p>
|
|---|
| 300 | <p>The request is satisfied only in case the maximum power is not overcome; otherwise the torque is scaled down so that the maximum power is delivered.</p>
|
|---|
| 301 | <p>The additional input torqueLim is useful in some cases. For instance when the ICE is used in PSD power train, there is a fixed ratio between the torque at the ICE and generator flanges. The ICE cannot deliber a torque that implies on the generator flange a torque larger than the maximum allowed.</p>
|
|---|
| 302 | <p>Signals connected to the connector:</p>
|
|---|
| 303 | <p>- iceTauRef (input) is the torque request (Nm). Negative values are internally converted to zero</p>
|
|---|
| 304 | <p>- iceW (output) is the measured ICE speed (rad/s)</p>
|
|---|
| 305 | <p>- icePowDel (output) delivered power (W)</p>
|
|---|
| 306 | </html>"),
|
|---|
| 307 | Icon(coordinateSystem(
|
|---|
| 308 | extent={{-100,-100},{100,100}},
|
|---|
| 309 | preserveAspectRatio=false,
|
|---|
| 310 | initialScale=0.1,
|
|---|
| 311 | grid={2,2}), graphics={Line(points={{-60,36},{-60,12}}),Polygon(
|
|---|
| 312 | points={{-60,4},{-66,14},{-54,14},{-60,4}})}));
|
|---|
| 313 | end MBiceConn;
|
|---|
| 314 |
|
|---|
| 315 | model MBOneFlangeConn "Simple map-based one-flange electric drive "
|
|---|
| 316 | extends Partial.PartialMBOneFlange;
|
|---|
| 317 | SupportModels.Conn conn annotation (Placement(
|
|---|
| 318 | visible=true,
|
|---|
| 319 | transformation(extent={{-18,-60},{22,-100}}, rotation=0),
|
|---|
| 320 | iconTransformation(extent={{80,-58},{120,-98}}, rotation=0)));
|
|---|
| 321 | Modelica.Blocks.Sources.RealExpression mechPow(y=powSensor.power)
|
|---|
| 322 | annotation (Placement(transformation(extent={{38,-56},{18,-36}})));
|
|---|
| 323 | equation
|
|---|
| 324 | connect(createTau.u2, conn.genTauRef) annotation (Line(
|
|---|
| 325 | points={{-28,4},{-42,4},{-42,-68},{2,-68},{2,-80}},
|
|---|
| 326 | color={0,0,127},
|
|---|
| 327 | smooth=Smooth.None), Text(
|
|---|
| 328 | string="%second",
|
|---|
| 329 | index=1,
|
|---|
| 330 | extent={{6,3},{6,3}}));
|
|---|
| 331 | connect(mechPow.y, conn.genPowDel) annotation (Line(
|
|---|
| 332 | points={{17,-46},{2,-46},{2,-80}},
|
|---|
| 333 | color={0,0,127},
|
|---|
| 334 | smooth=Smooth.None), Text(
|
|---|
| 335 | string="%second",
|
|---|
| 336 | index=1,
|
|---|
| 337 | extent={{6,3},{6,3}}));
|
|---|
| 338 | connect(limTau.y, conn.genTauLim) annotation (Line(
|
|---|
| 339 | points={{15,30},{-36,30},{-36,30},{-42,30},{-42,-68},{2,-68},{2,-80}},
|
|---|
| 340 |
|
|---|
| 341 | color={0,0,127},
|
|---|
| 342 | smooth=Smooth.None), Text(
|
|---|
| 343 | string="%second",
|
|---|
| 344 | index=1,
|
|---|
| 345 | extent={{6,3},{6,3}}));
|
|---|
| 346 |
|
|---|
| 347 | connect(wSensor.w, conn.genW) annotation (Line(
|
|---|
| 348 | points={{78,35.2},{78,-68},{2,-68},{2,-80}},
|
|---|
| 349 | color={0,0,127},
|
|---|
| 350 | smooth=Smooth.None), Text(
|
|---|
| 351 | string="%second",
|
|---|
| 352 | index=1,
|
|---|
| 353 | extent={{6,3},{6,3}}));
|
|---|
| 354 | annotation (
|
|---|
| 355 | Diagram(coordinateSystem(
|
|---|
| 356 | extent={{-100,-80},{100,80}},
|
|---|
| 357 | preserveAspectRatio=false,
|
|---|
| 358 | initialScale=0.1,
|
|---|
| 359 | grid={2,2}), graphics),
|
|---|
| 360 | Icon(coordinateSystem(
|
|---|
| 361 | extent={{-100,-100},{100,100}},
|
|---|
| 362 | preserveAspectRatio=false,
|
|---|
| 363 | initialScale=0.1,
|
|---|
| 364 | grid={2,2}), graphics={Line(points={{62,-7},{82,-7}}),Rectangle(
|
|---|
| 365 | extent={{-70,80},{100,-80}}),Line(points={{-98,40},{-70,40}},
|
|---|
| 366 | color={0,0,255}),Line(points={{-92,-40},{-70,-40}}, color={0,0,
|
|---|
| 367 | 255}),Text(
|
|---|
| 368 | origin={0,20},
|
|---|
| 369 | lineColor={0,0,255},
|
|---|
| 370 | extent={{-70,98},{100,60}},
|
|---|
| 371 | textString="%name")}),
|
|---|
| 372 | Documentation(info="<html>
|
|---|
| 373 | <p>The input signal is interpreted as a <u>normalised</u> torque request (0 means null torque, 1 maximum availabile torque).</p>
|
|---|
| 374 | <p>The maximum available torque is internally computed considering a direct torque maximum (tauMax) and a power maximum (powMax) </p>
|
|---|
| 375 | <p>The requested torque is applied to a mechancal inertia. The inertia is interfaced by means ot two flanges with the exterior.</p>
|
|---|
| 376 | <p>The model then computes the inner losses and absorbs the total power from the DC input.</p>
|
|---|
| 377 | <p><br><u>Signals connected to the bus connecto</u>r (the names are chosen from the examples FullVehicles!PSecu1 and PSecu2 where the one-flange machine is called "gen"):</p>
|
|---|
| 378 | <p>- genTauRef (input) is the torque request (Nm)</p>
|
|---|
| 379 | <p>- genPowDel (output) is the delivered mechanical power (W)</p>
|
|---|
| 380 | <p>- genTauLim (output) maximum available torque at the given machine rotational speed (Nm)</p>
|
|---|
| 381 | </html>"));
|
|---|
| 382 | end MBOneFlangeConn;
|
|---|
| 383 |
|
|---|
| 384 | model MBTwoFlangeConn "Simple map-based two-flange electric drive model"
|
|---|
| 385 | extends Partial.PartialMBTwoFlange;
|
|---|
| 386 | SupportModels.Conn conn1 annotation (Placement(
|
|---|
| 387 | visible=true,
|
|---|
| 388 | transformation(extent={{-112,-58},{-72,-98}}, rotation=0),
|
|---|
| 389 | iconTransformation(extent={{-112,-58},{-72,-98}}, rotation=0)));
|
|---|
| 390 | equation
|
|---|
| 391 | connect(outAPow.power, conn1.motPowDelA) annotation (Line(
|
|---|
| 392 | points={{64,39},{64,-78},{-92,-78},{-92,-78}},
|
|---|
| 393 | color={0,0,127},
|
|---|
| 394 | smooth=Smooth.None), Text(
|
|---|
| 395 | string="%second",
|
|---|
| 396 | index=1,
|
|---|
| 397 | extent={{6,3},{6,3}}));
|
|---|
| 398 | connect(speedRing.w, conn1.motW) annotation (Line(
|
|---|
| 399 | points={{-80,29},{-86,29},{-86,28},{-92,28},{-92,-78}},
|
|---|
| 400 | color={0,0,127},
|
|---|
| 401 | smooth=Smooth.None), Text(
|
|---|
| 402 | string="%second",
|
|---|
| 403 | index=1,
|
|---|
| 404 | extent={{6,3},{6,3}}));
|
|---|
| 405 | connect(add.y, conn1.motPowDelAB) annotation (Line(
|
|---|
| 406 | points={{28,-1},{28,-22},{78,-22},{78,-78},{-92,-78}},
|
|---|
| 407 | color={0,0,127},
|
|---|
| 408 | smooth=Smooth.None), Text(
|
|---|
| 409 | string="%second",
|
|---|
| 410 | index=1,
|
|---|
| 411 | extent={{6,3},{6,3}}));
|
|---|
| 412 | connect(createTau.u2, conn1.motTauRef) annotation (Line(
|
|---|
| 413 | points={{-20,-10},{-92,-10},{-92,-78}},
|
|---|
| 414 | color={0,0,127},
|
|---|
| 415 | smooth=Smooth.None), Text(
|
|---|
| 416 | string="%second",
|
|---|
| 417 | index=1,
|
|---|
| 418 | extent={{6,3},{6,3}}));
|
|---|
| 419 | annotation (
|
|---|
| 420 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
|
|---|
| 421 | {100,100}}), graphics),
|
|---|
| 422 | Icon(coordinateSystem(
|
|---|
| 423 | extent={{-100,-100},{100,100}},
|
|---|
| 424 | preserveAspectRatio=false,
|
|---|
| 425 | initialScale=0.1,
|
|---|
| 426 | grid={2,2}), graphics={Rectangle(
|
|---|
| 427 | fillColor={192,192,192},
|
|---|
| 428 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 429 | extent={{-100,10},{-66,-10}}),Rectangle(
|
|---|
| 430 | fillColor={192,192,192},
|
|---|
| 431 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 432 | extent={{66,8},{100,-12}}),Rectangle(origin={-25,2}, extent={
|
|---|
| 433 | {-75,74},{125,-74}}),Line(
|
|---|
| 434 | origin={20,-2},
|
|---|
| 435 | points={{-60,94},{-60,76}},
|
|---|
| 436 | color={0,0,255}),Line(
|
|---|
| 437 | origin={-20,-2},
|
|---|
| 438 | points={{60,94},{60,76}},
|
|---|
| 439 | color={0,0,255})}),
|
|---|
| 440 | Documentation(info="<html>
|
|---|
| 441 | <p>This model receives from the connector the torque request (variable MotTauInt) and trieds to deliver it.</p>
|
|---|
| 442 | <p>However before delivering the requested torque, the model limits it considering the maximum deliverable torque and power. In addition it computes and considers inner losses as determined by means of a map. </p>
|
|---|
| 443 | <p><br><u>Signals connected to the bus connecto</u>r (the names are chosen from the examples FullVehicles|PSecu1 and PSecu2 where the two-flange machine is called "mot"):</p>
|
|---|
| 444 | <p>- motTauRef (input) is the torque request (Nm)</p>
|
|---|
| 445 | <p>- motPowDelA (output) is the delivered mechanical power (W)</p>
|
|---|
| 446 | <p>- motPowDelAB (output) is the delivered mechanical power (W)</p>
|
|---|
| 447 | <p>- motTauLim (output) maximum available torque at the given machine rotational speed (Nm)</p>
|
|---|
| 448 | </html>"));
|
|---|
| 449 | end MBTwoFlangeConn;
|
|---|
| 450 |
|
|---|
| 451 | model MBecu2
|
|---|
| 452 | "Power Split hybrid power train controller, using ON/OFF strategy"
|
|---|
| 453 | extends Icons.EcuIcon;
|
|---|
| 454 | parameter Real powFiltT=60 "Power Filter time constant";
|
|---|
| 455 | parameter Real socInit=0.6 "Initial value of SOC";
|
|---|
| 456 | parameter Real socGain=1000 "soc loop gain (rad/s)";
|
|---|
| 457 | parameter Real genTorqueMax=80 "mximum absolute valoe of gen torque (Nm)";
|
|---|
| 458 | parameter Real genTorqueGain=genTorqueMax
|
|---|
| 459 | "Control gain between ice speed error and gen torque: Nm/(rad/s)";
|
|---|
| 460 | parameter Real maxTorqueReq=80
|
|---|
| 461 | "Torque request (Nm) that corresponds to 1 from driver";
|
|---|
| 462 | parameter Real maxIceTau[:, :]=[0, 80; 100, 80; 350, 95; 500, 95]
|
|---|
| 463 | "Curve of maximum ice torque (Nm)";
|
|---|
| 464 | parameter Real psdRatio=2.6 "Ring to gen ratio";
|
|---|
| 465 | Modelica.Blocks.Continuous.FirstOrder powFilt(T=powFiltT) annotation (
|
|---|
| 466 | Placement(transformation(
|
|---|
| 467 | extent={{-10,-10},{10,10}},
|
|---|
| 468 | rotation=-90,
|
|---|
| 469 | origin={-46,50})));
|
|---|
| 470 | Modelica.Blocks.Math.Feedback fbICEw
|
|---|
| 471 | annotation (Placement(transformation(extent={{80,-20},{100,0}})));
|
|---|
| 472 | Modelica.Blocks.Math.Gain gain(k=genTorqueGain) annotation (Placement(
|
|---|
| 473 | transformation(
|
|---|
| 474 | extent={{-10,-10},{10,10}},
|
|---|
| 475 | rotation=90,
|
|---|
| 476 | origin={100,20})));
|
|---|
| 477 | Modelica.Blocks.Nonlinear.Limiter limiter(uMax=genTorqueMax, uMin=-
|
|---|
| 478 | genTorqueMax) annotation (Placement(transformation(
|
|---|
| 479 | extent={{-10,-10},{10,10}},
|
|---|
| 480 | rotation=90,
|
|---|
| 481 | origin={100,50})));
|
|---|
| 482 | Modelica.Blocks.Math.Feedback fbSOC
|
|---|
| 483 | annotation (Placement(transformation(extent={{-64,-58},{-44,-38}})));
|
|---|
| 484 | Modelica.Blocks.Sources.Constant socRef(k=socInit) annotation (Placement(
|
|---|
| 485 | transformation(
|
|---|
| 486 | extent={{-10,-10},{10,10}},
|
|---|
| 487 | rotation=90,
|
|---|
| 488 | origin={-54,-76})));
|
|---|
| 489 | Modelica.Blocks.Math.Add add annotation (Placement(transformation(
|
|---|
| 490 | extent={{-10,-10},{10,10}},
|
|---|
| 491 | rotation=0,
|
|---|
| 492 | origin={10,-2})));
|
|---|
| 493 | Modelica.Blocks.Math.Gain toIceWRef1(k=-socGain) annotation (Placement(
|
|---|
| 494 | transformation(
|
|---|
| 495 | extent={{-10,-10},{10,10}},
|
|---|
| 496 | rotation=90,
|
|---|
| 497 | origin={-26,-24})));
|
|---|
| 498 | Modelica.Blocks.Logical.Hysteresis hysteresis(uLow=50, uHigh=100)
|
|---|
| 499 | annotation (Placement(transformation(
|
|---|
| 500 | extent={{-10,-10},{10,10}},
|
|---|
| 501 | rotation=90,
|
|---|
| 502 | origin={30,30})));
|
|---|
| 503 | Modelica.Blocks.Logical.Switch switch1
|
|---|
| 504 | annotation (Placement(transformation(extent={{56,-20},{76,0}})));
|
|---|
| 505 | Modelica.Blocks.Sources.Constant zero(k=0)
|
|---|
| 506 | annotation (Placement(transformation(extent={{14,-46},{34,-26}})));
|
|---|
| 507 | Modelica.Blocks.Math.Gain gain1(k=1 + psdRatio) annotation (Placement(
|
|---|
| 508 | visible=true, transformation(extent={{-10,58},{10,78}}, rotation=0)));
|
|---|
| 509 | Modelica.Blocks.Math.Division division
|
|---|
| 510 | annotation (Placement(transformation(extent={{-36,12},{-16,32}})));
|
|---|
| 511 | Modelica.Blocks.Tables.CombiTable1D toMaxIceTau(table=maxIceTau)
|
|---|
| 512 | annotation (Placement(visible=true, transformation(
|
|---|
| 513 | origin={-64,10},
|
|---|
| 514 | extent={{10,-10},{-10,10}},
|
|---|
| 515 | rotation=180)));
|
|---|
| 516 | Modelica.Blocks.Math.Gain toNm(k=maxTorqueReq)
|
|---|
| 517 | "converts p.u. torque request into Nm" annotation (Placement(visible=
|
|---|
| 518 | true, transformation(extent={{-80,70},{-60,90}}, rotation=0)));
|
|---|
| 519 | equation
|
|---|
| 520 | connect(powFilt.u, conn1.motPowDelA) annotation (Line(
|
|---|
| 521 | points={{-46,62},{-46,88},{0,88},{0,98}},
|
|---|
| 522 | color={0,0,127},
|
|---|
| 523 | smooth=Smooth.None), Text(
|
|---|
| 524 | string="%second",
|
|---|
| 525 | index=1,
|
|---|
| 526 | extent={{6,3},{6,3}}));
|
|---|
| 527 | connect(gain.u, fbICEw.y) annotation (Line(
|
|---|
| 528 | points={{100,8},{100,-10},{99,-10}},
|
|---|
| 529 | color={0,0,127},
|
|---|
| 530 | smooth=Smooth.None));
|
|---|
| 531 | connect(fbICEw.u2, conn1.iceW) annotation (Line(
|
|---|
| 532 | points={{90,-18},{90,-92},{-90,-92},{-90,98},{0,98}},
|
|---|
| 533 | color={0,0,127},
|
|---|
| 534 | smooth=Smooth.None), Text(
|
|---|
| 535 | string="%second",
|
|---|
| 536 | index=1,
|
|---|
| 537 | extent={{6,3},{6,3}}));
|
|---|
| 538 | connect(limiter.y, conn1.genTauRef) annotation (Line(
|
|---|
| 539 | points={{100,61},{100,88},{0,88},{0,98}},
|
|---|
| 540 | color={0,0,127},
|
|---|
| 541 | smooth=Smooth.None), Text(
|
|---|
| 542 | string="%second",
|
|---|
| 543 | index=1,
|
|---|
| 544 | extent={{6,3},{6,3}}));
|
|---|
| 545 | connect(socRef.y, fbSOC.u2) annotation (Line(
|
|---|
| 546 | points={{-54,-65},{-54,-56}},
|
|---|
| 547 | color={0,0,127},
|
|---|
| 548 | smooth=Smooth.None));
|
|---|
| 549 | connect(fbSOC.y, toIceWRef1.u) annotation (Line(
|
|---|
| 550 | points={{-45,-48},{-26,-48},{-26,-36}},
|
|---|
| 551 | color={0,0,127},
|
|---|
| 552 | smooth=Smooth.None));
|
|---|
| 553 | connect(fbSOC.u1, conn1.batSOC) annotation (Line(
|
|---|
| 554 | points={{-62,-48},{-90,-48},{-90,98},{0,98}},
|
|---|
| 555 | color={0,0,127},
|
|---|
| 556 | smooth=Smooth.None), Text(
|
|---|
| 557 | string="%second",
|
|---|
| 558 | index=1,
|
|---|
| 559 | extent={{6,3},{6,3}}));
|
|---|
| 560 | connect(gain.y, limiter.u) annotation (Line(
|
|---|
| 561 | points={{100,31},{100,38}},
|
|---|
| 562 | color={0,0,127},
|
|---|
| 563 | smooth=Smooth.None));
|
|---|
| 564 | connect(fbICEw.u1, switch1.y) annotation (Line(
|
|---|
| 565 | points={{82,-10},{77,-10}},
|
|---|
| 566 | color={0,0,127},
|
|---|
| 567 | smooth=Smooth.None));
|
|---|
| 568 | connect(switch1.u3, zero.y) annotation (Line(
|
|---|
| 569 | points={{54,-18},{42,-18},{42,-36},{35,-36}},
|
|---|
| 570 | color={0,0,127},
|
|---|
| 571 | smooth=Smooth.None));
|
|---|
| 572 | connect(hysteresis.u, switch1.u1) annotation (Line(
|
|---|
| 573 | points={{30,18},{30,-2},{54,-2}},
|
|---|
| 574 | color={0,0,127},
|
|---|
| 575 | smooth=Smooth.None));
|
|---|
| 576 | connect(add.y, switch1.u1) annotation (Line(
|
|---|
| 577 | points={{21,-2},{54,-2}},
|
|---|
| 578 | color={0,0,127},
|
|---|
| 579 | smooth=Smooth.None));
|
|---|
| 580 | connect(hysteresis.y, switch1.u2) annotation (Line(
|
|---|
| 581 | points={{30,41},{30,48},{44,48},{44,-10},{54,-10}},
|
|---|
| 582 | color={255,0,255},
|
|---|
| 583 | smooth=Smooth.None));
|
|---|
| 584 | connect(hysteresis.y, conn1.iceON) annotation (Line(
|
|---|
| 585 | points={{30,41},{30,98},{0,98}},
|
|---|
| 586 | color={255,0,255},
|
|---|
| 587 | smooth=Smooth.None), Text(
|
|---|
| 588 | string="%second",
|
|---|
| 589 | index=1,
|
|---|
| 590 | extent={{6,3},{6,3}}));
|
|---|
| 591 | connect(add.u2, toIceWRef1.y) annotation (Line(
|
|---|
| 592 | points={{-2,-8},{-26,-8},{-26,-13}},
|
|---|
| 593 | color={0,0,127},
|
|---|
| 594 | smooth=Smooth.None));
|
|---|
| 595 | connect(gain1.u, conn1.genTauLim) annotation (Line(
|
|---|
| 596 | points={{-12,68},{-18,68},{-18,84},{0,84},{0,98}},
|
|---|
| 597 | color={0,0,127},
|
|---|
| 598 | smooth=Smooth.None), Text(
|
|---|
| 599 | string="%second",
|
|---|
| 600 | index=1,
|
|---|
| 601 | extent={{6,3},{6,3}}));
|
|---|
| 602 | connect(gain1.y, conn1.iceTauRef) annotation (Line(
|
|---|
| 603 | points={{11,68},{14,68},{14,94},{0,94},{0,98}},
|
|---|
| 604 | color={0,0,127},
|
|---|
| 605 | smooth=Smooth.None), Text(
|
|---|
| 606 | string="%second",
|
|---|
| 607 | index=1,
|
|---|
| 608 | extent={{6,3},{6,3}}));
|
|---|
| 609 | connect(division.u1, powFilt.y) annotation (Line(
|
|---|
| 610 | points={{-38,28},{-46,28},{-46,39}},
|
|---|
| 611 | color={0,0,127},
|
|---|
| 612 | smooth=Smooth.None));
|
|---|
| 613 | connect(division.u2, toMaxIceTau.y[1]) annotation (Line(
|
|---|
| 614 | points={{-38,16},{-48,16},{-48,10},{-53,10}},
|
|---|
| 615 | color={0,0,127},
|
|---|
| 616 | smooth=Smooth.None));
|
|---|
| 617 | connect(toMaxIceTau.u[1], fbICEw.u2) annotation (Line(
|
|---|
| 618 | points={{-76,10},{-82,10},{-82,-92},{90,-92},{90,-18}},
|
|---|
| 619 | color={0,0,127},
|
|---|
| 620 | smooth=Smooth.None));
|
|---|
| 621 | connect(division.y, add.u1) annotation (Line(
|
|---|
| 622 | points={{-15,22},{-10,22},{-10,4},{-2,4}},
|
|---|
| 623 | color={0,0,127},
|
|---|
| 624 | smooth=Smooth.None));
|
|---|
| 625 | connect(toNm.u, motTauInt) annotation (Line(
|
|---|
| 626 | points={{-82,80},{-94,80},{-94,0},{-120,0}},
|
|---|
| 627 | color={0,0,127},
|
|---|
| 628 | smooth=Smooth.None));
|
|---|
| 629 | connect(toNm.y, conn1.motTauRef) annotation (Line(
|
|---|
| 630 | points={{-59,80},{-58,80},{-58,98},{0,98}},
|
|---|
| 631 | color={0,0,127},
|
|---|
| 632 | smooth=Smooth.None), Text(
|
|---|
| 633 | string="%second",
|
|---|
| 634 | index=1,
|
|---|
| 635 | extent={{6,3},{6,3}}));
|
|---|
| 636 | annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{
|
|---|
| 637 | -100,-100},{120,100}}), graphics), Icon(coordinateSystem(
|
|---|
| 638 | extent={{-100,-100},{100,100}},
|
|---|
| 639 | preserveAspectRatio=false,
|
|---|
| 640 | initialScale=0.1,
|
|---|
| 641 | grid={2,2}), graphics={Text(
|
|---|
| 642 | extent={{-102,84},{98,54}},
|
|---|
| 643 | lineColor={0,0,0},
|
|---|
| 644 | textString="PSD-MB2")}));
|
|---|
| 645 | end MBecu2;
|
|---|
| 646 |
|
|---|
| 647 | model MBecu1
|
|---|
| 648 | "Power Split hybrid power train controller, not using ON/OFF strategy"
|
|---|
| 649 | extends Icons.EcuIcon;
|
|---|
| 650 | parameter Real powFiltT=60 "Power filter time constant (s)";
|
|---|
| 651 | parameter Real maxIceTau[:, :]=[0, 80; 100, 80; 350, 95; 500, 95]
|
|---|
| 652 | "Curve of maximum ice torque (Nm)";
|
|---|
| 653 | parameter Real genTorqueMax=80
|
|---|
| 654 | "maximum absolute valoe of gen torque (Nm)";
|
|---|
| 655 | parameter Real maxTorqueReq=80
|
|---|
| 656 | "Torque request (Nm) that corresponds to 1 from driver";
|
|---|
| 657 | parameter Real genTorqueGain=genTorqueMax
|
|---|
| 658 | "Control gain between ice speed error and gen torque: Nm/(rad/s)";
|
|---|
| 659 | parameter Real psdRatio=2.6 "ring to sun ratio";
|
|---|
| 660 | Modelica.Blocks.Math.Gain gain(k=genTorqueGain) annotation (Placement(
|
|---|
| 661 | visible=true, transformation(extent={{46,-24},{66,-4}}, rotation=0)));
|
|---|
| 662 | Modelica.Blocks.Math.Feedback fbWIce annotation (Placement(visible=true,
|
|---|
| 663 | transformation(extent={{20,-24},{40,-4}}, rotation=0)));
|
|---|
| 664 | Modelica.Blocks.Nonlinear.Limiter limitWIce(uMax=500, uMin=25)
|
|---|
| 665 | annotation (Placement(visible=true, transformation(
|
|---|
| 666 | origin={-2,-14},
|
|---|
| 667 | extent={{-10,-10},{10,10}},
|
|---|
| 668 | rotation=0)));
|
|---|
| 669 | Modelica.Blocks.Continuous.FirstOrder powFilt(T=powFiltT) annotation (
|
|---|
| 670 | Placement(visible=true, transformation(
|
|---|
| 671 | origin={-62,16},
|
|---|
| 672 | extent={{-10,-10},{10,10}},
|
|---|
| 673 | rotation=-90)));
|
|---|
| 674 | Modelica.Blocks.Tables.CombiTable1D toMaxIceTau(table=maxIceTau)
|
|---|
| 675 | annotation (Placement(visible=true, transformation(
|
|---|
| 676 | origin={-60,-26},
|
|---|
| 677 | extent={{10,-10},{-10,10}},
|
|---|
| 678 | rotation=180)));
|
|---|
| 679 | Modelica.Blocks.Math.Division division
|
|---|
| 680 | annotation (Placement(transformation(extent={{-40,-24},{-20,-4}})));
|
|---|
| 681 | Modelica.Blocks.Math.Gain gain1(k=1 + psdRatio) annotation (Placement(
|
|---|
| 682 | visible=true, transformation(extent={{28,46},{48,66}}, rotation=0)));
|
|---|
| 683 | Modelica.Blocks.Nonlinear.Limiter limiter(uMax=genTorqueMax, uMin=-
|
|---|
| 684 | genTorqueMax) annotation (Placement(visible=true, transformation(
|
|---|
| 685 | origin={82,10},
|
|---|
| 686 | extent={{-10,-10},{10,10}},
|
|---|
| 687 | rotation=90)));
|
|---|
| 688 | Modelica.Blocks.Math.Gain toNm(k=maxTorqueReq)
|
|---|
| 689 | "converts p.u. torque request into Nm" annotation (Placement(visible=
|
|---|
| 690 | true, transformation(extent={{-70,66},{-50,86}}, rotation=0)));
|
|---|
| 691 | equation
|
|---|
| 692 | connect(fbWIce.u2, conn1.iceW) annotation (Line(points={{30,-22},{30,-56},
|
|---|
| 693 | {-78,-56},{-78,54},{-4,54},{-4,98},{0,98}}, color={0,0,127}));
|
|---|
| 694 | connect(powFilt.u, conn1.motPowDelA) annotation (Line(points={{-62,28},{-62,
|
|---|
| 695 | 40},{0,40},{0,98}}, color={0,0,127}));
|
|---|
| 696 | connect(fbWIce.u1, limitWIce.y)
|
|---|
| 697 | annotation (Line(points={{22,-14},{9,-14}}, color={0,0,127}));
|
|---|
| 698 | connect(gain.u, fbWIce.y)
|
|---|
| 699 | annotation (Line(points={{44,-14},{39,-14}}, color={0,0,127}));
|
|---|
| 700 | connect(limitWIce.u, division.y) annotation (Line(
|
|---|
| 701 | points={{-14,-14},{-19,-14}},
|
|---|
| 702 | color={0,0,127},
|
|---|
| 703 | smooth=Smooth.None));
|
|---|
| 704 | connect(toMaxIceTau.y[1], division.u2) annotation (Line(
|
|---|
| 705 | points={{-49,-26},{-47.5,-26},{-47.5,-20},{-42,-20}},
|
|---|
| 706 | color={0,0,127},
|
|---|
| 707 | smooth=Smooth.None));
|
|---|
| 708 | connect(division.u1, powFilt.y) annotation (Line(
|
|---|
| 709 | points={{-42,-8},{-62,-8},{-62,5}},
|
|---|
| 710 | color={0,0,127},
|
|---|
| 711 | smooth=Smooth.None));
|
|---|
| 712 | connect(toMaxIceTau.u[1], fbWIce.u2) annotation (Line(
|
|---|
| 713 | points={{-72,-26},{-76,-26},{-76,-48},{30,-48},{30,-22}},
|
|---|
| 714 | color={0,0,127},
|
|---|
| 715 | smooth=Smooth.None));
|
|---|
| 716 | connect(gain1.u, conn1.genTauLim) annotation (Line(
|
|---|
| 717 | points={{26,56},{0,56},{0,98}},
|
|---|
| 718 | color={0,0,127},
|
|---|
| 719 | smooth=Smooth.None), Text(
|
|---|
| 720 | string="%second",
|
|---|
| 721 | index=1,
|
|---|
| 722 | extent={{6,3},{6,3}}));
|
|---|
| 723 | connect(gain1.y, conn1.iceTauRef) annotation (Line(
|
|---|
| 724 | points={{49,56},{58,56},{58,98},{0,98}},
|
|---|
| 725 | color={0,0,127},
|
|---|
| 726 | smooth=Smooth.None), Text(
|
|---|
| 727 | string="%second",
|
|---|
| 728 | index=1,
|
|---|
| 729 | extent={{6,3},{6,3}}));
|
|---|
| 730 | connect(limiter.u, gain.y) annotation (Line(
|
|---|
| 731 | points={{82,-2},{82,-14},{67,-14}},
|
|---|
| 732 | color={0,0,127},
|
|---|
| 733 | smooth=Smooth.None));
|
|---|
| 734 | connect(limiter.y, conn1.genTauRef) annotation (Line(
|
|---|
| 735 | points={{82,21},{82,32},{0,32},{0,98}},
|
|---|
| 736 | color={0,0,127},
|
|---|
| 737 | smooth=Smooth.None), Text(
|
|---|
| 738 | string="%second",
|
|---|
| 739 | index=1,
|
|---|
| 740 | extent={{6,3},{6,3}}));
|
|---|
| 741 | connect(toNm.u, motTauInt) annotation (Line(
|
|---|
| 742 | points={{-72,76},{-94,76},{-94,0},{-120,0}},
|
|---|
| 743 | color={0,0,127},
|
|---|
| 744 | smooth=Smooth.None));
|
|---|
| 745 | connect(toNm.y, conn1.motTauRef) annotation (Line(
|
|---|
| 746 | points={{-49,76},{-20,76},{-20,98},{0,98}},
|
|---|
| 747 | color={0,0,127},
|
|---|
| 748 | smooth=Smooth.None), Text(
|
|---|
| 749 | string="%second",
|
|---|
| 750 | index=1,
|
|---|
| 751 | extent={{6,3},{6,3}}));
|
|---|
| 752 | annotation (
|
|---|
| 753 | Diagram(coordinateSystem(
|
|---|
| 754 | extent={{-100,-100},{100,100}},
|
|---|
| 755 | preserveAspectRatio=false,
|
|---|
| 756 | initialScale=0.1,
|
|---|
| 757 | grid={2,2}), graphics),
|
|---|
| 758 | Icon(coordinateSystem(
|
|---|
| 759 | extent={{-100,-80},{100,80}},
|
|---|
| 760 | preserveAspectRatio=false,
|
|---|
| 761 | initialScale=0.1,
|
|---|
| 762 | grid={2,2}), graphics={Text(
|
|---|
| 763 | extent={{-100,84},{100,54}},
|
|---|
| 764 | lineColor={0,0,0},
|
|---|
| 765 | textString="PSD-MB1")}),
|
|---|
| 766 | Documentation(info="<html>
|
|---|
| 767 | <h4>Power Split Power Train Controller without ON/OFF</h4>
|
|---|
| 768 | <p>This is a very simpllified controller.</p>
|
|---|
| 769 | <p>It just tries to keep the ICE at its maximun torque. </p>
|
|---|
| 770 | <p>Therefore from the vehicle power needs, obtained as the average of most recent delivered power, the requested ICE operating point is obtained by dividing the vehicle power needs by the maximum availble torque at the given speed.</p>
|
|---|
| 771 | <p>This optimal ICE speed is then pursed by adequate control of the gen torque.</p>
|
|---|
| 772 | <p>So:</p>
|
|---|
| 773 | <ul>
|
|---|
| 774 | <li>powFilt Block filters the delivered power to obtained the power to ask the ICE to deliver</li>
|
|---|
| 775 | <li>toIceWref converts the power to be requested from the ICE by its maximum torque at the actual speed</li>
|
|---|
| 776 | <li>after a limiting block, this torque is the reference signal of a feedback; the corresponnding error controls the Gen torque.</li>
|
|---|
| 777 | </ul>
|
|---|
| 778 | </html>"));
|
|---|
| 779 | end MBecu1;
|
|---|
| 780 |
|
|---|
| 781 | package MBsupport "Useful Additional Models"
|
|---|
| 782 | extends Modelica.Icons.Package;
|
|---|
| 783 |
|
|---|
| 784 | model ToConnIceTauRef "signal adaptor to send iceTauRef to a connector"
|
|---|
| 785 | Modelica.Blocks.Interfaces.RealInput u annotation (Placement(
|
|---|
| 786 | transformation(extent={{-94,-20},{-54,20}}), iconTransformation(
|
|---|
| 787 | extent={{-94,-20},{-54,20}})));
|
|---|
| 788 | SupportModels.Conn conn annotation (Placement(transformation(
|
|---|
| 789 | extent={{-20,-20},{20,20}},
|
|---|
| 790 | rotation=-90,
|
|---|
| 791 | origin={60,0}), iconTransformation(
|
|---|
| 792 | extent={{-20,-20},{20,20}},
|
|---|
| 793 | rotation=-90,
|
|---|
| 794 | origin={60,0})));
|
|---|
| 795 | equation
|
|---|
| 796 | connect(u, conn.iceTauRef) annotation (Line(
|
|---|
| 797 | points={{-74,0},{60,0}},
|
|---|
| 798 | color={0,0,127},
|
|---|
| 799 | smooth=Smooth.None), Text(
|
|---|
| 800 | string="%second",
|
|---|
| 801 | index=1,
|
|---|
| 802 | extent={{6,3},{6,3}}));
|
|---|
| 803 | annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-60,
|
|---|
| 804 | -60},{60,60}}), graphics={Rectangle(
|
|---|
| 805 | extent={{-60,40},{60,-40}},
|
|---|
| 806 | lineColor={0,0,0},
|
|---|
| 807 | fillColor={255,255,255},
|
|---|
| 808 | fillPattern=FillPattern.Solid),Line(
|
|---|
| 809 | points={{-38,0},{30,0}},
|
|---|
| 810 | color={0,0,0},
|
|---|
| 811 | smooth=Smooth.None),Polygon(
|
|---|
| 812 | points={{42,0},{22,8},{22,-8},{42,0}},
|
|---|
| 813 | lineColor={0,0,0},
|
|---|
| 814 | smooth=Smooth.None,
|
|---|
| 815 | fillColor={0,0,0},
|
|---|
| 816 | fillPattern=FillPattern.Solid)}), Diagram(
|
|---|
| 817 | coordinateSystem(preserveAspectRatio=false, extent={{-60,-60},{60,
|
|---|
| 818 | 60}}), graphics));
|
|---|
| 819 | end ToConnIceTauRef;
|
|---|
| 820 |
|
|---|
| 821 | model ToConnGenTauRef "signal adaptor to send genTauRef to a connector"
|
|---|
| 822 | Modelica.Blocks.Interfaces.RealInput u annotation (Placement(
|
|---|
| 823 | transformation(extent={{-90,-20},{-50,20}}), iconTransformation(
|
|---|
| 824 | extent={{-90,-20},{-50,20}})));
|
|---|
| 825 | SupportModels.Conn conn annotation (Placement(transformation(
|
|---|
| 826 | extent={{-20,-20},{20,20}},
|
|---|
| 827 | rotation=-90,
|
|---|
| 828 | origin={58,0}), iconTransformation(
|
|---|
| 829 | extent={{-20,-20},{20,20}},
|
|---|
| 830 | rotation=-90,
|
|---|
| 831 | origin={58,0})));
|
|---|
| 832 | equation
|
|---|
| 833 | connect(u, conn.genTauRef) annotation (Line(
|
|---|
| 834 | points={{-70,0},{58,0}},
|
|---|
| 835 | color={0,0,127},
|
|---|
| 836 | smooth=Smooth.None), Text(
|
|---|
| 837 | string="%second",
|
|---|
| 838 | index=1,
|
|---|
| 839 | extent={{6,3},{6,3}}));
|
|---|
| 840 | annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-60,
|
|---|
| 841 | -60},{60,60}}), graphics={Rectangle(
|
|---|
| 842 | extent={{-60,40},{60,-40}},
|
|---|
| 843 | lineColor={0,0,0},
|
|---|
| 844 | fillColor={255,255,255},
|
|---|
| 845 | fillPattern=FillPattern.Solid),Line(
|
|---|
| 846 | points={{-40,0},{32,0}},
|
|---|
| 847 | color={0,0,0},
|
|---|
| 848 | smooth=Smooth.None),Polygon(
|
|---|
| 849 | points={{42,0},{22,8},{22,-8},{42,0}},
|
|---|
| 850 | lineColor={0,0,0},
|
|---|
| 851 | smooth=Smooth.None,
|
|---|
| 852 | fillColor={0,0,0},
|
|---|
| 853 | fillPattern=FillPattern.Solid)}), Diagram(
|
|---|
| 854 | coordinateSystem(preserveAspectRatio=false, extent={{-60,-60},{60,
|
|---|
| 855 | 60}}), graphics));
|
|---|
| 856 | end ToConnGenTauRef;
|
|---|
| 857 |
|
|---|
| 858 | package Internal
|
|---|
| 859 | "Models intended to be used by other models of this package, not by the final user"
|
|---|
| 860 | block LimTau "Torque limiter"
|
|---|
| 861 | Modelica.Blocks.Interfaces.RealInput w annotation (Placement(
|
|---|
| 862 | transformation(extent={{-140,-20},{-100,20}})));
|
|---|
| 863 | Modelica.Blocks.Interfaces.RealOutput y
|
|---|
| 864 | annotation (Placement(transformation(extent={{100,-10},{120,10}})));
|
|---|
| 865 | parameter Real powMax(start=50000) "Maximum mechanical power (W)";
|
|---|
| 866 | parameter Real tauMax(start=400) "Maximum torque (Nm)";
|
|---|
| 867 | parameter Real wMax(start=1500, min=powMax/tauMax)
|
|---|
| 868 | "Maximum speed (rad/s)";
|
|---|
| 869 | Integer state
|
|---|
| 870 | "=0 below base speed; =1 before wMax; =2 in w limit, =3 above wMax";
|
|---|
| 871 | //0 or 1 if tauMax or powMax is delivered; =2 or 3 if w>wMax
|
|---|
| 872 | protected
|
|---|
| 873 | parameter Real alpha=0.10
|
|---|
| 874 | "fraction of wMax over which the torque is to be brought to zero";
|
|---|
| 875 | algorithm
|
|---|
| 876 | if w < powMax/tauMax then
|
|---|
| 877 | state := 0;
|
|---|
| 878 | y := tauMax;
|
|---|
| 879 | else
|
|---|
| 880 | state := 1;
|
|---|
| 881 | y := powMax/w;
|
|---|
| 882 | end if;
|
|---|
| 883 | //over wMax the torque max is to be rapidly brought to zero
|
|---|
| 884 | if w > wMax then
|
|---|
| 885 | if w < (1 + alpha)*wMax then
|
|---|
| 886 | state := 2;
|
|---|
| 887 | y := powMax/wMax*(1 - (w - wMax)/(alpha*wMax));
|
|---|
| 888 | else
|
|---|
| 889 | state := 3;
|
|---|
| 890 | y := 0;
|
|---|
| 891 | end if;
|
|---|
| 892 | end if;
|
|---|
| 893 | annotation (
|
|---|
| 894 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
|
|---|
| 895 | {100,100}}), graphics),
|
|---|
| 896 | Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
|
|---|
| 897 | {100,100}}), graphics={Rectangle(
|
|---|
| 898 | extent={{-100,60},{100,-60}},
|
|---|
| 899 | lineColor={0,0,0},
|
|---|
| 900 | fillColor={255,255,255},
|
|---|
| 901 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 902 | points={{-4,34},{6,16},{22,2},{38,-10},{56,-16},{72,-18},
|
|---|
| 903 | {72,-38},{12,-38},{-72,-38},{-72,34},{-4,34}},
|
|---|
| 904 | lineColor={0,0,0},
|
|---|
| 905 | smooth=Smooth.None,
|
|---|
| 906 | fillColor={255,255,255},
|
|---|
| 907 | fillPattern=FillPattern.Solid),Line(
|
|---|
| 908 | points={{-72,54},{-72,-40},{-74,-40}},
|
|---|
| 909 | color={0,0,0},
|
|---|
| 910 | thickness=0.5,
|
|---|
| 911 | smooth=Smooth.None,
|
|---|
| 912 | arrow={Arrow.Filled,Arrow.None}),Line(
|
|---|
| 913 | points={{90,-38},{-74,-38}},
|
|---|
| 914 | color={0,0,0},
|
|---|
| 915 | thickness=0.5,
|
|---|
| 916 | smooth=Smooth.None,
|
|---|
| 917 | arrow={Arrow.Filled,Arrow.None}),Text(
|
|---|
| 918 | extent={{-100,80},{96,52}},
|
|---|
| 919 | lineColor={0,0,255},
|
|---|
| 920 | fillColor={255,255,255},
|
|---|
| 921 | fillPattern=FillPattern.Solid,
|
|---|
| 922 | textString="%name
|
|---|
| 923 | "),Text( extent={{70,-48},{84,-54}},
|
|---|
| 924 | lineColor={0,0,255},
|
|---|
| 925 | textString="W"),Text(
|
|---|
| 926 | extent={{-96,48},{-82,42}},
|
|---|
| 927 | lineColor={0,0,255},
|
|---|
| 928 | textString="T")}),
|
|---|
| 929 | Documentation(info="<html>
|
|---|
| 930 | <p>Gives the maximum output torque as a function of the input speed.</p>
|
|---|
| 931 | <p>When w<wMax the output is Tmax if Tmax*w<Pnom, othersise it is Pnom/w</p>
|
|---|
| 932 | <p>But if w is over wMax Tmax is rapidly falling to zero (reaches zero when speed overcomes wMax by 10%).</p>
|
|---|
| 933 | <p>Torques and powers are in SI units</p>
|
|---|
| 934 | </html>"));
|
|---|
| 935 | end LimTau;
|
|---|
| 936 |
|
|---|
| 937 | block Pel
|
|---|
| 938 | "Outputs the electric power from the given efficiency and mechanical power"
|
|---|
| 939 | Modelica.Blocks.Interfaces.RealInput eta annotation (Placement(
|
|---|
| 940 | transformation(extent={{-140,-60},{-100,-20}})));
|
|---|
| 941 | Modelica.Blocks.Interfaces.RealInput P annotation (Placement(
|
|---|
| 942 | transformation(extent={{-140,20},{-100,60}})));
|
|---|
| 943 | Modelica.Blocks.Interfaces.RealOutput Pel
|
|---|
| 944 | annotation (Placement(transformation(extent={{100,-10},{120,10}})));
|
|---|
| 945 | algorithm
|
|---|
| 946 | if noEvent(P <= 0) then
|
|---|
| 947 | Pel := P*eta;
|
|---|
| 948 | else
|
|---|
| 949 | Pel := P/eta;
|
|---|
| 950 | end if;
|
|---|
| 951 | annotation (Icon(graphics={Rectangle(
|
|---|
| 952 | extent={{-92,56},{98,-48}},
|
|---|
| 953 | lineColor={0,0,255},
|
|---|
| 954 | fillColor={170,255,255},
|
|---|
| 955 | fillPattern=FillPattern.Solid),Text(
|
|---|
| 956 | extent={{-64,30},{48,-14}},
|
|---|
| 957 | lineColor={0,0,255},
|
|---|
| 958 | fillColor={170,255,255},
|
|---|
| 959 | fillPattern=FillPattern.Solid,
|
|---|
| 960 | textString="Pel")}), Diagram(coordinateSystem(
|
|---|
| 961 | preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
|
|---|
| 962 | graphics));
|
|---|
| 963 | end Pel;
|
|---|
| 964 |
|
|---|
| 965 | model InertiaTq "Inertia with added torque"
|
|---|
| 966 | import SI = Modelica.SIunits;
|
|---|
| 967 | Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a
|
|---|
| 968 | "Left flange of shaft" annotation (Placement(transformation(extent=
|
|---|
| 969 | {{-110,-10},{-90,10}}, rotation=0)));
|
|---|
| 970 | Modelica.Mechanics.Rotational.Interfaces.Flange_b flange_b
|
|---|
| 971 | "Right flange of shaft" annotation (Placement(transformation(extent
|
|---|
| 972 | ={{90,-10},{110,10}}, rotation=0)));
|
|---|
| 973 | parameter SI.Inertia J(min=0, start=1) "Moment of inertia";
|
|---|
| 974 | parameter StateSelect stateSelect=StateSelect.default
|
|---|
| 975 | "Priority to use phi and w as states"
|
|---|
| 976 | annotation (HideResult=true, Dialog(tab="Advanced"));
|
|---|
| 977 | SI.Angle phi(stateSelect=stateSelect)
|
|---|
| 978 | "Absolute rotation angle of component" annotation (Dialog(group=
|
|---|
| 979 | "Initialization", showStartAttribute=true));
|
|---|
| 980 | SI.AngularVelocity w(stateSelect=stateSelect)
|
|---|
| 981 | "Absolute angular velocity of component (= der(phi))" annotation (
|
|---|
| 982 | Dialog(group="Initialization", showStartAttribute=true));
|
|---|
| 983 | SI.AngularAcceleration a
|
|---|
| 984 | "Absolute angular acceleration of component (= der(w))" annotation
|
|---|
| 985 | (Dialog(group="Initialization", showStartAttribute=true));
|
|---|
| 986 | Modelica.Blocks.Interfaces.RealInput tau annotation (Placement(
|
|---|
| 987 | transformation(
|
|---|
| 988 | extent={{-20.5,-20},{20.5,20}},
|
|---|
| 989 | rotation=90,
|
|---|
| 990 | origin={-54.5,-100})));
|
|---|
| 991 | equation
|
|---|
| 992 | phi = flange_a.phi;
|
|---|
| 993 | phi = flange_b.phi;
|
|---|
| 994 | w = der(phi);
|
|---|
| 995 | a = der(w);
|
|---|
| 996 | J*a = flange_a.tau + flange_b.tau + tau;
|
|---|
| 997 | annotation (
|
|---|
| 998 | Documentation(info="<html>
|
|---|
| 999 | <p>
|
|---|
| 1000 | Rotational component with <b>inertia</b> and two rigidly connected flanges.
|
|---|
| 1001 | </p>
|
|---|
| 1002 |
|
|---|
| 1003 | </HTML>
|
|---|
| 1004 | "),
|
|---|
| 1005 | Icon(coordinateSystem(
|
|---|
| 1006 | preserveAspectRatio=true,
|
|---|
| 1007 | extent={{-100,-100},{100,100}},
|
|---|
| 1008 | grid={2,2}), graphics={Rectangle(
|
|---|
| 1009 | extent={{-100,10},{-50,-10}},
|
|---|
| 1010 | lineColor={0,0,0},
|
|---|
| 1011 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 1012 | fillColor={192,192,192}),Rectangle(
|
|---|
| 1013 | extent={{50,10},{100,-10}},
|
|---|
| 1014 | lineColor={0,0,0},
|
|---|
| 1015 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 1016 | fillColor={192,192,192}),Line(points={{-80,-25},{-60,
|
|---|
| 1017 | -25}}, color={0,0,0}),Line(points={{60,-25},{80,-25}}, color=
|
|---|
| 1018 | {0,0,0}),Line(points={{-70,-25},{-70,-70}}, color={0,0,0}),
|
|---|
| 1019 | Line(points={{70,-25},{70,-70}}, color={0,0,0}),Line(points={
|
|---|
| 1020 | {-80,25},{-60,25}}, color={0,0,0}),Line(points={{60,25},{80,
|
|---|
| 1021 | 25}}, color={0,0,0}),Line(points={{-70,45},{-70,25}}, color={
|
|---|
| 1022 | 0,0,0}),Line(points={{70,45},{70,25}}, color={0,0,0}),Line(
|
|---|
| 1023 | points={{-70,-70},{70,-70}}, color={0,0,0}),Rectangle(
|
|---|
| 1024 | extent={{-50,50},{50,-50}},
|
|---|
| 1025 | lineColor={0,0,0},
|
|---|
| 1026 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 1027 | fillColor={192,192,192}),Text(
|
|---|
| 1028 | extent={{-150,100},{150,60}},
|
|---|
| 1029 | textString="%name",
|
|---|
| 1030 | lineColor={0,0,255}),Text(
|
|---|
| 1031 | extent={{-150,-80},{150,-120}},
|
|---|
| 1032 | lineColor={0,0,0},
|
|---|
| 1033 | textString="J=%J")}),
|
|---|
| 1034 | Diagram(coordinateSystem(
|
|---|
| 1035 | preserveAspectRatio=true,
|
|---|
| 1036 | extent={{-100,-100},{100,100}},
|
|---|
| 1037 | grid={2,2}), graphics));
|
|---|
| 1038 | end InertiaTq;
|
|---|
| 1039 |
|
|---|
| 1040 | block ToElectricPower
|
|---|
| 1041 | "Determines the electric power from the mechanical considering efficiency map"
|
|---|
| 1042 | parameter Real tauMax(start=400) "Maximum machine torque(Nm)";
|
|---|
| 1043 | parameter Real powMax(start=22000) "Maximum drive power";
|
|---|
| 1044 | parameter Real wMax(start=650) "Maximum machine speed(rad/s)";
|
|---|
| 1045 | parameter Real effTable[:, :]=[0.00, 0.00, 0.25, 0.50, 0.75, 1.00;
|
|---|
| 1046 | 0.00, 0.75, 0.80, 0.81, 0.82, 0.83; 0.25, 0.76, 0.81, 0.82, 0.83,
|
|---|
| 1047 | 0.84; 0.50, 0.77, 0.82, 0.83, 0.84, 0.85; 0.75, 0.78, 0.83, 0.84,
|
|---|
| 1048 | 0.85, 0.87; 1.00, 0.80, 0.84, 0.85, 0.86, 0.88];
|
|---|
| 1049 | Modelica.Blocks.Tables.CombiTable2D effTable_(
|
|---|
| 1050 | tableOnFile=false,
|
|---|
| 1051 | smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments,
|
|---|
| 1052 | table=effTable) "normalised efficiency" annotation (Placement(
|
|---|
| 1053 | transformation(
|
|---|
| 1054 | extent={{-14,-14},{14,14}},
|
|---|
| 1055 | rotation=0,
|
|---|
| 1056 | origin={18,-18})));
|
|---|
| 1057 | Modelica.Blocks.Interfaces.RealInput w annotation (Placement(
|
|---|
| 1058 | transformation(extent={{-140,-60},{-100,-20}}),
|
|---|
| 1059 | iconTransformation(extent={{-140,-60},{-100,-20}})));
|
|---|
| 1060 | Modelica.Blocks.Interfaces.RealInput tau annotation (Placement(
|
|---|
| 1061 | transformation(extent={{-140,20},{-100,60}}),
|
|---|
| 1062 | iconTransformation(extent={{-140,20},{-100,60}})));
|
|---|
| 1063 | Modelica.Blocks.Interfaces.RealOutput elePow
|
|---|
| 1064 | annotation (Placement(transformation(extent={{100,-10},{120,10}})));
|
|---|
| 1065 | Modelica.Blocks.Math.Abs abs1 annotation (Placement(transformation(
|
|---|
| 1066 | extent={{-76,-50},{-56,-30}})));
|
|---|
| 1067 | Modelica.Blocks.Math.Abs abs2
|
|---|
| 1068 | annotation (Placement(transformation(extent={{-80,40},{-60,60}})));
|
|---|
| 1069 | Modelica.Blocks.Math.Gain normalizeTau(k=1/tauMax) annotation (
|
|---|
| 1070 | Placement(transformation(
|
|---|
| 1071 | extent={{-10,-10},{10,10}},
|
|---|
| 1072 | rotation=0,
|
|---|
| 1073 | origin={-36,50})));
|
|---|
| 1074 | Pel pel
|
|---|
| 1075 | annotation (Placement(transformation(extent={{60,-12},{84,10}})));
|
|---|
| 1076 | Modelica.Blocks.Math.Product PMOT
|
|---|
| 1077 | annotation (Placement(transformation(extent={{-72,0},{-52,20}})));
|
|---|
| 1078 | Modelica.Blocks.Math.Gain normalizeSpeed(k=1/wMax) annotation (
|
|---|
| 1079 | Placement(transformation(
|
|---|
| 1080 | extent={{-10,-10},{10,10}},
|
|---|
| 1081 | rotation=0,
|
|---|
| 1082 | origin={-34,-40})));
|
|---|
| 1083 | equation
|
|---|
| 1084 | connect(tau, abs2.u) annotation (Line(
|
|---|
| 1085 | points={{-120,40},{-94,40},{-94,50},{-82,50}},
|
|---|
| 1086 | color={0,0,127},
|
|---|
| 1087 | smooth=Smooth.None));
|
|---|
| 1088 | connect(w, abs1.u) annotation (Line(
|
|---|
| 1089 | points={{-120,-40},{-78,-40}},
|
|---|
| 1090 | color={0,0,127},
|
|---|
| 1091 | smooth=Smooth.None));
|
|---|
| 1092 | connect(abs2.y, normalizeTau.u) annotation (Line(
|
|---|
| 1093 | points={{-59,50},{-48,50}},
|
|---|
| 1094 | color={0,0,127},
|
|---|
| 1095 | smooth=Smooth.None));
|
|---|
| 1096 | connect(normalizeTau.y, effTable_.u1) annotation (Line(
|
|---|
| 1097 | points={{-25,50},{-7.7,50},{-7.7,-9.6},{1.2,-9.6}},
|
|---|
| 1098 | color={0,0,127},
|
|---|
| 1099 | smooth=Smooth.None));
|
|---|
| 1100 | connect(pel.Pel, elePow) annotation (Line(
|
|---|
| 1101 | points={{85.2,-1},{92.48,-1},{92.48,0},{110,0}},
|
|---|
| 1102 | color={0,0,127},
|
|---|
| 1103 | smooth=Smooth.None));
|
|---|
| 1104 | connect(effTable_.y, pel.eta) annotation (Line(
|
|---|
| 1105 | points={{33.4,-18},{46,-18},{46,-5.4},{57.6,-5.4}},
|
|---|
| 1106 | color={0,0,127},
|
|---|
| 1107 | smooth=Smooth.None));
|
|---|
| 1108 | connect(PMOT.u1, tau) annotation (Line(
|
|---|
| 1109 | points={{-74,16},{-84,16},{-84,40},{-120,40}},
|
|---|
| 1110 | color={0,0,127},
|
|---|
| 1111 | smooth=Smooth.None));
|
|---|
| 1112 | connect(PMOT.u2, w) annotation (Line(
|
|---|
| 1113 | points={{-74,4},{-84,4},{-84,-40},{-120,-40}},
|
|---|
| 1114 | color={0,0,127},
|
|---|
| 1115 | smooth=Smooth.None));
|
|---|
| 1116 | connect(PMOT.y, pel.P) annotation (Line(
|
|---|
| 1117 | points={{-51,10},{42,10},{42,3.4},{57.6,3.4}},
|
|---|
| 1118 | color={0,0,127},
|
|---|
| 1119 | smooth=Smooth.None));
|
|---|
| 1120 | connect(abs1.y, normalizeSpeed.u) annotation (Line(
|
|---|
| 1121 | points={{-55,-40},{-46,-40}},
|
|---|
| 1122 | color={0,0,127},
|
|---|
| 1123 | smooth=Smooth.None));
|
|---|
| 1124 | connect(normalizeSpeed.y, effTable_.u2) annotation (Line(
|
|---|
| 1125 | points={{-23,-40},{-10,-40},{-10,-26.4},{1.2,-26.4}},
|
|---|
| 1126 | color={0,0,127},
|
|---|
| 1127 | smooth=Smooth.None));
|
|---|
| 1128 | annotation (
|
|---|
| 1129 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-80},
|
|---|
| 1130 | {100,80}}), graphics),
|
|---|
| 1131 | Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
|
|---|
| 1132 | {100,100}}), graphics={Rectangle(
|
|---|
| 1133 | extent={{-100,72},{100,-72}},
|
|---|
| 1134 | lineColor={0,0,0},
|
|---|
| 1135 | fillColor={255,255,255},
|
|---|
| 1136 | fillPattern=FillPattern.Solid),Line(
|
|---|
| 1137 | points={{-74,-54},{-74,58}},
|
|---|
| 1138 | color={0,0,0},
|
|---|
| 1139 | smooth=Smooth.None),Line(
|
|---|
| 1140 | points={{-82,-48},{78,-48}},
|
|---|
| 1141 | color={0,0,0},
|
|---|
| 1142 | smooth=Smooth.None),Line(
|
|---|
| 1143 | points={{-74,38},{-24,38},{-4,12},{28,-8},{60,-22},{
|
|---|
| 1144 | 62,-48}},
|
|---|
| 1145 | color={0,0,0},
|
|---|
| 1146 | smooth=Smooth.None),Polygon(
|
|---|
| 1147 | points={{-20,14},{-40,24},{-56,-4},{-38,-36},{12,-38},
|
|---|
| 1148 | {26,-28},{22,-20},{8,-6},{-8,4},{-20,14}},
|
|---|
| 1149 | lineColor={0,0,0},
|
|---|
| 1150 | smooth=Smooth.None,
|
|---|
| 1151 | fillColor={255,255,255},
|
|---|
| 1152 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 1153 | points={{-28,4},{-38,2},{-32,-20},{0,-32},{10,-28},{
|
|---|
| 1154 | 12,-20},{-28,4}},
|
|---|
| 1155 | lineColor={0,0,0},
|
|---|
| 1156 | smooth=Smooth.None,
|
|---|
| 1157 | fillColor={255,255,255},
|
|---|
| 1158 | fillPattern=FillPattern.Solid),Text(
|
|---|
| 1159 | extent={{-102,118},{100,78}},
|
|---|
| 1160 | lineColor={0,0,255},
|
|---|
| 1161 | fillColor={255,255,255},
|
|---|
| 1162 | fillPattern=FillPattern.Solid,
|
|---|
| 1163 | textString="%name"),Text(
|
|---|
| 1164 | extent={{26,46},{76,4}},
|
|---|
| 1165 | lineColor={0,0,0},
|
|---|
| 1166 | textString="M")}),
|
|---|
| 1167 | Documentation(info="<html>
|
|---|
| 1168 | <p>This block computes the machine and inverter losses from the mechanical input quantities and determines the power to be drawn from the electric circuit. The "drawn" power can be also a negative numer, meaning that themachine is actually delivering electric power.</p>
|
|---|
| 1169 | <p>The given efficiency map is intended as being built with torques being rations of actual torques to tauMax and speeds being ratios of w to wMax. In case the user uses, inthe given efficiency map, torques in Nm and speeds in rad/s, the block can be used selecting tauTmax=1, wMax=1.</p>
|
|---|
| 1170 | <p>The choice of having normalised efficiency computation allows simulations of machines different in sizes and similar in characteristics to be repeated without having to rebuild the efficiency maps. </p>
|
|---|
| 1171 | </html>"));
|
|---|
| 1172 | end ToElectricPower;
|
|---|
| 1173 | end Internal;
|
|---|
| 1174 | annotation (Icon(graphics={Ellipse(extent={{-38,40},{38,-36}}, lineColor=
|
|---|
| 1175 | {0,0,0}),Line(
|
|---|
| 1176 | points={{2,82},{-8,82},{-12,72},{-26,68},{-36,78},{-48,70},{-44,
|
|---|
| 1177 | 58},{-56,46},{-68,50},{-76,36},{-68,30},{-70,16},{-80,12},{-80,
|
|---|
| 1178 | 2}},
|
|---|
| 1179 | color={0,0,0},
|
|---|
| 1180 | smooth=Smooth.None),Line(
|
|---|
| 1181 | points={{2,-78},{-8,-78},{-12,-68},{-26,-64},{-36,-74},{-48,-66},
|
|---|
| 1182 | {-44,-54},{-56,-42},{-68,-46},{-76,-32},{-68,-26},{-70,-12},{-80,
|
|---|
| 1183 | -8},{-80,2}},
|
|---|
| 1184 | color={0,0,0},
|
|---|
| 1185 | smooth=Smooth.None),Line(
|
|---|
| 1186 | points={{0,-78},{10,-78},{14,-68},{28,-64},{38,-74},{50,-66},
|
|---|
| 1187 | {46,-54},{58,-42},{70,-46},{78,-32},{70,-26},{72,-12},{82,-8},{
|
|---|
| 1188 | 82,2}},
|
|---|
| 1189 | color={0,0,0},
|
|---|
| 1190 | smooth=Smooth.None),Line(
|
|---|
| 1191 | points={{0,82},{10,82},{14,72},{28,68},{38,78},{50,70},{46,58},
|
|---|
| 1192 | {58,46},{70,50},{78,36},{70,30},{72,16},{82,12},{82,2}},
|
|---|
| 1193 | color={0,0,0},
|
|---|
| 1194 | smooth=Smooth.None)}));
|
|---|
| 1195 | end MBsupport;
|
|---|
| 1196 |
|
|---|
| 1197 | package Partial
|
|---|
| 1198 | partial model PartialMBice
|
|---|
| 1199 | "Simple map-based Internal Combustion Engine model"
|
|---|
| 1200 | import Modelica.Constants.*;
|
|---|
| 1201 | parameter Real vMass=1300;
|
|---|
| 1202 | parameter Real wIceStart=167;
|
|---|
| 1203 | // rad/s
|
|---|
| 1204 | parameter Real inertiaJ=0.5 "rotor moment of inertia (N.m^2)";
|
|---|
| 1205 | parameter Real maxIceTau[:, :]=[0, 80; 100, 80; 350, 95; 500, 95]
|
|---|
| 1206 | "curve of maximum ice torque (Nm)";
|
|---|
| 1207 | parameter Real specificCons[:, :]=[0, 80; 100, 80; 350, 95; 500, 95]
|
|---|
| 1208 | "curve of ice specific consumption (g/kWh)";
|
|---|
| 1209 | Modelica.Mechanics.Rotational.Sensors.SpeedSensor w annotation (
|
|---|
| 1210 | Placement(visible=true, transformation(
|
|---|
| 1211 | origin={52,44},
|
|---|
| 1212 | extent={{-10,-10},{10,10}},
|
|---|
| 1213 | rotation=270)));
|
|---|
| 1214 | Modelica.Blocks.Math.Min min1 annotation (Placement(visible=true,
|
|---|
| 1215 | transformation(extent={{-48,50},{-28,70}}, rotation=0)));
|
|---|
| 1216 | Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a annotation (
|
|---|
| 1217 | Placement(
|
|---|
| 1218 | visible=true,
|
|---|
| 1219 | transformation(extent={{90,10},{110,30}}, rotation=0),
|
|---|
| 1220 | iconTransformation(extent={{90,10},{110,30}}, rotation=0)));
|
|---|
| 1221 | Modelica.Mechanics.Rotational.Sensors.PowerSensor icePow annotation (
|
|---|
| 1222 | Placement(visible=true, transformation(extent={{66,50},{86,70}},
|
|---|
| 1223 | rotation=0)));
|
|---|
| 1224 | Modelica.Mechanics.Rotational.Sources.Torque Tice annotation (Placement(
|
|---|
| 1225 | visible=true, transformation(extent={{-12,50},{8,70}}, rotation=0)));
|
|---|
| 1226 | Modelica.Mechanics.Rotational.Components.Inertia ICE(w(
|
|---|
| 1227 | fixed=true,
|
|---|
| 1228 | start=wIceStart,
|
|---|
| 1229 | displayUnit="rpm"), J=inertiaJ) annotation (Placement(visible=true,
|
|---|
| 1230 | transformation(extent={{16,50},{36,70}}, rotation=0)));
|
|---|
| 1231 | Modelica.Blocks.Tables.CombiTable1D toSpecCons(table=specificCons)
|
|---|
| 1232 | annotation (Placement(visible=true, transformation(
|
|---|
| 1233 | origin={44,12},
|
|---|
| 1234 | extent={{10,-10},{-10,10}},
|
|---|
| 1235 | rotation=90)));
|
|---|
| 1236 | Modelica.Blocks.Math.Product toPow0 annotation (Placement(visible=true,
|
|---|
| 1237 | transformation(
|
|---|
| 1238 | origin={2,12},
|
|---|
| 1239 | extent={{-10,-10},{10,10}},
|
|---|
| 1240 | rotation=-90)));
|
|---|
| 1241 | Modelica.Blocks.Math.Product toG_perHour annotation (Placement(visible=
|
|---|
| 1242 | true, transformation(
|
|---|
| 1243 | origin={26,-46},
|
|---|
| 1244 | extent={{-10,-10},{10,10}},
|
|---|
| 1245 | rotation=-90)));
|
|---|
| 1246 | // Modelica.Blocks.Continuous.Integrator toGrams(k = 1 / 3600000.0)
|
|---|
| 1247 | // annotation(Placement(visible = true, transformation(origin = {26, -44},
|
|---|
| 1248 | //extent = {{-10, -10}, {10, 10}}, rotation = 270)));
|
|---|
| 1249 | Modelica.Blocks.Tables.CombiTable1D toLimTau(table=maxIceTau)
|
|---|
| 1250 | annotation (Placement(visible=true, transformation(
|
|---|
| 1251 | origin={-72,66},
|
|---|
| 1252 | extent={{10,-10},{-10,10}},
|
|---|
| 1253 | rotation=180)));
|
|---|
| 1254 | Modelica.Blocks.Sources.RealExpression rotorW(y=w.w) annotation (
|
|---|
| 1255 | Placement(transformation(
|
|---|
| 1256 | extent={{-10,-10},{10,10}},
|
|---|
| 1257 | rotation=90,
|
|---|
| 1258 | origin={-88,36})));
|
|---|
| 1259 | Modelica.Blocks.Math.Gain tokW(k=1e-3) annotation (Placement(
|
|---|
| 1260 | transformation(
|
|---|
| 1261 | extent={{-10,-10},{10,10}},
|
|---|
| 1262 | rotation=-90,
|
|---|
| 1263 | origin={2,-18})));
|
|---|
| 1264 | equation
|
|---|
| 1265 | connect(toSpecCons.y[1], toG_perHour.u1) annotation (Line(points={{44,1},
|
|---|
| 1266 | {44,-34},{32,-34}}, color={0,0,127}));
|
|---|
| 1267 | connect(toPow0.u1, w.w)
|
|---|
| 1268 | annotation (Line(points={{8,24},{8,33},{52,33}}, color={0,0,127}));
|
|---|
| 1269 | connect(toPow0.u2, min1.y) annotation (Line(points={{-4,24},{-4,32},{-22,
|
|---|
| 1270 | 32},{-22,60},{-27,60}}, color={0,0,127}));
|
|---|
| 1271 | connect(toSpecCons.u[1], w.w)
|
|---|
| 1272 | annotation (Line(points={{44,24},{44,33},{52,33}}, color={0,0,127}));
|
|---|
| 1273 | connect(w.flange, ICE.flange_b)
|
|---|
| 1274 | annotation (Line(points={{52,54},{52,60},{36,60}}));
|
|---|
| 1275 | connect(icePow.flange_a, ICE.flange_b)
|
|---|
| 1276 | annotation (Line(points={{66,60},{36,60}}));
|
|---|
| 1277 | connect(Tice.flange, ICE.flange_a)
|
|---|
| 1278 | annotation (Line(points={{8,60},{16,60}}));
|
|---|
| 1279 | connect(Tice.tau, min1.y)
|
|---|
| 1280 | annotation (Line(points={{-14,60},{-27,60}}, color={0,0,127}));
|
|---|
| 1281 | connect(icePow.flange_b, flange_a)
|
|---|
| 1282 | annotation (Line(points={{86,60},{94,60},{94,20},{100,20}}));
|
|---|
| 1283 | connect(min1.u1, toLimTau.y[1]) annotation (Line(
|
|---|
| 1284 | points={{-50,66},{-61,66}},
|
|---|
| 1285 | color={0,0,127},
|
|---|
| 1286 | smooth=Smooth.None));
|
|---|
| 1287 | connect(toLimTau.u[1], rotorW.y) annotation (Line(
|
|---|
| 1288 | points={{-84,66},{-88,66},{-88,47}},
|
|---|
| 1289 | color={0,0,127},
|
|---|
| 1290 | smooth=Smooth.None));
|
|---|
| 1291 | connect(toPow0.y, tokW.u) annotation (Line(
|
|---|
| 1292 | points={{2,1},{2,-6}},
|
|---|
| 1293 | color={0,0,127},
|
|---|
| 1294 | smooth=Smooth.None));
|
|---|
| 1295 | connect(tokW.y, toG_perHour.u2) annotation (Line(
|
|---|
| 1296 | points={{2,-29},{12,-29},{12,-26},{20,-26},{20,-34}},
|
|---|
| 1297 | color={0,0,127},
|
|---|
| 1298 | smooth=Smooth.None));
|
|---|
| 1299 | annotation (
|
|---|
| 1300 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-80},
|
|---|
| 1301 | {100,80}}), graphics),
|
|---|
| 1302 | experiment(
|
|---|
| 1303 | StopTime=200,
|
|---|
| 1304 | __Dymola_NumberOfIntervals=1000,
|
|---|
| 1305 | __Dymola_Algorithm="Lsodar"),
|
|---|
| 1306 | __Dymola_experimentSetupOutput,
|
|---|
| 1307 | Documentation(info="<html>
|
|---|
| 1308 | <h4>Basic map-based ICE model.</h4>
|
|---|
| 1309 | <p>It receives as input the reference torque as a fracton of the maximum deliverable torque at a given speed. It can be approximately thought as a signal proportional to the accelerator position fo the vehicle.</p>
|
|---|
| 1310 | <p>The generated torque is the minimum between this signal and the maximum deliverable torque at the actual engine speed (defined by means of a table).</p>
|
|---|
| 1311 | <p>From the generated torque and speed the fuel consumption is computed.</p>
|
|---|
| 1312 | </html>"),
|
|---|
| 1313 | Icon(coordinateSystem(
|
|---|
| 1314 | extent={{-100,-100},{100,100}},
|
|---|
| 1315 | preserveAspectRatio=false,
|
|---|
| 1316 | initialScale=0.1,
|
|---|
| 1317 | grid={2,2}), graphics={Rectangle(
|
|---|
| 1318 | extent={{-100,80},{100,-80}},
|
|---|
| 1319 | lineColor={0,0,0},
|
|---|
| 1320 | fillColor={255,255,255},
|
|---|
| 1321 | fillPattern=FillPattern.Solid),Rectangle(
|
|---|
| 1322 | fillColor={192,192,192},
|
|---|
| 1323 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 1324 | extent={{-24,68},{76,-24}}),Rectangle(
|
|---|
| 1325 | fillColor={192,192,192},
|
|---|
| 1326 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 1327 | extent={{76,30},{100,10}}),Text(
|
|---|
| 1328 | extent={{-140,-32},{140,-70}},
|
|---|
| 1329 | textString="J=%inertiaJ",
|
|---|
| 1330 | lineColor={0,0,0}),Text(
|
|---|
| 1331 | origin={0,30},
|
|---|
| 1332 | lineColor={0,0,255},
|
|---|
| 1333 | extent={{-140,100},{140,60}},
|
|---|
| 1334 | textString="%name"),Rectangle(extent={{-90,68},{-32,-26}}),
|
|---|
| 1335 | Rectangle(
|
|---|
| 1336 | fillColor={95,95,95},
|
|---|
| 1337 | fillPattern=FillPattern.Solid,
|
|---|
| 1338 | extent={{-90,22},{-32,0}}),Line(points={{-60,56},{-60,32}}),
|
|---|
| 1339 | Polygon(points={{-60,66},{-66,56},{-54,56},{-60,66}}),Polygon(
|
|---|
| 1340 | points={{-60,24},{-66,34},{-54,34},{-60,24}}),Rectangle(
|
|---|
| 1341 | fillColor={135,135,135},
|
|---|
| 1342 | fillPattern=FillPattern.Solid,
|
|---|
| 1343 | extent={{-64,0},{-54,-20}})}));
|
|---|
| 1344 | end PartialMBice;
|
|---|
| 1345 |
|
|---|
| 1346 | model PartialMBOneFlange
|
|---|
| 1347 | "Partial map-based one-Flange electric drive model"
|
|---|
| 1348 | parameter Real powMax=22000 "Maximum drive power (W)";
|
|---|
| 1349 | parameter Real tauMax=80 "Maximum drive torque (Nm)";
|
|---|
| 1350 | parameter Real wMax(start=3000, min=powMax/tauMax)
|
|---|
| 1351 | "Maximum drive speed (rad/s)";
|
|---|
| 1352 | parameter Real J=0.25 "Rotor's moment of inertia (kg.m^2)";
|
|---|
| 1353 | Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a
|
|---|
| 1354 | "Left flange of shaft" annotation (Placement(transformation(extent={{
|
|---|
| 1355 | 88,50},{108,70}}, rotation=0), iconTransformation(extent={{90,
|
|---|
| 1356 | -10},{110,10}})));
|
|---|
| 1357 | Modelica.Mechanics.Rotational.Sensors.SpeedSensor wSensor annotation (
|
|---|
| 1358 | Placement(transformation(
|
|---|
| 1359 | extent={{8,-8},{-8,8}},
|
|---|
| 1360 | rotation=90,
|
|---|
| 1361 | origin={78,44})));
|
|---|
| 1362 | Modelica.Blocks.Math.Abs abs1
|
|---|
| 1363 | annotation (Placement(transformation(extent={{62,16},{46,32}})));
|
|---|
| 1364 | MBsupport.Internal.LimTau limTau(
|
|---|
| 1365 | tauMax=tauMax,
|
|---|
| 1366 | wMax=wMax,
|
|---|
| 1367 | powMax=powMax)
|
|---|
| 1368 | annotation (Placement(transformation(extent={{36,18},{16,42}})));
|
|---|
| 1369 | MBsupport.Internal.ToElectricPower effMap(
|
|---|
| 1370 | tauMax=tauMax,
|
|---|
| 1371 | wMax=wMax,
|
|---|
| 1372 | powMax=powMax)
|
|---|
| 1373 | annotation (Placement(transformation(extent={{-6,-28},{-26,-8}})));
|
|---|
| 1374 | Modelica.Electrical.Analog.Interfaces.PositivePin pin_p annotation (
|
|---|
| 1375 | Placement(transformation(extent={{-110,30},{-90,50}}),
|
|---|
| 1376 | iconTransformation(extent={{-110,30},{-90,50}})));
|
|---|
| 1377 | Modelica.Electrical.Analog.Interfaces.NegativePin pin_n annotation (
|
|---|
| 1378 | Placement(transformation(extent={{-110,-50},{-90,-30}}),
|
|---|
| 1379 | iconTransformation(extent={{-110,-50},{-90,-30}})));
|
|---|
| 1380 | SupportModels.Internal.ConstPDC constPDC(k=10, T=0.01) annotation (
|
|---|
| 1381 | Placement(transformation(
|
|---|
| 1382 | extent={{-10,-10},{10,10}},
|
|---|
| 1383 | rotation=0,
|
|---|
| 1384 | origin={-100,0})));
|
|---|
| 1385 | Modelica.Mechanics.Rotational.Components.Inertia inertia(J=J)
|
|---|
| 1386 | annotation (Placement(transformation(extent={{22,50},{42,70}})));
|
|---|
| 1387 | Modelica.Mechanics.Rotational.Sources.Torque torque
|
|---|
| 1388 | annotation (Placement(transformation(extent={{-16,50},{4,70}})));
|
|---|
| 1389 | Modelica.Blocks.Math.Gain gain(k=1)
|
|---|
| 1390 | annotation (Placement(transformation(extent={{-64,-10},{-84,10}})));
|
|---|
| 1391 | Modelica.Mechanics.Rotational.Sensors.PowerSensor powSensor
|
|---|
| 1392 | annotation (Placement(transformation(extent={{50,50},{70,70}})));
|
|---|
| 1393 | Modelica.Blocks.Math.Min createTau annotation (Placement(visible=true,
|
|---|
| 1394 | transformation(extent={{-26,0},{-6,20}}, rotation=0)));
|
|---|
| 1395 | equation
|
|---|
| 1396 | assert(wMax >= powMax/tauMax, "\n****\n" +
|
|---|
| 1397 | "PARAMETER VERIFICATION ERROR:\nwMax must be not lower than powMax/tauMax"
|
|---|
| 1398 | + "\n***\n");
|
|---|
| 1399 | connect(abs1.u, wSensor.w) annotation (Line(
|
|---|
| 1400 | points={{63.6,24},{78,24},{78,35.2}},
|
|---|
| 1401 | color={0,0,127},
|
|---|
| 1402 | smooth=Smooth.None));
|
|---|
| 1403 | connect(effMap.w, wSensor.w) annotation (Line(
|
|---|
| 1404 | points={{-4,-22},{78,-22},{78,35.2}},
|
|---|
| 1405 | color={0,0,127},
|
|---|
| 1406 | smooth=Smooth.None));
|
|---|
| 1407 | connect(pin_p, constPDC.pin_p) annotation (Line(
|
|---|
| 1408 | points={{-100,40},{-100,10}},
|
|---|
| 1409 | color={0,0,255},
|
|---|
| 1410 | smooth=Smooth.None));
|
|---|
| 1411 | connect(pin_n, constPDC.pin_n) annotation (Line(
|
|---|
| 1412 | points={{-100,-40},{-100,-9.8}},
|
|---|
| 1413 | color={0,0,255},
|
|---|
| 1414 | smooth=Smooth.None));
|
|---|
| 1415 | connect(constPDC.Pref, gain.y) annotation (Line(
|
|---|
| 1416 | points={{-91.8,0},{-85,0}},
|
|---|
| 1417 | color={0,0,127},
|
|---|
| 1418 | smooth=Smooth.None));
|
|---|
| 1419 | connect(limTau.w, abs1.y) annotation (Line(
|
|---|
| 1420 | points={{38,30},{42,30},{42,24},{45.2,24}},
|
|---|
| 1421 | color={0,0,127},
|
|---|
| 1422 | smooth=Smooth.None));
|
|---|
| 1423 | connect(powSensor.flange_b, flange_a) annotation (Line(
|
|---|
| 1424 | points={{70,60},{98,60}},
|
|---|
| 1425 | color={0,0,0},
|
|---|
| 1426 | smooth=Smooth.None));
|
|---|
| 1427 | connect(wSensor.flange, flange_a) annotation (Line(
|
|---|
| 1428 | points={{78,52},{78,60},{98,60}},
|
|---|
| 1429 | color={0,0,0},
|
|---|
| 1430 | smooth=Smooth.None));
|
|---|
| 1431 | connect(effMap.elePow, gain.u) annotation (Line(
|
|---|
| 1432 | points={{-27,-18},{-46,-18},{-46,0},{-62,0}},
|
|---|
| 1433 | color={0,0,127},
|
|---|
| 1434 | smooth=Smooth.None));
|
|---|
| 1435 | connect(inertia.flange_a, torque.flange) annotation (Line(
|
|---|
| 1436 | points={{22,60},{4,60}},
|
|---|
| 1437 | color={0,0,0},
|
|---|
| 1438 | smooth=Smooth.None));
|
|---|
| 1439 | connect(inertia.flange_b, powSensor.flange_a) annotation (Line(
|
|---|
| 1440 | points={{42,60},{50,60}},
|
|---|
| 1441 | color={0,0,0},
|
|---|
| 1442 | smooth=Smooth.None));
|
|---|
| 1443 | connect(limTau.y, createTau.u1) annotation (Line(
|
|---|
| 1444 | points={{15,30},{-40,30},{-40,16},{-28,16}},
|
|---|
| 1445 | color={0,0,127},
|
|---|
| 1446 | smooth=Smooth.None));
|
|---|
| 1447 | connect(createTau.y, torque.tau) annotation (Line(
|
|---|
| 1448 | points={{-5,10},{6,10},{6,40},{-40,40},{-40,60},{-18,60}},
|
|---|
| 1449 | color={0,0,127},
|
|---|
| 1450 | smooth=Smooth.None));
|
|---|
| 1451 | connect(createTau.y, effMap.tau) annotation (Line(
|
|---|
| 1452 | points={{-5,10},{6,10},{6,-14},{-4,-14}},
|
|---|
| 1453 | color={0,0,127},
|
|---|
| 1454 | smooth=Smooth.None));
|
|---|
| 1455 | annotation (
|
|---|
| 1456 | Diagram(coordinateSystem(
|
|---|
| 1457 | extent={{-100,-80},{100,80}},
|
|---|
| 1458 | preserveAspectRatio=false,
|
|---|
| 1459 | initialScale=0.1,
|
|---|
| 1460 | grid={2,2}), graphics),
|
|---|
| 1461 | Icon(coordinateSystem(
|
|---|
| 1462 | extent={{-100,-100},{100,100}},
|
|---|
| 1463 | preserveAspectRatio=false,
|
|---|
| 1464 | initialScale=0.1,
|
|---|
| 1465 | grid={2,2}), graphics={Rectangle(
|
|---|
| 1466 | extent={{-70,80},{100,-80}},
|
|---|
| 1467 | lineColor={0,0,0},
|
|---|
| 1468 | fillColor={255,255,255},
|
|---|
| 1469 | fillPattern=FillPattern.Solid),Rectangle(
|
|---|
| 1470 | fillColor={192,192,192},
|
|---|
| 1471 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 1472 | extent={{-48,48},{52,-44}}),Line(points={{62,-7},{82,-7}}),
|
|---|
| 1473 | Rectangle(
|
|---|
| 1474 | fillColor={192,192,192},
|
|---|
| 1475 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 1476 | extent={{52,10},{100,-10}}),Text(
|
|---|
| 1477 | origin={-14,-36},
|
|---|
| 1478 | extent={{-140,-54},{160,-94}},
|
|---|
| 1479 | textString="J=%J"),Line(points={{-98,40},{-70,40}}, color
|
|---|
| 1480 | ={0,0,255}),Line(points={{-92,-40},{-70,-40}}, color={0,0,255}),
|
|---|
| 1481 | Text( origin={0,20},
|
|---|
| 1482 | lineColor={0,0,255},
|
|---|
| 1483 | extent={{-70,98},{100,60}},
|
|---|
| 1484 | textString="%name",
|
|---|
| 1485 | fillPattern=FillPattern.Solid,
|
|---|
| 1486 | fillColor={255,255,255})}),
|
|---|
| 1487 | Documentation(info="<html>
|
|---|
| 1488 | <p>One-flange electric drive.</p>
|
|---|
| 1489 | <p>The input signal is the requested normalised torque (1 means nominal torque)</p>
|
|---|
| 1490 | </html>"));
|
|---|
| 1491 | end PartialMBOneFlange;
|
|---|
| 1492 |
|
|---|
| 1493 | model PartialMBTwoFlange
|
|---|
| 1494 | "Simple map-based two-flange electric drive model"
|
|---|
| 1495 | parameter Real powMax(start=50000) "Maximum Mechanical drive power (W)";
|
|---|
| 1496 | parameter Real tauMax(start=400) "Maximum drive Torque (Nm)";
|
|---|
| 1497 | parameter Real wMax(start=650) "Maximum drive speed (rad/s)";
|
|---|
| 1498 | parameter Real J=0.59 "Moment of Inertia (kg.m^2)";
|
|---|
| 1499 | // Real state=limTau.state;
|
|---|
| 1500 | MBsupport.Internal.LimTau limTau(
|
|---|
| 1501 | tauMax=tauMax,
|
|---|
| 1502 | wMax=wMax,
|
|---|
| 1503 | powMax=powMax)
|
|---|
| 1504 | annotation (Placement(transformation(extent={{-54,-8},{-32,14}})));
|
|---|
| 1505 | MBsupport.Internal.InertiaTq inertia(w(displayUnit="rad/s", start=0), J
|
|---|
| 1506 | =J) annotation (Placement(transformation(extent={{6,40},{26,60}})));
|
|---|
| 1507 | Modelica.Mechanics.Rotational.Sensors.SpeedSensor speedRing annotation
|
|---|
| 1508 | (Placement(transformation(
|
|---|
| 1509 | extent={{-10,-10},{10,10}},
|
|---|
| 1510 | rotation=270,
|
|---|
| 1511 | origin={-80,40})));
|
|---|
| 1512 | Modelica.Blocks.Math.Abs abs1
|
|---|
| 1513 | annotation (Placement(transformation(extent={{-76,-4},{-62,10}})));
|
|---|
| 1514 | MBsupport.Internal.ToElectricPower effMap(
|
|---|
| 1515 | tauMax=tauMax,
|
|---|
| 1516 | wMax=wMax,
|
|---|
| 1517 | powMax=powMax)
|
|---|
| 1518 | annotation (Placement(transformation(extent={{20,-46},{40,-26}})));
|
|---|
| 1519 | SupportModels.Internal.ConstPDC constPDC(k=10, T=0.01) annotation (
|
|---|
| 1520 | Placement(transformation(
|
|---|
| 1521 | extent={{-10,10},{10,-10}},
|
|---|
| 1522 | rotation=-90,
|
|---|
| 1523 | origin={0,100})));
|
|---|
| 1524 | Modelica.Mechanics.Rotational.Sensors.PowerSensor outAPow
|
|---|
| 1525 | annotation (Placement(transformation(extent={{62,40},{82,60}})));
|
|---|
| 1526 | Modelica.Mechanics.Rotational.Sensors.PowerSensor outBPow
|
|---|
| 1527 | annotation (Placement(transformation(extent={{-18,40},{-38,60}})));
|
|---|
| 1528 | Modelica.Blocks.Math.Add add annotation (Placement(transformation(
|
|---|
| 1529 | extent={{-10,-10},{10,10}},
|
|---|
| 1530 | rotation=-90,
|
|---|
| 1531 | origin={28,10})));
|
|---|
| 1532 | Modelica.Mechanics.Rotational.Interfaces.Flange_b flange_b
|
|---|
| 1533 | "Right flange of shaft" annotation (Placement(
|
|---|
| 1534 | visible=true,
|
|---|
| 1535 | transformation(extent={{90,40},{110,60}}, rotation=0),
|
|---|
| 1536 | iconTransformation(extent={{90,-12},{110,8}}, rotation=0)));
|
|---|
| 1537 | Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a
|
|---|
| 1538 | "Left flange of shaft" annotation (Placement(
|
|---|
| 1539 | visible=true,
|
|---|
| 1540 | transformation(extent={{-110,40},{-90,60}}, rotation=0),
|
|---|
| 1541 | iconTransformation(extent={{-110,-10},{-90,10}}, rotation=0)));
|
|---|
| 1542 | Modelica.Electrical.Analog.Interfaces.PositivePin pin_p annotation (
|
|---|
| 1543 | Placement(
|
|---|
| 1544 | visible=true,
|
|---|
| 1545 | transformation(extent={{-70,90},{-50,110}}, rotation=0),
|
|---|
| 1546 | iconTransformation(extent={{-50,88},{-30,108}}, rotation=0)));
|
|---|
| 1547 | Modelica.Electrical.Analog.Interfaces.NegativePin pin_n annotation (
|
|---|
| 1548 | Placement(
|
|---|
| 1549 | visible=true,
|
|---|
| 1550 | transformation(extent={{30,90},{50,110}}, rotation=0),
|
|---|
| 1551 | iconTransformation(extent={{30,90},{50,110}}, rotation=0)));
|
|---|
| 1552 | Modelica.Blocks.Math.Min createTau annotation (Placement(visible=true,
|
|---|
| 1553 | transformation(extent={{-18,-14},{2,6}}, rotation=0)));
|
|---|
| 1554 | equation
|
|---|
| 1555 | connect(flange_a, speedRing.flange) annotation (Line(
|
|---|
| 1556 | points={{-100,50},{-80,50}},
|
|---|
| 1557 | color={0,0,0},
|
|---|
| 1558 | smooth=Smooth.None));
|
|---|
| 1559 | connect(abs1.u, speedRing.w) annotation (Line(
|
|---|
| 1560 | points={{-77.40000000000001,3},{-80,3},{-80,29}},
|
|---|
| 1561 | color={0,0,127},
|
|---|
| 1562 | smooth=Smooth.None));
|
|---|
| 1563 | connect(limTau.w, abs1.y) annotation (Line(
|
|---|
| 1564 | points={{-56.2,3},{-61.3,3}},
|
|---|
| 1565 | color={0,0,127},
|
|---|
| 1566 | smooth=Smooth.None));
|
|---|
| 1567 | connect(effMap.w, speedRing.w) annotation (Line(
|
|---|
| 1568 | points={{18,-40},{-80,-40},{-80,29}},
|
|---|
| 1569 | color={0,0,127},
|
|---|
| 1570 | smooth=Smooth.None));
|
|---|
| 1571 | connect(pin_p, constPDC.pin_p) annotation (Line(
|
|---|
| 1572 | points={{-60,100},{-10,100}},
|
|---|
| 1573 | color={0,0,255},
|
|---|
| 1574 | smooth=Smooth.None));
|
|---|
| 1575 | connect(pin_n, constPDC.pin_n) annotation (Line(
|
|---|
| 1576 | points={{40,100},{9.8,100}},
|
|---|
| 1577 | color={0,0,255},
|
|---|
| 1578 | smooth=Smooth.None));
|
|---|
| 1579 | connect(effMap.elePow, constPDC.Pref) annotation (Line(
|
|---|
| 1580 | points={{41,-36},{52,-36},{52,80},{0,80},{0,91.8}},
|
|---|
| 1581 | color={0,0,127},
|
|---|
| 1582 | smooth=Smooth.None));
|
|---|
| 1583 | connect(flange_b, outAPow.flange_b) annotation (Line(
|
|---|
| 1584 | points={{100,50},{82,50}},
|
|---|
| 1585 | color={0,0,0},
|
|---|
| 1586 | smooth=Smooth.None));
|
|---|
| 1587 | connect(inertia.flange_b, outAPow.flange_a) annotation (Line(
|
|---|
| 1588 | points={{26,50},{62,50}},
|
|---|
| 1589 | color={0,0,0},
|
|---|
| 1590 | smooth=Smooth.None));
|
|---|
| 1591 | connect(inertia.flange_a, outBPow.flange_a) annotation (Line(
|
|---|
| 1592 | points={{6,50},{-18,50}},
|
|---|
| 1593 | color={0,0,0},
|
|---|
| 1594 | smooth=Smooth.None));
|
|---|
| 1595 | connect(outBPow.flange_b, speedRing.flange) annotation (Line(
|
|---|
| 1596 | points={{-38,50},{-80,50}},
|
|---|
| 1597 | color={0,0,0},
|
|---|
| 1598 | smooth=Smooth.None));
|
|---|
| 1599 | connect(add.u1, outAPow.power) annotation (Line(
|
|---|
| 1600 | points={{34,22},{34,28},{64,28},{64,39}},
|
|---|
| 1601 | color={0,0,127},
|
|---|
| 1602 | smooth=Smooth.None));
|
|---|
| 1603 | connect(add.u2, outBPow.power) annotation (Line(
|
|---|
| 1604 | points={{22,22},{22,28},{-20,28},{-20,39}},
|
|---|
| 1605 | color={0,0,127},
|
|---|
| 1606 | smooth=Smooth.None));
|
|---|
| 1607 | connect(limTau.y, createTau.u1) annotation (Line(
|
|---|
| 1608 | points={{-30.9,3},{-26,3},{-26,2},{-20,2}},
|
|---|
| 1609 | color={0,0,127},
|
|---|
| 1610 | smooth=Smooth.None));
|
|---|
| 1611 | connect(createTau.y, inertia.tau) annotation (Line(
|
|---|
| 1612 | points={{3,-4},{10.55,-4},{10.55,40}},
|
|---|
| 1613 | color={0,0,127},
|
|---|
| 1614 | smooth=Smooth.None));
|
|---|
| 1615 | connect(effMap.tau, inertia.tau) annotation (Line(
|
|---|
| 1616 | points={{18,-32},{10,-32},{10,-4},{10.55,-4},{10.55,40}},
|
|---|
| 1617 | color={0,0,127},
|
|---|
| 1618 | smooth=Smooth.None));
|
|---|
| 1619 | annotation (
|
|---|
| 1620 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
|
|---|
| 1621 | {100,100}}), graphics),
|
|---|
| 1622 | Icon(coordinateSystem(
|
|---|
| 1623 | extent={{-100,-100},{100,100}},
|
|---|
| 1624 | preserveAspectRatio=false,
|
|---|
| 1625 | initialScale=0.1,
|
|---|
| 1626 | grid={2,2}), graphics={Rectangle(
|
|---|
| 1627 | origin={-25,2},
|
|---|
| 1628 | extent={{-75,74},{125,-74}},
|
|---|
| 1629 | lineColor={0,0,0},
|
|---|
| 1630 | fillColor={255,255,255},
|
|---|
| 1631 | fillPattern=FillPattern.Solid),Text(
|
|---|
| 1632 | origin={4,-6},
|
|---|
| 1633 | lineColor={0,0,255},
|
|---|
| 1634 | extent={{-110,84},{100,44}},
|
|---|
| 1635 | textString="%name"),Rectangle(
|
|---|
| 1636 | fillColor={192,192,192},
|
|---|
| 1637 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 1638 | extent={{-64,38},{64,-44}}),Rectangle(
|
|---|
| 1639 | fillColor={192,192,192},
|
|---|
| 1640 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 1641 | extent={{-100,10},{-64,-10}}),Rectangle(
|
|---|
| 1642 | fillColor={192,192,192},
|
|---|
| 1643 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 1644 | extent={{64,8},{100,-12}}),Line(
|
|---|
| 1645 | origin={20,0},
|
|---|
| 1646 | points={{-60,94},{-60,76}},
|
|---|
| 1647 | color={0,0,255}),Line(
|
|---|
| 1648 | origin={-20,0},
|
|---|
| 1649 | points={{60,94},{60,76}},
|
|---|
| 1650 | color={0,0,255}),Text(
|
|---|
| 1651 | origin={66,-32},
|
|---|
| 1652 | extent={{-108,-46},{100,-84}},
|
|---|
| 1653 | textString="J=%J")}),
|
|---|
| 1654 | Documentation(info="<html>
|
|---|
| 1655 | <p>This model receives from the connector the torque request (variable MotTauInt) and trieds to deliver it.</p>
|
|---|
| 1656 | <p>Howeve,r before delivering the requested torque, the model limits it considering the maximum deliverable torque and power. In addition it computes and considers inner losses as determined by means of a map. </p>
|
|---|
| 1657 | </html>"));
|
|---|
| 1658 | end PartialMBTwoFlange;
|
|---|
| 1659 | end Partial;
|
|---|
| 1660 |
|
|---|
| 1661 | package TestingModels
|
|---|
| 1662 | extends Modelica.Icons.ExamplesPackage;
|
|---|
| 1663 |
|
|---|
| 1664 | model TestMBIce
|
|---|
| 1665 | MBice mBice(wIceStart=90)
|
|---|
| 1666 | annotation (Placement(transformation(extent={{-20,-2},{0,18}})));
|
|---|
| 1667 | Modelica.Mechanics.Rotational.Components.Inertia inertia(J=0.5, phi(
|
|---|
| 1668 | start=0, fixed=true))
|
|---|
| 1669 | annotation (Placement(transformation(extent={{10,0},{30,20}})));
|
|---|
| 1670 | Modelica.Mechanics.Rotational.Sources.QuadraticSpeedDependentTorque
|
|---|
| 1671 | loadTorque(w_nominal=100, tau_nominal=-80)
|
|---|
| 1672 | annotation (Placement(transformation(extent={{64,0},{44,20}})));
|
|---|
| 1673 | Modelica.Blocks.Sources.Trapezoid trapezoid(
|
|---|
| 1674 | rising=10,
|
|---|
| 1675 | width=10,
|
|---|
| 1676 | falling=10,
|
|---|
| 1677 | period=1e6,
|
|---|
| 1678 | startTime=10,
|
|---|
| 1679 | offset=60,
|
|---|
| 1680 | amplitude=30)
|
|---|
| 1681 | annotation (Placement(transformation(extent={{-50,-38},{-30,-18}})));
|
|---|
| 1682 | equation
|
|---|
| 1683 | connect(mBice.flange_a, inertia.flange_a) annotation (Line(
|
|---|
| 1684 | points={{0,10},{10,10}},
|
|---|
| 1685 | color={0,0,0},
|
|---|
| 1686 | smooth=Smooth.None));
|
|---|
| 1687 | connect(inertia.flange_b, loadTorque.flange) annotation (Line(
|
|---|
| 1688 | points={{30,10},{44,10}},
|
|---|
| 1689 | color={0,0,0},
|
|---|
| 1690 | smooth=Smooth.None));
|
|---|
| 1691 | connect(mBice.tauRef, trapezoid.y) annotation (Line(
|
|---|
| 1692 | points={{-16,-2},{-16,-28},{-29,-28}},
|
|---|
| 1693 | color={0,0,127},
|
|---|
| 1694 | smooth=Smooth.None));
|
|---|
| 1695 | annotation (
|
|---|
| 1696 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-80,-60},
|
|---|
| 1697 | {80,60}}), graphics),
|
|---|
| 1698 | experiment(StopTime=50),
|
|---|
| 1699 | __Dymola_experimentSetupOutput,
|
|---|
| 1700 | Icon(coordinateSystem(extent={{-80,-60},{80,60}})),
|
|---|
| 1701 | Documentation(info="<html>
|
|---|
| 1702 | <p>This is a simple test of model MBIce.</p>
|
|---|
| 1703 | <p>It shows that the generated torque follows the torque request as long as the maximum allowed is not overcome; otherwise this maximum is generated.</p>
|
|---|
| 1704 | <p>It shows also the fuel consumption output.</p>
|
|---|
| 1705 | <p>The user could compare the torque request with the torque generated and at the ICE flange (with this transient the inertia torques are very small and can be neglected). The user could also have a look at the rotational speeds and fuel consumption. </p>
|
|---|
| 1706 | </html>"));
|
|---|
| 1707 | end TestMBIce;
|
|---|
| 1708 |
|
|---|
| 1709 | model TestMBOneFlange
|
|---|
| 1710 | Modelica.Mechanics.Rotational.Components.Inertia inertia(
|
|---|
| 1711 | J=0.5,
|
|---|
| 1712 | phi(start=0, fixed=true),
|
|---|
| 1713 | w(start=50, fixed=true))
|
|---|
| 1714 | annotation (Placement(transformation(extent={{38,0},{58,20}})));
|
|---|
| 1715 | Modelica.Mechanics.Rotational.Sources.QuadraticSpeedDependentTorque
|
|---|
| 1716 | loadTorque(tau_nominal=-50, w_nominal=400)
|
|---|
| 1717 | annotation (Placement(transformation(extent={{92,0},{72,20}})));
|
|---|
| 1718 | Modelica.Blocks.Sources.Trapezoid tauRef(
|
|---|
| 1719 | rising=10,
|
|---|
| 1720 | width=10,
|
|---|
| 1721 | falling=10,
|
|---|
| 1722 | period=1e6,
|
|---|
| 1723 | startTime=10,
|
|---|
| 1724 | amplitude=50,
|
|---|
| 1725 | offset=20)
|
|---|
| 1726 | annotation (Placement(transformation(extent={{-50,-38},{-30,-18}})));
|
|---|
| 1727 | MBOneFlange oneFlange(
|
|---|
| 1728 | powMax=10000,
|
|---|
| 1729 | tauMax=50,
|
|---|
| 1730 | J=0.5,
|
|---|
| 1731 | wMax=300)
|
|---|
| 1732 | annotation (Placement(transformation(extent={{-22,0},{-2,20}})));
|
|---|
| 1733 | Modelica.Electrical.Analog.Sources.ConstantVoltage gen(V=100)
|
|---|
| 1734 | annotation (Placement(transformation(
|
|---|
| 1735 | extent={{-10,-10},{10,10}},
|
|---|
| 1736 | rotation=-90,
|
|---|
| 1737 | origin={-64,10})));
|
|---|
| 1738 | Modelica.Electrical.Analog.Basic.Ground ground
|
|---|
| 1739 | annotation (Placement(transformation(extent={{-90,-20},{-70,0}})));
|
|---|
| 1740 | Modelica.Mechanics.Rotational.Sensors.PowerSensor powMech
|
|---|
| 1741 | annotation (Placement(transformation(extent={{12,0},{32,20}})));
|
|---|
| 1742 | Modelica.Electrical.Analog.Sensors.PowerSensor powElec
|
|---|
| 1743 | annotation (Placement(transformation(extent={{-52,14},{-32,34}})));
|
|---|
| 1744 | equation
|
|---|
| 1745 | connect(inertia.flange_b, loadTorque.flange) annotation (Line(
|
|---|
| 1746 | points={{58,10},{72,10}},
|
|---|
| 1747 | color={0,0,0},
|
|---|
| 1748 | smooth=Smooth.None));
|
|---|
| 1749 | connect(tauRef.y, oneFlange.tauRef) annotation (Line(
|
|---|
| 1750 | points={{-29,-28},{-3,-28},{-3,1.4}},
|
|---|
| 1751 | color={0,0,127},
|
|---|
| 1752 | smooth=Smooth.None));
|
|---|
| 1753 | connect(ground.p, gen.n) annotation (Line(
|
|---|
| 1754 | points={{-80,0},{-64,0}},
|
|---|
| 1755 | color={0,0,255},
|
|---|
| 1756 | smooth=Smooth.None));
|
|---|
| 1757 | connect(oneFlange.flange_a, powMech.flange_a) annotation (Line(
|
|---|
| 1758 | points={{-2,10},{12,10}},
|
|---|
| 1759 | color={0,0,0},
|
|---|
| 1760 | smooth=Smooth.None));
|
|---|
| 1761 | connect(inertia.flange_a, powMech.flange_b) annotation (Line(
|
|---|
| 1762 | points={{38,10},{32,10}},
|
|---|
| 1763 | color={0,0,0},
|
|---|
| 1764 | smooth=Smooth.None));
|
|---|
| 1765 | connect(powElec.nc, oneFlange.pin_p) annotation (Line(
|
|---|
| 1766 | points={{-32,24},{-22,24},{-22,14}},
|
|---|
| 1767 | color={0,0,255},
|
|---|
| 1768 | smooth=Smooth.None));
|
|---|
| 1769 | connect(powElec.pc, gen.p) annotation (Line(
|
|---|
| 1770 | points={{-52,24},{-64,24},{-64,20}},
|
|---|
| 1771 | color={0,0,255},
|
|---|
| 1772 | smooth=Smooth.None));
|
|---|
| 1773 | connect(powElec.pv, powElec.nc) annotation (Line(
|
|---|
| 1774 | points={{-42,34},{-36,34},{-36,34},{-32,34},{-32,24}},
|
|---|
| 1775 | color={0,0,255},
|
|---|
| 1776 | smooth=Smooth.None));
|
|---|
| 1777 | connect(gen.n, oneFlange.pin_n) annotation (Line(
|
|---|
| 1778 | points={{-64,0},{-22,0},{-22,6}},
|
|---|
| 1779 | color={0,0,255},
|
|---|
| 1780 | smooth=Smooth.None));
|
|---|
| 1781 | connect(powElec.nv, oneFlange.pin_n) annotation (Line(
|
|---|
| 1782 | points={{-42,14},{-42,0},{-22,0},{-22,6}},
|
|---|
| 1783 | color={0,0,255},
|
|---|
| 1784 | smooth=Smooth.None));
|
|---|
| 1785 | annotation (
|
|---|
| 1786 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-60},
|
|---|
| 1787 | {100,60}}), graphics),
|
|---|
| 1788 | experiment(StopTime=50),
|
|---|
| 1789 | __Dymola_experimentSetupOutput,
|
|---|
| 1790 | Icon(coordinateSystem(extent={{-100,-100},{100,100}})),
|
|---|
| 1791 | Documentation(info="<html>
|
|---|
| 1792 | <p>This is a simple test of model MBOneFlange.</p>
|
|---|
| 1793 | <p>It shows that the generated torque follows the normalised torque request as long as it does not overcome unity. Actual torque will be this request times the maximum value that, in turn, is the minimum between tauMax and poweMax/w (while w is the rotational speed)</p>
|
|---|
| 1794 | <p>It shows also the effects of efficiency on the DC power.</p>
|
|---|
| 1795 | <p>Finally it shows that MBOneFlange model automatically reduces torque if the mximum speed tends to be overcome.</p>
|
|---|
| 1796 | <p><u>First suggested plots</u>: 1) on the same axis oneFlange.torque.tau, oneFlange.limTau.y and tauRef 2) vertically aligned with the previous oneFlange.limTau.state. In these plots it can be seen that:</p>
|
|---|
| 1797 | <ul>
|
|---|
| 1798 | <li>during the first 10 seconds the generated torque oneFlange.torque.tau, is 20Nm, as requested from the input. The maximum torque that can be generated is not limited by the power limit (thus state=0)</li>
|
|---|
| 1799 | <li>between t=10 and 14 the generated torque continues to follow the input signal; but starting from t=10.8 the maximum torque that can be delivered is limited by the maximum drive power (this is confirmed by the value state=1)</li>
|
|---|
| 1800 | <li>between t=14 and 18 s, since the drive power has been reached (10 kW), the generated torque is automatically reduced to avoid this limit to be overcome </li>
|
|---|
| 1801 | <li>between t=18 and t=38 the maximum speed is reached and therefore the generated torque is automatically reduced to avoid this limit to be overcome (state=2)</li>
|
|---|
| 1802 | <li>above t=38 the torque request is reduced and the drive is again able to deliver this torque.</li>
|
|---|
| 1803 | </ul>
|
|---|
| 1804 | <p><u>Second suggested plot</u>: Once the first plot is anaysed, the user might want to have an idea of the mechanical and electrical powers: these are seen putting in the same plot powMech.power and powElec.power.</p>
|
|---|
| 1805 | </html>"));
|
|---|
| 1806 | end TestMBOneFlange;
|
|---|
| 1807 |
|
|---|
| 1808 | model TestMBIceConn
|
|---|
| 1809 | Modelica.Mechanics.Rotational.Components.Inertia inertia(J=0.5, phi(
|
|---|
| 1810 | start=0, fixed=true))
|
|---|
| 1811 | annotation (Placement(transformation(extent={{10,0},{30,20}})));
|
|---|
| 1812 | Modelica.Mechanics.Rotational.Sources.QuadraticSpeedDependentTorque
|
|---|
| 1813 | loadTorque(w_nominal=100, tau_nominal=-80)
|
|---|
| 1814 | annotation (Placement(transformation(extent={{64,0},{44,20}})));
|
|---|
| 1815 | MBiceConn mBiceConn(wIceStart=90)
|
|---|
| 1816 | annotation (Placement(transformation(extent={{-18,-2},{2,18}})));
|
|---|
| 1817 | MBsupport.ToConnIceTauRef toConnIceTauRef annotation (Placement(
|
|---|
| 1818 | transformation(
|
|---|
| 1819 | extent={{-6,-6},{6,6}},
|
|---|
| 1820 | rotation=90,
|
|---|
| 1821 | origin={-6,-18})));
|
|---|
| 1822 | Modelica.Blocks.Sources.Trapezoid trapezoid(
|
|---|
| 1823 | rising=10,
|
|---|
| 1824 | width=10,
|
|---|
| 1825 | falling=10,
|
|---|
| 1826 | period=1e6,
|
|---|
| 1827 | startTime=10,
|
|---|
| 1828 | offset=60,
|
|---|
| 1829 | amplitude=30)
|
|---|
| 1830 | annotation (Placement(transformation(extent={{-50,-30},{-30,-10}})));
|
|---|
| 1831 | equation
|
|---|
| 1832 | connect(inertia.flange_b, loadTorque.flange) annotation (Line(
|
|---|
| 1833 | points={{30,10},{44,10}},
|
|---|
| 1834 | color={0,0,0},
|
|---|
| 1835 | smooth=Smooth.None));
|
|---|
| 1836 | connect(inertia.flange_a, mBiceConn.flange_a) annotation (Line(
|
|---|
| 1837 | points={{10,10},{2,10}},
|
|---|
| 1838 | color={0,0,0},
|
|---|
| 1839 | smooth=Smooth.None));
|
|---|
| 1840 | connect(toConnIceTauRef.conn, mBiceConn.conn) annotation (Line(
|
|---|
| 1841 | points={{-6,-12},{-6,-2},{-6.4,-2}},
|
|---|
| 1842 | color={255,204,51},
|
|---|
| 1843 | thickness=0.5,
|
|---|
| 1844 | smooth=Smooth.None));
|
|---|
| 1845 | connect(toConnIceTauRef.u, trapezoid.y) annotation (Line(
|
|---|
| 1846 | points={{-6,-25.4},{-6,-32},{-20,-32},{-20,-20},{-29,-20}},
|
|---|
| 1847 | color={0,0,127},
|
|---|
| 1848 | smooth=Smooth.None));
|
|---|
| 1849 | annotation (
|
|---|
| 1850 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-80,-60},
|
|---|
| 1851 | {80,60}}), graphics),
|
|---|
| 1852 | experiment(StopTime=50),
|
|---|
| 1853 | __Dymola_experimentSetupOutput,
|
|---|
| 1854 | Icon(coordinateSystem(extent={{-80,-60},{80,60}})),
|
|---|
| 1855 | Documentation(info="<html>
|
|---|
| 1856 | <p>This is a simple test of model MBIce with connector.</p>
|
|---|
| 1857 | <p>For the desctipion see the description of TestMBIce.</p>
|
|---|
| 1858 | </html>"));
|
|---|
| 1859 | end TestMBIceConn;
|
|---|
| 1860 |
|
|---|
| 1861 | model TestMBOneFlangeConn
|
|---|
| 1862 | Modelica.Mechanics.Rotational.Components.Inertia inertia(
|
|---|
| 1863 | J=0.5,
|
|---|
| 1864 | phi(start=0, fixed=true),
|
|---|
| 1865 | w(start=50, fixed=true))
|
|---|
| 1866 | annotation (Placement(transformation(extent={{38,0},{58,20}})));
|
|---|
| 1867 | Modelica.Mechanics.Rotational.Sources.QuadraticSpeedDependentTorque
|
|---|
| 1868 | loadTorque(tau_nominal=-50, w_nominal=400)
|
|---|
| 1869 | annotation (Placement(transformation(extent={{92,0},{72,20}})));
|
|---|
| 1870 | Modelica.Electrical.Analog.Sources.ConstantVoltage gen(V=100)
|
|---|
| 1871 | annotation (Placement(transformation(
|
|---|
| 1872 | extent={{-10,-10},{10,10}},
|
|---|
| 1873 | rotation=-90,
|
|---|
| 1874 | origin={-64,10})));
|
|---|
| 1875 | Modelica.Electrical.Analog.Basic.Ground ground
|
|---|
| 1876 | annotation (Placement(transformation(extent={{-90,-20},{-70,0}})));
|
|---|
| 1877 | Modelica.Mechanics.Rotational.Sensors.PowerSensor powMech
|
|---|
| 1878 | annotation (Placement(transformation(extent={{12,0},{32,20}})));
|
|---|
| 1879 | Modelica.Electrical.Analog.Sensors.PowerSensor powElec
|
|---|
| 1880 | annotation (Placement(transformation(extent={{-52,14},{-32,34}})));
|
|---|
| 1881 | MBOneFlangeConn oneFlangeConn(
|
|---|
| 1882 | powMax=10000,
|
|---|
| 1883 | tauMax=50,
|
|---|
| 1884 | J=0.5,
|
|---|
| 1885 | wMax=300)
|
|---|
| 1886 | annotation (Placement(transformation(extent={{-16,0},{4,20}})));
|
|---|
| 1887 | MBsupport.ToConnGenTauRef toConnGenTauNorm
|
|---|
| 1888 | annotation (Placement(transformation(extent={{-16,-34},{-4,-22}})));
|
|---|
| 1889 | Modelica.Blocks.Sources.Trapezoid tauRef(
|
|---|
| 1890 | rising=10,
|
|---|
| 1891 | width=10,
|
|---|
| 1892 | falling=10,
|
|---|
| 1893 | period=1e6,
|
|---|
| 1894 | startTime=10,
|
|---|
| 1895 | amplitude=50,
|
|---|
| 1896 | offset=20)
|
|---|
| 1897 | annotation (Placement(transformation(extent={{-48,-38},{-28,-18}})));
|
|---|
| 1898 | equation
|
|---|
| 1899 | connect(inertia.flange_b, loadTorque.flange) annotation (Line(
|
|---|
| 1900 | points={{58,10},{72,10}},
|
|---|
| 1901 | color={0,0,0},
|
|---|
| 1902 | smooth=Smooth.None));
|
|---|
| 1903 | connect(ground.p, gen.n) annotation (Line(
|
|---|
| 1904 | points={{-80,0},{-64,0}},
|
|---|
| 1905 | color={0,0,255},
|
|---|
| 1906 | smooth=Smooth.None));
|
|---|
| 1907 | connect(inertia.flange_a, powMech.flange_b) annotation (Line(
|
|---|
| 1908 | points={{38,10},{32,10}},
|
|---|
| 1909 | color={0,0,0},
|
|---|
| 1910 | smooth=Smooth.None));
|
|---|
| 1911 | connect(powElec.pc, gen.p) annotation (Line(
|
|---|
| 1912 | points={{-52,24},{-64,24},{-64,20}},
|
|---|
| 1913 | color={0,0,255},
|
|---|
| 1914 | smooth=Smooth.None));
|
|---|
| 1915 | connect(powElec.pv, powElec.nc) annotation (Line(
|
|---|
| 1916 | points={{-42,34},{-36,34},{-36,34},{-32,34},{-32,24}},
|
|---|
| 1917 | color={0,0,255},
|
|---|
| 1918 | smooth=Smooth.None));
|
|---|
| 1919 | connect(powMech.flange_a, oneFlangeConn.flange_a) annotation (Line(
|
|---|
| 1920 | points={{12,10},{4,10}},
|
|---|
| 1921 | color={0,0,0},
|
|---|
| 1922 | smooth=Smooth.None));
|
|---|
| 1923 | connect(oneFlangeConn.pin_p, powElec.nc) annotation (Line(
|
|---|
| 1924 | points={{-16,14},{-24,14},{-24,24},{-32,24}},
|
|---|
| 1925 | color={0,0,255},
|
|---|
| 1926 | smooth=Smooth.None));
|
|---|
| 1927 | connect(oneFlangeConn.pin_n, gen.n) annotation (Line(
|
|---|
| 1928 | points={{-16,6},{-24,6},{-24,0},{-64,0}},
|
|---|
| 1929 | color={0,0,255},
|
|---|
| 1930 | smooth=Smooth.None));
|
|---|
| 1931 | connect(toConnGenTauNorm.conn, oneFlangeConn.conn) annotation (Line(
|
|---|
| 1932 | points={{-4.2,-28},{4,-28},{4,2.2}},
|
|---|
| 1933 | color={255,204,51},
|
|---|
| 1934 | thickness=0.5,
|
|---|
| 1935 | smooth=Smooth.None));
|
|---|
| 1936 | connect(powElec.nv, gen.n) annotation (Line(
|
|---|
| 1937 | points={{-42,14},{-42,0},{-64,0}},
|
|---|
| 1938 | color={0,0,255},
|
|---|
| 1939 | smooth=Smooth.None));
|
|---|
| 1940 | connect(toConnGenTauNorm.u, tauRef.y) annotation (Line(
|
|---|
| 1941 | points={{-17,-28},{-27,-28}},
|
|---|
| 1942 | color={0,0,127},
|
|---|
| 1943 | smooth=Smooth.None));
|
|---|
| 1944 | annotation (
|
|---|
| 1945 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-60},
|
|---|
| 1946 | {100,60}}), graphics),
|
|---|
| 1947 | experiment(StopTime=50),
|
|---|
| 1948 | __Dymola_experimentSetupOutput,
|
|---|
| 1949 | Icon(coordinateSystem(extent={{-100,-100},{100,100}})),
|
|---|
| 1950 | Documentation(info="<html>
|
|---|
| 1951 | <p>This is a simple test of model MBOneFlange with bus connector.</p>
|
|---|
| 1952 | <p>For the description see the description of TestMBOneFlange (substitute the word "oneFlange" with "oneFlangeConn").</p>
|
|---|
| 1953 | </html>"));
|
|---|
| 1954 | end TestMBOneFlangeConn;
|
|---|
| 1955 |
|
|---|
| 1956 | model TestMBTwoFlange "Test of MBTwoFlange drive train model"
|
|---|
| 1957 | Modelica.Mechanics.Rotational.Components.Inertia inertia(
|
|---|
| 1958 | J=0.5,
|
|---|
| 1959 | phi(start=0, fixed=true),
|
|---|
| 1960 | w(start=50, fixed=true))
|
|---|
| 1961 | annotation (Placement(transformation(extent={{38,-10},{58,10}})));
|
|---|
| 1962 | Modelica.Mechanics.Rotational.Sources.QuadraticSpeedDependentTorque
|
|---|
| 1963 | loadTorque(w_nominal=400, tau_nominal=-50.0)
|
|---|
| 1964 | annotation (Placement(transformation(extent={{92,-10},{72,10}})));
|
|---|
| 1965 | Modelica.Electrical.Analog.Sources.ConstantVoltage gen(V=100)
|
|---|
| 1966 | annotation (Placement(transformation(
|
|---|
| 1967 | extent={{-10,-10},{10,10}},
|
|---|
| 1968 | rotation=-90,
|
|---|
| 1969 | origin={-60,28})));
|
|---|
| 1970 | Modelica.Electrical.Analog.Basic.Ground ground
|
|---|
| 1971 | annotation (Placement(transformation(extent={{-94,38},{-74,18}})));
|
|---|
| 1972 | Modelica.Mechanics.Rotational.Sensors.PowerSensor powMech2
|
|---|
| 1973 | annotation (Placement(transformation(extent={{12,-10},{32,10}})));
|
|---|
| 1974 | Modelica.Electrical.Analog.Sensors.PowerSensor powElec
|
|---|
| 1975 | annotation (Placement(transformation(extent={{-48,32},{-28,52}})));
|
|---|
| 1976 | MBTwoFlange twoFlanges(
|
|---|
| 1977 | powMax=10000,
|
|---|
| 1978 | tauMax=50,
|
|---|
| 1979 | J=0.5,
|
|---|
| 1980 | wMax=300)
|
|---|
| 1981 | annotation (Placement(transformation(extent={{-18,-10},{2,10}})));
|
|---|
| 1982 | Modelica.Mechanics.Rotational.Sources.ConstantTorque tau1(tau_constant=
|
|---|
| 1983 | -5.0)
|
|---|
| 1984 | annotation (Placement(transformation(extent={{-76,-10},{-56,10}})));
|
|---|
| 1985 | Modelica.Mechanics.Rotational.Sensors.PowerSensor powMech1
|
|---|
| 1986 | annotation (Placement(transformation(extent={{-28,-10},{-48,10}})));
|
|---|
| 1987 | Modelica.Blocks.Sources.Trapezoid tauRef(
|
|---|
| 1988 | rising=10,
|
|---|
| 1989 | width=10,
|
|---|
| 1990 | falling=10,
|
|---|
| 1991 | period=1e6,
|
|---|
| 1992 | startTime=10,
|
|---|
| 1993 | amplitude=50,
|
|---|
| 1994 | offset=20)
|
|---|
| 1995 | annotation (Placement(transformation(extent={{-40,-48},{-20,-28}})));
|
|---|
| 1996 | equation
|
|---|
| 1997 | connect(inertia.flange_b, loadTorque.flange) annotation (Line(
|
|---|
| 1998 | points={{58,0},{72,0}},
|
|---|
| 1999 | color={0,0,0},
|
|---|
| 2000 | smooth=Smooth.None));
|
|---|
| 2001 | connect(ground.p, gen.n) annotation (Line(
|
|---|
| 2002 | points={{-84,18},{-60,18}},
|
|---|
| 2003 | color={0,0,255},
|
|---|
| 2004 | smooth=Smooth.None));
|
|---|
| 2005 | connect(inertia.flange_a, powMech2.flange_b) annotation (Line(
|
|---|
| 2006 | points={{38,0},{32,0}},
|
|---|
| 2007 | color={0,0,0},
|
|---|
| 2008 | smooth=Smooth.None));
|
|---|
| 2009 | connect(powElec.pc, gen.p) annotation (Line(
|
|---|
| 2010 | points={{-48,42},{-60,42},{-60,38}},
|
|---|
| 2011 | color={0,0,255},
|
|---|
| 2012 | smooth=Smooth.None));
|
|---|
| 2013 | connect(powElec.pv, powElec.nc) annotation (Line(
|
|---|
| 2014 | points={{-38,52},{-28,52},{-28,42}},
|
|---|
| 2015 | color={0,0,255},
|
|---|
| 2016 | smooth=Smooth.None));
|
|---|
| 2017 | connect(powMech2.flange_a, twoFlanges.flange_b) annotation (Line(
|
|---|
| 2018 | points={{12,0},{8,0},{8,-0.2},{2,-0.2}},
|
|---|
| 2019 | color={0,0,0},
|
|---|
| 2020 | smooth=Smooth.None));
|
|---|
| 2021 | connect(powElec.nc, twoFlanges.pin_n) annotation (Line(
|
|---|
| 2022 | points={{-28,42},{-4,42},{-4,10}},
|
|---|
| 2023 | color={0,0,255},
|
|---|
| 2024 | smooth=Smooth.None));
|
|---|
| 2025 | connect(twoFlanges.pin_p, gen.n) annotation (Line(
|
|---|
| 2026 | points={{-12,9.8},{-12,18},{-60,18}},
|
|---|
| 2027 | color={0,0,255},
|
|---|
| 2028 | smooth=Smooth.None));
|
|---|
| 2029 | connect(powElec.nv, gen.n) annotation (Line(
|
|---|
| 2030 | points={{-38,32},{-38,18},{-60,18}},
|
|---|
| 2031 | color={0,0,255},
|
|---|
| 2032 | smooth=Smooth.None));
|
|---|
| 2033 | connect(twoFlanges.flange_a, powMech1.flange_a) annotation (Line(
|
|---|
| 2034 | points={{-18,0},{-28,0}},
|
|---|
| 2035 | color={0,0,0},
|
|---|
| 2036 | smooth=Smooth.None));
|
|---|
| 2037 | connect(tau1.flange, powMech1.flange_b) annotation (Line(
|
|---|
| 2038 | points={{-56,0},{-48,0}},
|
|---|
| 2039 | color={0,0,0},
|
|---|
| 2040 | smooth=Smooth.None));
|
|---|
| 2041 | connect(tauRef.y, twoFlanges.tauRefInt) annotation (Line(
|
|---|
| 2042 | points={{-19,-38},{-8,-38},{-8,-11.4}},
|
|---|
| 2043 | color={0,0,127},
|
|---|
| 2044 | smooth=Smooth.None));
|
|---|
| 2045 | annotation (
|
|---|
| 2046 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-60},
|
|---|
| 2047 | {100,60}}), graphics),
|
|---|
| 2048 | experiment(StopTime=50),
|
|---|
| 2049 | __Dymola_experimentSetupOutput,
|
|---|
| 2050 | Icon(coordinateSystem(extent={{-100,-100},{100,100}})),
|
|---|
| 2051 | Documentation(info="<html>
|
|---|
| 2052 | <p>This is a simple test of model MBTwoFlange.</p>
|
|---|
| 2053 | <p>It shows that the generated torque follows the normalised torque request as long as it does not overcome torque and power limits. The generted torque will act on the machine inertia in conjunction with the toruqes applied from the exterior to the two flanges.</p>
|
|---|
| 2054 | <p>It shows also the effects of efficiency on the DC power.</p>
|
|---|
| 2055 | <p>Finally it shows that MBTwoFlange model automatically reduces torque if the maximum speed tends to be overcome.</p>
|
|---|
| 2056 | <p><u>First suggested plots</u>: a plot with tauRef.y and twoFlanges.inertia.tau; another with twoFlanges.limTau.state; a third one withinertia.wIn these plots it can be seen that:</p>
|
|---|
| 2057 | <ul>
|
|---|
| 2058 | <li>during the first 15 seconds the generated torque equals the torque request tauRef.y</li>
|
|---|
| 2059 | <li>starting from 13.1 s state becomes 1 meaning that the base speed has been overcome and therefore it is impossible to deliver the maximum drive torque</li>
|
|---|
| 2060 | <li>starting from t=15s the power limitation activates, and the delivered torque is lower than the torque request</li>
|
|---|
| 2061 | <li>starting from t= 30 s the maximum speed is reached, and torque is limitated not to overcome this maximum.</li>
|
|---|
| 2062 | </ul>
|
|---|
| 2063 | <p><u>Second suggested plot</u>: Once the first plots are anaysed, the user might want to have an idea of the mechanical and electrical powers: these are seen putting in the same plot ( powMech1.power+powMech2.power) and powElec.power.</p>
|
|---|
| 2064 | </html>"));
|
|---|
| 2065 | end TestMBTwoFlange;
|
|---|
| 2066 | end TestingModels;
|
|---|
| 2067 | annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
|
|---|
| 2068 | -100},{100,100}}), graphics={
|
|---|
| 2069 | Line(
|
|---|
| 2070 | points={{-80,-84},{-80,68}},
|
|---|
| 2071 | color={0,0,0},
|
|---|
| 2072 | smooth=Smooth.None),
|
|---|
| 2073 | Line(
|
|---|
| 2074 | points={{-88,-80},{78,-80}},
|
|---|
| 2075 | color={0,0,0},
|
|---|
| 2076 | smooth=Smooth.None),
|
|---|
| 2077 | Polygon(
|
|---|
| 2078 | points={{94,-80},{78,-74},{78,-86},{94,-80}},
|
|---|
| 2079 | lineColor={0,0,0},
|
|---|
| 2080 | smooth=Smooth.None),
|
|---|
| 2081 | Polygon(
|
|---|
| 2082 | points={{8,0},{-8,6},{-8,-6},{8,0}},
|
|---|
| 2083 | lineColor={0,0,0},
|
|---|
| 2084 | smooth=Smooth.None,
|
|---|
| 2085 | origin={-80,76},
|
|---|
| 2086 | rotation=90),
|
|---|
| 2087 | Line(
|
|---|
| 2088 | points={{-84,40},{-14,40}},
|
|---|
| 2089 | color={0,0,0},
|
|---|
| 2090 | smooth=Smooth.None),
|
|---|
| 2091 | Line(
|
|---|
| 2092 | points={{-14,40},{-4,2},{22,-32},{62,-44},{62,-80}},
|
|---|
| 2093 | color={0,0,0},
|
|---|
| 2094 | smooth=Smooth.None)}));
|
|---|
| 2095 | end MapBased;
|
|---|
| 2096 |
|
|---|
| 2097 | package ElectricDrives "Electric drives components and models"
|
|---|
| 2098 | extends Modelica.Icons.Package;
|
|---|
| 2099 |
|
|---|
| 2100 | model AMDrive "asynchronous machine-based electric drive"
|
|---|
| 2101 | import PI = Modelica.Constants.pi;
|
|---|
| 2102 | Modelica.SIunits.Torque tauMaximum=3*uAgGen.uAg^2*pp/(2*(2*PI*uAgGen.f)^2
|
|---|
| 2103 | *(L1 + L2)) "Maximum torque at given frequency and voltage";
|
|---|
| 2104 | Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a annotation (
|
|---|
| 2105 | Placement(transformation(extent={{90,-10},{110,10}}),
|
|---|
| 2106 | iconTransformation(extent={{90,-10},{110,10}})));
|
|---|
| 2107 | parameter Integer pp=2 "pole pairs";
|
|---|
| 2108 | parameter Modelica.SIunits.Voltage UBase=230
|
|---|
| 2109 | "Base RMS machine line voltage";
|
|---|
| 2110 | parameter Modelica.SIunits.AngularFrequency WeBase=314.15
|
|---|
| 2111 | "Base machine angular frequency ";
|
|---|
| 2112 | parameter Modelica.SIunits.AngularFrequency WeMax=314.15
|
|---|
| 2113 | "Maximum machine angular frequency";
|
|---|
| 2114 | parameter Modelica.SIunits.Voltage Unom=200
|
|---|
| 2115 | "DC nominal voltage (only order of magnitude needed)";
|
|---|
| 2116 | parameter Modelica.SIunits.Resistance R1=0.435
|
|---|
| 2117 | "Stator's phase resistance"
|
|---|
| 2118 | annotation (Dialog(tab="machine parameters"));
|
|---|
| 2119 | parameter Modelica.SIunits.Inductance L1=0.004
|
|---|
| 2120 | "Stator's leakage inductance"
|
|---|
| 2121 | annotation (Dialog(tab="machine parameters"));
|
|---|
| 2122 | parameter Modelica.SIunits.Inductance Lm=0.0693
|
|---|
| 2123 | "Stator's leakage inductance"
|
|---|
| 2124 | annotation (Dialog(tab="machine parameters"));
|
|---|
| 2125 | parameter Modelica.SIunits.Resistance R2=0.4 "Rotor's phase resistance "
|
|---|
| 2126 | annotation (Dialog(tab="machine parameters"));
|
|---|
| 2127 | parameter Modelica.SIunits.Inductance L2=0.002
|
|---|
| 2128 | "Rotor's leakage inductance"
|
|---|
| 2129 | annotation (Dialog(tab="machine parameters"));
|
|---|
| 2130 | parameter Modelica.SIunits.MomentOfInertia J=2.0
|
|---|
| 2131 | "Rotor's moment of inertia"
|
|---|
| 2132 | annotation (Dialog(tab="machine parameters"));
|
|---|
| 2133 | parameter Real lossFact=4
|
|---|
| 2134 | "Ratio of inverter losses (W) to machine current (A)";
|
|---|
| 2135 | Modelica.Electrical.Analog.Interfaces.PositivePin pin_p annotation (
|
|---|
| 2136 | Placement(transformation(extent={{-110,50},{-90,70}}),
|
|---|
| 2137 | iconTransformation(extent={{-112,50},{-92,70}})));
|
|---|
| 2138 | Modelica.Electrical.Analog.Interfaces.NegativePin pin_n annotation (
|
|---|
| 2139 | Placement(transformation(extent={{-110,-70},{-90,-50}}),
|
|---|
| 2140 | iconTransformation(extent={{-112,-70},{-92,-50}})));
|
|---|
| 2141 | SupportModels.Internal.ConstPDC dcLoad(T=0.01, k=1000/Unom)
|
|---|
| 2142 | annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
|
|---|
| 2143 | Modelica.Blocks.Interfaces.RealInput dWe annotation (Placement(
|
|---|
| 2144 | transformation(
|
|---|
| 2145 | extent={{-20,-20},{20,20}},
|
|---|
| 2146 | rotation=270,
|
|---|
| 2147 | origin={0,98}), iconTransformation(
|
|---|
| 2148 | extent={{-20,-20},{20,20}},
|
|---|
| 2149 | rotation=270,
|
|---|
| 2150 | origin={0,88})));
|
|---|
| 2151 | Modelica.Blocks.Nonlinear.Limiter limDWe(uMax=R2/(L1 + L2), uMin=-R2/(L1
|
|---|
| 2152 | + L2)) annotation (Placement(transformation(
|
|---|
| 2153 | extent={{-10,-10},{10,10}},
|
|---|
| 2154 | rotation=180,
|
|---|
| 2155 | origin={50,40})));
|
|---|
| 2156 | EDsupport.QSAsma qSAsma(
|
|---|
| 2157 | pp=pp,
|
|---|
| 2158 | R1=R1,
|
|---|
| 2159 | L1=L1,
|
|---|
| 2160 | Lm=Lm,
|
|---|
| 2161 | R2=R2,
|
|---|
| 2162 | L2=L2,
|
|---|
| 2163 | J=J) annotation (Placement(visible=true, transformation(extent={{22,-42},
|
|---|
| 2164 | {46,-22}}, rotation=0)));
|
|---|
| 2165 | Modelica.Blocks.Math.Add addPdc annotation (Placement(visible=true,
|
|---|
| 2166 | transformation(
|
|---|
| 2167 | origin={-58,-54},
|
|---|
| 2168 | extent={{-10,-10},{10,10}},
|
|---|
| 2169 | rotation=180)));
|
|---|
| 2170 | Modelica.Blocks.Math.Gain polePairs(k=pp) annotation (Placement(visible=
|
|---|
| 2171 | true, transformation(
|
|---|
| 2172 | origin={38,0},
|
|---|
| 2173 | extent={{10,-10},{-10,10}},
|
|---|
| 2174 | rotation=0)));
|
|---|
| 2175 | Modelica.Mechanics.Rotational.Sensors.SpeedSensor Wm annotation (
|
|---|
| 2176 | Placement(visible=true, transformation(
|
|---|
| 2177 | origin={74,0},
|
|---|
| 2178 | extent={{10,-10},{-10,10}},
|
|---|
| 2179 | rotation=0)));
|
|---|
| 2180 | Modelica.Blocks.Math.Gain lossF_(k=lossFact) annotation (Placement(
|
|---|
| 2181 | visible=true, transformation(
|
|---|
| 2182 | origin={-18,-64},
|
|---|
| 2183 | extent={{-10,-10},{10,10}},
|
|---|
| 2184 | rotation=180)));
|
|---|
| 2185 | EDsupport.UagGenerator uAgGen(
|
|---|
| 2186 | WeBase=WeBase,
|
|---|
| 2187 | WeMax=WeMax,
|
|---|
| 2188 | UBase=UBase)
|
|---|
| 2189 | annotation (Placement(transformation(extent={{14,0},{-6,20}})));
|
|---|
| 2190 | Modelica.Electrical.Analog.Sensors.VoltageSensor vDCSens annotation (
|
|---|
| 2191 | Placement(transformation(
|
|---|
| 2192 | extent={{-10,10},{10,-10}},
|
|---|
| 2193 | rotation=-90,
|
|---|
| 2194 | origin={-60,30})));
|
|---|
| 2195 | equation
|
|---|
| 2196 | connect(qSAsma.Is, lossF_.u) annotation (Line(points={{39.4545,-43},{
|
|---|
| 2197 | 39.4545,-64},{-6,-64}}, color={0,0,127}));
|
|---|
| 2198 | connect(lossF_.y, addPdc.u1) annotation (Line(points={{-29,-64},{-38,-64},
|
|---|
| 2199 | {-38,-60},{-46,-60}}, color={0,0,127}));
|
|---|
| 2200 | connect(Wm.flange, flange_a)
|
|---|
| 2201 | annotation (Line(points={{84,0},{84,0},{100,0}}));
|
|---|
| 2202 | connect(polePairs.u, Wm.w)
|
|---|
| 2203 | annotation (Line(points={{50,0},{50,0},{63,0}}, color={0,0,127}));
|
|---|
| 2204 | connect(addPdc.u2, qSAsma.Pdc) annotation (Line(points={{-46,-48},{
|
|---|
| 2205 | 26.3636,-48},{26.3636,-43}}, color={0,0,127}));
|
|---|
| 2206 | connect(addPdc.y, dcLoad.Pref) annotation (Line(points={{-69,-54},{-76,-54},
|
|---|
| 2207 | {-76,0},{-81.8,0}}, color={0,0,127}));
|
|---|
| 2208 | connect(qSAsma.flange_a, flange_a)
|
|---|
| 2209 | annotation (Line(points={{43.8182,-32},{90,-32},{90,0},{100,0}}));
|
|---|
| 2210 | connect(dcLoad.pin_p, pin_p) annotation (Line(
|
|---|
| 2211 | points={{-90,10},{-90,60},{-100,60}},
|
|---|
| 2212 | color={0,0,255},
|
|---|
| 2213 | smooth=Smooth.None));
|
|---|
| 2214 | connect(dcLoad.pin_n, pin_n) annotation (Line(
|
|---|
| 2215 | points={{-90,-9.8},{-90,-60},{-100,-60}},
|
|---|
| 2216 | color={0,0,255},
|
|---|
| 2217 | smooth=Smooth.None));
|
|---|
| 2218 | connect(limDWe.u, dWe) annotation (Line(
|
|---|
| 2219 | points={{62,40},{74,40},{74,66},{0,66},{0,98}},
|
|---|
| 2220 | color={0,0,127},
|
|---|
| 2221 | smooth=Smooth.None));
|
|---|
| 2222 | connect(uAgGen.dWe, limDWe.y) annotation (Line(
|
|---|
| 2223 | points={{15.6,16},{20,16},{20,40},{39,40}},
|
|---|
| 2224 | color={0,0,127},
|
|---|
| 2225 | smooth=Smooth.None));
|
|---|
| 2226 | connect(uAgGen.We, polePairs.y) annotation (Line(
|
|---|
| 2227 | points={{15.6,4},{22,4},{22,0},{27,0}},
|
|---|
| 2228 | color={0,0,127},
|
|---|
| 2229 | smooth=Smooth.None));
|
|---|
| 2230 | connect(vDCSens.v, uAgGen.dcVoltage) annotation (Line(
|
|---|
| 2231 | points={{-50,30},{4,30},{4,21.6}},
|
|---|
| 2232 | color={0,0,127},
|
|---|
| 2233 | smooth=Smooth.None));
|
|---|
| 2234 | connect(vDCSens.p, pin_p) annotation (Line(
|
|---|
| 2235 | points={{-60,40},{-60,60},{-100,60}},
|
|---|
| 2236 | color={0,0,255},
|
|---|
| 2237 | smooth=Smooth.None));
|
|---|
| 2238 | connect(vDCSens.n, pin_n) annotation (Line(
|
|---|
| 2239 | points={{-60,20},{-60,-20},{-90,-20},{-90,-60},{-100,-60}},
|
|---|
| 2240 | color={0,0,255},
|
|---|
| 2241 | smooth=Smooth.None));
|
|---|
| 2242 | connect(uAgGen.f, qSAsma.f) annotation (Line(
|
|---|
| 2243 | points={{-7,4},{-20,4},{-20,-38},{19.8182,-38}},
|
|---|
| 2244 | color={0,0,127},
|
|---|
| 2245 | smooth=Smooth.None));
|
|---|
| 2246 | connect(qSAsma.Uag, uAgGen.uAg) annotation (Line(
|
|---|
| 2247 | points={{19.8182,-26},{-26,-26},{-26,16},{-7,16}},
|
|---|
| 2248 | color={0,0,127},
|
|---|
| 2249 | smooth=Smooth.None));
|
|---|
| 2250 | annotation (
|
|---|
| 2251 | Placement(transformation(extent={{-80,72},{-60,92}})),
|
|---|
| 2252 | Dialog(tab="Other", group="Inverter"),
|
|---|
| 2253 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-80},
|
|---|
| 2254 | {100,80}}), graphics={Rectangle(
|
|---|
| 2255 | extent={{-36,60},{82,-14}},
|
|---|
| 2256 | lineColor={255,0,0},
|
|---|
| 2257 | pattern=LinePattern.Dash)}),
|
|---|
| 2258 | Documentation(info="<html>
|
|---|
| 2259 | <p>This model models an asynchronous machine - based electric drive, containing U/f control, with stator resistance drop compensation.</p>
|
|---|
| 2260 | <p>It makes usage of the quasi-stationary asynchornous machine model QSAsma.</p>
|
|---|
| 2261 | <p>The model can operate only with positive angular speeds.</p>
|
|---|
| 2262 | <p>Full description of the model can be found in the following paper.</p>
|
|---|
| 2263 | <p>M. Ceraolo: "A new Modelica Electric and Hybrid Power Trains library" <i>11th Modelica Conference, 2015 Versailles - France</i></p>
|
|---|
| 2264 | </html>"),
|
|---|
| 2265 | experiment(StopTime=300, Interval=0.1),
|
|---|
| 2266 | __Dymola_experimentSetupOutput,
|
|---|
| 2267 | Icon(coordinateSystem(
|
|---|
| 2268 | extent={{-100,-100},{100,100}},
|
|---|
| 2269 | preserveAspectRatio=true,
|
|---|
| 2270 | initialScale=0.1,
|
|---|
| 2271 | grid={2,2}), graphics={Line(points={{-28,20},{6,20}}, color={0,0,
|
|---|
| 2272 | 255}),Line(points={{-30,0},{4,0}}, color={0,0,255}),Line(points={
|
|---|
| 2273 | {-30,-20},{4,-20}}, color={0,0,255}),Text(
|
|---|
| 2274 | lineColor={0,0,255},
|
|---|
| 2275 | fillColor={95,95,95},
|
|---|
| 2276 | fillPattern=FillPattern.Solid,
|
|---|
| 2277 | extent={{-140,-112},{148,-146}},
|
|---|
| 2278 | textString="%name"),Line(points={{-102,-60},{-78,-60},{-78,-28},
|
|---|
| 2279 | {-60,-28}}, color={0,0,255}),Line(points={{-96,60},{-78,60},{-78,
|
|---|
| 2280 | 28},{-60,28}}, color={0,0,255}),Rectangle(
|
|---|
| 2281 | fillColor={175,175,175},
|
|---|
| 2282 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2283 | extent={{-40,68},{80,-52}}),Rectangle(
|
|---|
| 2284 | lineColor={0,0,255},
|
|---|
| 2285 | fillColor={0,0,255},
|
|---|
| 2286 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2287 | extent={{-40,68},{-62,-52}}),Polygon(fillPattern=FillPattern.Solid,
|
|---|
| 2288 | points={{-54,-82},{-44,-82},{-14,-12},{36,-12},{66,-82},{76,-82},
|
|---|
| 2289 | {76,-92},{-54,-92},{-54,-82}}),Rectangle(
|
|---|
| 2290 | fillColor={95,95,95},
|
|---|
| 2291 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2292 | extent={{80,12},{100,-8}})}));
|
|---|
| 2293 | end AMDrive;
|
|---|
| 2294 |
|
|---|
| 2295 | model AMDrivePU
|
|---|
| 2296 | "asynchronous machine-based electric drive (parameters in per-unit)"
|
|---|
| 2297 | import PI = Modelica.Constants.pi;
|
|---|
| 2298 | Modelica.SIunits.Torque tauMaximum
|
|---|
| 2299 | "Maximum torque at given frequency and voltage";
|
|---|
| 2300 | Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a annotation (
|
|---|
| 2301 | Placement(transformation(extent={{92,-10},{112,10}}),
|
|---|
| 2302 | iconTransformation(extent={{92,-10},{112,10}})));
|
|---|
| 2303 | // General parameters
|
|---|
| 2304 | parameter Real UBase=400 "Base RMS machine line voltage";
|
|---|
| 2305 | parameter Real WeBase=314.15 "Base machine angular frequency";
|
|---|
| 2306 | parameter Real WeMax=2*WeBase "Max machine angular frequency";
|
|---|
| 2307 | parameter Real Unom=400 "PU reference RMS machine line voltage"
|
|---|
| 2308 | annotation (Dialog(group="p.u. reference quantities"));
|
|---|
| 2309 | parameter Modelica.SIunits.ApparentPower Snom=1e5
|
|---|
| 2310 | "Reference power pf p.u."
|
|---|
| 2311 | annotation (Dialog(group="p.u. reference quantities"));
|
|---|
| 2312 | parameter Modelica.SIunits.Frequency FNom=50
|
|---|
| 2313 | "Reference frequency of p.u."
|
|---|
| 2314 | annotation (Dialog(group="p.u. reference quantities"));
|
|---|
| 2315 | // Machine parameters
|
|---|
| 2316 | parameter Real R1u=0.01 "Stator phase resistance " annotation (Dialog(tab
|
|---|
| 2317 | ="Machine", group="Resistances and inductances per phase"));
|
|---|
| 2318 | parameter Real X1u=0.05 "Stator leackage inductance" annotation (Dialog(
|
|---|
| 2319 | tab="Machine", group="Resistances and inductances per phase"));
|
|---|
| 2320 | parameter Real R2u=0.01 "Rotor phase resistance referred to primary"
|
|---|
| 2321 | annotation (Dialog(tab="Machine", group=
|
|---|
| 2322 | "Resistances and inductances per phase"));
|
|---|
| 2323 | parameter Real X2u=0.05 "Rotor leackage inductance" annotation (Dialog(
|
|---|
| 2324 | tab="Machine", group="Resistances and inductances per phase"));
|
|---|
| 2325 | parameter Real Xmu=10 "Magnetic coupling inductance" annotation (Dialog(
|
|---|
| 2326 | tab="Machine", group="Resistances and inductances per phase"));
|
|---|
| 2327 | // parameter Real Rmu=10 "Iron loss equivalent resistance (Zm=Rm//Xm)"
|
|---|
| 2328 | // annotation(Dialog(tab="Machine",group="Resistances and inductances per phase"));
|
|---|
| 2329 | parameter Modelica.SIunits.Time Hu=5 "Inertia constant (s)"
|
|---|
| 2330 | annotation (Dialog(tab="Machine", group="Other parameters"));
|
|---|
| 2331 | parameter Integer pp(min=1) = 1 "Number of pole pairs"
|
|---|
| 2332 | annotation (Dialog(tab="Machine", group="Other parameters"));
|
|---|
| 2333 | // Other/Inverter
|
|---|
| 2334 | parameter Modelica.SIunits.Time TInv=0.01 "Inverter time constant"
|
|---|
| 2335 | annotation (Dialog(tab="Other", group="Inverter"));
|
|---|
| 2336 | parameter Real lossFact=4
|
|---|
| 2337 | "Ratio of inverter losses (W) to machine current (A)";
|
|---|
| 2338 | // Other/Load
|
|---|
| 2339 | parameter Real KL=1 "Inner DCload PI k constant (adimens.)"
|
|---|
| 2340 | annotation (Dialog(tab="Other", group="DCLoad"));
|
|---|
| 2341 | parameter Modelica.SIunits.Time TL=0.001 "Inner DCload PI time constant"
|
|---|
| 2342 | annotation (Dialog(tab="Other", group="DCLoad"));
|
|---|
| 2343 | protected
|
|---|
| 2344 | parameter Real UBase1=UBase/sqrt(3);
|
|---|
| 2345 | //single-circuit equivalent of UBase
|
|---|
| 2346 | parameter Real fContr=UBase1/(WeBase/(2*PI));
|
|---|
| 2347 | //constant U/f
|
|---|
| 2348 | parameter Real WeNom=2*PI*FNom;
|
|---|
| 2349 | parameter Real WmNom=WeNom/pp;
|
|---|
| 2350 | parameter Real Znom=Unom^2/Snom;
|
|---|
| 2351 | parameter Modelica.SIunits.Resistance R1=R1u*Znom;
|
|---|
| 2352 | parameter Modelica.SIunits.Inductance L1=X1u*Znom/WeNom;
|
|---|
| 2353 | parameter Modelica.SIunits.Inductance Lm=Xmu*Znom/WeNom;
|
|---|
| 2354 | parameter Modelica.SIunits.Resistance R2=R2u*Znom;
|
|---|
| 2355 | parameter Modelica.SIunits.Inductance L2=X2u*Znom/WeNom;
|
|---|
| 2356 | // parameter Modelica.SIunits.Resistance Rm=Rmu*Z_nom;
|
|---|
| 2357 | parameter Modelica.SIunits.MomentOfInertia J=2*Hu*Snom/WmNom^2;
|
|---|
| 2358 | public
|
|---|
| 2359 | Modelica.Blocks.Math.Add addPdc annotation (Placement(transformation(
|
|---|
| 2360 | extent={{-10,-10},{10,10}},
|
|---|
| 2361 | rotation=180,
|
|---|
| 2362 | origin={-58,-56})));
|
|---|
| 2363 | Modelica.Blocks.Math.Gain LossF_(k=lossFact) annotation (Placement(
|
|---|
| 2364 | transformation(
|
|---|
| 2365 | extent={{-10,-10},{10,10}},
|
|---|
| 2366 | rotation=180,
|
|---|
| 2367 | origin={-18,-66})));
|
|---|
| 2368 | Modelica.Electrical.Analog.Interfaces.PositivePin pin_p annotation (
|
|---|
| 2369 | Placement(transformation(extent={{-110,50},{-90,70}}),
|
|---|
| 2370 | iconTransformation(extent={{-112,50},{-92,70}})));
|
|---|
| 2371 | Modelica.Electrical.Analog.Interfaces.NegativePin pin_n annotation (
|
|---|
| 2372 | Placement(transformation(extent={{-110,-70},{-90,-50}}),
|
|---|
| 2373 | iconTransformation(extent={{-112,-70},{-92,-50}})));
|
|---|
| 2374 | SupportModels.Internal.ConstPDC dcLoad(k=KL, T=TL)
|
|---|
| 2375 | annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
|
|---|
| 2376 | EDsupport.QSAsma qSAsma(
|
|---|
| 2377 | pp=pp,
|
|---|
| 2378 | R1=R1,
|
|---|
| 2379 | L1=L1,
|
|---|
| 2380 | Lm=Lm,
|
|---|
| 2381 | R2=R2,
|
|---|
| 2382 | L2=L2,
|
|---|
| 2383 | J=J) annotation (Placement(transformation(extent={{22,-42},{46,-22}})));
|
|---|
| 2384 | Modelica.Blocks.Interfaces.RealInput dWe annotation (Placement(
|
|---|
| 2385 | transformation(
|
|---|
| 2386 | extent={{-20,-20},{20,20}},
|
|---|
| 2387 | rotation=270,
|
|---|
| 2388 | origin={0,100}), iconTransformation(
|
|---|
| 2389 | extent={{-20,-20},{20,20}},
|
|---|
| 2390 | rotation=270,
|
|---|
| 2391 | origin={0,88})));
|
|---|
| 2392 | Modelica.Blocks.Nonlinear.Limiter limDWe1(uMax=R2/(L1 + L2), uMin=-R2/(L1
|
|---|
| 2393 | + L2)) annotation (Placement(transformation(
|
|---|
| 2394 | extent={{-10,-10},{10,10}},
|
|---|
| 2395 | rotation=180,
|
|---|
| 2396 | origin={44,42})));
|
|---|
| 2397 | Modelica.Blocks.Math.Gain polePairs(k=pp) annotation (Placement(visible=
|
|---|
| 2398 | true, transformation(
|
|---|
| 2399 | origin={30,6},
|
|---|
| 2400 | extent={{10,-10},{-10,10}},
|
|---|
| 2401 | rotation=0)));
|
|---|
| 2402 | Modelica.Mechanics.Rotational.Sensors.SpeedSensor Wm1 annotation (
|
|---|
| 2403 | Placement(visible=true, transformation(
|
|---|
| 2404 | origin={68,0},
|
|---|
| 2405 | extent={{10,-10},{-10,10}},
|
|---|
| 2406 | rotation=0)));
|
|---|
| 2407 | EDsupport.UagGenerator uAgGen(
|
|---|
| 2408 | WeBase=WeBase,
|
|---|
| 2409 | WeMax=WeMax,
|
|---|
| 2410 | UBase=UBase)
|
|---|
| 2411 | annotation (Placement(transformation(extent={{8,2},{-12,22}})));
|
|---|
| 2412 | Modelica.Electrical.Analog.Sensors.VoltageSensor vDCSens annotation (
|
|---|
| 2413 | Placement(transformation(
|
|---|
| 2414 | extent={{-10,10},{10,-10}},
|
|---|
| 2415 | rotation=-90,
|
|---|
| 2416 | origin={-68,32})));
|
|---|
| 2417 | equation
|
|---|
| 2418 | if uAgGen.f < 1e-12 then
|
|---|
| 2419 | tauMaximum = 1e-9;
|
|---|
| 2420 | else
|
|---|
| 2421 | tauMaximum = 3*uAgGen.uAg^2*pp/(2*(2*PI*uAgGen.f)^2*(L1 + L2));
|
|---|
| 2422 | end if;
|
|---|
| 2423 | connect(dcLoad.pin_p, pin_p) annotation (Line(
|
|---|
| 2424 | points={{-90,10},{-90,60},{-100,60}},
|
|---|
| 2425 | color={0,0,255},
|
|---|
| 2426 | smooth=Smooth.None));
|
|---|
| 2427 | connect(dcLoad.pin_n, pin_n) annotation (Line(
|
|---|
| 2428 | points={{-90,-9.8},{-90,-60},{-100,-60}},
|
|---|
| 2429 | color={0,0,255},
|
|---|
| 2430 | smooth=Smooth.None));
|
|---|
| 2431 | connect(qSAsma.flange_a, flange_a) annotation (Line(
|
|---|
| 2432 | points={{43.8182,-32},{82,-32},{82,0},{102,0}},
|
|---|
| 2433 | color={0,0,0},
|
|---|
| 2434 | smooth=Smooth.None));
|
|---|
| 2435 | connect(addPdc.y, dcLoad.Pref) annotation (Line(
|
|---|
| 2436 | points={{-69,-56},{-76,-56},{-76,0},{-81.8,0}},
|
|---|
| 2437 | color={0,0,127},
|
|---|
| 2438 | smooth=Smooth.None));
|
|---|
| 2439 | connect(addPdc.u2, qSAsma.Pdc) annotation (Line(
|
|---|
| 2440 | points={{-46,-50},{26.3636,-50},{26.3636,-43}},
|
|---|
| 2441 | color={0,0,127},
|
|---|
| 2442 | smooth=Smooth.None));
|
|---|
| 2443 | connect(LossF_.y, addPdc.u1) annotation (Line(
|
|---|
| 2444 | points={{-29,-66},{-38,-66},{-38,-62},{-46,-62}},
|
|---|
| 2445 | color={0,0,127},
|
|---|
| 2446 | smooth=Smooth.None));
|
|---|
| 2447 | connect(qSAsma.Is, LossF_.u) annotation (Line(
|
|---|
| 2448 | points={{39.4545,-43},{39.4545,-66},{-6,-66}},
|
|---|
| 2449 | color={0,0,127},
|
|---|
| 2450 | smooth=Smooth.None));
|
|---|
| 2451 | connect(polePairs.u, Wm1.w) annotation (Line(points={{42,6},{42,6},{48,6},
|
|---|
| 2452 | {48,0},{57,0}}, color={0,0,127}));
|
|---|
| 2453 | connect(limDWe1.u, dWe) annotation (Line(
|
|---|
| 2454 | points={{56,42},{66,42},{66,72},{0,72},{0,100}},
|
|---|
| 2455 | color={0,0,127},
|
|---|
| 2456 | smooth=Smooth.None));
|
|---|
| 2457 | connect(uAgGen.dWe, limDWe1.y) annotation (Line(
|
|---|
| 2458 | points={{9.6,18},{14,18},{14,42},{33,42}},
|
|---|
| 2459 | color={0,0,127},
|
|---|
| 2460 | smooth=Smooth.None));
|
|---|
| 2461 | connect(uAgGen.We, polePairs.y) annotation (Line(
|
|---|
| 2462 | points={{9.6,6},{19,6}},
|
|---|
| 2463 | color={0,0,127},
|
|---|
| 2464 | smooth=Smooth.None));
|
|---|
| 2465 | connect(uAgGen.f, qSAsma.f) annotation (Line(
|
|---|
| 2466 | points={{-13,6},{-26,6},{-26,-38},{19.8182,-38}},
|
|---|
| 2467 | color={0,0,127},
|
|---|
| 2468 | smooth=Smooth.None));
|
|---|
| 2469 | connect(qSAsma.Uag, uAgGen.uAg) annotation (Line(
|
|---|
| 2470 | points={{19.8182,-26},{-32,-26},{-32,18},{-13,18}},
|
|---|
| 2471 | color={0,0,127},
|
|---|
| 2472 | smooth=Smooth.None));
|
|---|
| 2473 | connect(Wm1.flange, flange_a) annotation (Line(
|
|---|
| 2474 | points={{78,0},{102,0}},
|
|---|
| 2475 | color={0,0,0},
|
|---|
| 2476 | smooth=Smooth.None));
|
|---|
| 2477 | connect(vDCSens.p, pin_p) annotation (Line(
|
|---|
| 2478 | points={{-68,42},{-68,60},{-100,60}},
|
|---|
| 2479 | color={0,0,255},
|
|---|
| 2480 | smooth=Smooth.None));
|
|---|
| 2481 | connect(vDCSens.n, pin_n) annotation (Line(
|
|---|
| 2482 | points={{-68,22},{-68,-30},{-90,-30},{-90,-60},{-100,-60}},
|
|---|
| 2483 | color={0,0,255},
|
|---|
| 2484 | smooth=Smooth.None));
|
|---|
| 2485 | connect(vDCSens.v, uAgGen.dcVoltage) annotation (Line(
|
|---|
| 2486 | points={{-58,32},{-2,32},{-2,23.6}},
|
|---|
| 2487 | color={0,0,127},
|
|---|
| 2488 | smooth=Smooth.None));
|
|---|
| 2489 | annotation (
|
|---|
| 2490 | Dialog(tab="Other", group="Inverter"),
|
|---|
| 2491 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-80},
|
|---|
| 2492 | {100,80}}), graphics={Rectangle(
|
|---|
| 2493 | extent={{-42,62},{76,-12}},
|
|---|
| 2494 | lineColor={255,0,0},
|
|---|
| 2495 | pattern=LinePattern.Dash)}),
|
|---|
| 2496 | Documentation(info="<html>
|
|---|
| 2497 | <p>This model models an asynchronous machine - based electric drive, containing U/f control, with stator resistance drop compensation.</p>
|
|---|
| 2498 | <p>It makes usage of the quasi-stationary asynchornous machine model QSAsma.</p>
|
|---|
| 2499 | <p>The model can operate only with positive angular speeds.</p>
|
|---|
| 2500 | </html>"),
|
|---|
| 2501 | experiment(StopTime=300, Interval=0.1),
|
|---|
| 2502 | __Dymola_experimentSetupOutput,
|
|---|
| 2503 | Icon(coordinateSystem(
|
|---|
| 2504 | extent={{-100,-100},{100,100}},
|
|---|
| 2505 | preserveAspectRatio=true,
|
|---|
| 2506 | initialScale=0.1,
|
|---|
| 2507 | grid={2,2}), graphics={Line(points={{-28,20},{6,20}}, color={0,0,
|
|---|
| 2508 | 255}),Line(points={{-30,0},{4,0}}, color={0,0,255}),Line(points={
|
|---|
| 2509 | {-30,-20},{4,-20}}, color={0,0,255}),Text(
|
|---|
| 2510 | lineColor={0,0,255},
|
|---|
| 2511 | fillColor={95,95,95},
|
|---|
| 2512 | fillPattern=FillPattern.Solid,
|
|---|
| 2513 | extent={{-140,-112},{148,-146}},
|
|---|
| 2514 | textString="%name"),Line(points={{-102,-60},{-78,-60},{-78,-28},
|
|---|
| 2515 | {-60,-28}}, color={0,0,255}),Line(points={{-96,60},{-78,60},{-78,
|
|---|
| 2516 | 28},{-60,28}}, color={0,0,255}),Rectangle(
|
|---|
| 2517 | fillColor={175,175,175},
|
|---|
| 2518 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2519 | extent={{-40,68},{80,-52}}),Rectangle(
|
|---|
| 2520 | lineColor={0,0,255},
|
|---|
| 2521 | fillColor={0,0,255},
|
|---|
| 2522 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2523 | extent={{-40,68},{-62,-52}}),Polygon(fillPattern=FillPattern.Solid,
|
|---|
| 2524 | points={{-54,-82},{-44,-82},{-14,-12},{36,-12},{66,-82},{76,-82},
|
|---|
| 2525 | {76,-92},{-54,-92},{-54,-82}}),Rectangle(
|
|---|
| 2526 | fillColor={95,95,95},
|
|---|
| 2527 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2528 | extent={{80,12},{100,-8}}),Text(
|
|---|
| 2529 | lineColor={0,0,255},
|
|---|
| 2530 | fillColor={0,0,255},
|
|---|
| 2531 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2532 | extent={{-40,40},{68,18}},
|
|---|
| 2533 | textString="P.U.")}));
|
|---|
| 2534 | end AMDrivePU;
|
|---|
| 2535 |
|
|---|
| 2536 | model PMDrive
|
|---|
| 2537 | parameter Real Rs=0.03 "stator resistance (ohm)";
|
|---|
| 2538 | parameter Real Ipm=sqrt(2)*200 "PM equivalent current (=psi/Ld)";
|
|---|
| 2539 | parameter Integer pp=2 "pole pairs";
|
|---|
| 2540 | parameter Real Ld=1.837e-3 "direct-axis inductance (H)", Lq=1.837e-3
|
|---|
| 2541 | "quadrature axis inductance (H)";
|
|---|
| 2542 | parameter Real Inom=100 "nominal current (rms per phase)";
|
|---|
| 2543 | parameter Real Unom=100 "nominal voltage (rms per phase)";
|
|---|
| 2544 | parameter Real kInvLoss=6 "Inverter losses (W/(ampere AC rms))";
|
|---|
| 2545 | parameter Real J=0.29 "Moment of inertia (kg.m^2)";
|
|---|
| 2546 | SupportModels.PmsmAllFluxLimI allFluxLim(
|
|---|
| 2547 | Rs=Rs,
|
|---|
| 2548 | Ipm=Ipm,
|
|---|
| 2549 | pp=pp,
|
|---|
| 2550 | Ld=Ld,
|
|---|
| 2551 | Lq=Lq,
|
|---|
| 2552 | Unom=Unom,
|
|---|
| 2553 | Inom=Inom)
|
|---|
| 2554 | annotation (Placement(transformation(extent={{-52,-10},{-32,10}})));
|
|---|
| 2555 | Modelica.Mechanics.Rotational.Sources.Torque torque
|
|---|
| 2556 | annotation (Placement(transformation(extent={{-14,-10},{6,10}})));
|
|---|
| 2557 | Modelica.Mechanics.Rotational.Components.Inertia inertia(phi(fixed=true,
|
|---|
| 2558 | start=0), J=J)
|
|---|
| 2559 | annotation (Placement(transformation(extent={{58,-10},{78,10}})));
|
|---|
| 2560 | Modelica.Mechanics.Rotational.Sensors.SpeedSensor speedSensor annotation
|
|---|
| 2561 | (Placement(transformation(
|
|---|
| 2562 | extent={{-10,-10},{10,10}},
|
|---|
| 2563 | rotation=-90,
|
|---|
| 2564 | origin={16,-18})));
|
|---|
| 2565 | Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a
|
|---|
| 2566 | annotation (Placement(transformation(extent={{90,-10},{110,10}})));
|
|---|
| 2567 | Modelica.Blocks.Interfaces.RealInput tauRef
|
|---|
| 2568 | annotation (Placement(transformation(extent={{-126,-20},{-86,20}})));
|
|---|
| 2569 | SupportModels.DriveLosses invLoss(Rs=Rs, Kv=kInvLoss)
|
|---|
| 2570 | annotation (Placement(transformation(extent={{-16,18},{4,38}})));
|
|---|
| 2571 | Modelica.Blocks.Math.Add add(k1=1, k2=1) annotation (Placement(
|
|---|
| 2572 | transformation(
|
|---|
| 2573 | extent={{-10,-10},{10,10}},
|
|---|
| 2574 | rotation=90,
|
|---|
| 2575 | origin={26,46})));
|
|---|
| 2576 | SupportModels.Internal.ConstPDC dCLConstP(k=1, T=0.001) annotation (
|
|---|
| 2577 | Placement(transformation(
|
|---|
| 2578 | extent={{10,-10},{-10,10}},
|
|---|
| 2579 | rotation=90,
|
|---|
| 2580 | origin={0,90})));
|
|---|
| 2581 | Modelica.Mechanics.Rotational.Sensors.PowerSensor powerSensor
|
|---|
| 2582 | annotation (Placement(transformation(extent={{30,10},{50,-10}})));
|
|---|
| 2583 | Modelica.Electrical.Analog.Interfaces.PositivePin pin_p annotation (
|
|---|
| 2584 | Placement(transformation(extent={{-70,90},{-50,110}}),
|
|---|
| 2585 | iconTransformation(extent={{-70,90},{-50,110}})));
|
|---|
| 2586 | Modelica.Electrical.Analog.Interfaces.NegativePin pin_n annotation (
|
|---|
| 2587 | Placement(transformation(extent={{50,90},{70,110}}),
|
|---|
| 2588 | iconTransformation(extent={{50,90},{70,110}})));
|
|---|
| 2589 | Modelica.Electrical.Analog.Sensors.VoltageSensor uDCSens
|
|---|
| 2590 | annotation (Placement(transformation(extent={{-40,54},{-20,74}})));
|
|---|
| 2591 | equation
|
|---|
| 2592 | connect(speedSensor.w, allFluxLim.wMechanical) annotation (Line(
|
|---|
| 2593 | points={{16,-29},{16,-34},{-64,-34},{-64,-6},{-52.6,-6}},
|
|---|
| 2594 | color={0,0,127},
|
|---|
| 2595 | smooth=Smooth.None));
|
|---|
| 2596 | connect(allFluxLim.tauElectrical, torque.tau) annotation (Line(
|
|---|
| 2597 | points={{-31.2,-6},{-26,-6},{-26,0},{-16,0}},
|
|---|
| 2598 | color={0,0,127},
|
|---|
| 2599 | smooth=Smooth.None));
|
|---|
| 2600 | connect(inertia.flange_b, flange_a) annotation (Line(
|
|---|
| 2601 | points={{78,0},{100,0}},
|
|---|
| 2602 | color={0,0,0},
|
|---|
| 2603 | smooth=Smooth.None));
|
|---|
| 2604 | connect(allFluxLim.tauRef, tauRef) annotation (Line(
|
|---|
| 2605 | points={{-52.8,6},{-80,6},{-80,0},{-106,0}},
|
|---|
| 2606 | color={0,0,127},
|
|---|
| 2607 | smooth=Smooth.None));
|
|---|
| 2608 | connect(invLoss.Is, allFluxLim.Is) annotation (Line(
|
|---|
| 2609 | points={{-16.8,28},{-24,28},{-24,6},{-31.4,6}},
|
|---|
| 2610 | color={0,0,127},
|
|---|
| 2611 | smooth=Smooth.None));
|
|---|
| 2612 | connect(add.u1, invLoss.losses) annotation (Line(
|
|---|
| 2613 | points={{20,34},{20,28},{4.4,28}},
|
|---|
| 2614 | color={0,0,127},
|
|---|
| 2615 | smooth=Smooth.None));
|
|---|
| 2616 | connect(inertia.flange_a, powerSensor.flange_b) annotation (Line(
|
|---|
| 2617 | points={{58,0},{50,0}},
|
|---|
| 2618 | color={0,0,0},
|
|---|
| 2619 | smooth=Smooth.None));
|
|---|
| 2620 | connect(torque.flange, powerSensor.flange_a) annotation (Line(
|
|---|
| 2621 | points={{6,0},{30,0}},
|
|---|
| 2622 | color={0,0,0},
|
|---|
| 2623 | smooth=Smooth.None));
|
|---|
| 2624 | connect(speedSensor.flange, powerSensor.flange_a) annotation (Line(
|
|---|
| 2625 | points={{16,-8},{16,0},{30,0}},
|
|---|
| 2626 | color={0,0,0},
|
|---|
| 2627 | smooth=Smooth.None));
|
|---|
| 2628 | connect(powerSensor.power, add.u2) annotation (Line(
|
|---|
| 2629 | points={{32,11},{32,34}},
|
|---|
| 2630 | color={0,0,127},
|
|---|
| 2631 | smooth=Smooth.None));
|
|---|
| 2632 | connect(add.y, dCLConstP.Pref) annotation (Line(
|
|---|
| 2633 | points={{26,57},{26,80},{0,80},{0,81.8}},
|
|---|
| 2634 | color={0,0,127},
|
|---|
| 2635 | smooth=Smooth.None));
|
|---|
| 2636 | connect(dCLConstP.pin_p, pin_p) annotation (Line(
|
|---|
| 2637 | points={{-10,90},{-60,90},{-60,100}},
|
|---|
| 2638 | color={0,0,255},
|
|---|
| 2639 | smooth=Smooth.None));
|
|---|
| 2640 | connect(dCLConstP.pin_n, pin_n) annotation (Line(
|
|---|
| 2641 | points={{9.8,90},{60,90},{60,100}},
|
|---|
| 2642 | color={0,0,255},
|
|---|
| 2643 | smooth=Smooth.None));
|
|---|
| 2644 | connect(uDCSens.v, allFluxLim.uDC) annotation (Line(
|
|---|
| 2645 | points={{-30,54},{-30,28},{-64,28},{-64,0},{-53,0}},
|
|---|
| 2646 | color={0,0,127},
|
|---|
| 2647 | smooth=Smooth.None));
|
|---|
| 2648 | connect(uDCSens.p, pin_p) annotation (Line(
|
|---|
| 2649 | points={{-40,64},{-44,64},{-44,80},{-44,80},{-44,90},{-60,90},{-60,
|
|---|
| 2650 | 100}},
|
|---|
| 2651 | color={0,0,255},
|
|---|
| 2652 | smooth=Smooth.None));
|
|---|
| 2653 | connect(uDCSens.n, pin_n) annotation (Line(
|
|---|
| 2654 | points={{-20,64},{46,64},{46,90},{60,90},{60,100}},
|
|---|
| 2655 | color={0,0,255},
|
|---|
| 2656 | smooth=Smooth.None));
|
|---|
| 2657 | annotation (
|
|---|
| 2658 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-60},
|
|---|
| 2659 | {100,100}}), graphics),
|
|---|
| 2660 | experiment(StopTime=5),
|
|---|
| 2661 | __Dymola_experimentSetupOutput,
|
|---|
| 2662 | Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{
|
|---|
| 2663 | 100,100}}), graphics={Rectangle(
|
|---|
| 2664 | extent={{72,10},{98,-10}},
|
|---|
| 2665 | lineColor={0,0,0},
|
|---|
| 2666 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2667 | fillColor={95,95,95}),Line(
|
|---|
| 2668 | points={{-118,0},{-56,0}},
|
|---|
| 2669 | color={0,0,127},
|
|---|
| 2670 | smooth=Smooth.None,
|
|---|
| 2671 | thickness=0.5),Rectangle(
|
|---|
| 2672 | extent={{-44,60},{76,-60}},
|
|---|
| 2673 | lineColor={0,0,0},
|
|---|
| 2674 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2675 | fillColor={135,135,135}),Rectangle(
|
|---|
| 2676 | extent={{-44,60},{-64,-60}},
|
|---|
| 2677 | lineColor={0,0,0},
|
|---|
| 2678 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2679 | fillColor={0,0,127}),Rectangle(
|
|---|
| 2680 | extent={{-64,70},{76,48}},
|
|---|
| 2681 | lineColor={95,95,95},
|
|---|
| 2682 | fillColor={0,0,255},
|
|---|
| 2683 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 2684 | points={{-54,-90},{-44,-90},{-14,-20},{36,-20},{66,-90},{76,-90},
|
|---|
| 2685 | {76,-100},{-54,-100},{-54,-90}},
|
|---|
| 2686 | lineColor={0,0,0},
|
|---|
| 2687 | fillColor={0,0,0},
|
|---|
| 2688 | fillPattern=FillPattern.Solid),Line(points={{58,100},{40,100},
|
|---|
| 2689 | {40,70}}, color={0,0,255}),Ellipse(
|
|---|
| 2690 | extent={{-24,44},{44,-24}},
|
|---|
| 2691 | lineColor={0,0,0},
|
|---|
| 2692 | fillColor={215,215,215},
|
|---|
| 2693 | fillPattern=FillPattern.Solid),Rectangle(
|
|---|
| 2694 | extent={{10,20},{40,0}},
|
|---|
| 2695 | lineColor={0,0,0},
|
|---|
| 2696 | fillColor={255,0,0},
|
|---|
| 2697 | fillPattern=FillPattern.Solid),Rectangle(
|
|---|
| 2698 | extent={{-20,20},{10,0}},
|
|---|
| 2699 | lineColor={0,0,0},
|
|---|
| 2700 | fillColor={0,255,0},
|
|---|
| 2701 | fillPattern=FillPattern.Solid),Line(points={{-64,100},{-40,
|
|---|
| 2702 | 100},{-40,66}}, color={0,0,255}),Text(
|
|---|
| 2703 | extent={{-100,-110},{100,-150}},
|
|---|
| 2704 | lineColor={0,0,255},
|
|---|
| 2705 | textString="%name")}),
|
|---|
| 2706 | Documentation(info="<html>
|
|---|
| 2707 | <p>Model of Permanent-Magnet Sychronous Machine based drive trains.</p>
|
|---|
| 2708 | <p>It operates at the optimal angle between PM and stator flux, both in full flux and flux weakening behaviour.</p>
|
|---|
| 2709 | <p>Full description of the model can be found in the following paper.</p>
|
|---|
| 2710 | <p>M. Ceraolo "Modelica synchronous electric drive model for EV and HEV simulations" submitted for publication to the IEEE transactions on Vehicular Tehnologies.</p>
|
|---|
| 2711 | </html>"));
|
|---|
| 2712 | end PMDrive;
|
|---|
| 2713 |
|
|---|
| 2714 | model AMDriveOLD "asynchronous machine-based electric drive"
|
|---|
| 2715 | import PI = Modelica.Constants.pi;
|
|---|
| 2716 | Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a annotation (
|
|---|
| 2717 | Placement(transformation(extent={{90,-10},{110,10}}),
|
|---|
| 2718 | iconTransformation(extent={{90,-10},{110,10}})));
|
|---|
| 2719 | parameter Integer pp=2 "pole pairs";
|
|---|
| 2720 | parameter Modelica.SIunits.Voltage UBase=230
|
|---|
| 2721 | "Base RMS machine line voltage";
|
|---|
| 2722 | parameter Modelica.SIunits.AngularFrequency WeBase=314.15
|
|---|
| 2723 | "Base machine angular frequency ";
|
|---|
| 2724 | parameter Modelica.SIunits.AngularFrequency WeMax=314.15
|
|---|
| 2725 | "Base machine angular frequency";
|
|---|
| 2726 | parameter Modelica.SIunits.Voltage Unom=200
|
|---|
| 2727 | "DC nominal voltage (only order of magnitude needed)";
|
|---|
| 2728 | parameter Modelica.SIunits.Resistance R1=0.435
|
|---|
| 2729 | "Stator's phase resistance"
|
|---|
| 2730 | annotation (Dialog(tab="machine parameters"));
|
|---|
| 2731 | parameter Modelica.SIunits.Inductance L1=0.004
|
|---|
| 2732 | "Stator's leakage inductance"
|
|---|
| 2733 | annotation (Dialog(tab="machine parameters"));
|
|---|
| 2734 | parameter Modelica.SIunits.Inductance Lm=0.0693
|
|---|
| 2735 | "Stator's leakage inductance"
|
|---|
| 2736 | annotation (Dialog(tab="machine parameters"));
|
|---|
| 2737 | parameter Modelica.SIunits.Resistance R2=0.4 "Rotor's phase resistance "
|
|---|
| 2738 | annotation (Dialog(tab="machine parameters"));
|
|---|
| 2739 | parameter Modelica.SIunits.Inductance L2=0.002
|
|---|
| 2740 | "Rotor's leakage inductance"
|
|---|
| 2741 | annotation (Dialog(tab="machine parameters"));
|
|---|
| 2742 | parameter Modelica.SIunits.MomentOfInertia J=2.0
|
|---|
| 2743 | "Rotor's moment of inertia"
|
|---|
| 2744 | annotation (Dialog(tab="machine parameters"));
|
|---|
| 2745 | parameter Real lossFact=4
|
|---|
| 2746 | "Ratio of inverter losses (W) to machine current (A)";
|
|---|
| 2747 | Modelica.Electrical.Analog.Interfaces.PositivePin pin_p annotation (
|
|---|
| 2748 | Placement(transformation(extent={{-110,50},{-90,70}}),
|
|---|
| 2749 | iconTransformation(extent={{-112,50},{-92,70}})));
|
|---|
| 2750 | Modelica.Electrical.Analog.Interfaces.NegativePin pin_n annotation (
|
|---|
| 2751 | Placement(transformation(extent={{-110,-70},{-90,-50}}),
|
|---|
| 2752 | iconTransformation(extent={{-112,-70},{-92,-50}})));
|
|---|
| 2753 | EHPT.SupportModels.Internal.ConstPDC dcLoad(T=0.01, k=1000/Unom)
|
|---|
| 2754 | annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
|
|---|
| 2755 | Modelica.Blocks.Interfaces.RealInput dWe annotation (Placement(
|
|---|
| 2756 | transformation(
|
|---|
| 2757 | extent={{-20,-20},{20,20}},
|
|---|
| 2758 | rotation=270,
|
|---|
| 2759 | origin={0,120}), iconTransformation(
|
|---|
| 2760 | extent={{-20,-20},{20,20}},
|
|---|
| 2761 | rotation=270,
|
|---|
| 2762 | origin={0,88})));
|
|---|
| 2763 | Modelica.Blocks.Nonlinear.Limiter limDWe(uMax=R2/(L1 + L2), uMin=-R2/(L1
|
|---|
| 2764 | + L2)) annotation (Placement(transformation(
|
|---|
| 2765 | extent={{-10,-10},{10,10}},
|
|---|
| 2766 | rotation=270,
|
|---|
| 2767 | origin={70,76})));
|
|---|
| 2768 | Modelica.Blocks.Math.Gain ToFreq(k=1/(2*PI)) annotation (Placement(
|
|---|
| 2769 | visible=true, transformation(
|
|---|
| 2770 | origin={-30,46},
|
|---|
| 2771 | extent={{-10,-10},{10,10}},
|
|---|
| 2772 | rotation=180)));
|
|---|
| 2773 | Modelica.Blocks.Math.Gain gain(k=fContr) annotation (Placement(visible=
|
|---|
| 2774 | true, transformation(extent={{-38,-4},{-18,16}}, rotation=0)));
|
|---|
| 2775 | Modelica.Blocks.Sources.RealExpression uAG_(y=innerUag) annotation (
|
|---|
| 2776 | Placement(visible=true, transformation(extent={{-10,-4},{10,16}},
|
|---|
| 2777 | rotation=0)));
|
|---|
| 2778 | Modelica.Blocks.Nonlinear.Limiter limWe(uMax=WeMax) annotation (Placement(
|
|---|
| 2779 | visible=true, transformation(extent={{16,36},{-4,56}}, rotation=0)));
|
|---|
| 2780 | EDsupport.QSAsma qSAsma(
|
|---|
| 2781 | pp=pp,
|
|---|
| 2782 | R1=R1,
|
|---|
| 2783 | L1=L1,
|
|---|
| 2784 | Lm=Lm,
|
|---|
| 2785 | R2=R2,
|
|---|
| 2786 | L2=L2,
|
|---|
| 2787 | J=J) annotation (Placement(visible=true, transformation(extent={{22,-32},
|
|---|
| 2788 | {46,-12}}, rotation=0)));
|
|---|
| 2789 | Modelica.Blocks.Math.Add add annotation (Placement(visible=true,
|
|---|
| 2790 | transformation(
|
|---|
| 2791 | origin={40,46},
|
|---|
| 2792 | extent={{10,-10},{-10,10}},
|
|---|
| 2793 | rotation=0)));
|
|---|
| 2794 | Modelica.Blocks.Math.Add addPdc annotation (Placement(visible=true,
|
|---|
| 2795 | transformation(
|
|---|
| 2796 | origin={-58,-54},
|
|---|
| 2797 | extent={{-10,-10},{10,10}},
|
|---|
| 2798 | rotation=180)));
|
|---|
| 2799 | Modelica.Blocks.Math.Gain polePairs(k=pp) annotation (Placement(visible=
|
|---|
| 2800 | true, transformation(
|
|---|
| 2801 | origin={62,22},
|
|---|
| 2802 | extent={{10,-10},{-10,10}},
|
|---|
| 2803 | rotation=270)));
|
|---|
| 2804 | Modelica.Mechanics.Rotational.Sensors.SpeedSensor Wm annotation (
|
|---|
| 2805 | Placement(visible=true, transformation(
|
|---|
| 2806 | origin={62,-6},
|
|---|
| 2807 | extent={{10,-10},{-10,10}},
|
|---|
| 2808 | rotation=270)));
|
|---|
| 2809 | Modelica.Blocks.Math.Gain lossF_(k=lossFact) annotation (Placement(
|
|---|
| 2810 | visible=true, transformation(
|
|---|
| 2811 | origin={-18,-64},
|
|---|
| 2812 | extent={{-10,-10},{10,10}},
|
|---|
| 2813 | rotation=180)));
|
|---|
| 2814 | protected
|
|---|
| 2815 | parameter Real UBase1=UBase/sqrt(3);
|
|---|
| 2816 | //single-circuit equivalent of UBase
|
|---|
| 2817 | parameter Real fContr=UBase1/(WeBase/(2*PI));
|
|---|
| 2818 | //constant U/f
|
|---|
| 2819 | parameter Real WeNom=WeBase;
|
|---|
| 2820 | parameter Real WmNom=WeNom/pp;
|
|---|
| 2821 | Real innerUag;
|
|---|
| 2822 | equation
|
|---|
| 2823 | connect(qSAsma.Is, lossF_.u) annotation (Line(points={{39.4545,-33},{
|
|---|
| 2824 | 39.4545,-64},{-6,-64}}, color={0,0,127}));
|
|---|
| 2825 | connect(lossF_.y, addPdc.u1) annotation (Line(points={{-29,-64},{-38,-64},
|
|---|
| 2826 | {-38,-60},{-46,-60}}, color={0,0,127}));
|
|---|
| 2827 | connect(Wm.flange, flange_a)
|
|---|
| 2828 | annotation (Line(points={{62,-16},{62,-28},{80,-28},{80,0},{100,0}}));
|
|---|
| 2829 | connect(polePairs.u, Wm.w)
|
|---|
| 2830 | annotation (Line(points={{62,10},{62,5}}, color={0,0,127}));
|
|---|
| 2831 | connect(polePairs.y, add.u2)
|
|---|
| 2832 | annotation (Line(points={{62,33},{62,40},{52,40}}, color={0,0,127}));
|
|---|
| 2833 | connect(addPdc.u2, qSAsma.Pdc) annotation (Line(points={{-46,-48},{
|
|---|
| 2834 | 26.3636,-48},{26.3636,-33}}, color={0,0,127}));
|
|---|
| 2835 | connect(addPdc.y, dcLoad.Pref) annotation (Line(points={{-69,-54},{-76,-54},
|
|---|
| 2836 | {-76,0},{-81.8,0}}, color={0,0,127}));
|
|---|
| 2837 | connect(limWe.u, add.y)
|
|---|
| 2838 | annotation (Line(points={{18,46},{29,46}}, color={0,0,127}));
|
|---|
| 2839 | connect(limDWe.y, add.u1)
|
|---|
| 2840 | annotation (Line(points={{70,65},{70,52},{52,52}}, color={0,0,127}));
|
|---|
| 2841 | connect(qSAsma.Uag, uAG_.y) annotation (Line(points={{19.8182,-16},{
|
|---|
| 2842 | 17.0909,-16},{17.0909,6},{11,6}}, color={0,0,127}));
|
|---|
| 2843 | connect(ToFreq.y, qSAsma.f) annotation (Line(points={{-41,46},{-58,46},{-58,
|
|---|
| 2844 | -14},{-40,-14},{-40,-28},{19.8182,-28}}, color={0,0,127}));
|
|---|
| 2845 | connect(gain.u, qSAsma.f) annotation (Line(points={{-40,6},{-40,-28},{
|
|---|
| 2846 | 19.8182,-28}}, color={0,0,127}));
|
|---|
| 2847 | connect(qSAsma.flange_a, flange_a)
|
|---|
| 2848 | annotation (Line(points={{43.8182,-22},{80,-22},{80,0},{100,0}}));
|
|---|
| 2849 | connect(limWe.y, ToFreq.u)
|
|---|
| 2850 | annotation (Line(points={{-5,46},{-18,46}}, color={0,0,127}));
|
|---|
| 2851 | innerUag = if noEvent(abs(dcLoad.v)) > 2.5*gain.y then gain.y else
|
|---|
| 2852 | noEvent(abs(dcLoad.v))/2.5;
|
|---|
| 2853 | connect(dcLoad.pin_p, pin_p) annotation (Line(
|
|---|
| 2854 | points={{-90,10},{-90,60},{-100,60}},
|
|---|
| 2855 | color={0,0,255},
|
|---|
| 2856 | smooth=Smooth.None));
|
|---|
| 2857 | connect(dcLoad.pin_n, pin_n) annotation (Line(
|
|---|
| 2858 | points={{-90,-9.8},{-90,-60},{-100,-60}},
|
|---|
| 2859 | color={0,0,255},
|
|---|
| 2860 | smooth=Smooth.None));
|
|---|
| 2861 | connect(limDWe.u, dWe) annotation (Line(
|
|---|
| 2862 | points={{70,88},{70,92},{0,92},{0,120}},
|
|---|
| 2863 | color={0,0,127},
|
|---|
| 2864 | smooth=Smooth.None));
|
|---|
| 2865 | annotation (
|
|---|
| 2866 | Placement(transformation(extent={{-80,72},{-60,92}})),
|
|---|
| 2867 | Dialog(tab="Other", group="Inverter"),
|
|---|
| 2868 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-80},
|
|---|
| 2869 | {100,100}}), graphics),
|
|---|
| 2870 | Documentation(info="<html>
|
|---|
| 2871 | <p>This model models an asynchronous machine - based electric drive, containing U/f control, with stator resistance drop compensation.</p>
|
|---|
| 2872 | <p>It makes usage of the quasi-stationary asynchornous machine model QSAsma.</p>
|
|---|
| 2873 | <p>The model can operate only with positive angular speeds.</p>
|
|---|
| 2874 | <p>Full description of the model can be found in the following paper.</p>
|
|---|
| 2875 | <p>M. Ceraolo and F. Casella "Asynchronous machine electric drives modelling for EV simulations using Modelica" submitted for publication to <i>Simulation modelling practice and Theory</i>, Elsevier</p>
|
|---|
| 2876 | </html>"),
|
|---|
| 2877 | experiment(StopTime=300, Interval=0.1),
|
|---|
| 2878 | __Dymola_experimentSetupOutput,
|
|---|
| 2879 | Icon(coordinateSystem(
|
|---|
| 2880 | extent={{-100,-100},{100,100}},
|
|---|
| 2881 | preserveAspectRatio=true,
|
|---|
| 2882 | initialScale=0.1,
|
|---|
| 2883 | grid={2,2}), graphics={Line(points={{-28,20},{6,20}}, color={0,0,
|
|---|
| 2884 | 255}),Line(points={{-30,0},{4,0}}, color={0,0,255}),Line(points={
|
|---|
| 2885 | {-30,-20},{4,-20}}, color={0,0,255}),Text(
|
|---|
| 2886 | lineColor={0,0,255},
|
|---|
| 2887 | fillColor={95,95,95},
|
|---|
| 2888 | fillPattern=FillPattern.Solid,
|
|---|
| 2889 | extent={{-140,-112},{148,-146}},
|
|---|
| 2890 | textString="%name"),Line(points={{-102,-60},{-78,-60},{-78,-28},
|
|---|
| 2891 | {-60,-28}}, color={0,0,255}),Line(points={{-96,60},{-78,60},{-78,
|
|---|
| 2892 | 28},{-60,28}}, color={0,0,255}),Rectangle(
|
|---|
| 2893 | fillColor={175,175,175},
|
|---|
| 2894 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2895 | extent={{-40,68},{80,-52}}),Rectangle(
|
|---|
| 2896 | lineColor={0,0,255},
|
|---|
| 2897 | fillColor={0,0,255},
|
|---|
| 2898 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2899 | extent={{-40,68},{-62,-52}}),Polygon(fillPattern=FillPattern.Solid,
|
|---|
| 2900 | points={{-54,-82},{-44,-82},{-14,-12},{36,-12},{66,-82},{76,-82},
|
|---|
| 2901 | {76,-92},{-54,-92},{-54,-82}}),Rectangle(
|
|---|
| 2902 | fillColor={95,95,95},
|
|---|
| 2903 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 2904 | extent={{80,12},{100,-8}})}));
|
|---|
| 2905 | end AMDriveOLD;
|
|---|
| 2906 |
|
|---|
| 2907 | package TestingModels
|
|---|
| 2908 | extends Modelica.Icons.ExamplesPackage;
|
|---|
| 2909 |
|
|---|
| 2910 | model TestAMDrive
|
|---|
| 2911 | "Compares QSDrive with a drive based on the MSL asynchronous machine"
|
|---|
| 2912 | // extends Modelica.Icons.Example;
|
|---|
| 2913 | import Modelica.Constants.pi;
|
|---|
| 2914 | parameter Modelica.SIunits.AngularVelocity DeltaOmEl=25
|
|---|
| 2915 | "Controller Delta Omega";
|
|---|
| 2916 | // Real Pac=aimc.plug_sp[i]
|
|---|
| 2917 | Modelica.Blocks.Sources.Constant const1(k=-500) annotation (Placement(
|
|---|
| 2918 | transformation(
|
|---|
| 2919 | extent={{-10,-10},{10,10}},
|
|---|
| 2920 | rotation=180,
|
|---|
| 2921 | origin={90,-20})));
|
|---|
| 2922 | Modelica.Electrical.Machines.Utilities.TerminalBox terminalBox
|
|---|
| 2923 | annotation (Placement(transformation(extent={{-10,60},{10,80}})));
|
|---|
| 2924 | Modelica.Electrical.Analog.Basic.Ground ground
|
|---|
| 2925 | annotation (Placement(transformation(extent={{-90,14},{-70,34}})));
|
|---|
| 2926 | Modelica.Electrical.MultiPhase.Basic.Star star annotation (Placement(
|
|---|
| 2927 | transformation(
|
|---|
| 2928 | extent={{-10,-10},{10,10}},
|
|---|
| 2929 | rotation=270,
|
|---|
| 2930 | origin={-80,58})));
|
|---|
| 2931 | Modelica.Mechanics.Rotational.Sources.Torque torque annotation (
|
|---|
| 2932 | Placement(transformation(
|
|---|
| 2933 | extent={{-10,-10},{10,10}},
|
|---|
| 2934 | rotation=180,
|
|---|
| 2935 | origin={74,40})));
|
|---|
| 2936 | Modelica.Electrical.MultiPhase.Sources.SignalVoltage signalVoltage
|
|---|
| 2937 | annotation (Placement(transformation(
|
|---|
| 2938 | extent={{-10,-10},{10,10}},
|
|---|
| 2939 | rotation=180,
|
|---|
| 2940 | origin={-70,80})));
|
|---|
| 2941 | Modelica.Mechanics.Rotational.Sensors.SpeedSensor wMot annotation (
|
|---|
| 2942 | Placement(transformation(
|
|---|
| 2943 | extent={{-7,-7},{7,7}},
|
|---|
| 2944 | rotation=270,
|
|---|
| 2945 | origin={59,19})));
|
|---|
| 2946 | Modelica.Blocks.Sources.Constant dWe(k=25)
|
|---|
| 2947 | annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
|
|---|
| 2948 | Modelica.Mechanics.Rotational.Components.Inertia inertia(J=40)
|
|---|
| 2949 | annotation (Placement(transformation(extent={{22,30},{42,50}})));
|
|---|
| 2950 | TestingModels.AsmaUgenerator uVar(
|
|---|
| 2951 | UBase=400,
|
|---|
| 2952 | pp=2,
|
|---|
| 2953 | WeBase=314.15,
|
|---|
| 2954 | WeMax=314.15) annotation (Placement(transformation(
|
|---|
| 2955 | extent={{-14,-10},{14,10}},
|
|---|
| 2956 | rotation=90,
|
|---|
| 2957 | origin={-50,46})));
|
|---|
| 2958 | Modelica.Electrical.Machines.BasicMachines.AsynchronousInductionMachines.AIM_SquirrelCage
|
|---|
| 2959 | aimc(
|
|---|
| 2960 | p=2,
|
|---|
| 2961 | fsNominal=50,
|
|---|
| 2962 | Rs=0.016,
|
|---|
| 2963 | Lssigma=0.07039/(100*pi),
|
|---|
| 2964 | Lm=2.046/(100*pi),
|
|---|
| 2965 | Lrsigma=0.07039/(100*pi),
|
|---|
| 2966 | Rr=0.0313,
|
|---|
| 2967 | Jr=0.341,
|
|---|
| 2968 | TrOperational=293.15,
|
|---|
| 2969 | TsOperational=293.15,
|
|---|
| 2970 | TsRef=293.15,
|
|---|
| 2971 | alpha20s=0)
|
|---|
| 2972 | annotation (Placement(transformation(extent={{-10,30},{10,50}})));
|
|---|
| 2973 | SupportModels.PTrifSensor pAC
|
|---|
| 2974 | annotation (Placement(transformation(extent={{-42,70},{-22,90}})));
|
|---|
| 2975 | Modelica.Electrical.Analog.Sensors.PowerSensor pDC annotation (
|
|---|
| 2976 | Placement(visible=true, transformation(
|
|---|
| 2977 | origin={-34,-34},
|
|---|
| 2978 | extent={{-10,-10},{10,10}},
|
|---|
| 2979 | rotation=0)));
|
|---|
| 2980 | AMDrive qSDrive(
|
|---|
| 2981 | UBase=400,
|
|---|
| 2982 | WeMax=314.15,
|
|---|
| 2983 | Unom=800,
|
|---|
| 2984 | R1=0.016,
|
|---|
| 2985 | L1=0.07039/(100*pi),
|
|---|
| 2986 | Lm=2.046/(100*pi),
|
|---|
| 2987 | R2=0.0313,
|
|---|
| 2988 | L2=0.07039/(100*pi),
|
|---|
| 2989 | J=0.341,
|
|---|
| 2990 | pp=2,
|
|---|
| 2991 | lossFact=0) annotation (Placement(visible=true, transformation(
|
|---|
| 2992 | origin={-2,-44},
|
|---|
| 2993 | extent={{-10,-10},{10,10}},
|
|---|
| 2994 | rotation=0)));
|
|---|
| 2995 | Modelica.Electrical.Analog.Sources.ConstantVoltage Udc(V=1000)
|
|---|
| 2996 | annotation (Placement(visible=true, transformation(
|
|---|
| 2997 | origin={-58,-44},
|
|---|
| 2998 | extent={{-10,-10},{10,10}},
|
|---|
| 2999 | rotation=270)));
|
|---|
| 3000 | Modelica.Mechanics.Rotational.Components.Inertia inertia1(J=40)
|
|---|
| 3001 | annotation (Placement(visible=true, transformation(
|
|---|
| 3002 | origin={32,-44},
|
|---|
| 3003 | extent={{-10,-10},{10,10}},
|
|---|
| 3004 | rotation=0)));
|
|---|
| 3005 | Modelica.Electrical.Analog.Basic.Ground ground1 annotation (Placement(
|
|---|
| 3006 | visible=true, transformation(
|
|---|
| 3007 | origin={-58,-72},
|
|---|
| 3008 | extent={{-10,-10},{10,10}},
|
|---|
| 3009 | rotation=0)));
|
|---|
| 3010 | Modelica.Mechanics.Rotational.Sources.Torque torque1 annotation (
|
|---|
| 3011 | Placement(visible=true, transformation(
|
|---|
| 3012 | origin={58,-44},
|
|---|
| 3013 | extent={{-10,-10},{10,10}},
|
|---|
| 3014 | rotation=180)));
|
|---|
| 3015 | Modelica.Blocks.Sources.Constant dWe1(k=23) annotation (Placement(
|
|---|
| 3016 | visible=true, transformation(
|
|---|
| 3017 | origin={24,-16},
|
|---|
| 3018 | extent={{10,-10},{-10,10}},
|
|---|
| 3019 | rotation=0)));
|
|---|
| 3020 | Modelica.Blocks.Sources.Constant U1(k=15) annotation (Placement(visible
|
|---|
| 3021 | =true, transformation(
|
|---|
| 3022 | origin={-51,19},
|
|---|
| 3023 | extent={{-8,-8},{8,8}},
|
|---|
| 3024 | rotation=90)));
|
|---|
| 3025 | equation
|
|---|
| 3026 | connect(U1.y, uVar.U0) annotation (Line(points={{-51,27.8},{-51,34.7},{
|
|---|
| 3027 | -50.1,34.7}}, color={0,0,127}));
|
|---|
| 3028 | connect(torque1.tau, const1.y) annotation (Line(points={{70,-44},{74,-44},
|
|---|
| 3029 | {74,-20},{79,-20},{79,-20}}, color={0,0,127}));
|
|---|
| 3030 | connect(dWe1.y, qSDrive.dWe) annotation (Line(points={{13,-16},{-2,-16},
|
|---|
| 3031 | {-2,-35.2}}, color={0,0,127}));
|
|---|
| 3032 | connect(inertia1.flange_b, torque1.flange)
|
|---|
| 3033 | annotation (Line(points={{42,-44},{48,-44}}));
|
|---|
| 3034 | connect(ground1.p, Udc.n)
|
|---|
| 3035 | annotation (Line(points={{-58,-62},{-58,-54}}, color={0,0,255}));
|
|---|
| 3036 | connect(inertia1.flange_a, qSDrive.flange_a)
|
|---|
| 3037 | annotation (Line(points={{22,-44},{8,-44}}));
|
|---|
| 3038 | connect(pDC.nv, Udc.n) annotation (Line(points={{-34,-44},{-34,-62},{-58,
|
|---|
| 3039 | -62},{-58,-54}}, color={0,0,255}));
|
|---|
| 3040 | connect(pDC.pc, Udc.p)
|
|---|
| 3041 | annotation (Line(points={{-44,-34},{-58,-34}}, color={0,0,255}));
|
|---|
| 3042 | connect(qSDrive.pin_n, pDC.nv) annotation (Line(points={{-12.2,-50},{-18,
|
|---|
| 3043 | -50},{-20,-50},{-20,-62},{-34,-62},{-34,-44}}, color={0,0,255}));
|
|---|
| 3044 | connect(qSDrive.pin_p, pDC.nc) annotation (Line(points={{-12.2,-38},{-18,
|
|---|
| 3045 | -38},{-18,-34},{-24,-34}}, color={0,0,255}));
|
|---|
| 3046 | connect(pDC.pv, pDC.pc) annotation (Line(points={{-34,-24},{-44,-24},{-44,
|
|---|
| 3047 | -34},{-44,-34}}, color={0,0,255}));
|
|---|
| 3048 | connect(ground.p, star.pin_n) annotation (Line(
|
|---|
| 3049 | points={{-80,34},{-80,48}},
|
|---|
| 3050 | color={0,0,255},
|
|---|
| 3051 | smooth=Smooth.None));
|
|---|
| 3052 | connect(signalVoltage.plug_n, star.plug_p) annotation (Line(
|
|---|
| 3053 | points={{-80,80},{-80,68}},
|
|---|
| 3054 | color={0,0,255},
|
|---|
| 3055 | smooth=Smooth.None));
|
|---|
| 3056 | connect(wMot.flange, torque.flange) annotation (Line(
|
|---|
| 3057 | points={{59,26},{59,33},{64,33},{64,40}},
|
|---|
| 3058 | color={0,0,0},
|
|---|
| 3059 | smooth=Smooth.None));
|
|---|
| 3060 | connect(torque.tau, const1.y) annotation (Line(
|
|---|
| 3061 | points={{86,40},{92,40},{92,0},{72,0},{72,-20},{79,-20}},
|
|---|
| 3062 | color={0,0,127},
|
|---|
| 3063 | smooth=Smooth.None));
|
|---|
| 3064 | connect(inertia.flange_b, torque.flange) annotation (Line(
|
|---|
| 3065 | points={{42,40},{64,40}},
|
|---|
| 3066 | color={0,0,0},
|
|---|
| 3067 | smooth=Smooth.None));
|
|---|
| 3068 | connect(uVar.DWe, dWe.y) annotation (Line(
|
|---|
| 3069 | points={{-38.7,40.1},{-36,40.1},{-36,0},{-79,0}},
|
|---|
| 3070 | color={0,0,127},
|
|---|
| 3071 | smooth=Smooth.None));
|
|---|
| 3072 | connect(uVar.U, signalVoltage.v) annotation (Line(
|
|---|
| 3073 | points={{-54,57},{-54,68},{-70,68},{-70,73}},
|
|---|
| 3074 | color={0,0,127},
|
|---|
| 3075 | smooth=Smooth.None));
|
|---|
| 3076 | connect(uVar.Wm, wMot.w) annotation (Line(
|
|---|
| 3077 | points={{-38.7,52.3},{-24,52.3},{-24,6},{59,6},{59,11.3}},
|
|---|
| 3078 | color={0,0,127},
|
|---|
| 3079 | smooth=Smooth.None));
|
|---|
| 3080 | connect(aimc.plug_sp, terminalBox.plug_sp) annotation (Line(
|
|---|
| 3081 | points={{6,50},{6,60}},
|
|---|
| 3082 | color={0,0,255},
|
|---|
| 3083 | smooth=Smooth.None));
|
|---|
| 3084 | connect(aimc.plug_sn, terminalBox.plug_sn) annotation (Line(
|
|---|
| 3085 | points={{-6,50},{-6,60}},
|
|---|
| 3086 | color={0,0,255},
|
|---|
| 3087 | smooth=Smooth.None));
|
|---|
| 3088 | connect(aimc.flange, inertia.flange_a) annotation (Line(
|
|---|
| 3089 | points={{10,40},{22,40}},
|
|---|
| 3090 | color={0,0,0},
|
|---|
| 3091 | smooth=Smooth.None));
|
|---|
| 3092 | connect(signalVoltage.plug_p, pAC.pc) annotation (Line(
|
|---|
| 3093 | points={{-60,80},{-42,80}},
|
|---|
| 3094 | color={0,0,255},
|
|---|
| 3095 | smooth=Smooth.None));
|
|---|
| 3096 | connect(pAC.nc, terminalBox.plugSupply) annotation (Line(
|
|---|
| 3097 | points={{-22,80},{0,80},{0,62}},
|
|---|
| 3098 | color={0,0,255},
|
|---|
| 3099 | smooth=Smooth.None));
|
|---|
| 3100 | annotation (
|
|---|
| 3101 | experimentSetupOutput,
|
|---|
| 3102 | Documentation(info="<html>
|
|---|
| 3103 | <p>This system simulates variable-frequency start-up of an asyncronous motor in two different ways.</p>
|
|---|
| 3104 | <p>The above system uses the MSL aimc, and a variable voltage variable frequency source obtained by controlled generators.</p>
|
|---|
| 3105 | <p><br>The system below is built around the QSDrive, that in turn is built along a machine model that makes usage of the Quasi-Stationary MSL library.</p>
|
|---|
| 3106 | <p>In both cases the motor supply is constituted by a three-phase system of quasi-sinusoidal shapes, created according to the following equations:</p>
|
|---|
| 3107 | <p>Wel=Wmecc*PolePairs+DeltaWel</p>
|
|---|
| 3108 | <p>U=U0+(Ubase-U0)*(Wel)/WElbase</p>
|
|---|
| 3109 | <p>where:</p>
|
|---|
| 3110 | <ul>
|
|---|
| 3111 | <li>U0, Ubase U, are initial, base, actual voltage amplitudes</li>
|
|---|
| 3112 | <li>Wmecc, Wel, are machine, mechanical and supply, electrical angular speeds</li>
|
|---|
| 3113 | <li>PolePairs are the machine pole pairs</li>
|
|---|
| 3114 | <li>DeltaWel is intended as a scaled indication of the requested torque. </li>
|
|---|
| 3115 | </ul>
|
|---|
| 3116 | <p><br>It is suggested to compare in the same plot aimc.tauElectrical and qSDrive.qSAsma.tauElectrical, as well as pDC.power and pAC.power</p>
|
|---|
| 3117 | </html>"),
|
|---|
| 3118 | experimentSetupOutput,
|
|---|
| 3119 | Icon(coordinateSystem(
|
|---|
| 3120 | extent={{-100,-80},{100,100}},
|
|---|
| 3121 | preserveAspectRatio=false,
|
|---|
| 3122 | initialScale=0.1,
|
|---|
| 3123 | grid={2,2})),
|
|---|
| 3124 | Diagram(coordinateSystem(
|
|---|
| 3125 | extent={{-100,-80},{100,100}},
|
|---|
| 3126 | preserveAspectRatio=false,
|
|---|
| 3127 | initialScale=0.1,
|
|---|
| 3128 | grid={2,2}), graphics),
|
|---|
| 3129 | experiment(StopTime=6, Interval=0.0015));
|
|---|
| 3130 | end TestAMDrive;
|
|---|
| 3131 |
|
|---|
| 3132 | model TestAMDrive2
|
|---|
| 3133 | "Compares QSDrive with a drive based on the MSL asynchronous machine; woing beyond base speed"
|
|---|
| 3134 | // extends Modelica.Icons.Example;
|
|---|
| 3135 | import Modelica.Constants.pi;
|
|---|
| 3136 | parameter Real factor=1.4;
|
|---|
| 3137 | parameter Modelica.SIunits.AngularVelocity DeltaOmEl=25
|
|---|
| 3138 | "Controller Delta Omega";
|
|---|
| 3139 | // Real Pac=aimc.plug_sp[i]
|
|---|
| 3140 | Modelica.Blocks.Sources.Constant const1(k=-500) annotation (Placement(
|
|---|
| 3141 | transformation(
|
|---|
| 3142 | extent={{-10,-10},{10,10}},
|
|---|
| 3143 | rotation=180,
|
|---|
| 3144 | origin={90,-20})));
|
|---|
| 3145 | Modelica.Electrical.Machines.Utilities.TerminalBox terminalBox
|
|---|
| 3146 | annotation (Placement(transformation(extent={{-10,60},{10,80}})));
|
|---|
| 3147 | Modelica.Electrical.Analog.Basic.Ground ground
|
|---|
| 3148 | annotation (Placement(transformation(extent={{-90,14},{-70,34}})));
|
|---|
| 3149 | Modelica.Electrical.MultiPhase.Basic.Star star annotation (Placement(
|
|---|
| 3150 | transformation(
|
|---|
| 3151 | extent={{-10,-10},{10,10}},
|
|---|
| 3152 | rotation=270,
|
|---|
| 3153 | origin={-80,58})));
|
|---|
| 3154 | Modelica.Mechanics.Rotational.Sources.Torque torque annotation (
|
|---|
| 3155 | Placement(transformation(
|
|---|
| 3156 | extent={{-10,-10},{10,10}},
|
|---|
| 3157 | rotation=180,
|
|---|
| 3158 | origin={74,40})));
|
|---|
| 3159 | Modelica.Electrical.MultiPhase.Sources.SignalVoltage signalVoltage
|
|---|
| 3160 | annotation (Placement(transformation(
|
|---|
| 3161 | extent={{-10,-10},{10,10}},
|
|---|
| 3162 | rotation=180,
|
|---|
| 3163 | origin={-70,80})));
|
|---|
| 3164 | Modelica.Mechanics.Rotational.Sensors.SpeedSensor wMot annotation (
|
|---|
| 3165 | Placement(transformation(
|
|---|
| 3166 | extent={{-7,-7},{7,7}},
|
|---|
| 3167 | rotation=270,
|
|---|
| 3168 | origin={59,19})));
|
|---|
| 3169 | Modelica.Blocks.Sources.Constant dWe(k=25)
|
|---|
| 3170 | annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
|
|---|
| 3171 | Modelica.Mechanics.Rotational.Components.Inertia inertia(J=40)
|
|---|
| 3172 | annotation (Placement(transformation(extent={{22,30},{42,50}})));
|
|---|
| 3173 | TestingModels.AsmaUgenerator uVar(
|
|---|
| 3174 | UBase=400,
|
|---|
| 3175 | pp=2,
|
|---|
| 3176 | WeBase=314.15,
|
|---|
| 3177 | WeMax=factor*314.15) annotation (Placement(transformation(
|
|---|
| 3178 | extent={{-14,-10},{14,10}},
|
|---|
| 3179 | rotation=90,
|
|---|
| 3180 | origin={-50,46})));
|
|---|
| 3181 | Modelica.Electrical.Machines.BasicMachines.AsynchronousInductionMachines.AIM_SquirrelCage
|
|---|
| 3182 | aimc(
|
|---|
| 3183 | p=2,
|
|---|
| 3184 | fsNominal=50,
|
|---|
| 3185 | Rs=0.016,
|
|---|
| 3186 | Lssigma=0.07039/(100*pi),
|
|---|
| 3187 | Lm=2.046/(100*pi),
|
|---|
| 3188 | Lrsigma=0.07039/(100*pi),
|
|---|
| 3189 | Rr=0.0313,
|
|---|
| 3190 | Jr=0.341,
|
|---|
| 3191 | TrOperational=293.15,
|
|---|
| 3192 | TsOperational=293.15,
|
|---|
| 3193 | TsRef=293.15,
|
|---|
| 3194 | alpha20s=0)
|
|---|
| 3195 | annotation (Placement(transformation(extent={{-10,30},{10,50}})));
|
|---|
| 3196 | SupportModels.PTrifSensor pAC
|
|---|
| 3197 | annotation (Placement(transformation(extent={{-42,70},{-22,90}})));
|
|---|
| 3198 | Modelica.Electrical.Analog.Sensors.PowerSensor pDC annotation (
|
|---|
| 3199 | Placement(visible=true, transformation(
|
|---|
| 3200 | origin={-34,-34},
|
|---|
| 3201 | extent={{-10,-10},{10,10}},
|
|---|
| 3202 | rotation=0)));
|
|---|
| 3203 | AMDrive qSDrive(
|
|---|
| 3204 | UBase=400,
|
|---|
| 3205 | Unom=800,
|
|---|
| 3206 | R1=0.016,
|
|---|
| 3207 | L1=0.07039/(100*pi),
|
|---|
| 3208 | Lm=2.046/(100*pi),
|
|---|
| 3209 | R2=0.0313,
|
|---|
| 3210 | L2=0.07039/(100*pi),
|
|---|
| 3211 | J=0.341,
|
|---|
| 3212 | pp=2,
|
|---|
| 3213 | lossFact=0,
|
|---|
| 3214 | WeMax=factor*314.15) annotation (Placement(visible=true,
|
|---|
| 3215 | transformation(
|
|---|
| 3216 | origin={-2,-44},
|
|---|
| 3217 | extent={{-10,-10},{10,10}},
|
|---|
| 3218 | rotation=0)));
|
|---|
| 3219 | Modelica.Electrical.Analog.Sources.ConstantVoltage Udc(V=sqrt(2)*400)
|
|---|
| 3220 | annotation (Placement(visible=true, transformation(
|
|---|
| 3221 | origin={-58,-44},
|
|---|
| 3222 | extent={{-10,-10},{10,10}},
|
|---|
| 3223 | rotation=270)));
|
|---|
| 3224 | Modelica.Mechanics.Rotational.Components.Inertia inertia1(J=40)
|
|---|
| 3225 | annotation (Placement(visible=true, transformation(
|
|---|
| 3226 | origin={32,-44},
|
|---|
| 3227 | extent={{-10,-10},{10,10}},
|
|---|
| 3228 | rotation=0)));
|
|---|
| 3229 | Modelica.Electrical.Analog.Basic.Ground ground1 annotation (Placement(
|
|---|
| 3230 | visible=true, transformation(
|
|---|
| 3231 | origin={-58,-72},
|
|---|
| 3232 | extent={{-10,-10},{10,10}},
|
|---|
| 3233 | rotation=0)));
|
|---|
| 3234 | Modelica.Mechanics.Rotational.Sources.Torque torque1 annotation (
|
|---|
| 3235 | Placement(visible=true, transformation(
|
|---|
| 3236 | origin={58,-44},
|
|---|
| 3237 | extent={{-10,-10},{10,10}},
|
|---|
| 3238 | rotation=180)));
|
|---|
| 3239 | Modelica.Blocks.Sources.Constant dWe1(k=23) annotation (Placement(
|
|---|
| 3240 | visible=true, transformation(
|
|---|
| 3241 | origin={24,-16},
|
|---|
| 3242 | extent={{10,-10},{-10,10}},
|
|---|
| 3243 | rotation=0)));
|
|---|
| 3244 | Modelica.Blocks.Sources.Constant U1(k=15) annotation (Placement(visible
|
|---|
| 3245 | =true, transformation(
|
|---|
| 3246 | origin={-51,19},
|
|---|
| 3247 | extent={{-8,-8},{8,8}},
|
|---|
| 3248 | rotation=90)));
|
|---|
| 3249 | equation
|
|---|
| 3250 | connect(U1.y, uVar.U0) annotation (Line(points={{-51,27.8},{-51,34.7},{
|
|---|
| 3251 | -50.1,34.7}}, color={0,0,127}));
|
|---|
| 3252 | connect(torque1.tau, const1.y) annotation (Line(points={{70,-44},{74,-44},
|
|---|
| 3253 | {74,-20},{79,-20},{79,-20}}, color={0,0,127}));
|
|---|
| 3254 | connect(dWe1.y, qSDrive.dWe) annotation (Line(points={{13,-16},{-2,-16},
|
|---|
| 3255 | {-2,-35.2}}, color={0,0,127}));
|
|---|
| 3256 | connect(inertia1.flange_b, torque1.flange)
|
|---|
| 3257 | annotation (Line(points={{42,-44},{48,-44}}));
|
|---|
| 3258 | connect(ground1.p, Udc.n)
|
|---|
| 3259 | annotation (Line(points={{-58,-62},{-58,-54}}, color={0,0,255}));
|
|---|
| 3260 | connect(inertia1.flange_a, qSDrive.flange_a)
|
|---|
| 3261 | annotation (Line(points={{22,-44},{8,-44}}));
|
|---|
| 3262 | connect(pDC.nv, Udc.n) annotation (Line(points={{-34,-44},{-34,-62},{-58,
|
|---|
| 3263 | -62},{-58,-54}}, color={0,0,255}));
|
|---|
| 3264 | connect(pDC.pc, Udc.p)
|
|---|
| 3265 | annotation (Line(points={{-44,-34},{-58,-34}}, color={0,0,255}));
|
|---|
| 3266 | connect(qSDrive.pin_n, pDC.nv) annotation (Line(points={{-12.2,-50},{-18,
|
|---|
| 3267 | -50},{-20,-50},{-20,-62},{-34,-62},{-34,-44}}, color={0,0,255}));
|
|---|
| 3268 | connect(qSDrive.pin_p, pDC.nc) annotation (Line(points={{-12.2,-38},{-18,
|
|---|
| 3269 | -38},{-18,-34},{-24,-34}}, color={0,0,255}));
|
|---|
| 3270 | connect(pDC.pv, pDC.pc) annotation (Line(points={{-34,-24},{-44,-24},{-44,
|
|---|
| 3271 | -34},{-44,-34}}, color={0,0,255}));
|
|---|
| 3272 | connect(ground.p, star.pin_n) annotation (Line(
|
|---|
| 3273 | points={{-80,34},{-80,48}},
|
|---|
| 3274 | color={0,0,255},
|
|---|
| 3275 | smooth=Smooth.None));
|
|---|
| 3276 | connect(signalVoltage.plug_n, star.plug_p) annotation (Line(
|
|---|
| 3277 | points={{-80,80},{-80,68}},
|
|---|
| 3278 | color={0,0,255},
|
|---|
| 3279 | smooth=Smooth.None));
|
|---|
| 3280 | connect(wMot.flange, torque.flange) annotation (Line(
|
|---|
| 3281 | points={{59,26},{59,33},{64,33},{64,40}},
|
|---|
| 3282 | color={0,0,0},
|
|---|
| 3283 | smooth=Smooth.None));
|
|---|
| 3284 | connect(torque.tau, const1.y) annotation (Line(
|
|---|
| 3285 | points={{86,40},{92,40},{92,0},{72,0},{72,-20},{79,-20}},
|
|---|
| 3286 | color={0,0,127},
|
|---|
| 3287 | smooth=Smooth.None));
|
|---|
| 3288 | connect(inertia.flange_b, torque.flange) annotation (Line(
|
|---|
| 3289 | points={{42,40},{64,40}},
|
|---|
| 3290 | color={0,0,0},
|
|---|
| 3291 | smooth=Smooth.None));
|
|---|
| 3292 | connect(uVar.DWe, dWe.y) annotation (Line(
|
|---|
| 3293 | points={{-38.7,40.1},{-36,40.1},{-36,0},{-79,0}},
|
|---|
| 3294 | color={0,0,127},
|
|---|
| 3295 | smooth=Smooth.None));
|
|---|
| 3296 | connect(uVar.U, signalVoltage.v) annotation (Line(
|
|---|
| 3297 | points={{-54,57},{-54,68},{-70,68},{-70,73}},
|
|---|
| 3298 | color={0,0,127},
|
|---|
| 3299 | smooth=Smooth.None));
|
|---|
| 3300 | connect(uVar.Wm, wMot.w) annotation (Line(
|
|---|
| 3301 | points={{-38.7,52.3},{-24,52.3},{-24,6},{59,6},{59,11.3}},
|
|---|
| 3302 | color={0,0,127},
|
|---|
| 3303 | smooth=Smooth.None));
|
|---|
| 3304 | connect(aimc.plug_sp, terminalBox.plug_sp) annotation (Line(
|
|---|
| 3305 | points={{6,50},{6,60}},
|
|---|
| 3306 | color={0,0,255},
|
|---|
| 3307 | smooth=Smooth.None));
|
|---|
| 3308 | connect(aimc.plug_sn, terminalBox.plug_sn) annotation (Line(
|
|---|
| 3309 | points={{-6,50},{-6,60}},
|
|---|
| 3310 | color={0,0,255},
|
|---|
| 3311 | smooth=Smooth.None));
|
|---|
| 3312 | connect(aimc.flange, inertia.flange_a) annotation (Line(
|
|---|
| 3313 | points={{10,40},{22,40}},
|
|---|
| 3314 | color={0,0,0},
|
|---|
| 3315 | smooth=Smooth.None));
|
|---|
| 3316 | connect(signalVoltage.plug_p, pAC.pc) annotation (Line(
|
|---|
| 3317 | points={{-60,80},{-42,80}},
|
|---|
| 3318 | color={0,0,255},
|
|---|
| 3319 | smooth=Smooth.None));
|
|---|
| 3320 | connect(pAC.nc, terminalBox.plugSupply) annotation (Line(
|
|---|
| 3321 | points={{-22,80},{0,80},{0,62}},
|
|---|
| 3322 | color={0,0,255},
|
|---|
| 3323 | smooth=Smooth.None));
|
|---|
| 3324 | annotation (
|
|---|
| 3325 | experimentSetupOutput,
|
|---|
| 3326 | Documentation(info="<html>
|
|---|
| 3327 | <p>This model simulates variable-frequency start-up of an asyncronous motor in two different ways.</p>
|
|---|
| 3328 | <p>The above system uses the MSL aimc, and a variable voltage variable frequency source obtained by controlled generators.</p>
|
|---|
| 3329 | <p><br>The system below is built around the QSDrive, that in turn is built along a machine model that makes usage of the Quasi-Stationary MSL library.</p>
|
|---|
| 3330 | <p>In both cases the motor supply is constituted by a three-phase system of quasi-sinusoidal shapes, created according to the following equations:</p>
|
|---|
| 3331 | <p>Wel=Wmecc*PolePairs+DeltaWel</p>
|
|---|
| 3332 | <p>U=U0+(Ubase-U0)*(Wel)/WElbase </p>
|
|---|
| 3333 | <p>(but U is limited to the maximum voltage capability of the inverter, due to DC voltage. The U limit is set to Udc/2.4)</p>
|
|---|
| 3334 | <p>where:</p>
|
|---|
| 3335 | <ul>
|
|---|
| 3336 | <li>U0, Ubase U, are initial, base, actual voltage amplitudes</li>
|
|---|
| 3337 | <li>Wmecc, Wel, are machine, mechanical and supply, electrical angular speeds</li>
|
|---|
| 3338 | <li>PolePairs are the machine pole pairs</li>
|
|---|
| 3339 | <li>DeltaWel is intended as a scaled indication of the requested torque. </li>
|
|---|
| 3340 | </ul>
|
|---|
| 3341 | <p><br>It is suggested to compare in the same plot aimc.tauElectrical and qSDrive.qSAsma.tauElectrical, as well as pDC.power and pAC.power</p>
|
|---|
| 3342 | <p>In comparison with TestAMDrive, TestAMDrive2 simulates a longer transient, and imposes the drive to go beyond the base speed, up to "factor" times that value. "factor" is a parameter by default set to 1.4.</p>
|
|---|
| 3343 | <p>It is suggested, in a first plot, to compare aimc.tauElectrical, qSDrive.sQAsma.tauElectrical, and qsDrive.tauMaximum.</p>
|
|---|
| 3344 | <p>The first two quantities are nearly equal to each other (except for a limited transient in the beginning, not described by the simplified model); the third one indicates the maximum torque that the drive can deliver. Since the transient is charactierised by constant slip speed (difference between electromagnetic field rotational speed and mechanical speed), the maximum torque <span style=\"font-family: MS Shell Dlg 2;\">always </span>remains well above the delivered torque.</p>
|
|---|
| 3345 | <p>In another plot the user could plot qSDrive.uAgGen.luxPU, that indicates the ration of actual and maximum flux: the flux weakening action starting around t=4s is effectively seen.</p>
|
|---|
| 3346 | <p>Finally the user could plot in a diagram aimc.vs[1] and qsDrive.uAgGen.uAg: the second quantity is the rms value of the first one, as expected.</p>
|
|---|
| 3347 | <p>Around t=7 s the maximum speed reuired (with the default factor=1.4) is reached, and therefore the torques have a different behaviour.</p>
|
|---|
| 3348 | </html>"),
|
|---|
| 3349 | experimentSetupOutput,
|
|---|
| 3350 | Icon(coordinateSystem(
|
|---|
| 3351 | extent={{-100,-80},{100,100}},
|
|---|
| 3352 | preserveAspectRatio=false,
|
|---|
| 3353 | initialScale=0.1,
|
|---|
| 3354 | grid={2,2})),
|
|---|
| 3355 | Diagram(coordinateSystem(
|
|---|
| 3356 | extent={{-100,-80},{100,100}},
|
|---|
| 3357 | preserveAspectRatio=false,
|
|---|
| 3358 | initialScale=0.1,
|
|---|
| 3359 | grid={2,2}), graphics),
|
|---|
| 3360 | experiment(StopTime=10, Interval=0.0015));
|
|---|
| 3361 | end TestAMDrive2;
|
|---|
| 3362 |
|
|---|
| 3363 | model TestPMDrive
|
|---|
| 3364 | // extends Modelica.Icons.Example;
|
|---|
| 3365 | ElectricDrives.PMDrive pMDrive(Ld=1.846e-3, Lq=1.846e-3)
|
|---|
| 3366 | annotation (Placement(transformation(extent={{-12,28},{8,48}})));
|
|---|
| 3367 | Modelica.Mechanics.Rotational.Components.Inertia inertia(J=0.29, phi(
|
|---|
| 3368 | fixed=true, start=0))
|
|---|
| 3369 | annotation (Placement(transformation(extent={{18,28},{38,48}})));
|
|---|
| 3370 | Modelica.Blocks.Sources.Trapezoid torqueRef(
|
|---|
| 3371 | period=1e6,
|
|---|
| 3372 | amplitude=200,
|
|---|
| 3373 | rising=2,
|
|---|
| 3374 | width=2,
|
|---|
| 3375 | falling=2)
|
|---|
| 3376 | annotation (Placement(transformation(extent={{-60,28},{-40,48}})));
|
|---|
| 3377 | Modelica.Electrical.Analog.Sources.ConstantVoltage fem(V=250)
|
|---|
| 3378 | annotation (Placement(transformation(extent={{-10,62},{10,82}})));
|
|---|
| 3379 | Modelica.Electrical.Analog.Basic.Ground ground
|
|---|
| 3380 | annotation (Placement(transformation(extent={{24,52},{44,72}})));
|
|---|
| 3381 | Modelica.Mechanics.Rotational.Sources.QuadraticSpeedDependentTorque
|
|---|
| 3382 | myTorque(w_nominal(displayUnit="rpm") = 157.07963267949, tau_nominal=
|
|---|
| 3383 | -150)
|
|---|
| 3384 | annotation (Placement(transformation(extent={{76,28},{56,48}})));
|
|---|
| 3385 | Modelica.Electrical.Machines.BasicMachines.SynchronousInductionMachines.SM_PermanentMagnet
|
|---|
| 3386 | smpm(
|
|---|
| 3387 | useDamperCage=false,
|
|---|
| 3388 | VsOpenCircuit=115.5,
|
|---|
| 3389 | Lmd=1.846e-3,
|
|---|
| 3390 | Lmq=1.846e-3,
|
|---|
| 3391 | Lssigma=1.91e-4) annotation (Placement(transformation(extent={{-12,-74},
|
|---|
| 3392 | {8,-54}}, rotation=0)));
|
|---|
| 3393 | Modelica.Electrical.MultiPhase.Sources.SignalCurrent signalCurr(final m
|
|---|
| 3394 | =3) annotation (Placement(transformation(
|
|---|
| 3395 | origin={22,-16},
|
|---|
| 3396 | extent={{-10,10},{10,-10}},
|
|---|
| 3397 | rotation=180)));
|
|---|
| 3398 | Modelica.Electrical.MultiPhase.Basic.Star star(final m=3) annotation (
|
|---|
| 3399 | Placement(transformation(
|
|---|
| 3400 | extent={{10,-10},{-10,10}},
|
|---|
| 3401 | rotation=180,
|
|---|
| 3402 | origin={50,-18})));
|
|---|
| 3403 | Modelica.Electrical.Analog.Basic.Ground ground1 annotation (Placement(
|
|---|
| 3404 | transformation(
|
|---|
| 3405 | origin={76,-18},
|
|---|
| 3406 | extent={{-10,-10},{10,10}},
|
|---|
| 3407 | rotation=90)));
|
|---|
| 3408 | Modelica.Electrical.Analog.Basic.Ground groundM annotation (Placement(
|
|---|
| 3409 | transformation(
|
|---|
| 3410 | origin={-26,-46},
|
|---|
| 3411 | extent={{-10,-10},{10,10}},
|
|---|
| 3412 | rotation=270)));
|
|---|
| 3413 | Modelica.Electrical.Machines.Utilities.TerminalBox terminalBox(
|
|---|
| 3414 | terminalConnection="Y") annotation (Placement(transformation(extent
|
|---|
| 3415 | ={{-12,-48},{8,-28}}, rotation=0)));
|
|---|
| 3416 | Modelica.Mechanics.Rotational.Sensors.AngleSensor angleS annotation (
|
|---|
| 3417 | Placement(transformation(
|
|---|
| 3418 | extent={{-10,-10},{10,10}},
|
|---|
| 3419 | rotation=90,
|
|---|
| 3420 | origin={18,-44})));
|
|---|
| 3421 | Modelica.Mechanics.Rotational.Components.Inertia inertia1(J=0.29, phi(
|
|---|
| 3422 | fixed=true, start=0))
|
|---|
| 3423 | annotation (Placement(transformation(extent={{26,-74},{46,-54}})));
|
|---|
| 3424 | Modelica.Mechanics.Rotational.Sources.QuadraticSpeedDependentTorque
|
|---|
| 3425 | Tres(w_nominal(displayUnit="rpm") = 157.07963267949, tau_nominal=-150)
|
|---|
| 3426 | annotation (Placement(transformation(extent={{76,-74},{56,-54}})));
|
|---|
| 3427 | ElectricDrives.EDsupport.FromPark fromPark(p=smpm.p)
|
|---|
| 3428 | annotation (Placement(transformation(extent={{-30,-20},{-10,0}})));
|
|---|
| 3429 | Modelica.Blocks.Sources.Trapezoid IqRef(
|
|---|
| 3430 | period=1e6,
|
|---|
| 3431 | amplitude=115.0,
|
|---|
| 3432 | rising=2,
|
|---|
| 3433 | width=2,
|
|---|
| 3434 | falling=2)
|
|---|
| 3435 | annotation (Placement(transformation(extent={{-78,-56},{-58,-36}})));
|
|---|
| 3436 | Modelica.Blocks.Sources.Trapezoid IdRef(
|
|---|
| 3437 | period=1e6,
|
|---|
| 3438 | amplitude=-95.0,
|
|---|
| 3439 | rising=0.5,
|
|---|
| 3440 | falling=0.5,
|
|---|
| 3441 | offset=1,
|
|---|
| 3442 | width=2.5,
|
|---|
| 3443 | startTime=1.5)
|
|---|
| 3444 | annotation (Placement(transformation(extent={{-78,-20},{-58,0}})));
|
|---|
| 3445 | equation
|
|---|
| 3446 | connect(pMDrive.flange_a, inertia.flange_a) annotation (Line(
|
|---|
| 3447 | points={{8,38},{18,38}},
|
|---|
| 3448 | color={0,0,0},
|
|---|
| 3449 | smooth=Smooth.None));
|
|---|
| 3450 | connect(fem.p, pMDrive.pin_p) annotation (Line(
|
|---|
| 3451 | points={{-10,72},{-20,72},{-20,48},{-8,48}},
|
|---|
| 3452 | color={0,0,255},
|
|---|
| 3453 | smooth=Smooth.None));
|
|---|
| 3454 | connect(pMDrive.pin_n, fem.n) annotation (Line(
|
|---|
| 3455 | points={{4,48},{16,48},{16,72},{10,72}},
|
|---|
| 3456 | color={0,0,255},
|
|---|
| 3457 | smooth=Smooth.None));
|
|---|
| 3458 | connect(ground.p, fem.n) annotation (Line(
|
|---|
| 3459 | points={{34,72},{10,72}},
|
|---|
| 3460 | color={0,0,255},
|
|---|
| 3461 | smooth=Smooth.None));
|
|---|
| 3462 | connect(pMDrive.tauRef, torqueRef.y) annotation (Line(
|
|---|
| 3463 | points={{-12.6,38},{-39,38}},
|
|---|
| 3464 | color={0,0,127},
|
|---|
| 3465 | smooth=Smooth.None));
|
|---|
| 3466 | connect(inertia.flange_b, myTorque.flange) annotation (Line(
|
|---|
| 3467 | points={{38,38},{56,38}},
|
|---|
| 3468 | color={0,0,0},
|
|---|
| 3469 | smooth=Smooth.None));
|
|---|
| 3470 | connect(star.pin_n, ground1.p) annotation (Line(points={{60,-18},{60,-18},
|
|---|
| 3471 | {66,-18}}, color={0,0,255}));
|
|---|
| 3472 | connect(terminalBox.plug_sn, smpm.plug_sn) annotation (Line(
|
|---|
| 3473 | points={{-8,-48},{-8,-54}},
|
|---|
| 3474 | color={0,0,255},
|
|---|
| 3475 | smooth=Smooth.None));
|
|---|
| 3476 | connect(terminalBox.plug_sp, smpm.plug_sp) annotation (Line(
|
|---|
| 3477 | points={{4,-48},{4,-50},{6,-50},{6,-52},{4,-52},{4,-54}},
|
|---|
| 3478 | color={0,0,255},
|
|---|
| 3479 | smooth=Smooth.None));
|
|---|
| 3480 | connect(signalCurr.plug_p, star.plug_p) annotation (Line(
|
|---|
| 3481 | points={{32,-16},{36,-16},{36,-18},{40,-18}},
|
|---|
| 3482 | color={0,0,255},
|
|---|
| 3483 | smooth=Smooth.None));
|
|---|
| 3484 | connect(signalCurr.plug_n, terminalBox.plugSupply) annotation (Line(
|
|---|
| 3485 | points={{12,-16},{-2,-16},{-2,-46}},
|
|---|
| 3486 | color={0,0,255},
|
|---|
| 3487 | smooth=Smooth.None));
|
|---|
| 3488 | connect(groundM.p, terminalBox.starpoint) annotation (Line(
|
|---|
| 3489 | points={{-16,-46},{-11,-46}},
|
|---|
| 3490 | color={0,0,255},
|
|---|
| 3491 | smooth=Smooth.None));
|
|---|
| 3492 | connect(Tres.flange, inertia1.flange_b) annotation (Line(
|
|---|
| 3493 | points={{56,-64},{46,-64}},
|
|---|
| 3494 | color={0,0,0},
|
|---|
| 3495 | smooth=Smooth.None));
|
|---|
| 3496 | connect(angleS.flange, smpm.flange) annotation (Line(
|
|---|
| 3497 | points={{18,-54},{18,-64},{8,-64}},
|
|---|
| 3498 | color={0,0,0},
|
|---|
| 3499 | smooth=Smooth.None));
|
|---|
| 3500 | connect(inertia1.flange_a, smpm.flange) annotation (Line(
|
|---|
| 3501 | points={{26,-64},{8,-64}},
|
|---|
| 3502 | color={0,0,0},
|
|---|
| 3503 | smooth=Smooth.None));
|
|---|
| 3504 | connect(fromPark.y, signalCurr.i) annotation (Line(
|
|---|
| 3505 | points={{-9,-10},{22,-10},{22,-9}},
|
|---|
| 3506 | color={0,0,127},
|
|---|
| 3507 | smooth=Smooth.None));
|
|---|
| 3508 | connect(angleS.phi, fromPark.phi) annotation (Line(
|
|---|
| 3509 | points={{18,-33},{18,-32},{-20,-32},{-20,-28},{-20,-28},{-20,-22}},
|
|---|
| 3510 |
|
|---|
| 3511 | color={0,0,127},
|
|---|
| 3512 | smooth=Smooth.None));
|
|---|
| 3513 |
|
|---|
| 3514 | connect(IqRef.y, fromPark.Xq) annotation (Line(
|
|---|
| 3515 | points={{-57,-46},{-46,-46},{-46,-16},{-32,-16}},
|
|---|
| 3516 | color={0,0,127},
|
|---|
| 3517 | smooth=Smooth.None));
|
|---|
| 3518 | connect(fromPark.Xd, IdRef.y) annotation (Line(
|
|---|
| 3519 | points={{-32,-4},{-44,-4},{-44,-10},{-57,-10}},
|
|---|
| 3520 | color={0,0,127},
|
|---|
| 3521 | smooth=Smooth.None));
|
|---|
| 3522 | annotation (
|
|---|
| 3523 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
|
|---|
| 3524 | {100,100}}), graphics),
|
|---|
| 3525 | experiment(StopTime=8, __Dymola_NumberOfIntervals=5000),
|
|---|
| 3526 | __Dymola_experimentSetupOutput,
|
|---|
| 3527 | Documentation(info="<html>
|
|---|
| 3528 | <p>Ths model propose a comparisono of the library PMDrive and what can be seen using the MSL PMSM machine model.</p>
|
|---|
| 3529 | <p>To make this comparison it is proceeded as follows:</p>
|
|---|
| 3530 | <ol>
|
|---|
| 3531 | <li>PMDrive is run so that the behaviour of Pd and Iq over time is determined. this behaviour is the result of optimisations, that consider the need to have optimal angle between PM and stator field at lows speeds, and an alggle that produces the needed fluz weakening at high speeds, so that the machin terminal voltages are compatible with the available DC voltage</li>
|
|---|
| 3532 | <li>The shape of Id(t) and Id(t) is emulated with two trapezoids. The corresponding instantaneous currents are generated by making the inverse park transform and fed to the machine.</li>
|
|---|
| 3533 | <li>Some quantities of the MSL PMSM and PMDrive model are compared.</li>
|
|---|
| 3534 | </ol>
|
|---|
| 3535 | <p>Plots that show this can be the following one:</p>
|
|---|
| 3536 | <ul>
|
|---|
| 3537 | <li>plot in the same window IqRef.y and pmDrive.allFluxLim.atomicPmsm.Iq. It is seen that the trapezoid follows in a reasonable way the Iq value PMDrive model computes over time</li>
|
|---|
| 3538 | <li>plot in the same window IdRef.y and pmDrive.allFluxLim.atomicPmsm.Id. It is seen that the trapezoid follows in a reasonable way the Id value PMDrive model computes over time</li>
|
|---|
| 3539 | <li>plot in the same window smpm.v[1] and pmDrive.allFluxLim.atomicPmsm.Vpark and pmDrive.allFluxLim.atomicPmsm.VparkFF. It can be seen that the trend of Vpark is the same of all the instantaneous peaks of v[1], while in the central zones, in which the machine speed overcomes the base speed VparkFF is larger</li>
|
|---|
| 3540 | <li>plot in the same window smpm.tauElectrical and pmDrive.allFluxLim.tauElectrical. It can be seen that the two torques are nearly equal to each other. The differences can be justified considering that Id(t) and Id(t) of the two models are not perfectly equal to each other</li>
|
|---|
| 3541 | </ul>
|
|---|
| 3542 | </html>"));
|
|---|
| 3543 | end TestPMDrive;
|
|---|
| 3544 |
|
|---|
| 3545 | block AsmaUgenerator
|
|---|
| 3546 | import Modelica.Constants.pi;
|
|---|
| 3547 | parameter Modelica.SIunits.Voltage UBase(start=400)
|
|---|
| 3548 | "Base phase-to-phase RMS voltage";
|
|---|
| 3549 | parameter Modelica.SIunits.AngularVelocity WeBase(start=314.15)
|
|---|
| 3550 | "Base electric frequency";
|
|---|
| 3551 | parameter Modelica.SIunits.AngularVelocity WeMax(start=314.15)
|
|---|
| 3552 | "Maximum Electric frequency";
|
|---|
| 3553 | parameter Integer pp(min=1, start=2) "number of pole pairs (Integer)";
|
|---|
| 3554 | Modelica.Blocks.Interfaces.RealInput Wm annotation (Placement(
|
|---|
| 3555 | transformation(extent={{-180,40},{-140,80}}), iconTransformation(
|
|---|
| 3556 | extent={{-13,-13},{13,13}},
|
|---|
| 3557 | rotation=90,
|
|---|
| 3558 | origin={63,-113})));
|
|---|
| 3559 | Modelica.Blocks.Interfaces.RealOutput U[3] annotation (Placement(
|
|---|
| 3560 | transformation(extent={{140,50},{160,70}}), iconTransformation(
|
|---|
| 3561 | extent={{100,30},{120,50}})));
|
|---|
| 3562 | Modelica.Blocks.Math.Gain PolePairsG(k=pp)
|
|---|
| 3563 | annotation (Placement(transformation(extent={{-130,50},{-110,70}})));
|
|---|
| 3564 | Modelica.Blocks.Interfaces.RealInput DWe annotation (Placement(
|
|---|
| 3565 | transformation(extent={{-180,-40},{-140,0}}), iconTransformation(
|
|---|
| 3566 | extent={{-13,-13},{13,13}},
|
|---|
| 3567 | rotation=90,
|
|---|
| 3568 | origin={-59,-113})));
|
|---|
| 3569 | Modelica.Blocks.Nonlinear.Limiter limiter1(uMin=0, uMax=UBase)
|
|---|
| 3570 | annotation (Placement(transformation(
|
|---|
| 3571 | extent={{-10,-10},{10,10}},
|
|---|
| 3572 | rotation=90,
|
|---|
| 3573 | origin={100,-28})));
|
|---|
| 3574 | Modelica.Blocks.Math.Add add
|
|---|
| 3575 | annotation (Placement(transformation(extent={{-100,40},{-80,60}})));
|
|---|
| 3576 | Modelica.Blocks.Nonlinear.Limiter limiter(uMin=0, uMax=WeMax)
|
|---|
| 3577 | annotation (Placement(transformation(extent={{-72,40},{-52,60}})));
|
|---|
| 3578 | Modelica.Blocks.Math.Add add1[3]
|
|---|
| 3579 | annotation (Placement(transformation(extent={{40,60},{60,80}})));
|
|---|
| 3580 | Modelica.Blocks.Math.Sin sin[3]
|
|---|
| 3581 | annotation (Placement(transformation(extent={{74,60},{94,80}})));
|
|---|
| 3582 | Modelica.Blocks.Continuous.Integrator integrator
|
|---|
| 3583 | annotation (Placement(transformation(extent={{-32,60},{-12,80}})));
|
|---|
| 3584 | Modelica.Blocks.Routing.Replicator replicator(nout=3) annotation (
|
|---|
| 3585 | Placement(transformation(
|
|---|
| 3586 | extent={{-10,-10},{10,10}},
|
|---|
| 3587 | rotation=90,
|
|---|
| 3588 | origin={100,30})));
|
|---|
| 3589 | Modelica.Blocks.Math.Product product[3]
|
|---|
| 3590 | annotation (Placement(transformation(extent={{112,50},{132,70}})));
|
|---|
| 3591 | Modelica.Blocks.Math.Gain ToPeak(k=sqrt(2/3)) annotation (Placement(
|
|---|
| 3592 | transformation(
|
|---|
| 3593 | extent={{-10,-10},{10,10}},
|
|---|
| 3594 | rotation=90,
|
|---|
| 3595 | origin={100,0})));
|
|---|
| 3596 | Modelica.Blocks.Sources.Constant Fase[3](k=2*pi/3*{0,-1,1}) annotation
|
|---|
| 3597 | (Placement(transformation(
|
|---|
| 3598 | extent={{-10,-10},{10,10}},
|
|---|
| 3599 | rotation=90,
|
|---|
| 3600 | origin={30,30})));
|
|---|
| 3601 | Modelica.Blocks.Routing.Replicator replicator1(nout=3) annotation (
|
|---|
| 3602 | Placement(transformation(
|
|---|
| 3603 | extent={{-10,-10},{10,10}},
|
|---|
| 3604 | rotation=0,
|
|---|
| 3605 | origin={10,70})));
|
|---|
| 3606 | Modelica.Blocks.Interfaces.RealOutput Wel annotation (Placement(
|
|---|
| 3607 | transformation(extent={{140,-70},{160,-50}}), iconTransformation(
|
|---|
| 3608 | extent={{100,-50},{120,-30}})));
|
|---|
| 3609 | Modelica.Blocks.Sources.RealExpression amplitude(y=U0 + (UBase - U0)*
|
|---|
| 3610 | Wel/WeBase)
|
|---|
| 3611 | annotation (Placement(transformation(extent={{32,-56},{86,-34}})));
|
|---|
| 3612 | Modelica.Blocks.Interfaces.RealInput U0 annotation (Placement(
|
|---|
| 3613 | transformation(extent={{-180,-100},{-140,-60}}),
|
|---|
| 3614 | iconTransformation(extent={{-126,-12},{-100,14}})));
|
|---|
| 3615 | equation
|
|---|
| 3616 | connect(add.u1, PolePairsG.y) annotation (Line(
|
|---|
| 3617 | points={{-102,56},{-102,60},{-109,60}},
|
|---|
| 3618 | color={0,0,127},
|
|---|
| 3619 | smooth=Smooth.None));
|
|---|
| 3620 | connect(limiter.u, add.y) annotation (Line(
|
|---|
| 3621 | points={{-74,50},{-79,50}},
|
|---|
| 3622 | color={0,0,127},
|
|---|
| 3623 | smooth=Smooth.None));
|
|---|
| 3624 | connect(sin.u, add1.y) annotation (Line(
|
|---|
| 3625 | points={{72,70},{61,70}},
|
|---|
| 3626 | color={0,0,127},
|
|---|
| 3627 | smooth=Smooth.None));
|
|---|
| 3628 | connect(integrator.u, limiter.y) annotation (Line(
|
|---|
| 3629 | points={{-34,70},{-34,50},{-51,50}},
|
|---|
| 3630 | color={0,0,127},
|
|---|
| 3631 | smooth=Smooth.None));
|
|---|
| 3632 | connect(product.y, U) annotation (Line(
|
|---|
| 3633 | points={{133,60},{150,60}},
|
|---|
| 3634 | color={0,0,127},
|
|---|
| 3635 | smooth=Smooth.None));
|
|---|
| 3636 | connect(product.u2, replicator.y) annotation (Line(
|
|---|
| 3637 | points={{110,54},{100,54},{100,41}},
|
|---|
| 3638 | color={0,0,127},
|
|---|
| 3639 | smooth=Smooth.None));
|
|---|
| 3640 | connect(ToPeak.y, replicator.u) annotation (Line(
|
|---|
| 3641 | points={{100,11},{100,18}},
|
|---|
| 3642 | color={0,0,127},
|
|---|
| 3643 | smooth=Smooth.None));
|
|---|
| 3644 | connect(sin.y, product.u1) annotation (Line(
|
|---|
| 3645 | points={{95,70},{102,70},{102,66},{110,66}},
|
|---|
| 3646 | color={0,0,127},
|
|---|
| 3647 | smooth=Smooth.None));
|
|---|
| 3648 | connect(add1.u1, replicator1.y) annotation (Line(
|
|---|
| 3649 | points={{38,76},{30,76},{30,70},{21,70}},
|
|---|
| 3650 | color={0,0,127},
|
|---|
| 3651 | smooth=Smooth.None));
|
|---|
| 3652 | connect(add1.u2, Fase.y) annotation (Line(
|
|---|
| 3653 | points={{38,64},{30,64},{30,41}},
|
|---|
| 3654 | color={0,0,127},
|
|---|
| 3655 | smooth=Smooth.None));
|
|---|
| 3656 | connect(Wel, limiter.y) annotation (Line(
|
|---|
| 3657 | points={{150,-60},{-42,-60},{-42,50},{-51,50}},
|
|---|
| 3658 | color={0,0,127},
|
|---|
| 3659 | smooth=Smooth.None));
|
|---|
| 3660 | connect(PolePairsG.u, Wm) annotation (Line(
|
|---|
| 3661 | points={{-132,60},{-160,60}},
|
|---|
| 3662 | color={0,0,127},
|
|---|
| 3663 | smooth=Smooth.None));
|
|---|
| 3664 | connect(replicator1.u, integrator.y) annotation (Line(
|
|---|
| 3665 | points={{-2,70},{-11,70}},
|
|---|
| 3666 | color={0,0,127},
|
|---|
| 3667 | smooth=Smooth.None));
|
|---|
| 3668 | connect(DWe, add.u2) annotation (Line(
|
|---|
| 3669 | points={{-160,-20},{-102,-20},{-102,44}},
|
|---|
| 3670 | color={0,0,127},
|
|---|
| 3671 | smooth=Smooth.None));
|
|---|
| 3672 | connect(ToPeak.u, limiter1.y) annotation (Line(
|
|---|
| 3673 | points={{100,-12},{100,-17}},
|
|---|
| 3674 | color={0,0,127},
|
|---|
| 3675 | smooth=Smooth.None));
|
|---|
| 3676 | connect(amplitude.y, limiter1.u) annotation (Line(
|
|---|
| 3677 | points={{88.7,-45},{90,-44},{96,-44},{96,-40},{100,-40}},
|
|---|
| 3678 | color={0,0,127},
|
|---|
| 3679 | smooth=Smooth.None));
|
|---|
| 3680 | annotation (
|
|---|
| 3681 | Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-140,-100},
|
|---|
| 3682 | {140,100}}), graphics={Text(
|
|---|
| 3683 | extent={{-11,3},{11,-3}},
|
|---|
| 3684 | lineColor={0,0,255},
|
|---|
| 3685 | textString="Omega",
|
|---|
| 3686 | origin={-47,1},
|
|---|
| 3687 | rotation=90)}),
|
|---|
| 3688 | Icon(coordinateSystem(preserveAspectRatio=false, extent={{-140,-100},
|
|---|
| 3689 | {140,100}}), graphics={Rectangle(
|
|---|
| 3690 | extent={{-100,100},{100,-100}},
|
|---|
| 3691 | lineColor={0,0,127},
|
|---|
| 3692 | fillColor={255,255,255},
|
|---|
| 3693 | fillPattern=FillPattern.Solid),Line(
|
|---|
| 3694 | points={{-40,-50},{-40,76}},
|
|---|
| 3695 | color={0,0,127},
|
|---|
| 3696 | smooth=Smooth.None),Line(
|
|---|
| 3697 | points={{-48,66},{-40,78},{-34,66}},
|
|---|
| 3698 | color={0,0,127},
|
|---|
| 3699 | smooth=Smooth.None),Line(
|
|---|
| 3700 | points={{-54,-42},{90,-42}},
|
|---|
| 3701 | color={0,0,127},
|
|---|
| 3702 | smooth=Smooth.None),Line(
|
|---|
| 3703 | points={{-7,-6},{1,6},{7,-6}},
|
|---|
| 3704 | color={0,0,127},
|
|---|
| 3705 | smooth=Smooth.None,
|
|---|
| 3706 | origin={87,-42},
|
|---|
| 3707 | rotation=270),Line(
|
|---|
| 3708 | points={{-46,-28},{24,40},{76,40}},
|
|---|
| 3709 | color={0,0,127},
|
|---|
| 3710 | smooth=Smooth.None),Line(
|
|---|
| 3711 | points={{-47,-23},{-31,-23}},
|
|---|
| 3712 | color={0,0,127},
|
|---|
| 3713 | smooth=Smooth.None),Text(
|
|---|
| 3714 | extent={{-82,-6},{-51,-34}},
|
|---|
| 3715 | lineColor={0,0,127},
|
|---|
| 3716 | textString="Uo"),Text(
|
|---|
| 3717 | extent={{-84,54},{-48,26}},
|
|---|
| 3718 | lineColor={0,0,127},
|
|---|
| 3719 | textString="Un"),Line(
|
|---|
| 3720 | points={{-47,39},{-31,39}},
|
|---|
| 3721 | color={0,0,127},
|
|---|
| 3722 | smooth=Smooth.None),Text(
|
|---|
| 3723 | extent={{9,-47},{52,-78}},
|
|---|
| 3724 | lineColor={0,0,127},
|
|---|
| 3725 | textString="Wn"),Line(
|
|---|
| 3726 | points={{26,-14},{26,-46},{26,-36}},
|
|---|
| 3727 | color={0,0,127},
|
|---|
| 3728 | smooth=Smooth.None),Text(
|
|---|
| 3729 | extent={{-106,144},{92,106}},
|
|---|
| 3730 | lineColor={0,0,255},
|
|---|
| 3731 | fillColor={255,255,255},
|
|---|
| 3732 | fillPattern=FillPattern.Solid,
|
|---|
| 3733 | textString="%name"),Line(
|
|---|
| 3734 | points={{20,8},{30,22},{48,22},{62,-6},{80,-6},{90,8}},
|
|---|
| 3735 | color={255,0,0},
|
|---|
| 3736 | pattern=LinePattern.Dash,
|
|---|
| 3737 | smooth=Smooth.None)}),
|
|---|
| 3738 | Documentation(info="<html>
|
|---|
| 3739 | <p>This class produces a three-phase voltage system to variable-frequency control of an asynchronous motor.</p>
|
|---|
| 3740 | <p>The output voltages constitute a three-phase system of quasi-sinusoidal shapes, created according to the following equations:</p>
|
|---|
| 3741 | <p>Wel=Wmecc*PolePairs+DeltaWel</p>
|
|---|
| 3742 | <p>U=min(Ubase, U0+(Ubase-U0)*(Wel)/Wnom ) </p>
|
|---|
| 3743 | <p>where:</p>
|
|---|
| 3744 | <ul>
|
|---|
| 3745 | <li>U0, Ubase U, are initial, base actual voltage amplitudes</li>
|
|---|
| 3746 | <li>Wmecc, Wel are machine (mechanical) and supply (electrical) angular speeds</li>
|
|---|
| 3747 | <li>PolePairs are the number of machine pole pairs</li>
|
|---|
| 3748 | <li>DeltaWel is an input variable and depends on the desired torque</li>
|
|---|
| 3749 | </ul>
|
|---|
| 3750 | </html>"));
|
|---|
| 3751 | end AsmaUgenerator;
|
|---|
| 3752 | end TestingModels;
|
|---|
| 3753 |
|
|---|
| 3754 | package EDsupport "Useful Additional Models"
|
|---|
| 3755 | model QSAsma
|
|---|
| 3756 | "Asynchronus machine model based on Quasi-stationary library"
|
|---|
| 3757 | import PI = Modelica.Constants.pi;
|
|---|
| 3758 | Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Inductor L2_(L=L2)
|
|---|
| 3759 | annotation (Placement(transformation(extent={{44,8},{64,28}})));
|
|---|
| 3760 | Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Inductor Lm_(L=Lm)
|
|---|
| 3761 | annotation (Placement(transformation(
|
|---|
| 3762 | extent={{-10,-10},{10,10}},
|
|---|
| 3763 | rotation=270,
|
|---|
| 3764 | origin={36,-4})));
|
|---|
| 3765 | Modelica.Electrical.QuasiStationary.SinglePhase.Sources.VariableVoltageSource
|
|---|
| 3766 | uFeed annotation (Placement(transformation(
|
|---|
| 3767 | extent={{-10,10},{10,-10}},
|
|---|
| 3768 | rotation=270,
|
|---|
| 3769 | origin={-32,-2})));
|
|---|
| 3770 | Modelica.ComplexBlocks.ComplexMath.PolarToComplex ToComplexUin
|
|---|
| 3771 | annotation (Placement(transformation(
|
|---|
| 3772 | origin={-68,48},
|
|---|
| 3773 | extent={{-10,-10},{10,10}},
|
|---|
| 3774 | rotation=0)));
|
|---|
| 3775 | Modelica.Blocks.Interfaces.RealInput Uag annotation (Placement(
|
|---|
| 3776 | transformation(extent={{-140,40},{-100,80}}), iconTransformation(
|
|---|
| 3777 | extent={{-140,40},{-100,80}})));
|
|---|
| 3778 | Modelica.Blocks.Sources.Constant const(k=0) annotation (Placement(
|
|---|
| 3779 | transformation(
|
|---|
| 3780 | extent={{-10,-10},{10,10}},
|
|---|
| 3781 | rotation=180,
|
|---|
| 3782 | origin={-68,20})));
|
|---|
| 3783 | Modelica.Blocks.Interfaces.RealInput f annotation (Placement(
|
|---|
| 3784 | transformation(extent={{-140,-80},{-100,-40}}),
|
|---|
| 3785 | iconTransformation(extent={{-140,-80},{-100,-40}})));
|
|---|
| 3786 | Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a annotation (
|
|---|
| 3787 | Placement(transformation(extent={{90,70},{110,90}}),
|
|---|
| 3788 | iconTransformation(extent={{90,-10},{110,10}})));
|
|---|
| 3789 | Modelica.Mechanics.Rotational.Sources.Torque torque
|
|---|
| 3790 | annotation (Placement(transformation(extent={{-10,70},{10,90}})));
|
|---|
| 3791 | Modelica.Mechanics.Rotational.Sensors.SpeedSensor Wm annotation (
|
|---|
| 3792 | Placement(transformation(
|
|---|
| 3793 | extent={{-10,-10},{10,10}},
|
|---|
| 3794 | rotation=270,
|
|---|
| 3795 | origin={48,58})));
|
|---|
| 3796 | Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.PowerSensor Pag
|
|---|
| 3797 | annotation (Placement(transformation(extent={{72,8},{92,28}})));
|
|---|
| 3798 | Modelica.Blocks.Sources.RealExpression WmS1(y=tauGen)
|
|---|
| 3799 | annotation (Placement(transformation(extent={{-60,70},{-28,90}})));
|
|---|
| 3800 | parameter Integer pp=2 "Pole pairs";
|
|---|
| 3801 | parameter Real R1=0.435 "Stator's phase resistance (ohm)";
|
|---|
| 3802 | parameter Real L1=0.004 "Stator's leakage inductance (H)";
|
|---|
| 3803 | parameter Real Lm=0.0693 "Stator's leakage inductance (H)";
|
|---|
| 3804 | parameter Real R2=0.4 "Rotor's phase resistance (ohm)";
|
|---|
| 3805 | parameter Real L2=0.002 "Rotor's leakage inductance (H)";
|
|---|
| 3806 | parameter Real J=2.0 "Rotor's moment of inertia (kg.m^2)";
|
|---|
| 3807 | Real W0, tauGen;
|
|---|
| 3808 | Modelica.SIunits.Torque tauElectrical;
|
|---|
| 3809 | Modelica.SIunits.AngularVelocity wMechanical;
|
|---|
| 3810 | //mechanical angular speed
|
|---|
| 3811 | Real s;
|
|---|
| 3812 | //slip
|
|---|
| 3813 | Real absUag;
|
|---|
| 3814 | //abs(Uag)
|
|---|
| 3815 | Real constUF;
|
|---|
| 3816 | //abs(Uag)/f
|
|---|
| 3817 | Modelica.Mechanics.Rotational.Components.Inertia inertia(J=J)
|
|---|
| 3818 | annotation (Placement(transformation(extent={{58,70},{78,90}})));
|
|---|
| 3819 | Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Ground ground
|
|---|
| 3820 | annotation (Placement(transformation(extent={{26,-40},{46,-20}})));
|
|---|
| 3821 | Modelica.Blocks.Interfaces.RealOutput Pdc annotation (Placement(
|
|---|
| 3822 | transformation(
|
|---|
| 3823 | extent={{-10,-10},{10,10}},
|
|---|
| 3824 | rotation=270,
|
|---|
| 3825 | origin={-60,-110}), iconTransformation(
|
|---|
| 3826 | extent={{-10,-10},{10,10}},
|
|---|
| 3827 | rotation=270,
|
|---|
| 3828 | origin={-60,-110})));
|
|---|
| 3829 | Modelica.Blocks.Interfaces.RealOutput Is annotation (Placement(
|
|---|
| 3830 | transformation(
|
|---|
| 3831 | extent={{-10,-10},{10,10}},
|
|---|
| 3832 | rotation=270,
|
|---|
| 3833 | origin={60,-110}), iconTransformation(
|
|---|
| 3834 | extent={{-10,-10},{10,10}},
|
|---|
| 3835 | rotation=270,
|
|---|
| 3836 | origin={60,-110})));
|
|---|
| 3837 | Modelica.Mechanics.Rotational.Sensors.PowerSensor PmGen
|
|---|
| 3838 | annotation (Placement(transformation(extent={{22,70},{42,90}})));
|
|---|
| 3839 | Modelica.ComplexBlocks.ComplexMath.ComplexToPolar toIs annotation (
|
|---|
| 3840 | Placement(transformation(
|
|---|
| 3841 | extent={{-7,-7},{7,7}},
|
|---|
| 3842 | rotation=270,
|
|---|
| 3843 | origin={-7,-3})));
|
|---|
| 3844 | Modelica.Electrical.QuasiStationary.SinglePhase.Basic.VariableConductor
|
|---|
| 3845 | gAirgap annotation (Placement(transformation(
|
|---|
| 3846 | extent={{-10,-10},{10,10}},
|
|---|
| 3847 | rotation=-90,
|
|---|
| 3848 | origin={106,-4})));
|
|---|
| 3849 | Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.CurrentSensor
|
|---|
| 3850 | Is1 annotation (Placement(transformation(
|
|---|
| 3851 | extent={{9,8},{-9,-8}},
|
|---|
| 3852 | rotation=180,
|
|---|
| 3853 | origin={-7,18})));
|
|---|
| 3854 | Modelica.Blocks.Sources.RealExpression toPdc(y=3*(Pag.y.re + R1*toIs.len
|
|---|
| 3855 | ^2))
|
|---|
| 3856 | annotation (Placement(transformation(extent={{-10,-74},{-58,-58}})));
|
|---|
| 3857 | Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Inductor L1_(L=L1)
|
|---|
| 3858 | annotation (Placement(transformation(extent={{10,8},{30,28}})));
|
|---|
| 3859 | equation
|
|---|
| 3860 | W0 = f*2*PI/pp;
|
|---|
| 3861 | absUag = sqrt(L2_.pin_p.v.re^2 + L2_.pin_p.v.im^2);
|
|---|
| 3862 | if abs(f) < 1e-12 then
|
|---|
| 3863 | s = 1.0;
|
|---|
| 3864 | tauGen = 0;
|
|---|
| 3865 | constUF = 1;
|
|---|
| 3866 | else
|
|---|
| 3867 | s = (W0 - Wm.w)/W0;
|
|---|
| 3868 | tauGen = 3*Pag.y.re/W0;
|
|---|
| 3869 | constUF = absUag/f;
|
|---|
| 3870 | end if;
|
|---|
| 3871 | gAirgap.G_ref = s/R2;
|
|---|
| 3872 | tauElectrical = torque.tau;
|
|---|
| 3873 | wMechanical = Wm.w;
|
|---|
| 3874 | connect(ToComplexUin.y, uFeed.V) annotation (Line(
|
|---|
| 3875 | points={{-57,48},{-44,48},{-44,2},{-42,2}},
|
|---|
| 3876 | color={85,170,255},
|
|---|
| 3877 | smooth=Smooth.None));
|
|---|
| 3878 | connect(ToComplexUin.len, Uag) annotation (Line(
|
|---|
| 3879 | points={{-80,54},{-92,54},{-92,60},{-120,60}},
|
|---|
| 3880 | color={0,0,127},
|
|---|
| 3881 | smooth=Smooth.None));
|
|---|
| 3882 | connect(Pag.currentP, L2_.pin_n) annotation (Line(
|
|---|
| 3883 | points={{72,18},{64,18}},
|
|---|
| 3884 | color={85,170,255},
|
|---|
| 3885 | smooth=Smooth.None));
|
|---|
| 3886 | connect(Pag.voltageP, Pag.currentP) annotation (Line(
|
|---|
| 3887 | points={{82,28},{72,28},{72,18}},
|
|---|
| 3888 | color={85,170,255},
|
|---|
| 3889 | smooth=Smooth.None));
|
|---|
| 3890 | connect(WmS1.y, torque.tau) annotation (Line(
|
|---|
| 3891 | points={{-26.4,80},{-12,80}},
|
|---|
| 3892 | color={0,0,127},
|
|---|
| 3893 | smooth=Smooth.None));
|
|---|
| 3894 | connect(inertia.flange_b, flange_a) annotation (Line(
|
|---|
| 3895 | points={{78,80},{100,80}},
|
|---|
| 3896 | color={0,0,0},
|
|---|
| 3897 | smooth=Smooth.None));
|
|---|
| 3898 | connect(ground.pin, Lm_.pin_n) annotation (Line(
|
|---|
| 3899 | points={{36,-20},{36,-14}},
|
|---|
| 3900 | color={85,170,255},
|
|---|
| 3901 | smooth=Smooth.None));
|
|---|
| 3902 | connect(PmGen.flange_a, torque.flange) annotation (Line(
|
|---|
| 3903 | points={{22,80},{10,80}},
|
|---|
| 3904 | color={0,0,0},
|
|---|
| 3905 | smooth=Smooth.None));
|
|---|
| 3906 | connect(PmGen.flange_b, inertia.flange_a) annotation (Line(
|
|---|
| 3907 | points={{42,80},{58,80}},
|
|---|
| 3908 | color={0,0,0},
|
|---|
| 3909 | smooth=Smooth.None));
|
|---|
| 3910 | connect(Wm.flange, PmGen.flange_b) annotation (Line(
|
|---|
| 3911 | points={{48,68},{48,76},{42,76},{42,80}},
|
|---|
| 3912 | color={0,0,0},
|
|---|
| 3913 | smooth=Smooth.None));
|
|---|
| 3914 | connect(uFeed.f, f) annotation (Line(
|
|---|
| 3915 | points={{-42,-6},{-80,-6},{-80,-60},{-120,-60}},
|
|---|
| 3916 | color={0,0,127},
|
|---|
| 3917 | smooth=Smooth.None));
|
|---|
| 3918 | connect(Pag.currentN, gAirgap.pin_p) annotation (Line(
|
|---|
| 3919 | points={{92,18},{106,18},{106,6}},
|
|---|
| 3920 | color={85,170,255},
|
|---|
| 3921 | smooth=Smooth.None));
|
|---|
| 3922 | connect(Lm_.pin_p, L2_.pin_p) annotation (Line(
|
|---|
| 3923 | points={{36,6},{36,18},{44,18}},
|
|---|
| 3924 | color={85,170,255},
|
|---|
| 3925 | smooth=Smooth.None));
|
|---|
| 3926 | connect(Is1.y, toIs.u) annotation (Line(
|
|---|
| 3927 | points={{-7,9.2},{-7,5.4}},
|
|---|
| 3928 | color={85,170,255},
|
|---|
| 3929 | smooth=Smooth.None));
|
|---|
| 3930 | connect(toPdc.y, Pdc) annotation (Line(
|
|---|
| 3931 | points={{-60.4,-66},{-60,-66},{-60,-110}},
|
|---|
| 3932 | color={0,0,127},
|
|---|
| 3933 | smooth=Smooth.None));
|
|---|
| 3934 | connect(uFeed.pin_p, Is1.pin_p) annotation (Line(
|
|---|
| 3935 | points={{-32,8},{-32,18},{-16,18}},
|
|---|
| 3936 | color={85,170,255},
|
|---|
| 3937 | smooth=Smooth.None));
|
|---|
| 3938 | connect(toIs.len, Is) annotation (Line(
|
|---|
| 3939 | points={{-2.8,-11.4},{-2.8,-84},{60,-84},{60,-110}},
|
|---|
| 3940 | color={0,0,127},
|
|---|
| 3941 | smooth=Smooth.None));
|
|---|
| 3942 | connect(gAirgap.pin_n, Lm_.pin_n) annotation (Line(
|
|---|
| 3943 | points={{106,-14},{36,-14}},
|
|---|
| 3944 | color={85,170,255},
|
|---|
| 3945 | smooth=Smooth.None));
|
|---|
| 3946 | connect(Lm_.pin_n, uFeed.pin_n) annotation (Line(
|
|---|
| 3947 | points={{36,-14},{-32,-14},{-32,-12}},
|
|---|
| 3948 | color={85,170,255},
|
|---|
| 3949 | smooth=Smooth.None));
|
|---|
| 3950 | connect(ToComplexUin.phi, const.y) annotation (Line(
|
|---|
| 3951 | points={{-80,42},{-92,42},{-92,20},{-79,20}},
|
|---|
| 3952 | color={0,0,127},
|
|---|
| 3953 | smooth=Smooth.None));
|
|---|
| 3954 | connect(Pag.voltageN, Lm_.pin_n) annotation (Line(
|
|---|
| 3955 | points={{82,8},{82,-14},{36,-14}},
|
|---|
| 3956 | color={85,170,255},
|
|---|
| 3957 | smooth=Smooth.None));
|
|---|
| 3958 | connect(Is1.pin_n, L1_.pin_p) annotation (Line(
|
|---|
| 3959 | points={{2,18},{10,18}},
|
|---|
| 3960 | color={85,170,255},
|
|---|
| 3961 | smooth=Smooth.None));
|
|---|
| 3962 | connect(L2_.pin_p, L1_.pin_n) annotation (Line(
|
|---|
| 3963 | points={{44,18},{30,18}},
|
|---|
| 3964 | color={85,170,255},
|
|---|
| 3965 | smooth=Smooth.None));
|
|---|
| 3966 | annotation (
|
|---|
| 3967 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
|
|---|
| 3968 | {120,100}}), graphics={Rectangle(
|
|---|
| 3969 | extent={{-48,34},{120,-38}},
|
|---|
| 3970 | lineColor={255,0,0},
|
|---|
| 3971 | pattern=LinePattern.Dash)}),
|
|---|
| 3972 | Documentation(info="<html>
|
|---|
| 3973 | <p>This model models ans asynchronous machine based on a quasi-stationary approximation: the equivalent single-phase circuit.</p>
|
|---|
| 3974 | <p>This model is very fast and compact, and gives result with sufficient precision in most vehicular propulsion needs.</p>
|
|---|
| 3975 | </html>"),
|
|---|
| 3976 | Icon(coordinateSystem(
|
|---|
| 3977 | extent={{-100,-100},{120,100}},
|
|---|
| 3978 | preserveAspectRatio=false,
|
|---|
| 3979 | initialScale=0.1,
|
|---|
| 3980 | grid={2,2}), graphics={Line(points={{-102,60},{-50,32}}, color={0,
|
|---|
| 3981 | 0,127}),Line(points={{-100,-60},{-48,-30}}, color={0,0,127}),
|
|---|
| 3982 | Text( origin={14,-16},
|
|---|
| 3983 | lineColor={0,0,255},
|
|---|
| 3984 | fillColor={95,95,95},
|
|---|
| 3985 | fillPattern=FillPattern.Solid,
|
|---|
| 3986 | extent={{-114,140},{102,100}},
|
|---|
| 3987 | textString="%name"),Rectangle(
|
|---|
| 3988 | fillColor={175,175,175},
|
|---|
| 3989 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 3990 | extent={{-56,66},{78,-54}}),Rectangle(
|
|---|
| 3991 | fillColor={95,95,95},
|
|---|
| 3992 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 3993 | extent={{78,10},{98,-10}}),Rectangle(
|
|---|
| 3994 | fillColor={128,128,128},
|
|---|
| 3995 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 3996 | extent={{-56,66},{-76,-54}}),Polygon(fillPattern=
|
|---|
| 3997 | FillPattern.Solid, points={{-72,-84},{-56,-84},{-26,-14},{26,-14},
|
|---|
| 3998 | {58,-84},{72,-84},{72,-94},{-72,-94},{-72,-84}})}));
|
|---|
| 3999 | end QSAsma;
|
|---|
| 4000 |
|
|---|
| 4001 | model FromPark "Semplice PMM con modello funzionale inverter"
|
|---|
| 4002 | parameter Integer p "Number or pole pairs";
|
|---|
| 4003 | Modelica.Electrical.Machines.SpacePhasors.Blocks.FromSpacePhasor
|
|---|
| 4004 | fromSpacePhasor
|
|---|
| 4005 | annotation (Placement(transformation(extent={{60,0},{80,20}})));
|
|---|
| 4006 | Modelica.Electrical.Machines.SpacePhasors.Blocks.Rotator rotator
|
|---|
| 4007 | annotation (Placement(transformation(extent={{0,6},{20,26}})));
|
|---|
| 4008 | Modelica.Blocks.Routing.Multiplex2 multiplex2_1
|
|---|
| 4009 | annotation (Placement(transformation(extent={{-40,0},{-20,20}})));
|
|---|
| 4010 | Modelica.Blocks.Interfaces.RealOutput y[3] annotation (Placement(
|
|---|
| 4011 | transformation(extent={{100,-10},{120,10}}), iconTransformation(
|
|---|
| 4012 | extent={{100,-10},{120,10}})));
|
|---|
| 4013 | Modelica.Blocks.Interfaces.RealInput Xd annotation (Placement(
|
|---|
| 4014 | transformation(extent={{-140,40},{-100,80}}), iconTransformation(
|
|---|
| 4015 | extent={{-140,40},{-100,80}})));
|
|---|
| 4016 | Modelica.Blocks.Interfaces.RealInput Xq annotation (Placement(
|
|---|
| 4017 | transformation(extent={{-140,-80},{-100,-40}}),
|
|---|
| 4018 | iconTransformation(extent={{-140,-80},{-100,-40}})));
|
|---|
| 4019 | Modelica.Blocks.Interfaces.RealInput phi annotation (Placement(
|
|---|
| 4020 | transformation(
|
|---|
| 4021 | extent={{-20,-20},{20,20}},
|
|---|
| 4022 | rotation=90,
|
|---|
| 4023 | origin={10,-110}), iconTransformation(
|
|---|
| 4024 | extent={{-20,-20},{20,20}},
|
|---|
| 4025 | rotation=90,
|
|---|
| 4026 | origin={0,-120})));
|
|---|
| 4027 | Modelica.Blocks.Math.Gain gain(k=-p) annotation (Placement(
|
|---|
| 4028 | transformation(
|
|---|
| 4029 | extent={{-10,-10},{10,10}},
|
|---|
| 4030 | rotation=90,
|
|---|
| 4031 | origin={10,-50})));
|
|---|
| 4032 | Modelica.Blocks.Sources.Constant const annotation (Placement(
|
|---|
| 4033 | transformation(
|
|---|
| 4034 | extent={{-10,-10},{10,10}},
|
|---|
| 4035 | rotation=90,
|
|---|
| 4036 | origin={50,-30})));
|
|---|
| 4037 | equation
|
|---|
| 4038 | connect(multiplex2_1.y, rotator.u) annotation (Line(
|
|---|
| 4039 | points={{-19,10},{-10,10},{-10,16},{-2,16}},
|
|---|
| 4040 | color={0,0,127},
|
|---|
| 4041 | smooth=Smooth.None));
|
|---|
| 4042 | connect(fromSpacePhasor.u, rotator.y) annotation (Line(
|
|---|
| 4043 | points={{58,10},{40,10},{40,16},{21,16}},
|
|---|
| 4044 | color={0,0,127},
|
|---|
| 4045 | smooth=Smooth.None));
|
|---|
| 4046 | connect(fromSpacePhasor.y, y) annotation (Line(
|
|---|
| 4047 | points={{81,10},{94,10},{94,0},{110,0}},
|
|---|
| 4048 | color={0,0,127},
|
|---|
| 4049 | smooth=Smooth.None));
|
|---|
| 4050 | connect(multiplex2_1.u1[1], Xd) annotation (Line(
|
|---|
| 4051 | points={{-42,16},{-60,16},{-60,60},{-120,60}},
|
|---|
| 4052 | color={0,0,127},
|
|---|
| 4053 | smooth=Smooth.None));
|
|---|
| 4054 | connect(multiplex2_1.u2[1], Xq) annotation (Line(
|
|---|
| 4055 | points={{-42,4},{-60,4},{-60,-60},{-120,-60}},
|
|---|
| 4056 | color={0,0,127},
|
|---|
| 4057 | smooth=Smooth.None));
|
|---|
| 4058 | connect(rotator.angle, gain.y) annotation (Line(
|
|---|
| 4059 | points={{10,4},{10,-39}},
|
|---|
| 4060 | color={0,0,127},
|
|---|
| 4061 | smooth=Smooth.None));
|
|---|
| 4062 | connect(gain.u, phi) annotation (Line(
|
|---|
| 4063 | points={{10,-62},{10,-110}},
|
|---|
| 4064 | color={0,0,127},
|
|---|
| 4065 | smooth=Smooth.None));
|
|---|
| 4066 | connect(fromSpacePhasor.zero, const.y) annotation (Line(
|
|---|
| 4067 | points={{58,2},{50,2},{50,-19}},
|
|---|
| 4068 | color={0,0,127},
|
|---|
| 4069 | smooth=Smooth.None));
|
|---|
| 4070 | annotation (
|
|---|
| 4071 | Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},
|
|---|
| 4072 | {100,100}}), graphics),
|
|---|
| 4073 | experiment(StopTime=5, Interval=0.001),
|
|---|
| 4074 | Documentation(info="<html>
|
|---|
| 4075 | <p><br/><b>Test example: Permanent magnet synchronous induction machine fed by a current source</b></p>
|
|---|
| 4076 |
|
|---|
| 4077 |
|
|---|
| 4078 | <p><i><span style='color:red'>NOTA: la macchina ha Lmd=Lmq=0.3(2*pi*f) come definito internamente.</p>
|
|---|
| 4079 | <i><span style='color:red'>E' pertanto una macchina isotropa. la miglior maniera di controllarla, quindi, dovrebbe essere di mettere la corrente tutta sull'asse q e mantenere a 0 la componente sull'asse d.</p></i>
|
|---|
| 4080 |
|
|---|
| 4081 |
|
|---|
| 4082 | <p><br/><br/>A synchronous induction machine with permanent magnets accelerates a quadratic speed dependent load from standstill. The rms values of d- and q-current in rotor fixed coordinate system are converted to threephase currents, and fed to the machine. The result shows that the torque is influenced by the q-current, whereas the stator voltage is influenced by the d-current.</p><p><br/><br/>Default machine parameters of model <i>SM_PermanentMagnet</i> are used. </p>
|
|---|
| 4083 | </html>"),
|
|---|
| 4084 | __Dymola_experimentSetupOutput,
|
|---|
| 4085 | Icon(coordinateSystem(
|
|---|
| 4086 | extent={{-100,-100},{100,100}},
|
|---|
| 4087 | preserveAspectRatio=false,
|
|---|
| 4088 | initialScale=0.1,
|
|---|
| 4089 | grid={2,2}), graphics={Rectangle(
|
|---|
| 4090 | lineColor={0,0,255},
|
|---|
| 4091 | fillColor={255,255,255},
|
|---|
| 4092 | fillPattern=FillPattern.Solid,
|
|---|
| 4093 | extent={{-100,100},{100,-100}}),Text(
|
|---|
| 4094 | lineColor={0,0,255},
|
|---|
| 4095 | extent={{-96,28},{96,-26}},
|
|---|
| 4096 | textString="P=>"),Text(
|
|---|
| 4097 | lineColor={0,0,255},
|
|---|
| 4098 | extent={{-108,150},{102,110}},
|
|---|
| 4099 | textString="%name")}));
|
|---|
| 4100 | end FromPark;
|
|---|
| 4101 |
|
|---|
| 4102 | block UagGenerator
|
|---|
| 4103 | "Generates the voltage behind stator resistance for QAsma model"
|
|---|
| 4104 | import PI = Modelica.Constants.pi;
|
|---|
| 4105 | Real fluxPU "Factor indicating the ratio flux/nominalFlux";
|
|---|
| 4106 | Modelica.Blocks.Interfaces.RealInput dWe "slip radian frequency"
|
|---|
| 4107 | annotation (Placement(transformation(extent={{-136,40},{-96,80}}),
|
|---|
| 4108 | iconTransformation(extent={{-136,40},{-96,80}})));
|
|---|
| 4109 | Modelica.Blocks.Interfaces.RealOutput f "frequency" annotation (
|
|---|
| 4110 | Placement(transformation(extent={{100,-70},{120,-50}}),
|
|---|
| 4111 | iconTransformation(extent={{100,-70},{120,-50}})));
|
|---|
| 4112 | Modelica.Blocks.Math.Add add annotation (Placement(visible=true,
|
|---|
| 4113 | transformation(
|
|---|
| 4114 | origin={-78,-6},
|
|---|
| 4115 | extent={{-10,-10},{10,10}},
|
|---|
| 4116 | rotation=0)));
|
|---|
| 4117 | Modelica.Blocks.Interfaces.RealInput We
|
|---|
| 4118 | "rotating field radian frequency" annotation (Placement(
|
|---|
| 4119 | transformation(extent={{-136,-80},{-96,-40}}), iconTransformation(
|
|---|
| 4120 | extent={{-136,-80},{-96,-40}})));
|
|---|
| 4121 | Modelica.Blocks.Nonlinear.Limiter limWe(uMax=WeMax) annotation (
|
|---|
| 4122 | Placement(visible=true, transformation(extent={{-30,-16},{-10,4}},
|
|---|
| 4123 | rotation=0)));
|
|---|
| 4124 | Modelica.Blocks.Math.Gain toFreq(k=1/(2*PI)) annotation (Placement(
|
|---|
| 4125 | visible=true, transformation(
|
|---|
| 4126 | origin={6,-6},
|
|---|
| 4127 | extent={{8,-8},{-8,8}},
|
|---|
| 4128 | rotation=180)));
|
|---|
| 4129 | Modelica.Blocks.Math.Gain freqToVoltage(k=UBase1/(WeBase/(2*PI)))
|
|---|
| 4130 | annotation (Placement(visible=true, transformation(extent={{28,-14},{
|
|---|
| 4131 | 44,2}}, rotation=0)));
|
|---|
| 4132 | Modelica.Blocks.Interfaces.RealOutput uAg
|
|---|
| 4133 | "air-gap voltage (single-phase, rms)" annotation (Placement(
|
|---|
| 4134 | transformation(extent={{100,50},{120,70}}), iconTransformation(
|
|---|
| 4135 | extent={{100,50},{120,70}})));
|
|---|
| 4136 | Modelica.Blocks.Interfaces.RealInput dcVoltage "DC Voltage" annotation
|
|---|
| 4137 | (Placement(transformation(
|
|---|
| 4138 | extent={{20,-20},{-20,20}},
|
|---|
| 4139 | rotation=90,
|
|---|
| 4140 | origin={0,116})));
|
|---|
| 4141 | Modelica.Blocks.Nonlinear.VariableLimiter variableLimiter
|
|---|
| 4142 | annotation (Placement(transformation(extent={{58,-16},{78,4}})));
|
|---|
| 4143 | Modelica.Blocks.Math.Gain toUagMax(k=1/2.445)
|
|---|
| 4144 | "Limits the maximum generated voltage due to DC voltage limitations"
|
|---|
| 4145 | annotation (Placement(visible=true, transformation(
|
|---|
| 4146 | origin={0,62},
|
|---|
| 4147 | extent={{-10,-10},{10,10}},
|
|---|
| 4148 | rotation=270)));
|
|---|
| 4149 | parameter Modelica.SIunits.Voltage UBase=230
|
|---|
| 4150 | "Base RMS machine line voltage";
|
|---|
| 4151 | parameter Modelica.SIunits.AngularFrequency WeBase=314.15
|
|---|
| 4152 | "Base machine angular frequency ";
|
|---|
| 4153 | parameter Modelica.SIunits.AngularFrequency WeMax=314.15
|
|---|
| 4154 | "Base machine angular frequency";
|
|---|
| 4155 | protected
|
|---|
| 4156 | parameter Real UBase1=UBase/sqrt(3);
|
|---|
| 4157 | public
|
|---|
| 4158 | Modelica.Blocks.Math.Gain toLim2(k=-1)
|
|---|
| 4159 | "Limits the maximum generated voltage due to DC voltage limitations"
|
|---|
| 4160 | annotation (Placement(visible=true, transformation(
|
|---|
| 4161 | origin={42,-46},
|
|---|
| 4162 | extent={{-10,-10},{10,10}},
|
|---|
| 4163 | rotation=0)));
|
|---|
| 4164 | equation
|
|---|
| 4165 | if variableLimiter.limit1 > variableLimiter.u then
|
|---|
| 4166 | fluxPU = 1;
|
|---|
| 4167 | else
|
|---|
| 4168 | fluxPU = variableLimiter.limit1/variableLimiter.u;
|
|---|
| 4169 | end if;
|
|---|
| 4170 | connect(limWe.y, toFreq.u) annotation (Line(
|
|---|
| 4171 | points={{-9,-6},{-3.6,-6}},
|
|---|
| 4172 | color={0,0,127},
|
|---|
| 4173 | smooth=Smooth.None));
|
|---|
| 4174 | connect(toFreq.y, freqToVoltage.u) annotation (Line(
|
|---|
| 4175 | points={{14.8,-6},{26.4,-6}},
|
|---|
| 4176 | color={0,0,127},
|
|---|
| 4177 | smooth=Smooth.None));
|
|---|
| 4178 | connect(f, freqToVoltage.u) annotation (Line(
|
|---|
| 4179 | points={{110,-60},{20,-60},{20,-6},{26.4,-6}},
|
|---|
| 4180 | color={0,0,127},
|
|---|
| 4181 | smooth=Smooth.None));
|
|---|
| 4182 | connect(freqToVoltage.y, variableLimiter.u) annotation (Line(
|
|---|
| 4183 | points={{44.8,-6},{56,-6}},
|
|---|
| 4184 | color={0,0,127},
|
|---|
| 4185 | smooth=Smooth.None));
|
|---|
| 4186 | connect(dcVoltage, toUagMax.u) annotation (Line(
|
|---|
| 4187 | points={{0,116},{0,74}},
|
|---|
| 4188 | color={0,0,127},
|
|---|
| 4189 | smooth=Smooth.None));
|
|---|
| 4190 | connect(toUagMax.y, variableLimiter.limit1) annotation (Line(
|
|---|
| 4191 | points={{0,51},{0,20},{42,20},{42,2},{56,2}},
|
|---|
| 4192 | color={0,0,127},
|
|---|
| 4193 | smooth=Smooth.None));
|
|---|
| 4194 | connect(variableLimiter.y, uAg) annotation (Line(
|
|---|
| 4195 | points={{79,-6},{90,-6},{90,60},{110,60}},
|
|---|
| 4196 | color={0,0,127},
|
|---|
| 4197 | smooth=Smooth.None));
|
|---|
| 4198 | connect(add.u2, We) annotation (Line(
|
|---|
| 4199 | points={{-90,-12},{-96,-12},{-96,-60},{-116,-60}},
|
|---|
| 4200 | color={0,0,127},
|
|---|
| 4201 | smooth=Smooth.None));
|
|---|
| 4202 | connect(dWe, add.u1) annotation (Line(
|
|---|
| 4203 | points={{-116,60},{-84,60},{-84,18},{-96,18},{-96,0},{-90,0}},
|
|---|
| 4204 | color={0,0,127},
|
|---|
| 4205 | smooth=Smooth.None));
|
|---|
| 4206 | connect(limWe.u, add.y) annotation (Line(
|
|---|
| 4207 | points={{-32,-6},{-67,-6}},
|
|---|
| 4208 | color={0,0,127},
|
|---|
| 4209 | smooth=Smooth.None));
|
|---|
| 4210 | connect(toLim2.y, variableLimiter.limit2) annotation (Line(
|
|---|
| 4211 | points={{53,-46},{64,-46},{64,-26},{56,-26},{56,-14}},
|
|---|
| 4212 | color={0,0,127},
|
|---|
| 4213 | smooth=Smooth.None));
|
|---|
| 4214 | connect(toLim2.u, variableLimiter.limit1) annotation (Line(
|
|---|
| 4215 | points={{30,-46},{-56,-46},{-56,32},{0,32},{0,20},{42,20},{42,2},{
|
|---|
| 4216 | 56,2}},
|
|---|
| 4217 | color={0,0,127},
|
|---|
| 4218 | smooth=Smooth.None));
|
|---|
| 4219 | annotation (
|
|---|
| 4220 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
|
|---|
| 4221 | {100,100}})),
|
|---|
| 4222 | Icon(coordinateSystem(extent={{-100,-100},{100,100}},
|
|---|
| 4223 | preserveAspectRatio=false), graphics={Rectangle(
|
|---|
| 4224 | extent={{-100,100},{100,-100}},
|
|---|
| 4225 | lineColor={0,0,127},
|
|---|
| 4226 | fillColor={255,255,255},
|
|---|
| 4227 | fillPattern=FillPattern.Solid),Line(
|
|---|
| 4228 | points={{-46,-58},{-46,68}},
|
|---|
| 4229 | color={0,0,127},
|
|---|
| 4230 | smooth=Smooth.None),Line(
|
|---|
| 4231 | points={{-54,58},{-46,70},{-40,58}},
|
|---|
| 4232 | color={0,0,127},
|
|---|
| 4233 | smooth=Smooth.None),Line(
|
|---|
| 4234 | points={{-60,-50},{84,-50}},
|
|---|
| 4235 | color={0,0,127},
|
|---|
| 4236 | smooth=Smooth.None),Line(
|
|---|
| 4237 | points={{-7,-6},{1,6},{7,-6}},
|
|---|
| 4238 | color={0,0,127},
|
|---|
| 4239 | smooth=Smooth.None,
|
|---|
| 4240 | origin={81,-50},
|
|---|
| 4241 | rotation=270),Line(
|
|---|
| 4242 | points={{-52,-55},{18,13},{70,13}},
|
|---|
| 4243 | color={0,0,127},
|
|---|
| 4244 | smooth=Smooth.None),Line(
|
|---|
| 4245 | points={{-53,-50},{-37,-50}},
|
|---|
| 4246 | color={0,0,127},
|
|---|
| 4247 | smooth=Smooth.None),Text(
|
|---|
| 4248 | extent={{-90,46},{-54,18}},
|
|---|
| 4249 | lineColor={0,0,127},
|
|---|
| 4250 | textString="Ub"),Line(
|
|---|
| 4251 | points={{-53,31},{-37,31}},
|
|---|
| 4252 | color={0,0,127},
|
|---|
| 4253 | smooth=Smooth.None),Text(
|
|---|
| 4254 | extent={{3,-55},{46,-86}},
|
|---|
| 4255 | lineColor={0,0,127},
|
|---|
| 4256 | textString="Wb"),Line(
|
|---|
| 4257 | points={{20,-22},{20,-54},{20,-44}},
|
|---|
| 4258 | color={0,0,127},
|
|---|
| 4259 | smooth=Smooth.None),Text(
|
|---|
| 4260 | extent={{-100,-100},{90,-140}},
|
|---|
| 4261 | lineColor={0,0,255},
|
|---|
| 4262 | textString="%name")}),
|
|---|
| 4263 | Documentation(info="<html>
|
|---|
| 4264 | <p>Generates the voltage behind stator resistance for QAsma model.</p>
|
|---|
| 4265 | <p>It uses the U/f=const technique, so it applies a voltage proportional to frequency, wusing the input deltaOmeca, in such a way that when spees is base speed, the applied voltage is the nominal voltage.</p>
|
|---|
| 4266 | <p>The maximum machine voltage is limited by the DC available voltage. The maximum line-to-line peak machine voltage is imposed to be equal to the available DC voltage.</p>
|
|---|
| 4267 | </html>"));
|
|---|
| 4268 | end UagGenerator;
|
|---|
| 4269 | annotation (Icon(graphics={Rectangle(
|
|---|
| 4270 | lineColor={200,200,200},
|
|---|
| 4271 | fillColor={248,248,248},
|
|---|
| 4272 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 4273 | extent={{-100,-100},{100,100}},
|
|---|
| 4274 | radius=25.0),Rectangle(
|
|---|
| 4275 | lineColor={128,128,128},
|
|---|
| 4276 | fillPattern=FillPattern.None,
|
|---|
| 4277 | extent={{-100,-100},{100,100}},
|
|---|
| 4278 | radius=25.0),Ellipse(extent={{-38,40},{38,-36}}, lineColor={0,
|
|---|
| 4279 | 0,0}),Line(
|
|---|
| 4280 | points={{2,82},{-8,82},{-12,72},{-26,68},{-36,78},{-48,70},{-44,
|
|---|
| 4281 | 58},{-56,46},{-68,50},{-76,36},{-68,30},{-70,16},{-80,12},{-80,
|
|---|
| 4282 | 2}},
|
|---|
| 4283 | color={0,0,0},
|
|---|
| 4284 | smooth=Smooth.None),Line(
|
|---|
| 4285 | points={{2,-78},{-8,-78},{-12,-68},{-26,-64},{-36,-74},{-48,-66},
|
|---|
| 4286 | {-44,-54},{-56,-42},{-68,-46},{-76,-32},{-68,-26},{-70,-12},{-80,
|
|---|
| 4287 | -8},{-80,2}},
|
|---|
| 4288 | color={0,0,0},
|
|---|
| 4289 | smooth=Smooth.None),Line(
|
|---|
| 4290 | points={{0,-78},{10,-78},{14,-68},{28,-64},{38,-74},{50,-66},
|
|---|
| 4291 | {46,-54},{58,-42},{70,-46},{78,-32},{70,-26},{72,-12},{82,-8},{
|
|---|
| 4292 | 82,2}},
|
|---|
| 4293 | color={0,0,0},
|
|---|
| 4294 | smooth=Smooth.None),Line(
|
|---|
| 4295 | points={{0,82},{10,82},{14,72},{28,68},{38,78},{50,70},{46,58},
|
|---|
| 4296 | {58,46},{70,50},{78,36},{70,30},{72,16},{82,12},{82,2}},
|
|---|
| 4297 | color={0,0,0},
|
|---|
| 4298 | smooth=Smooth.None)}));
|
|---|
| 4299 | end EDsupport;
|
|---|
| 4300 | annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
|
|---|
| 4301 | -100},{100,100}}), graphics={
|
|---|
| 4302 | Line(points={{-30,20},{4,20}}, color={0,0,255}),
|
|---|
| 4303 | Line(points={{-32,0},{2,0}}, color={0,0,255}),
|
|---|
| 4304 | Line(points={{-32,-20},{2,-20}}, color={0,0,255}),
|
|---|
| 4305 | Text(
|
|---|
| 4306 | lineColor={0,0,255},
|
|---|
| 4307 | fillColor={95,95,95},
|
|---|
| 4308 | fillPattern=FillPattern.Solid,
|
|---|
| 4309 | extent={{-142,-112},{146,-146}},
|
|---|
| 4310 | textString="%name"),
|
|---|
| 4311 | Line(points={{-104,-60},{-80,-60},{-80,-28},{-62,-28}}, color={0,0,
|
|---|
| 4312 | 255}),
|
|---|
| 4313 | Line(points={{-98,60},{-80,60},{-80,28},{-62,28}}, color={0,0,255}),
|
|---|
| 4314 | Rectangle(
|
|---|
| 4315 | fillColor={175,175,175},
|
|---|
| 4316 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 4317 | extent={{-42,68},{78,-52}}),
|
|---|
| 4318 | Rectangle(
|
|---|
| 4319 | lineColor={0,0,255},
|
|---|
| 4320 | fillColor={0,0,255},
|
|---|
| 4321 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 4322 | extent={{-42,68},{-64,-52}}),
|
|---|
| 4323 | Polygon(fillPattern=FillPattern.Solid, points={{-56,-82},{-46,-82},{-16,
|
|---|
| 4324 | -12},{34,-12},{64,-82},{74,-82},{74,-92},{-56,-92},{-56,-82}}),
|
|---|
| 4325 |
|
|---|
| 4326 | Rectangle(
|
|---|
| 4327 | fillColor={95,95,95},
|
|---|
| 4328 | fillPattern=FillPattern.HorizontalCylinder,
|
|---|
| 4329 | extent={{78,12},{98,-8}})}));
|
|---|
| 4330 |
|
|---|
| 4331 | end ElectricDrives;
|
|---|
| 4332 |
|
|---|
| 4333 | package SupportModels "Useful addtional models"
|
|---|
| 4334 | extends Modelica.Icons.Package;
|
|---|
| 4335 | // extends EHPT.Icons.SupportIcon;
|
|---|
| 4336 |
|
|---|
| 4337 | model PropDriver "Simple Proportional controller driver"
|
|---|
| 4338 | parameter String CycleFileName="MyCycleName.txt"
|
|---|
| 4339 | "Drive Cycle Name ex: \"sort1.txt\"";
|
|---|
| 4340 | parameter Real k "Controller gain";
|
|---|
| 4341 | parameter Real yMax=1000000.0 "Max output value (absolute)";
|
|---|
| 4342 | Modelica.Blocks.Interfaces.RealInput V annotation (Placement(
|
|---|
| 4343 | transformation(
|
|---|
| 4344 | extent={{-14,-14},{14,14}},
|
|---|
| 4345 | rotation=90,
|
|---|
| 4346 | origin={0,-114}), iconTransformation(
|
|---|
| 4347 | extent={{-12,-12},{12,12}},
|
|---|
| 4348 | rotation=90,
|
|---|
| 4349 | origin={0,-112})));
|
|---|
| 4350 | Modelica.Blocks.Interfaces.RealOutput tauRef(unit="N.m") annotation (
|
|---|
| 4351 | Placement(transformation(extent={{100,-10},{120,10}}),
|
|---|
| 4352 | iconTransformation(extent={{100,-10},{120,10}})));
|
|---|
| 4353 | Modelica.Blocks.Sources.CombiTimeTable driveCyc(
|
|---|
| 4354 | tableOnFile=true,
|
|---|
| 4355 | tableName="Cycle",
|
|---|
| 4356 | extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic,
|
|---|
| 4357 | fileName=CycleFileName,
|
|---|
| 4358 | columns={2})
|
|---|
| 4359 | annotation (Placement(transformation(extent={{-86,-10},{-66,10}})));
|
|---|
| 4360 | Modelica.Blocks.Math.UnitConversions.From_kmh from_kmh
|
|---|
| 4361 | annotation (Placement(transformation(extent={{-48,-10},{-28,10}})));
|
|---|
| 4362 | Modelica.Blocks.Math.Feedback feedback
|
|---|
| 4363 | annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
|
|---|
| 4364 | Modelica.Blocks.Math.Gain gain(k=k)
|
|---|
| 4365 | annotation (Placement(transformation(extent={{32,-10},{52,10}})));
|
|---|
| 4366 | Modelica.Blocks.Nonlinear.Limiter limiter(uMax=yMax)
|
|---|
| 4367 | annotation (Placement(transformation(extent={{70,-10},{90,10}})));
|
|---|
| 4368 | equation
|
|---|
| 4369 | connect(from_kmh.u, driveCyc.y[1]) annotation (Line(
|
|---|
| 4370 | points={{-50,0},{-65,0}},
|
|---|
| 4371 | color={0,0,127},
|
|---|
| 4372 | smooth=Smooth.None));
|
|---|
| 4373 | connect(from_kmh.y, feedback.u1) annotation (Line(
|
|---|
| 4374 | points={{-27,0},{-8,0}},
|
|---|
| 4375 | color={0,0,127},
|
|---|
| 4376 | smooth=Smooth.None));
|
|---|
| 4377 | connect(feedback.u2, V) annotation (Line(
|
|---|
| 4378 | points={{0,-8},{0,-114},{1.77636e-015,-114}},
|
|---|
| 4379 | color={0,0,127},
|
|---|
| 4380 | smooth=Smooth.None));
|
|---|
| 4381 | connect(feedback.y, gain.u) annotation (Line(
|
|---|
| 4382 | points={{9,0},{30,0}},
|
|---|
| 4383 | color={0,0,127},
|
|---|
| 4384 | smooth=Smooth.None));
|
|---|
| 4385 | connect(gain.y, limiter.u) annotation (Line(
|
|---|
| 4386 | points={{53,0},{68,0}},
|
|---|
| 4387 | color={0,0,127},
|
|---|
| 4388 | smooth=Smooth.None));
|
|---|
| 4389 | connect(tauRef, limiter.y) annotation (Line(
|
|---|
| 4390 | points={{110,0},{91,0}},
|
|---|
| 4391 | color={0,0,127},
|
|---|
| 4392 | smooth=Smooth.None));
|
|---|
| 4393 | annotation (
|
|---|
| 4394 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
|
|---|
| 4395 | {100,100}}), graphics),
|
|---|
| 4396 | Documentation(info="<html>
|
|---|
| 4397 | <p>Modello semplice di pilota.</p>
|
|---|
| 4398 | <p>Esso contiene al suo interno il ciclo di riferimento, che insegue attraverso un regolatore solo proporzionale.</p>
|
|---|
| 4399 | </html>"),
|
|---|
| 4400 | Icon(coordinateSystem(
|
|---|
| 4401 | extent={{-100,-100},{100,100}},
|
|---|
| 4402 | preserveAspectRatio=false,
|
|---|
| 4403 | initialScale=0.1,
|
|---|
| 4404 | grid={2,2}), graphics={Rectangle(
|
|---|
| 4405 | fillColor={255,255,255},
|
|---|
| 4406 | fillPattern=FillPattern.Solid,
|
|---|
| 4407 | extent={{-100,100},{100,-100}}),Ellipse(
|
|---|
| 4408 | fillColor={255,213,170},
|
|---|
| 4409 | fillPattern=FillPattern.Solid,
|
|---|
| 4410 | extent={{-23,46},{-12,20}},
|
|---|
| 4411 | endAngle=360),Text(
|
|---|
| 4412 | origin={0,1.81063},
|
|---|
| 4413 | lineColor={0,0,255},
|
|---|
| 4414 | extent={{-104,142.189},{98,104}},
|
|---|
| 4415 | textString="%name"),Polygon(
|
|---|
| 4416 | fillColor={215,215,215},
|
|---|
| 4417 | pattern=LinePattern.None,
|
|---|
| 4418 | fillPattern=FillPattern.Solid,
|
|---|
| 4419 | points={{-22,-36},{-42,-64},{-16,-64},{16,-64},{-22,-36}}),
|
|---|
| 4420 | Polygon(
|
|---|
| 4421 | fillColor={135,135,135},
|
|---|
| 4422 | pattern=LinePattern.None,
|
|---|
| 4423 | fillPattern=FillPattern.Solid,
|
|---|
| 4424 | points={{-32,64},{-62,-28},{-30,-28},{-30,-28},{-32,64}},
|
|---|
| 4425 | smooth=Smooth.Bezier),Polygon(
|
|---|
| 4426 | fillColor={135,135,135},
|
|---|
| 4427 | pattern=LinePattern.None,
|
|---|
| 4428 | fillPattern=FillPattern.Solid,
|
|---|
| 4429 | points={{-68,-12},{-14,-66},{10,-26},{0,-26},{-68,-12}},
|
|---|
| 4430 | smooth=Smooth.Bezier),Polygon(
|
|---|
| 4431 | fillColor={175,175,175},
|
|---|
| 4432 | fillPattern=FillPattern.Solid,
|
|---|
| 4433 | points={{-22,34},{-30,30},{-40,-24},{2,-22},{2,-10},{0,26},{-22,
|
|---|
| 4434 | 34}},
|
|---|
| 4435 | smooth=Smooth.Bezier),Ellipse(
|
|---|
| 4436 | fillColor={255,213,170},
|
|---|
| 4437 | fillPattern=FillPattern.Solid,
|
|---|
| 4438 | extent={{-30,68},{-3,34}},
|
|---|
| 4439 | endAngle=360),Polygon(
|
|---|
| 4440 | pattern=LinePattern.None,
|
|---|
| 4441 | fillPattern=FillPattern.Solid,
|
|---|
| 4442 | points={{-38,58},{-16,74},{-2,60},{4,60},{6,60},{-38,58}},
|
|---|
| 4443 | smooth=Smooth.Bezier),Polygon(
|
|---|
| 4444 | fillColor={95,95,95},
|
|---|
| 4445 | fillPattern=FillPattern.Solid,
|
|---|
| 4446 | points={{30,-20},{-32,-4},{-36,-20},{-24,-34},{30,-20}},
|
|---|
| 4447 | smooth=Smooth.Bezier),Polygon(
|
|---|
| 4448 | fillPattern=FillPattern.Solid,
|
|---|
| 4449 | points={{42,-46},{36,-60},{48,-54},{52,-48},{50,-44},{42,-46}},
|
|---|
| 4450 | smooth=Smooth.Bezier),Line(points={{48,10},{26,24},{26,24}},
|
|---|
| 4451 | thickness=0.5),Line(points={{20,14},{34,34},{34,34}}, thickness=
|
|---|
| 4452 | 0.5),Polygon(
|
|---|
| 4453 | fillColor={255,213,170},
|
|---|
| 4454 | fillPattern=FillPattern.Solid,
|
|---|
| 4455 | points={{28,28},{32,32},{28,26},{34,30},{30,26},{34,28},{30,
|
|---|
| 4456 | 24},{26,26},{34,24},{26,24},{26,26},{28,28},{28,28},{26,26},{26,
|
|---|
| 4457 | 26},{26,26},{28,32},{28,30},{28,28}},
|
|---|
| 4458 | smooth=Smooth.Bezier),Polygon(
|
|---|
| 4459 | fillColor={175,175,175},
|
|---|
| 4460 | fillPattern=FillPattern.Solid,
|
|---|
| 4461 | points={{-18,24},{28,30},{26,22},{-16,8},{-20,8},{-24,18},{-18,
|
|---|
| 4462 | 24}},
|
|---|
| 4463 | smooth=Smooth.Bezier),Polygon(
|
|---|
| 4464 | fillColor={215,215,215},
|
|---|
| 4465 | fillPattern=FillPattern.Solid,
|
|---|
| 4466 | points={{72,18},{48,18},{36,-2},{58,-62},{72,-62},{72,18}}),
|
|---|
| 4467 | Polygon(
|
|---|
| 4468 | fillColor={95,95,95},
|
|---|
| 4469 | fillPattern=FillPattern.Solid,
|
|---|
| 4470 | points={{49,-70},{17,-16},{7,-20},{-1,-26},{49,-70}},
|
|---|
| 4471 | smooth=Smooth.Bezier),Line(points={{-7,55},{-3,53}}),Line(
|
|---|
| 4472 | points={{-9,42},{-5,42}}),Line(points={{-7,55},{-3,55}})}));
|
|---|
| 4473 | end PropDriver;
|
|---|
| 4474 |
|
|---|
| 4475 | model DragForce "Vehicle rolling and aerodinamical drag force"
|
|---|
| 4476 | import Modelica.Constants.g_n;
|
|---|
| 4477 | extends
|
|---|
| 4478 | Modelica.Mechanics.Translational.Interfaces.PartialElementaryOneFlangeAndSupport2;
|
|---|
| 4479 | extends Modelica.Mechanics.Translational.Interfaces.PartialFriction;
|
|---|
| 4480 | Modelica.SIunits.Force f "Total drag force";
|
|---|
| 4481 | Modelica.SIunits.Velocity v "Vehicle velocity";
|
|---|
| 4482 | Modelica.SIunits.Acceleration a "Absolute acceleration of flange";
|
|---|
| 4483 | Real Sign;
|
|---|
| 4484 | parameter Modelica.SIunits.Mass m "Vehicle mass";
|
|---|
| 4485 | parameter Modelica.SIunits.Density rho(start=1.226) "air density";
|
|---|
| 4486 | parameter Modelica.SIunits.Area S "Vehicle cross area";
|
|---|
| 4487 | parameter Real fc(start=0.01) "Rolling friction coefficient";
|
|---|
| 4488 | parameter Real Cx "Aerodinamic drag coefficient";
|
|---|
| 4489 | protected
|
|---|
| 4490 | parameter Real A=fc*m*g_n;
|
|---|
| 4491 | parameter Real B=1/2*rho*S*Cx;
|
|---|
| 4492 | // Constant auxiliary variable
|
|---|
| 4493 | equation
|
|---|
| 4494 | // s = flange.s;
|
|---|
| 4495 | v = der(s);
|
|---|
| 4496 | a = der(v);
|
|---|
| 4497 | // Le seguenti definizioni seguono l'ordine e le ridchieste del modello "PartialFriction" di
|
|---|
| 4498 | // Modelica.Mechanics.Translational.Interfaces"
|
|---|
| 4499 | v_relfric = v;
|
|---|
| 4500 | a_relfric = a;
|
|---|
| 4501 | f0 = A "forza a velocitC 0 ma con scorrimento";
|
|---|
| 4502 | f0_max = A "massima forza velocitC 0 e senza scorrimento ";
|
|---|
| 4503 | free = false "sarebbe true quando la ruota si stacca dalla strada";
|
|---|
| 4504 | // Ora il calcolo di f, e la sua attribuzione alla flangia:
|
|---|
| 4505 | flange.f - f = 0;
|
|---|
| 4506 | // friction force
|
|---|
| 4507 | if v > 0 then
|
|---|
| 4508 | Sign = 1;
|
|---|
| 4509 | else
|
|---|
| 4510 | Sign = -1;
|
|---|
| 4511 | end if;
|
|---|
| 4512 | f - B*v^2*Sign = if locked then sa*unitForce else f0*(if startForward
|
|---|
| 4513 | then Modelica.Math.tempInterpol1(
|
|---|
| 4514 | v,
|
|---|
| 4515 | [0, 1],
|
|---|
| 4516 | 2) else if startBackward then -Modelica.Math.tempInterpol1(
|
|---|
| 4517 | -v,
|
|---|
| 4518 | [0, 1],
|
|---|
| 4519 | 2) else if pre(mode) == Forward then Modelica.Math.tempInterpol1(
|
|---|
| 4520 | v,
|
|---|
| 4521 | [0, 1],
|
|---|
| 4522 | 2) else -Modelica.Math.tempInterpol1(
|
|---|
| 4523 | -v,
|
|---|
| 4524 | [0, 1],
|
|---|
| 4525 | 2));
|
|---|
| 4526 | annotation (
|
|---|
| 4527 | Documentation(info="<html>
|
|---|
| 4528 | <p>This component modesl the total (rolling è+ aerrodynamic vehicle drag resistance: </p>
|
|---|
| 4529 | <p>f=mgh+(1/2)*rho*Cx*S*v^2</p>
|
|---|
| 4530 | <p>It models reliably the stuck phase. based on Modelica-Intrerfaces.PartialFriction model</p>
|
|---|
| 4531 | </html>"),
|
|---|
| 4532 | Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{
|
|---|
| 4533 | 100,100}}), graphics={Polygon(
|
|---|
| 4534 | points={{-98,10},{22,10},{22,41},{92,0},{22,-41},{22,-10},{-98,
|
|---|
| 4535 | -10},{-98,10}},
|
|---|
| 4536 | lineColor={0,127,0},
|
|---|
| 4537 | fillColor={215,215,215},
|
|---|
| 4538 | fillPattern=FillPattern.Solid),Line(points={{-42,-50},{87,-50}},
|
|---|
| 4539 | color={0,0,0}),Polygon(
|
|---|
| 4540 | points={{-72,-50},{-41,-40},{-41,-60},{-72,-50}},
|
|---|
| 4541 | lineColor={0,0,0},
|
|---|
| 4542 | fillColor={128,128,128},
|
|---|
| 4543 | fillPattern=FillPattern.Solid),Line(
|
|---|
| 4544 | points={{-90,-90},{-70,-88},{-50,-82},{-30,-72},{-10,-58},{10,
|
|---|
| 4545 | -40},{30,-18},{50,8},{70,38},{90,72},{110,110}},
|
|---|
| 4546 | color={0,0,255},
|
|---|
| 4547 | thickness=0.5),Text(
|
|---|
| 4548 | extent={{-82,90},{80,50}},
|
|---|
| 4549 | lineColor={0,0,255},
|
|---|
| 4550 | textString="%name")}),
|
|---|
| 4551 | Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},
|
|---|
| 4552 | {100,100}}), graphics));
|
|---|
| 4553 | end DragForce;
|
|---|
| 4554 |
|
|---|
| 4555 | expandable connector Conn
|
|---|
| 4556 | "Control bus that is adapted to the signals connected to it"
|
|---|
| 4557 | extends Modelica.Icons.SignalBus;
|
|---|
| 4558 | annotation (Diagram(graphics));
|
|---|
| 4559 | end Conn;
|
|---|
| 4560 |
|
|---|
| 4561 | model Batt1 "Battery model based on one R-C block in its electric circuit"
|
|---|
| 4562 | parameter Modelica.SIunits.ElectricCharge QCellNom(min=0) = 10*3600.0
|
|---|
| 4563 | "Nominal admissible electric charge per cell"
|
|---|
| 4564 | annotation (Dialog(tab="cell data"));
|
|---|
| 4565 | parameter Modelica.SIunits.Voltage ECellMin(min=0) = 3.3
|
|---|
| 4566 | "Minimum open source voltage per cell"
|
|---|
| 4567 | annotation (Dialog(tab="cell data"));
|
|---|
| 4568 | parameter Modelica.SIunits.Voltage ECellMax(min=0.0001) = 4.15
|
|---|
| 4569 | "Maximum open source voltage per cell"
|
|---|
| 4570 | annotation (Dialog(tab="cell data"));
|
|---|
| 4571 | parameter Real SOCMin(
|
|---|
| 4572 | min=0,
|
|---|
| 4573 | max=1) = 0 "Minimum state of charge"
|
|---|
| 4574 | annotation (Dialog(group="SOC parameters"));
|
|---|
| 4575 | parameter Real SOCMax(
|
|---|
| 4576 | min=0,
|
|---|
| 4577 | max=1) = 1 "Maximum state of charge"
|
|---|
| 4578 | annotation (Dialog(group="SOC parameters"));
|
|---|
| 4579 | parameter Real SOCInit(
|
|---|
| 4580 | min=0,
|
|---|
| 4581 | max=1) = 0.5 "Initial state of charge"
|
|---|
| 4582 | annotation (Dialog(group="SOC parameters"));
|
|---|
| 4583 | parameter Modelica.SIunits.Current ICellMax(min=0) = 10*QCellNom/3600.0
|
|---|
| 4584 | "Maximum admissible cell current" annotation (Dialog(tab="cell data"));
|
|---|
| 4585 | parameter Modelica.SIunits.Resistance R0Cell(min=0) = 0.05*ECellMax/
|
|---|
| 4586 | ICellMax "Serial cell resistance \"R0\"" annotation (Dialog(tab=
|
|---|
| 4587 | "cell data", group="Electric circuit parameters"));
|
|---|
| 4588 | parameter Modelica.SIunits.Resistance R1Cell(min=0) = R0Cell
|
|---|
| 4589 | "Serial cell resistance \"R1\"" annotation (Dialog(tab="cell data",
|
|---|
| 4590 | group="Electric circuit parameters"));
|
|---|
| 4591 | parameter Modelica.SIunits.Capacitance C1Cell(min=0) = 60/R1Cell
|
|---|
| 4592 | "Capacitance in parallel with R1" annotation (Dialog(tab="cell data",
|
|---|
| 4593 | group="Electric circuit parameters"));
|
|---|
| 4594 | parameter Real efficiency(
|
|---|
| 4595 | min=0,
|
|---|
| 4596 | max=0.9999) = 0.85 "Overall charging/discharging energy efficiency"
|
|---|
| 4597 | annotation (Dialog(group="Parameters related to losses"));
|
|---|
| 4598 | parameter Modelica.SIunits.Current ICellChargeDischarge(min=0) = 0.5*
|
|---|
| 4599 | ICellMax
|
|---|
| 4600 | "Charging/discharging current of a cell that the efficiency refers to"
|
|---|
| 4601 | annotation (Dialog(group="Parameters related to losses"));
|
|---|
| 4602 | parameter Integer ns=1 "Number of serial connected cells"
|
|---|
| 4603 | annotation (Dialog(tab="package data", group="Size of the package"));
|
|---|
| 4604 | parameter Integer np=1 "Number of parallel connected cells"
|
|---|
| 4605 | annotation (Dialog(tab="package data", group="Size of the package"));
|
|---|
| 4606 | protected
|
|---|
| 4607 | parameter Real efficiencyMax=(EBatteryMin + EBatteryMax - 2*Rtot*
|
|---|
| 4608 | ICellChargeDischarge)/(EBatteryMin + EBatteryMax + 2*Rtot*
|
|---|
| 4609 | ICellChargeDischarge);
|
|---|
| 4610 | parameter Modelica.SIunits.Capacitance C=QCellNom/(ECellMax - ECellMin)
|
|---|
| 4611 | "Cell capacitance";
|
|---|
| 4612 | // determine fraction of drain current with respect to the total package current
|
|---|
| 4613 | parameter Real k=((1 - efficiency)*(EBatteryMax + EBatteryMin) - 2*(1 +
|
|---|
| 4614 | efficiency)*Rtot*ICellChargeDischarge)/((1 + efficiency)*(EBatteryMax
|
|---|
| 4615 | + EBatteryMin) - 2*(1 - efficiency)*Rtot*ICellChargeDischarge);
|
|---|
| 4616 | parameter Modelica.SIunits.Current IBatteryMax=ICellMax*np
|
|---|
| 4617 | "Maximum battery current";
|
|---|
| 4618 | parameter Modelica.SIunits.Voltage EBatteryMin=ECellMin*ns
|
|---|
| 4619 | "Minimum battery voltage";
|
|---|
| 4620 | parameter Modelica.SIunits.Voltage EBatteryMax=ECellMax*ns
|
|---|
| 4621 | "Maximum battery voltage";
|
|---|
| 4622 | parameter Modelica.SIunits.ElectricCharge QBatteryNominal=QCellNom*np
|
|---|
| 4623 | "Battery admissible electric charge";
|
|---|
| 4624 | parameter Modelica.SIunits.Capacitance CBattery=C*np/ns
|
|---|
| 4625 | "Battery capacitance";
|
|---|
| 4626 | parameter Modelica.SIunits.Resistance R0Battery=R0Cell*ns/np
|
|---|
| 4627 | "Serial inner resistance R0 of cell package";
|
|---|
| 4628 | parameter Modelica.SIunits.Resistance R1Battery=R1Cell*ns/np
|
|---|
| 4629 | "Serial inner resistance R1 of cell package";
|
|---|
| 4630 | parameter Modelica.SIunits.Resistance Rtot=R0Battery + R1Battery;
|
|---|
| 4631 | parameter Modelica.SIunits.Capacitance C1Battery=C1Cell*np/ns
|
|---|
| 4632 | "Battery series inner capacitance C1";
|
|---|
| 4633 | protected
|
|---|
| 4634 | Modelica.SIunits.Voltage ECell "Cell e.m.f.";
|
|---|
| 4635 | Modelica.SIunits.Current iCellStray "Cell stray current";
|
|---|
| 4636 | Modelica.SIunits.Voltage EBattery(start=EBatteryMin + SOCInit*(
|
|---|
| 4637 | EBatteryMax - EBatteryMin), fixed=true) "Battery e.m.f.";
|
|---|
| 4638 | Modelica.SIunits.Voltage Ubat(start=EBatteryMin + SOCInit*(EBatteryMax -
|
|---|
| 4639 | EBatteryMin), fixed=true);
|
|---|
| 4640 | Modelica.SIunits.Current iBatteryStray "Cell parasitic current";
|
|---|
| 4641 | Modelica.Electrical.Analog.Sensors.CurrentSensor currentSensor
|
|---|
| 4642 | annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation
|
|---|
| 4643 | =0)));
|
|---|
| 4644 | Modelica.Blocks.Math.Gain gain(k=k) annotation (Placement(transformation(
|
|---|
| 4645 | origin={52,0},
|
|---|
| 4646 | extent={{-10,-10},{10,10}},
|
|---|
| 4647 | rotation=180)));
|
|---|
| 4648 | Modelica.Blocks.Math.Abs absolute annotation (Placement(transformation(
|
|---|
| 4649 | extent={{34,-10},{14,10}}, rotation=0)));
|
|---|
| 4650 | public
|
|---|
| 4651 | Modelica.Electrical.Analog.Basic.Capacitor cBattery(final C=CBattery)
|
|---|
| 4652 | annotation (Placement(transformation(
|
|---|
| 4653 | origin={-60,0},
|
|---|
| 4654 | extent={{-10,-10},{10,10}},
|
|---|
| 4655 | rotation=270)));
|
|---|
| 4656 | Modelica.Electrical.Analog.Basic.Resistor R0(final R=R0Battery)
|
|---|
| 4657 | annotation (Placement(transformation(
|
|---|
| 4658 | origin={20,60},
|
|---|
| 4659 | extent={{-10,-10},{10,10}},
|
|---|
| 4660 | rotation=180)));
|
|---|
| 4661 | Modelica.Electrical.Analog.Sources.SignalCurrent strayCurrent annotation
|
|---|
| 4662 | (Placement(transformation(
|
|---|
| 4663 | origin={-6,0},
|
|---|
| 4664 | extent={{-10,-10},{10,10}},
|
|---|
| 4665 | rotation=270)));
|
|---|
| 4666 | Modelica.Electrical.Analog.Interfaces.Pin p annotation (Placement(
|
|---|
| 4667 | transformation(extent={{90,50},{110,70}}), iconTransformation(
|
|---|
| 4668 | extent={{90,50},{110,70}})));
|
|---|
| 4669 | Modelica.Electrical.Analog.Interfaces.NegativePin n annotation (Placement(
|
|---|
| 4670 | transformation(extent={{90,-70},{110,-50}}), iconTransformation(
|
|---|
| 4671 | extent={{91,-70},{111,-50}})));
|
|---|
| 4672 | Modelica.Electrical.Analog.Basic.Resistor R1(final R=R1Battery)
|
|---|
| 4673 | annotation (Placement(transformation(
|
|---|
| 4674 | origin={-37,74},
|
|---|
| 4675 | extent={{-10,-10},{10,10}},
|
|---|
| 4676 | rotation=180)));
|
|---|
| 4677 | Modelica.Electrical.Analog.Basic.Capacitor C1(C=C1Battery) annotation (
|
|---|
| 4678 | Placement(transformation(
|
|---|
| 4679 | extent={{-10,-10},{10,10}},
|
|---|
| 4680 | rotation=180,
|
|---|
| 4681 | origin={-37,50})));
|
|---|
| 4682 | Modelica.Blocks.Interfaces.RealOutput SOC annotation (Placement(
|
|---|
| 4683 | transformation(
|
|---|
| 4684 | extent={{-10,-10},{10,10}},
|
|---|
| 4685 | rotation=180,
|
|---|
| 4686 | origin={-110,0}), iconTransformation(
|
|---|
| 4687 | extent={{-10,-10},{10,10}},
|
|---|
| 4688 | rotation=180,
|
|---|
| 4689 | origin={-110,0})));
|
|---|
| 4690 | Modelica.Electrical.Analog.Basic.Capacitor Cdummy(C=C1Battery/10000)
|
|---|
| 4691 | annotation (Placement(transformation(
|
|---|
| 4692 | extent={{-10,-10},{10,10}},
|
|---|
| 4693 | rotation=270,
|
|---|
| 4694 | origin={87,12})));
|
|---|
| 4695 | equation
|
|---|
| 4696 | assert(SOCMin >= 0, "SOCMin must be greater than, or equal to 0");
|
|---|
| 4697 | assert(SOCMax <= 1, "SOCMax must be smaller than, or equal to 1");
|
|---|
| 4698 | assert(efficiency <= efficiencyMax,
|
|---|
| 4699 | "Overall charging/discharging energy efficiency is too big with respect to the actual serial resistance (EfficiencyMax ="
|
|---|
| 4700 | + String(efficiencyMax) + ")");
|
|---|
| 4701 | assert(SOCMin < SOCMax, "SOCMax(=" + String(SOCMax) +
|
|---|
| 4702 | ") must be greater than SOCMin(=" + String(SOCMin) + ")");
|
|---|
| 4703 | assert(SOCInit >= SOCMin, "SOCInit(=" + String(SOCInit) +
|
|---|
| 4704 | ") must be greater than, or equal to SOCMin(=" + String(SOCMin) + ")");
|
|---|
| 4705 | assert(SOCInit <= SOCMax, "SOCInit(=" + String(SOCInit) +
|
|---|
| 4706 | ") must be smaller than, or equal to SOCMax(=" + String(SOCMax) + ")");
|
|---|
| 4707 | iBatteryStray = strayCurrent.i;
|
|---|
| 4708 | iCellStray = iBatteryStray/np;
|
|---|
| 4709 | EBattery = cBattery.v;
|
|---|
| 4710 | //Solo per dare maggiore chiarezza all'utente con un nome significativo
|
|---|
| 4711 | Ubat = Cdummy.v;
|
|---|
| 4712 | ECell = EBattery/ns;
|
|---|
| 4713 | assert(abs(p.i/np) < ICellMax, "Battery cell current i=" + String(abs(p.i
|
|---|
| 4714 | /np)) + "\n exceeds max admissable ICellMax (=" + String(ICellMax) +
|
|---|
| 4715 | "A)");
|
|---|
| 4716 | SOC = (EBattery - EBatteryMin)/(EBatteryMax - EBatteryMin);
|
|---|
| 4717 | //*(SOCMax-SOCMin)+SOCMin);
|
|---|
| 4718 | assert(SOC <= SOCMax,
|
|---|
| 4719 | "Battery is fully charged: State of charge reached maximum limit (=" +
|
|---|
| 4720 | String(SOCMax) + ")");
|
|---|
| 4721 | assert(SOCMin <= SOC,
|
|---|
| 4722 | "Battery is fully discharged: State of charge reached minimum limit (="
|
|---|
| 4723 | + String(SOCMin) + ")");
|
|---|
| 4724 | connect(R0.p, currentSensor.p)
|
|---|
| 4725 | annotation (Line(points={{30,60},{60,60}}, color={0,0,255}));
|
|---|
| 4726 | connect(strayCurrent.p, R0.n)
|
|---|
| 4727 | annotation (Line(points={{-6,10},{-6,60},{10,60}}, color={0,0,255}));
|
|---|
| 4728 | connect(currentSensor.i, gain.u) annotation (Line(points={{70,50},{70,-1.46958e-015},
|
|---|
| 4729 | {64,-1.46958e-015}}, color={0,0,127}));
|
|---|
| 4730 | connect(absolute.u, gain.y) annotation (Line(points={{36,0},{39.5,0},{
|
|---|
| 4731 | 39.5,1.34711e-015},{41,1.34711e-015}}, color={0,0,127}));
|
|---|
| 4732 | connect(absolute.y, strayCurrent.i) annotation (Line(points={{13,0},{7,0},
|
|---|
| 4733 | {7,-1.28588e-015},{1,-1.28588e-015}}, color={0,0,127}));
|
|---|
| 4734 | connect(currentSensor.n, p)
|
|---|
| 4735 | annotation (Line(points={{80,60},{80,60},{100,60}}, color={0,0,255}));
|
|---|
| 4736 | connect(strayCurrent.n, n) annotation (Line(points={{-6,-10},{-6,-60},{
|
|---|
| 4737 | 100,-60}}, color={0,0,255}));
|
|---|
| 4738 | connect(n, cBattery.n) annotation (Line(points={{100,-60},{-60,-60},{-60,
|
|---|
| 4739 | -10}}, color={0,0,255}));
|
|---|
| 4740 | connect(R1.n, cBattery.p) annotation (Line(
|
|---|
| 4741 | points={{-47,74},{-60,74},{-60,10}},
|
|---|
| 4742 | color={0,0,255},
|
|---|
| 4743 | smooth=Smooth.None));
|
|---|
| 4744 | connect(C1.n, cBattery.p) annotation (Line(
|
|---|
| 4745 | points={{-47,50},{-60,50},{-60,10}},
|
|---|
| 4746 | color={0,0,255},
|
|---|
| 4747 | smooth=Smooth.None));
|
|---|
| 4748 | connect(R1.p, C1.p) annotation (Line(
|
|---|
| 4749 | points={{-27,74},{-18,74},{-18,50},{-27,50}},
|
|---|
| 4750 | color={0,0,255},
|
|---|
| 4751 | smooth=Smooth.None));
|
|---|
| 4752 | connect(R1.p, R0.n) annotation (Line(
|
|---|
| 4753 | points={{-27,74},{-18,74},{-18,60},{10,60}},
|
|---|
| 4754 | color={0,0,255},
|
|---|
| 4755 | smooth=Smooth.None));
|
|---|
| 4756 | connect(Cdummy.p, currentSensor.n) annotation (Line(
|
|---|
| 4757 | points={{87,22},{88,22},{88,60},{80,60}},
|
|---|
| 4758 | color={0,0,255},
|
|---|
| 4759 | smooth=Smooth.None));
|
|---|
| 4760 | connect(Cdummy.n, n) annotation (Line(
|
|---|
| 4761 | points={{87,2},{88,2},{88,-60},{100,-60}},
|
|---|
| 4762 | color={0,0,255},
|
|---|
| 4763 | smooth=Smooth.None));
|
|---|
| 4764 | annotation (
|
|---|
| 4765 | Documentation(info="<html>
|
|---|
| 4766 | <p>Battery model wit non-unity coulombic efficiency. </p>
|
|---|
| 4767 | <p>The main cell branch contains an e.m.f. that is linearly increasing with SOC, simulated through an equivalent capacitor the resistance R0 and a parallel R-C couple. </p>
|
|---|
| 4768 | <p>The full battery is composed by np rows in parallel, each of them containing ns cells in series</p>
|
|---|
| 4769 | </html>", revisions="<html><table border=\"1\" rules=\"groups\">
|
|---|
| 4770 | <thead>
|
|---|
| 4771 | <tr><td>Version</td> <td>Date</td> <td>Comment</td></tr>
|
|---|
| 4772 | </thead>
|
|---|
| 4773 | <tbody>
|
|---|
| 4774 | <tr><td>1.0.0</td> <td>2006-01-12</td> <td> </td></tr>
|
|---|
| 4775 | <tr><td>1.0.3</td> <td>2006-08-31</td> <td> Improved assert statements </td></tr>
|
|---|
| 4776 | <tr><td>1.0.6</td> <td>2007-05-14</td> <td> The documentation changed slightly </td></tr>
|
|---|
| 4777 | </tbody>
|
|---|
| 4778 | </table>
|
|---|
| 4779 | </html>"),
|
|---|
| 4780 | Diagram(coordinateSystem(
|
|---|
| 4781 | preserveAspectRatio=true,
|
|---|
| 4782 | extent={{-100,-100},{100,100}},
|
|---|
| 4783 | grid={2,2}), graphics),
|
|---|
| 4784 | Icon(coordinateSystem(
|
|---|
| 4785 | extent={{-100,-100},{100,100}},
|
|---|
| 4786 | preserveAspectRatio=true,
|
|---|
| 4787 | initialScale=0.1,
|
|---|
| 4788 | grid={2,2}), graphics={Rectangle(
|
|---|
| 4789 | lineColor={95,95,95},
|
|---|
| 4790 | fillColor={255,255,255},
|
|---|
| 4791 | fillPattern=FillPattern.Solid,
|
|---|
| 4792 | extent={{-100,100},{78,-98}}),Line(points={{-92,6},{-52,6}},
|
|---|
| 4793 | color={0,0,255}),Rectangle(
|
|---|
| 4794 | lineColor={0,0,255},
|
|---|
| 4795 | fillColor={0,0,255},
|
|---|
| 4796 | fillPattern=FillPattern.Solid,
|
|---|
| 4797 | extent={{-82,-3},{-65,-10}}),Line(points={{-73,63},{98,64}},
|
|---|
| 4798 | color={0,0,255}),Rectangle(
|
|---|
| 4799 | lineColor={0,0,255},
|
|---|
| 4800 | fillColor={255,255,255},
|
|---|
| 4801 | fillPattern=FillPattern.Solid,
|
|---|
| 4802 | extent={{38,69},{68,57}}),Rectangle(
|
|---|
| 4803 | lineColor={0,0,255},
|
|---|
| 4804 | fillColor={255,255,255},
|
|---|
| 4805 | fillPattern=FillPattern.Solid,
|
|---|
| 4806 | extent={{-37.5,68},{-6.5,56}}),Line(points={{-19.5,49},{-19.5,
|
|---|
| 4807 | 32}}, color={0,0,255}),Line(points={{-54.5,63},{-54.5,41},{-25.5,
|
|---|
| 4808 | 41}}, color={0,0,255}),Line(points={{9.5,62},{9.5,40},{-19.5,40}},
|
|---|
| 4809 | color={0,0,255}),Line(points={{-73,63},{-73,5}}, color={0,0,255}),
|
|---|
| 4810 | Line(points={{-73,-6},{-73,-60},{96,-60}}, color={0,0,255}),Line(
|
|---|
| 4811 | points={{26,63},{26,-61}}, color={0,0,255}),Line(points={{-25.5,
|
|---|
| 4812 | 49},{-25.5,32}}, color={0,0,255}),Polygon(
|
|---|
| 4813 | lineColor={0,0,255},
|
|---|
| 4814 | fillColor={255,255,255},
|
|---|
| 4815 | fillPattern=FillPattern.Solid,
|
|---|
| 4816 | points={{26,22},{14,4},{26,-14},{38,4},{26,22}}),Line(points=
|
|---|
| 4817 | {{20,4},{32,4}}, color={0,0,255}),Polygon(lineColor={0,0,255},
|
|---|
| 4818 | points={{22,-20},{30,-20},{26,-32},{22,-20}}),Text(
|
|---|
| 4819 | lineColor={0,0,255},
|
|---|
| 4820 | extent={{-100,150},{100,110}},
|
|---|
| 4821 | textString="%name")}));
|
|---|
| 4822 | end Batt1;
|
|---|
| 4823 |
|
|---|
| 4824 | model Batt1Conn
|
|---|
| 4825 | "Modello di batteria basato su Batt0 con ordine elettrico pari a 1"
|
|---|
| 4826 | Real powDeliv "battery power (positive when delivered)";
|
|---|
| 4827 | Real SOC "State Of Charge";
|
|---|
| 4828 | parameter Modelica.SIunits.ElectricCharge QCellNom(min=0) = 10*3.6e3
|
|---|
| 4829 | "Nominal admissible electric charge per cell"
|
|---|
| 4830 | annotation (Dialog(tab="cell data"));
|
|---|
| 4831 | parameter Modelica.SIunits.Voltage ECellMin(min=0) = 3.3
|
|---|
| 4832 | "Minimum open source voltage per cell"
|
|---|
| 4833 | annotation (Dialog(tab="cell data"));
|
|---|
| 4834 | parameter Modelica.SIunits.Voltage ECellMax(min=0.0001) = 4.15
|
|---|
| 4835 | "Maximum open source voltage per cell"
|
|---|
| 4836 | annotation (Dialog(tab="cell data"));
|
|---|
| 4837 | parameter Real SOCMin(
|
|---|
| 4838 | min=0,
|
|---|
| 4839 | max=1) = 0 "Minimum state of charge"
|
|---|
| 4840 | annotation (Dialog(group="SOC parameters"));
|
|---|
| 4841 | parameter Real SOCMax(
|
|---|
| 4842 | min=0,
|
|---|
| 4843 | max=1) = 1 "Maximum state of charge"
|
|---|
| 4844 | annotation (Dialog(group="SOC parameters"));
|
|---|
| 4845 | parameter Real SOCInit(
|
|---|
| 4846 | min=0,
|
|---|
| 4847 | max=1) = 0.5 "Initial state of charge"
|
|---|
| 4848 | annotation (Dialog(group="SOC parameters"));
|
|---|
| 4849 | parameter Modelica.SIunits.Current ICellMax(min=0) = 10*QCellNom/3.6e3
|
|---|
| 4850 | "Maximum admissible current" annotation (Dialog(tab="cell data"));
|
|---|
| 4851 | parameter Modelica.SIunits.Resistance R0Cell(min=0) = 0.05*ECellMax/
|
|---|
| 4852 | ICellMax "Series resistance \"R0\"" annotation (Dialog(tab="cell data",
|
|---|
| 4853 | group="Electric circuit parameters"));
|
|---|
| 4854 | parameter Modelica.SIunits.Resistance R1Cell(min=0) = R0Cell
|
|---|
| 4855 | "Series resistance \"R1\"" annotation (Dialog(tab="cell data", group=
|
|---|
| 4856 | "Electric circuit parameters"));
|
|---|
| 4857 | parameter Modelica.SIunits.Capacitance C1Cell(min=0) = 60/R1Cell
|
|---|
| 4858 | "Capacitance in parallel with R1" annotation (Dialog(tab="cell data",
|
|---|
| 4859 | group="Electric circuit parameters"));
|
|---|
| 4860 | parameter Real efficiency(
|
|---|
| 4861 | min=0,
|
|---|
| 4862 | max=0.9999) = 0.85 "Overall charging/discharging energy efficiency"
|
|---|
| 4863 | annotation (Dialog(group="Parameters related to losses"));
|
|---|
| 4864 | parameter Modelica.SIunits.Current iCellEfficiency(min=0) = 0.5*ICellMax
|
|---|
| 4865 | "Cell charging/discharging current the efficiency refers to"
|
|---|
| 4866 | annotation (Dialog(group="Parameters related to losses"));
|
|---|
| 4867 | parameter Integer ns=1 "Number of serial connected cells"
|
|---|
| 4868 | annotation (Dialog(tab="package data", group="Size of the package"));
|
|---|
| 4869 | parameter Integer np=1 "Number of parallel connected cells"
|
|---|
| 4870 | annotation (Dialog(tab="package data", group="Size of the package"));
|
|---|
| 4871 | // determine fraction of drain current with respect to the total package current
|
|---|
| 4872 | Modelica.Electrical.Analog.Basic.Capacitor cBattery(final C=CBattery)
|
|---|
| 4873 | annotation (Placement(transformation(
|
|---|
| 4874 | origin={-60,0},
|
|---|
| 4875 | extent={{-10,-10},{10,10}},
|
|---|
| 4876 | rotation=270)));
|
|---|
| 4877 | Modelica.Electrical.Analog.Basic.Resistor R0(final R=R0Battery)
|
|---|
| 4878 | annotation (Placement(transformation(
|
|---|
| 4879 | origin={20,60},
|
|---|
| 4880 | extent={{-10,-10},{10,10}},
|
|---|
| 4881 | rotation=180)));
|
|---|
| 4882 | Modelica.Electrical.Analog.Sources.SignalCurrent strayCurrent annotation
|
|---|
| 4883 | (Placement(transformation(
|
|---|
| 4884 | origin={-6,0},
|
|---|
| 4885 | extent={{-10,-10},{10,10}},
|
|---|
| 4886 | rotation=270)));
|
|---|
| 4887 | Modelica.Electrical.Analog.Interfaces.Pin p annotation (Placement(
|
|---|
| 4888 | transformation(extent={{90,50},{110,70}}), iconTransformation(
|
|---|
| 4889 | extent={{90,52},{110,72}})));
|
|---|
| 4890 | Modelica.Electrical.Analog.Interfaces.NegativePin n annotation (Placement(
|
|---|
| 4891 | transformation(extent={{90,-70},{110,-50}}), iconTransformation(
|
|---|
| 4892 | extent={{91,-70},{111,-50}})));
|
|---|
| 4893 | Modelica.Electrical.Analog.Basic.Capacitor C1(C=C1Battery) annotation (
|
|---|
| 4894 | Placement(transformation(
|
|---|
| 4895 | extent={{-10,-10},{10,10}},
|
|---|
| 4896 | rotation=180,
|
|---|
| 4897 | origin={-37,50})));
|
|---|
| 4898 | SupportModels.Conn conn annotation (Placement(transformation(
|
|---|
| 4899 | extent={{-20,-20},{20,20}},
|
|---|
| 4900 | rotation=90,
|
|---|
| 4901 | origin={-100,-2})));
|
|---|
| 4902 | Modelica.Blocks.Sources.RealExpression SOCs(y=SOC) annotation (Placement(
|
|---|
| 4903 | transformation(
|
|---|
| 4904 | extent={{-10,-10},{10,10}},
|
|---|
| 4905 | rotation=-90,
|
|---|
| 4906 | origin={-80,30})));
|
|---|
| 4907 | Modelica.Blocks.Sources.RealExpression outPow(y=(p.v - n.v)*n.i)
|
|---|
| 4908 | annotation (Placement(transformation(
|
|---|
| 4909 | extent={{10,-10},{-10,10}},
|
|---|
| 4910 | rotation=-90,
|
|---|
| 4911 | origin={-80,-26})));
|
|---|
| 4912 | Modelica.Electrical.Analog.Basic.Resistor R1(final R=R1Battery)
|
|---|
| 4913 | annotation (Placement(visible=true, transformation(
|
|---|
| 4914 | origin={-37,72},
|
|---|
| 4915 | extent={{-10,-10},{10,10}},
|
|---|
| 4916 | rotation=180)));
|
|---|
| 4917 | protected
|
|---|
| 4918 | parameter Real k=((1 - efficiency)*(eBattMax + eBattMin) - 2*(1 +
|
|---|
| 4919 | efficiency)*Rtot*iCellEfficiency)/((1 + efficiency)*(eBattMax +
|
|---|
| 4920 | eBattMin) - 2*(1 - efficiency)*Rtot*iCellEfficiency);
|
|---|
| 4921 | parameter Real efficiencyMax=(eBattMin + eBattMax - 2*Rtot*
|
|---|
| 4922 | iCellEfficiency)/(eBattMin + eBattMax + 2*Rtot*iCellEfficiency);
|
|---|
| 4923 | final parameter Modelica.SIunits.Capacitance C=QCellNom/(ECellMax -
|
|---|
| 4924 | ECellMin) "Cell capacitance";
|
|---|
| 4925 | parameter Modelica.SIunits.Current IBatteryMax=ICellMax*np
|
|---|
| 4926 | "Maximum battery current";
|
|---|
| 4927 | parameter Modelica.SIunits.Voltage eBattMin=ECellMin*ns
|
|---|
| 4928 | "Minimum battery voltage";
|
|---|
| 4929 | parameter Modelica.SIunits.Voltage eBattMax=ECellMax*ns
|
|---|
| 4930 | "Maximum battery voltage";
|
|---|
| 4931 | parameter Modelica.SIunits.ElectricCharge QBatteryNominal=QCellNom*np
|
|---|
| 4932 | "Battery admissible electric charge";
|
|---|
| 4933 | parameter Modelica.SIunits.Capacitance CBattery=C*np/ns
|
|---|
| 4934 | "Battery capacitance";
|
|---|
| 4935 | parameter Modelica.SIunits.Resistance R0Battery=R0Cell*ns/np
|
|---|
| 4936 | "Series inner resistance R0 of cell package";
|
|---|
| 4937 | parameter Modelica.SIunits.Resistance R1Battery=R1Cell*ns/np
|
|---|
| 4938 | "Series inner resistance R1 of cell package";
|
|---|
| 4939 | parameter Modelica.SIunits.Resistance Rtot=R0Battery + R1Battery;
|
|---|
| 4940 | parameter Modelica.SIunits.Capacitance C1Battery=C1Cell*np/ns
|
|---|
| 4941 | "Battery series inner capacitance C1";
|
|---|
| 4942 | Modelica.SIunits.Voltage ECell "Cell e.m.f.";
|
|---|
| 4943 | Modelica.SIunits.Current iCellStray "Cell stray current";
|
|---|
| 4944 | Modelica.SIunits.Voltage eBatt(start=eBattMin + SOCInit*(eBattMax -
|
|---|
| 4945 | eBattMin), fixed=true) "Battery e.m.f.";
|
|---|
| 4946 | Modelica.SIunits.Current iBatteryStray "Cell parasitic current";
|
|---|
| 4947 | Modelica.Electrical.Analog.Sensors.CurrentSensor currentSensor
|
|---|
| 4948 | annotation (Placement(transformation(extent={{70,50},{90,70}}, rotation
|
|---|
| 4949 | =0)));
|
|---|
| 4950 | Modelica.Blocks.Math.Gain gain(k=k) annotation (Placement(transformation(
|
|---|
| 4951 | origin={60,0},
|
|---|
| 4952 | extent={{-10,-10},{10,10}},
|
|---|
| 4953 | rotation=180)));
|
|---|
| 4954 | Modelica.Blocks.Math.Abs absolute annotation (Placement(transformation(
|
|---|
| 4955 | extent={{34,-10},{14,10}}, rotation=0)));
|
|---|
| 4956 | equation
|
|---|
| 4957 | connect(R1.p, R0.n) annotation (Line(points={{-27,72},{-18,72},{-18,60},{
|
|---|
| 4958 | 10,60}}, color={0,0,255}));
|
|---|
| 4959 | connect(R1.p, C1.p) annotation (Line(points={{-27,72},{-18,72},{-18,50},{
|
|---|
| 4960 | -27,50}}, color={0,0,255}));
|
|---|
| 4961 | connect(R1.n, cBattery.p) annotation (Line(points={{-47,72},{-60,72},{-60,
|
|---|
| 4962 | 10}}, color={0,0,255}));
|
|---|
| 4963 | assert(SOCMin >= 0, "SOCMin must be greater than, or equal to 0");
|
|---|
| 4964 | assert(SOCMax <= 1, "SOCMax must be smaller than, or equal to 1");
|
|---|
| 4965 | assert(efficiency <= efficiencyMax,
|
|---|
| 4966 | "Overall charging/discharging energy efficiency is too big with respect to the actual serial resistance (EfficiencyMax ="
|
|---|
| 4967 | + String(efficiencyMax) + ")");
|
|---|
| 4968 | assert(SOCMin < SOCMax, "SOCMax(=" + String(SOCMax) +
|
|---|
| 4969 | ") must be greater than SOCMin(=" + String(SOCMin) + ")");
|
|---|
| 4970 | assert(SOCInit >= SOCMin, "SOCInit(=" + String(SOCInit) +
|
|---|
| 4971 | ") must be greater than, or equal to SOCMin(=" + String(SOCMin) + ")");
|
|---|
| 4972 | assert(SOCInit <= SOCMax, "SOCInit(=" + String(SOCInit) +
|
|---|
| 4973 | ") must be smaller than, or equal to SOCMax(=" + String(SOCMax) + ")");
|
|---|
| 4974 | iBatteryStray = strayCurrent.i;
|
|---|
| 4975 | iCellStray = iBatteryStray/np;
|
|---|
| 4976 | eBatt = cBattery.v;
|
|---|
| 4977 | //Solo per dare maggiore chiarezza all'utente con un nome significativo
|
|---|
| 4978 | ECell = eBatt/ns;
|
|---|
| 4979 | powDeliv = (p.v - n.v)*n.i;
|
|---|
| 4980 | assert(abs(p.i/np) < ICellMax, "Battery cell current i=" + String(abs(p.i
|
|---|
| 4981 | /np)) + "\n exceeds max admissable ICellMax (=" + String(ICellMax) +
|
|---|
| 4982 | "A)");
|
|---|
| 4983 | SOC = (eBatt - eBattMin)/(eBattMax - eBattMin);
|
|---|
| 4984 | //*(SOCMax-SOCMin)+SOCMin);
|
|---|
| 4985 | assert(SOC <= SOCMax,
|
|---|
| 4986 | "Battery is fully charged: State of charge reached maximum limit (=" +
|
|---|
| 4987 | String(SOCMax) + ")");
|
|---|
| 4988 | assert(SOCMin <= SOC,
|
|---|
| 4989 | "Battery is fully discharged: State of charge reached minimum limit (="
|
|---|
| 4990 | + String(SOCMin) + ")");
|
|---|
| 4991 | connect(R0.p, currentSensor.p)
|
|---|
| 4992 | annotation (Line(points={{30,60},{70,60}}, color={0,0,255}));
|
|---|
| 4993 | connect(strayCurrent.p, R0.n)
|
|---|
| 4994 | annotation (Line(points={{-6,10},{-6,60},{10,60}}, color={0,0,255}));
|
|---|
| 4995 | connect(currentSensor.i, gain.u) annotation (Line(points={{80,50},{80,-1.46958e-015},
|
|---|
| 4996 | {72,-1.46958e-015}}, color={0,0,127}));
|
|---|
| 4997 | connect(absolute.u, gain.y) annotation (Line(points={{36,0},{39.5,0},{
|
|---|
| 4998 | 39.5,1.33227e-015},{49,1.33227e-015}}, color={0,0,127}));
|
|---|
| 4999 | connect(absolute.y, strayCurrent.i) annotation (Line(points={{13,0},{7,0},
|
|---|
| 5000 | {7,-1.28588e-015},{1,-1.28588e-015}}, color={0,0,127}));
|
|---|
| 5001 | connect(currentSensor.n, p)
|
|---|
| 5002 | annotation (Line(points={{90,60},{90,60},{100,60}}, color={0,0,255}));
|
|---|
| 5003 | connect(strayCurrent.n, n) annotation (Line(points={{-6,-10},{-6,-60},{
|
|---|
| 5004 | 100,-60}}, color={0,0,255}));
|
|---|
| 5005 | connect(n, cBattery.n) annotation (Line(points={{100,-60},{-60,-60},{-60,
|
|---|
| 5006 | -10}}, color={0,0,255}));
|
|---|
| 5007 | connect(C1.n, cBattery.p) annotation (Line(
|
|---|
| 5008 | points={{-47,50},{-60,50},{-60,10}},
|
|---|
| 5009 | color={0,0,255},
|
|---|
| 5010 | smooth=Smooth.None));
|
|---|
| 5011 | connect(conn.batSOC, SOCs.y) annotation (Line(
|
|---|
| 5012 | points={{-100,-2},{-100,8.5},{-80,8.5},{-80,19}},
|
|---|
| 5013 | color={255,204,51},
|
|---|
| 5014 | thickness=0.5,
|
|---|
| 5015 | smooth=Smooth.None), Text(
|
|---|
| 5016 | string="%first",
|
|---|
| 5017 | index=-1,
|
|---|
| 5018 | extent={{-6,3},{-6,3}}));
|
|---|
| 5019 | connect(outPow.y, conn.batPowDel) annotation (Line(
|
|---|
| 5020 | points={{-80,-15},{-80,-2},{-100,-2}},
|
|---|
| 5021 | color={0,0,127},
|
|---|
| 5022 | smooth=Smooth.None), Text(
|
|---|
| 5023 | string="%second",
|
|---|
| 5024 | index=1,
|
|---|
| 5025 | extent={{6,3},{6,3}}));
|
|---|
| 5026 | annotation (
|
|---|
| 5027 | Documentation(info="<html>
|
|---|
| 5028 | <p>Modello di batteria dotato di efficienza colombica non unitaria, secondo quanto discusso nelle dispense SEB.</p>
|
|---|
| 5029 | <p>Il ramo principaledel modello di cella presenta una f.e.m. linearmente crescente con il SOC (simulata tramite un condensatore equivalente), una resistenza R0 ed un blocco R-C.</p>
|
|---|
| 5030 | <p>La batteria è composta da np filari idi celle in parallelo, ciascuno composto da ns celle in serie.</p>
|
|---|
| 5031 | <p><br/>SEB a.a. 2012-2013.</p>
|
|---|
| 5032 | </html>", revisions="<html><table border=\"1\" rules=\"groups\">
|
|---|
| 5033 | <thead>
|
|---|
| 5034 | <tr><td>Version</td> <td>Date</td> <td>Comment</td></tr>
|
|---|
| 5035 | </thead>
|
|---|
| 5036 | <tbody>
|
|---|
| 5037 | <tr><td>1.0.0</td> <td>2006-01-12</td> <td> </td></tr>
|
|---|
| 5038 | <tr><td>1.0.3</td> <td>2006-08-31</td> <td> Improved assert statements </td></tr>
|
|---|
| 5039 | <tr><td>1.0.6</td> <td>2007-05-14</td> <td> The documentation changed slightly </td></tr>
|
|---|
| 5040 | </tbody>
|
|---|
| 5041 | </table>
|
|---|
| 5042 | </html>"),
|
|---|
| 5043 | Diagram(coordinateSystem(
|
|---|
| 5044 | extent={{-100,-80},{100,80}},
|
|---|
| 5045 | preserveAspectRatio=false,
|
|---|
| 5046 | initialScale=0.1,
|
|---|
| 5047 | grid={2,2}), graphics),
|
|---|
| 5048 | Icon(coordinateSystem(
|
|---|
| 5049 | extent={{-100,-80},{100,80}},
|
|---|
| 5050 | preserveAspectRatio=false,
|
|---|
| 5051 | initialScale=0.1,
|
|---|
| 5052 | grid={2,2}), graphics={Rectangle(
|
|---|
| 5053 | lineColor={95,95,95},
|
|---|
| 5054 | fillColor={255,255,255},
|
|---|
| 5055 | fillPattern=FillPattern.Solid,
|
|---|
| 5056 | extent={{-100,80},{80,-82}}),Line(points={{-92,6},{-52,6}},
|
|---|
| 5057 | color={0,0,255}),Rectangle(
|
|---|
| 5058 | lineColor={0,0,255},
|
|---|
| 5059 | fillColor={0,0,255},
|
|---|
| 5060 | fillPattern=FillPattern.Solid,
|
|---|
| 5061 | extent={{-82,-3},{-65,-10}}),Line(points={{-73,63},{98,64}},
|
|---|
| 5062 | color={0,0,255}),Rectangle(
|
|---|
| 5063 | lineColor={0,0,255},
|
|---|
| 5064 | fillColor={255,255,255},
|
|---|
| 5065 | fillPattern=FillPattern.Solid,
|
|---|
| 5066 | extent={{38,69},{68,57}}),Rectangle(
|
|---|
| 5067 | lineColor={0,0,255},
|
|---|
| 5068 | fillColor={255,255,255},
|
|---|
| 5069 | fillPattern=FillPattern.Solid,
|
|---|
| 5070 | extent={{-37.5,68},{-6.5,56}}),Line(points={{-19.5,49},{-19.5,
|
|---|
| 5071 | 32}}, color={0,0,255}),Line(points={{-54.5,63},{-54.5,41},{-25.5,
|
|---|
| 5072 | 41}}, color={0,0,255}),Line(points={{9.5,62},{9.5,40},{-19.5,40}},
|
|---|
| 5073 | color={0,0,255}),Line(points={{-73,63},{-73,5}}, color={0,0,255}),
|
|---|
| 5074 | Line(points={{-73,-6},{-73,-60},{96,-60}}, color={0,0,255}),Line(
|
|---|
| 5075 | points={{26,63},{26,-61}}, color={0,0,255}),Line(points={{-25.5,
|
|---|
| 5076 | 49},{-25.5,32}}, color={0,0,255}),Polygon(
|
|---|
| 5077 | lineColor={0,0,255},
|
|---|
| 5078 | fillColor={255,255,255},
|
|---|
| 5079 | fillPattern=FillPattern.Solid,
|
|---|
| 5080 | points={{26,22},{14,4},{26,-14},{38,4},{26,22}}),Line(points=
|
|---|
| 5081 | {{20,4},{32,4}}, color={0,0,255}),Polygon(lineColor={0,0,255},
|
|---|
| 5082 | points={{22,-20},{30,-20},{26,-32},{22,-20}}),Text(
|
|---|
| 5083 | origin={-4,-22},
|
|---|
| 5084 | lineColor={0,0,255},
|
|---|
| 5085 | extent={{-100,150},{100,110}},
|
|---|
| 5086 | textString="%name")}));
|
|---|
| 5087 | end Batt1Conn;
|
|---|
| 5088 |
|
|---|
| 5089 | package Internal
|
|---|
| 5090 | "Models intended to be used by other models of this package, not by the final user"
|
|---|
| 5091 | model ConstPDC "Constant Power DC Load"
|
|---|
| 5092 | parameter Real k "inner PI follower proportional gain";
|
|---|
| 5093 | parameter Modelica.SIunits.Time T
|
|---|
| 5094 | "inner PI follower integral time constant";
|
|---|
| 5095 | Real v "DC voltage";
|
|---|
| 5096 | Modelica.Blocks.Math.Feedback feedback1 annotation (Placement(visible=
|
|---|
| 5097 | true, transformation(
|
|---|
| 5098 | origin={56,-44},
|
|---|
| 5099 | extent={{-10,-10},{10,10}},
|
|---|
| 5100 | rotation=180)));
|
|---|
| 5101 | Modelica.Blocks.Continuous.PI PI(
|
|---|
| 5102 | k=k,
|
|---|
| 5103 | T=T,
|
|---|
| 5104 | initType=Modelica.Blocks.Types.Init.InitialState) annotation (
|
|---|
| 5105 | Placement(visible=true, transformation(
|
|---|
| 5106 | origin={20,-44},
|
|---|
| 5107 | extent={{-8,-8},{8,8}},
|
|---|
| 5108 | rotation=180)));
|
|---|
| 5109 | Modelica.Electrical.Analog.Interfaces.PositivePin pin_p annotation (
|
|---|
| 5110 | Placement(
|
|---|
| 5111 | visible=true,
|
|---|
| 5112 | transformation(extent={{-108,58},{-88,78}}, rotation=0),
|
|---|
| 5113 | iconTransformation(extent={{-10,90},{10,110}}, rotation=0)));
|
|---|
| 5114 | Modelica.Electrical.Analog.Interfaces.NegativePin pin_n annotation (
|
|---|
| 5115 | Placement(
|
|---|
| 5116 | visible=true,
|
|---|
| 5117 | transformation(extent={{-108,-74},{-88,-54}}, rotation=0),
|
|---|
| 5118 | iconTransformation(extent={{-10,-108},{10,-88}}, rotation=0)));
|
|---|
| 5119 | Modelica.Blocks.Interfaces.RealInput Pref "Reference power" annotation
|
|---|
| 5120 | (Placement(
|
|---|
| 5121 | visible=true,
|
|---|
| 5122 | transformation(
|
|---|
| 5123 | origin={100,-44},
|
|---|
| 5124 | extent={{-18,-18},{18,18}},
|
|---|
| 5125 | rotation=180),
|
|---|
| 5126 | iconTransformation(
|
|---|
| 5127 | origin={82,0},
|
|---|
| 5128 | extent={{-18,-18},{18,18}},
|
|---|
| 5129 | rotation=180)));
|
|---|
| 5130 | Modelica.Electrical.Analog.Sensors.PowerSensor pSensor annotation (
|
|---|
| 5131 | Placement(visible=true, transformation(extent={{-78,58},{-58,78}},
|
|---|
| 5132 | rotation=0)));
|
|---|
| 5133 | Modelica.Electrical.Analog.Sensors.VoltageSensor uSensor annotation (
|
|---|
| 5134 | Placement(visible=true, transformation(
|
|---|
| 5135 | origin={-43,15},
|
|---|
| 5136 | extent={{-9,-9},{9,9}},
|
|---|
| 5137 | rotation=270)));
|
|---|
| 5138 | Modelica.Electrical.Analog.Sources.SignalCurrent iDrawn annotation (
|
|---|
| 5139 | Placement(visible=true, transformation(
|
|---|
| 5140 | origin={-12,18},
|
|---|
| 5141 | extent={{-10,-10},{10,10}},
|
|---|
| 5142 | rotation=270)));
|
|---|
| 5143 | Modelica.Blocks.Math.Product product annotation (Placement(visible=true,
|
|---|
| 5144 | transformation(
|
|---|
| 5145 | origin={18,18},
|
|---|
| 5146 | extent={{-8,-8},{8,8}},
|
|---|
| 5147 | rotation=180)));
|
|---|
| 5148 | Inverse inverse(k=1) annotation (Placement(visible=true, transformation(
|
|---|
| 5149 | origin={10,50},
|
|---|
| 5150 | extent={{-10,-10},{10,10}},
|
|---|
| 5151 | rotation=0)));
|
|---|
| 5152 | equation
|
|---|
| 5153 | connect(PI.y, product.u1) annotation (Line(points={{11.2,-44},{2,-44},{
|
|---|
| 5154 | 2,-20},{40,-20},{40,13.2},{27.6,13.2}}, color={0,0,127}));
|
|---|
| 5155 | connect(inverse.y, product.u2) annotation (Line(points={{20.6,50},{40,
|
|---|
| 5156 | 50},{40,22.8},{27.6,22.8}}, color={0,0,127}));
|
|---|
| 5157 | connect(uSensor.v, inverse.u) annotation (Line(points={{-52,15},{-54,15},
|
|---|
| 5158 | {-54,50},{-1,50}}, color={0,0,127}));
|
|---|
| 5159 | connect(product.y, iDrawn.i)
|
|---|
| 5160 | annotation (Line(points={{9.2,18},{-5,18}}, color={0,0,127}));
|
|---|
| 5161 | connect(uSensor.n, iDrawn.n) annotation (Line(points={{-43,6},{-43,-28},
|
|---|
| 5162 | {-12,-28},{-12,8}}, color={0,0,255}));
|
|---|
| 5163 | connect(pSensor.nc, iDrawn.p) annotation (Line(points={{-58,68},{-12,68},
|
|---|
| 5164 | {-12,28}}, color={0,0,255}));
|
|---|
| 5165 | connect(iDrawn.n, pin_n) annotation (Line(points={{-12,8},{-12,-64},{-98,
|
|---|
| 5166 | -64}}, color={0,0,255}));
|
|---|
| 5167 | connect(uSensor.p, pSensor.nc) annotation (Line(points={{-43,24},{-43,
|
|---|
| 5168 | 68},{-58,68}}, color={0,0,255}));
|
|---|
| 5169 | connect(feedback1.u2, pSensor.power) annotation (Line(points={{56,-36},
|
|---|
| 5170 | {56,-8},{-76,-8},{-76,57}}, color={0,0,127}));
|
|---|
| 5171 | connect(pSensor.nv, pin_n) annotation (Line(points={{-68,58},{-68,-64},
|
|---|
| 5172 | {-98,-64}}, color={0,0,255}));
|
|---|
| 5173 | connect(feedback1.u1, Pref)
|
|---|
| 5174 | annotation (Line(points={{64,-44},{100,-44}}, color={0,0,127}));
|
|---|
| 5175 | connect(iDrawn.n, pin_n) annotation (Line(points={{-12,8},{-12,-64},{-98,
|
|---|
| 5176 | -64}}, color={0,0,255}));
|
|---|
| 5177 | connect(pSensor.nv, pin_n) annotation (Line(points={{-68,58},{-68,-64},
|
|---|
| 5178 | {-98,-64}}, color={0,0,255}));
|
|---|
| 5179 | connect(feedback1.u2, pSensor.power) annotation (Line(points={{56,-36},
|
|---|
| 5180 | {56,-8},{-76,-8},{-76,57}}, color={0,0,127}));
|
|---|
| 5181 | connect(uSensor.n, iDrawn.n) annotation (Line(points={{-43,6},{-43,-28},
|
|---|
| 5182 | {-12,-28},{-12,8}}, color={0,0,255}));
|
|---|
| 5183 | connect(uSensor.v, inverse.u) annotation (Line(points={{-52,15},{-54,15},
|
|---|
| 5184 | {-54,50},{-1,50}}, color={0,0,127}));
|
|---|
| 5185 | connect(feedback1.y, PI.u)
|
|---|
| 5186 | annotation (Line(points={{47,-44},{29.6,-44}}, color={0,0,127}));
|
|---|
| 5187 | v = pin_p.v - pin_n.v;
|
|---|
| 5188 | connect(pSensor.pc, pin_p) annotation (Line(
|
|---|
| 5189 | points={{-78,68},{-98,68}},
|
|---|
| 5190 | color={0,0,255},
|
|---|
| 5191 | smooth=Smooth.None));
|
|---|
| 5192 | connect(pSensor.pv, pSensor.pc) annotation (Line(
|
|---|
| 5193 | points={{-68,78},{-78,78},{-78,68}},
|
|---|
| 5194 | color={0,0,255},
|
|---|
| 5195 | smooth=Smooth.None));
|
|---|
| 5196 | annotation (
|
|---|
| 5197 | Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
|
|---|
| 5198 | {100,100}}), graphics),
|
|---|
| 5199 | Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{
|
|---|
| 5200 | 100,100}}), graphics={Line(
|
|---|
| 5201 | points={{-4,0},{70,0}},
|
|---|
| 5202 | color={0,0,0},
|
|---|
| 5203 | smooth=Smooth.None),Line(
|
|---|
| 5204 | points={{0,94},{0,-88},{-2,-90}},
|
|---|
| 5205 | color={0,0,255},
|
|---|
| 5206 | smooth=Smooth.None),Rectangle(
|
|---|
| 5207 | extent={{-28,68},{28,-52}},
|
|---|
| 5208 | lineColor={0,0,255},
|
|---|
| 5209 | fillColor={255,255,255},
|
|---|
| 5210 | fillPattern=FillPattern.Solid),Text(
|
|---|
| 5211 | extent={{42,58},{78,22}},
|
|---|
| 5212 | lineColor={255,0,0},
|
|---|
| 5213 | fillColor={255,255,255},
|
|---|
| 5214 | fillPattern=FillPattern.Solid,
|
|---|
| 5215 | textString="P")}),
|
|---|
| 5216 | Documentation(info="<html>
|
|---|
| 5217 | <p>Questo componente simula, mediante inseguimento di un riferimento esterno, un carico a potenza costante.</p>
|
|---|
| 5218 | <p>I parametri k e T sono i parametri del regolatore PI che insegue l'input. TIpicamente si potrà utilizzare k=1 e T di un ordine di grandezza più piccolo delle costanti di tempo del segnale di ingresso di potenza</p>
|
|---|
| 5219 | </html>"));
|
|---|
| 5220 | end ConstPDC;
|
|---|
| 5221 |
|
|---|
| 5222 | block Inverse "Outputs the inverse of (input multiplied by k)"
|
|---|
| 5223 | import Modelica.Constants.inf;
|
|---|
| 5224 | import Modelica.Constants.eps;
|
|---|
| 5225 | Modelica.Blocks.Interfaces.RealInput u annotation (Placement(
|
|---|
| 5226 | transformation(extent={{-128,-20},{-88,20}}), iconTransformation(
|
|---|
| 5227 | extent={{-128,-18},{-92,18}})));
|
|---|
| 5228 | Modelica.Blocks.Interfaces.RealOutput y annotation (Placement(
|
|---|
| 5229 | transformation(extent={{98,-10},{118,10}}), iconTransformation(
|
|---|
| 5230 | extent={{96,-10},{116,10}})));
|
|---|
| 5231 | parameter Real k;
|
|---|
| 5232 | equation
|
|---|
| 5233 | if abs(u) < eps then
|
|---|
| 5234 | y = inf;
|
|---|
| 5235 | else
|
|---|
| 5236 | y = 1.0/(k*u);
|
|---|
| 5237 | end if;
|
|---|
| 5238 | annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={
|
|---|
| 5239 | {-100,-100},{100,100}}), graphics), Icon(coordinateSystem(
|
|---|
| 5240 | preserveAspectRatio=true, extent={{-100,-100},{100,100}}),
|
|---|
| 5241 | graphics={Rectangle(
|
|---|
| 5242 | extent={{-100,100},{100,-100}},
|
|---|
| 5243 | lineColor={0,0,127},
|
|---|
| 5244 | fillPattern=FillPattern.Solid,
|
|---|
| 5245 | fillColor={255,255,255}),Text(
|
|---|
| 5246 | extent={{-10,-4},{60,52}},
|
|---|
| 5247 | lineColor={0,0,127},
|
|---|
| 5248 | textString="1"),Text(
|
|---|
| 5249 | extent={{-32,0},{76,-46}},
|
|---|
| 5250 | lineColor={0,0,127},
|
|---|
| 5251 | textString="k u"),Line(
|
|---|
| 5252 | points={{-14,0},{66,0}},
|
|---|
| 5253 | color={0,0,127},
|
|---|
| 5254 | smooth=Smooth.None),Text(
|
|---|
| 5255 | extent={{-86,-30},{-16,26}},
|
|---|
| 5256 | lineColor={0,0,127},
|
|---|
| 5257 | textString="y=")}));
|
|---|
| 5258 | end Inverse;
|
|---|
| 5259 |
|
|---|
| 5260 | model Inverter
|
|---|
| 5261 | Modelica.Blocks.Interfaces.RealInput u
|
|---|
| 5262 | annotation (Placement(transformation(extent={{140,-20},{100,20}})));
|
|---|
| 5263 | Modelica.Blocks.Interfaces.RealOutput y
|
|---|
| 5264 | annotation (Placement(transformation(extent={{-100,-10},{-120,10}})));
|
|---|
| 5265 | Modelica.Blocks.Math.Gain gain(k=LossFact)
|
|---|
| 5266 | annotation (Placement(transformation(extent={{10,-10},{-10,10}})));
|
|---|
| 5267 | parameter Real LossFact=4 "Loss Factor (W per AC Arms)";
|
|---|
| 5268 | equation
|
|---|
| 5269 | connect(gain.u, u) annotation (Line(
|
|---|
| 5270 | points={{12,0},{120,0}},
|
|---|
| 5271 | color={0,0,127},
|
|---|
| 5272 | smooth=Smooth.None));
|
|---|
| 5273 | connect(gain.y, y) annotation (Line(
|
|---|
| 5274 | points={{-11,0},{-110,0}},
|
|---|
| 5275 | color={0,0,127},
|
|---|
| 5276 | smooth=Smooth.None));
|
|---|
| 5277 | annotation (Diagram(coordinateSystem(extent={{-100,-100},{100,100}},
|
|---|
| 5278 | preserveAspectRatio=false), graphics), Icon(coordinateSystem(
|
|---|
| 5279 | extent={{-100,-100},{100,100}},
|
|---|
| 5280 | preserveAspectRatio=false,
|
|---|
| 5281 | initialScale=0.1,
|
|---|
| 5282 | grid={2,2}), graphics={Rectangle(
|
|---|
| 5283 | lineColor={0,0,127},
|
|---|
| 5284 | fillColor={255,255,255},
|
|---|
| 5285 | fillPattern=FillPattern.Solid,
|
|---|
| 5286 | extent={{-100,60},{100,-60}}),Text(
|
|---|
| 5287 | origin={0,4},
|
|---|
| 5288 | lineColor={0,0,255},
|
|---|
| 5289 | fillColor={255,255,255},
|
|---|
| 5290 | fillPattern=FillPattern.Solid,
|
|---|
| 5291 | extent={{-100,102},{100,62}},
|
|---|
| 5292 | textString="%name")}));
|
|---|
| 5293 | end Inverter;
|
|---|
| 5294 | end Internal;
|
|---|
| 5295 |
|
|---|
| 5296 | model PTrifSensor "Two port three-phase power"
|
|---|
| 5297 | protected
|
|---|
| 5298 | Modelica.Electrical.MultiPhase.Sensors.PowerSensor powerSensor
|
|---|
| 5299 | annotation (Placement(transformation(extent={{-12,10},{8,30}})));
|
|---|
| 5300 | Modelica.Electrical.MultiPhase.Basic.Star star annotation (Placement(
|
|---|
| 5301 | transformation(
|
|---|
| 5302 | extent={{-10,-10},{10,10}},
|
|---|
| 5303 | rotation=270,
|
|---|
| 5304 | origin={-2,-18})));
|
|---|
| 5305 | Modelica.Electrical.Analog.Basic.Ground ground
|
|---|
| 5306 | annotation (Placement(transformation(extent={{-12,-60},{8,-40}})));
|
|---|
| 5307 | public
|
|---|
| 5308 | Modelica.Electrical.MultiPhase.Interfaces.PositivePlug pc
|
|---|
| 5309 | "Positive plug, current path" annotation (Placement(transformation(
|
|---|
| 5310 | extent={{-110,10},{-90,30}}), iconTransformation(extent={{-110,-10},
|
|---|
| 5311 | {-90,10}})));
|
|---|
| 5312 | Modelica.Electrical.MultiPhase.Interfaces.NegativePlug nc(final m=3)
|
|---|
| 5313 | "Negative plug, current path" annotation (Placement(transformation(
|
|---|
| 5314 | extent={{90,30},{110,10}}, rotation=0), iconTransformation(extent
|
|---|
| 5315 | ={{90,10},{110,-10}})));
|
|---|
| 5316 | Modelica.Blocks.Interfaces.RealOutput Power(final unit="W") annotation (
|
|---|
| 5317 | Placement(transformation(
|
|---|
| 5318 | extent={{-10,-10},{10,10}},
|
|---|
| 5319 | rotation=270,
|
|---|
| 5320 | origin={-20,-110})));
|
|---|
| 5321 | equation
|
|---|
| 5322 | connect(star.plug_p, powerSensor.nv) annotation (Line(
|
|---|
| 5323 | points={{-2,-8},{-2,0},{-2,10},{-2,10}},
|
|---|
| 5324 | color={0,0,255},
|
|---|
| 5325 | smooth=Smooth.None));
|
|---|
| 5326 | connect(ground.p, star.pin_n) annotation (Line(
|
|---|
| 5327 | points={{-2,-40},{-2,-34},{-2,-28},{-2,-28}},
|
|---|
| 5328 | color={0,0,255},
|
|---|
| 5329 | smooth=Smooth.None));
|
|---|
| 5330 | connect(powerSensor.pc, pc) annotation (Line(
|
|---|
| 5331 | points={{-12,20},{-100,20}},
|
|---|
| 5332 | color={0,0,255},
|
|---|
| 5333 | smooth=Smooth.None));
|
|---|
| 5334 | connect(powerSensor.pv, powerSensor.pc) annotation (Line(
|
|---|
| 5335 | points={{-2,30},{-2,48},{-12,48},{-12,20}},
|
|---|
| 5336 | color={0,0,255},
|
|---|
| 5337 | smooth=Smooth.None));
|
|---|
| 5338 | connect(powerSensor.nc, nc) annotation (Line(
|
|---|
| 5339 | points={{8,20},{100,20}},
|
|---|
| 5340 | color={0,0,255},
|
|---|
| 5341 | smooth=Smooth.None));
|
|---|
| 5342 | connect(Power, powerSensor.power) annotation (Line(
|
|---|
| 5343 | points={{-20,-110},{-20,9},{-10,9}},
|
|---|
| 5344 | color={0,0,127},
|
|---|
| 5345 | smooth=Smooth.None));
|
|---|
| 5346 | annotation (
|
|---|
| 5347 | Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},
|
|---|
| 5348 | {100,100}}), graphics),
|
|---|
| 5349 | Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{
|
|---|
| 5350 | 100,100}}), graphics={Line(points={{-104,0},{96,0}}, color={0,0,
|
|---|
| 5351 | 255}),Ellipse(
|
|---|
| 5352 | extent={{-70,70},{70,-70}},
|
|---|
| 5353 | lineColor={0,0,0},
|
|---|
| 5354 | fillColor={255,255,255},
|
|---|
| 5355 | fillPattern=FillPattern.Solid),Line(points={{0,70},{0,40}},
|
|---|
| 5356 | color={0,0,0}),Line(points={{22.9,32.8},{40.2,57.3}}, color={0,0,
|
|---|
| 5357 | 0}),Line(points={{-22.9,32.8},{-40.2,57.3}}, color={0,0,0}),Line(
|
|---|
| 5358 | points={{37.6,13.7},{65.8,23.9}}, color={0,0,0}),Line(points={{-37.6,
|
|---|
| 5359 | 13.7},{-65.8,23.9}}, color={0,0,0}),Line(points={{0,0},{9.02,28.6}},
|
|---|
| 5360 | color={0,0,0}),Polygon(
|
|---|
| 5361 | points={{-0.48,31.6},{18,26},{18,57.2},{-0.48,31.6}},
|
|---|
| 5362 | lineColor={0,0,0},
|
|---|
| 5363 | fillColor={0,0,0},
|
|---|
| 5364 | fillPattern=FillPattern.Solid),Ellipse(
|
|---|
| 5365 | extent={{-5,5},{5,-5}},
|
|---|
| 5366 | lineColor={0,0,0},
|
|---|
| 5367 | fillColor={0,0,0},
|
|---|
| 5368 | fillPattern=FillPattern.Solid),Text(
|
|---|
| 5369 | extent={{-39,-3},{40,-66}},
|
|---|
| 5370 | lineColor={0,0,0},
|
|---|
| 5371 | textString="P3"),Line(
|
|---|
| 5372 | points={{-20,-104},{-20,-66}},
|
|---|
| 5373 | color={0,0,127},
|
|---|
| 5374 | smooth=Smooth.None),Text(
|
|---|
| 5375 | origin={0,24},
|
|---|
| 5376 | lineColor={0,0,255},
|
|---|
| 5377 | fillColor={255,255,255},
|
|---|
| 5378 | fillPattern=FillPattern.Solid,
|
|---|
| 5379 | extent={{-100,102},{100,62}},
|
|---|
| 5380 | textString="%name")}),
|
|---|
| 5381 | Documentation(info="<html>
|
|---|
| 5382 | <p>MODELLO OBSOLETO!</p>
|
|---|
| 5383 | <p>Esso era stato introdotto per generare una misura di potenza con un componente a due sole porte trifasi, invece che le quattro porte del modello PowerSensor di Modelica</p>
|
|---|
| 5384 | <p>Si è poi visto che ha il difetto di avere troppe equazioni (121 contro 98 di PowerSensor di Modelica)</p>
|
|---|
| 5385 | <p>Infine è stato creato Aron, che ha solo due poorte trifasi e soltanto 13 equazioni.</p>
|
|---|
| 5386 | <p>PER TUTTI I NUOVI MODELLI OCCORRE QUINDI USARE ARON.</p>
|
|---|
| 5387 | </html>"));
|
|---|
| 5388 | end PTrifSensor;
|
|---|
| 5389 |
|
|---|
| 5390 | model DriveLosses "computes drive losses : joule and inverter"
|
|---|
| 5391 | parameter Real Rs=0.03 "stator resistance";
|
|---|
| 5392 | parameter Real Kv=4 "inverter los constant, W/A";
|
|---|
| 5393 | Modelica.Blocks.Interfaces.RealInput Is
|
|---|
| 5394 | annotation (Placement(transformation(extent={{-128,-20},{-88,20}})));
|
|---|
| 5395 | Modelica.Blocks.Interfaces.RealOutput losses
|
|---|
| 5396 | annotation (Placement(transformation(extent={{94,-10},{114,10}})));
|
|---|
| 5397 | equation
|
|---|
| 5398 | losses = 3*Rs*Is^2 + Kv*Is;
|
|---|
| 5399 | annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{
|
|---|
| 5400 | -100,-100},{100,100}}), graphics), Icon(coordinateSystem(
|
|---|
| 5401 | preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
|
|---|
| 5402 | graphics={Rectangle(
|
|---|
| 5403 | extent={{-100,100},{100,-100}},
|
|---|
| 5404 | lineColor={0,0,255},
|
|---|
| 5405 | fillColor={255,255,255},
|
|---|
| 5406 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5407 | points={{-20,-20},{20,-20},{20,-60},{40,-60},{0,-100},{-40,-60},
|
|---|
| 5408 | {-20,-60},{-20,-20}},
|
|---|
| 5409 | lineColor={0,0,0},
|
|---|
| 5410 | smooth=Smooth.None,
|
|---|
| 5411 | fillColor={255,0,0},
|
|---|
| 5412 | fillPattern=FillPattern.Solid),Text(
|
|---|
| 5413 | extent={{-100,75},{100,35}},
|
|---|
| 5414 | lineColor={0,0,127},
|
|---|
| 5415 | fillColor={255,0,0},
|
|---|
| 5416 | fillPattern=FillPattern.Solid,
|
|---|
| 5417 | textString="%name")}));
|
|---|
| 5418 | end DriveLosses;
|
|---|
| 5419 |
|
|---|
| 5420 | model PmsmAllFluxLimI "adds current control to AllFlux"
|
|---|
| 5421 | parameter Real Rs=0.02 "stator resistance (ohm)";
|
|---|
| 5422 | parameter Real Ipm=1.5 "PM equivalent current (=psi/Ld)";
|
|---|
| 5423 | parameter Integer pp=1 "pole pairs";
|
|---|
| 5424 | parameter Real Ld=0.4 "direct-axis inductance (H)", Lq=1.1
|
|---|
| 5425 | "quadrature axis inductance (H)";
|
|---|
| 5426 | parameter Real Inom=1 "nominal current (rms per phase)";
|
|---|
| 5427 | parameter Real Unom=1 "nominal voltage (rms per phase)";
|
|---|
| 5428 | protected
|
|---|
| 5429 | parameter Real K=5000/(1.5*Ipm*pp) "Current loop gain (Nm/A)";
|
|---|
| 5430 | parameter Real IpmEff=Ipm/sqrt(2);
|
|---|
| 5431 | public
|
|---|
| 5432 | parameter Real wElBase(fixed=false, start=100), gammaBase(fixed=false,
|
|---|
| 5433 | start=0);
|
|---|
| 5434 | public
|
|---|
| 5435 | Modelica.Blocks.Math.Feedback feedback1(u1(start=0)) annotation (
|
|---|
| 5436 | Placement(visible=true, transformation(
|
|---|
| 5437 | origin={26,20},
|
|---|
| 5438 | extent={{-10,-10},{10,10}},
|
|---|
| 5439 | rotation=0)));
|
|---|
| 5440 | Modelica.Blocks.Sources.Constant Inom_(k=Inom) annotation (Placement(
|
|---|
| 5441 | visible=true, transformation(
|
|---|
| 5442 | origin={26,-4},
|
|---|
| 5443 | extent={{10,-10},{-10,10}},
|
|---|
| 5444 | rotation=-90)));
|
|---|
| 5445 | Modelica.Blocks.Math.Add add1(k1=-1) annotation (Placement(visible=true,
|
|---|
| 5446 | transformation(
|
|---|
| 5447 | origin={-40,36},
|
|---|
| 5448 | extent={{-10,-10},{10,10}},
|
|---|
| 5449 | rotation=-90)));
|
|---|
| 5450 | Modelica.Blocks.Nonlinear.Limiter limiter1(uMax=1e99, uMin=0) annotation
|
|---|
| 5451 | (Placement(visible=true, transformation(
|
|---|
| 5452 | origin={-4,58},
|
|---|
| 5453 | extent={{10,-10},{-10,10}},
|
|---|
| 5454 | rotation=0)));
|
|---|
| 5455 | AtomicPmsm atomicPmsm(
|
|---|
| 5456 | Ipm=Ipm,
|
|---|
| 5457 | pp=pp,
|
|---|
| 5458 | Rs=Rs,
|
|---|
| 5459 | Ld=Ld,
|
|---|
| 5460 | Lq=Lq,
|
|---|
| 5461 | gamma(fixed=false, start=0),
|
|---|
| 5462 | Unom=Unom)
|
|---|
| 5463 | annotation (Placement(transformation(extent={{-26,-60},{-6,-40}})));
|
|---|
| 5464 | Modelica.Blocks.Interfaces.RealInput tauRef
|
|---|
| 5465 | annotation (Placement(transformation(extent={{-128,40},{-88,80}})));
|
|---|
| 5466 | Modelica.Blocks.Interfaces.RealInput wMechanical
|
|---|
| 5467 | annotation (Placement(transformation(extent={{-130,-80},{-90,-40}})));
|
|---|
| 5468 | Modelica.Blocks.Interfaces.RealOutput tauElectrical
|
|---|
| 5469 | annotation (Placement(transformation(extent={{98,-70},{118,-50}})));
|
|---|
| 5470 | Modelica.Blocks.Continuous.FirstOrder firstOrder(T=0.01, k=K)
|
|---|
| 5471 | annotation (Placement(transformation(extent={{50,48},{30,68}})));
|
|---|
| 5472 | Modelica.Blocks.Interfaces.RealOutput Is
|
|---|
| 5473 | annotation (Placement(transformation(extent={{96,50},{116,70}})));
|
|---|
| 5474 | Modelica.Blocks.Interfaces.RealInput uDC
|
|---|
| 5475 | annotation (Placement(transformation(extent={{-130,-20},{-90,20}})));
|
|---|
| 5476 | Modelica.Blocks.Continuous.FirstOrder firstOrder1(T=0.01, k=1)
|
|---|
| 5477 | annotation (Placement(transformation(extent={{-76,50},{-56,70}})));
|
|---|
| 5478 | initial equation
|
|---|
| 5479 | //le seguenti equazioni determinano wElBase e gammaBase
|
|---|
| 5480 | Unom^2 = wElBase^2*((Ld*(IpmEff - Inom)*sin(gammaBase))^2 + (Lq*Inom*cos(
|
|---|
| 5481 | gammaBase))^2);
|
|---|
| 5482 | 0 = (-Ld*IpmEff*sin(gammaBase)) + (Lq - Ld)*Inom*cos(2*gammaBase);
|
|---|
| 5483 |
|
|---|
| 5484 | equation
|
|---|
| 5485 | connect(limiter1.y, add1.u1) annotation (Line(points={{-15,58},{-34,58},{
|
|---|
| 5486 | -34,48}}, color={0,0,127}));
|
|---|
| 5487 | connect(Inom_.y, feedback1.u2)
|
|---|
| 5488 | annotation (Line(points={{26,7},{26,7},{26,12}}, color={0,0,127}));
|
|---|
| 5489 | connect(atomicPmsm.wMechanical, wMechanical) annotation (Line(
|
|---|
| 5490 | points={{-26.8,-56},{-60,-56},{-60,-60},{-110,-60}},
|
|---|
| 5491 | color={0,0,127},
|
|---|
| 5492 | smooth=Smooth.None));
|
|---|
| 5493 | connect(atomicPmsm.Is, feedback1.u1) annotation (Line(
|
|---|
| 5494 | points={{-5.2,-44},{6,-44},{6,20},{18,20}},
|
|---|
| 5495 | color={0,0,127},
|
|---|
| 5496 | smooth=Smooth.None));
|
|---|
| 5497 | connect(atomicPmsm.tauElectrical, tauElectrical) annotation (Line(
|
|---|
| 5498 | points={{-5.2,-56},{52,-56},{52,-60},{108,-60}},
|
|---|
| 5499 | color={0,0,127},
|
|---|
| 5500 | smooth=Smooth.None));
|
|---|
| 5501 | connect(limiter1.u, firstOrder.y) annotation (Line(
|
|---|
| 5502 | points={{8,58},{29,58}},
|
|---|
| 5503 | color={0,0,127},
|
|---|
| 5504 | smooth=Smooth.None));
|
|---|
| 5505 | connect(firstOrder.u, feedback1.y) annotation (Line(
|
|---|
| 5506 | points={{52,58},{68,58},{68,20},{35,20}},
|
|---|
| 5507 | color={0,0,127},
|
|---|
| 5508 | smooth=Smooth.None));
|
|---|
| 5509 | connect(Is, feedback1.u1) annotation (Line(
|
|---|
| 5510 | points={{106,60},{80,60},{80,-44},{6,-44},{6,20},{18,20}},
|
|---|
| 5511 | color={0,0,127},
|
|---|
| 5512 | smooth=Smooth.None));
|
|---|
| 5513 | connect(atomicPmsm.uDC, uDC) annotation (Line(
|
|---|
| 5514 | points={{-27,-50},{-74,-50},{-74,0},{-110,0}},
|
|---|
| 5515 | color={0,0,127},
|
|---|
| 5516 | smooth=Smooth.None));
|
|---|
| 5517 | connect(add1.y, atomicPmsm.torqueReq) annotation (Line(
|
|---|
| 5518 | points={{-40,25},{-40,-44},{-27,-44}},
|
|---|
| 5519 | color={0,0,127},
|
|---|
| 5520 | smooth=Smooth.None));
|
|---|
| 5521 | connect(tauRef, firstOrder1.u) annotation (Line(
|
|---|
| 5522 | points={{-108,60},{-78,60}},
|
|---|
| 5523 | color={0,0,127},
|
|---|
| 5524 | smooth=Smooth.None));
|
|---|
| 5525 | connect(firstOrder1.y, add1.u2) annotation (Line(
|
|---|
| 5526 | points={{-55,60},{-46,60},{-46,48}},
|
|---|
| 5527 | color={0,0,127},
|
|---|
| 5528 | smooth=Smooth.None));
|
|---|
| 5529 | annotation (
|
|---|
| 5530 | Icon(coordinateSystem(
|
|---|
| 5531 | extent={{-100,-100},{100,100}},
|
|---|
| 5532 | preserveAspectRatio=true,
|
|---|
| 5533 | initialScale=0.1,
|
|---|
| 5534 | grid={2,2})),
|
|---|
| 5535 | Diagram(coordinateSystem(
|
|---|
| 5536 | extent={{-100,-100},{100,100}},
|
|---|
| 5537 | preserveAspectRatio=false,
|
|---|
| 5538 | initialScale=0.1,
|
|---|
| 5539 | grid={2,2})),
|
|---|
| 5540 | experiment(
|
|---|
| 5541 | StartTime=0,
|
|---|
| 5542 | StopTime=6,
|
|---|
| 5543 | Tolerance=0.0001,
|
|---|
| 5544 | Interval=0.003));
|
|---|
| 5545 | end PmsmAllFluxLimI;
|
|---|
| 5546 |
|
|---|
| 5547 | model AtomicPmsm
|
|---|
| 5548 | "IdIq pmsm drive train with full and weakened flux, resistance, torque output"
|
|---|
| 5549 | // at low speeds (below wBase) operates with optimal angle between PM and
|
|---|
| 5550 | // stator fields, to minimise current; at higher speeds, instead of this
|
|---|
| 5551 | // angle it imposes the machine line-to-line peak voltage to be equal to the DC voltage
|
|---|
| 5552 | parameter Real Ipm=1.5;
|
|---|
| 5553 | parameter Integer pp=1 "pole pairs";
|
|---|
| 5554 | parameter Real Rs=0.02;
|
|---|
| 5555 | parameter Real Ld=0.4, Lq=1.1;
|
|---|
| 5556 | parameter Real Unom "nominal voltage (rms per phase)";
|
|---|
| 5557 | protected
|
|---|
| 5558 | parameter Real UnomPk=sqrt(2)*Unom "nominal voltage (peak per phase)";
|
|---|
| 5559 | //The following voltage Ulimi is set to be equal to Udc without margins
|
|---|
| 5560 | //since this model implementation allows it. In pcactice, obviously
|
|---|
| 5561 | //some safety coefficient will be included since the voltage control is not
|
|---|
| 5562 | // "perfect" and instantaneous
|
|---|
| 5563 | public
|
|---|
| 5564 | Real Ulim=min(uDC/sqrt(3), UnomPk)
|
|---|
| 5565 | "tensione limite (fase-picco) fa attivare il deflussaggio;";
|
|---|
| 5566 | Modelica.SIunits.Angle gammaFF(start=0), gamma(start=0);
|
|---|
| 5567 | // Real Is "corrente rapportata al valore nominale (es. rms/rms)";
|
|---|
| 5568 | Real P "potenza rapportata a UnIn";
|
|---|
| 5569 | Real Id(start=0), Iq, Vd, Vq;
|
|---|
| 5570 | Real IdFF "Id FullFlux (i.e. before flux weaking evalation)", IqFF
|
|---|
| 5571 | "Iq FullFlux (i.e. before flux weaking evalation)", VdFF
|
|---|
| 5572 | "Vd FullFlux (i.e. before flux weaking evalation)", VqFF
|
|---|
| 5573 | "Vq FullFlux (i.e. before flux weaking evalation)", IparkFF(start=0)
|
|---|
| 5574 | "Ipark amplitude FullFlux (i.e. before flux weaking evalation)",
|
|---|
| 5575 | VparkFF "Vpark amplitude FullFlux (i.e. before flux weaking evalation)";
|
|---|
| 5576 | Real Ipark(start=70) "Ipark amplitude (=sqrt(Id^2+Iq^2))";
|
|---|
| 5577 | Real Vpark "Vpark amplitude (=sqrt(Vd^2+Vq^2))";
|
|---|
| 5578 | Real T1 "Torque due to PM field";
|
|---|
| 5579 | Real T2 "Torque due to anisotropy (reluctance torque)";
|
|---|
| 5580 | Real w=pp*wMechanical;
|
|---|
| 5581 | Real weakening;
|
|---|
| 5582 | //weakening should be boolean. It is assumed to be real because otherwise this
|
|---|
| 5583 | //model will not work under OpenModelica 1.9.2.
|
|---|
| 5584 | protected
|
|---|
| 5585 | parameter Real Psi=Ipm*Ld "psi=Ipm*Ld";
|
|---|
| 5586 | public
|
|---|
| 5587 | Modelica.Blocks.Interfaces.RealInput torqueReq annotation (Placement(
|
|---|
| 5588 | transformation(extent={{-130,40},{-90,80}}), iconTransformation(
|
|---|
| 5589 | extent={{-130,40},{-90,80}})));
|
|---|
| 5590 | Modelica.Blocks.Interfaces.RealInput wMechanical annotation (Placement(
|
|---|
| 5591 | transformation(extent={{-128,-80},{-88,-40}}), iconTransformation(
|
|---|
| 5592 | extent={{-128,-80},{-88,-40}})));
|
|---|
| 5593 | Modelica.Blocks.Interfaces.RealOutput Is annotation (Placement(
|
|---|
| 5594 | transformation(extent={{98,50},{118,70}}), iconTransformation(
|
|---|
| 5595 | extent={{98,50},{118,70}})));
|
|---|
| 5596 | Modelica.Blocks.Interfaces.RealOutput tauElectrical annotation (Placement(
|
|---|
| 5597 | transformation(extent={{98,-70},{118,-50}}), iconTransformation(
|
|---|
| 5598 | extent={{98,-70},{118,-50}})));
|
|---|
| 5599 | Modelica.Blocks.Interfaces.RealInput uDC "DC voltage"
|
|---|
| 5600 | annotation (Placement(transformation(extent={{-130,-20},{-90,20}})));
|
|---|
| 5601 | equation
|
|---|
| 5602 | //Computations with fill flux.
|
|---|
| 5603 | //The following two equations determine IparkFF and gammaFF:
|
|---|
| 5604 | 0 = (-Psi*sin(gammaFF)) + (Lq - Ld)*IparkFF*cos(2*gammaFF);
|
|---|
| 5605 | torqueReq = 1.5*pp*(Psi*IparkFF*cos(gammaFF) + (Lq - Ld)/2*IparkFF^2*sin(
|
|---|
| 5606 | 2*gammaFF));
|
|---|
| 5607 | //omputation of Id, Iq, Vd, Vq, V
|
|---|
| 5608 | IdFF = -IparkFF*sin(gammaFF);
|
|---|
| 5609 | IqFF = IparkFF*cos(gammaFF);
|
|---|
| 5610 | VdFF = Rs*IdFF - w*Lq*IqFF;
|
|---|
| 5611 | VqFF = Rs*IqFF + w*(Psi + Ld*IdFF);
|
|---|
| 5612 | VparkFF = sqrt(VdFF^2 + VqFF^2);
|
|---|
| 5613 | if VparkFF < Ulim then
|
|---|
| 5614 | weakening = 0;
|
|---|
| 5615 | //weakening should be boolean. It is assumed to be real because otherwise this
|
|---|
| 5616 | //model will not work under OpenModelica 1.9.2.
|
|---|
| 5617 | 0 = (-Psi*sin(gamma)) + (Lq - Ld)*IparkFF*cos(2*gamma);
|
|---|
| 5618 | Id = IdFF;
|
|---|
| 5619 | Iq = IqFF;
|
|---|
| 5620 | Vd = VdFF;
|
|---|
| 5621 | Vq = VqFF;
|
|---|
| 5622 | Vpark = VparkFF;
|
|---|
| 5623 | else
|
|---|
| 5624 | weakening = 1;
|
|---|
| 5625 | //weakening should be boolean. It is assumed to be real because otherwise this
|
|---|
| 5626 | //model will not work under OpenModelica 1.9.2.
|
|---|
| 5627 | Id = -Ipark*sin(gamma);
|
|---|
| 5628 | Iq = Ipark*cos(gamma);
|
|---|
| 5629 | Vd = Rs*Id - w*Lq*Iq;
|
|---|
| 5630 | Vq = Rs*Iq + w*(Psi + Ld*Id);
|
|---|
| 5631 | Vpark = sqrt(Vd^2 + Vq^2);
|
|---|
| 5632 | Vpark = Ulim;
|
|---|
| 5633 | // gammaFilt+tauFilt*der(gammaFilt)=gamma;
|
|---|
| 5634 | end if;
|
|---|
| 5635 | // T1 = 1.5*pp*Psi*Ipark*cos(gammaFilt);
|
|---|
| 5636 | // T2 = 1.5*pp*(Lq - Ld)/2*Ipark^2*sin(2*gammaFilt);
|
|---|
| 5637 | T1 = 1.5*pp*Psi*Ipark*cos(gamma);
|
|---|
| 5638 | T2 = 1.5*pp*(Lq - Ld)/2*Ipark^2*sin(2*gamma);
|
|---|
| 5639 | tauElectrical = T1 + T2;
|
|---|
| 5640 | //Equating the generated torqe to the input one:
|
|---|
| 5641 | tauElectrical = torqueReq;
|
|---|
| 5642 | // Other quantities:
|
|---|
| 5643 | P = wMechanical*tauElectrical;
|
|---|
| 5644 | Is = Ipark/sqrt(2);
|
|---|
| 5645 | annotation (Icon(coordinateSystem(
|
|---|
| 5646 | extent={{-100,-100},{100,100}},
|
|---|
| 5647 | preserveAspectRatio=false,
|
|---|
| 5648 | initialScale=0.1,
|
|---|
| 5649 | grid={2,2}), graphics), Diagram(coordinateSystem(
|
|---|
| 5650 | extent={{-100,-100},{100,100}},
|
|---|
| 5651 | preserveAspectRatio=false,
|
|---|
| 5652 | initialScale=0.1,
|
|---|
| 5653 | grid={2,2}), graphics));
|
|---|
| 5654 | end AtomicPmsm;
|
|---|
| 5655 | annotation (Icon(graphics={
|
|---|
| 5656 | Ellipse(extent={{-36,40},{40,-36}}, lineColor={0,0,0}),
|
|---|
| 5657 | Line(
|
|---|
| 5658 | points={{4,82},{-6,82},{-10,72},{-24,68},{-34,78},{-46,70},{-42,58},
|
|---|
| 5659 | {-54,46},{-66,50},{-74,36},{-66,30},{-68,16},{-78,12},{-78,2}},
|
|---|
| 5660 |
|
|---|
| 5661 | color={0,0,0},
|
|---|
| 5662 | smooth=Smooth.None),
|
|---|
| 5663 | Line(
|
|---|
| 5664 | points={{4,-78},{-6,-78},{-10,-68},{-24,-64},{-34,-74},{-46,-66},{-42,
|
|---|
| 5665 | -54},{-54,-42},{-66,-46},{-74,-32},{-66,-26},{-68,-12},{-78,-8},
|
|---|
| 5666 | {-78,2}},
|
|---|
| 5667 | color={0,0,0},
|
|---|
| 5668 | smooth=Smooth.None),
|
|---|
| 5669 | Line(
|
|---|
| 5670 | points={{2,-78},{12,-78},{16,-68},{30,-64},{40,-74},{52,-66},{48,-54},
|
|---|
| 5671 | {60,-42},{72,-46},{80,-32},{72,-26},{74,-12},{84,-8},{84,2}},
|
|---|
| 5672 | color={0,0,0},
|
|---|
| 5673 | smooth=Smooth.None),
|
|---|
| 5674 | Line(
|
|---|
| 5675 | points={{2,82},{12,82},{16,72},{30,68},{40,78},{52,70},{48,58},{60,
|
|---|
| 5676 | 46},{72,50},{80,36},{72,30},{74,16},{84,12},{84,2}},
|
|---|
| 5677 | color={0,0,0},
|
|---|
| 5678 | smooth=Smooth.None)}));
|
|---|
| 5679 |
|
|---|
| 5680 | end SupportModels;
|
|---|
| 5681 |
|
|---|
| 5682 | package Icons
|
|---|
| 5683 | model EcuIcon
|
|---|
| 5684 | SupportModels.Conn conn1 annotation (Placement(
|
|---|
| 5685 | visible=true,
|
|---|
| 5686 | transformation(extent={{-20,78},{20,118}}, rotation=0),
|
|---|
| 5687 | iconTransformation(extent={{-20,80},{20,120}}, rotation=0)));
|
|---|
| 5688 | Modelica.Blocks.Interfaces.RealInput motTauInt annotation (Placement(
|
|---|
| 5689 | visible=true,
|
|---|
| 5690 | transformation(extent={{-140,-20},{-100,20}}, rotation=0),
|
|---|
| 5691 | iconTransformation(extent={{-140,-20},{-100,20}}, rotation=0)));
|
|---|
| 5692 | annotation (Icon(graphics={Rectangle(
|
|---|
| 5693 | extent={{-100,100},{100,-100}},
|
|---|
| 5694 | lineColor={0,0,0},
|
|---|
| 5695 | fillColor={255,255,255},
|
|---|
| 5696 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5697 | points={{-4,-40},{74,16},{74,-6},{-4,-62},{-4,-40}},
|
|---|
| 5698 | lineColor={95,95,95},
|
|---|
| 5699 | fillColor={175,175,175},
|
|---|
| 5700 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5701 | points={{8,-38},{28,-48},{20,-54},{0,-44},{8,-38}},
|
|---|
| 5702 | lineColor={0,0,255},
|
|---|
| 5703 | fillColor={255,255,0},
|
|---|
| 5704 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5705 | points={{20,-54},{28,-48},{32,-56},{24,-62},{20,-54}},
|
|---|
| 5706 | lineColor={0,0,255},
|
|---|
| 5707 | fillColor={255,255,0},
|
|---|
| 5708 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5709 | points={{24,-62},{32,-56},{32,-78},{24,-84},{24,-62}},
|
|---|
| 5710 | lineColor={0,0,255},
|
|---|
| 5711 | fillColor={255,255,127},
|
|---|
| 5712 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5713 | points={{0,-44},{20,-54},{24,-62},{24,-84},{22,-84},{22,-62},
|
|---|
| 5714 | {20,-58},{0,-48},{0,-44}},
|
|---|
| 5715 | lineColor={0,0,255},
|
|---|
| 5716 | fillColor={191,191,0},
|
|---|
| 5717 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5718 | points={{-14,40},{-18,32},{-10,38},{-8,44},{-14,40}},
|
|---|
| 5719 | lineColor={128,128,128},
|
|---|
| 5720 | fillColor={128,128,128},
|
|---|
| 5721 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5722 | points={{-18,32},{-10,38},{-10,14},{-18,8},{-18,32}},
|
|---|
| 5723 | lineColor={0,0,255},
|
|---|
| 5724 | fillColor={255,255,127},
|
|---|
| 5725 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5726 | points={{-20,10},{-20,32},{-16,40},{4,30},{4,26},{-16,36},{-18,
|
|---|
| 5727 | 32},{-18,8},{-20,10}},
|
|---|
| 5728 | lineColor={0,0,255},
|
|---|
| 5729 | fillColor={191,191,0},
|
|---|
| 5730 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5731 | points={{-8,46},{12,36},{4,30},{-16,40},{-8,46}},
|
|---|
| 5732 | lineColor={0,0,255},
|
|---|
| 5733 | fillColor={255,255,0},
|
|---|
| 5734 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5735 | points={{28,-22},{48,-32},{40,-38},{20,-28},{28,-22}},
|
|---|
| 5736 | lineColor={0,0,255},
|
|---|
| 5737 | fillColor={255,255,0},
|
|---|
| 5738 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5739 | points={{40,-38},{48,-32},{52,-40},{44,-46},{40,-38}},
|
|---|
| 5740 | lineColor={0,0,255},
|
|---|
| 5741 | fillColor={255,255,0},
|
|---|
| 5742 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5743 | points={{44,-46},{52,-40},{52,-62},{44,-68},{44,-46}},
|
|---|
| 5744 | lineColor={0,0,255},
|
|---|
| 5745 | fillColor={255,255,127},
|
|---|
| 5746 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5747 | points={{20,-28},{40,-38},{44,-46},{44,-68},{42,-68},{42,-46},
|
|---|
| 5748 | {40,-42},{20,-32},{20,-28}},
|
|---|
| 5749 | lineColor={0,0,255},
|
|---|
| 5750 | fillColor={191,191,0},
|
|---|
| 5751 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5752 | points={{48,-8},{68,-18},{60,-24},{40,-14},{48,-8}},
|
|---|
| 5753 | lineColor={0,0,255},
|
|---|
| 5754 | fillColor={255,255,0},
|
|---|
| 5755 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5756 | points={{60,-24},{68,-18},{72,-26},{64,-32},{60,-24}},
|
|---|
| 5757 | lineColor={0,0,255},
|
|---|
| 5758 | fillColor={255,255,0},
|
|---|
| 5759 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5760 | points={{64,-32},{72,-26},{72,-48},{64,-54},{64,-32}},
|
|---|
| 5761 | lineColor={0,0,255},
|
|---|
| 5762 | fillColor={255,255,127},
|
|---|
| 5763 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5764 | points={{40,-14},{60,-24},{64,-32},{64,-54},{62,-54},{62,-32},
|
|---|
| 5765 | {60,-28},{40,-18},{40,-14}},
|
|---|
| 5766 | lineColor={0,0,255},
|
|---|
| 5767 | fillColor={191,191,0},
|
|---|
| 5768 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5769 | points={{68,6},{88,-4},{80,-10},{60,0},{68,6}},
|
|---|
| 5770 | lineColor={0,0,255},
|
|---|
| 5771 | fillColor={255,255,0},
|
|---|
| 5772 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5773 | points={{80,-10},{88,-4},{92,-12},{84,-18},{80,-10}},
|
|---|
| 5774 | lineColor={0,0,255},
|
|---|
| 5775 | fillColor={255,255,0},
|
|---|
| 5776 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5777 | points={{84,-18},{92,-12},{92,-34},{84,-40},{84,-18}},
|
|---|
| 5778 | lineColor={0,0,255},
|
|---|
| 5779 | fillColor={255,255,127},
|
|---|
| 5780 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5781 | points={{60,0},{80,-10},{84,-18},{84,-40},{82,-40},{82,-18},{
|
|---|
| 5782 | 80,-14},{60,-4},{60,0}},
|
|---|
| 5783 | lineColor={0,0,255},
|
|---|
| 5784 | fillColor={191,191,0},
|
|---|
| 5785 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5786 | points={{-34,26},{-38,18},{-30,24},{-28,30},{-34,26}},
|
|---|
| 5787 | lineColor={128,128,128},
|
|---|
| 5788 | fillColor={128,128,128},
|
|---|
| 5789 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5790 | points={{-38,18},{-30,24},{-30,0},{-38,-6},{-38,18}},
|
|---|
| 5791 | lineColor={0,0,255},
|
|---|
| 5792 | fillColor={255,255,127},
|
|---|
| 5793 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5794 | points={{-40,-4},{-40,18},{-36,26},{-16,16},{-16,12},{-36,22},
|
|---|
| 5795 | {-38,18},{-38,-6},{-40,-4}},
|
|---|
| 5796 | lineColor={0,0,255},
|
|---|
| 5797 | fillColor={191,191,0},
|
|---|
| 5798 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5799 | points={{-28,32},{-8,22},{-16,16},{-36,26},{-28,32}},
|
|---|
| 5800 | lineColor={0,0,255},
|
|---|
| 5801 | fillColor={255,255,0},
|
|---|
| 5802 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5803 | points={{-54,12},{-58,4},{-50,10},{-48,16},{-54,12}},
|
|---|
| 5804 | lineColor={128,128,128},
|
|---|
| 5805 | fillColor={128,128,128},
|
|---|
| 5806 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5807 | points={{-58,4},{-50,10},{-50,-14},{-58,-20},{-58,4}},
|
|---|
| 5808 | lineColor={0,0,255},
|
|---|
| 5809 | fillColor={255,255,127},
|
|---|
| 5810 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5811 | points={{-60,-18},{-60,4},{-56,12},{-36,2},{-36,-2},{-56,8},{
|
|---|
| 5812 | -58,4},{-58,-20},{-60,-18}},
|
|---|
| 5813 | lineColor={0,0,255},
|
|---|
| 5814 | fillColor={191,191,0},
|
|---|
| 5815 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5816 | points={{-48,18},{-28,8},{-36,2},{-56,12},{-48,18}},
|
|---|
| 5817 | lineColor={0,0,255},
|
|---|
| 5818 | fillColor={255,255,0},
|
|---|
| 5819 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5820 | points={{-74,-4},{-78,-12},{-70,-6},{-68,0},{-74,-4}},
|
|---|
| 5821 | lineColor={128,128,128},
|
|---|
| 5822 | fillColor={128,128,128},
|
|---|
| 5823 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5824 | points={{-78,-12},{-70,-6},{-70,-30},{-78,-36},{-78,-12}},
|
|---|
| 5825 | lineColor={0,0,255},
|
|---|
| 5826 | fillColor={255,255,127},
|
|---|
| 5827 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5828 | points={{-80,-34},{-80,-12},{-76,-4},{-56,-14},{-56,-18},{-76,
|
|---|
| 5829 | -8},{-78,-12},{-78,-36},{-80,-34}},
|
|---|
| 5830 | lineColor={0,0,255},
|
|---|
| 5831 | fillColor={191,191,0},
|
|---|
| 5832 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5833 | points={{-68,2},{-48,-8},{-56,-14},{-76,-4},{-68,2}},
|
|---|
| 5834 | lineColor={0,0,255},
|
|---|
| 5835 | fillColor={255,255,0},
|
|---|
| 5836 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5837 | points={{-64,-8},{-4,-40},{-4,-62},{-64,-30},{-64,-8}},
|
|---|
| 5838 | lineColor={95,95,95},
|
|---|
| 5839 | fillColor={75,75,75},
|
|---|
| 5840 | fillPattern=FillPattern.Solid),Polygon(
|
|---|
| 5841 | points={{-64,-8},{-4,-40},{74,16},{14,48},{-64,-8}},
|
|---|
| 5842 | lineColor={95,95,95},
|
|---|
| 5843 | fillColor={160,160,164},
|
|---|
| 5844 | fillPattern=FillPattern.Solid),Text(
|
|---|
| 5845 | origin={-1,-42},
|
|---|
| 5846 | lineColor={0,0,255},
|
|---|
| 5847 | extent={{-119,-64},{119,-104}},
|
|---|
| 5848 | textString="%name"),Rectangle(
|
|---|
| 5849 | extent={{-98,92},{98,62}},
|
|---|
| 5850 | fillColor={255,255,255},
|
|---|
| 5851 | fillPattern=FillPattern.Solid,
|
|---|
| 5852 | pattern=LinePattern.None)}), Diagram(coordinateSystem(
|
|---|
| 5853 | preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
|
|---|
| 5854 | graphics));
|
|---|
| 5855 | end EcuIcon;
|
|---|
| 5856 |
|
|---|
| 5857 | model SupportIcon
|
|---|
| 5858 | annotation (Icon(graphics={Ellipse(extent={{-38,38},{38,-38}}, lineColor=
|
|---|
| 5859 | {0,0,0}),Line(
|
|---|
| 5860 | points={{2,80},{-8,80},{-12,70},{-26,66},{-36,76},{-48,68},{-44,
|
|---|
| 5861 | 56},{-56,44},{-68,48},{-76,34},{-68,28},{-70,14},{-80,10},{-80,
|
|---|
| 5862 | 0}},
|
|---|
| 5863 | color={0,0,0},
|
|---|
| 5864 | smooth=Smooth.None),Line(
|
|---|
| 5865 | points={{2,-80},{-8,-80},{-12,-70},{-26,-66},{-36,-76},{-48,-68},
|
|---|
| 5866 | {-44,-56},{-56,-44},{-68,-48},{-76,-34},{-68,-28},{-70,-14},{-80,
|
|---|
| 5867 | -10},{-80,0}},
|
|---|
| 5868 | color={0,0,0},
|
|---|
| 5869 | smooth=Smooth.None),Line(
|
|---|
| 5870 | points={{0,-80},{10,-80},{14,-70},{28,-66},{38,-76},{50,-68},
|
|---|
| 5871 | {46,-56},{58,-44},{70,-48},{78,-34},{70,-28},{72,-14},{82,-10},
|
|---|
| 5872 | {82,0}},
|
|---|
| 5873 | color={0,0,0},
|
|---|
| 5874 | smooth=Smooth.None),Line(
|
|---|
| 5875 | points={{0,80},{10,80},{14,70},{28,66},{38,76},{50,68},{46,56},
|
|---|
| 5876 | {58,44},{70,48},{78,34},{70,28},{72,14},{82,10},{82,0}},
|
|---|
| 5877 | color={0,0,0},
|
|---|
| 5878 | smooth=Smooth.None)}));
|
|---|
| 5879 | end SupportIcon;
|
|---|
| 5880 | end Icons;
|
|---|
| 5881 |
|
|---|
| 5882 | package FullVehicles "Full Vehicles examples"
|
|---|
| 5883 | extends Modelica.Icons.ExamplesPackage;
|
|---|
| 5884 |
|
|---|
| 5885 |
|
|---|
| 5886 |
|
|---|
| 5887 | model PSecu1
|
|---|
| 5888 | "Full Power Split Device power train using Map-Based components"
|
|---|
| 5889 | import Modelica.Constants.*;
|
|---|
| 5890 | extends Modelica.Icons.Example;
|
|---|
| 5891 | parameter Real vMass=1300;
|
|---|
| 5892 | parameter Real wIceStart=50;
|
|---|
| 5893 | parameter Real factorDebug=100;
|
|---|
| 5894 | // rad/s
|
|---|
| 5895 | Modelica.SIunits.Power Pbat;
|
|---|
| 5896 | Modelica.SIunits.Energy Ebat, Egen, Eroad;
|
|---|
| 5897 | Modelica.SIunits.Energy Eice, Emot, Emass;
|
|---|
| 5898 | Modelica.Mechanics.Rotational.Components.IdealPlanetary PSD(ratio=78/30)
|
|---|
| 5899 | annotation (Placement(transformation(
|
|---|
| 5900 | extent={{-10,-10},{10,10}},
|
|---|
| 5901 | rotation=0,
|
|---|
| 5902 | origin={-50,52})));
|
|---|
| 5903 | Modelica.Mechanics.Rotational.Components.IdealGear idealGear(ratio=3.905)
|
|---|
| 5904 | annotation (Placement(transformation(extent={{2,42},{22,62}})));
|
|---|
| 5905 | Modelica.Mechanics.Translational.Sensors.SpeedSensor carVel annotation (
|
|---|
| 5906 | Placement(transformation(
|
|---|
| 5907 | extent={{-10,-10},{10,10}},
|
|---|
| 5908 | rotation=270,
|
|---|
| 5909 | origin={78,-12})));
|
|---|
| 5910 | Modelica.Mechanics.Translational.Components.Mass mass(v(fixed=true, start
|
|---|
| 5911 | =0), m=vMass)
|
|---|
| 5912 | annotation (Placement(transformation(extent={{54,42},{74,62}})));
|
|---|
| 5913 | SupportModels.DragForce dragForce(
|
|---|
| 5914 | fc=0.014,
|
|---|
| 5915 | rho=1.226,
|
|---|
| 5916 | m=vMass,
|
|---|
| 5917 | S=2.2,
|
|---|
| 5918 | Cx=0.26) annotation (Placement(transformation(
|
|---|
| 5919 | extent={{-9,-9},{9,9}},
|
|---|
| 5920 | rotation=90,
|
|---|
| 5921 | origin={89,29})));
|
|---|
| 5922 | MapBased.MBiceConn ice(vMass=vMass, wIceStart=wIceStart)
|
|---|
| 5923 | annotation (Placement(transformation(extent={{-98,46},{-78,66}})));
|
|---|
| 5924 | SupportModels.Batt1Conn battery(
|
|---|
| 5925 | ECellMin=0.9,
|
|---|
| 5926 | ECellMax=1.45,
|
|---|
| 5927 | R0Cell=0.0003,
|
|---|
| 5928 | ns=168,
|
|---|
| 5929 | QCellNom=2*6.5*3600.0,
|
|---|
| 5930 | SOCInit=0.8,
|
|---|
| 5931 | ICellMax=1e5,
|
|---|
| 5932 | iCellEfficiency=15*6.5) annotation (Placement(transformation(
|
|---|
| 5933 | extent={{-10,-10},{10,10}},
|
|---|
| 5934 | rotation=90,
|
|---|
| 5935 | origin={-16,0})));
|
|---|
| 5936 | SupportModels.PropDriver driver(
|
|---|
| 5937 | yMax=1.8,
|
|---|
| 5938 | CycleFileName="Sort1.txt",
|
|---|
| 5939 | k=1) annotation (Placement(visible=true, transformation(extent={{-52,-50},
|
|---|
| 5940 | {-32,-30}}, rotation=0)));
|
|---|
| 5941 | SupportModels.Conn d annotation (Placement(
|
|---|
| 5942 | visible=true,
|
|---|
| 5943 | transformation(extent={{2,-40},{28,-16}}, rotation=0),
|
|---|
| 5944 | iconTransformation(extent={{4,-52},{30,-28}}, rotation=0)));
|
|---|
| 5945 | MapBased.MBecu1 ECU annotation (Placement(visible=true, transformation(
|
|---|
| 5946 | origin={-10,-40},
|
|---|
| 5947 | extent={{-10,-8},{10,8}},
|
|---|
| 5948 | rotation=0)));
|
|---|
| 5949 | MapBased.MBTwoFlangeConn mot annotation (Placement(visible=true,
|
|---|
| 5950 | transformation(extent={{-28,62},{-8,42}}, rotation=0)));
|
|---|
| 5951 | Modelica.Mechanics.Rotational.Components.IdealRollingWheel wheel(radius=
|
|---|
| 5952 | 0.31) annotation (Placement(visible=true, transformation(
|
|---|
| 5953 | origin={38,52},
|
|---|
| 5954 | extent={{-10,-10},{10,10}},
|
|---|
| 5955 | rotation=0)));
|
|---|
| 5956 | Modelica.Electrical.Analog.Basic.Ground ground annotation (Placement(
|
|---|
| 5957 | visible=true, transformation(
|
|---|
| 5958 | origin={10,26},
|
|---|
| 5959 | extent={{10,10},{-10,-10}},
|
|---|
| 5960 | rotation=270)));
|
|---|
| 5961 | MapBased.MBOneFlangeConn gen annotation (Placement(visible=true,
|
|---|
| 5962 | transformation(extent={{-38,14},{-58,34}}, rotation=0)));
|
|---|
| 5963 | equation
|
|---|
| 5964 | connect(gen.pin_p, battery.p) annotation (Line(points={{-38,28},{-24,28},
|
|---|
| 5965 | {-24,10},{-23.75,10}}, color={0,0,255}));
|
|---|
| 5966 | connect(gen.pin_n, battery.n) annotation (Line(points={{-38,20},{-8.5,20},
|
|---|
| 5967 | {-8.5,10.1}}, color={0,0,255}));
|
|---|
| 5968 | connect(gen.flange_a, PSD.sun) annotation (Line(points={{-58,24},{-58,24},
|
|---|
| 5969 | {-70,24},{-70,52},{-60,52}}));
|
|---|
| 5970 | connect(gen.conn, ECU.conn1) annotation (Line(
|
|---|
| 5971 | points={{-58,16.2},{-58,-20},{-10,-20},{-10,-30}},
|
|---|
| 5972 | color={255,204,51},
|
|---|
| 5973 | thickness=0.5));
|
|---|
| 5974 | connect(ground.p, battery.n) annotation (Line(points={{0,26},{-8.5,26},{-8.5,
|
|---|
| 5975 | 10.1}}, color={0,0,255}));
|
|---|
| 5976 | connect(wheel.flangeT, mass.flange_a)
|
|---|
| 5977 | annotation (Line(points={{48,52},{54,52}}, color={0,127,0}));
|
|---|
| 5978 | connect(wheel.flangeR, idealGear.flange_b)
|
|---|
| 5979 | annotation (Line(points={{28,52},{22,52}}));
|
|---|
| 5980 | connect(PSD.ring, mot.flange_a)
|
|---|
| 5981 | annotation (Line(points={{-40,52},{-34,52},{-28,52}}));
|
|---|
| 5982 | connect(idealGear.flange_a, mot.flange_b)
|
|---|
| 5983 | annotation (Line(points={{2,52},{-4,52},{-4,52.2},{-8,52.2}}));
|
|---|
| 5984 | connect(mot.pin_p, battery.p) annotation (Line(points={{-22,42.2},{-22,10},
|
|---|
| 5985 | {-23.75,10}}, color={0,0,255}));
|
|---|
| 5986 | connect(mot.pin_n, battery.n) annotation (Line(points={{-14,42},{-14,10.1},
|
|---|
| 5987 | {-8.5,10.1}}, color={0,0,255}));
|
|---|
| 5988 | connect(mot.conn1, ECU.conn1) annotation (Line(
|
|---|
| 5989 | points={{-27.2,59.8},{-27.2,76},{50,76},{50,-20},{-10,-20},{-10,-30}},
|
|---|
| 5990 |
|
|---|
| 5991 | color={255,204,51},
|
|---|
| 5992 | thickness=0.5));
|
|---|
| 5993 |
|
|---|
| 5994 | connect(battery.conn, ECU.conn1) annotation (Line(
|
|---|
| 5995 | points={{-15.75,-10},{-16,-10},{-16,-20},{-10,-20},{-10,-30}},
|
|---|
| 5996 | color={255,204,51},
|
|---|
| 5997 | thickness=0.5));
|
|---|
| 5998 | connect(ice.conn, ECU.conn1) annotation (Line(
|
|---|
| 5999 | points={{-86.4,46},{-86,46},{-86,-20},{-10,-20},{-10,-30}},
|
|---|
| 6000 | color={255,204,51},
|
|---|
| 6001 | thickness=0.5));
|
|---|
| 6002 | connect(ECU.conn1, d) annotation (Line(
|
|---|
| 6003 | points={{-10,-30},{-10,-28},{15,-28}},
|
|---|
| 6004 | color={255,204,51},
|
|---|
| 6005 | thickness=0.5));
|
|---|
| 6006 | connect(carVel.v, driver.V) annotation (Line(points={{78,-23},{78,-58},{-42,
|
|---|
| 6007 | -58},{-42,-51.2}}, color={0,0,127}));
|
|---|
| 6008 | Pbat = battery.p.i*(battery.p.v - battery.n.v);
|
|---|
| 6009 | der(Ebat) = Pbat;
|
|---|
| 6010 | der(Egen) = gen.pin_p.i*(gen.pin_p.v - gen.pin_n.v) + gen.flange_a.tau*
|
|---|
| 6011 | der(gen.flange_a.phi);
|
|---|
| 6012 | der(Eroad) = dragForce.flange.f*der(dragForce.flange.s);
|
|---|
| 6013 | der(Eice) = ice.flange_a.tau*der(ice.flange_a.phi);
|
|---|
| 6014 | der(Emot) = mot.flange_a.tau*der(mot.flange_a.phi) + mot.flange_b.tau*der(
|
|---|
| 6015 | mot.flange_b.phi);
|
|---|
| 6016 | Emass = 0.5*mass.m*der(mass.flange_a.s)^2;
|
|---|
| 6017 | connect(PSD.carrier, ice.flange_a) annotation (Line(
|
|---|
| 6018 | points={{-60,56},{-70,56},{-70,58},{-78,58}},
|
|---|
| 6019 | color={0,0,0},
|
|---|
| 6020 | smooth=Smooth.None));
|
|---|
| 6021 | connect(dragForce.flange, mass.flange_b) annotation (Line(
|
|---|
| 6022 | points={{89,38},{90,38},{90,52},{74,52}},
|
|---|
| 6023 | color={0,127,0},
|
|---|
| 6024 | smooth=Smooth.None));
|
|---|
| 6025 | connect(carVel.flange, mass.flange_b) annotation (Line(
|
|---|
| 6026 | points={{78,-2},{78,52},{74,52}},
|
|---|
| 6027 | color={0,127,0},
|
|---|
| 6028 | smooth=Smooth.None));
|
|---|
| 6029 | connect(ECU.motTauInt, driver.tauRef) annotation (Line(
|
|---|
| 6030 | points={{-22,-40},{-31,-40}},
|
|---|
| 6031 | color={0,0,127},
|
|---|
| 6032 | smooth=Smooth.None));
|
|---|
| 6033 | annotation (
|
|---|
| 6034 | experiment(StopTime=200, __Dymola_NumberOfIntervals=1000),
|
|---|
| 6035 | __Dymola_experimentSetupOutput,
|
|---|
| 6036 | Documentation(info="<html>
|
|---|
| 6037 | <p>This model tries to make the ICE to operate at the highest possible torque since this corresponds to the best fuel consumption given the delivered power. </p>
|
|---|
| 6038 | <p>This has two main inconveniences:</p>
|
|---|
| 6039 | <ul>
|
|---|
| 6040 | <li>the battery SOC is not controlled and tends to drift</li>
|
|---|
| 6041 | <li>in urban environment the power is too low to allow efficient drive without shutting off the engine.</li>
|
|---|
| 6042 | </ul>
|
|---|
| 6043 | <p>Both these inconveniencess are addressed in podel PSecu2.</p>
|
|---|
| 6044 | </html>"),
|
|---|
| 6045 | Diagram(coordinateSystem(
|
|---|
| 6046 | extent={{-100,-60},{100,80}},
|
|---|
| 6047 | preserveAspectRatio=false,
|
|---|
| 6048 | initialScale=0.1,
|
|---|
| 6049 | grid={2,2}), graphics),
|
|---|
| 6050 | Icon(coordinateSystem(
|
|---|
| 6051 | extent={{-100,-100},{100,100}},
|
|---|
| 6052 | preserveAspectRatio=false,
|
|---|
| 6053 | initialScale=0.1,
|
|---|
| 6054 | grid={2,2})));
|
|---|
| 6055 | end PSecu1;
|
|---|
| 6056 |
|
|---|
| 6057 | end FullVehicles;
|
|---|
| 6058 | annotation (
|
|---|
| 6059 | uses(Modelica(version="3.2.1")),
|
|---|
| 6060 | Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,
|
|---|
| 6061 | 100}}), graphics={
|
|---|
| 6062 | Polygon(
|
|---|
| 6063 | points={{-60,16},{78,16},{94,0},{96,-16},{-98,-16},{-90,0},{-76,12},{
|
|---|
| 6064 | -60,16}},
|
|---|
| 6065 | lineColor={0,0,0},
|
|---|
| 6066 | smooth=Smooth.None,
|
|---|
| 6067 | fillColor={0,0,255},
|
|---|
| 6068 | fillPattern=FillPattern.Solid),
|
|---|
| 6069 | Ellipse(
|
|---|
| 6070 | extent={{-70,-4},{-30,-40}},
|
|---|
| 6071 | lineColor={95,95,95},
|
|---|
| 6072 | fillColor={95,95,95},
|
|---|
| 6073 | fillPattern=FillPattern.Solid),
|
|---|
| 6074 | Ellipse(
|
|---|
| 6075 | extent={{34,-6},{74,-42}},
|
|---|
| 6076 | lineColor={95,95,95},
|
|---|
| 6077 | fillColor={95,95,95},
|
|---|
| 6078 | fillPattern=FillPattern.Solid),
|
|---|
| 6079 | Polygon(
|
|---|
| 6080 | points={{-54,16},{-18,46},{46,46},{74,16},{-54,16}},
|
|---|
| 6081 | lineColor={0,0,0},
|
|---|
| 6082 | smooth=Smooth.None,
|
|---|
| 6083 | fillColor={0,0,255},
|
|---|
| 6084 | fillPattern=FillPattern.Solid),
|
|---|
| 6085 | Ellipse(
|
|---|
| 6086 | extent={{-86,-6},{-92,4}},
|
|---|
| 6087 | lineColor={0,0,0},
|
|---|
| 6088 | fillColor={255,255,0},
|
|---|
| 6089 | fillPattern=FillPattern.Solid),
|
|---|
| 6090 | Ellipse(
|
|---|
| 6091 | extent={{98,-10},{92,-4}},
|
|---|
| 6092 | lineColor={0,0,0},
|
|---|
| 6093 | fillColor={255,0,0},
|
|---|
| 6094 | fillPattern=FillPattern.Solid),
|
|---|
| 6095 | Polygon(
|
|---|
| 6096 | points={{-46,20},{-20,42},{16,42},{14,20},{-46,20}},
|
|---|
| 6097 | lineColor={0,0,0},
|
|---|
| 6098 | smooth=Smooth.None,
|
|---|
| 6099 | fillColor={255,255,255},
|
|---|
| 6100 | fillPattern=FillPattern.Solid),
|
|---|
| 6101 | Polygon(
|
|---|
| 6102 | points={{22,42},{42,42},{60,20},{20,20},{22,42}},
|
|---|
| 6103 | lineColor={0,0,0},
|
|---|
| 6104 | smooth=Smooth.None,
|
|---|
| 6105 | fillColor={255,255,255},
|
|---|
| 6106 | fillPattern=FillPattern.Solid),
|
|---|
| 6107 | Ellipse(
|
|---|
| 6108 | extent={{-60,-12},{-40,-30}},
|
|---|
| 6109 | lineColor={95,95,95},
|
|---|
| 6110 | fillColor={215,215,215},
|
|---|
| 6111 | fillPattern=FillPattern.Solid),
|
|---|
| 6112 | Ellipse(
|
|---|
| 6113 | extent={{44,-14},{64,-32}},
|
|---|
| 6114 | lineColor={95,95,95},
|
|---|
| 6115 | fillColor={215,215,215},
|
|---|
| 6116 | fillPattern=FillPattern.Solid)}),
|
|---|
| 6117 | Documentation(info="<html>
|
|---|
| 6118 | <p>Library containing models of components, subsystems and full vehicle examples for simulation of electric and Hybrid vehicular power trains.</p>
|
|---|
| 6119 | <p>A general description of the library composition and on how to use it effectively is in the compaion paper:</p>
|
|---|
| 6120 | <p>M. Ceraolo "Modelica Electric and hybrid power trains library" submitted for publication at the 11th International Modelica Conference, 2015, September 21-23, Palais des congrès de Versailles, 23-23 September, France</p>
|
|---|
| 6121 | </html>"));
|
|---|
| 6122 | end EHPT;
|
|---|