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 0c7d20d5 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

testpowertrain hybrid strategy: initialize engine auxiliaries to use correct...

testpowertrain hybrid strategy: initialize engine auxiliaries to use correct angular speed for calculation
parent 9598dc0b
No related branches found
No related tags found
No related merge requests found
......@@ -491,7 +491,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
if (!filtered.Any()) {
filtered = eval.OrderBy(x => Math.Abs((int)currentGear - x.Gear)).ToArray();
}
best = filtered.MaxBy(x => x.Setting.MechanicalAssistPower.Sum(e => e.Value ?? 0.SI<NewtonMeter>()));
best = filtered.Where(x => !x.IgnoreReason.BatteryDemandExceeded()).MaxBy(x => x.Setting.MechanicalAssistPower.Sum(e => e.Value ?? 0.SI<NewtonMeter>()));
if (best != null) {
return best;
}
......@@ -521,7 +521,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
}
}
if (DataBus.DriverInfo.DrivingAction == DrivingAction.Brake && emEngaged) {
best = eval.MaxBy(x => x.Setting.MechanicalAssistPower.Sum(e => e.Value ?? 0.SI<NewtonMeter>()));
best = eval.Where(x => !x.IgnoreReason.BatteryDemandExceeded()).MaxBy(x => x.Setting.MechanicalAssistPower.Sum(e => e.Value ?? 0.SI<NewtonMeter>()));
if (best != null) {
return best;
}
......@@ -1004,6 +1004,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
}
//if (!PreviousState.GearboxEngaged) {
TestPowertrain.CombustionEngine.Initialize(
(DataBus.EngineInfo as CombustionEngine).PreviousState.EngineTorque,
(DataBus.EngineInfo as CombustionEngine).PreviousState.EngineSpeed);
TestPowertrain.CombustionEngine.PreviousState.EngineOn = true;
//(DataBus.EngineInfo as CombustionEngine).PreviousState.EngineOn;
TestPowertrain.CombustionEngine.PreviousState.EnginePower =
......@@ -1023,6 +1026,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
TestPowertrain.Clutch.PreviousState.InAngularVelocity =
(DataBus.ClutchInfo as SwitchableClutch).PreviousState.InAngularVelocity;
//}
if (/*nextGear != DataBus.GearboxInfo.Gear && */TestPowertrain.ElectricMotorP2 != null) {
......
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