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

hybrid strategy: additional filter, try to avoid configurations that exceed the battery limits

parent 43dbad12
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
TestPowertrain.Gearbox.Disengaged = !useNextGear.Engaged;
TestPowertrain.Gearbox.DisengageGearbox = !useNextGear.Engaged;
TestPowertrain.Gearbox._nextGear = Controller.ShiftStrategy.NextGear;
TestPowertrain.Container.VehiclePort.Initialize(DataBus.VehicleInfo.VehicleSpeed, DataBus.DrivingCycleInfo.RoadGradient ?? 0.SI<Radian>());
//if (DataBus.GearboxInfo.GearboxType != GearboxType.APTN) {
TestPowertrain.Container.VehiclePort.Initialize(DataBus.VehicleInfo.VehicleSpeed,
DataBus.DrivingCycleInfo.RoadGradient ?? 0.SI<Radian>());
//}
TestPowertrain.HybridController.ApplyStrategySettings(cfg);
......@@ -79,7 +83,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
}
}
TestPowertrain.HybridController.Initialize(Controller.PreviousState.OutTorque, Controller.PreviousState.OutAngularVelocity);
//if (DataBus.GearboxInfo.GearboxType != GearboxType.APTN) {
TestPowertrain.HybridController.Initialize(Controller.PreviousState.OutTorque,
Controller.PreviousState.OutAngularVelocity);
//}
if (!PreviousState.GearboxEngaged || (useNextGear.Engaged && useNextGear.Equals(DataBus.GearboxInfo.Gear)) || !nextGear.Engaged) {
TestPowertrain.CombustionEngine.UpdateFrom(DataBus.EngineInfo);
......@@ -1536,7 +1543,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
DataBus.GearboxInfo.GearEngaged(absTime) && (eval.First().Response?.Gearbox.Gear.Engaged ?? true);
if (DataBus.DriverInfo.DrivingAction == DrivingAction.Accelerate && emEngaged) {
//var filtered = eval.Where(x => !x.IgnoreReason.InvalidEngineSpeed()).ToArray();
var filtered = eval.Where(x => !x.IgnoreReason.EngineSpeedTooLow() && !x.IgnoreReason.EngineSpeedTooHigh()).ToArray();
var batOK = eval.Where(x => !x.IgnoreReason.BatteryDemandExceeded()).ToArray();
if (!batOK.Any()) {
batOK = eval.ToArray();
}
var filtered = batOK.Where(x => !x.IgnoreReason.EngineSpeedTooLow() && !x.IgnoreReason.EngineSpeedTooHigh()).ToArray();
if (filtered.Length == 0) {
filtered = eval.Where(x => !x.IgnoreReason.EngineSpeedTooLow() && !x.IgnoreReason.EngineSpeedTooHigh()).ToArray();
}
......
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