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 b2801f45 authored by Stefanos Doumpoulakis's avatar Stefanos Doumpoulakis
Browse files

fix #610: broken VTP mode due to Clutch

parent da5220c9
Branches
Tags
No related merge requests found
...@@ -228,14 +228,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -228,14 +228,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var engTorque = 0.SI<NewtonMeter>(); var engTorque = 0.SI<NewtonMeter>();
/* gear used for clutch slipping: saturation to avoid case where Gear==0 (where GetGearData crash) and Gear>2 (allowslipping does not allow slipping at speed higher than 2) */ /* gear used for clutch slipping: saturation to avoid case where Gear==0 (where GetGearData crash) and Gear>2 (allowslipping does not allow slipping at speed higher than 2) */
if ((DataBus.DrivingCycleInfo.RoadGradient != null) && (DataBus.WheelsInfo != null))
{
var slipGear = Math.Min(Math.Max(DataBus.GearboxInfo?.Gear?.Gear ?? 1, 1), 2); var slipGear = Math.Min(Math.Max(DataBus.GearboxInfo?.Gear?.Gear ?? 1, 1), 2);
var ratioGB = DataBus.GearboxInfo?.GetGearData(slipGear)?.Ratio ?? 1.0; var ratioGB = DataBus.GearboxInfo?.GetGearData(slipGear)?.Ratio ?? 1.0;
var ratioAxl = DataBus.AxlegearInfo?.Ratio ?? 1.0; var ratioAxl = DataBus.AxlegearInfo?.Ratio ?? 1.0;
var axlegearlossP = DataBus.AxlegearInfo?.AxlegearLoss() ?? 0.0.SI<Watt>(); var axlegearlossP = DataBus.AxlegearInfo?.AxlegearLoss() ?? 0.0.SI<Watt>();
var gearboxlossP = DataBus.GearboxInfo?.GearboxLoss() ?? 0.0.SI<Watt>(); var gearboxlossP = DataBus.GearboxInfo?.GearboxLoss() ?? 0.0.SI<Watt>();
if (DataBus.DrivingCycleInfo.RoadGradient != null)
{
var fWheel = DataBus.VehicleInfo.RollingResistance(DataBus.DrivingCycleInfo.RoadGradient) var fWheel = DataBus.VehicleInfo.RollingResistance(DataBus.DrivingCycleInfo.RoadGradient)
+ DataBus.VehicleInfo.SlopeResistance(DataBus.DrivingCycleInfo.RoadGradient) + DataBus.VehicleInfo.SlopeResistance(DataBus.DrivingCycleInfo.RoadGradient)
+ DataBus.VehicleInfo.TotalMass*acc; + DataBus.VehicleInfo.TotalMass*acc;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment