Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dag bruck #75

Merged
merged 9 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified examples/DC-Motor2023.ssp
Binary file not shown.
5 changes: 1 addition & 4 deletions examples/DC-Motor2023/DC-motor-mechanic.ssd
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@
<ssv:Parameter name="Voltage_step.offset" description="Offset of output signal y">
<ssv:Real value="0.0"/>
</ssv:Parameter>
<ssv:Parameter name="gain.k" description="Gain value multiplied with input signal">
<ssv:Real value="1.0" unit="1"/>
</ssv:Parameter>
<ssv:Parameter name="MLoad.k" description="Constant output value">
<ssv:Real value="-1.0" unit="N.m"/>
<ssv:Real value="1.0" unit="N.m"/>
</ssv:Parameter>
<ssv:Parameter name="Voltage_step.startTime" description="Output y = offset for time &lt; startTime">
<ssv:Real value="0.0" unit="s"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,7 @@
<ssv:Real value="1.0" unit="N.m"/>
</ssv:Parameter>
<ssv:Parameter name="Voltage_step.height" description="Height of step">
<ssv:Real value="-48.0" unit="V"/>
</ssv:Parameter>
<ssv:Parameter name="gain.k" description="Gain value multiplied with input signal">
<ssv:Real value="1.0" unit="1"/>
<ssv:Real value="48.0" unit="V"/>
</ssv:Parameter>
<ssv:Parameter name="Voltage_step.startTime" description="Output y = offset for time &lt; startTime">
<ssv:Real value="0.0" unit="s"/>
Expand Down
12 changes: 3 additions & 9 deletions examples/DC-Motor2023/SystemStructure.ssd
Original file line number Diff line number Diff line change
Expand Up @@ -424,17 +424,14 @@
<ssv:ParameterSet version="1.0" name="Parameter-Set">
<ssv:Parameters>
<ssv:Parameter name="Voltage_step.height" description="Height of step">
<ssv:Real value="-48.0" unit="V"/>
<ssv:Real value="48.0" unit="V"/>
</ssv:Parameter>
<ssv:Parameter name="Voltage_step.offset" description="Offset of output signal y">
<ssv:Real value="0.0"/>
</ssv:Parameter>
<ssv:Parameter name="Voltage_step.startTime" description="Output y = offset for time &lt; startTime">
<ssv:Real value="0.0" unit="s"/>
</ssv:Parameter>
<ssv:Parameter name="gain.k" description="Gain value multiplied with input signal">
<ssv:Real value="1.0" unit="1"/>
</ssv:Parameter>
<ssv:Parameter name="MLoad.k" description="Constant output value">
<ssv:Real value="1.0" unit="N.m"/>
</ssv:Parameter>
Expand Down Expand Up @@ -470,14 +467,11 @@
<ssv:Real value="0.0"/>
</ssv:Parameter>
<ssv:Parameter name="Voltage_step.height" description="Height of step">
<ssv:Real value="-48.0" unit="V"/>
<ssv:Real value="48.0" unit="V"/>
</ssv:Parameter>
<ssv:Parameter name="Voltage_step.startTime" description="Output y = offset for time &lt; startTime">
<ssv:Real value="0.0" unit="s"/>
</ssv:Parameter>
<ssv:Parameter name="gain.k" description="Gain value multiplied with input signal">
<ssv:Real value="1.0" unit="1"/>
</ssv:Parameter>
<ssv:Parameter name="MLoad.k" description="Constant output value">
<ssv:Real value="1.0" unit="N.m"/>
</ssv:Parameter>
Expand Down Expand Up @@ -514,7 +508,7 @@
<ssv:Real value="1.0" unit="N.m"/>
</ssv:Parameter>
<ssv:Parameter name="Voltage_step.height" description="Height of step">
<ssv:Real value="-48.0" unit="V"/>
<ssv:Real value="48.0" unit="V"/>
</ssv:Parameter>
<ssv:Parameter name="Voltage_step.startTime" description="Output y = offset for time &lt; startTime">
<ssv:Real value="0.0" unit="s"/>
Expand Down
3 changes: 3 additions & 0 deletions examples/DC-Motor2023/models/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Models

These are the Modelica source models used to generate the FMUs of this example.
34 changes: 34 additions & 0 deletions examples/DC-Motor2023/models/sse_edrive/Export FMUs.mos
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Script to export FMUs from library.
// Script generated by Dymola.

OutputCPUtime = false;
Advanced.Translation.EnableCodeExport=true;
Advanced.FMI.CrossExport=true;

translateModelFMU(
"sse_edrive.stimuli",
false,
"stimuli_model",
"2",
"all",
true,
0,
fill("", 0));
translateModelFMU(
"sse_edrive.emachine",
false,
"emachine_model",
"2",
"all",
true,
0,
fill("", 0));
translateModelFMU(
"sse_edrive.mass_damper",
false,
"edrive_mass",
"2",
"all",
true,
0,
fill("", 0));
110 changes: 110 additions & 0 deletions examples/DC-Motor2023/models/sse_edrive/emachine.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
within sse_edrive;
model emachine "DC-Motor for a mild hybrid application"
Modelica.Electrical.Analog.Basic.Ground ground
annotation (Placement(transformation(extent={{-20,-60},{0,-40}})));
Modelica.Electrical.Analog.Basic.Resistor resistor(
R=1,
T_ref=300.15,
alpha=0,
T=300.15) annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=180,
origin={-10,60})));
Modelica.Electrical.Analog.Basic.Inductor inductor(L=0.001, i(start=0)) annotation (Placement(
transformation(
extent={{10,-10},{-10,10}},
rotation=90,
origin={40,40})));
Modelica.Electrical.Analog.Basic.RotationalEMF emf(k=0.01) annotation (Placement(transformation(
extent={{10,10},{-10,-10}},
rotation=180,
origin={40,0})));
Modelica.Electrical.Analog.Sensors.CurrentSensor currentSensor annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=270,
origin={-60,0})));
Modelica.Blocks.Interfaces.RealOutput I(unit="A") annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=180,
origin={-110,-60})));
Modelica.Mechanics.Rotational.Components.AngleToTorqueAdaptor angleToTorqueAdaptor(use_a=false)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=180,
origin={60,0})));
Modelica.Blocks.Interfaces.RealInput w(unit="rad/s") annotation (Placement(transformation(
extent={{-20,-20},{20,20}},
rotation=180,
origin={120,-20})));
Modelica.Blocks.Interfaces.RealInput phi(unit="rad") annotation (Placement(transformation(
extent={{-20,-20},{20,20}},
rotation=180,
origin={120,-60})));
Modelica.Blocks.Interfaces.RealOutput M(unit="N.m") annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=180,
origin={110,60})));
Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=90,
origin={-60,40})));
Modelica.Blocks.Interfaces.RealInput U(unit="V") annotation (Placement(transformation(
extent={{-20,-20},{20,20}},
rotation=0,
origin={-120,60})));
equation
connect(currentSensor.i, I)
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)
annotation (Line(points={{63,-5},{83,-5},{83,-20},{120,-20}}, color={0,0,127}));
connect(angleToTorqueAdaptor.tau, M)
annotation (Line(points={{63,8},{76,8},{76,60},{110,60}}, color={0,0,127}));
connect(phi, angleToTorqueAdaptor.phi)
annotation (Line(points={{120,-60},{76,-60},{76,-8},{63,-8}}, color={0,0,127}));
connect(resistor.n, inductor.p) annotation (Line(points={{0,60},{40,60},{40,50}}, color={0,0,255}));
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,-10}},color={0,0,255}));
connect(signalVoltage.v, U)
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)),
__Dymola_UserMetaData(MetaData(category="DC-Motor-el Meta-Data (DC-Motor-el.srmd)", value={{
"Type: de.setlevel.srmd.model-meta-data=",""},{"model.type","physical principle"},{
"physical-principle.family","ex: Electrical"},{"physical-principle.name","ex: motor"},{
"physical-principle.technology","ex: DC"},{"physical-principle.technology.variant",
"ex: el-magn"},{"model.manufacturer","GlueParticle"},{"model.family"," DC-Motor"},{
"model.name","DC-Motor-el"},{"model.version","GPsim2.03"},{"model.releasedate",
"2022-02-01"},{"model.releasestatus","In Development"},{"model.guid",
"For FMU-based models, this should be the GUID of the FMU, e.g. 7ae4-210f-dead-beef-0422"},
{"model.purpose","Pre-development of systems with DC-motors"},{
"model.modelling-approach",
"basic physical equations of the electrical part of a DC motor is causal modeled"},{
"model.preconditions","-none-"},{"model.validity-range","basic physical equations"},{
"model.specification","link to specification document"},{"model.verification.status",
"false"},{"model.verification.report",""},{"model.validation.concept",""},{
"model.validation.status","false"},{"model.validation.platform",
"Dymola V112 and PMSF FMIBench 1.9.9.4 on Windows 10 1809"},{"model.validation.report",
""},{"model.limitations","This delivery is a pre-release and the model is intended to be used for pre-development
The model is not validated; thus it is not intended to be used for validation or verification of any actuator.

This delivery is not developed according to process defined in ISO 26262 (Standard for Functional Safety).
"},{"model.implementation.format","FMI 2.0"},{"model.implementation.preconditions",
"Model needs Windows 10 1809 or newer or Linux"},{
"model.implementation.performance-characteristics",
"Potentially real-time capable, simple differential equation 1 order"},{
"model.integration.requirements",
"link to requirements and considerations for operating the model"},{
"Type: de.setlevel.srmd.ISO-11010-X=",""},{"part",
"The part of the ISO-11010 relevant for model, for example 1 if ISO-11010-1"},{"plant",
"The relevant nomencalture convention for the plant part of the model if applicable, for example a Model of the Brake physical system: BRM2.2"},
{"controller",
"The relevant nomencalture convention for the controller part of the model if applicable, for example a Model of the Brake controller system: BRC2.1"}})));
end emachine;
59 changes: 59 additions & 0 deletions examples/DC-Motor2023/models/sse_edrive/mass.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
within sse_edrive;
model mass "Rotational mass (load)"
Modelica.Mechanics.Rotational.Components.TorqueToAngleAdaptor torqueToAngleAdaptor(use_a=false)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=180,
origin={-50,0})));
Modelica.Mechanics.Rotational.Components.TorqueToAngleAdaptor torqueToAngleAdaptor1(use_a=false)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={50,0})));
Modelica.Mechanics.Rotational.Components.Inertia inertia(
J=0.002,
phi(start=0),
w(start=0),
a(start=0)) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
Modelica.Blocks.Interfaces.RealInput M_A(unit="N.m")
annotation (Placement(transformation(extent={{-140,40},{-100,80}})));
Modelica.Blocks.Interfaces.RealOutput wA(unit="rad/s") annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=180,
origin={-110,-20})));
Modelica.Blocks.Interfaces.RealOutput phiA(unit="rad") annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=180,
origin={-110,-60})));
Modelica.Blocks.Interfaces.RealInput M_B(unit="N.m") annotation (Placement(transformation(
extent={{-20,-20},{20,20}},
rotation=180,
origin={120,-60})));
Modelica.Blocks.Interfaces.RealOutput wB(unit="rad/s") annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={110,20})));
Modelica.Blocks.Interfaces.RealOutput phiB(unit="rad") annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={110,60})));
equation
connect(inertia.flange_a, torqueToAngleAdaptor.flange)
annotation (Line(points={{-10,0},{-48,0}}, color={0,0,0}));
connect(inertia.flange_b, torqueToAngleAdaptor1.flange)
annotation (Line(points={{10,0},{48,0}}, color={0,0,0}));
connect(torqueToAngleAdaptor.tau, M_A)
annotation (Line(points={{-53,8},{-80,8},{-80,60},{-120,60}}, color={0,0,127}));
connect(torqueToAngleAdaptor.w, wA)
annotation (Line(points={{-53,-5},{-80.5,-5},{-80.5,-20},{-110,-20}}, color={0,0,127}));
connect(torqueToAngleAdaptor.phi, phiA)
annotation (Line(points={{-53,-8},{-70,-8},{-70,-60},{-110,-60}}, color={0,0,127}));
connect(torqueToAngleAdaptor1.phi, phiB)
annotation (Line(points={{53,8},{70,8},{70,60},{110,60}}, color={0,0,127}));
connect(torqueToAngleAdaptor1.w, wB)
annotation (Line(points={{53,5},{80,5},{80,20},{110,20}}, color={0,0,127}));
connect(torqueToAngleAdaptor1.tau, M_B)
annotation (Line(points={{53,-8},{80,-8},{80,-60},{120,-60}}, color={0,0,127}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(
preserveAspectRatio=false)));
end mass;
16 changes: 16 additions & 0 deletions examples/DC-Motor2023/models/sse_edrive/mass_damper.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
within sse_edrive;
model mass_damper "Rotational mass with damper"
extends mass;
Modelica.Mechanics.Rotational.Components.Damper damper(d=0.001)
annotation (Placement(transformation(extent={{-10,-50},{10,-30}})));
Modelica.Mechanics.Rotational.Components.Fixed fixed
annotation (Placement(transformation(extent={{20,-50},{40,-30}})));
equation
connect(fixed.flange, damper.flange_b) annotation (Line(points={{30,-40},{10,-40}}, color={0,0,0}));
connect(inertia.flange_a, torqueToAngleAdaptor.flange)
annotation (Line(points={{-10,0},{-48,0}}, color={0,0,0}));
connect(inertia.flange_a, damper.flange_a)
annotation (Line(points={{-10,0},{-30,0},{-30,-40},{-10,-40}}, color={0,0,0}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(
preserveAspectRatio=false)));
end mass_damper;
9 changes: 9 additions & 0 deletions examples/DC-Motor2023/models/sse_edrive/package.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
within ;
package sse_edrive "ProSTEP Smart System Engineering DCMmotor example"

annotation (
uses(Modelica(version="4.0.0")),
version="1.2.0",
conversion(noneFromVersion=""),
versionDate="2024-02-16");
end sse_edrive;
7 changes: 7 additions & 0 deletions examples/DC-Motor2023/models/sse_edrive/package.order
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
emachine
mass
mass_damper
spring_mass
stimuli
test_spring_mass
test
Loading
Loading