mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 00:09:18 +02:00
Fix for last fix for speed control
This commit is contained in:
@@ -6529,7 +6529,7 @@ void TMoverParameters::CheckSpeedCtrl(double dt)
|
|||||||
}
|
}
|
||||||
double error = (std::max(SpeedCtrlValue + SpeedCtrlUnit.Offset, 0.0) - Vel);
|
double error = (std::max(SpeedCtrlValue + SpeedCtrlUnit.Offset, 0.0) - Vel);
|
||||||
double factorP = error > 0 ? SpeedCtrlUnit.FactorPpos : SpeedCtrlUnit.FactorPneg;
|
double factorP = error > 0 ? SpeedCtrlUnit.FactorPpos : SpeedCtrlUnit.FactorPneg;
|
||||||
double eSCP = clamp(factorP * error, -1.2, UniCtrlList[MainCtrlPos].MaxCtrlVal); //P module
|
double eSCP = clamp(factorP * error, -1.2, 1.0); //P module
|
||||||
if (eSCP < -1.0)
|
if (eSCP < -1.0)
|
||||||
{
|
{
|
||||||
SpeedCtrlUnit.BrakeInterventionBraking = (eSCP < -1.1) && (Vel < hydro_TC_UnlockSpeed);
|
SpeedCtrlUnit.BrakeInterventionBraking = (eSCP < -1.1) && (Vel < hydro_TC_UnlockSpeed);
|
||||||
@@ -6545,7 +6545,7 @@ void TMoverParameters::CheckSpeedCtrl(double dt)
|
|||||||
else {
|
else {
|
||||||
eimicSpeedCtrlIntegral = 0;
|
eimicSpeedCtrlIntegral = 0;
|
||||||
}
|
}
|
||||||
eimicSpeedCtrl = clamp(eimicSpeedCtrlIntegral + eSCP, -SpeedCtrlUnit.DesiredPower, SpeedCtrlUnit.DesiredPower);
|
eimicSpeedCtrl = clamp(eimicSpeedCtrlIntegral + eSCP, -SpeedCtrlUnit.DesiredPower, SpeedCtrlUnit.DesiredPower*double(UniCtrlList[MainCtrlPos].SpeedUp > 0));
|
||||||
if (Vel < SpeedCtrlUnit.FullPowerVelocity) {
|
if (Vel < SpeedCtrlUnit.FullPowerVelocity) {
|
||||||
eimicSpeedCtrl = std::min(eimicSpeedCtrl, SpeedCtrlUnit.InitialPower);
|
eimicSpeedCtrl = std::min(eimicSpeedCtrl, SpeedCtrlUnit.InitialPower);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user