17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-09 10:12:24 +01:00

Brake force table: take the rapid step threshold from the distributor

TMoverParameters::BrakeForceR() halves the force of a vehicle set to R
below 40 km/h. That is one approximation for every distributor, but a
NESt3/ESt4 distributor with a rapid relay engages the step above 70 km/h
and keeps it down to 50 km/h (TNESt3::GetPF, RapidStatus), and below
that its cylinder pressure is divided by the relay's own multiplier
(TRapid, RapidMult). For a vehicle braking from speed the full force
therefore lasts down to 50 km/h, not 40. The AI builds its consist brake
table (fBrake_a0/a1) from BrakeForceR(), so between 40 and 50 km/h it
expected twice the force the wagons actually deliver.

Add TBrake::GetRapidRatio(), which keeps the old approximation as the
default, and override it in TNESt3 with the relay's threshold and
multiplier. The brake itself is unchanged; only the prediction is.
This commit is contained in:
pwarszawski
2026-09-27 17:50:07 +02:00
parent b1bdd42178
commit 36d4f16c01
4 changed files with 20 additions and 2 deletions

View File

@@ -5166,8 +5166,8 @@ double TMoverParameters::BrakeForceR(double ratio, double velocity)
press = MaxBrakePress[3];
if (DynamicBrakeType == dbrake_automatic)
ratio = ratio + (1.5 - ratio) * std::min(1.0, Vel * 0.02);
if (BrakeDelayFlag & bdelay_R && BrakeMethod % 128 != bp_Cosid && BrakeMethod % 128 != bp_D1 && BrakeMethod % 128 != bp_D2 && Power < 1 && velocity < 40)
ratio = ratio / 2;
if (BrakeDelayFlag & bdelay_R && BrakeMethod % 128 != bp_Cosid && BrakeMethod % 128 != bp_D1 && BrakeMethod % 128 != bp_D2 && Power < 1)
ratio *= Hamulec->GetRapidRatio(velocity);
if (TrainType == dt_DMU && velocity < 30.0)
{
ratio -= 0.3;

View File

@@ -324,6 +324,17 @@ void TNESt3::Init( double const PP, double const HPP, double const LPP, double c
RapidStaly = false;
}
double TNESt3::GetRapidRatio(double const Vel) const
{
// ESt3 has no rapid relay, and with disc brakes the rapid step stays engaged at all speeds
if( ( PrzekRapid == nullptr ) || ( true == RapidStaly ) ) {
return 1.0;
}
// a braking vehicle comes from above, so the step is still engaged down to the speed
// at which GetPF() drops it, not the one at which it engages
return ( Vel < 50.0 ? 1.0 / PrzekRapid->GetRapidMult() : 1.0 );
}
double TNESt3::GetCRP()
{
return CntrlRes->P();

View File

@@ -117,6 +117,7 @@ class TRapid : public TPrzekladnik {
public:
void SetRapidParams(double mult, double size);
void SetRapidStatus(bool rs);
double GetRapidMult() const { return RapidMult; }
void Update(double dt) /*override*/;
inline TRapid() :
TPrzekladnik()
@@ -213,6 +214,7 @@ class TNESt3 : public TBrake {
virtual double GetPF( double const PP, double const dt, double const Vel ) /*override*/; // przeplyw miedzy komora wstepna i PG
void EStParams(double i_crc); // parametry charakterystyczne dla ESt
virtual double GetCRP() /*override*/;
double GetRapidRatio(double const Vel) const override;
void CheckState(double const BCP, double &dV1); // glowny przyrzad rozrzadczy
void CheckReleaser(double const dt); // odluzniacz
double CVs(double const BP); // napelniacz sterujacego

View File

@@ -442,6 +442,11 @@ class TBrake
/// <summary>Sets the rapid step ratio. Default no-op; overridden where supported.</summary>
/// <param name="RMR">Rapid ratio.</param>
virtual void SetRM(double const RMR) {}; // ustalenie przelozenia rapida
/// <summary>Share of the full cylinder pressure the distributor delivers at the given speed
/// while the vehicle is slowing down through it, for a vehicle set to R. Used only to predict
/// the brake force; the default is the approximation BrakeForceR() has always used.</summary>
/// <param name="Vel">Vehicle velocity [km/h].</param>
virtual double GetRapidRatio(double const Vel) const { return Vel < 40.0 ? 0.5 : 1.0; }
/// <summary>Sets the velocity threshold for the rapid step.</summary>
/// <param name="RVR">Velocity threshold (same unit as Vel passed to GetPF).</param>
virtual void SetRV(double const RVR)