diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs index de5e3afe0ab645c311e1fe18a47a9b74722ee2f3..cc13afb0cdfdabe138ba8a30634ca1124cbebe3c 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs @@ -113,7 +113,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public override bool ClutchClosed(Second absTime) { return absTime.IsGreater(DataBus.AbsTime) || - !(CurrentState.Disengaged || (DataBus.DriverBehavior == DrivingBehavior.Halted)); + !(CurrentState.Disengaged || (DataBus.DriverBehavior == DrivingBehavior.Halted || (DisengageGearbox && !ModelData.ATEcoRollReleaseLockupClutch))); } public override bool DisengageGearbox { get; set; } @@ -226,7 +226,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var loop = false; SetPowershiftLossEnergy(absTime, dt, outTorque, outAngularVelocity); do { - if (CurrentState.Disengaged || (DataBus.DriverBehavior == DrivingBehavior.Halted)) { + if (CurrentState.Disengaged || (DataBus.DriverBehavior == DrivingBehavior.Halted) || (DisengageGearbox && !ModelData.ATEcoRollReleaseLockupClutch)) { // only when vehicle is halted or close before halting retVal = RequestDisengaged(absTime, dt, outTorque, outAngularVelocity, dryRun); } else { @@ -326,7 +326,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl CurrentState.InAngularVelocity); } - if (!CurrentState.TorqueConverterLocked || DisengageGearbox) { + if (!CurrentState.TorqueConverterLocked || (DisengageGearbox && ModelData.ATEcoRollReleaseLockupClutch)) { var response = TorqueConverter.Request(absTime, dt, inTorque, inAngularVelocity, dryRun); if (response is ResponseGearShift) { //RequestAfterGearshift = false; @@ -406,8 +406,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var avgInAngularSpeed = (PreviousState.InAngularVelocity + CurrentState.InAngularVelocity) / 2.0; var avgOutAngularSpeed = (PreviousState.OutAngularVelocity + CurrentState.OutAngularVelocity) / 2.0; - container[ModalResultField.Gear] = CurrentState.Disengaged || DataBus.VehicleStopped ? 0 : Gear; - container[ModalResultField.TC_Locked] = !DisengageGearbox && CurrentState.TorqueConverterLocked; + container[ModalResultField.Gear] = CurrentState.Disengaged || DataBus.VehicleStopped || + (DisengageGearbox && !ModelData.ATEcoRollReleaseLockupClutch) + ? 0 + : Gear; + container[ModalResultField.TC_Locked] = !(DisengageGearbox && ModelData.ATEcoRollReleaseLockupClutch) && CurrentState.TorqueConverterLocked; container[ModalResultField.P_gbx_loss] = CurrentState.InTorque * avgInAngularSpeed - CurrentState.OutTorque * avgOutAngularSpeed; container[ModalResultField.P_gbx_inertia] = CurrentState.InertiaTorqueLossOut * avgOutAngularSpeed; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index d397be99b3a50ba4b5183610437a466e041953d6..7e071ba67ef80a28db627d75cf934df17bb5f195 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -81,6 +81,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl protected EcoRoll EcoRollState; protected PCCSegments PCCSegments; protected internal PCCStates PCCState = PCCStates.OutsideSegment; + protected bool ATEcoRollReleaseLockupClutch; public DefaultDriverStrategy(IVehicleContainer container = null) @@ -95,6 +96,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl EngineStopStart = false, PredictiveCruiseControl = PredictiveCruiseControlType.None, }; + ATEcoRollReleaseLockupClutch = data.GearboxData.ATEcoRollReleaseLockupClutch; EcoRollState = new EcoRoll() { State = Impl.EcoRollStates.EcoRollOff, @@ -256,6 +258,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var dataBus = Driver.DataBus; var vehicleSpeed = dataBus.VehicleSpeed; + if (dataBus.Distance > 38000) { + Console.WriteLine("here!"); + } + UpdatePCCState(targetVelocity); switch (PCCState) { @@ -407,7 +413,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var forces = dBus.SlopeResistance(dBus.RoadGradient) + dBus.RollingResistance(dBus.RoadGradient) + dBus.AirDragResistance(dBus.VehicleSpeed, dBus.VehicleSpeed); - if (dBus.GearboxType.AutomaticTransmission() && dBus.VehicleSpeed.IsGreater(0)) { + if (dBus.GearboxType.AutomaticTransmission() && !ATEcoRollReleaseLockupClutch && dBus.VehicleSpeed.IsGreater(0)) { // for AT transmissions consider engine drag losses during eco-roll events forces -= dBus.EngineDragPower(dBus.EngineSpeed) / dBus.VehicleSpeed; forces += (dBus.GearboxLoss() + dBus.AxlegearLoss()) / dBus.VehicleSpeed; @@ -416,8 +422,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Driver.DriverData.EcoRoll.AccelerationLowerLimit, Driver.DriverData.EcoRoll.AccelerationUpperLimit); var accelerationPedalIdle = EcoRollState.AcceleratorPedalIdle; var brakeActive = !EcoRollState.PreviousBrakePower.IsEqual(0); + var vehcleSpeedBelowMax = dBus.VehicleSpeed <= + dBus.CycleData.LeftSample.VehicleTargetSpeed + GetOverspeed() - 2.KMPHtoMeterPerSecond(); - EcoRollState.AllConditionsMet = vehicleSpeedAboveLowerThreshold && slopeNegative && accelerationWithinLimits && + EcoRollState.AllConditionsMet = vehicleSpeedAboveLowerThreshold && vehcleSpeedBelowMax && slopeNegative && accelerationWithinLimits && accelerationPedalIdle && !brakeActive; EcoRollState.Gear = dBus.Gear; diff --git a/VectoCore/VectoCoreTest/Integration/ADAS/ADASTests.cs b/VectoCore/VectoCoreTest/Integration/ADAS/ADASTests.cs index 6255d8384337f4c6a9d096396b05cdd1feacc801..1e756ccc484c80e31b558aa25ecbe8c172025873 100644 --- a/VectoCore/VectoCoreTest/Integration/ADAS/ADASTests.cs +++ b/VectoCore/VectoCoreTest/Integration/ADAS/ADASTests.cs @@ -116,20 +116,21 @@ namespace TUGraz.VectoCore.Tests.Integration.ADAS GraphWriter.Write(modFilename); } - [TestCase(0, TestName = "AT EcoRoll DH1.8 const"), - TestCase(1, TestName = "AT EcoRoll DH1.8 UH0.1"), - TestCase(2, TestName = "AT EcoRoll DH1.9 const"), - TestCase(3, TestName = "AT EcoRoll DH1.2 const - too flat"), - TestCase(4, TestName = "AT EcoRoll DH2.5 const - too steep"), - TestCase(5, TestName = "AT EcoRoll DH1.9 const - Stop"), - TestCase(6, TestName = "AT EcoRoll DH1.9 const - TS60"), - TestCase(7, TestName = "AT EcoRoll DH1.9 const - TS68"), - TestCase(8, TestName = "AT EcoRoll DH1.9 const - TS72"), - TestCase(9, TestName = "AT EcoRoll DH1.9 const - TS80"), + [TestCase(0, TestName = "AT EcoRoll Neutral DH1.8 const"), + TestCase(1, TestName = "AT EcoRoll Neutral DH1.8 UH0.1"), + TestCase(2, TestName = "AT EcoRoll Neutral DH1.9 const"), + TestCase(3, TestName = "AT EcoRoll Neutral DH1.2 const - too flat"), + TestCase(4, TestName = "AT EcoRoll Neutral DH2.5 const - too steep"), + TestCase(5, TestName = "AT EcoRoll Neutral DH1.9 const - Stop"), + TestCase(6, TestName = "AT EcoRoll Neutral DH1.9 const - TS60"), + TestCase(7, TestName = "AT EcoRoll Neutral DH1.9 const - TS68"), + TestCase(8, TestName = "AT EcoRoll Neutral DH1.9 const - TS72"), + TestCase(9, TestName = "AT EcoRoll Neutral DH1.9 const - TS80"), + TestCase(10, TestName = "AT EcoRoll Neutral DH1.2 const"), ] - public void TestEcoRollAT(int cycleIdx) + public void TestEcoRollAT_Neutral(int cycleIdx) { - string jobName = @"TestData\Integration\ADAS\Group9_RigidTruck_AT\Class_9_RigidTruck_AT_Eng.vecto"; + string jobName = @"TestData\Integration\ADAS\Group9_RigidTruck_AT\Class_9_RigidTruck_AT_Eng_Neutral.vecto"; var inputData = JSONInputDataFactory.ReadJsonJob(jobName); var writer = new FileOutputWriter(Path.Combine(Path.GetDirectoryName(jobName), Path.GetFileName(jobName))); @@ -157,6 +158,46 @@ namespace TUGraz.VectoCore.Tests.Integration.ADAS } + [TestCase(0, TestName = "AT EcoRoll TC DH1.8 const"), + TestCase(1, TestName = "AT EcoRoll TC DH1.8 UH0.1"), + TestCase(2, TestName = "AT EcoRoll TC DH1.9 const"), + TestCase(3, TestName = "AT EcoRoll TC DH1.2 const - too flat"), + TestCase(4, TestName = "AT EcoRoll TC DH2.5 const - too steep"), + TestCase(5, TestName = "AT EcoRoll TC DH1.9 const - Stop"), + TestCase(6, TestName = "AT EcoRoll TC DH1.9 const - TS60"), + TestCase(7, TestName = "AT EcoRoll TC DH1.9 const - TS68"), + TestCase(8, TestName = "AT EcoRoll TC DH1.9 const - TS72"), + TestCase(9, TestName = "AT EcoRoll TC DH1.9 const - TS80"), + ] + public void TestEcoRollAT_TC(int cycleIdx) + { + string jobName = @"TestData\Integration\ADAS\Group9_RigidTruck_AT\Class_9_RigidTruck_AT_Eng_TC.vecto"; + var inputData = JSONInputDataFactory.ReadJsonJob(jobName); + var writer = new FileOutputWriter(Path.Combine(Path.GetDirectoryName(jobName), Path.GetFileName(jobName))); + + var sumContainer = new SummaryDataContainer(writer); + var jobContainer = new JobContainer(sumContainer); + var factory = new SimulatorFactory(ExecutionMode.Engineering, inputData, writer) { + WriteModalResults = true, + //ActualModalData = true, + Validate = false + }; + + factory.SumData = sumContainer; + + var runs = factory.SimulationRuns().ToArray(); + var run = runs[cycleIdx]; + + jobContainer.AddRun(run); + jobContainer.Execute(); + jobContainer.WaitFinished(); + + var progress = jobContainer.GetProgress(); + Assert.IsTrue(progress.All(r => r.Value.Success), string.Concat<Exception>(progress.Select(r => r.Value.Error))); + var modFilename = writer.GetModDataFileName(run.RunName, run.CycleName, run.RunSuffix); + GraphWriter.Write(modFilename); + } + [TestCase(@"TestData\Integration\ADAS\Group9_AT_EngineStopStart.xml")] public void TestATVehicleWithADASEngineStopStart(string filename) { diff --git a/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/Class_9_RigidTruck_AT_Eng_Neutral.vecto b/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/Class_9_RigidTruck_AT_Eng_Neutral.vecto new file mode 100644 index 0000000000000000000000000000000000000000..ad33dc22746e5de55162280b3a983029f75056bb --- /dev/null +++ b/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/Class_9_RigidTruck_AT_Eng_Neutral.vecto @@ -0,0 +1,54 @@ +{ + "Header": { + "CreatedBy": "", + "Date": "2017-07-03T12:21:05.6496880Z", + "AppVersion": "3", + "FileVersion": 3 + }, + "Body": { + "SavedInDeclMode": false, + "EngineOnlyMode": false, + "VehicleFile": "RigidTruck_6x2_Neutral.vveh", + "EngineFile": "Engine_220kW.veng", + "GearboxFile": "APT-S Generic TqMax1200.vgbx", + "AuxiliaryAssembly": "Classic", + "AuxiliaryVersion": "CLASSIC", + "AdvancedAuxiliaryFilePath": "", + "Aux": [ ], + "Padd": 3500.0, + "VACC": "Truck.vacc", + "StartStop": { + "Enabled": false, + "MaxSpeed": 5.0, + "MinTime": 5.0, + "Delay": 0.0 + }, + "LAC": { + "Enabled": true, + "PreviewDistanceFactor": 10.0, + "DF_offset": 2.5, + "DF_scaling": 1.5, + "DF_targetSpeedLookup": "", + "Df_velocityDropLookup": "" + }, + "OverSpeedEcoRoll": { + "Mode": "Overspeed", + "MinSpeed": 50.0, + "OverSpeed": 5.0, + "UnderSpeed": 5.0 + }, + "Cycles": [ + "DriveDHSl1.8.vdri", + "DriveDHSl1.8_Uh0.1.vdri", + "DriveDHSl1.9.vdri", + "DriveDhSl1.2.vdri", + "DriveDhSl2.5.vdri", + "DriveDHSl1.9_Stop.vdri", + "DriveDHSl1.9_TS--.vdri", + "DriveDHSl1.9_TS-.vdri", + "DriveDHSl1.9_TS+.vdri", + "DriveDHSl1.9_TS++.vdri", + "DriveDHSl1.2.vdri", + ] + } +} \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/Class_9_RigidTruck_AT_Eng.vecto b/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/Class_9_RigidTruck_AT_Eng_TC.vecto similarity index 96% rename from VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/Class_9_RigidTruck_AT_Eng.vecto rename to VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/Class_9_RigidTruck_AT_Eng_TC.vecto index 8ebd46eb3a44be8fb4de0b229a759d3569444f23..77d1f4c23b9c499a31cece181480f8797db959a3 100644 --- a/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/Class_9_RigidTruck_AT_Eng.vecto +++ b/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/Class_9_RigidTruck_AT_Eng_TC.vecto @@ -8,7 +8,7 @@ "Body": { "SavedInDeclMode": false, "EngineOnlyMode": false, - "VehicleFile": "RigidTruck_6x2.vveh", + "VehicleFile": "RigidTruck_6x2_TC.vveh", "EngineFile": "Engine_220kW.veng", "GearboxFile": "APT-S Generic TqMax1200.vgbx", "AuxiliaryAssembly": "Classic", diff --git a/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/RigidTruck_6x2_Neutral.vveh b/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/RigidTruck_6x2_Neutral.vveh new file mode 100644 index 0000000000000000000000000000000000000000..49cbfeeb607b0d58ba09fb8843dbd4b69060a045 --- /dev/null +++ b/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/RigidTruck_6x2_Neutral.vveh @@ -0,0 +1,75 @@ +{ + "Header": { + "CreatedBy": "", + "Date": "2017-07-03T14:48:36.5106880Z", + "AppVersion": "3", + "FileVersion": 8 + }, + "Body": { + "SavedInDeclMode": true, + "VehCat": "RigidTruck", + "LegislativeClass": "N3", + "CurbWeight": 7750.0, + "CurbWeightExtra": 0.0, + "Loading": 19300.0, + "MassMax": 26.0, + "CdA": 5.3, + "rdyn": 492.0, + "CdCorrMode": "CdofVdecl", + "CdCorrFile": "", + "EngineStopStart": false, + "EcoRoll": "WithoutEngineStop", + "PredictiveCruiseControl": "none", + "ATEcoRollReleaseLockupClutch": false, + "Retarder": { + "Type": "None", + "Ratio": 1.0, + "File": "" + }, + "Angledrive": { + "Type": "None", + "Ratio": "NaN", + "LossMap": "" + }, + "PTO": { + "Type": "None", + "LossMap": "", + "Cycle": "" + }, + "TorqueLimits": {}, + "IdlingSpeed": 0.0, + "AxleConfig": { + "Type": "6x2", + "Axles": [ + { + "Inertia": 14.9, + "Wheels": "315/70 R22.5", + "AxleWeightShare": 0.3, + "TwinTyres": false, + "RRCISO": 0.0055, + "FzISO": 33350.0, + "Type": "VehicleNonDriven" + }, + { + "Inertia": 14.9, + "Wheels": "315/70 R22.5", + "AxleWeightShare": 0.35, + "TwinTyres": true, + "RRCISO": 0.0055, + "FzISO": 33350.0, + "Type": "VehicleDriven" + }, + { + "Inertia": 14.9, + "Wheels": "315/70 R22.5", + "AxleWeightShare": 0.35, + "TwinTyres": false, + "RRCISO": 0.0055, + "FzISO": 33350.0, + "Type": "VehicleNonDriven" + } + ] + }, + "CdA": 5.8 + } +} \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/RigidTruck_6x2.vveh b/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/RigidTruck_6x2_TC.vveh similarity index 97% rename from VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/RigidTruck_6x2.vveh rename to VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/RigidTruck_6x2_TC.vveh index dfcd3a2d55c34a87e2ae529e9704a97f2470ac37..d3ca74cbb62c8d689f0d8c837d430e1716d233ce 100644 --- a/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/RigidTruck_6x2.vveh +++ b/VectoCore/VectoCoreTest/TestData/Integration/ADAS/Group9_RigidTruck_AT/RigidTruck_6x2_TC.vveh @@ -20,6 +20,7 @@ "EngineStopStart": false, "EcoRoll": "WithoutEngineStop", "PredictiveCruiseControl": "none", + "ATEcoRollReleaseLockupClutch": true, "Retarder": { "Type": "None", "Ratio": 1.0, diff --git a/VectoCore/VectoCoreTest/VectoCoreTest.csproj b/VectoCore/VectoCoreTest/VectoCoreTest.csproj index 4d790646a41aa9cc6ac28868eb987305a746becd..2ebfd4ba1c88a8986e85dd8ac0b740197ba98e05 100644 --- a/VectoCore/VectoCoreTest/VectoCoreTest.csproj +++ b/VectoCore/VectoCoreTest/VectoCoreTest.csproj @@ -761,7 +761,10 @@ <None Include="TestData\Integration\ADAS\Group9_RigidTruck_AT\Axle_i6-5.vtlm"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Include="TestData\Integration\ADAS\Group9_RigidTruck_AT\Class_9_RigidTruck_AT_Eng.vecto"> + <None Include="TestData\Integration\ADAS\Group9_RigidTruck_AT\Class_9_RigidTruck_AT_Eng_TC.vecto"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Integration\ADAS\Group9_RigidTruck_AT\Class_9_RigidTruck_AT_Eng_Neutral.vecto"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Include="TestData\Integration\ADAS\Group9_RigidTruck_AT\DriveDhSl1.2.vdri"> @@ -821,7 +824,10 @@ <None Include="TestData\Integration\ADAS\Group9_RigidTruck_AT\Gear_6_i=0-65.vtlm"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Include="TestData\Integration\ADAS\Group9_RigidTruck_AT\RigidTruck_6x2.vveh"> + <None Include="TestData\Integration\ADAS\Group9_RigidTruck_AT\RigidTruck_6x2_Neutral.vveh"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Integration\ADAS\Group9_RigidTruck_AT\RigidTruck_6x2_TC.vveh"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Include="TestData\Integration\ADAS\Group9_RigidTruck_AT\TorqueConverter_Serial_TqMax1200.vtcc">