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
Commit 69f456f4 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

renamed shiftTime to engageTime

parent 3173092b
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -66,7 +66,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
/// <summary> /// <summary>
/// Time when a gearbox shift engages a new gear (shift is finished). Is set when shifting is needed. /// Time when a gearbox shift engages a new gear (shift is finished). Is set when shifting is needed.
/// </summary> /// </summary>
private Second _shiftTime = 0.SI<Second>(); private Second _engageTime = 0.SI<Second>();
/// <summary> /// <summary>
/// True if gearbox is disengaged (no gear is set). /// True if gearbox is disengaged (no gear is set).
...@@ -75,7 +75,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -75,7 +75,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public bool ClutchClosed(Second absTime) public bool ClutchClosed(Second absTime)
{ {
return _shiftTime.IsSmallerOrEqual(absTime); return _engageTime.IsSmallerOrEqual(absTime);
} }
public Gearbox(IVehicleContainer container, GearboxData gearboxModelData, IShiftStrategy strategy) : base(container) public Gearbox(IVehicleContainer container, GearboxData gearboxModelData, IShiftStrategy strategy) : base(container)
...@@ -138,7 +138,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -138,7 +138,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var dt = Constants.SimulationSettings.TargetTimeInterval; var dt = Constants.SimulationSettings.TargetTimeInterval;
// MK 2016-02-10: SI doesn't allow inifinity anymore -- therefore simply a very negative value is used. // MK 2016-02-10: SI doesn't allow inifinity anymore -- therefore simply a very negative value is used.
_shiftTime = -1e10.SI<Second>(); //double.NegativeInfinity.SI<Second>(); _engageTime = -1e10.SI<Second>(); //double.NegativeInfinity.SI<Second>();
if (Disengaged) { if (Disengaged) {
Gear = _strategy.InitGear(absTime, dt, outTorque, outAngularVelocity); Gear = _strategy.InitGear(absTime, dt, outTorque, outAngularVelocity);
...@@ -217,7 +217,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -217,7 +217,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{ {
Log.Debug("Gearbox Power Request: torque: {0}, angularVelocity: {1}", torque, angularVelocity); Log.Debug("Gearbox Power Request: torque: {0}, angularVelocity: {1}", torque, angularVelocity);
if (DataBus.VehicleStopped) { if (DataBus.VehicleStopped) {
_shiftTime = absTime; _engageTime = absTime;
} }
IResponse retVal; IResponse retVal;
// TODO: MQ 2016/03/10: investigate further the effects of having the condition angularvelocity != 0 // TODO: MQ 2016/03/10: investigate further the effects of having the condition angularvelocity != 0
...@@ -259,12 +259,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -259,12 +259,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}; };
} }
var shiftTimeExceeded = absTime.IsSmaller(_shiftTime) && var shiftTimeExceeded = absTime.IsSmaller(_engageTime) &&
_shiftTime.IsSmaller(absTime + dt, ModelData.TractionInterruption / 20.0); // allow 5% tolerance of shift time _engageTime.IsSmaller(absTime + dt, ModelData.TractionInterruption / 20.0); // allow 5% tolerance of shift time
if (shiftTimeExceeded) { if (shiftTimeExceeded) {
return new ResponseFailTimeInterval { return new ResponseFailTimeInterval {
Source = this, Source = this,
DeltaT = _shiftTime - absTime, DeltaT = _engageTime - absTime,
GearboxPowerRequest = outTorque * (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0 GearboxPowerRequest = outTorque * (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0
}; };
} }
...@@ -319,17 +319,16 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -319,17 +319,16 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
} }
var avgOutAngularVelocity = (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0; var avgOutAngularVelocity = (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0;
var torqueLoss = ModelData.Gears[Gear].LossMap.GetTorqueLoss(avgOutAngularVelocity, outTorque); var inTorqueLoss = ModelData.Gears[Gear].LossMap.GetTorqueLoss(avgOutAngularVelocity, outTorque);
var inTorque = outTorque / ModelData.Gears[Gear].Ratio + torqueLoss; var inTorque = outTorque / ModelData.Gears[Gear].Ratio + inTorqueLoss;
var inAngularVelocity = outAngularVelocity * ModelData.Gears[Gear].Ratio; var inAngularVelocity = outAngularVelocity * ModelData.Gears[Gear].Ratio;
if (dryRun) { if (dryRun) {
if ((DataBus.DrivingBehavior == DrivingBehavior.Braking || DataBus.DrivingBehavior == DrivingBehavior.Coasting) && if ((DataBus.DrivingBehavior == DrivingBehavior.Braking || DataBus.DrivingBehavior == DrivingBehavior.Coasting) &&
inAngularVelocity < DataBus.EngineIdleSpeed && inAngularVelocity < DataBus.EngineIdleSpeed && DataBus.VehicleSpeed < Constants.SimulationSettings.VehicleStopClutchDisengageSpeed) {
DataBus.VehicleSpeed < Constants.SimulationSettings.VehicleStopClutchDisengageSpeed) {
Disengaged = true; Disengaged = true;
_shiftTime = absTime + dt; _engageTime = absTime + dt;
_strategy.Disengage(absTime, dt, outTorque, outAngularVelocity); _strategy.Disengage(absTime, dt, outTorque, outAngularVelocity);
Log.Debug("EngineSpeed is below IdleSpeed, Gearbox disengage!"); Log.Debug("EngineSpeed is below IdleSpeed, Gearbox disengage!");
return new ResponseEngineSpeedTooLow { Source = this, GearboxPowerRequest = outTorque * outAngularVelocity }; return new ResponseEngineSpeedTooLow { Source = this, GearboxPowerRequest = outTorque * outAngularVelocity };
...@@ -343,13 +342,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -343,13 +342,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (shiftAllowed) { if (shiftAllowed) {
var shiftRequired = _strategy.ShiftRequired(absTime, dt, outTorque, outAngularVelocity, inTorque, inAngularVelocity, var shiftRequired = _strategy.ShiftRequired(absTime, dt, outTorque, outAngularVelocity, inTorque, inAngularVelocity,
Gear, _shiftTime + ModelData.TractionInterruption); Gear, _engageTime + ModelData.TractionInterruption);
if (shiftRequired) { if (shiftRequired) {
_shiftTime = absTime + ModelData.TractionInterruption; _engageTime = absTime + ModelData.TractionInterruption;
Log.Debug("Gearbox is shifting. absTime: {0}, dt: {1}, shiftTime: {2}, out: ({3}, {4}), in: ({5}, {6})", absTime, Log.Debug("Gearbox is shifting. absTime: {0}, dt: {1}, interuptionTime: {2}, out: ({3}, {4}), in: ({5}, {6})", absTime,
dt, _shiftTime, outTorque, outAngularVelocity, inTorque, inAngularVelocity); dt, _engageTime, outTorque, outAngularVelocity, inTorque, inAngularVelocity);
Disengaged = true; Disengaged = true;
_strategy.Disengage(absTime, dt, outTorque, outAngularVelocity); _strategy.Disengage(absTime, dt, outTorque, outAngularVelocity);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment