Skip to content

Reactor PLC

Mikayla edited this page Jun 5, 2023 · 22 revisions

Reactor Programmable Logic Controller

Unlike the RTUs, this device both provides an interface to a peripheral (the reactor) to the supervisor, but also takes actions on its own. This application offers:

  • The Reactor Protection System (RPS)
  • Communications interface with the supervisor for manual and automatic control and reporting of build and status information
  • Burn rate setpoint ramping
  • Crash-resilient "threaded" application

Front Panel

image

The front panel of the PLC should provide all the information you need to see what it's up to. This front panel is designed to look industrial, not a beautiful modern display screen. It uses "LEDs" to indicate states, and is color themed to look like an industrial automation device.

System Status

  • STATUS: green if initialized OK, red otherwise
  • HEARTBEAT: 1 Hz blink, 0.5s on 0.5s off if all timings are accurate (unlikely): indicates the main loop is running OK
  • REACTOR: red if reactor is not connected, yellow if it is not formed, green if it is formed & connected
  • MODEM: green off if disconnected, green on if connected
  • NETWORK: gray for no connection (always gray if networking is disabled), red if supervisor connection denied generically, yellow if supervisor connection denied for collision, orange for version mismatch, green for successful link with supervisor.
  • RT ...: [co]routine thread statuses. green on if running, green off if not (thread stopped)

Reactor Status

  • RCT ACTIVE: reactor running (green on for on, green off for off)
  • RPS TRIP: RPS trip status, red flashing if tripped, red off for not tripped
  • RPS trip conditions shown on the right, red on if tripped, red off if not

Controls

  • SCRAM: SCRAM the reactor (manual trip)
  • RESET: reset the RPS

Versions

  • FW: PLC firmware version
  • NT: [network] communication protocol version

Standalone vs Networked Mode

Unlike every other application, the reactor PLC can be valuable by itself. While in standalone (non-networked) mode, the RPS can still function as a safety system without having a full facility set up. To do this, instead of continuously holding the reactor in SCRAM on a safety problem, the RPS SCRAMs the reactor ONCE, then resets the RPS. The user is now able to use the start button in the reactor's GUI (Mekanism) unlike in networked mode where the supervisor has to send the RESET RPS command.

In standalone mode, the system will also boot successfully (not in a degraded state) if the wireless modem is not present.

Reactor Protection System

The RPS checks for unsafe conditions and then SCRAMs the reactor if those conditions are met. Even if someone tries to re-enable the reactor through the Mekanism interface, it will re-SCRAM the reactor until it is RESET (unless it is in manual mode).

RPS SCRAM Conditions

  • High Reactor Damage
  • High Core Temperature
  • Low Coolant
  • Excess Waste
  • Excess Heated Coolant
  • No Fuel
  • PPM Fault
  • Supervisor Connection Timeout (if in networked mode)
  • Manual SCRAM via Supervisor (if in networked mode)
  • Automatic SCRAM via Supervisor (if in networked mode)
  • PLC System Failure (reactor not formed)
  • Force Disabled (reactor force disabled by Mekanism itself due to having "melted down" on a server with meltdowns disabled)

High damage is defined in scada-common/constants.lua as 90% damage.

High core temperature is defined in scada-common/constants.lua as 1200K.

Low coolant (Coolant Level Low Low on annuncaitor) is defined in scada-common/constants.lua as <10% coolant fill.

Excess waste is defined in scada-common/constants.lua as > 95% waste fill.

Emergency Coolant Control

image

The reactor PLC has an independent control option for a redstone output to toggle emergency coolant flow to a reactor. This is enabled (redstone off) when the RPS detects low coolant, and deactivated (redstone on) otherwise. When configured, a new LED will appear on the front panel below the reactor active indicator. Yellow off indicates emergency coolant is not opened, yellow on indicates emergency coolant has been opened.

This feature is only enabled if a valid emergency coolant configuration is found in the config, which looks like the following:

-- for offline mode, this redstone interface will turn off (open a valve)
-- when emergency coolant is needed due to low coolant
config.EMERGENCY_COOL = { side = "right", color = nil }

This sets up a redstone output on the right to be used. If color is set to a valid color (colors.red for example), then a bundled output signal can be used on that side and that channel (red as example) will be used.

Functionality is:

  • Redstone active = valve closed
  • Redstone inactive = valve opened
Clone this wiki locally