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

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

fix: cycle gearbox: torque converter was called with wrong speed & torque;...

fix: cycle gearbox: torque converter was called with wrong speed & torque; disengage if engine speed is below idle speed
parent a71abdd7
No related branches found
No related tags found
No related merge requests found
......@@ -145,7 +145,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
retVal.GearboxPowerRequest = outTorque * outAngularVelocity;
return retVal;
}
/// <summary>
......@@ -184,7 +183,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (dryRun) {
if (TorqueConverter != null && TorqueConverterActive != null && TorqueConverterActive.Value) {
return RequestTorqueConverter(absTime, dt, outTorque, outAngularVelocity, true);
return RequestTorqueConverter(absTime, dt, inTorque, inAngularVelocity, true);
}
if (outTorque.IsSmaller(0) && inAngularVelocity.IsSmaller(DataBus.EngineIdleSpeed)) {
//Log.Warn("engine speed would fall below idle speed - disengage! gear from cycle: {0}, vehicle speed: {1}", Gear,
// DataBus.VehicleSpeed);
Gear = 0;
return RequestDisengaged(absTime, dt, outTorque, outAngularVelocity, dryRun);
}
var dryRunResponse = NextComponent.Request(absTime, dt, inTorque, inAngularVelocity, true);
dryRunResponse.GearboxPowerRequest = outTorque * avgOutAngularVelocity;
......@@ -201,9 +206,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (TorqueConverter != null && TorqueConverterActive != null && TorqueConverterActive.Value) {
CurrentState.TorqueConverterActive = true;
return RequestTorqueConverter(absTime, dt, outTorque, outAngularVelocity);
return RequestTorqueConverter(absTime, dt, inTorque, inAngularVelocity);
}
if (outTorque.IsSmaller(0) && inAngularVelocity.IsSmaller(DataBus.EngineIdleSpeed)) {
Log.Warn("engine speed would fall below idle speed - disengage! gear from cycle: {0}, vehicle speed: {1}", Gear,
DataBus.VehicleSpeed);
Gear = 0;
return RequestDisengaged(absTime, dt, outTorque, outAngularVelocity, dryRun);
}
var response = NextComponent.Request(absTime, dt, inTorque, inAngularVelocity);
response.GearboxPowerRequest = outTorque * avgOutAngularVelocity;
return response;
......@@ -214,8 +224,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
/// </summary>
/// <param name="absTime"></param>
/// <param name="dt"></param>
/// <param name="outTorque"></param>
/// <param name="outAngularVelocity"></param>
/// <param name="outTorque">torque at the output of the torque converter (to the mechanical gear)</param>
/// <param name="outAngularVelocity">angular velocity at the output of the torque converter (to the mechanical gear)</param>
/// <param name="dryRun"></param>
/// <returns></returns>
private IResponse RequestTorqueConverter(Second absTime, Second dt, NewtonMeter outTorque,
......@@ -225,6 +235,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return RequestTorqueConverterDryRun(absTime, dt, outTorque, outAngularVelocity);
}
var operatingPoint = FindOperatingPoint(outTorque, outAngularVelocity);
CurrentState.TorqueConverterOperatingPoint = operatingPoint;
if (!outAngularVelocity.IsEqual(operatingPoint.OutAngularVelocity) || !outTorque.IsEqual(operatingPoint.OutTorque)) {
// a different operating point was found...
var delta = (outTorque - operatingPoint.OutTorque) *
......@@ -404,6 +415,47 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
container[ModalResultField.P_gbx_loss] = CurrentState.TransmissionTorqueLoss * avgInAngularSpeed;
container[ModalResultField.P_gbx_inertia] = CurrentState.InertiaTorqueLossOut * avgInAngularSpeed;
container[ModalResultField.P_gbx_in] = CurrentState.InTorque * avgInAngularSpeed;
if (TorqueConverter != null) {
DoWriteTorqueConverterModalResults(container, avgInAngularSpeed);
}
}
private void DoWriteTorqueConverterModalResults(IModalDataContainer container, PerSecond avgInAngularSpeed)
{
if (CurrentState.TorqueConverterOperatingPoint == null) {
container[ModalResultField.TorqueConverterTorqueRatio] = 1.0;
container[ModalResultField.TorqueConverterSpeedRatio] = 1.0;
container[ModalResultField.TC_TorqueIn] = CurrentState.InTorque;
container[ModalResultField.TC_TorqueOut] = CurrentState.InTorque;
container[ModalResultField.TC_angularSpeedIn] = CurrentState.InAngularVelocity;
container[ModalResultField.TC_angularSpeedOut] = CurrentState.OutAngularVelocity;
container[ModalResultField.P_TC_out] = CurrentState.InTorque * avgInAngularSpeed;
container[ModalResultField.P_TC_loss] = 0.SI<Watt>();
} else {
container[ModalResultField.TorqueConverterTorqueRatio] = CurrentState.TorqueConverterOperatingPoint.TorqueRatio;
container[ModalResultField.TorqueConverterSpeedRatio] = CurrentState.TorqueConverterOperatingPoint.SpeedRatio;
container[ModalResultField.TC_TorqueIn] = CurrentState.TorqueConverterOperatingPoint.InTorque;
container[ModalResultField.TC_TorqueOut] = CurrentState.TorqueConverterOperatingPoint.OutTorque;
container[ModalResultField.TC_angularSpeedIn] = CurrentState.TorqueConverterOperatingPoint.InAngularVelocity;
container[ModalResultField.TC_angularSpeedOut] = CurrentState.TorqueConverterOperatingPoint.OutAngularVelocity;
var avgOutVelocity = ((PreviousState.TorqueConverterOperatingPoint != null
? PreviousState.TorqueConverterOperatingPoint.OutAngularVelocity
: PreviousState.InAngularVelocity) +
CurrentState.TorqueConverterOperatingPoint.OutAngularVelocity) / 2.0;
var avgInVelocity = ((PreviousState.TorqueConverterOperatingPoint != null
? PreviousState.TorqueConverterOperatingPoint.InAngularVelocity
: PreviousState.InAngularVelocity) +
CurrentState.TorqueConverterOperatingPoint.InAngularVelocity) / 2.0;
container[ModalResultField.P_TC_out] = CurrentState.OutTorque * avgOutVelocity;
container[ModalResultField.P_TC_loss] = CurrentState.InTorque * avgInVelocity -
CurrentState.OutTorque * avgOutVelocity;
}
}
protected override void DoCommitSimulationStep()
......@@ -435,6 +487,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public class CycleGearboxState : GearboxState
{
public bool TorqueConverterActive;
public TorqueConverterOperatingPoint TorqueConverterOperatingPoint;
}
}
}
\ No newline at end of file
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