BP String
I have always used circuits to some extent to add functionality to my factories and I have started another playthrough recently with an intent of using them even more. I am gunning for as much SPM as possible so naturally, UPS optimization is required by any means necessary. Considering that, I came across a concept of clocking inserters. Fair enough. Watched a great guide from u/knightelite Inserter Clocking Guide. Great work on that thanks.
After grasping the concept, I realized it has other uses, which I was looking for in my playthrough, mainly, during mid game/early mega base. I am at the stage of red belts/assemblers 2/modules T1, expanding away. I decided that when I produce something at rate X requiring Y assemblers where Y is not an integer, I want to throttle the operation of last assembler to match as close as possible. First I thought about clocking the input inserters, but that can increase build size when multiple inputs are required. So, instead, I went for output inserter clocking.
DISCLAIMER: I am not a programmer or mathematician or anything, hence I used AI for help with this concept. The BP has its limitations and probably/most likely you will find issues/errors with it in particular scenarios. Feel free to ask/comment/rinse the idea, just remember, it works for me for what I need it for. It can always evolve for what you need it for in any way you like. Due to parameters been set in the string, editing the BP in game will most likely break it so always make a copy before editing the BP. My playthrough is lightly modded with QoL mods like rate calc etc, the BP should work in Vanilla
Instructions on using the device and readme are bellow:
FACTORIO 2.1 | V7 FEEDBACK PRODUCTION LIMITER
FOUR COMBINATORS — AUTOMATIC PARAMETER MATH + ITEM PICKUP FEEDBACK
WHAT CHANGED FROM V6
V6 assumes every timer pulse moves exactly H items. A missed or partial swing creates
rate error. V7 instead maintains an accumulating credit for item extraction, and
subtracts the actual items reported by the inserter in Read hand contents: PULSE.
No manual clock threshold or raw timing pulse is needed.
FOUR COMBINATORS
TOP LEFT: RATE GATE (decider): if C < cap, emit +R100 to C each tick.
TOP MIDDLE: BUCKET (arithmetic): C + 0 -> C; its red output loops to red input.
TOP RIGHT: DEBIT (arithmetic): EACH * -360000 -> C, using inserter pickup pulses.
BOTTOM: ENABLE (decider): if C >= 360000*H, emit W = 1.
MANDATORY EXTERNAL WIRING — TWO WIRES
- RED wire: the throttled assembler's OUTPUT INSERTER -> TOP RIGHT arithmetic INPUT.
This is the PICKUP feedback path. Do NOT connect it to other circuit networks. - GREEN wire: BOTTOM decider OUTPUT -> SAME output inserter.
This is the ENABLE path; keep distinct from the red feedback path. - Inserter circuit settings:
- Enable/disable: W > 0
- Read hand contents: ON; hand read mode = PULSE (not Hold)
- Override hand stack size: H entered at blueprint placement. - Supply electric power to the combinators and inserter.
BLUEPRINT PARAMETERS (entered when stamping)
A — Base crafting speed x100. Example assembler 3 1.25 -> 125.
S — Net speed bonus (%) from modules DIRECTLY inside the machine. Include penalties;
do not include beacons. For 2 Speed 1 + 1 Productivity 1: +20+20-5 = 35.
P — Total productivity bonus (%), including productivity modules, built-in production
bonus and applicable research. In that mixed-module example: 4.
Q — Output items per craft. MUST replace placeholder 101, e.g. rails=2.
T — Recipe time in seconds x100; 0.5 seconds -> 50.
Y — Desired TOTAL output per minute x100; 1410/min -> 141000.
F — Full-speed unrestricted assemblers. MUST replace placeholder 103; 4.7 -> 4.
B — Combined speed bonuses (%) of modules inside ONE common-quality beacon;
if no beacons, 0. Example 2 common Speed 1: 40.
N — Number of identical COMMON-quality beacons affecting EACH machine; 0 if none.
H — Inserter hand size; MUST replace placeholder 107. Match actual inserter override.
CALCULATIONS (AUTOMATIC at placement)
Rate per machine (items/min): 60*(A/100)*Q/(T/100) *
[1 + (S + 1.5*B*sqrt(N))/100] * [1 + P/100]
R = Desired production/min - F*unrestricted machine rate
Rate gate output: R100 = R * 100, emitted as C units PER TICK
One actual item picked up subtracts 360000 C units (3600 ticks/min *100).
Enable inserter once C >= H*360000 (one hand of allowed production).
Stop adding credit once C >= 2*H*360000 (two hands of bounded backlog).
HOW IT BEHAVES
- No items ready: credit builds up to about two hands; controller holds enable ON.
- Items picked: actual pickup pulse debits their ACTUAL COUNT (not assumed H).
- Inserter picks fewer than H: fewer item credits are deducted.
- Output belt blocked: the inserter waits holding items; the system can accumulate
a small backlog but cannot create physical belt capacity.
- Belt clears: remaining credit allows modest catch-up, then rate settles.
- Credit cap is approximate due to 1-tick combinator pipeline delays.
- This counts pickups, NOT confirmed belt deposits. Item(s) already held in
the inserter were counted at pickup and may be waiting to unload.
RAILS EXAMPLE (4.7 ASSEMBLERS)
Assembling Machine 3, no modules/beacons, rail recipe 0.5s, 2 rails/craft.
A=125 S=0 P=0 Q=2 T=50 Y=141000 F=4 B=0 N=0 H=3
Each machine: 300 rails/min. Four unrestricted machines: 1200/min.
Throttled fifth machine: 210 rails/min.
Rate gate emits C=21000 PER TICK.
Each rail pickup subtracts C=360000; full 3-rail pickup subtracts 1080000.
Enable threshold = 1080000. Cap = 2160000 (plus small pipeline overshoot).
The target is 210 rails/min AVERAGE when output is unblocked and throughput
capacity is sufficient; no fixed 51-tick pulse is required.
ELECTRIC FURNACES EXAMPLE
A=75 S=40 P=0 Q=1 T=500 Y=1930 F=1 B=0 N=0 H=1
1 unrestricted machine: 12.6/min; controlled machine target: 6.7/min.
Rate gate emits C=670/tick. Pickup subtracts 360000 C.
LIMITATIONS + CHECKS
* IMPORTANT: This prototype has been VALIDATED OFFLINE (blueprint serialization,
formulas and a simplified discrete-tick controller model), NOT IMPORTED/TESTED
INSIDE FACTORIO. Game timing and parameter handling must be verified in editor.
* Read hand contents must be PULSE, not HOLD, or credits are subtracted repeatedly.
* If red and green circuits are joined, feedback can become contaminated.
* The output inserter may keep holding items when belt is full; no device can
guarantee a target output greater than belt/inserter throughput.
* Credit cap is approximately two HANDS of items, not two minutes of production.
* Stable average depends on all F unrestricted machines actually delivering
their expected full-speed output and the controlled machine receiving inputs.
* The last assembler must have the same machine/modules/beacon setup as the
others (including its production capability >= required remainder).
* Beacon calculation is for IDENTICAL COMMON beacons, each with B% speed
modules; mixed/quality beacons need manually computed S (net total) instead.
* Factorio arithmetic is integer only: R100 is truncated to an integer at
placement (precision ~0.01 items/min), and C is also an integer. Max credits
fit well within the signed 32-bit range for normal hand sizes.
* Blueprint parameters Q/F/H use placeholder values 101/103/107 to avoid
replacing fixed internal numeric values accidentally. Change all three.
* Keep ORIGINAL imported string: freely defined parameters can disappear
when the blueprint is opened/re-saved in the in-game parameter editor.
IN-GAME TEST
- Place blueprint with the rail example values; inspect rate gate C output=21000,
first decider cap C<2160000, bottom decider C>=1080000. - Inspect bucket C growing, then stabilising near the capped balance.
- Wire output inserter RED feedback / GREEN enable; enable Read hand PULSE.
- Test free belt: throughput should average near 210 rails/min (use production
statistics or an output chest); then block belt for 10 seconds. - Unblock belt: expect limited catch-up, no giant runaway burst.
- Repeat with a partially filled assembler output; verify each pickup deducts
the reported actual number of items, not always H.