Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit a323a9ff authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

Pull request #100: Bugfix/VECTO-1482 hybrid vehicle em speed gets very high no gearshift

Merge in VECTO/vecto-dev from VECTO/mq_vecto-dev:bugfix/VECTO-1482-hybrid-vehicle-em-speed-gets-very-high-no-gearshift to develop

* commit '93ae31ba':
  hybrid strategy: calculation of gearshift penalty - if score is negative, multiply with penalty (instead of dividing) to get a worse rating
  correctiing typos and bugs detected during backporting ADAS/DF/WHR - engine form: use correct filebrowser instance - vtp job: plot second fuel if available - json writer set engine-only mode correctly - test-project: do not use classes from GUI but already available classes from test project
parents c1c7422a 93ae31ba
No related branches found
No related tags found
No related merge requests found
Showing
with 53 additions and 40 deletions
......@@ -287,7 +287,7 @@ Public Class BusAuxiliariesEngParametersForm
End If
End If
HCUFileBrowser.UpdateHistory(file)
BusAuxFileBrowser.UpdateHistory(file)
Text = GetFilenameWithoutPath(file, True)
LbStatus.Text = ""
......
......@@ -655,6 +655,19 @@ Public Class VectoVTPJobForm
s.MarkerSize = 3
s.Color = Color.Red
s.Name = "Map"
If (engine.EngineModes.First().Fuels.Count > 1) then
Dim fcMap2 As FuelConsumptionMap = FuelConsumptionMapReader.Create(engine.EngineModes.First().Fuels(1).FuelConsumptionMap)
Dim s2 As Series = New Series
s2.Points.DataBindXY(fcMap2.Entries.Select(Function(x) x.EngineSpeed.AsRPM).ToArray(),
fcMap2.Entries.Select(Function(x) x.Torque.Value()).ToArray())
s2.ChartType = SeriesChartType.Point
s2.MarkerSize = 3
s2.Color = Color.Green
s2.Name = "Map 2"
chart.Series.Add(s2)
End If
chart.Series.Add(s)
Dim engineCharacteristics As String =
......
......@@ -2096,7 +2096,6 @@ End Sub
' Friend WithEvents TabPage1 As System.Windows.Forms.TabPage
' Friend WithEvents TabPage2 As System.Windows.Forms.TabPage
' Friend WithEvents TabPage3 As System.Windows.Forms.TabPage
'>>>>>>> VECTO_CERT/master
Friend WithEvents Label17 As System.Windows.Forms.Label
Friend WithEvents btDelMaxTorqueEntry As System.Windows.Forms.Button
Friend WithEvents btAddMaxTorqueEntry As System.Windows.Forms.Button
......@@ -2119,7 +2118,6 @@ End Sub
Friend WithEvents GroupBox9 As GroupBox
Friend WithEvents cbTankSystem As ComboBox
Friend WithEvents Label23 As Label
'<<<<<<< HEAD
Friend WithEvents cbAtEcoRollReleaseLockupClutch As CheckBox
Friend WithEvents tpElectricComponents As TabPage
Friend WithEvents gpElectricMotor As GroupBox
......
......@@ -438,7 +438,7 @@ Public Class VehicleForm
if (declVehicle.TankSystem.HasValue) then
cbTankSystem.SelectedValue = declVehicle.TankSystem.Value
End If
else
tbPtoEngineSpeed.Text = vehicle.PTO_DriveEngineSpeed?.AsRPM.ToGUIFormat()
tbPtoGear.Text = if (not vehicle.PTO_DriveGear is nothing, vehicle.PTO_DriveGear.Gear.ToString() ,"")
End If
......
......@@ -38,7 +38,6 @@ using TUGraz.VectoCommon.BusAuxiliaries;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Models.Declaration;
namespace TUGraz.VectoCommon.InputData
......
......@@ -51,7 +51,6 @@ namespace TUGraz.VectoCommon.InputData
/// </summary>
IList<ICycleData> Cycles { get; }
//ToDo Remove use JobType
IEngineEngineeringInputData EngineOnly { get; }
}
......
......@@ -44,9 +44,16 @@ namespace TUGraz.VectoCommon.Models {
public IResponse Response { get; set; }
public double Score =>
(FuelCosts + EquivalenceFactor * (BatCosts + ICEStartPenalty1) * SoCPenalty + ICEStartPenalty2 +
RampUpPenalty) / GearshiftPenalty;
public double Score
{
get
{
var cost = (FuelCosts + EquivalenceFactor * (BatCosts + ICEStartPenalty1) * SoCPenalty + ICEStartPenalty2 +
RampUpPenalty);
var gearshift = cost.IsSmaller(0) ? GearshiftPenalty : 1 / GearshiftPenalty;
return cost * gearshift;
}
}
public double FuelCosts { get; set; }
......
using System;
using System.Collections.Generic;
namespace TUGraz.VectoCore.Models.Declaration {
namespace TUGraz.VectoCommon.Models {
[Flags]
public enum WHRType
......
......@@ -38,12 +38,12 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData {
{
var entry = CreateEntry(row);
if (entry.Torque.IsGreaterOrEqual(0)) {
delaunayMap.AddPoint(-entry.Torque.Value() * count, // * ratio * efficiency,
entry.MotorSpeed.Value(), // / ratio,
delaunayMap.AddPoint(-entry.Torque.Value() * count,
entry.MotorSpeed.Value(),
-entry.PowerElectrical.Value() * count);
} else {
delaunayMap.AddPoint(-entry.Torque.Value() * count, // * ratio / efficiency,
entry.MotorSpeed.Value(), // / ratio,
delaunayMap.AddPoint(-entry.Torque.Value() * count,
entry.MotorSpeed.Value(),
-entry.PowerElectrical.Value() * count);
}
}
......
......@@ -24,6 +24,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.ElectricMotor
{
var result = new EfficiencyResult();
result.Torque = torque;
result.Speed = angularSpeed;
var value = _efficiencyMapMech2El.Interpolate(torque, angularSpeed);
if (!value.IsNaN())
{
......
......@@ -214,7 +214,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
// PTO Active while drive (roadsweeping) shift rules
if (DataBus.DrivingCycleInfo.CycleData.LeftSample.PTOActive == PTOActivity.PTOActivityRoadSweeping) {
if (gear == DesiredGearRoadsweeping) {
if (gear.Equals(DesiredGearRoadsweeping)) {
return false;
}
......
......@@ -483,8 +483,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
};
}
CurrentState.SetState(0.SI<NewtonMeter>(), outAngularVelocity * effectiveRatio, outTorque,
outAngularVelocity);
CurrentState.Gear = ModelData.GearList.First();
......
......@@ -938,7 +938,7 @@ public class JSONFileWriter : IOutputFileWriter
var job = input.JobInputData;
body.Add("SavedInDeclMode", job.SavedInDeclarationMode);
body.Add("EngineOnlyMode", job.JobType);
body.Add("EngineOnlyMode", job.JobType == VectoSimulationJobType.EngineOnlySimulation);
body.Add("EngineFile", GetRelativePath(job.EngineOnly.DataSource.SourceFile, basePath));
......
......@@ -75,7 +75,7 @@ namespace TUGraz.VectoCore.OutputData.XML.Writer
InputData.DriverInputData, Writer, InputData.JobInputData.Vehicle.DataSource);
return new object[] {
new XElement(v10 + XMLNames.VectoJob_EngineOnlyMode, InputData.JobInputData.JobType != VectoSimulationJobType.EngineOnlySimulation),
new XElement(v10 + XMLNames.VectoJob_EngineOnlyMode, InputData.JobInputData.JobType == VectoSimulationJobType.EngineOnlySimulation),
CreateVehicle(InputData.JobInputData.Vehicle),
new XElement(
v10 + XMLNames.Component_DriverModel,
......
......@@ -185,11 +185,11 @@ namespace TUGraz.VectoCore.Tests.FileIO
var gbxData = new EngineeringDataAdapter().CreateGearboxData(
new MockEngineeringInputProvider() {
DriverInputData = new MockDriverInputData() {
DriverInputData = new MockDriverTestInputData() {
GearshiftInputData = (IGearshiftEngineeringInputData)inputProvider
},
JobInputData = new MockJobInputData() {
IEngineeringJobInputData_Vehicle = new MockEngineeringVehicleInputData() {
JobInputData = new MockJobTestInputData() {
Vehicle = new MockEngineeringVehicleInputData() {
GearboxInputData = inputProvider,
TorqueConverterInputData = (ITorqueConverterEngineeringInputData)inputProvider,
}
......@@ -226,11 +226,11 @@ namespace TUGraz.VectoCore.Tests.FileIO
var gbxData = new EngineeringDataAdapter().CreateGearboxData(
new MockEngineeringInputProvider() {
DriverInputData = new MockDriverInputData() {
DriverInputData = new MockDriverTestInputData() {
GearshiftInputData = (IGearshiftEngineeringInputData)inputProvider
},
JobInputData = new MockJobInputData() {
IEngineeringJobInputData_Vehicle = new MockEngineeringVehicleInputData() {
JobInputData = new MockJobTestInputData() {
Vehicle = new MockEngineeringVehicleInputData() {
GearboxInputData = inputProvider,
TorqueConverterInputData = (ITorqueConverterEngineeringInputData)inputProvider,
}
......@@ -274,11 +274,11 @@ namespace TUGraz.VectoCore.Tests.FileIO
var gbxData = new EngineeringDataAdapter().CreateGearboxData(
new MockEngineeringInputProvider() {
DriverInputData = new MockDriverInputData() {
DriverInputData = new MockDriverTestInputData() {
GearshiftInputData = (IGearshiftEngineeringInputData)inputProvider
},
JobInputData = new MockJobInputData() {
IEngineeringJobInputData_Vehicle = new MockEngineeringVehicleInputData() {
JobInputData = new MockJobTestInputData() {
Vehicle = new MockEngineeringVehicleInputData() {
GearboxInputData = inputProvider,
TorqueConverterInputData = (ITorqueConverterEngineeringInputData)inputProvider,
}
......@@ -321,11 +321,11 @@ namespace TUGraz.VectoCore.Tests.FileIO
var gbxData = new EngineeringDataAdapter().CreateGearboxData(
new MockEngineeringInputProvider() {
DriverInputData = new MockDriverInputData() {
DriverInputData = new MockDriverTestInputData() {
GearshiftInputData = (IGearshiftEngineeringInputData)inputProvider
},
JobInputData = new MockJobInputData() {
IEngineeringJobInputData_Vehicle = new MockEngineeringVehicleInputData() {
JobInputData = new MockJobTestInputData() {
Vehicle = new MockEngineeringVehicleInputData() {
GearboxInputData = inputProvider,
TorqueConverterInputData = (ITorqueConverterEngineeringInputData)inputProvider,
}
......@@ -369,11 +369,11 @@ namespace TUGraz.VectoCore.Tests.FileIO
var gbxData = new EngineeringDataAdapter().CreateGearboxData(
new MockEngineeringInputProvider() {
DriverInputData = new MockDriverInputData() {
DriverInputData = new MockDriverTestInputData() {
GearshiftInputData = (IGearshiftEngineeringInputData)inputProvider
},
JobInputData = new MockJobInputData() {
IEngineeringJobInputData_Vehicle = new MockEngineeringVehicleInputData() {
JobInputData = new MockJobTestInputData() {
Vehicle = new MockEngineeringVehicleInputData() {
GearboxInputData = inputProvider,
TorqueConverterInputData = (ITorqueConverterEngineeringInputData)inputProvider,
}
......@@ -417,11 +417,11 @@ namespace TUGraz.VectoCore.Tests.FileIO
var gbxData = new EngineeringDataAdapter().CreateGearboxData(
new MockEngineeringInputProvider() {
DriverInputData = new MockDriverInputData() {
DriverInputData = new MockDriverTestInputData() {
GearshiftInputData = (IGearshiftEngineeringInputData)inputProvider
},
JobInputData = new MockJobInputData() {
IEngineeringJobInputData_Vehicle = new MockEngineeringVehicleInputData() {
JobInputData = new MockJobTestInputData() {
Vehicle = new MockEngineeringVehicleInputData() {
GearboxInputData = inputProvider,
TorqueConverterInputData = (ITorqueConverterEngineeringInputData)inputProvider,
}
......
......@@ -76,9 +76,6 @@ namespace TUGraz.VectoCore.Tests.Integration
public static VehicleContainer CreatePowerTrain(DrivingCycleData cycleData, GearboxType gbxType, string modFileName,
bool overspeed = false, KilogramSquareMeter gearBoxInertia = null)
{
var gearboxData = CreateGearboxData(gbxType);
var engineData = MockSimulationDataFactory.CreateEngineDataFromFile(EngineFile, gearboxData.Gears.Count);
var axleGearData = CreateAxleGearData(gbxType);
......
......@@ -5,6 +5,7 @@ using Ninject;
using NUnit.Framework;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.InputData.FileIO.XML;
using TUGraz.VectoCore.InputData.Reader.ComponentData;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment