PID Combinator

by imoth_f

A combinator that runs a PID controller for holding a signal at its setpoint.

Content
a day ago
2.0 - 2.1
105
Circuit network

Changelog

Version: 2.1.2
Date: 2026-08-06
  Bugfixes:
    - Fixed graphs sometimes getting darker.
Version: 2.1.1
Date: 2026-08-05
  Bugfixes:
    - Fixed auto-tunning bias converging on a value which prevented the actuator form crossing the boundary.
  Changes:
    - Changed versionint to accomodate for different Factorio versions. First two numbers of the version are Factorio release and the last is mod version. e.g. 2.1.5 for Factorio 2.1.
Version: 0.2.3
Date: 2026-08-04
  Bugfixes:
    - Term indicators are drawn properly when there is no power.
Version: 0.2.2
Date: 2026-07-21
  Gui:
    - Auto-tune now shows a failure message on the Tuning tab when it times out without producing a sustained oscillation.
    - Tuning tab separates the gain settings from the auto-tune controls with a divider.
    - Kp / Ki / Kd rows show explanatory tooltips on their labels, sliders, and fields.
  Bugfixes:
    - Hidden output combinator is no longer duplicated during cloning.
    - Copying settings for a different entity type discards currently copied PID combinator settings. This matches default Factorio behaviour.
    - Copying settings no longer discards signal quality.
    - Output signal quality is no longer discarded.
    - PID combinator GUI now closes when the ghost is removed with a deconstruction planner.
    - Combinator GUI and its private graph surface are now cleaned up when the entity is removed without a normal mining event, such as by a script or surface deletion.
  Locale:
    - Added English and Ukrainian strings for the auto-tune failure message and the Kp / Ki / Kd tooltips.
Version: 0.2.1
Date: 2026-07-16
  Gui:
    - Auto-tune button turns into a red Cancel button while a tuning session runs. Clicking it aborts the session and keeps the current gains.
  Locale:
    - Added English and Ukrainian strings for the auto-tune Cancel button.
  Bugfixes:
    - Timed-out auto-tune sessions no longer linger in the save.
    - Status and signal value labels in the GUI now update when the combinator loses power, instead of freezing at their last values.
    - Output no longer keeps emitting the last value after the input wires are disconnected.
    - Open GUIs now refresh all controls (gains, anti-windup limit, signal pickers, network checkboxes) when settings change externally via copy/paste, undo/redo, or blueprint paste. Previously they kept showing the old values.
    - Output wire connections now follow the red/green output flags applied by copy/paste, undo/redo, and blueprint paste.
  Optimizations:
    - Output signal writes are skipped when the numeric value is unchanged tick-to-tick.
    - Output section is toggled active/inactive instead of clearing its slot each tick when no output signal is configured.
    - Graph samples once every 2 ticks instead of every tick, approximately matching display pixel density.
    - Graph data retention buffer shortened to match the visible viewport width.
    - Input signals are read with a single API call per wire pair instead of separate network lookups.
Version: 0.2.0
Date: 2026-07-14
  Features:
    - Auto-tuning of Kp / Ki / Kd via relay-feedback measurement, with nine selectable rules.
  Gui:
    - New auto-tune controls on the Tuning tab: target field, rule dropdown, "Allow negative output" toggle, and Start button.
    - "Tuning" status shown in the combinator header while a session runs.
    - Setpoint reference line on the plot follows the auto-tune target while tuning is active.
    - Kp / Ki / Kd fields now format to 4 significant figures so long values fit the textfield.
    - Header status icon now scales with the game's UI display scale.
    - Tuning table stretches to fill the container width.
  Locale:
    - Added English and Ukrainian strings for the auto-tune controls.
Version: 0.1.3
Date: 2026-07-09
  Features:
    - Added low-pass filter to the derivative term to make it less noisy.
  Gui:
    - Added a side panel with PID term indicators.
Version: 0.1.2
Date: 2026-07-08
  Gui:
    - Added labels to horizontal gridlines.
    - Changed SP and PV line colours to be more visually distinct.
Version: 0.1.1
Date: 2026-07-05
  Gui:
    - Added auto-scaling to the graph.
    - Horizontal grid lines auto-scale and represent 1, 2, 5 * 10^n.
Version: 0.1.0
Date: 2026-07-05
  Features:
    - PID controller in a combinator with configurable process variable, setpoint, and output signals.
  Gui:
    - Adjustable Kp / Ki / Kd gains and anti-windup limit.
    - Live process variable plot in the GUI with setpoint reference line.
  Locale:
    - English and Ukrainian localisation.