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

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

compute shift losses for measured speed mode with gear

parent 820c64e5
No related branches found
No related tags found
No related merge requests found
......@@ -228,10 +228,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return dryRunResponse;
}
// this code has to be _after_ the check for a potential gear-shift!
// (the above block issues dry-run requests and thus may update the CurrentState!)
CurrentState.TransmissionTorqueLoss = inTorque - (outTorque / effectiveRatio);
if (Gear != PreviousState.Gear &&
ConsiderShiftLosses(new GearInfo(Gear, torqueConverterLocked), outTorque)) {
CurrentState.PowershiftLosses = ComputeShiftLosses(dt, outTorque, outAngularVelocity);
}
inTorque += CurrentState.PowershiftLosses ?? 0.SI<NewtonMeter>();
CurrentState.SetState(inTorque, inAngularVelocity, outTorque, outAngularVelocity);
CurrentState.Gear = Gear;
// end critical section
......@@ -339,6 +342,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (ModelData.Type.AutomaticTransmission()) {
container[ModalResultField.TC_Locked] = !CurrentState.TorqueConverterActive;
container[ModalResultField.P_gbx_shift_loss] = CurrentState.PowershiftLosses == null
? 0.SI<Watt>()
: CurrentState.PowershiftLosses * avgInAngularSpeed;
}
// torque converter fields are written by TorqueConverter (if present), called from Vehicle container
}
......@@ -382,6 +388,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public class CycleGearboxState : GearboxState
{
public bool TorqueConverterActive;
public NewtonMeter PowershiftLosses { get; set; }
}
public class CycleShiftStrategy : IShiftStrategy
......
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