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
Unverified Commit c5995b15 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

disable recuperation of EM only in case the driver wants to brake (i.e., allow...

disable recuperation of EM only in case the driver wants to brake (i.e., allow recuperation in case the driver performs an accelerate action to overcome the drag losses in the EM)
parent e0f8d7b3
Branches
Tags
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Utils; using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.Models.Simulation.DataBus;
using TUGraz.VectoCore.Models.Simulation.Impl; using TUGraz.VectoCore.Models.Simulation.Impl;
using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Utils; using TUGraz.VectoCore.Utils;
...@@ -59,7 +60,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { ...@@ -59,7 +60,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
protected virtual bool CannotProvideRecuperationAtLowSpeed(NewtonMeter outTorque) protected virtual bool CannotProvideRecuperationAtLowSpeed(NewtonMeter outTorque)
{ {
return (DataBus.VehicleInfo.VehicleSpeed ?? 0.SI<MeterPerSecond>()).IsSmallerOrEqual( var driverIsBraking = DataBus.DriverInfo.DriverBehavior == DrivingBehavior.Braking &&
DataBus.DriverInfo.DrivingAction == DrivingAction.Brake;
return driverIsBraking && (DataBus.VehicleInfo.VehicleSpeed ?? 0.SI<MeterPerSecond>()).IsSmallerOrEqual(
GearboxModelData?.DisengageWhenHaltingSpeed ?? Constants.SimulationSettings.ATGearboxDisengageWhenHaltingSpeed) GearboxModelData?.DisengageWhenHaltingSpeed ?? Constants.SimulationSettings.ATGearboxDisengageWhenHaltingSpeed)
&& outTorque.IsSmaller(0); && outTorque.IsSmaller(0);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment