#19 #156 gain changes for generation rate control, fixed plc ready checks

This commit is contained in:
Mikayla Fischler 2023-02-10 20:26:25 -05:00
parent 44d5cec1f8
commit da9eead2d5
3 changed files with 10 additions and 7 deletions

View File

@ -35,7 +35,7 @@ local charge_Ki = 0.0
local charge_Kd = 0.0
local rate_Kp = 2.45
local rate_Ki = 0.2825 -- 0.1825, 0.2825
local rate_Ki = 0.4825
local rate_Kd = -1.0
---@class facility_management
@ -271,8 +271,8 @@ function facility.new(num_reactors, cooling_conf)
if blade_count == nil then
blade_count = u_blade_count
elseif u_blade_count ~= blade_count then
log.warning("FAC: cannot start auto control with inconsistent blade counts")
elseif (u_blade_count ~= blade_count) and (self.mode == PROCESS.GEN_RATE) then
log.warning("FAC: cannot start GEN_RATE process with inconsistent unit blade counts")
next_mode = PROCESS.INACTIVE
self.start_fail = START_STATUS.BLADE_MISMATCH
end
@ -314,9 +314,11 @@ function facility.new(num_reactors, cooling_conf)
end
-- update unit ready state
local assign_count = 0
self.units_ready = true
for i = 1, #self.prio_defs do
for _, u in pairs(self.prio_defs[i]) do
assign_count = assign_count + 1
self.units_ready = self.units_ready and u.get_control_inf().ready
end
end
@ -325,8 +327,8 @@ function facility.new(num_reactors, cooling_conf)
if self.mode == PROCESS.INACTIVE then
if not self.units_ready then
self.status_text = { "NOT READY", "assigned units not ready" }
elseif self.start_fail == START_STATUS.NO_UNITS then
self.status_text = { "START FAILED", "no units assigned" }
elseif self.start_fail == START_STATUS.NO_UNITS and assign_count == 0 then
self.status_text = { "START FAILED", "no units were assigned" }
elseif self.start_fail == START_STATUS.BLADE_MISMATCH then
self.status_text = { "START FAILED", "turbine blade count mismatch" }
else

View File

@ -47,7 +47,8 @@ function logic.update_annunciator(self)
-- - can't be tripped
-- - must have received status at least once
-- - must have received struct at least once
plc_ready = (not plc_db.rps_tripped) and (plc_db.last_status_update > 0) and (plc_db.mek_struct.length > 0)
plc_ready = plc_db.formed and (not plc_db.no_reactor) and (not plc_db.rps_tripped) and
(next(self.plc_i.get_status()) ~= nil) and (next(self.plc_i.get_struct()) ~= nil)
-- update auto control limit
if (self.db.control.lim_br100 == 0) or ((self.db.control.lim_br100 / 100) > plc_db.mek_struct.max_burn) then

View File

@ -14,7 +14,7 @@ local svsessions = require("supervisor.session.svsessions")
local config = require("supervisor.config")
local supervisor = require("supervisor.supervisor")
local SUPERVISOR_VERSION = "beta-v0.10.5"
local SUPERVISOR_VERSION = "beta-v0.10.6"
local print = util.print
local println = util.println