Skip to content

Commit

Permalink
update to v1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AHaumer committed Jul 10, 2021
1 parent 5c74d21 commit 22c8b35
Show file tree
Hide file tree
Showing 18 changed files with 305 additions and 388 deletions.
122 changes: 84 additions & 38 deletions EMOTH/Chassis/Car2Axle.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ model Car2Axle "Car chassis with 2 axles"
extends VehicleInterfaces.Chassis.Interfaces.TwoAxleBase(final usingMultiBodyDriveline=false);
extends VehicleInterfaces.Icons.Chassis;
parameter EMo.ParameterRecords.Vehicles.VehicleData vehicleData
annotation (Placement(transformation(extent={{20,-10},{40,10}})));
annotation (Placement(transformation(extent={{40,-10},{60,10}})));
output Modelica.Units.SI.Position s(start=0) = mass.s "Vehicle position";
output Modelica.Units.SI.Velocity v(
start=0,
Expand Down Expand Up @@ -62,22 +62,42 @@ model Car2Axle "Car chassis with 2 axles"
rotation=180,
origin={80,70})));
EMo.Sensors.TranslationalMultiSensor translationalMultiSensor
annotation (Placement(transformation(extent={{-20,10},{-40,-10}})));
annotation (Placement(transformation(extent={{-40,10},{-60,-10}})));
EMo.Chassis.Components.DragResistance
dragResistance(
final f_nominal=-vehicleData.Fdrag,
final v_nominal=vehicleData.vNominal)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={-70,-30})));
Components.RollingResistance rollingResistance(final m=vehicleData.m, final v0=
1e-4*vehicleData.vNominal)
annotation (Placement(transformation(extent={{-80,-10},{-60,10}})));
origin={-90,-20})));
Components.RollingResistance rollingResistance1(final m=vehicleData.m/4,
final v0=1e-4*vehicleData.vNominal) annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={-30,-60})));
Components.InclinationResistance inclinationResistance(final m=vehicleData.m)
annotation (Placement(transformation(extent={{-80,20},{-60,40}})));
annotation (Placement(transformation(extent={{-100,10},{-80,30}})));
Modelica.Blocks.Continuous.Integrator integratorEnergy(final k=1)
annotation (Placement(transformation(extent={{-120,40},{-140,60}})));
EMo.Chassis.Components.RollingResistance rollingResistance2(final m=
vehicleData.m/4, final v0=1e-4*vehicleData.vNominal) annotation (
Placement(transformation(
extent={{-10,10},{10,-10}},
rotation=90,
origin={-30,60})));
EMo.Chassis.Components.RollingResistance rollingResistance3(final m=
vehicleData.m/4, final v0=1e-4*vehicleData.vNominal) annotation (
Placement(transformation(
extent={{-10,10},{10,-10}},
rotation=270,
origin={30,-60})));
EMo.Chassis.Components.RollingResistance rollingResistance4(final m=
vehicleData.m/4, final v0=1e-4*vehicleData.vNominal) annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=90,
origin={30,60})));
protected
Interfaces.ChassisBus chassisBus annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
Expand All @@ -98,56 +118,82 @@ equation
annotation (Line(points={{70,70},{70,70},{62,70}}, color={0,0,0}));
connect(inertia_4.flange_a, wheelHub_4.flange) annotation (Line(points={{90,70},
{90,100.05},{89.95,100.05}}, color={0,0,0}));
connect(mass.flange_a, wheel_1.flangeT)
annotation (Line(points={{-10,0},{-10,-70},{-40,-70}}, color={0,127,0}));
connect(mass.flange_b, wheel_3.flangeT) annotation (Line(points={{10,0},{10,0},
{10,-70},{40,-70}}, color={0,127,0}));
connect(mass.flange_a, wheel_2.flangeT) annotation (Line(points={{-10,0},{-10,
0},{-10,70},{-40,70}}, color={0,127,0}));
connect(mass.flange_b, wheel_4.flangeT)
annotation (Line(points={{10,0},{10,70},{42,70}}, color={0,127,0}));
connect(controlBus.chassisBus, chassisBus) annotation (Line(
points={{-158.1,60.1},{-160,60.1},{-160,0}},
color={255,204,51},
thickness=0.5));
connect(rollingResistance.inclination, chassisBus.inclination) annotation (
Line(points={{-82,0},{-160.05,0},{-160.05,0.05}}, color={0,0,127}));
connect(inclinationResistance.inclination, chassisBus.inclination)
annotation (Line(points={{-82,30},{-100,30},{-100,0.05},{-160.05,0.05}},
annotation (Line(points={{-102,20},{-110,20},{-110,0.05},{-160.05,0.05}},
color={0,0,127}));
connect(translationalMultiSensor.s, chassisBus.s) annotation (Line(points={{-30,11},
{-30,11},{-30,50},{-110,50},{-110,0.05},{-160.05,0.05}},
connect(translationalMultiSensor.s, chassisBus.s) annotation (Line(points={{-50,11},
{-50,40},{-110,40},{-110,0.05},{-160.05,0.05}},
color={0,0,127}));
connect(translationalMultiSensor.v, chassisBus.v) annotation (Line(points={{-34.2,
11},{-34.2,50},{-110,50},{-110,0.05},{-160.05,0.05}}, color={0,
connect(translationalMultiSensor.v, chassisBus.v) annotation (Line(points={{-54.2,
11},{-54.2,40},{-110,40},{-110,0.05},{-160.05,0.05}}, color={0,
0,127}));
connect(translationalMultiSensor.a, chassisBus.a) annotation (Line(points={{-38,11},
{-38,50},{-110,50},{-110,0.05},{-160.05,0.05}}, color={0,0,
connect(translationalMultiSensor.a, chassisBus.a) annotation (Line(points={{-58,11},
{-58,40},{-110,40},{-110,0.05},{-160.05,0.05}}, color={0,0,
127}));
connect(translationalMultiSensor.f, chassisBus.f) annotation (Line(points={{-26,11},
{-26,50},{-110,50},{-110,0.05},{-160.05,0.05}}, color={0,0,
connect(translationalMultiSensor.f, chassisBus.f) annotation (Line(points={{-46,11},
{-46,40},{-110,40},{-110,0.05},{-160.05,0.05}}, color={0,0,
127}));
connect(wheel_3.flangeR, inertia_3.flange_b)
annotation (Line(points={{60,-70},{65,-70},{70,-70}}, color={0,0,0}));
connect(rollingResistance.rollingResistance, chassisBus.cr) annotation (Line(
points={{-82,-6},{-100,-6},{-100,0.05},{-160.05,0.05}}, color={0,0,127}));
connect(translationalMultiSensor.power, chassisBus.P) annotation (Line(points={{-22,11},
{-22,11},{-22,50},{-110,50},{-110,0.05},{-160.05,0.05}},
connect(translationalMultiSensor.power, chassisBus.P) annotation (Line(points={{-42,11},
{-42,40},{-110,40},{-110,0.05},{-160.05,0.05}},
color={0,0,127}));
connect(mass.flange_a, translationalMultiSensor.flange_a)
annotation (Line(points={{-10,0},{-15,0},{-20,0}}, color={0,127,0}));
connect(translationalMultiSensor.flange_b, rollingResistance.flange)
annotation (Line(points={{-40,0},{-60,0}}, color={0,127,0}));
annotation (Line(points={{-10,0},{-40,0}}, color={0,127,0}));
connect(translationalMultiSensor.flange_b, inclinationResistance.flange)
annotation (Line(points={{-40,0},{-50,0},{-50,30},{-60,30}}, color={0,127,0}));
annotation (Line(points={{-60,0},{-70,0},{-70,20},{-80,20}}, color={0,127,0}));
connect(translationalMultiSensor.flange_b, dragResistance.flange) annotation (
Line(points={{-40,0},{-46,0},{-50,0},{-50,-30},{-60,-30}}, color={0,127,0}));
Line(points={{-60,0},{-70,0},{-70,-20},{-80,-20}}, color={0,127,0}));
connect(translationalMultiSensor.power, integratorEnergy.u) annotation (Line(
points={{-22,11},{-22,11},{-22,50},{-118,50}}, color={0,0,127}));
points={{-42,11},{-42,50},{-118,50}}, color={0,0,127}));
connect(integratorEnergy.y, chassisBus.E) annotation (Line(points={{-141,50},{-150,
50},{-150,0.05},{-160.05,0.05}}, color={0,0,127}));
connect(dragResistance.vWind, chassisBus.vWind) annotation (Line(points={{-82,
-30},{-100,-30},{-100,0.05},{-160.05,0.05}}, color={0,0,127}));
connect(dragResistance.vWind, chassisBus.vWind) annotation (Line(points={{-102,
-20},{-110,-20},{-110,0.05},{-160.05,0.05}}, color={0,0,127}));
connect(wheel_2.flangeT, rollingResistance2.flange)
annotation (Line(points={{-40,70},{-30,70}}, color={0,127,0}));
connect(rollingResistance2.flange, mass.flange_a)
annotation (Line(points={{-30,70},{-10,70},{-10,0}}, color={0,127,0}));
connect(wheel_4.flangeT, rollingResistance4.flange)
annotation (Line(points={{42,70},{30,70}}, color={0,127,0}));
connect(rollingResistance4.flange, mass.flange_b)
annotation (Line(points={{30,70},{10,70},{10,0}}, color={0,127,0}));
connect(wheel_3.flangeT, rollingResistance3.flange)
annotation (Line(points={{40,-70},{30,-70}}, color={0,127,0}));
connect(rollingResistance3.flange, mass.flange_b)
annotation (Line(points={{30,-70},{10,-70},{10,0}}, color={0,127,0}));
connect(rollingResistance1.flange, mass.flange_a)
annotation (Line(points={{-30,-70},{-10,-70},{-10,0}}, color={0,127,0}));
connect(wheel_1.flangeT, rollingResistance1.flange)
annotation (Line(points={{-40,-70},{-30,-70}}, color={0,127,0}));
connect(rollingResistance1.rollingResistance, chassisBus.cr) annotation (Line(
points={{-36,-48},{-36,-40},{-110,-40},{-110,0.05},{-160.05,0.05}},
color={0,0,127}));
connect(rollingResistance3.rollingResistance, chassisBus.cr) annotation (Line(
points={{36,-48},{36,-40},{-110,-40},{-110,0.05},{-160.05,0.05}}, color=
{0,0,127}));
connect(rollingResistance2.rollingResistance, chassisBus.cr) annotation (Line(
points={{-36,48},{-36,40},{-110,40},{-110,0.05},{-160.05,0.05}}, color=
{0,0,127}));
connect(rollingResistance4.rollingResistance, chassisBus.cr) annotation (Line(
points={{36,48},{36,40},{-110,40},{-110,0.05},{-160.05,0.05}}, color={0,
0,127}));
connect(rollingResistance4.inclination, chassisBus.inclination) annotation (
Line(points={{30,48},{30,40},{-110,40},{-110,0.05},{-160.05,0.05}}, color=
{0,0,127}));
connect(rollingResistance2.inclination, chassisBus.inclination) annotation (
Line(points={{-30,48},{-30,40},{-110,40},{-110,0.05},{-160.05,0.05}},
color={0,0,127}));
connect(rollingResistance3.inclination, chassisBus.inclination) annotation (
Line(points={{30,-48},{30,-40},{-110,-40},{-110,0.05},{-160.05,0.05}},
color={0,0,127}));
connect(rollingResistance1.inclination, chassisBus.inclination) annotation (
Line(points={{-30,-48},{-30,-40},{-110,-40},{-110,0.05},{-160.05,0.05}},
color={0,0,127}));
annotation (Documentation(info="<html>
<p>
Simple 1-dimensioanl chassis model, taking into account:
Expand Down
2 changes: 1 addition & 1 deletion EMOTH/Chassis/Components/RollingResistance.mo
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ model RollingResistance
"Velocity of flange with respect to support (= der(s))";
Modelica.Blocks.Interfaces.RealInput inclination "Inclination"
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
Modelica.Blocks.Interfaces.RealInput rollingResistance "Inclination"
Modelica.Blocks.Interfaces.RealInput rollingResistance "Rolling resistance"
annotation (Placement(transformation(extent={{-140,-80},{-100,-40}})));
equation
v = der(s);
Expand Down
13 changes: 13 additions & 0 deletions EMOTH/DriveLines/Components/Differential.mo
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,23 @@ model Differential "Simple model of a differential"
Modelica.Mechanics.Rotational.Interfaces.Flange_b flange_b2
"driven flange 2 (right)"
annotation (Placement(transformation(extent={{90,-10},{110,10}})));
Modelica.Mechanics.Rotational.Components.IdealPlanetary idealPlanetary(final
ratio=-2) annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,-30})));
equation
/*
2*flange_a.phi = flange_b1.phi + flange_b2.phi;
flange_b2.tau = flange_b1.tau;
flange_a.tau = -(flange_b1.tau + flange_b2.tau);
*/
connect(flange_a, idealPlanetary.ring)
annotation (Line(points={{0,-100},{0,-40}}, color={0,0,0}));
connect(idealPlanetary.sun, flange_b1) annotation (Line(points={{1.77636e-15,-20},
{1.77636e-15,0},{-100,0}}, color={0,0,0}));
connect(idealPlanetary.carrier, flange_b2)
annotation (Line(points={{4,-20},{4,0},{100,0}}, color={0,0,0}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Ellipse(
extent={{-60,60},{60,-60}},
Expand Down
1 change: 0 additions & 1 deletion EMOTH/Drivers/CruiseControl.mo
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ This signal is split into the throttle and the brake signal.
fillPattern=FillPattern.Solid,
textString="%name"), Polygon(
points={{-18,-5},{0,-19},{18,-5},{8,-5},{8,19},{-8,19},{-8,-5},{-18,-5}},
lineColor={0,0,0},
pattern=LinePattern.None,
fillColor={0,140,72},
Expand Down
122 changes: 122 additions & 0 deletions EMOTH/Examples/ExampleTemplate.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
within EMOTH.Examples;
partial model ExampleTemplate "Template for examples"
extends EMOTH.Icons.ExampleTemplate;
replaceable parameter EMOTH.ParameterRecords.Vehicles.VehicleTestData vehicleData
annotation (Placement(transformation(extent={{30,-50},{50,-30}})));
Chassis.Car2Axle chassis(
vehicleData=vehicleData,
a(start=0),
s(start=0, fixed=true),
v(start=0, fixed=true))
annotation (Placement(transformation(extent={{60,-10},{92,10}})));
Brakes.Brakes4wheels brakes4wheels(vehicleData = vehicleData, includeHeatPort = false) annotation (
Placement(transformation(extent={{20,-10},{40,10}})));
DriveLines.RearAxleDrive rearAxleDrive(vehicleData = vehicleData, includeHeatPort = false) annotation (
Placement(transformation(extent = {{-10, -10}, {10, 10}})));
Tracks.Track track annotation (
Placement(transformation(extent = {{60, 40}, {40, 60}})));
replaceable parameter EMOTH.ParameterRecords.ElectricDrives.GenericDrives.DriveTestData driveData
annotation (
Placement(transformation(extent={{-40,-50},{-20,-30}})));
EMOTH.ElectricDrives.GenericDrive genericDrive(driveData=driveData, includeHeatPort=false)
annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
replaceable parameter EMOTH.ParameterRecords.EnergyStorages.BatteryTestData batteryData
annotation (
Placement(transformation(extent={{-80,-50},{-60,-30}})));
EnergyStorages.SimpleBattery battery(batteryData = batteryData, includeHeatPort = false, SoC0=1.0)
annotation (
Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0, origin = {-70, 0})));
Drivers.DriverEnvironment driverEnvironment
annotation (
Placement(transformation(extent={{0,40},{20,60}})));
equation
connect(chassis.wheelHub_2, brakes4wheels.wheelHub_2) annotation (Line(
points={{67,10},{67,18},{24,18},{24,10}},
color={135,135,135},
thickness=0.5));
connect(chassis.wheelHub_4, brakes4wheels.wheelHub_4) annotation (Line(
points={{85,10},{85,22},{36,22},{36,10}},
color={135,135,135},
thickness=0.5));
connect(brakes4wheels.wheelHub_3, chassis.wheelHub_3) annotation (Line(
points={{36,-10},{36,-22},{85,-22},{85,-10}},
color={135,135,135},
thickness=0.5));
connect(brakes4wheels.wheelHub_1, chassis.wheelHub_1) annotation (Line(
points={{24,-10},{24,-18},{67,-18},{67,-10}},
color={135,135,135},
thickness=0.5));
connect(brakes4wheels.wheelHub_2, rearAxleDrive.wheelHub_2) annotation (
Line(points={{24,10},{24,18},{-6,18},{-6,10}}, color = {135, 135, 135}, thickness = 0.5));
connect(brakes4wheels.wheelHub_4, rearAxleDrive.wheelHub_4) annotation (
Line(points={{36,10},{36,22},{6,22},{6,10}}, color = {135, 135, 135}, thickness = 0.5));
connect(brakes4wheels.wheelHub_1, rearAxleDrive.wheelHub_1) annotation (
Line(points={{24,-10},{24,-18},{-6,-18},{-6,-10}}, color = {135, 135, 135}, thickness = 0.5));
connect(brakes4wheels.wheelHub_3, rearAxleDrive.wheelHub_3) annotation (
Line(points={{36,-10},{36,-22},{6,-22},{6,-10}}, color = {135, 135, 135}, thickness = 0.5));
connect(genericDrive.shaft_b, rearAxleDrive.transmissionFlange) annotation (
Line(
points={{-20,0},{-20,0},{-10,0}},
color={135,135,135},
thickness=0.5));
connect(battery.pin_p, genericDrive.pin_p) annotation (Line(points={{-64,10},{
-64,10},{-64,22},{-24,22},{-24,10}}, color={0,0,255}));
connect(battery.pin_n, genericDrive.pin_n) annotation (Line(points={{-76,10},{
-76,10},{-76,18},{-36,18},{-36,10}}, color={0,0,255}));
connect(rearAxleDrive.controlBus, genericDrive.controlBus) annotation (Line(
points={{-10,6},{-14,6},{-14,30},{-44,30},{-44,-6},{-40,-6}},
color={255,204,51},
thickness=0.5));
connect(rearAxleDrive.controlBus, battery.controlBus) annotation (
Line(points={{-10,6},{-14,6},{-14,30},{-84,30},{-84,-6},{-80,-6}}, color = {255, 204, 51}, thickness = 0.5));
connect(track.controlBus, driverEnvironment.controlBus) annotation (
Line(points={{40,56},{20,56}}, color = {255, 204, 51}, thickness = 0.5));
connect(rearAxleDrive.controlBus, track.controlBus) annotation (Line(
points={{-10,6},{-14,6},{-14,30},{30,30},{30,56},{40,56}},
color={255,204,51},
thickness=0.5));
connect(rearAxleDrive.controlBus, brakes4wheels.controlBus) annotation (Line(
points={{-10,6},{-14,6},{-14,30},{16,30},{16,6},{20,6}},
color={255,204,51},
thickness=0.5));
connect(brakes4wheels.controlBus, chassis.controlBus) annotation (Line(
points={{20,6},{16,6},{16,30},{56,30},{56,6},{60.2,6}},
color={255,204,51},
thickness=0.5));
annotation (
experiment(
StopTime=86400,
Interval=0.1,
__Dymola_Algorithm="Dassl"),
Documentation(info="<html>
<p>
Example template for a full electric vehicle.
</p>
<h4>Note:</h4>
<p>
Checking this example template you get a warning / error message. You have to connect an appropriate model to the <code>driverEnvironment.driverInterface</code>:
</p>
<ul>
<li><a href=\"modelica://EMOTH.Drivers.ThrottleAndBrake\">throttleAndBrake</a></li>
<li><a href=\"modelica://EMOTH.Drivers.Driver\">driver</a></li>
<li><a href=\"modelica://EMOTH.Drivers.CruiseControl\">cruiseControl</a></li>
</ul>
<p>
Don't forget to set:
</p>
<ul>
<li><code>driverEnvironment.useDriverModel</code></li>
<li><code>driverEnvironment.useRecuperation</code></li>
<li><code>track.inclinationData</code></li>
<li><code>track.rollingResistanceData</code></li>
<li><code>chassis.v.start</code>; using a <a href=\"modelica://EMOTH.Drivers.DrivingCycle\">driving cycle</a>, you may set <code>chassis.v.start=drivingCycle.v0</code></li>
</ul>
<p>
You may want to add:
</p>
<ul>
<li>an <a href=\"modelica://EMOTH.Accessories.ElectricalAccessories\">electricalAccesories</a> model</li>
<li>a <a href=\"modelica://EMOTH.Accessories.RangeExtender\">rangeExtender</a></li>
</ul>
</html>"));
end ExampleTemplate;
Loading

0 comments on commit 22c8b35

Please sign in to comment.