18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-24 15:29:14 +01:00
Files
maszyna/application/driverhints_def.h
maj00r e0b2bdfb7f fix(ai): a standing train starts only with its brakes charged, held on the locomotive brake while it charges (#444)
* fix(ai): a standing train starts only with its brakes charged, held on the locomotive brake while it charges

Prepared from cold, the AI filled the brake pipe at once with the locomotive brake off: the distributors
released while the auxiliary reservoirs were still empty, so the train had no air to brake with, and on
a gradient it rolled as it released. The train counted as ready as soon as it was released. A train placed
cold with its pipe below the lock of the FV4a driver's brake valve (2.75 bar) wasn't unlocked until the
order to go, and went on what its reservoirs got meanwhile (TMS77185 in linia_107_objazdy: 40 minutes at
1.2-1.9 bar, the last wagon at 4.3 bar at the start).

- Standing, PrepareEngine() applies the locomotive brake first, then fills the pipe. Where the locomotive
  brake alone doesn't hold the train (1.1 x the grade force), the train brake goes to the first service
  position instead, so the reservoirs charge with the train held. Multiple units with the
  electro-pneumatic brake are released as before.
- Standing to charge, the AI unlocks the pipe as it does to go (the releaser, or the unlock button). A
  handle which has to be moved to unlock is left where the light application holds the train.
- A train is ready only once the pipe and the auxiliary reservoir of every vehicle with a working brake
  are within 0.5 bar of the working pressure (4.5 of 5.0: the last wagon of a long train stays at about
  4.6-4.7 from what leaks along the pipe), with the pipe fed at the head of the train. Brakes cut out
  don't count.
- The locomotive brake comes off only once the train is charged, also against DecBrakeEIM(), which for a
  vehicle without the integrated handle releases it too; an uphill start begins only then.
- A human driver gets the same wait as a hint: "Wait for the train brakes to charge"
  (driver_hint::waitbrakecharge), and the hint to release the brakes waits with it once the train brake is
  off (brake_charge::release_waits()). The train brake may still come off: released, it fills the pipe.
- A charge that rises by less than 0.02 bar in 60 s lets the train go all the same, with a line in the
  log. The time counts only while there is air to charge with (the engine prepared, the main reservoir
  above what the pipe charges to, the pipe fed at the head): a train with its compressor not running yet
  or a locked pipe is waited out. Once let go, a train stays so until it is to stand again: otherwise the
  pipe refilling behind the release held it at a crawl (et22-1075 with 36 wagons, baltyk_interregio).
- The check applies to the pneumatic brake only, to the first start of a train that hasn't run (above
  1 km/h) since it was placed, and to a start with the pipe below 2.5 bar (near empty, after an emergency
  application). A start after an ordinary stop, a service stop (3.0-3.5 bar), a change of direction or a
  shunting move isn't held: waiting there only delayed the train, and the scenery set the routes of the
  others later.
- The release of the train brake in PrepareEngine() had a stray semicolon after its condition; the
  condition applies again in motion.
- Unit tests for the charge check (brake_charge::charged(), locomotive_brake_holds(), release_waits()).

Run on all 174 shipped sceneries (20 minutes each, against master): no train stuck that moved on master,
466 timetable departures compared, 459 within 15 s, mean -1.2 s. Waits for the charge: median 4 s, 90%
39 s, longest 106 s (a heavy freight train charged from 2.2 bar).

* test(ai): the brake charge test counts its looks in whole numbers, not in a floating-point time

SonarCloud took the loop of the test of a train with nothing to charge with yet for a bug (cpp:S2193, a
counter of type double). The same 120 looks, 5 s apart.

* fix(ai): the light application that holds a charging train stays on, and an empty pipe is no charge

Runs of a cold train on a gradient (P33000 at Lupkow in linia_107_objazdy, 13-16 per mille, with an SM42 and 32
wagons, 1556 t) showed three faults of the charged-brakes start:

- The locomotive brake was taken to hold the train with the force of its brake blocks alone, 1031 kN for an ST43:
  several times what its wheels pass on to the rails. It is limited to a quarter of the locomotive's weight
  (brake_charge::adhesion), so a light locomotive with a heavy train gets the light application of the train brake.
- That application was taken off again as soon as the order to go came, by the rule that puts the handle back to
  running with the main reservoir below 5 bar, and by DecBrake(). The train then stood on the locomotive brake
  that doesn't hold it, and moved as its wagons let go (to 0.3 km/h). It stays on until the train is charged
  (brake_charge::holds_application()).
- With the train brake applied the train counted as charged to what the head of the pipe has, which is nothing with
  the pipe empty: charged at 0.02 bar the moment the brake was applied. The pipe at the head counts no lower than a
  full service application leaves (brake_charge::reference()).

The SM42 with the 32 wagons now stands still while it charges and starts without rolling back, 2 min 30 s after it
was prepared (4 min 40 s before, with a start that rolled back at 0.3 km/h). An ST43 with 33 wagons and a 754 with
8 coaches there are as before, their locomotive brake holds them. In eight of the sceneries run before
(l053_poranek, calkowo_v2_cementa, calkowo_v2_ctl-wegiela, calkowo_v2_osoba_jar_poranek, calkowo_retro_zima,
linia61_towarowy2, l053-sluzba-brutto-posp, baltyk_interregio) the 60 timetable departures compared are the same,
within 15 s, mean 0.0 s. Unit tests for the two new decisions.

* fix(ai): the locomotive brake counted of the occupied vehicle alone

locomotive_brake_force() added the brake of every powered vehicle of the train. The locomotive brake handle acts on the
occupied vehicle only (LocalBrakePosA is set on mvOccupied and passed to no other vehicle), so a second locomotive, in
multiple control or hauled dead, made the brake count as holding a train it doesn't hold, and the train brake was
released on a gradient with the leading locomotive alone holding.

The estimate of one vehicle is brake_charge::locomotive_brake_force(), with a test.

brakecharge.h named TController::control_brake_charge(), which doesn't exist: the logic is in
determine_consist_state().
2026-11-24 12:07:52 +01:00

108 lines
7.1 KiB
C

DRIVER_HINT_DEF(batteryon, STRN("Switch on battery"))
DRIVER_HINT_DEF(batteryoff, STRN("Switch off battery"))
DRIVER_HINT_DEF(radioon, STRN("Switch on radio"))
DRIVER_HINT_DEF(radiooff, STRN("Switch off radio"))
DRIVER_HINT_DEF(radiofuseon, STRN("Close radio fuse"))
DRIVER_HINT_DEF(radiochannel, STRN("Tune into channel %.0f"))
DRIVER_HINT_DEF(oilpumpon, STRN("Switch on oil pump"))
DRIVER_HINT_DEF(oilpumpoff, STRN("Switch off oil pump"))
DRIVER_HINT_DEF(fuelpumpon, STRN("Switch on fuel pump"))
DRIVER_HINT_DEF(fuelpumpoff, STRN("Switch off fuel pump"))
DRIVER_HINT_DEF(pantographairsourcesetmain, STRN("Switch pantograph 3-way valve to primary air source"))
DRIVER_HINT_DEF(pantographairsourcesetauxiliary, STRN("Switch pantograph 3-way valve to auxiliary air source"))
DRIVER_HINT_DEF(pantographcompressoron, STRN("Switch on pantograph compressor"))
DRIVER_HINT_DEF(pantographcompressoroff, STRN("Switch off pantograph compressor"))
DRIVER_HINT_DEF(pantographsvalveon, STRN("Enable pantographs valve"))
DRIVER_HINT_DEF(pantographsvalveoff, STRN("Disable pantographcs valve"))
DRIVER_HINT_DEF(frontpantographvalveon, STRN("Raise pantograph A"))
DRIVER_HINT_DEF(frontpantographvalveoff, STRN("Lower pantograph A"))
DRIVER_HINT_DEF(rearpantographvalveon, STRN("Raise pantograph B"))
DRIVER_HINT_DEF(rearpantographvalveoff, STRN("Lower pantograph B"))
DRIVER_HINT_DEF(converteron, STRN("Switch on converter"))
DRIVER_HINT_DEF(converteroff, STRN("Switch off converter"))
DRIVER_HINT_DEF(primaryconverteroverloadreset, STRN("Reset converter overload relay"))
DRIVER_HINT_DEF(maincircuitgroundreset, STRN("Reset main circuit ground relay"))
DRIVER_HINT_DEF(tractionnmotoroverloadreset, STRN("Reset traction motors overload relay"))
DRIVER_HINT_DEF(linebreakerclose, STRN("Close line breaker"))
DRIVER_HINT_DEF(linebreakeropen, STRN("Open line breaker"))
DRIVER_HINT_DEF(compressoron, STRN("Switch on compressor"))
DRIVER_HINT_DEF(compressoroff, STRN("Switch off compressor"))
DRIVER_HINT_DEF(frontmotorblowerson, STRN("Switch on front motor blowers"))
DRIVER_HINT_DEF(frontmotorblowersoff, STRN("Switch off front motor blowers"))
DRIVER_HINT_DEF(rearmotorblowerson, STRN("Switch on rear motor blowers"))
DRIVER_HINT_DEF(rearmotorblowersoff, STRN("Switch off rear motor blowers"))
DRIVER_HINT_DEF(springbrakeon, STRN("Apply spring brake"))
DRIVER_HINT_DEF(springbrakeoff, STRN("Release spring brake"))
DRIVER_HINT_DEF(manualbrakon, STRN("Apply manual brake"))
DRIVER_HINT_DEF(manualbrakoff, STRN("Release manual brake"))
DRIVER_HINT_DEF(mastercontrollersetidle, STRN("Set engine to idle"))
DRIVER_HINT_DEF(mastercontrollersetseriesmode, STRN("Set master controller to series mode"))
DRIVER_HINT_DEF(waterheateron, STRN("Switch on water heater"))
DRIVER_HINT_DEF(waterheateroff, STRN("Switch off water heater"))
DRIVER_HINT_DEF(waterheaterbreakeron, STRN("Switch on water heater breaker"))
DRIVER_HINT_DEF(waterheaterbreakeroff, STRN("Switch off water heater breaker"))
DRIVER_HINT_DEF(waterpumpon, STRN("Switch on water pump"))
DRIVER_HINT_DEF(waterpumpoff, STRN("Switch off water pump"))
DRIVER_HINT_DEF(waterpumpbreakeron, STRN("Switch on water pump breaker"))
DRIVER_HINT_DEF(waterpumpbreakeroff, STRN("Switch off water pump breaker"))
DRIVER_HINT_DEF(watercircuitslinkon, STRN("Link water circuits"))
DRIVER_HINT_DEF(watercircuitslinkoff, STRN("Unlink water circuits"))
DRIVER_HINT_DEF(waittemperaturetoolow, STRN("Wait for warm up to complete"))
DRIVER_HINT_DEF(mastercontrollersetzerospeed, STRN("Set master controller to neutral"))
DRIVER_HINT_DEF(mastercontrollersetreverserunlock, STRN("Set master controller to position %.0f"))
DRIVER_HINT_DEF(trainbrakesetpipeunlock, STRN("Set brake controller to pipe filling mode"))
DRIVER_HINT_DEF(trainbrakerelease, STRN("Release train brake"))
DRIVER_HINT_DEF(trainbrakeapply, STRN("Apply train brake"))
DRIVER_HINT_DEF(directionforward, STRN("Set reverser to forward"))
DRIVER_HINT_DEF(directionbackward, STRN("Set reverser to reverse"))
DRIVER_HINT_DEF(directionother, STRN("Switch reverser to opposite direction"))
DRIVER_HINT_DEF(directionnone, STRN("Set reverser to neutral"))
DRIVER_HINT_DEF(waitpressuretoolow, STRN("Wait for main reservoir to fill"))
DRIVER_HINT_DEF(waitpantographpressuretoolow, STRN("Wait for sufficient air pressure in pantograph subsystem"))
DRIVER_HINT_DEF(waitbrakecharge, STRN("Wait for the train brakes to charge"))
DRIVER_HINT_DEF(sandingon, STRN("Switch on sanding"))
DRIVER_HINT_DEF(sandingoff, STRN("Switch off sanding"))
DRIVER_HINT_DEF(consistdoorlockson, STRN("Switch on door locks"))
DRIVER_HINT_DEF(departuresignalon, STRN("Switch on departure signal"))
DRIVER_HINT_DEF(departuresignaloff, STRN("Switch off departure signal"))
DRIVER_HINT_DEF(doorrightopen, STRN("Open doors"))
DRIVER_HINT_DEF(doorrightclose, STRN("Close doors"))
DRIVER_HINT_DEF(doorleftopen, STRN("Open doors"))
DRIVER_HINT_DEF(doorleftclose, STRN("Close doors"))
DRIVER_HINT_DEF(doorrightpermiton, STRN("Grant permit to open doors"))
DRIVER_HINT_DEF(doorrightpermitoff, STRN("Revoke permit to open doors"))
DRIVER_HINT_DEF(doorleftpermiton, STRN("Grant permit to open doors"))
DRIVER_HINT_DEF(doorleftpermitoff, STRN("Revoke permit to open doors"))
DRIVER_HINT_DEF(hornon, STRN("Sound the horn"))
DRIVER_HINT_DEF(hornoff, STRN("Switch off horn"))
DRIVER_HINT_DEF(consistlightson, STRN("Switch on consist lights"))
DRIVER_HINT_DEF(consistlightsoff, STRN("Switch off consist lights"))
DRIVER_HINT_DEF(consistheatingon, STRN("Switch on consist heating"))
DRIVER_HINT_DEF(consistheatingoff, STRN("Switch off consist heating"))
DRIVER_HINT_DEF(securitysystemreset, STRN("Acknowledge alerter"))
DRIVER_HINT_DEF(shpsystemreset, STRN("Acknowledge SHP"))
DRIVER_HINT_DEF(couplingadapterattach, STRN("Attach coupling adapter"))
DRIVER_HINT_DEF(couplingadapterremove, STRN("Remove coupling adapter"))
DRIVER_HINT_DEF(secondcontrollersetzero, STRN("Switch off field shunting"))
DRIVER_HINT_DEF(tractiveforcedecrease, STRN("Reduce tractive force"))
DRIVER_HINT_DEF(tractiveforceincrease, STRN("Increase tractive force"))
DRIVER_HINT_DEF(brakingforcedecrease, STRN("Reduce braking force"))
DRIVER_HINT_DEF(brakingforceincrease, STRN("Increase braking force"))
DRIVER_HINT_DEF(brakingforcesetzero, STRN("Release train brakes"))
DRIVER_HINT_DEF(brakingforcelap, STRN("Lap train brake"))
DRIVER_HINT_DEF(independentbrakeapply, STRN("Apply independent brake"))
DRIVER_HINT_DEF(independentbrakerelease, STRN("Release independent brake"))
DRIVER_HINT_DEF(antislip, STRN("Apply anti slip brake"))
DRIVER_HINT_DEF(waitloadexchange, STRN("Wait for passenger exchange to complete"))
DRIVER_HINT_DEF(waitdeparturetime, STRN("Wait for departure time"))
DRIVER_HINT_DEF(headcodepc1, STRN("Switch on Pc 1 head lamp code"))
DRIVER_HINT_DEF(headcodepc2, STRN("Switch on Pc 2 head lamp code"))
DRIVER_HINT_DEF(headcodepc5, STRN("Switch on Pc 5 tail lamp code"))
DRIVER_HINT_DEF(headcodetb1, STRN("Switch on Tb 1 head lamp code"))
DRIVER_HINT_DEF(lightsoff, STRN("Switch off lights"))
DRIVER_HINT_DEF(releaseron, STRN("Actuate"))
DRIVER_HINT_DEF(releaseroff, STRN("Stop actuating"))
DRIVER_HINT_DEF(bufferscompress, STRN("Apply tractive force to compress buffers"))
DRIVER_HINT_DEF(cabactivation, STRN("Activate cabin"))
DRIVER_HINT_DEF(cabdeactivation, STRN("Deactivate cabin"))