diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs index d99358c0e97ff8a548718ea8a03266d9cb4225e0..a4e6ce20cc1c418fb0db9bb3dbc46e8cc1acd165 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs @@ -98,9 +98,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var inTorque = response.ClutchPowerRequest / inAngularSpeed; // if in shift curve and above idle speed and torque reserve is provided. - if (!IsBelowDownShiftCurve(gear, inTorque, inAngularSpeed) && inAngularSpeed > DataBus.EngineIdleSpeed && + if (/*!IsBelowDownShiftCurve(gear, inTorque, response.EngineSpeed) &&*/ response.EngineSpeed > DataBus.EngineIdleSpeed && reserve >= ModelData.StartTorqueReserve) { _nextGear = gear; + _gearbox.LastUpshift = absTime; + _gearbox.LastDownshift = absTime; return gear; } } @@ -148,10 +150,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl // emergency shift to not stall the engine ------------------------ _nextGear = gear; - while (_nextGear > 1 && SpeedTooLowForEngine(_nextGear, outAngularVelocity)) { + while (_nextGear > 1 && SpeedTooLowForEngine(_nextGear, inAngularVelocity / ModelData.Gears[gear].Ratio)) { _nextGear--; } - while (_nextGear < ModelData.Gears.Count && SpeedTooHighForEngine(_nextGear, outAngularVelocity)) { + while (_nextGear < ModelData.Gears.Count && + SpeedTooHighForEngine(_nextGear, inAngularVelocity / ModelData.Gears[gear].Ratio)) { _nextGear++; } if (_nextGear != gear) { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs index f9a48c918fd5cfbe5c2c0ca7df4a0aedffaa83b6..9046b11dcbbb676f7c50b7b9b590112a5f13897d 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs @@ -60,9 +60,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl /// </summary> protected internal bool Disengaged = true; - public Second LastUpshift { get; private set; } + public Second LastUpshift { get; protected internal set; } - public Second LastDownshift { get; private set; } + public Second LastDownshift { get; protected internal set; } public override GearInfo NextGear { @@ -349,7 +349,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var shiftAllowed = !inAngularVelocity.IsEqual(0) && !DataBus.VehicleSpeed.IsEqual(0); if (response is ResponseSuccess && shiftAllowed) { - var shiftRequired = _strategy.ShiftRequired(absTime, dt, outTorque, outAngularVelocity, inTorque, inAngularVelocity, + var shiftRequired = _strategy.ShiftRequired(absTime, dt, outTorque, outAngularVelocity, inTorque, response.EngineSpeed, Gear, _engageTime); if (shiftRequired) {