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

Merge pull request #683 in VECTO/vecto-sim from...

Merge pull request #683 in VECTO/vecto-sim from ~EMQUARIMA/vecto-sim:bugfix/VECTO-797-vecto-abort-with-at-transmission-and-tc-table-value to develop

* commit '7a9a8e2f':
  adding info about TC state to the databus; force line-search for search braking power because interpolate search jumps to a very unreasonable operating point and the whole search and driving action screws up
parents 28ab8622 7a9a8e2f
Tags
No related merge requests found
Showing
with 322 additions and 293 deletions
...@@ -49,6 +49,8 @@ namespace TUGraz.VectoCore.Models.Simulation.DataBus ...@@ -49,6 +49,8 @@ namespace TUGraz.VectoCore.Models.Simulation.DataBus
/// <returns></returns> /// <returns></returns>
uint Gear { get; } uint Gear { get; }
bool TCLocked { get; }
MeterPerSecond StartSpeed { get; } MeterPerSecond StartSpeed { get; }
MeterPerSquareSecond StartAcceleration { get; } MeterPerSquareSecond StartAcceleration { get; }
......
...@@ -93,6 +93,16 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ...@@ -93,6 +93,16 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
} }
} }
public bool TCLocked
{
get {
if (Gearbox == null) {
return true;
}
return Gearbox.TCLocked;
}
}
public MeterPerSecond StartSpeed public MeterPerSecond StartSpeed
{ {
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design",
......
...@@ -144,6 +144,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -144,6 +144,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return response; return response;
} }
public override bool TCLocked { get { return PreviousState.TorqueConverterLocked; } }
internal ResponseDryRun Initialize(uint gear, bool torqueConverterLocked, NewtonMeter outTorque, internal ResponseDryRun Initialize(uint gear, bool torqueConverterLocked, NewtonMeter outTorque,
PerSecond outAngularVelocity) PerSecond outAngularVelocity)
{ {
......
...@@ -78,6 +78,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -78,6 +78,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
/// </summary> /// </summary>
public uint Gear { get; protected internal set; } public uint Gear { get; protected internal set; }
public abstract bool TCLocked { get; }
[DebuggerHidden] [DebuggerHidden]
public MeterPerSecond StartSpeed public MeterPerSecond StartSpeed
{ {
......
...@@ -126,6 +126,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -126,6 +126,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return response; return response;
} }
public override bool TCLocked { get { return !TorqueConverterActive ?? false; } }
/// <summary> /// <summary>
/// Requests the Gearbox to deliver torque and angularVelocity /// Requests the Gearbox to deliver torque and angularVelocity
/// </summary> /// </summary>
......
...@@ -732,7 +732,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -732,7 +732,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
? response.DeltaDragLoad ? response.DeltaDragLoad
: response.GearboxPowerRequest; : response.GearboxPowerRequest;
return delta.Value(); return delta.Value();
}); },
forceLineSearch: DataBus.GearboxType.AutomaticTransmission() && !DataBus.TCLocked);
return operatingPoint; return operatingPoint;
} catch (Exception) { } catch (Exception) {
......
...@@ -110,6 +110,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -110,6 +110,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return response; return response;
} }
public override bool TCLocked { get { return true; } }
internal ResponseDryRun Initialize(uint gear, NewtonMeter outTorque, PerSecond outAngularVelocity) internal ResponseDryRun Initialize(uint gear, NewtonMeter outTorque, PerSecond outAngularVelocity)
{ {
var oldGear = Gear; var oldGear = Gear;
......
...@@ -55,10 +55,10 @@ namespace TUGraz.VectoCore.Utils ...@@ -55,10 +55,10 @@ namespace TUGraz.VectoCore.Utils
/// </code> /// </code>
/// </summary> /// </summary>
public static T Search<T>(T x, SI y, T interval, Func<object, SI> getYValue, Func<T, object> evaluateFunction, public static T Search<T>(T x, SI y, T interval, Func<object, SI> getYValue, Func<T, object> evaluateFunction,
Func<object, double> criterion) where T : SIBase<T> Func<object, double> criterion, bool forceLineSearch = false) where T : SIBase<T>
{ {
var iterationCount = 0; var iterationCount = 0;
return Search(x, y, interval, getYValue, evaluateFunction, criterion, null, ref iterationCount); return Search(x, y, interval, getYValue, evaluateFunction, criterion, null, ref iterationCount, forceLineSearch);
} }
/// <summary> /// <summary>
...@@ -72,10 +72,10 @@ namespace TUGraz.VectoCore.Utils ...@@ -72,10 +72,10 @@ namespace TUGraz.VectoCore.Utils
/// </code> /// </code>
/// </summary> /// </summary>
public static T Search<T>(T x, SI y, T interval, Func<object, SI> getYValue, Func<T, object> evaluateFunction, public static T Search<T>(T x, SI y, T interval, Func<object, SI> getYValue, Func<T, object> evaluateFunction,
Func<object, double> criterion, Func<object, int, bool> abortCriterion) where T : SIBase<T> Func<object, double> criterion, Func<object, int, bool> abortCriterion, bool forceLineSearch = false) where T : SIBase<T>
{ {
var iterationCount = 0; var iterationCount = 0;
return Search(x, y, interval, getYValue, evaluateFunction, criterion, abortCriterion, ref iterationCount); return Search(x, y, interval, getYValue, evaluateFunction, criterion, abortCriterion, ref iterationCount, forceLineSearch);
} }
/// <summary> /// <summary>
...@@ -89,12 +89,18 @@ namespace TUGraz.VectoCore.Utils ...@@ -89,12 +89,18 @@ namespace TUGraz.VectoCore.Utils
/// </code> /// </code>
/// </summary> /// </summary>
public static T Search<T>(T x, SI y, T interval, Func<object, SI> getYValue, Func<T, object> evaluateFunction, public static T Search<T>(T x, SI y, T interval, Func<object, SI> getYValue, Func<T, object> evaluateFunction,
Func<object, double> criterion, Func<object, int, bool> abortCriterion, ref int iterationCount) where T : SIBase<T> Func<object, double> criterion, Func<object, int, bool> abortCriterion, ref int iterationCount, bool forceLineSearch) where T : SIBase<T>
{ {
T result; T result;
try { try {
result = InterpolateSearch(x, y, interval, getYValue, evaluateFunction, criterion, abortCriterion, if (forceLineSearch) {
result = LineSearch(x, y, interval, getYValue, evaluateFunction, criterion, abortCriterion, ref iterationCount);
} else {
result = InterpolateSearch(
x, y, interval, getYValue, evaluateFunction, criterion, abortCriterion,
ref iterationCount); ref iterationCount);
}
} catch (VectoException ex) { } catch (VectoException ex) {
var log = LogManager.GetLogger(typeof(SearchAlgorithm).FullName); var log = LogManager.GetLogger(typeof(SearchAlgorithm).FullName);
log.Debug("Falling back to InterpolationSearch in reverse. Normal InterpolationSearch failed: " + ex.Message); log.Debug("Falling back to InterpolationSearch in reverse. Normal InterpolationSearch failed: " + ex.Message);
......
...@@ -63,6 +63,7 @@ namespace TUGraz.VectoCore.Tests.Utils ...@@ -63,6 +63,7 @@ namespace TUGraz.VectoCore.Tests.Utils
public GearboxType GearboxType { get; set; } public GearboxType GearboxType { get; set; }
public uint Gear { get; set; } public uint Gear { get; set; }
public bool TCLocked { get; set; }
public GearInfo NextGear { get; private set; } public GearInfo NextGear { get; private set; }
public Second TractionInterruption public Second TractionInterruption
......
...@@ -61,6 +61,7 @@ namespace TUGraz.VectoCore.Tests.Utils ...@@ -61,6 +61,7 @@ namespace TUGraz.VectoCore.Tests.Utils
public GearboxType GearboxType { get; set; } public GearboxType GearboxType { get; set; }
public uint Gear { get; set; } public uint Gear { get; set; }
public bool TCLocked { get; set; }
public GearInfo NextGear { get; private set; } public GearInfo NextGear { get; private set; }
public Second TractionInterruption public Second TractionInterruption
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment