Skip to content

Commit

Permalink
Fix for sign problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Dag Brück committed Feb 7, 2024
1 parent 0bbef79 commit cde0ad6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
18 changes: 9 additions & 9 deletions examples/DC-Motor2023/models/sse_edrive/emachine.mo
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ model emachine "DC-Motor for a mild hybrid application"
Modelica.Electrical.Analog.Sensors.CurrentSensor currentSensor annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=270,
origin={-60,2})));
origin={-60,0})));
Modelica.Blocks.Interfaces.RealOutput I(unit="A") annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=180,
Expand All @@ -45,7 +45,7 @@ model emachine "DC-Motor for a mild hybrid application"
rotation=180,
origin={110,60})));
Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
extent={{10,-10},{-10,10}},
rotation=90,
origin={-60,40})));
Modelica.Blocks.Interfaces.RealInput U(unit="V") annotation (Placement(transformation(
Expand All @@ -54,7 +54,7 @@ model emachine "DC-Motor for a mild hybrid application"
origin={-120,60})));
equation
connect(currentSensor.i, I)
annotation (Line(points={{-71,2},{-88,2},{-88,-60},{-110,-60}}, color={0,0,127}));
annotation (Line(points={{-71,0},{-88,0},{-88,-60},{-110,-60}}, color={0,0,127}));
connect(angleToTorqueAdaptor.flange, emf.flange)
annotation (Line(points={{58,0},{50,0}}, color={0,0,0}));
connect(angleToTorqueAdaptor.w, w)
Expand All @@ -67,13 +67,13 @@ equation
connect(emf.p, inductor.n) annotation (Line(points={{40,10},{40,30}}, color={0,0,255}));
connect(emf.n, ground.p) annotation (Line(points={{40,-10},{40,-40},{-10,-40}}, color={0,0,255}));
connect(ground.p, currentSensor.p)
annotation (Line(points={{-10,-40},{-60,-40},{-60,-8}}, color={0,0,255}));
connect(signalVoltage.n, resistor.p)
annotation (Line(points={{-60,50},{-60,60},{-20,60}}, color={0,0,255}));
connect(signalVoltage.p, currentSensor.n)
annotation (Line(points={{-60,30},{-60,12}}, color={0,0,255}));
annotation (Line(points={{-10,-40},{-60,-40},{-60,-10}},color={0,0,255}));
connect(signalVoltage.v, U)
annotation (Line(points={{-72,40},{-94,40},{-94,60},{-120,60}}, color={0,0,127}));
annotation (Line(points={{-72,40},{-90,40},{-90,60},{-120,60}}, color={0,0,127}));
connect(signalVoltage.p, resistor.p)
annotation (Line(points={{-60,50},{-60,60},{-20,60}}, color={0,0,255}));
connect(signalVoltage.n, currentSensor.n)
annotation (Line(points={{-60,30},{-60,10}}, color={0,0,255}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(
preserveAspectRatio=false)));
end emachine;
12 changes: 7 additions & 5 deletions examples/DC-Motor2023/models/sse_edrive/stimuli.mo
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ model stimuli "Stimulus of e-drive example"
annotation (Placement(transformation(rotation=0, extent={{100,50},{120,70}})));
Modelica.Blocks.Math.Gain gain(
k=-1,
u(unit="V"),
y(unit="V")) annotation (Placement(transformation(extent={{0,30},{20,50}})));
u(unit="N.m"),
y(unit="N.m"))
annotation (Placement(transformation(extent={{0,-70},{20,-50}})));
equation
connect(M_load, MLoad.y) annotation (Line(points={{110,-60},{-39,-60}}, color={0,0,127}));
connect(U, gain.y) annotation (Line(points={{110,60},{70,60},{70,40},{21,40}}, color={0,0,127}));
connect(gain.u, Voltage_step.y) annotation (Line(points={{-2,40},{-39,40}}, color={0,0,127}));
connect(M_load, gain.y) annotation (Line(points={{110,-60},{21,-60}}, color={0,0,127}));
connect(gain.u, MLoad.y) annotation (Line(points={{-2,-60},{-39,-60}}, color={0,0,127}));
connect(Voltage_step.y, U)
annotation (Line(points={{-39,40},{32,40},{32,60},{110,60}}, color={0,0,127}));
end stimuli;

0 comments on commit cde0ad6

Please sign in to comment.