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

MeasuredSpeedDrivingCycle: Corrected Merger Errors

parent 4793a15b
No related branches found
No related tags found
No related merge requests found
......@@ -255,7 +255,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var retval = IdleController.Request(absTime, dt, 0.SI<NewtonMeter>(), null);
retval.ClutchPowerRequest = 0.SI<Watt>();
CurrentState.SetState(0.SI<NewtonMeter>(), retval.EngineSpeed, outTorque, outAngularVelocity);
CurrentState.SetState(0.SI<NewtonMeter>(), 0.SI<PerSecond>(), outTorque, outAngularVelocity);
TorqueConverter.Locked(CurrentState.InTorque, CurrentState.InAngularVelocity);
......
......@@ -21,7 +21,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
/// </summary>
public class MeasuredSpeedDrivingCycle :
StatefulProviderComponent
<MeasuredSpeedDrivingCycle.DrivingCycleState, ISimulationOutPort, IDriverDemandInPort, IDriverDemandOutPort>,
<MeasuredSpeedDrivingCycle.DrivingCycleState, ISimulationOutPort, IDriverDemandInPort, IDriverDemandOutPort>,
IDriverInfo, IDrivingCycleInfo, IMileageCounter, IDriverDemandInProvider, IDriverDemandInPort, ISimulationOutProvider,
ISimulationOutPort
{
......@@ -134,19 +134,32 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
.Case<ResponseGearShift>(() => response = NextComponent.Request(absTime, dt, acceleration, gradient))
.Case<ResponseUnderload>(r => {
DataBus.BrakePower = SearchAlgorithm.Search(DataBus.BrakePower, r.Delta, -r.Delta,
getYValue: result => RightSample.Current.Gear == 0
? ((ResponseDryRun)result).GearboxPowerRequest
: ((ResponseDryRun)result).DeltaDragLoad,
getYValue: result => DataBus.ClutchClosed(absTime)
? ((ResponseDryRun)result).DeltaDragLoad
: ((ResponseDryRun)result).GearboxPowerRequest,
evaluateFunction: x => {
DataBus.BrakePower = x;
return NextComponent.Request(absTime, dt, acceleration, gradient, true);
},
criterion: y => RightSample.Current.Gear == 0
? ((ResponseDryRun)y).GearboxPowerRequest.Value()
: ((ResponseDryRun)y).DeltaDragLoad.Value());
criterion: y => DataBus.ClutchClosed(absTime)
? ((ResponseDryRun)y).DeltaDragLoad.Value()
: ((ResponseDryRun)y).GearboxPowerRequest.Value());
Log.Info(
"Found operating point for braking. absTime: {0}, dt: {1}, acceleration: {2}, gradient: {3}, BrakePower: {4}",
absTime, dt, acceleration, gradient, DataBus.BrakePower);
if (DataBus.BrakePower.IsSmaller(0)) {
Log.Info(
"BrakePower was negative: {4}. Setting to 0 and searching for acceleration operating point. absTime: {0}, dt: {1}, acceleration: {2}, gradient: {3}",
absTime, dt, acceleration, gradient, DataBus.BrakePower);
DataBus.BrakePower = 0.SI<Watt>();
acceleration = SearchAlgorithm.Search(acceleration, r.Delta,
Constants.SimulationSettings.OperatingPointInitialSearchIntervalAccelerating,
getYValue: result => ((ResponseDryRun)result).DeltaFullLoad,
evaluateFunction: x => NextComponent.Request(absTime, dt, x, gradient, true),
criterion: y => ((ResponseDryRun)y).DeltaFullLoad.Value());
}
response = NextComponent.Request(absTime, dt, acceleration, gradient);
})
.Case<ResponseOverload>(r => {
......@@ -155,7 +168,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
getYValue: result => ((ResponseDryRun)result).DeltaFullLoad,
evaluateFunction: x => NextComponent.Request(absTime, dt, x, gradient, true),
criterion:
y => ((ResponseDryRun)y).DeltaFullLoad.Value());
y => ((ResponseDryRun)y).DeltaFullLoad.Value());
Log.Info(
"Found operating point for driver acceleration. absTime: {0}, dt: {1}, acceleration: {2}, gradient: {3}",
absTime,
......
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