#329 disable reactor rather than trip on auto control stop

This commit is contained in:
Mikayla
2023-09-19 20:37:15 +00:00
parent b1c2c4d291
commit c24766a4db
7 changed files with 59 additions and 42 deletions

View File

@@ -402,7 +402,7 @@ function facility.new(num_reactors, cooling_conf)
-- SCRAM reactors and disengage auto control
-- use manual SCRAM since inactive was requested, and automatic SCRAM trips an alarm
for _, u in pairs(self.prio_defs[i]) do
u.scram()
u.disable()
u.auto_disengage()
end
end

View File

@@ -25,8 +25,9 @@ local PLC_S_CMDS = {
SCRAM = 1,
ASCRAM = 2,
ENABLE = 3,
RPS_RESET = 4,
RPS_AUTO_RESET = 5
DISABLE = 4,
RPS_RESET = 5,
RPS_AUTO_RESET = 6
}
local PLC_S_DATA = {
@@ -80,6 +81,7 @@ function plc.new_session(id, s_addr, reactor_id, in_queue, out_queue, timeout, f
retry_times = {
struct_req = (util.time() + 500),
status_req = (util.time() + 500),
disable_req = 0,
scram_req = 0,
ascram_req = 0,
burn_rate_req = 0,
@@ -87,6 +89,7 @@ function plc.new_session(id, s_addr, reactor_id, in_queue, out_queue, timeout, f
},
-- command acknowledgements
acks = {
disable = true,
scram = true,
ascram = true,
burn_rate = true,
@@ -627,6 +630,11 @@ function plc.new_session(id, s_addr, reactor_id, in_queue, out_queue, timeout, f
if not self.auto_lock then
_send(RPLC_TYPE.RPS_ENABLE, {})
end
elseif cmd == PLC_S_CMDS.DISABLE then
-- disable the reactor
self.acks.disable = false
self.retry_times.disable_req = util.time() + INITIAL_WAIT
_send(RPLC_TYPE.RPS_DISABLE, {})
elseif cmd == PLC_S_CMDS.SCRAM then
-- SCRAM reactor
self.acks.scram = false
@@ -780,6 +788,15 @@ function plc.new_session(id, s_addr, reactor_id, in_queue, out_queue, timeout, f
end
end
-- reactor disable request retry
if not self.acks.disable then
if rtimes.disable_req - util.time() <= 0 then
_send(RPLC_TYPE.RPS_DISABLE, {})
rtimes.disable_req = util.time() + RETRY_PERIOD
end
end
-- SCRAM request retry
if not self.acks.scram then

View File

@@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor")
local svsessions = require("supervisor.session.svsessions")
local SUPERVISOR_VERSION = "v1.0.4"
local SUPERVISOR_VERSION = "v1.0.5"
local println = util.println
local println_ts = util.println_ts

View File

@@ -645,6 +645,13 @@ function unit.new(reactor_id, num_boilers, num_turbines)
-- OPERATIONS --
--#region
-- queue a command to disable the reactor
function public.disable()
if self.plc_s ~= nil then
self.plc_s.in_queue.push_command(PLC_S_CMDS.DISABLE)
end
end
-- queue a command to SCRAM the reactor
function public.scram()
if self.plc_s ~= nil then