mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 16:19:19 +02:00
Fix of speed control: for EN57A EMUs
This commit is contained in:
@@ -2855,6 +2855,7 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
&& ( ctOwner != nullptr ) ) {
|
&& ( ctOwner != nullptr ) ) {
|
||||||
MoverParameters->MainCtrlPos = ctOwner->Controlling()->MainCtrlPos*MoverParameters->MainCtrlPosNo / std::max(1, ctOwner->Controlling()->MainCtrlPosNo);
|
MoverParameters->MainCtrlPos = ctOwner->Controlling()->MainCtrlPos*MoverParameters->MainCtrlPosNo / std::max(1, ctOwner->Controlling()->MainCtrlPosNo);
|
||||||
MoverParameters->SpeedCtrlValue = ctOwner->Controlling()->SpeedCtrlValue;
|
MoverParameters->SpeedCtrlValue = ctOwner->Controlling()->SpeedCtrlValue;
|
||||||
|
MoverParameters->SpeedCtrlUnit.IsActive = ctOwner->Controlling()->SpeedCtrlUnit.IsActive;
|
||||||
}
|
}
|
||||||
MoverParameters->CheckEIMIC(dt1);
|
MoverParameters->CheckEIMIC(dt1);
|
||||||
MoverParameters->CheckSpeedCtrl(dt1);
|
MoverParameters->CheckSpeedCtrl(dt1);
|
||||||
|
|||||||
@@ -2216,16 +2216,12 @@ bool TMoverParameters::IncScndCtrl(int CtrlSpeed)
|
|||||||
if ((OK) && (EngineType == TEngineType::ElectricInductionMotor) && (ScndCtrlPosNo == 1) && (MainCtrlPos>0))
|
if ((OK) && (EngineType == TEngineType::ElectricInductionMotor) && (ScndCtrlPosNo == 1) && (MainCtrlPos>0))
|
||||||
{
|
{
|
||||||
// NOTE: round() already adds 0.5, are the ones added here as well correct?
|
// NOTE: round() already adds 0.5, are the ones added here as well correct?
|
||||||
if ((Vmax < 250))
|
SpeedCtrlValue = Vel;
|
||||||
SpeedCtrlValue = Round(Vel);
|
|
||||||
else
|
|
||||||
SpeedCtrlValue = Round(Vel * 0.5);
|
|
||||||
if ((EIMCtrlType == 0)&&(SpeedCtrlAutoTurnOffFlag == 1))
|
if ((EIMCtrlType == 0)&&(SpeedCtrlAutoTurnOffFlag == 1))
|
||||||
{
|
{
|
||||||
MainCtrlActualPos = MainCtrlPos;
|
MainCtrlActualPos = MainCtrlPos;
|
||||||
}
|
}
|
||||||
SpeedCtrlUnit.IsActive = true;
|
SpeedCtrlUnit.IsActive = true;
|
||||||
SendCtrlToNext("SpeedCntrl", SpeedCtrlValue, CabNo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((OK) && (SpeedCtrl) && (ScndCtrlPos == 1) && (EngineType == TEngineType::DieselEngine))
|
if ((OK) && (SpeedCtrl) && (ScndCtrlPos == 1) && (EngineType == TEngineType::DieselEngine))
|
||||||
@@ -2286,7 +2282,6 @@ bool TMoverParameters::DecScndCtrl(int CtrlSpeed)
|
|||||||
if ((OK) && (EngineType == TEngineType::ElectricInductionMotor) && (ScndCtrlPosNo == 1))
|
if ((OK) && (EngineType == TEngineType::ElectricInductionMotor) && (ScndCtrlPosNo == 1))
|
||||||
{
|
{
|
||||||
SpeedCtrlValue = 0;
|
SpeedCtrlValue = 0;
|
||||||
SendCtrlToNext("SpeedCntrl", SpeedCtrlValue, CabNo);
|
|
||||||
SpeedCtrlUnit.IsActive = false;
|
SpeedCtrlUnit.IsActive = false;
|
||||||
if (SpeedCtrlUnit.ManualStateOverride) {
|
if (SpeedCtrlUnit.ManualStateOverride) {
|
||||||
eimic = 0.0;
|
eimic = 0.0;
|
||||||
@@ -5603,11 +5598,10 @@ double TMoverParameters::TractionForce( double dt ) {
|
|||||||
SpeedCtrlTimer += dt;
|
SpeedCtrlTimer += dt;
|
||||||
if (SpeedCtrlTimer > SpeedCtrlDelay)
|
if (SpeedCtrlTimer > SpeedCtrlDelay)
|
||||||
{
|
{
|
||||||
int NewSCAP = (Vmax < 250 ? 1 : 0.5) * (float)ScndCtrlPos / (float)ScndCtrlPosNo * Vmax;
|
int NewSCAP = (float)ScndCtrlPos / (float)ScndCtrlPosNo * Vmax;
|
||||||
if (NewSCAP != SpeedCtrlValue)
|
if (NewSCAP != SpeedCtrlValue)
|
||||||
{
|
{
|
||||||
SpeedCtrlValue = NewSCAP;
|
SpeedCtrlValue = NewSCAP;
|
||||||
// SendCtrlToNext("SpeedCntrl", SpeedCtrlValue, CabNo);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user