18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 03:37:09 +01:00
Commit Graph

6 Commits

Author SHA1 Message Date
Hirek f4ef43feec refactor(physics): the definition and the state of the induction motor drive as named fields
The arrays eimc[26] and eimv[21] of InductionMotor, indexed by the eimc_* and
eimv_* constants, become structs with named and described fields. The
definition splits into blocks by what it describes:

  motor      dfic currentPerSlip, dfmax maxSlipFrequency, p polePairs,
             cfu voltsPerHertz, cim torquePerCurrent, icif fieldCurrentRatio
  converter  Uzmax maxLinkVoltage, Uzh brakingLinkVoltage, DU voltageDrop,
             I0 noLoadCurrent, fcfu voltsPerHertz, fcfuH brakingVoltsPerHertz
  traction   F0 startingForce, a1 forceDropPerSpeed, Pmax maxPower,
             Imax maxCurrent
  braking    Fh maxForce, Ph maxPower, Vh0 offSpeed, Vh1 fullSpeed,
             abed cylinderPressureGain, edep maxEpDeceleration

and the state (InductionMotorState) groups the forces, the frequencies, the
values of the motors and the powers: FMAXMAX absoluteMaxForce, Fmax maxForce,
Fful fullForce, Fr force, Fzad forceDemand, ks slipShare, df slipFrequency,
fp supplyFrequency, fkr criticalFrequency, Uzsmax linkVoltage, U voltage,
pole flux, Ic torqueCurrent, If fieldCurrent, M torque, Ipoj lineCurrent,
Imax currentLimit, Pmax powerLimit, Pm mechanicalPower, Pe electricalPower,
eta efficiency.

The old comments of the constants took the "h" entries (Uzh, fcfuH, Fh, Ph,
Vh0, Vh1) for field weakening; the code uses them for the electrodynamic
brake, and the new names say so. The .fiz keys don't change. The constants
eimc_* / eimv_* are gone from physics/vehicletypes.h, and the labels of the
debug panel (TMoverParameters::eimc_labels, eimv_labels) move into
InductionMotor::ConfigListing() and StateListing().

One change on the screen: the eimc column of the debug panel (the engine
section of an induction motor vehicle) showed the labels from "Uzmax:" on
next to the wrong values (shifted by one entry, from "F0:" on by two), and
never showed abed and eped. It now shows each label with its own value. The
eimv column is as it was.

No change in the simulation: 1144/1144 tests, golden traces exact against
staging 62f7a29b.
2026-11-28 16:29:17 +01:00
Hirek ff739d2328 refactor(physics): the induction motor drive is a component of its own
The fields of the drive of asynchronous motors fed by inverters move from
TMoverParameters into InductionMotor inductionMotor
(physics/components/inductionmotor.h):

  eimc[26]                    config (std::array, indexed by eimc_* as before)
  eimv[21]                    state (std::array, indexed by eimv_*)
  eimv_pr                     forceShare
  InverterFrequency           inverterFrequency
  InvertersNo, InvertersRatio inverterCount, inverterRatio
  Inverters                   inverters (of Inverter, inverter before)
  InverterControlCouplerFlag  inverterControlCouplings
  EIM_Pmax_Table              maxPowerTable
  EIMCLogForce                logForce

The integrated controller (eimic, EIMCtrlType), which the diesel-electric
vehicles use too, and the ED/EP blending (MED_*) stay where they are.

No change in behaviour: 1144/1144 tests, golden traces exact against staging
62f7a29b.
2026-11-28 15:43:22 +01:00
Hirek 5a537e69f2 refactor(physics): McZapkie/ becomes physics/, its files get English names
The folder of the vehicle physics was named after the author of its first
version (2001). Its name now says what it holds, and so do its files:

  McZapkie/MOVER.h, Mover.cpp       -> physics/mover.h, mover.cpp
  McZapkie/hamulce.h, hamulce.cpp   -> physics/brakes.h, brakes.cpp
  McZapkie/Oerlikon_ESt.h, .cpp     -> physics/oerlikonest.h, .cpp
  friction, collision, couplerphysics, derailment: same names in physics/

Every include names the folder ("physics/mover.h"); the McZapkie include
directory is gone from CMakeLists.txt. The comments and documents that
named the old paths name the new ones. The credits to McZapkie stay.

Renames only: git sees every file as renamed (98-100%). 1142/1142 tests,
golden traces exact against staging 62f7a29b.
2026-11-27 17:11:46 +01:00
jerrrrycho 7a4a9532d1 test: cover the release delay of the Elf's holding brake
Without SBDReleaseDelay the holding brake lets go at the first demand, as
before. With SBDReleaseDelay=1.0 it lets go about 1 s after the handle, both
with the controller held at power and flicked there once and back to
holding the power; it holds again at no demand, a demand dropped before the
delay starts the count again, and two coupled Elfs do the same as one. A
start with the holding brake shared out as the MED does at standstill
shows the train held at the 1% of the first step until the release.
2026-11-19 19:30:44 +01:00
jerrrrycho 97c483e827 fix: Elf emergency brake position vents the pipe only from the driven vehicle, coupled units agree on the controller position
The emergency position of the master controller vented the brake pipe from
every vehicle whose controller stood there, and "MainCtrl" reached the coupled
vehicles raw, so an Elf with EIMCtrlMainEmergency and one without it disagreed
by one notch (the full braking of one was the emergency brake of the other,
neutral of one a power position of the other). The pipe is now vented only
from the vehicle driven from (IsCabMaster()), and the position goes to the
coupled vehicles in the positions without the key (MainCtrlPosForCoupled(),
the emergency one as the full braking), each adding its own shift on receiving
it (MainCtrlPosFromCoupled()).

The loader's fix-up for the old MCPN=4 raises DirChangeMaxPos by the same
shift, so the reverser keeps working at the new neutral.
2026-11-08 18:05:00 +01:00
jerrrrycho 22c8e7322f feat: Elf emergency brake position in the master controller (eu07/maszyna#413)
The Elf's master controller (EIMCtrlType 2) gets an optional emergency
brake position below its position 0, turned on by the new .fiz key
EIMCtrlMainEmergency=Yes in Cntrl (default No, no change without it).
With it the old positions move up by one (MCPN 5, neutral at 4): the
emergency position brakes fully at once and vents the brake pipe, like
the alarm chain or the Impuls's EIMCtrlEmergency. The loader raises a
too small MCPN to 5 and logs it. The Elf code with hard-coded positions
(CheckEIMIC, the MED full braking, the AI) takes the shift into account.

SVN data to change afterwards (dynamic/pkp/elf_v1, needs this exe):
- every .fiz with EIMCtrlType=2: EIMCtrlMainEmergency=Yes, MCPN=5,
  DirChangeMaxPos=4 where present;
- the cab .mmd mainctrl entries: offset one notch lower (-0.06 -> -0.09),
  sounds shifted one index up, new sound0 with
  26284_elf_nastawnik_nagle_*.wav.

Issue: (eu07/maszyna#413)
2026-11-07 19:53:16 +01:00