diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs index 4df9c70a3c7a034acd0af0f875d48f3ab0616bad..f61e127a710b75925432dd92f6d8a2225e0f8352 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs @@ -164,7 +164,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.ElectricMotor }, searcher: this); var tmp = LookupElectricPower(avgSpeed, retVal, true); - if ((tmp.ElectricalPower - batPower).IsGreater(Constants.SimulationSettings.InterpolateSearchTolerance)) { + if (VectoMath.Abs(tmp.ElectricalPower - batPower).IsGreater(Constants.SimulationSettings.InterpolateSearchTolerance)) { // searched operating point is not accurate enough... retVal = SearchAlgorithm.Search( maxEmTorque, elPowerMaxEM.ElectricalPower - batPower, diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricMotor.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricMotor.cs index 69ad5fe4a116341f53ad34188a71f8c501187625..8e6eb79c42a418d9a4d633a9e1885531d03844f2 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricMotor.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricMotor.cs @@ -161,7 +161,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var avgEmSpeed = (prevEmSpeed + emSpeed) / 2; var inertiaTorqueEm = avgEmSpeed.IsEqual(0) ? 0.SI<NewtonMeter>() - : Formulas.InertiaPower(avgEmSpeed, PreviousState.EMSpeed, ModelData.Inertia, dt) / avgEmSpeed; + : Formulas.InertiaPower(emSpeed, PreviousState.EMSpeed, ModelData.Inertia, dt) / avgEmSpeed; var maxDriveTorqueEmMap = GetMaxDriveTorque(voltage, dt, avgEmSpeed, gear); var maxRecuperationTorqueEmMap = GetMaxRecuperationTorque(voltage, dt, avgEmSpeed, gear); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs index 38e36b8cf9a9cdaef02709c0dec790d6404a75f1..33b5db495e30054cf3643e1018c8a9489dbf1517 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs @@ -1298,6 +1298,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies } } else { if (emRecuperationTq.IsGreater(0)) { + var voltage = DataBus.BatteryInfo.InternalVoltage; + var maxbatDragTq = DataBus.ElectricMotorInfo(emPos).GetTorqueForElectricPower(voltage, + response.ElectricSystem.MaxPowerDrag, response.ElectricMotor.AngularVelocity, dt, nextGear, + false); eval.Add( new HybridResultEntry { ICEOff = !DataBus.EngineInfo.EngineOn, @@ -1307,7 +1311,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies GearboxInNeutral = false, NextGear = nextGear, MechanicalAssistPower = new Dictionary<PowertrainPosition, Tuple<PerSecond, NewtonMeter>> { - { emPos, Tuple.Create(response.ElectricMotor.AngularVelocity, response.ElectricMotor.MaxRecuperationTorque) } + { emPos, Tuple.Create(response.ElectricMotor.AngularVelocity, VectoMath.Min(maxbatDragTq, response.ElectricMotor.MaxRecuperationTorque)) } } } });