From 222e55d92089f292460640ee9668b1e59068f714 Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Wed, 17 Nov 2021 14:05:59 +0100 Subject: [PATCH] removing no longer needed shift parameters (Scania model, voith model) adding new shift parameter (not yet used) read cycle and shift parameters from file if available (TEST MODE) --- VECTO/Input Files/Gearbox.vb | 6 + .../InputData/EngineeringInputData.cs | 30 +--- .../InputData/FileIO/JSON/JSONGearboxData.cs | 1 + .../InputData/FileIO/JSON/JSONTCUData.cs | 155 +----------------- .../XMLEngineeringGearshiftData.cs | 34 +--- .../DeclarationDataAdapter.cs | 5 +- .../EngineeringDataAdapter.cs | 3 +- .../EngineeringModeVectoRunDataFactory.cs | 2 +- .../Models/Declaration/DeclarationData.cs | 34 +++- .../Data/ShiftStrategyParameters.cs | 2 +- .../Simulation/Impl/PowertrainBuilder.cs | 30 ++-- .../Impl/ATShiftStrategyOptimized.cs | 6 + .../Declaration/EffShiftParameters.vtcu | 31 +++- 13 files changed, 106 insertions(+), 233 deletions(-) diff --git a/VECTO/Input Files/Gearbox.vb b/VECTO/Input Files/Gearbox.vb index 3efacc6c88..1894977851 100644 --- a/VECTO/Input Files/Gearbox.vb +++ b/VECTO/Input Files/Gearbox.vb @@ -556,6 +556,12 @@ Public Class Gearbox End Get End Property + Public ReadOnly Property DownshiftMaxAccelerationAT As MeterPerSquareSecond Implements IGearshiftEngineeringInputData.DownshiftMaxAccelerationAT + get + return Nothing + End Get + End Property + Public ReadOnly Property PowershiftShiftTime As Second Implements IGearboxEngineeringInputData.PowershiftShiftTime Get Return PSShiftTime.SI(Of Second)() diff --git a/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs b/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs index a068cf3142..1003e33368 100644 --- a/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs +++ b/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs @@ -262,27 +262,11 @@ namespace TUGraz.VectoCommon.InputData MeterPerSquareSecond UpshiftMinAcceleration { get; } - // ACEA/Scania GS Parameters - //Second GearResidenceTime { get; } - //double? DnT99LHMin1 { get; } - //double? DnT99LHMin2 { get; } - //int? AllowedGearRangeUp { get; } - //int? AllowedGearRangeDown { get; } - //Second LookBackInterval { get; } - //Watt AvgCardanPowerThresholdPropulsion { get; } - //Watt CurrCardanPowerThresholdPropulsion { get; } - //double? TargetSpeedDeviationFactor { get; } - //double? EngineSpeedHighDriveOffFactor { get; } + double? RatingFactorCurrentGear { get; } - //TableData AccelerationReserveLookup { get; } - //TableData ShareTorque99L { get; } - //TableData PredictionDurationLookup { get; } - //TableData ShareIdleLow { get; } - //TableData ShareEngineHigh { get; } + string Source { get; } - //Second DriverAccelerationLookBackInterval { get; } - //MeterPerSquareSecond DriverAccelerationThresholdLow { get; } - + // FC-Based GS parameters double? RatioEarlyUpshiftFC { get; } double? RatioEarlyDownshiftFC { get; } @@ -293,8 +277,7 @@ namespace TUGraz.VectoCommon.InputData double? AccelerationFactor { get; } - // Voith GS Parameters - //TableData LoadStageShiftLines { get; } + IList<double> LoadStageThresholdsUp { get; } IList<double> LoadStageThresholdsDown { get; } PerSecond MinEngineSpeedPostUpshift { get; } @@ -302,10 +285,7 @@ namespace TUGraz.VectoCommon.InputData Second ATLookAheadTime { get; } double[][] ShiftSpeedsTCToLocked { get; } - //double? PEV_TargetSpeedBrakeNorm { get; } - - //double? PEV_DeRatingDownshiftSpeedFactor { get; } - //double? PEV_DownshiftMinSpeedFactor { get; } + MeterPerSquareSecond DownshiftMaxAccelerationAT { get; } } public interface ITorqueConverterEngineeringShiftParameterInputData diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs index f444a7fd78..338ba2a11a 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs @@ -390,6 +390,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON public PerSecond MinEngineSpeedPostUpshift => null; public Second ATLookAheadTime => null; public double[][] ShiftSpeedsTCToLocked => null; + public MeterPerSquareSecond DownshiftMaxAccelerationAT => null; public double? VeloictyDropFactor => null; diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONTCUData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONTCUData.cs index 29ff6cda9a..5d95dfdbf4 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONTCUData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONTCUData.cs @@ -64,116 +64,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON public MeterPerSquareSecond StartAcceleration => Body.GetValueOrDefault<double>(JsonKeys.Gearbox_StartAcceleration)?.SI<MeterPerSquareSecond>() ?? DeclarationData.GearboxTCU.StartAcceleration; - public Second GearResidenceTime => Body.GetValueOrDefault<double>("GearResidenceTime")?.SI<Second>(); - - public double? DnT99LHMin1 => Body.GetValueOrDefault<double>("Dn_Tq99L_high_min_1"); - - public double? DnT99LHMin2 => Body.GetValueOrDefault<double>("Dn_Tq99L_high_min_2"); - - public int? AllowedGearRangeUp => Body.GetValueOrDefault<int>("GearRangeUp"); - - public int? AllowedGearRangeDown => Body.GetValueOrDefault<int>("GearRangeDown"); - - public Second LookBackInterval => Body.GetValueOrDefault<double>("LookBackDriver")?.SI<Second>(); - - public Watt AvgCardanPowerThresholdPropulsion => Body.GetValueOrDefault<double>("P_card_avg_threshold")?.SI<Watt>(); - - public Watt CurrCardanPowerThresholdPropulsion => Body.GetValueOrDefault<double>("P_card_curr_threshold")?.SI<Watt>(); - - public double? TargetSpeedDeviationFactor => Body.GetValueOrDefault<double>("Diff_curr_targ_vel"); - - public double? EngineSpeedHighDriveOffFactor => Body.GetValueOrDefault<double>("EngineSpeedHighDriveOffFactor"); - public double? RatingFactorCurrentGear => Body.GetValueOrDefault<double>("Rating_current_gear"); - public TableData AccelerationReserveLookup - { - get { - try { - return ReadTableData(Body["AccelerationReserveLookup"]?.ToString(), "AccelerationReserveLookup", false); - } catch (Exception) { - if (!TolerateMissing) { - throw; - } - - return new TableData( - Path.Combine(BasePath, Body["AccelerationReserveLookup"]?.ToString() ?? "") + MissingFileSuffix, - DataSourceType.Missing); - } - } - } - - public TableData ShareTorque99L - { - get { - try { - return ReadTableData(Body["ShareTorque99L"]?.ToString(), "ShareTorque99L", false); - } catch (Exception) { - if (!TolerateMissing) { - throw; - } - - return new TableData( - Path.Combine(BasePath, Body["ShareTorque99L"]?.ToString() ?? "") + MissingFileSuffix, - DataSourceType.Missing); - } - } - } - - public TableData PredictionDurationLookup - { - get { - try { - return ReadTableData(Body["PredictionDurationLookup"]?.ToString(), "PredictionDurationLookup", false); - } catch (Exception) { - if (!TolerateMissing) { - throw; - } - - return new TableData( - Path.Combine(BasePath, Body["PredictionDurationLookup"]?.ToString() ?? "") + MissingFileSuffix, - DataSourceType.Missing); - } - } - } - - public TableData ShareIdleLow - { - get { - try { - return ReadTableData(Body["ShareIdleLow"]?.ToString(), "ShareIdleLow", false); - } catch (Exception) { - if (!TolerateMissing) { - throw; - } - - return new TableData( - Path.Combine(BasePath, Body["ShareIdleLow"]?.ToString() ?? "") + MissingFileSuffix, - DataSourceType.Missing); - } - } - } - - public TableData ShareEngineHigh - { - get { - try { - return ReadTableData(Body["ShareEngineHigh"]?.ToString(), "ShareEngineHigh", false); - } catch (Exception) { - if (!TolerateMissing) { - throw; - } - - return new TableData( - Path.Combine(BasePath, Body["ShareEngineHigh"]?.ToString() ?? "") + MissingFileSuffix, - DataSourceType.Missing); - } - } - } - - public Second DriverAccelerationLookBackInterval => Body.GetValueOrDefault<double>("DriverAccelerationLookBackInterval")?.SI<Second>(); - public MeterPerSquareSecond DriverAccelerationThresholdLow => Body.GetValueOrDefault<double>("DriverAccelerationThresholdLow")?.SI<MeterPerSquareSecond>(); - public double? RatioEarlyUpshiftFC => Body.GetValueOrDefault<double>("RatioEarlyUpshiftFC"); public double? RatioEarlyDownshiftFC => Body.GetValueOrDefault<double>("RatioEarlyDownshiftFC"); @@ -253,64 +145,29 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON } } - public double? PEV_TargetSpeedBrakeNorm + public MeterPerSquareSecond DownshiftMaxAccelerationAT { get { - if (Body["PEV_TargetSpeedBrakeNorm"] != null) { - return Body.GetEx<double>("PEV_TargetSpeedBrakeNorm"); - } - - return null; - } - } - - public double? PEV_DeRatingDownshiftSpeedFactor - { - get - { - if (Body["PEV_DeRatingDownshiftSpeedFactor"] != null) { - return Body.GetEx<double>("PEV_DeRatingDownshiftSpeedFactor"); - } - - return null; - } - } - - public double? PEV_DownshiftMinSpeedFactor - { - get - { - if (Body["PEV_DownshiftMinSpeedFactor"] != null) { - return Body.GetEx<double>("PEV_DownshiftMinSpeedFactor"); - } - - return null; - } - } - - public TableData LoadStageShiftLines - { - get { - try { - return ReadTableData(Body["LoadStageShiftLines"]?.ToString(), "LoadStageShiftLines", false); - } catch (Exception) { + if (Body["DownshiftMaxAccelerationAT"] == null) { return null; } + + return Body.GetEx<double>("DownshiftMaxAccelerationAT").SI<MeterPerSquareSecond>(); } } public IList<double> LoadStageThresholdsUp { get { - return (Body["LoadStageThresoldsUp"]?.ToString())?.Split(';').Select(x => x.ToDouble(0)).ToList(); + return (Body["LoadStageThresholdsUp"]?.ToString())?.Split(';').Select(x => x.ToDouble(0)).ToList(); } } public IList<double> LoadStageThresholdsDown { get { - return (Body["LoadStageThresoldsDown"]?.ToString())?.Split(';').Select(x => x.ToDouble(0)).ToList(); + return (Body["LoadStageThresholdsDown"]?.ToString())?.Split(';').Select(x => x.ToDouble(0)).ToList(); } } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringGearshiftData.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringGearshiftData.cs index 503b3f7ddc..5989f46604 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringGearshiftData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringGearshiftData.cs @@ -124,25 +124,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider } } - public virtual Second GearResidenceTime => null; - public virtual double? DnT99LHMin1 => null; - public virtual double? DnT99LHMin2 => null; - public virtual int? AllowedGearRangeUp => null; - public virtual int? AllowedGearRangeDown => null; - public virtual Second LookBackInterval => null; - public virtual Watt AvgCardanPowerThresholdPropulsion => null; - public virtual Watt CurrCardanPowerThresholdPropulsion => null; - public virtual double? TargetSpeedDeviationFactor => null; - public virtual double? EngineSpeedHighDriveOffFactor => null; public virtual double? RatingFactorCurrentGear => null; - public virtual TableData AccelerationReserveLookup => null; - public virtual TableData ShareTorque99L => null; - public virtual TableData PredictionDurationLookup => null; - public virtual TableData ShareIdleLow => null; - public virtual TableData ShareEngineHigh => null; + public virtual string Source => null; - public virtual Second DriverAccelerationLookBackInterval => null; - public virtual MeterPerSquareSecond DriverAccelerationThresholdLow => null; + public virtual double? RatioEarlyUpshiftFC => null; public virtual double? RatioEarlyDownshiftFC => null; public int? AllowedGearRangeFC => null; @@ -152,24 +137,15 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider public PerSecond MinEngineSpeedPostUpshift => null; public Second ATLookAheadTime => null; public double[][] ShiftSpeedsTCToLocked => null; - public double? PEV_TargetSpeedBrakeNorm => null; - public double? PEV_DeRatingDownshiftSpeedFactor => null; - public double? PEV_DownshiftMinSpeedFactor => null; + public MeterPerSquareSecond DownshiftMaxAccelerationAT { get; } + public double? AccelerationFactor => null; - public virtual TableData LoadStageShiftLines => null; + public virtual IList<double> LoadStageThresholdsUp => null; public virtual IList<double> LoadStageThresholdsDown => null; - public virtual Second PowershiftShiftTime - { - get { - return GetNode(XMLNames.DriverModel_ShiftStrategyParameters_PowershiftShiftTime, required: false) - ?.InnerText.ToDouble().SI<Second>() ?? 0.8.SI<Second>(); - } - } - #endregion #region Implementation of ITorqueConverterEngineeringShiftParameterInputData diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs index 0bfa1e7061..b16d40ea3d 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs @@ -602,8 +602,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter RatioEarlyDownshiftFC = DeclarationData.GearboxTCU.RatioEarlyDownshiftFC / axleRatio, AllowedGearRangeFC = gbx.Type.AutomaticTransmission() ? (gbx.Gears.Count > DeclarationData.GearboxTCU.ATSkipGearsThreshold - ? DeclarationData.GearboxTCU.AllowedGearRangeFCATSkipGear - : DeclarationData.GearboxTCU.AllowedGearRangeFCAT) + ? DeclarationData.GearboxTCU.AllowedGearRangeFCAPTSkipGear + : DeclarationData.GearboxTCU.AllowedGearRangeFCAPT) : DeclarationData.GearboxTCU.AllowedGearRangeFCAMT, VelocityDropFactor = DeclarationData.GearboxTCU.VelocityDropFactor, AccelerationFactor = DeclarationData.GearboxTCU.AccelerationFactor, @@ -614,6 +614,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter LoadStageThresoldsDown = DeclarationData.GearboxTCU.LoadStageThresoldsDown, ShiftSpeedsTCToLocked = DeclarationData.GearboxTCU.ShiftSpeedsTCToLocked .Select(x => x.Select(y => y + engineIdlingSpeed.AsRPM).ToArray()).ToArray(), + DownshiftMaxAccelerationAT = DeclarationData.GearboxTCU.DownshiftMaxAccelerationAT, }; return retVal; diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index 016e69f1b1..7b6fa830c3 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -614,7 +614,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter RatioEarlyUpshiftFC = (gsInputData.RatioEarlyUpshiftFC ?? DeclarationData.GearboxTCU.RatioEarlyUpshiftFC) / axleRatio, RatioEarlyDownshiftFC = (gsInputData.RatioEarlyDownshiftFC ?? DeclarationData.GearboxTCU.RatioEarlyDownshiftFC) / axleRatio, - AllowedGearRangeFC = gsInputData.AllowedGearRangeFC ?? (gbxType.AutomaticTransmission() ? DeclarationData.GearboxTCU.AllowedGearRangeFCAT : DeclarationData.GearboxTCU.AllowedGearRangeFCAMT), + AllowedGearRangeFC = gsInputData.AllowedGearRangeFC ?? (gbxType.AutomaticTransmission() ? DeclarationData.GearboxTCU.AllowedGearRangeFCAPT : DeclarationData.GearboxTCU.AllowedGearRangeFCAMT), VelocityDropFactor = gsInputData.VeloictyDropFactor ?? DeclarationData.GearboxTCU.VelocityDropFactor, AccelerationFactor = gsInputData.AccelerationFactor ?? DeclarationData.GearboxTCU.AccelerationFactor, MinEngineSpeedPostUpshift = gsInputData.MinEngineSpeedPostUpshift ?? DeclarationData.GearboxTCU.MinEngineSpeedPostUpshift, @@ -623,6 +623,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter LoadStageThresoldsDown = gsInputData.LoadStageThresholdsDown?.ToArray() ?? DeclarationData.GearboxTCU.LoadStageThresoldsDown, LoadStageThresoldsUp = gsInputData.LoadStageThresholdsUp?.ToArray() ?? DeclarationData.GearboxTCU.LoadStageThresholdsUp, ShiftSpeedsTCToLocked = engineIdlingSpeed == null ? null : (gsInputData.ShiftSpeedsTCToLocked ?? DeclarationData.GearboxTCU.ShiftSpeedsTCToLocked).Select(x => x.Select(y => y + engineIdlingSpeed.AsRPM).ToArray()).ToArray(), + DownshiftMaxAccelerationAT = gsInputData.DownshiftMaxAccelerationAT ?? DeclarationData.GearboxTCU.DownshiftMaxAccelerationAT, }; diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs index d60b410c25..d882c6e14c 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs @@ -197,7 +197,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl RatioEarlyUpshiftFC = (gsInputData.RatioEarlyUpshiftFC ?? DeclarationData.GearboxTCU.RatioEarlyUpshiftFC) / axleRatio, RatioEarlyDownshiftFC = (gsInputData.RatioEarlyDownshiftFC ?? DeclarationData.GearboxTCU.RatioEarlyDownshiftFC) / axleRatio, - AllowedGearRangeFC = gsInputData.AllowedGearRangeFC ?? (gbxType.AutomaticTransmission() ? DeclarationData.GearboxTCU.AllowedGearRangeFCAT : DeclarationData.GearboxTCU.AllowedGearRangeFCAMT), + AllowedGearRangeFC = gsInputData.AllowedGearRangeFC ?? (gbxType.AutomaticTransmission() ? DeclarationData.GearboxTCU.AllowedGearRangeFCAPT : DeclarationData.GearboxTCU.AllowedGearRangeFCAMT), VelocityDropFactor = gsInputData.VeloictyDropFactor ?? DeclarationData.GearboxTCU.VelocityDropFactor, AccelerationFactor = gsInputData.AccelerationFactor ?? DeclarationData.GearboxTCU.AccelerationFactor, MinEngineSpeedPostUpshift = gsInputData.MinEngineSpeedPostUpshift ?? DeclarationData.GearboxTCU.MinEngineSpeedPostUpshift, diff --git a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs index abcf4e7382..d70ddc3f18 100644 --- a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs +++ b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs @@ -440,8 +440,8 @@ namespace TUGraz.VectoCore.Models.Declaration public static double RatioEarlyDownshiftFC = 24; public static int AllowedGearRangeFCAMT = 2; - public static int AllowedGearRangeFCAT = 1; - public static int AllowedGearRangeFCATSkipGear = 2; + public static int AllowedGearRangeFCAPT = 1; + public static int AllowedGearRangeFCAPTSkipGear = 2; public static int ATSkipGearsThreshold = 6; public static PerSecond MinEngineSpeedPostUpshift = 0.RPMtoRad(); @@ -463,10 +463,11 @@ namespace TUGraz.VectoCore.Models.Declaration public const double DownhillSlope = -5; public const double UphillSlope = 5; - public static string DefaultShiftStrategy = ""; + //public static string DefaultShiftStrategy = ""; public const double DragMarginFactor = 0.7; public static bool Fallback_ATEcoRollReleaseLockupClutch = false; + public static MeterPerSquareSecond DownshiftMaxAccelerationAT = -5.SI<MeterPerSquareSecond>(); // TODO: MQ 2019-11-26 remove, once the parameters are fixed! make fields above read-only or const @@ -480,7 +481,6 @@ namespace TUGraz.VectoCore.Models.Declaration var tcuData = JSONInputDataFactory.ReadShiftParameters(expectedFile, true); if (tcuData.RatingFactorCurrentGear.HasValue) { RatingFactorCurrentGear = tcuData.RatingFactorCurrentGear.Value; - RatingFactorCurrentGearAPT = tcuData.RatingFactorCurrentGear.Value; } if (tcuData.RatioEarlyDownshiftFC.HasValue) { RatioEarlyDownshiftFC = tcuData.RatioEarlyDownshiftFC.Value; @@ -490,7 +490,6 @@ namespace TUGraz.VectoCore.Models.Declaration } if (tcuData.AllowedGearRangeFC.HasValue) { AllowedGearRangeFCAMT = tcuData.AllowedGearRangeFC.Value; - AllowedGearRangeFCAT = tcuData.AllowedGearRangeFC.Value; } if (tcuData.VeloictyDropFactor.HasValue) { VelocityDropFactor = tcuData.VeloictyDropFactor.Value; @@ -513,11 +512,28 @@ namespace TUGraz.VectoCore.Models.Declaration if (tcuData.MinEngineSpeedPostUpshift != null) { MinEngineSpeedPostUpshift = tcuData.MinEngineSpeedPostUpshift; } - var tmp = tcuData as JSONFile; - if (tmp != null && tmp.Body["ShiftStrategy"] != null) { - DefaultShiftStrategy = tmp.Body["ShiftStrategy"].Value<string>(); + + if (tcuData.DownshiftMaxAccelerationAT != null) { + DownshiftMaxAccelerationAT = tcuData.DownshiftMaxAccelerationAT; + } + + var raw = tcuData as JSONFile; + if (raw.Body["Rating_current_gear_APT"] != null) { + RatingFactorCurrentGearAPT = raw.Body.GetEx<double>("Rating_current_gear_APT"); + } + if (raw.Body["AllowedGearRangeFCAPT"] != null) { + AllowedGearRangeFCAPT = raw.Body.GetEx<int>("AllowedGearRangeFCAPT"); } - + if (raw.Body["AllowedGearRangeFCAPTSkipGear"] != null) { + AllowedGearRangeFCAPTSkipGear = raw.Body.GetEx<int>("AllowedGearRangeFCAPTSkipGear"); + } + + + //var tmp = tcuData as JSONFile; + //if (tmp != null && tmp.Body["ShiftStrategy"] != null) { + // DefaultShiftStrategy = tmp.Body["ShiftStrategy"].Value<string>(); + //} + } } diff --git a/VectoCore/VectoCore/Models/Simulation/Data/ShiftStrategyParameters.cs b/VectoCore/VectoCore/Models/Simulation/Data/ShiftStrategyParameters.cs index 6fc5c87eb5..1b06889df6 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/ShiftStrategyParameters.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/ShiftStrategyParameters.cs @@ -72,6 +72,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Data { public double[] LoadStageThresoldsUp { get; set; } public double[] LoadStageThresoldsDown { get; set; } public double[][] ShiftSpeedsTCToLocked { get; set; } - + public MeterPerSquareSecond DownshiftMaxAccelerationAT { get; set; } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs index 796d8e970e..fe6d37d951 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs @@ -520,12 +520,12 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl public static IShiftStrategy GetShiftStrategy(IVehicleContainer container) { var runData = container.RunData; - var shiftStrategy = runData.ShiftStrategy; - if (string.IsNullOrWhiteSpace(shiftStrategy)) { - shiftStrategy = DeclarationData.GearboxTCU.DefaultShiftStrategy; - } + //var shiftStrategy = runData.ShiftStrategy; + //if (string.IsNullOrWhiteSpace(shiftStrategy)) { + // shiftStrategy = DeclarationData.GearboxTCU.DefaultShiftStrategy; + //} - if (string.IsNullOrWhiteSpace(shiftStrategy)) { + //if (string.IsNullOrWhiteSpace(shiftStrategy)) { switch (runData.GearboxData.Type) { case GearboxType.AMT: //if (runData.JobType == VectoSimulationJobType.ConventionalVehicle) { @@ -551,18 +551,18 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl throw new ArgumentOutOfRangeException("GearboxType", $"Unknown Gearbox Type {runData.GearboxData.Type.ToString()}"); } - } + //} - var selected = ShiftStrategies.FirstOrDefault(x => - x.Item1.Contains(runData.GearboxData.Type) && - x.Item2.Equals(shiftStrategy, StringComparison.InvariantCultureIgnoreCase)); - if (selected == null) { - throw new ArgumentOutOfRangeException("ShiftStrategy", - $"Unknown Shiftstrategy {shiftStrategy} for Gearbox Type {runData.GearboxData.Type.ToString()}"); - } + //var selected = ShiftStrategies.FirstOrDefault(x => + // x.Item1.Contains(runData.GearboxData.Type) && + // x.Item2.Equals(shiftStrategy, StringComparison.InvariantCultureIgnoreCase)); + //if (selected == null) { + // throw new ArgumentOutOfRangeException("ShiftStrategy", + // $"Unknown Shiftstrategy {shiftStrategy} for Gearbox Type {runData.GearboxData.Type.ToString()}"); + //} - runData.ShiftStrategy = selected.Item3; - return selected.Item4(container); + //runData.ShiftStrategy = selected.Item3; + //return selected.Item4(container); } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategyOptimized.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategyOptimized.cs index 1d405fb91d..be0952c87b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategyOptimized.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategyOptimized.cs @@ -359,6 +359,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return null; } + //var minAcceleration = VectoMath.Min(shiftStrategyParameters.DownshiftMaxAccelerationAT, ???); + //if (!(DataBus.DriverInfo.DrivingAction == DrivingAction.Accelerate && + // DataBus.DriverInfo.DriverAcceleration.IsGreater(minAcceleration))) { + // return null; + //} + var minFcGear = currentGear; var minFc = double.MaxValue; var fcCurrent = double.NaN; diff --git a/VectoCore/VectoCore/Resources/Declaration/EffShiftParameters.vtcu b/VectoCore/VectoCore/Resources/Declaration/EffShiftParameters.vtcu index 5f282702bb..5262dec921 100644 --- a/VectoCore/VectoCore/Resources/Declaration/EffShiftParameters.vtcu +++ b/VectoCore/VectoCore/Resources/Declaration/EffShiftParameters.vtcu @@ -1 +1,30 @@ - \ No newline at end of file +{ +"Header": { + "FileVersion": 1 +}, + "Body": { + + "Rating_current_gear": 0.97, + "Rating_current_gear_APT": 0.97, + "RatioEarlyDownshiftFC": 24, + "RatioEarlyUpshiftFC": 24, + "AllowedGearRangeFC": 2, + "AllowedGearRangeFCAPT": 1, + "AllowedGearRangeFCAPTSkipGear": 2, + "VelocityDropFactor": 1.0, + "AccelerationFactorNP98h": 0.5, + "ATLookAheadTime": 0.8, + "ShiftSpeedsTCLockup": [ + [ 90.0, 120, 165, 90, 120, 165 ], + [ 90.0, 120, 165, 90, 120, 165 ], + [ 90.0, 120, 165, 90, 120, 165 ], + [ 90.0, 120, 165, 110, 140, 185 ], + [ 100.0, 130, 175, 120, 150, 195 ], + [ 110.0, 140, 185, 130, 160, 205 ] + ], + "LoadStageThresholdsUp": "19.7; 36.34; 53.01; 69.68; 86.35", + "LoadStageThresholdsDown": "13.7; 30.34; 47.01; 63.68; 80.35", + "MinEngineSpeedPostUpshift": 0, + "DownshiftMaxAccelerationAT": -2 + } +} \ No newline at end of file -- GitLab