Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Verified Commit f6af645a authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

implement speed and torque limitations in electric motor in case of PEV vehicle

parent 33cb884b
Branches
Tags
No related merge requests found
......@@ -191,8 +191,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
maxRecuperationTorqueEm = null;
}
var maxDriveTorqueDt = maxDriveTorqueEm == null ? null : ConvertEmTorqueToDrivetrain(avgEmSpeed, maxDriveTorqueEm, dryRun);
var maxRecuperationTorqueDt = maxRecuperationTorqueEm == null ? null : ConvertEmTorqueToDrivetrain(avgEmSpeed, maxRecuperationTorqueEm, dryRun);
NewtonMeter maxGbxTorque = null;
if (NextComponent == null && DataBus.GearboxInfo != null && DataBus.GearboxInfo.Gear.Gear != 0) {
maxGbxTorque = DataBus.GearboxInfo.GetGearData(DataBus.GearboxInfo.Gear.Gear)?.MaxTorque;
}
var maxDriveTorqueDt = maxDriveTorqueEm == null ? null : VectoMath.Max(ConvertEmTorqueToDrivetrain(avgEmSpeed, maxDriveTorqueEm, dryRun), maxGbxTorque != null ? -maxGbxTorque : null);
var maxRecuperationTorqueDt = maxRecuperationTorqueEm == null ? null : VectoMath.Min(ConvertEmTorqueToDrivetrain(avgEmSpeed, maxRecuperationTorqueEm, dryRun), maxGbxTorque);
// control returns torque that shall be applied on the drivetrain. calculate backward to the EM
var emTorqueDt = Control.MechanicalAssistPower(absTime, dt, outTorque,
......@@ -328,9 +333,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return retVal;
}
// electric motor only
var speedLimit = GetMotorSpeedLimit(absTime);
var remainingPower = inTorqueDt * avgDtSpeed;
if (dryRun) {
retVal = new ResponseDryRun(this) {
DeltaEngineSpeed = outAngularVelocity - speedLimit,
Engine = { EngineSpeed = avgDtSpeed},
ElectricMotor = {
ElectricMotorPowerMech = (inTorqueDt - outTorque) * avgDtSpeed,
......@@ -343,6 +350,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
};
} else {
if (outAngularVelocity.IsGreater(speedLimit)) {
return new ResponseEngineSpeedTooHigh(this) {
DeltaEngineSpeed = outAngularVelocity - speedLimit,
};
}
if (remainingPower.IsEqual(0, Constants.SimulationSettings.LineSearchTolerance)) {
//if (electricSupplyResponse.MaxPowerDrive.IsGreaterOrEqual(0)) {
if (electricSupplyResponse is ElectricSystemUnderloadResponse) {
......@@ -420,6 +432,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return retVal;
}
protected virtual PerSecond GetMotorSpeedLimit(Second absTime)
{
if (DataBus.GearboxInfo.Gear.Gear == 0) {
return MaxSpeed;
}
return VectoMath.Min(DataBus.GearboxInfo.GetGearData(DataBus.GearboxInfo.Gear.Gear)?.MaxSpeed, MaxSpeed);
}
private NewtonMeter GetMaxRecuperationTorque(Volt volt, Second dt, PerSecond avgSpeed, GearshiftPosition gear)
{
var tqContinuousPwr = DeRatingActive ? ModelData.Overload.ContinuousTorque : null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment