Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit cb6e269e authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

adapting state machine for serial hybrid strategy

parent 4bd94b33
No related branches found
No related tags found
No related merge requests found
......@@ -43,8 +43,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
TestPowertrain.Gearbox.Disengaged = gearboxInfo.Disengaged;
TestPowertrain.Gearbox.DisengageGearbox = gearboxInfo.DisengageGearbox;
TestPowertrain.Gearbox.Gear = currentGear;
TestPowertrain.Gearbox._nextGear = gearboxInfo.NextGear;
}
TestPowertrain.Gearbox._nextGear = gearboxInfo.NextGear;
}
TestPowertrain.Container.VehiclePort.Initialize(DataBus.VehicleInfo.VehicleSpeed, DataBus.DrivingCycleInfo.RoadGradient ?? 0.SI<Radian>());
(TestPowertrain.Container.VehicleInfo as Vehicle).PreviousState.Velocity =
(DataBus.VehicleInfo as Vehicle).PreviousState.Velocity;
......@@ -125,15 +125,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
public class SerialHybridStrategy : AbstractSerialHybridStrategy<Gearbox>
{
public SerialHybridStrategy(VectoRunData runData, IVehicleContainer container) : base(runData, container) { }
protected override DrivetrainDemand GetDrivetrainPowerDemand(Second absTime, Second dt, NewtonMeter outTorque,
PerSecond outAngularVelocity, GenSetOperatingPoint maxPowerGenset)
{
......@@ -188,11 +182,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
TestPowertrain.HybridController.Initialize(Controller.PreviousState.OutTorque,
Controller.PreviousState.OutAngularVelocity);
TestPowertrain.Brakes.BrakePower = DataBus.Brakes.BrakePower;
if (TestPowertrain.Gearbox != null) {
TestPowertrain.Gearbox.PreviousState.InAngularVelocity =
(DataBus.GearboxInfo as Gearbox).PreviousState.InAngularVelocity;
}
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() {
......@@ -297,7 +291,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
TestPowertrain = new TestPowertrain<T>(testContainer, DataBus);
var gensetContainer = new SimplePowertrainContainer(runData);
var gensetContainer = new SimplePowertrainContainer(runData);
builder.BuildSimpleGenSet(runData, gensetContainer);
TestGenSet = new TestGenset(gensetContainer, DataBus);
......@@ -600,7 +594,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
break;
case StateMachineState.Acc_S1:
if (/*DataBus.BatteryInfo.StateOfCharge >= StrategyParameters.MinSoC &&*/
DataBus.BatteryInfo.StateOfCharge < StrategyParameters.TargetSoC
DataBus.BatteryInfo.StateOfCharge < StrategyParameters.MinSoC
&& -drivetrainDemand.ElectricPowerDemand >
optimalGensetPoint.ElectricPower) {
return StateMachineState.Acc_S2;
......@@ -612,14 +606,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
break;
case StateMachineState.Acc_S2:
if (DataBus.BatteryInfo.StateOfCharge >= StrategyParameters.TargetSoC) {
return StateMachineState.Acc_S0;
if (DataBus.BatteryInfo.StateOfCharge > StrategyParameters.MinSoC) {
return StateMachineState.Acc_S1;
}
if (DataBus.BatteryInfo.StateOfCharge >= StrategyParameters.MinSoC &&
DataBus.BatteryInfo.StateOfCharge < StrategyParameters.TargetSoC
&& -drivetrainDemand.ElectricPowerDemand <=
optimalGensetPoint.ElectricPower) {
if (DataBus.BatteryInfo.StateOfCharge < StrategyParameters.MinSoC &&
-drivetrainDemand.ElectricPowerDemand < optimalGensetPoint.ElectricPower) {
return StateMachineState.Acc_S1;
}
break;
......@@ -772,10 +763,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
}
if (rampUp && r1 is ResponseSuccess && r1.Engine.TotalTorqueDemand.IsSmaller(r1.Engine.DynamicFullLoadTorque)) {
TestGenSet.ElectricMotorCtl.EMTorque = r1.Engine.DynamicFullLoadTorque * 0.1;
var tmp = TestGenSet.ElectricMotor.Request(absTime, dt, 0.SI<NewtonMeter>(), iceSpeed, true) as ResponseDryRun;
(emTqDt, iceSpeed, r1) = SearchEMTorque(absTime, dt, iceSpeed, r1.Engine.DynamicFullLoadTorque * 0.1, tmp.DeltaFullLoad);
}
TestGenSet.ElectricMotorCtl.EMTorque = r1.Engine.DynamicFullLoadTorque * 0.1;
var tmp = TestGenSet.ElectricMotor.Request(absTime, dt, 0.SI<NewtonMeter>(), iceSpeed, true) as ResponseDryRun;
(emTqDt, iceSpeed, r1) = SearchEMTorque(absTime, dt, iceSpeed, r1.Engine.DynamicFullLoadTorque * 0.1, tmp.DeltaFullLoad);
}
if (r1 is ResponseSuccess && emTqDt != null && !emTqDt.IsBetween(
r1.ElectricMotor.MaxDriveTorque ?? 0.SI<NewtonMeter>(),
......
......@@ -364,7 +364,8 @@ namespace TUGraz.VectoCore.Tests.Integration.Hybrid
[
TestCase(30, 0.7, 0, TestName = "S4 Serial Hybrid DriveOff 30km/h SoC: 0.7, level"),
TestCase(80, 0.7, 0, TestName = "S4 Serial Hybrid DriveOff 80km/h SoC: 0.7, level"),
TestCase(30, 0.22, 0, TestName = "S4 Serial Hybrid DriveOff 30km/h SoC: 0.22, level")
TestCase(30, 0.22, 0, TestName = "S4 Serial Hybrid DriveOff 30km/h SoC: 0.22, level"),
TestCase(80, 0.22, 0, TestName = "S4 Serial Hybrid DriveOff 80km/h SoC: 0.22, level"),
]
public void S4HybridDriveOff(double vmax, double initialSoC, double slope)
{
......
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