mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#519 fixed issue with turbine stability evaluation
This commit is contained in:
parent
bcc55628cf
commit
196e0b1daf
@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor")
|
|||||||
|
|
||||||
local svsessions = require("supervisor.session.svsessions")
|
local svsessions = require("supervisor.session.svsessions")
|
||||||
|
|
||||||
local SUPERVISOR_VERSION = "v1.4.2"
|
local SUPERVISOR_VERSION = "v1.4.3"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
@ -264,7 +264,7 @@ function unit.new(reactor_id, num_boilers, num_turbines, ext_idle)
|
|||||||
table.insert(self.db.annunciator.TurbineOverSpeed, false)
|
table.insert(self.db.annunciator.TurbineOverSpeed, false)
|
||||||
table.insert(self.db.annunciator.GeneratorTrip, false)
|
table.insert(self.db.annunciator.GeneratorTrip, false)
|
||||||
table.insert(self.db.annunciator.TurbineTrip, false)
|
table.insert(self.db.annunciator.TurbineTrip, false)
|
||||||
table.insert(self.turbine_stability_data, { time_state = 0, time_tanks = 0, rotation = 1 })
|
table.insert(self.turbine_stability_data, { time_state = 0, time_tanks = 0, rotation = 1, input_rate = 0 })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- PRIVATE FUNCTIONS --
|
-- PRIVATE FUNCTIONS --
|
||||||
|
@ -84,7 +84,7 @@ function logic.update_annunciator(self)
|
|||||||
self.turbine_flow_stable = false
|
self.turbine_flow_stable = false
|
||||||
|
|
||||||
for t = 1, self.num_turbines do
|
for t = 1, self.num_turbines do
|
||||||
self.turbine_stability_data[t] = { time_state = 0, time_tanks = 0, rotation = 1 }
|
self.turbine_stability_data[t] = { time_state = 0, time_tanks = 0, rotation = 1, input_rate = 0 }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ function logic.update_annunciator(self)
|
|||||||
|
|
||||||
local last = self.turbine_stability_data[i]
|
local last = self.turbine_stability_data[i]
|
||||||
|
|
||||||
if (not self.turbine_flow_stable) and (turbine.state.steam_input_rate > 0) then
|
if not self.turbine_flow_stable then
|
||||||
local rotation = util.turbine_rotation(turbine)
|
local rotation = util.turbine_rotation(turbine)
|
||||||
local rotation_stable = false
|
local rotation_stable = false
|
||||||
|
|
||||||
@ -351,13 +351,18 @@ function logic.update_annunciator(self)
|
|||||||
end
|
end
|
||||||
|
|
||||||
turbines_stable = turbines_stable and (rotation_stable or flow_stable)
|
turbines_stable = turbines_stable and (rotation_stable or flow_stable)
|
||||||
else
|
elseif math.abs(turbine.state.steam_input_rate - last.input_rate) > 1 then
|
||||||
|
-- reset to unstable to re-check
|
||||||
last.time_state = 0
|
last.time_state = 0
|
||||||
last.time_tanks = 0
|
last.time_tanks = 0
|
||||||
last.rotation = 1
|
last.rotation = 1
|
||||||
|
|
||||||
turbines_stable = false
|
turbines_stable = false
|
||||||
|
|
||||||
|
log.debug(util.c("UNIT ", self.r_id, ": turbine ", idx, " reset stability (new rate ", turbine.state.steam_input_rate, " != ", last.input_rate," mB/t)"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
last.input_rate = turbine.state.steam_input_rate
|
||||||
end
|
end
|
||||||
|
|
||||||
self.turbine_flow_stable = self.turbine_flow_stable or turbines_stable
|
self.turbine_flow_stable = self.turbine_flow_stable or turbines_stable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user