@@ -252,9 +252,11 @@ package ControlsMotors "Control models"
252252 Modelica.Blocks.Sources.BooleanExpression open_circuit_condition(y= if
253253 Resistor.i < = 0 then true else false )
254254 annotation (Placement(transformation(extent={{52,6},{32,26}})));
255- Modelica.Blocks.Sources.RealExpression Pmotor(y= - (n.vr* n.ir + n.vi* n.ii))
255+ Modelica.Blocks.Sources.RealExpression Pmotor(y= - (n.vr* n.ir + n.vi* n.ii)
256+ * SPEED_INPUT/ wb)
256257 annotation (Placement(transformation(extent={{24,70},{44,90}})));
257- Modelica.Blocks.Sources.RealExpression Qmotor(y= (n.vr* n.ii - n.vi* n.ir))
258+ Modelica.Blocks.Sources.RealExpression Qmotor(y= (n.vr* n.ii - n.vi* n.ir)
259+ * SPEED_INPUT/ wb)
258260 annotation (Placement(transformation(extent={{24,54},{44,74}})));
259261 OpenIPSL.Types.PerUnit P;
260262 Modelica.Units.SI.ActivePower Pdc;
@@ -297,6 +299,7 @@ package ControlsMotors "Control models"
297299 annotation (Dialog(group="DC Link Parameters" ));
298300 parameter Real m0= 0.1 "Initial PWM Modulation Value" annotation (Dialog(group="DC Link Parameters" ));
299301 parameter Real N= 1 ;
302+ Real SPEED_INPUT;
300303
301304 parameter Modelica.Units.SI.AngularVelocity wb = 2 * pi* fn/ N;
302305 Modelica.Blocks.Sources.RealExpression Smotor(y= sqrt (Pmotor.y^ 2 + Qmotor.y^ 2 ))
@@ -306,6 +309,14 @@ package ControlsMotors "Control models"
306309 extent={{-10,10},{10,-10}},
307310 rotation=270,
308311 origin={-46,-14})));
312+ Modelica.Blocks.Interfaces.RealInput speed_input annotation (Placement(
313+ transformation(
314+ extent={{-20,-20},{20,20}},
315+ rotation=180,
316+ origin={120,-60}), iconTransformation(
317+ extent={{-20,-20},{20,20}},
318+ rotation=180,
319+ origin={140,-60})));
309320 protected
310321 parameter OpenIPSL.Types.Voltage Vd00 = 3 * sqrt (6 )* v_0* V_b/ Modelica.Constants.pi;
311322 parameter OpenIPSL.Types.Voltage Vc0 = 2 * sqrt (2 )* Vmotor0* V_b/ m0;
@@ -332,6 +343,8 @@ package ControlsMotors "Control models"
332343 connect (signalCurrent.i, Ii.y) annotation (Line(points={{62,-14},{67,-14}}, color={0,0,127}));
333344 connect (open_circuit_condition.y, switch.control)
334345 annotation (Line(points={{31,16},{20,16},{20,12}}, color={255,0,255}));
346+ SPEED_INPUT = speed_input;
347+
335348 P = (p.vr* p.ir + p.vi* p.ii);
336349 Q = ((- p.vr* p.ii) + p.vi* p.ir);
337350 Q = 0 ;
0 commit comments