Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 4bf3d93b authored by Michael KRISPER's avatar Michael KRISPER
Browse files

Merge remote-tracking branch 'origin/develop' into update-net6

parents 402c628d 6441f764
No related branches found
No related tags found
No related merge requests found
......@@ -49,9 +49,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
if (avgSpeed.IsEqual(0.RPMtoRad()) || avgSpeed.IsGreater(MaxSpeed)) {
return 0.SI<NewtonMeter>();
}
var (a, b) = GetSection(voltage);
var r1 = a.EfficiencyMap.LookupTorque(electricPower, avgSpeed, maxEmTorque);
var r2 = b.EfficiencyMap.LookupTorque(electricPower, avgSpeed, maxEmTorque);
var (vLow, vHigh) = GetSection(voltage);
var r1 = vLow.EfficiencyMap.LookupTorque(electricPower, avgSpeed, maxEmTorque);
var r2 = vHigh.EfficiencyMap.LookupTorque(electricPower, avgSpeed, maxEmTorque);
if (r1 is null && r2 is null) {
return null;
......@@ -65,8 +65,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
r2 = maxEmTorque;
}
var retVal = VectoMath.Interpolate(a.Voltage, b.Voltage,
r1, r2, voltage);
var retVal = vLow.Voltage.IsEqual(vHigh.Voltage)
? r1
: VectoMath.Interpolate(vLow.Voltage, vHigh.Voltage,
r1, r2, voltage);
var elPwr = LookupElectricPower(voltage, avgSpeed, retVal, true);
if (elPwr.ElectricalPower != null && electricPower.IsEqual(elPwr.ElectricalPower, 1e-3.SI<Watt>())) {
return retVal;
......@@ -87,10 +89,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
public EfficiencyMap.EfficiencyResult LookupElectricPower(Volt voltage, PerSecond avgSpeed, NewtonMeter torque, bool allowExtrapolation = false)
{
var tuple = GetSection(voltage);
var (vLow, vHigh) = GetSection(voltage);
var r1 = tuple.Item1.EfficiencyMap.LookupElectricPower(avgSpeed, torque, allowExtrapolation);
var r2 = tuple.Item2.EfficiencyMap.LookupElectricPower(avgSpeed, torque, allowExtrapolation);
var r1 = vLow.EfficiencyMap.LookupElectricPower(avgSpeed, torque, allowExtrapolation);
var r2 = vHigh.EfficiencyMap.LookupElectricPower(avgSpeed, torque, allowExtrapolation);
if (r1 == null || r2 == null || r1.ElectricalPower == null || r2.ElectricalPower == null) {
return new EfficiencyMap.EfficiencyResult() {
......@@ -100,8 +102,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
};
}
var pwr = VectoMath.Interpolate(tuple.Item1.Voltage, tuple.Item2.Voltage, r1.ElectricalPower,
r2.ElectricalPower, voltage);
var pwr = vLow.Voltage.IsEqual(vHigh.Voltage)
? r1.ElectricalPower
: VectoMath.Interpolate(vLow.Voltage, vHigh.Voltage, r1.ElectricalPower,
r2.ElectricalPower, voltage);
return new EfficiencyMap.EfficiencyResult() {
ElectricalPower = pwr,
......@@ -113,20 +117,28 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
public NewtonMeter FullGenerationTorque(Volt voltage, PerSecond avgSpeed)
{
var tuple = GetSection(voltage);
var (vLow, vHigh) = GetSection(voltage);
return VectoMath.Interpolate(tuple.Item1.Voltage, tuple.Item2.Voltage,
tuple.Item1.FullLoadCurve.FullGenerationTorque(avgSpeed),
tuple.Item2.FullLoadCurve.FullGenerationTorque(avgSpeed), voltage);
if (vLow.Voltage.IsEqual(vHigh.Voltage)) {
return vLow.FullLoadCurve.FullGenerationTorque(avgSpeed);
}
return VectoMath.Interpolate(vLow.Voltage, vHigh.Voltage,
vLow.FullLoadCurve.FullGenerationTorque(avgSpeed),
vHigh.FullLoadCurve.FullGenerationTorque(avgSpeed), voltage);
}
public NewtonMeter FullLoadDriveTorque(Volt voltage, PerSecond avgSpeed)
{
var (electricMotorVoltageLevelData, item2) = GetSection(voltage);
var (vLow, vHigh) = GetSection(voltage);
if (vLow.Voltage.IsEqual(vHigh.Voltage)) {
return vLow.FullLoadCurve.FullLoadDriveTorque(avgSpeed);
}
return VectoMath.Interpolate(electricMotorVoltageLevelData.Voltage, item2.Voltage,
electricMotorVoltageLevelData.FullLoadCurve.FullLoadDriveTorque(avgSpeed),
item2.FullLoadCurve.FullLoadDriveTorque(avgSpeed), voltage);
return VectoMath.Interpolate(vLow.Voltage, vHigh.Voltage,
vLow.FullLoadCurve.FullLoadDriveTorque(avgSpeed),
vHigh.FullLoadCurve.FullLoadDriveTorque(avgSpeed), voltage);
}
protected (ElectricMotorVoltageLevelData, ElectricMotorVoltageLevelData) GetSection(Volt voltage)
......
......@@ -188,7 +188,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
TestPowertrain.HybridController.Initialize(Controller.PreviousState.OutTorque,
Controller.PreviousState.OutAngularVelocity);
TestPowertrain.Brakes.BrakePower = DataBus.Brakes.BrakePower;
var testResponse =
if (TestPowertrain.Gearbox != null) {
TestPowertrain.Gearbox.PreviousState.InAngularVelocity =
(DataBus.GearboxInfo as Gearbox).PreviousState.InAngularVelocity;
}
var testResponse =
TestPowertrain.HybridController.NextComponent.Request(absTime, dt, outTorque, outAngularVelocity, false);
TestPowertrain.HybridController.ApplyStrategySettings(new HybridStrategyResponse() {
......
engine torque [Nm],downshift rpm [1/min],upshift rpm [1/min]
-200,700,800
0,700,800
3000,700,800
......@@ -18,19 +18,19 @@
{
"Ratio": 1.35,
"Efficiency": 0.98,
"ShiftPolygon": "AT-Shift.vgbs",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 1.0,
"Efficiency": 0.98,
"ShiftPolygon": "AT-Shift.vgbs",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 0.73,
"Efficiency": 0.98,
"ShiftPolygon": "AT-Shift.vgbs",
"ShiftPolygon": "",
"MaxTorque": ""
}
],
......@@ -45,7 +45,7 @@
"File": "TorqueConverterPowerSplit.vtcc",
"RefRPM": 1000.0,
"Inertia": 0.0,
"ShiftPolygon": "AT-Shift.vgbs"
"ShiftPolygon": ""
},
"DownshiftAferUpshiftDelay": 0.0,
"UpshiftAfterDownshiftDelay": 0.0,
......
......@@ -18,37 +18,37 @@
{
"Ratio": 3.4,
"Efficiency": 0.98,
"ShiftPolygon": "AT-Shift.vgbs",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 1.9,
"Efficiency": 0.98,
"ShiftPolygon": "AT-Shift.vgbs",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 1.42,
"Efficiency": 0.98,
"ShiftPolygon": "AT-Shift.vgbs",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 1.0,
"Efficiency": 0.98,
"ShiftPolygon": "AT-Shift.vgbs",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 0.7,
"Efficiency": 0.98,
"ShiftPolygon": "AT-Shift.vgbs",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 0.62,
"Efficiency": 0.98,
"ShiftPolygon": "AT-Shift.vgbs",
"ShiftPolygon": "",
"MaxTorque": ""
}
],
......@@ -63,7 +63,7 @@
"File": "TorqueConverter.vtcc",
"RefRPM": 1000.0,
"Inertia": 0.0,
"ShiftPolygon": "AT-Shift.vgbs"
"ShiftPolygon": ""
},
"DownshiftAferUpshiftDelay": 0.0,
"UpshiftAfterDownshiftDelay": 0.0,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment