diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs index e89c13663777d42de13db563d9d2be31c5db65ac..00d0635078767dc0c7d57e4ef70ad11db8c75277 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs @@ -362,6 +362,18 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter retVal.TorqueConverterData.CertificationNumber = torqueConverter.CertificationNumber; } + // update disengageWhenHaltingSpeed + if (retVal.Type.AutomaticTransmission()) { + var firstGear = retVal.GearList.First(x => x.IsLockedGear()); + if (retVal.Gears[firstGear.Gear].ShiftPolygon.Downshift.Any()) { + var downshiftSpeedInc = retVal.Gears[firstGear.Gear].ShiftPolygon + .InterpolateDownshiftSpeed(0.SI<NewtonMeter>()) * 1.05; + var vehicleSpeedDisengage = downshiftSpeedInc / axlegearRatio / retVal.Gears[firstGear.Gear].Ratio * + dynamicTyreRadius; + retVal.DisengageWhenHaltingSpeed = vehicleSpeedDisengage; + } + } + return retVal; } diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index 6c827f53d62eb9aabefcff9eb994a4d57aeaf93d..a2c0839d04130192fe045726c66c4a0052c17cf6 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -333,6 +333,18 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter gearshiftData.CLUpshiftMinAcceleration, gearshiftData.CCUpshiftMinAcceleration); } + // update disengageWhenHaltingSpeed + if (retVal.Type.AutomaticTransmission()) { + var firstGear = retVal.GearList.First(x => x.IsLockedGear()); + if (retVal.Gears[firstGear.Gear].ShiftPolygon.Downshift.Any()) { + var downshiftSpeedInc = retVal.Gears[firstGear.Gear].ShiftPolygon + .InterpolateDownshiftSpeed(0.SI<NewtonMeter>()) * 1.05; + var vehicleSpeedDisengage = downshiftSpeedInc / axlegearRatio / retVal.Gears[firstGear.Gear].Ratio * + dynamicTyreRadius; + retVal.DisengageWhenHaltingSpeed = vehicleSpeedDisengage; + } + } + return retVal; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs index 1927a02be3a9fd89a7d40871074afea5c5120872..eaaa88741797988c2c26894039ca70939ee8c14b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs @@ -38,6 +38,7 @@ using System.Runtime.Serialization; using Newtonsoft.Json; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; using TUGraz.VectoCore.Models.SimulationComponent.Impl; @@ -52,6 +53,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data public class GearboxData : SimulationComponentData { private GearList _gearlist; + private MeterPerSecond _disengageWhenHaltingSpeed; public GearboxType Type { get; internal set; } @@ -73,6 +75,19 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data [JsonIgnore] public GearList GearList => _gearlist ?? (_gearlist = CreateGearList()); + public MeterPerSecond DisengageWhenHaltingSpeed { + get { + return _disengageWhenHaltingSpeed != null + ? _disengageWhenHaltingSpeed + : (Type.AutomaticTransmission() + ? Constants.SimulationSettings.ATGearboxDisengageWhenHaltingSpeed + : Constants.SimulationSettings.ClutchDisengageWhenHaltingSpeed); + } + internal set { + _disengageWhenHaltingSpeed = value; + } + } + private GearList CreateGearList() { var gearList = new List<GearshiftPosition>(); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs index 3e73811c52474ca7b3dc8e81e77d5ad223aa8268..1ab62b193ee4981358afe5f0df2d2afb187f9951 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs @@ -157,7 +157,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var braking = DataBus.DriverInfo.DriverBehavior == DrivingBehavior.Braking; var torqueNegative = outTorque.IsSmaller(0); var slowerThanDisengageSpeed = - DataBus.VehicleInfo.VehicleSpeed.IsSmaller(Constants.SimulationSettings.ATGearboxDisengageWhenHaltingSpeed); + DataBus.VehicleInfo.VehicleSpeed.IsSmaller(GearboxModelData.DisengageWhenHaltingSpeed); var disengageBeforeHalting = braking && torqueNegative && slowerThanDisengageSpeed; // 2) L -> 0: disengage if inAngularVelocity == 0 diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs index 28684b21766d5c869e9e61d9a3b26440094ec320..c26d183e3923a1ccbf4b8db5bccaa1150f49a09d 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs @@ -258,7 +258,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl (inAngularVelocity.IsSmaller(DataBus.EngineInfo.EngineIdleSpeed))) && (DataBus.Brakes.BrakePower.IsGreater(0) || inTorque.IsSmaller(0)); var vehicleSpeedBelowThreshold = - DataBus.VehicleInfo.VehicleSpeed.IsSmaller(Constants.SimulationSettings.ClutchDisengageWhenHaltingSpeed); + DataBus.VehicleInfo.VehicleSpeed.IsSmaller(ModelData.DisengageWhenHaltingSpeed); if (halted || (driverDeceleratingNegTorque && vehicleSpeedBelowThreshold)) { EngageTime = VectoMath.Max(EngageTime, absTime + dt); _strategy?.Disengage(absTime, dt, outTorque, outAngularVelocity);