1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00

Improved battery charging and control circuits current computing; also added more correct BPSN overload protection code

This commit is contained in:
Moon Horse
2024-07-05 21:49:44 +03:00
parent 14310e2cfe
commit 24a3e9f67c
7 changed files with 50 additions and 53 deletions

View File

@@ -57,8 +57,6 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter)
local P = Train.PositionSwitch
local RheostatController = Train.RheostatController
local RK = RheostatController.SelectedPosition
--local B = (Train.Battery.Voltage >= 60) and 1 or (Train.Battery.Voltage >= Train.Battery.CutoffVoltage) and 0.5 or 0
--local B = math.min(1,linearity*(Train.Battery.Voltage - Train.Battery.CutoffVoltage)/(Train.Battery.StartVoltage - Train.Battery.CutoffVoltage))
local B = Train.Battery.Voltage > Train.Battery.CutoffVoltage and 1 or 0
local BO = B*Train.VB.Value*(1-Train.PA1.Value)
local BO2 = B*Train.VB.Value*(1-Train.PA2.Value)