diff --git a/VectoCore/VectoCore/Configuration/Constants.cs b/VectoCore/VectoCore/Configuration/Constants.cs index c065245d4b30e49d15ad414001bcdb2dda6dac5c..9f5ed156bc9efca212f6c14be6060e1428f96d28 100644 --- a/VectoCore/VectoCore/Configuration/Constants.cs +++ b/VectoCore/VectoCore/Configuration/Constants.cs @@ -149,6 +149,8 @@ namespace TUGraz.VectoCore.Configuration public const int MaximumIterationCountForSimulationStep = 30; public static readonly MeterPerSecond VehicleStopClutchDisengageSpeed = 10.KMPHtoMeterPerSecond(); + + public static readonly Meter GearboxLookaheadForAccelerationEstimation = 100.SI<Meter>(); } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs index 2d82d3b639b08a0ccd5e910c8efa2aa5595172f3..4436424adce2e6954fac7d29cc533672c4559934 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs @@ -130,5 +130,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data /// <c>true</c> if this instance has torque converter; otherwise, <c>false</c>. /// </value> public bool HasTorqueConverter { get; internal set; } + + public Second UpshiftAfterDownshiftDelay { get; internal set; } + public Second DownshiftAfterUpshiftDelay { get; internal set; } + public MeterPerSquareSecond UpshiftMinAcceleration { get; internal set; } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs index b06249f7a30fad98855c7c8ae22a6551ef53f671..c71280279879f46b2a255423b784453c13cdb8c7 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs @@ -164,7 +164,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if (DataBus.DriverBehavior != DrivingBehavior.Accelerating && DataBus.DriverBehavior != DrivingBehavior.Driving) { return currentGear; } - if ((absTime - Gearbox.LastDownshift).IsSmaller(10.SI<Second>())) { + if ((absTime - Gearbox.LastDownshift).IsSmaller(Gearbox.ModelData.UpshiftAfterDownshiftDelay)) { return currentGear; } var nextGear = DoCheckUpshift(absTime, dt, outTorque, outAngularVelocity, inTorque, inAngularVelocity, currentGear); @@ -173,14 +173,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } // estimate acceleration for selected gear - if (EstimateAccelerationForGear(nextGear, outAngularVelocity).IsSmaller(0.1.SI<MeterPerSquareSecond>())) { + if (EstimateAccelerationForGear(nextGear, outAngularVelocity).IsSmaller(Gearbox.ModelData.UpshiftMinAcceleration)) { // if less than 0.1 for next gear, don't shift if (nextGear - currentGear == 1) { return currentGear; } // if a gear is skipped but acceleration is less than 0.1, try for next gear. if acceleration is still below 0.1 don't shift! if (nextGear > currentGear && - EstimateAccelerationForGear(currentGear + 1, outAngularVelocity).IsSmaller(0.1.SI<MeterPerSquareSecond>())) { + EstimateAccelerationForGear(currentGear + 1, outAngularVelocity).IsSmaller(Gearbox.ModelData.UpshiftMinAcceleration)) + { return currentGear; } nextGear = currentGear + 1; @@ -192,7 +193,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl protected virtual uint CheckDownshift(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, NewtonMeter inTorque, PerSecond inAngularVelocity, uint currentGear) { - if ((absTime - Gearbox.LastUpshift).IsSmaller(10.SI<Second>())) { + if ((absTime - Gearbox.LastUpshift).IsSmaller(Gearbox.ModelData.DownshiftAfterUpshiftDelay)) { return currentGear; } return DoCheckDownshift(absTime, dt, outTorque, outAngularVelocity, inTorque, inAngularVelocity, currentGear); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ShiftStrategy.cs index f8e52b88d9e82633af9117b312e0d895aebd1877..03002d7bfdd066d30ec935e6182a6c5406229fd0 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ShiftStrategy.cs @@ -33,6 +33,7 @@ using System; using System.Drawing.Design; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; @@ -77,7 +78,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var maxEnginePower = DataBus.EngineStationaryFullPower(nextEngineSpeed); var avgSlope = - ((DataBus.CycleLookAhead(100.SI<Meter>()).Altitude - DataBus.Altitude) / 100.SI<Meter>()).Value().SI<Radian>(); + ((DataBus.CycleLookAhead(Constants.SimulationSettings.GearboxLookaheadForAccelerationEstimation).Altitude - + DataBus.Altitude) / Constants.SimulationSettings.GearboxLookaheadForAccelerationEstimation).Value().SI<Radian>(); var airDragLoss = DataBus.AirDragResistance(vehicleSpeed, vehicleSpeed) * DataBus.VehicleSpeed; var rollResistanceLoss = DataBus.RollingResistance(avgSlope) * DataBus.VehicleSpeed;