mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-09 10:12:24 +01:00
AI braking: take power off when holding the speed uphill near a stop
Within fMaxProximityDist of a stop, going uphill, the AI holds its speed with AccDesired = min(0, AccPreferred). control_tractive_force only cut the power uphill when AccDesired < 0, so an AccDesired of exactly 0 kept the controller where it was. A consist that came into that range under power kept full power and crept up to the signal. Holding the speed uphill on the way to a stop now asks for no speeding up: power comes off once the train is faster than AccDesired allows. With the current brake valves this rarely shows: on a 10 per mille climb, four real-time runs of 32 consists each, the E186 with 25 empty 408W drew power in 0-14 samples of the last 50 m before and 0-8 after, no overruns either way. It surfaced once the AI predicted the ESt3 brake closer to what the valve delivers, where the same train crept to 12 km/h from 40 m out and overran the signal; with this change it stopped short in all runs.
This commit is contained in:
@@ -8099,7 +8099,9 @@ void TController::control_tractive_force() {
|
||||
}
|
||||
else if( velocity > VelDesired + SpeedCtrlMargin
|
||||
|| ( fAccGravity < -0.01 ?
|
||||
AccDesired < 0.0 :
|
||||
AccDesired < 0.0
|
||||
// holding the speed uphill on the way to a stop asks for no speeding up
|
||||
|| ( VelNext == 0.0 && ActualProximityDist <= fMaxProximityDist && AbsAccS > AccDesired + 0.05 ) :
|
||||
AbsAccS > AccDesired + 10.05 )
|
||||
|| IsAnyCouplerStretched ) {
|
||||
// jak za bardzo przyspiesza albo prędkość przekroczona
|
||||
|
||||
Reference in New Issue
Block a user