supervisor debug log messages and #427 fix
This commit is contained in:
parent
910509d764
commit
96691d773a
@ -337,7 +337,7 @@ function facility.new(num_reactors, cooling_conf)
|
|||||||
if state_changed then
|
if state_changed then
|
||||||
self.saturated = false
|
self.saturated = false
|
||||||
|
|
||||||
log.debug("FAC: state changed from " .. PROCESS_NAMES[self.last_mode + 1] .. " to " .. PROCESS_NAMES[self.mode + 1])
|
log.debug(util.c("FAC: state changed from ", PROCESS_NAMES[self.last_mode + 1], " to ", PROCESS_NAMES[self.mode + 1]))
|
||||||
|
|
||||||
if (self.last_mode == PROCESS.INACTIVE) or (self.last_mode == PROCESS.GEN_RATE_FAULT_IDLE) then
|
if (self.last_mode == PROCESS.INACTIVE) or (self.last_mode == PROCESS.GEN_RATE_FAULT_IDLE) then
|
||||||
self.start_fail = START_STATUS.OK
|
self.start_fail = START_STATUS.OK
|
||||||
@ -375,6 +375,8 @@ function facility.new(num_reactors, cooling_conf)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
log.debug(util.c("FAC: computed a max combined burn rate of ", self.max_burn_combined, "mB/t"))
|
||||||
|
|
||||||
if blade_count == nil then
|
if blade_count == nil then
|
||||||
-- no units
|
-- no units
|
||||||
log.warning("FAC: cannot start process control with 0 units assigned")
|
log.warning("FAC: cannot start process control with 0 units assigned")
|
||||||
@ -436,7 +438,7 @@ function facility.new(num_reactors, cooling_conf)
|
|||||||
self.saturated = true
|
self.saturated = true
|
||||||
|
|
||||||
self.status_text = { "MONITORED MODE", "running reactors at limit" }
|
self.status_text = { "MONITORED MODE", "running reactors at limit" }
|
||||||
log.info(util.c("FAC: MAX_BURN process mode started"))
|
log.info("FAC: MAX_BURN process mode started")
|
||||||
end
|
end
|
||||||
|
|
||||||
_allocate_burn_rate(self.max_burn_combined, true)
|
_allocate_burn_rate(self.max_burn_combined, true)
|
||||||
@ -445,7 +447,7 @@ function facility.new(num_reactors, cooling_conf)
|
|||||||
if state_changed then
|
if state_changed then
|
||||||
self.time_start = now
|
self.time_start = now
|
||||||
self.status_text = { "BURN RATE MODE", "running" }
|
self.status_text = { "BURN RATE MODE", "running" }
|
||||||
log.info(util.c("FAC: BURN_RATE process mode started"))
|
log.info("FAC: BURN_RATE process mode started")
|
||||||
end
|
end
|
||||||
|
|
||||||
local unallocated = _allocate_burn_rate(self.burn_target, true)
|
local unallocated = _allocate_burn_rate(self.burn_target, true)
|
||||||
@ -459,7 +461,7 @@ function facility.new(num_reactors, cooling_conf)
|
|||||||
self.accumulator = 0
|
self.accumulator = 0
|
||||||
|
|
||||||
self.status_text = { "CHARGE MODE", "running control loop" }
|
self.status_text = { "CHARGE MODE", "running control loop" }
|
||||||
log.info(util.c("FAC: CHARGE mode starting PID control"))
|
log.info("FAC: CHARGE mode starting PID control")
|
||||||
elseif self.last_update ~= charge_update then
|
elseif self.last_update ~= charge_update then
|
||||||
-- convert to kFE to make constants not microscopic
|
-- convert to kFE to make constants not microscopic
|
||||||
local error = util.round((self.charge_setpoint - avg_charge) / 1000) / 1000
|
local error = util.round((self.charge_setpoint - avg_charge) / 1000) / 1000
|
||||||
@ -614,7 +616,7 @@ function facility.new(num_reactors, cooling_conf)
|
|||||||
astatus.matrix_fill = (db.tanks.energy_fill >= ALARM_LIMS.CHARGE_HIGH) or (astatus.matrix_fill and db.tanks.energy_fill > ALARM_LIMS.CHARGE_RE_ENABLE)
|
astatus.matrix_fill = (db.tanks.energy_fill >= ALARM_LIMS.CHARGE_HIGH) or (astatus.matrix_fill and db.tanks.energy_fill > ALARM_LIMS.CHARGE_RE_ENABLE)
|
||||||
|
|
||||||
if was_fill and not astatus.matrix_fill then
|
if was_fill and not astatus.matrix_fill then
|
||||||
log.info("FAC: charge state of induction matrix entered acceptable range <= " .. (ALARM_LIMS.CHARGE_RE_ENABLE * 100) .. "%")
|
log.info(util.c("FAC: charge state of induction matrix entered acceptable range <= ", ALARM_LIMS.CHARGE_RE_ENABLE * 100, "%"))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- check for critical unit alarms
|
-- check for critical unit alarms
|
||||||
|
|||||||
@ -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.2.7"
|
local SUPERVISOR_VERSION = "v1.2.8"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
|||||||
@ -199,9 +199,8 @@ function supervisor.comms(_version, nic, fp_ok)
|
|||||||
-- pass the packet onto the session handler
|
-- pass the packet onto the session handler
|
||||||
session.in_queue.push_packet(packet)
|
session.in_queue.push_packet(packet)
|
||||||
else
|
else
|
||||||
-- unknown session, force a re-link
|
-- any other packet should be session related, discard it
|
||||||
log.debug("PLC_ESTABLISH: no session but not an establish, forcing relink")
|
log.debug("discarding RPLC packet without a known session")
|
||||||
_send_establish(packet.scada_frame, ESTABLISH_ACK.DENY)
|
|
||||||
end
|
end
|
||||||
elseif protocol == PROTOCOL.SCADA_MGMT then
|
elseif protocol == PROTOCOL.SCADA_MGMT then
|
||||||
---@cast packet mgmt_frame
|
---@cast packet mgmt_frame
|
||||||
|
|||||||
@ -564,6 +564,7 @@ function unit.new(reactor_id, num_boilers, num_turbines)
|
|||||||
function public.auto_engage()
|
function public.auto_engage()
|
||||||
self.auto_engaged = true
|
self.auto_engaged = true
|
||||||
if self.plc_i ~= nil then
|
if self.plc_i ~= nil then
|
||||||
|
log.debug(util.c("UNIT ", self.r_id, ": engaged auto control"))
|
||||||
self.plc_i.auto_lock(true)
|
self.plc_i.auto_lock(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -572,6 +573,7 @@ function unit.new(reactor_id, num_boilers, num_turbines)
|
|||||||
function public.auto_disengage()
|
function public.auto_disengage()
|
||||||
self.auto_engaged = false
|
self.auto_engaged = false
|
||||||
if self.plc_i ~= nil then
|
if self.plc_i ~= nil then
|
||||||
|
log.debug(util.c("UNIT ", self.r_id, ": disengaged auto control"))
|
||||||
self.plc_i.auto_lock(false)
|
self.plc_i.auto_lock(false)
|
||||||
self.db.control.br100 = 0
|
self.db.control.br100 = 0
|
||||||
end
|
end
|
||||||
@ -582,12 +584,12 @@ function unit.new(reactor_id, num_boilers, num_turbines)
|
|||||||
---@nodiscard
|
---@nodiscard
|
||||||
---@return integer lim_br100
|
---@return integer lim_br100
|
||||||
function public.auto_get_effective_limit()
|
function public.auto_get_effective_limit()
|
||||||
if (not self.db.control.ready) or self.db.control.degraded or self.plc_cache.rps_trip then
|
local ctrl = self.db.control
|
||||||
self.db.control.br100 = 0
|
if (not ctrl.ready) or ctrl.degraded or self.plc_cache.rps_trip then
|
||||||
|
log.debug(util.c("UNIT ", self.r_id, ": effective limit is zero! ready[", ctrl.ready, "] degraded[", ctrl.degraded, "] rps_trip[", self.plc_cache.rps_trip, "]"))
|
||||||
|
ctrl.br100 = 0
|
||||||
return 0
|
return 0
|
||||||
else
|
else return ctrl.lim_br100 end
|
||||||
return self.db.control.lim_br100
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- set the automatic burn rate based on the last set burn rate in 100ths
|
-- set the automatic burn rate based on the last set burn rate in 100ths
|
||||||
@ -595,8 +597,8 @@ function unit.new(reactor_id, num_boilers, num_turbines)
|
|||||||
function public.auto_commit_br100(ramp)
|
function public.auto_commit_br100(ramp)
|
||||||
if self.auto_engaged then
|
if self.auto_engaged then
|
||||||
if self.plc_i ~= nil then
|
if self.plc_i ~= nil then
|
||||||
|
log.debug(util.c("UNIT ", self.r_id, ": commit br100 of ", self.db.control.br100, " with ramp set to ", ramp))
|
||||||
self.plc_i.auto_set_burn(self.db.control.br100 / 100, ramp)
|
self.plc_i.auto_set_burn(self.db.control.br100 / 100, ramp)
|
||||||
|
|
||||||
if ramp then self.ramp_target_br100 = self.db.control.br100 end
|
if ramp then self.ramp_target_br100 = self.db.control.br100 end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user