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

hybrid controller: split calculation of cost and gearshift penalty for debugging purpose

allow emergencyshift if ICE is off so that EM speed stays with in range of ICE
parent ad486028
No related branches found
No related tags found
No related merge requests found
......@@ -48,13 +48,15 @@ namespace TUGraz.VectoCommon.Models {
{
get
{
var cost = (FuelCosts + EquivalenceFactor * (BatCosts + ICEStartPenalty1) * SoCPenalty + ICEStartPenalty2 +
Cost = (FuelCosts + EquivalenceFactor * (BatCosts + ICEStartPenalty1) * SoCPenalty + ICEStartPenalty2 +
RampUpPenalty);
var gearshift = cost.IsSmaller(0) ? GearshiftPenalty : 1 / GearshiftPenalty;
return cost * gearshift;
var gearshift = Cost.IsSmaller(0) ? GearshiftPenalty : 1 / GearshiftPenalty;
return Cost * gearshift;
}
}
public double Cost { get; set; }
public double FuelCosts { get; set; }
public double BatCosts { get; set; }
......
......@@ -181,6 +181,17 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
continue;
}
var gear = DataBus.GearboxInfo.Gear;
var maxSpeed = VectoMath.Min(DataBus.GearboxInfo.GetGearData(gear.Gear).MaxSpeed,
DataBus.EngineInfo.EngineN95hSpeed);
if (!dryRun && retVal is ResponseSuccess && DataBus.GearboxInfo.GearEngaged(absTime) && retVal.Gearbox.InputSpeed.IsGreater(maxSpeed)) {
Strategy.AllowEmergencyShift = true;
retryCount++;
retry = true;
Strategy.OperatingpointChangedDuringRequest(absTime, dt, outTorque, outAngularVelocity, false, retVal);
continue;
}
if (!dryRun && strategySettings.CombustionEngineOn && retVal is ResponseEngineSpeedTooHigh && !strategySettings.ProhibitGearshift) {
retryCount++;
retry = true;
......
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