Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 1f6c2c33 authored by Stefanos Doumpoulakis's avatar Stefanos Doumpoulakis
Browse files

added controller for PWheel, integration tests for PWheel E4

parent 731b2b61
No related branches found
No related tags found
No related merge requests found
Showing
with 53907 additions and 29 deletions
......@@ -809,25 +809,18 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
es.Connect(superCap);
}
var ctl = new BatteryElectricMotorController(container, es);
var ctl = new PWheelBatteryElectricMotorController(container, es);
var aux = new ElectricAuxiliary(container);
aux.AddConstant("P_aux_el", data.ElectricAuxDemand ?? 0.SI<Watt>());
es.Connect(aux);
var position = data.ElectricMachinesData.First().Item1;
var powertrain = new PWheelCycle(container, data.Cycle);
if (position == PowertrainPosition.BatteryElectricE2) {
powertrain
.AddComponent(GetRetarder(RetarderType.TransmissionOutputRetarder, data.Retarder, container))
.AddComponent(new CycleGearbox(container, data))
.AddComponent(GetRetarder(RetarderType.TransmissionInputRetarder, data.Retarder, container));
}
IElectricMotor em;
var position = data.ElectricMachinesData.First().Item1;
switch (position)
{
case PowertrainPosition.BatteryElectricE4:
......@@ -853,6 +846,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
powertrain
.AddComponent(new AxleGear(container, data.AxleGearData))
.AddComponent(data.AngledriveData != null ? new Angledrive(container, data.AngledriveData) : null)
.AddComponent(GetRetarder(RetarderType.TransmissionOutputRetarder, data.Retarder, container))
.AddComponent(new CycleGearbox(container, data))
.AddComponent(GetRetarder(RetarderType.TransmissionInputRetarder, data.Retarder, container))
.AddComponent(em);
new ATClutchInfo(container);
new DummyEngineInfo(container);
......
......@@ -43,8 +43,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
return null;
}
if ((DataBus.VehicleInfo.VehicleSpeed ?? 0.SI<MeterPerSecond>()).IsSmallerOrEqual(GearboxModelData?.DisengageWhenHaltingSpeed ?? Constants.SimulationSettings.ClutchDisengageWhenHaltingSpeed)
&& outTorque.IsSmaller(0)) {
if (CannotProvideMechanicalAssistAtLowSpeed(outTorque)) {
return null;
}
......@@ -53,8 +52,16 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
}
return (-outTorque).LimitTo(maxDriveTorque, maxRecuperationTorque ?? VectoMath.Max(maxDriveTorque, 0.SI<NewtonMeter>()));
}
#endregion
protected virtual bool CannotProvideMechanicalAssistAtLowSpeed(NewtonMeter outTorque)
{
return (DataBus.VehicleInfo.VehicleSpeed ?? 0.SI<MeterPerSecond>()).IsSmallerOrEqual(
GearboxModelData?.DisengageWhenHaltingSpeed ?? Constants.SimulationSettings.ClutchDisengageWhenHaltingSpeed)
&& outTorque.IsSmaller(0);
}
#endregion
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Models.Simulation.Impl;
namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{
public class PWheelBatteryElectricMotorController : BatteryElectricMotorController
{
public PWheelBatteryElectricMotorController(VehicleContainer container, ElectricSystem es) : base(container, es)
{}
protected override bool CannotProvideMechanicalAssistAtLowSpeed(NewtonMeter outTorque)
{
return false;
}
}
}
......@@ -69,7 +69,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
// just to ensure that null-gear has ratio 1
gearRatios[0] = 1;
var axleRatio = RunData.AxleGearData.AxleGear.Ratio;
var axleRatio = (RunData.AxleGearData != null) ? RunData.AxleGearData.AxleGear.Ratio : 1;
var emData = RunData.ElectricMachinesData.First().Item2;
......
......@@ -36,21 +36,25 @@ namespace TUGraz.VectoCore.Tests.Integration.BatteryElectric
TestCase(E2_JOB, 7, 1, 4.3124, 117.0889, TestName = "E2 BEV TimeRun MeasuredSpeedGear RegionalDelivery"),
TestCase(E2_JOB, 8, 2, 28.7993, 125.4735, TestName = "E2 BEV TimeRun MeasuredSpeedGear UrbanDelivery"),
TestCase(E2_JOB, 9, 0, 0.0028, 120.269, TestName = "E2 BEV TimeRun MeasuredSpeedPWheel LongHaul"),
TestCase(E2_JOB, 10, 1, 0.0226, 117.7803, TestName = "E2 BEV TimeRun MeasuredSpeedPWheel RegionalDelivery"),
TestCase(E2_JOB, 11, 2, 0.2723, 130.6771, TestName = "E2 BEV TimeRun MeasuredSpeedPWheel UrbanDelivery"),
TestCase(E2_JOB, 9, 0, 1.1661, 120.0129, TestName = "E2 BEV TimeRun MeasuredSpeedPWheel LongHaul"),
TestCase(E2_JOB, 10, 1, 4.6925, 117.3748, TestName = "E2 BEV TimeRun MeasuredSpeedPWheel RegionalDelivery"),
TestCase(E2_JOB, 11, 2, 31.7336, 127.926, TestName = "E2 BEV TimeRun MeasuredSpeedPWheel UrbanDelivery"),
TestCase(E3_JOB, 0, 0, 0.7916, 101.6194, TestName = "E3 BEV TimeRun MeasuredSpeed LongHaul"),
TestCase(E3_JOB, 1, 1, 3.3777, 104.792, TestName = "E3 BEV TimeRun MeasuredSpeed RegionalDelivery"),
TestCase(E3_JOB, 2, 2, 28.1637, 128.3685, TestName = "E3 BEV TimeRun MeasuredSpeed UrbanDelivery"),
TestCase(E3_JOB, 6, 0, 0, 98.8855, TestName = "E3 BEV TimeRun MeasuredSpeedPWheel LongHaul"),
TestCase(E3_JOB, 7, 1, 0, 0, TestName = "E3 BEV TimeRun MeasuredSpeedPWheel RegionalDelivery"),
TestCase(E3_JOB, 8, 2, 0, 0, TestName = "E3 BEV TimeRun MeasuredSpeedPWheel UrbanDelivery"),
TestCase(E3_JOB, 6, 0, 0.8476, 101.5911, TestName = "E3 BEV TimeRun MeasuredSpeedPWheel LongHaul"),
TestCase(E3_JOB, 7, 1, 3.611, 104.7354, TestName = "E3 BEV TimeRun MeasuredSpeedPWheel RegionalDelivery"),
TestCase(E3_JOB, 8, 2, 30.5738, 127.6631, TestName = "E3 BEV TimeRun MeasuredSpeedPWheel UrbanDelivery"),
TestCase(E4_JOB, 0, 0, 0.9165, 97.3067, TestName = "E4 BEV TimeRun MeasuredSpeed LongHaul"),
TestCase(E4_JOB, 1, 1, 3.7896, 100.3712, TestName = "E4 BEV TimeRun MeasuredSpeed RegionalDelivery"),
TestCase(E4_JOB, 2, 2, 30.1342, 123.7528, TestName = "E4 BEV TimeRun MeasuredSpeed UrbanDelivery")
TestCase(E4_JOB, 2, 2, 30.1342, 123.7528, TestName = "E4 BEV TimeRun MeasuredSpeed UrbanDelivery"),
TestCase(E4_JOB, 6, 0, 0.9741, 97.2793, TestName = "E4 BEV TimeRun MeasuredSpeedPWheel LongHaul"),
TestCase(E4_JOB, 7, 1, 4.0286, 100.3147, TestName = "E4 BEV TimeRun MeasuredSpeedPWheel RegionalDelivery"),
TestCase(E4_JOB, 8, 2, 32.6304, 123.0436, TestName = "E4 BEV TimeRun MeasuredSpeedPWheel UrbanDelivery")
]
public void TestBEVTimeRunCycle(string jobFile, int cycleIdx, int distanceCycleIdx, double charge, double discharge)
{
......@@ -111,7 +115,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BatteryElectric
AssertHelper.AssertMetrics(factory, metrics);
//Directory.Delete(Path.GetDirectoryName(outputFile), recursive: true);
Directory.Delete(Path.GetDirectoryName(outputFile), recursive: true);
}
public void RunBEVDistanceRunCycle(string jobFile, int cycleIdx, Dictionary<String, double> metrics)
......@@ -137,7 +141,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BatteryElectric
AssertHelper.AssertMetrics(factory, metrics);
Directory.Delete(Path.GetDirectoryName(outputFile), recursive: true);
//Directory.Delete(Path.GetDirectoryName(outputFile), recursive: true);
}
}
}
......@@ -27,11 +27,14 @@
},
"Cycles": [
"MeasuredSpeed_LongHaul.vdri",
"MeasuredSpeed_RegionalDelivery.vdri",
"MeasuredSpeed_UrbanDelivery.vdri",
"LongHaul",
"RegionalDelivery",
"UrbanDelivery"
"MeasuredSpeed_RegionalDelivery.vdri",
"MeasuredSpeed_UrbanDelivery.vdri",
"LongHaul",
"RegionalDelivery",
"UrbanDelivery",
"PWheel_LongHaul.vdri",
"PWheel_RegionalDelivery.vdri",
"PWheel_UrbanDelivery.vdri"
]
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment