diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategyOptimized.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategyOptimized.cs index 91340b5a9058ca203f59af0b9468170d25e00857..c26fb47f8cb95975939d488f80842bbe609a065b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategyOptimized.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategyOptimized.cs @@ -304,6 +304,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } } + var tqdrag = fld[next.Gear].DragLoadStationaryTorque(response.Engine.EngineSpeed); + var tqmax = fld[next.Gear].FullLoadStationaryTorque(response.Engine.EngineSpeed); + if (tqmax.IsSmallerOrEqual(tqdrag) || response.Engine.EngineSpeed.IsGreaterOrEqual(DataBus.EngineInfo.EngineN95hSpeed)) { + // engine speed is to high or + // extrapolation of max torque curve for high engine speeds may leads to negative max torque + continue; + } + if (double.IsNaN(fcCurrent)) { //var responseCurrent = RequestDryRunWithGear( // absTime, dt, vehicleSpeedForGearRating, DataBus.DriverAcceleration, current); @@ -314,9 +322,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl fld[currentGear.Gear].FullLoadStationaryTorque(responseCurrent.Engine.EngineSpeed)); fcCurrent = GetFCRating(responseCurrent.Engine.EngineSpeed, tqCurrent); } - var tqNext = response.Engine.TorqueOutDemand.LimitTo( - fld[next.Gear].DragLoadStationaryTorque(response.Engine.EngineSpeed), - fld[next.Gear].FullLoadStationaryTorque(response.Engine.EngineSpeed)); + + var tqNext = response.Engine.TorqueOutDemand.LimitTo(tqdrag, tqmax); var fcNext = GetFCRating(response.Engine.EngineSpeed, tqNext); if (reserve < GearshiftParams.TorqueReserve ||