|
| 1 | +within OpenIPSL.Electrical.Machines.PSSE.BaseClasses; |
| 2 | +partial model baseMotor "Base model for the PSSE three-phase induction motor models" |
| 3 | + |
| 4 | + parameter OpenIPSL.Types.ApparentPower M_b = 15e6 "Machine base power" |
| 5 | + annotation (Dialog(group="Power flow data")); |
| 6 | + extends OpenIPSL.Electrical.Essentials.pfComponent( |
| 7 | + final enabledisplayPF=false, |
| 8 | + final enablefn=false, |
| 9 | + final enableV_b=false, |
| 10 | + final enableangle_0=false, |
| 11 | + final enablev_0=false, |
| 12 | + final enableQ_0=false, |
| 13 | + final enableP_0=false, |
| 14 | + final enableS_b=true); |
| 15 | + |
| 16 | + import OpenIPSL.NonElectrical.Functions.SE; |
| 17 | + |
| 18 | + parameter Boolean Sup = true "True: Start-up process, False: Steady-state condition" annotation (Dialog(group="Motor Setup")); |
| 19 | + parameter Boolean Ctrl = true "True: Model for VSD control, False: Model not controllable" |
| 20 | + annotation (Dialog(group="Motor Setup")); |
| 21 | + parameter Real N = 1 "Number of pair of Poles" |
| 22 | + annotation (Dialog(group="Machine parameters")); |
| 23 | + parameter Modelica.Units.SI.Time H = 0.4 "Inertia constant" |
| 24 | + annotation (Dialog(group="Machine parameters")); |
| 25 | + |
| 26 | + OpenIPSL.Types.PerUnit v "Bus voltage magnitude"; |
| 27 | + OpenIPSL.Types.Angle anglev "Bus voltage angle"; |
| 28 | + OpenIPSL.Types.Angle delta "Bus voltage angle"; |
| 29 | + OpenIPSL.Types.PerUnit s "Induction motor slip"; |
| 30 | + OpenIPSL.Types.PerUnit P "Active power"; |
| 31 | + OpenIPSL.Types.PerUnit Q "Reactive power"; |
| 32 | + Modelica.Units.SI.AngularVelocity nr "Rotor speed"; |
| 33 | + Modelica.Units.SI.AngularVelocity ns "Synchronous speed"; |
| 34 | + Modelica.Units.SI.AngularVelocity w_sync "Controllable synchronous speed"; |
| 35 | + OpenIPSL.Types.PerUnit P_motor "Active power in motor base power"; |
| 36 | + OpenIPSL.Types.PerUnit Q_motor "Reactive power in motor base power"; |
| 37 | + OpenIPSL.Types.PerUnit Vr "Real part of terminal voltage"; |
| 38 | + OpenIPSL.Types.PerUnit Vi "Imaginary part of terminal voltage"; |
| 39 | + OpenIPSL.Types.PerUnit Ir "Real part of terminal current"; |
| 40 | + OpenIPSL.Types.PerUnit Ii "Imaginary part of terminal current"; |
| 41 | + OpenIPSL.Types.PerUnit Imag "Terminal current magnitude"; |
| 42 | + OpenIPSL.Types.PerUnit Te_motor "Electromagnetic torque in motor base"; |
| 43 | + OpenIPSL.Types.PerUnit Te_sys "Electromagnetic torque in system base"; |
| 44 | + |
| 45 | + Modelica.Blocks.Math.Gain we_fix(k=1) "Necessary gain for controllable synchronous speed functionality" |
| 46 | + annotation (Placement(transformation(extent={{80,-88},{90,-78}}))); |
| 47 | + Modelica.Blocks.Sources.Constant we_source_fix(k=0) |
| 48 | + if not Ctrl "Necessary source for controllable synchrnous speed functionality" |
| 49 | + annotation (Placement(transformation(extent={{32,-86},{44,-74}}))); |
| 50 | + OpenIPSL.Interfaces.PwPin p( |
| 51 | + vr(start=vr0), |
| 52 | + vi(start=vi0), |
| 53 | + ir(start=ir0_sys), |
| 54 | + ii(start=ii0_sys)) |
| 55 | + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); |
| 56 | + Modelica.Blocks.Interfaces.RealOutput wr |
| 57 | + "Absolute angular velocity of flange as output signal (rad/s)" |
| 58 | + annotation (Placement(transformation(extent={{-100,-10},{-120,10}}), |
| 59 | + iconTransformation( |
| 60 | + extent={{20,-20},{-20,20}}, |
| 61 | + rotation=90, |
| 62 | + origin={60,-120}))); |
| 63 | + Modelica.Blocks.Interfaces.RealInput we if Ctrl "Input for controllable synchronous speed functionality (rad/s)" annotation (Placement( |
| 64 | + transformation( |
| 65 | + extent={{-20,-20},{20,20}}, |
| 66 | + rotation=90, |
| 67 | + origin={60,-120}), iconTransformation( |
| 68 | + extent={{-20,-20},{20,20}}, |
| 69 | + rotation=90, |
| 70 | + origin={-60,-120}))); |
| 71 | + |
| 72 | +protected |
| 73 | + parameter OpenIPSL.Types.PerUnit p0 = P_0/M_b "Initial active power"; |
| 74 | + parameter OpenIPSL.Types.PerUnit q0 = Q_0/M_b "Initial reactive power"; |
| 75 | + parameter Modelica.Units.SI.AngularVelocity w_b=2*C.pi*fn/N "Base freq in rad/s"; |
| 76 | + parameter OpenIPSL.Types.PerUnit vr0=v_0*cos(angle_0) "Initial real voltage"; |
| 77 | + parameter OpenIPSL.Types.PerUnit vi0=v_0*sin(angle_0) "Initial imaginary voltage"; |
| 78 | + parameter OpenIPSL.Types.PerUnit ir0=(p0*vr0 + q0*vi0)/(vr0^2 + vi0^2) "Initial real current in motor base"; |
| 79 | + parameter OpenIPSL.Types.PerUnit ii0=(p0*vi0 - q0*vr0)/(vr0^2 + vi0^2) "Initial real current in motor base"; |
| 80 | + parameter OpenIPSL.Types.PerUnit ir0_sys = CoB*ir0 "Initial real current in system base"; |
| 81 | + parameter OpenIPSL.Types.PerUnit ii0_sys = CoB*ii0 "Initial imaginary current in system base"; |
| 82 | + parameter Real CoB = M_b/S_b "Change of base"; |
| 83 | +equation |
| 84 | + connect(we,we_fix. u) |
| 85 | + annotation (Line(points={{60,-120},{60,-83},{79,-83}}, color={0,0,127})); |
| 86 | + connect(we_source_fix.y,we_fix. u) |
| 87 | + annotation (Line(points={{44.6,-80},{70,-80},{70,-83},{79,-83}}, |
| 88 | + color={0,0,127})); |
| 89 | + |
| 90 | + w_sync = (if Ctrl == true then we_fix.y else w_b); |
| 91 | + [Vr; Vi] = [p.vr; p.vi]; |
| 92 | + [Ir; Ii] = (1/CoB)*[p.ir; p.ii]; |
| 93 | + Imag = sqrt(Ir^2 + Ii^2); |
| 94 | + v = sqrt(p.vr^2 + p.vi^2); |
| 95 | + anglev = atan2(p.vi, p.vr); |
| 96 | + delta = anglev; |
| 97 | + //P = if Ctrl == true then (p.vr*p.ir + p.vi*p.ii)*(we_fix.y/w_b) else (p.vr*p.ir + p.vi*p.ii); |
| 98 | + //Q = if Ctrl == true then ((-p.vr*p.ii) + p.vi*p.ir)*(we_fix.y/w_b) else ((-p.vr*p.ii) + p.vi*p.ir); |
| 99 | + //P = (p.vr*p.ir + p.vi*p.ii); |
| 100 | + P = if Ctrl == true then Te_sys*nr/w_b else Te_sys; |
| 101 | + Q = (-p.vr*p.ii) + p.vi*p.ir; |
| 102 | + |
| 103 | + P_motor = P/CoB; |
| 104 | + Q_motor = Q/CoB; |
| 105 | + ns = w_sync/N; |
| 106 | + nr = (1-s)*ns; |
| 107 | + wr = nr; |
| 108 | + |
| 109 | + annotation (preferredView = "info",Icon(graphics={ |
| 110 | + Rectangle(extent={{-100,100},{100,-100}}, lineColor={28,108,200}), |
| 111 | + Ellipse( |
| 112 | + fillColor={255,255,255}, |
| 113 | + extent={{-56,-58},{55.932,54}}), Text( |
| 114 | + extent={{-50,48},{50,-52}}, |
| 115 | + lineColor={0,0,0}, |
| 116 | + textString="M"),Text( |
| 117 | + origin={0,-80}, |
| 118 | + extent={{-100,-20},{100,20}}, |
| 119 | + fontName="Arial", |
| 120 | + lineColor={0,0,0}, |
| 121 | + textString="%name")}), |
| 122 | + Documentation(info="<html> |
| 123 | +<p> |
| 124 | +This component is the base class for the PSSE induction motor models from the Machines.PSSE sub-package. |
| 125 | +</p> |
| 126 | +</html>")); |
| 127 | +end baseMotor; |
0 commit comments