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 6bf45843 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

added pWheelClutch for controlling the engine speed with the cycle

parent 948d28ed
No related branches found
No related tags found
No related merge requests found
......@@ -97,9 +97,8 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
throw new ArgumentOutOfRangeException();
}
// pWheel: pt1 disabled!!
var engine = new CombustionEngine(_container, data.EngineData, pt1Disabled: true);
var clutch = new Clutch(_container, data.EngineData, engine.IdleController);
var clutch = new PWheelClutch(_container, engine.IdleController);
// gearbox --> clutch
tmp = AddComponent(tmp, clutch);
......
......@@ -37,9 +37,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
private NewtonMeter _requiredTorque;
public Clutch(IVehicleContainer cockpit, CombustionEngineData engineData,
protected Clutch(IVehicleContainer container) : base(container) {}
public Clutch(IVehicleContainer container, CombustionEngineData engineData,
ICombustionEngineIdleController idleController)
: base(cockpit)
: base(container)
{
_idleSpeed = engineData.IdleSpeed;
_ratedSpeed = engineData.FullLoadCurve.RatedSpeed;
......@@ -68,7 +71,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return this;
}
public ITnOutPort OutPort()
{
return this;
......@@ -120,7 +122,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
NextComponent = other;
}
private void AddClutchLoss(NewtonMeter torque, PerSecond angularVelocity, out NewtonMeter torqueIn,
protected virtual void AddClutchLoss(NewtonMeter torque, PerSecond angularVelocity, out NewtonMeter torqueIn,
out PerSecond engineSpeedIn)
{
Log.Debug("from Wheels: torque: {0}, angularVelocity: {1}, power {2}", torque, angularVelocity,
......@@ -133,8 +135,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
engineSpeedIn = _idleSpeed;
torqueIn = 0.SI<NewtonMeter>();
} else {
var engineSpeedNorm = (angularVelocity - _idleSpeed) /
(_ratedSpeed - _idleSpeed);
var engineSpeedNorm = (angularVelocity - _idleSpeed) / (_ratedSpeed - _idleSpeed);
if (engineSpeedNorm < Constants.SimulationSettings.CluchNormSpeed) {
_clutchState = ClutchState.ClutchSlipping;
......@@ -142,8 +143,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var clutchSpeedNorm = Constants.SimulationSettings.CluchNormSpeed /
((_idleSpeed + Constants.SimulationSettings.CluchNormSpeed * (_ratedSpeed - _idleSpeed)) / _ratedSpeed);
engineSpeedIn =
((clutchSpeedNorm * engineSpeed0 / _ratedSpeed) * (_ratedSpeed - _idleSpeed) + _idleSpeed).Radian
.Cast<PerSecond>();
((clutchSpeedNorm * engineSpeed0 / _ratedSpeed) * (_ratedSpeed - _idleSpeed) + _idleSpeed).Radian.Cast<PerSecond>();
torqueIn = (torque * angularVelocity) / ClutchEff / engineSpeedIn;
} else {
......@@ -154,4 +154,22 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
Formulas.TorqueToPower(torqueIn, engineSpeedIn));
}
}
/// <summary>
/// Clutch without losses and slipping behaviour for PWheel driving cycle.
/// </summary>
public class PWheelClutch : Clutch
{
public PWheelClutch(IVehicleContainer container, ICombustionEngineIdleController idleController) : base(container)
{
IdleController = idleController;
}
protected override void AddClutchLoss(NewtonMeter torque, PerSecond angularVelocity, out NewtonMeter torqueIn,
out PerSecond engineSpeedIn)
{
torqueIn = torque;
engineSpeedIn = angularVelocity;
}
}
}
\ 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