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

only evaluate max em power if it does not go below low-soc threshold

parent 25460449
No related branches found
No related tags found
No related merge requests found
......@@ -788,6 +788,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
}
// make sure the max drive point is also covered.
var batEnergyAvailable = (DataBus.BatteryInfo.StoredEnergy - BatteryDischargeEnergyThreshold) / dt;
var emDrivePower = -(batEnergyAvailable - ModelData.ElectricAuxDemand);
var emTorqueM = emTqReq * maxU;
if (!responses.Any(x => x.Gear == nextGear && x.U.IsEqual(maxU)) && emTorqueM.IsBetween(
0.SI<NewtonMeter>(), firstResponse.ElectricMotor.MaxDriveTorque)) {
......@@ -796,11 +798,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
}
if (maxEmTorque.IsSmaller(0) && emTqReq.IsGreater(-maxEmTorque)) {
var tmp = TryConfiguration(absTime, dt, outTorque, outAngularVelocity, nextGear, emPos, maxEmTorque, maxEmTorque / emTqReq, allowIceOff);
responses.Add(tmp);
if (!tmp.Response.ElectricSystem.ConsumerPower.IsSmaller(emDrivePower)) {
responses.Add(tmp);
}
}
// if battery is getting empty try to set EM-torque to discharge battery to lower SoC boundary
var batEnergyAvailable = (DataBus.BatteryInfo.StoredEnergy - BatteryDischargeEnergyThreshold) / dt;
var emDrivePower = -(batEnergyAvailable - ModelData.ElectricAuxDemand);
if (maxEmTorque.IsSmaller(0) && (-emDrivePower).IsGreaterOrEqual(maxEmTorque * firstResponse.ElectricMotor.AngularVelocity)) {
// maxEmTorque < 0 ==> EM can still propell
// (-emDrivePower).IsGreaterOrEqual(maxEmTorque * firstResponse.ElectricMotor.AngularVelocity) ==> power available from battery for driving does not exceed max EM power (otherwise torque lookup may fail)
......
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