The Signal Processor: A Handful of Chips

Day 19 — Stability at the fencepost: 29%

The drifting clouds are thicker this week. One of them, a low bruise-coloured bank of mist forty paces wide, slid across the lower pasture at noon. While it hung over the fence, the crows in the rowan tree stopped mid-caw with their beaks open, and the rain froze in mid-air like glass beads on wire. Ten minutes later the cloud drifted east into the ravine, the whole shower hit the mud at once, and the crows finished swearing and cleared off.

I spent the afternoon crouched behind the boiler with a soldering iron, losing an argument with my own wiring.

If the steam plant and the 48 V battery bank are going to mind themselves while I'm down in the mine, the shed needs a circuit that watches battery charge, drops the workshop tools below thirty percent, waits until the bank recovers past sixty before bringing them back, and throttles the cooling valve cleanly. Building that out of discrete Schmitt Triggers, RS Latches, Amplifiers, and PID chips was eating half a stone wall and a small fortune in Signal Cable. You would have labelled every strand in neat block letters, Kid, and still rolled your eyes at the mess.

Then I remembered the Signal Processor sitting at the back of the parts drawer.

One block no bigger than a dinner plate: four iron ingots in the corners, four lengths of Signal Cable along the edges, and a Cheap Chip in the centre. Slap it on a wall or a floor. It needs no power supply of its own. Right-click it, and instead of wiring ten logic boxes together, you type plain arithmetic into its screen.

Pins and Wiring

Stand facing the plain brass output terminal on the front edge. The three inputs sit around the other sides, each marked by a coloured cap on its brass terminal that matches its trace on the screen:

All three inputs connect as soon as Signal Cable meets them. A spare pin sits beside the output for the field bus; leave it alone for now, that belongs to a later week.

Picture to come: A Signal Processor mounted on a stone wall, viewed facing its output edge. Signal Cable enters three brass terminals with coloured caps: red on the right for Input A, blue at the back for Input B, and green on the left for Input C. A fourth Signal Cable leaves the plain brass output on the front toward a Low Voltage Relay.

The full pin layout is noted under hardware and pins.

Signals and Your First Program

The processor speaks in fractions, not volts. Every input divides its voltage by 5 V and clamps the result between 0 and 1. Zero volts reads 0, 2.5 V reads 0.5, and 5 V reads 1. Your program runs line by line, and its last line becomes the output: clamped to 0 through 1, then multiplied back by 5 V. If your arithmetic breaks and produces NaN, the output drops safely to 0 V.

Open the block and you get a proper multi-line code editor holding up to 40 lines and 4096 characters. Beside it sits a Quick Reference pane—click any entry to drop it straight into your code—and a small live graph tracing A, B, C, and the output. Stand close to the block in the shed and you can even read a tiny version of that graph on its face. Hover over the block to check its voltages, or put a MultiMeter on it to read Uout and Iout.

Try one on the bench before you wire anything complicated:

  1. Place a Signal Processor and right-click to open it.
  2. Put 1 Cheap Chip into the Chips slot at the lower left.
  3. Run Signal Cable from a lever or signal source into A, the red-capped terminal on your right as you face the plain output. Wire the plain output to a lamp supply's signal input, or simply hold a MultiMeter on the output terminal.
  4. Type A > 0.5 into the editor, or !A if you want an inverter.
  5. Check the status line: it should read 1 Cheap Chip(s) required in green.
  6. Click Save. The Save button glows red whenever you have unsaved edits; until you click it, the old program keeps running.
  7. Flip the input. The output snaps cleanly between 5 V and 0 V, and the graph jumps to match.

Want to test a formula before running cable across the shed? An unconnected input reads 0 unless you give it a plain-number fallback on its own line:

A = 0.8
A > 0.5

Save that with nothing wired to A and the output reads 5 V straight away. Change 0.8 to 0.2, click Save, and it drops to 0 V. Once you hook real cable to A, the live wire takes over.

Paying in Chips

The Ministry shipped these boxes without a manual, naturally, so I burned an hour with the MultiMeter before spotting why my second program sat dead at zero volts.

The processor runs on a deposit of silicon. The Chips slot holds up to 64 Cheap Chips, or up to 8 Advanced Chips, each worth 8 Cheap Chips. They are not used up—they sit in the slot for as long as the program needs them, like coins wedged in a meter.

Every operator and function in your code has a cost, and each Cheap Chip buys 4 operators, rounded up:

If the slot holds enough silicon, the status line turns green and tells you N Cheap Chip(s) required. Short by even a single chip, the line turns red and the output drops dead to 0 V.

Naming intermediate lines saves chips as well as headaches. You pay for a line's operators once, no matter how many times you reuse that name below. Here is the load-shedder for my 48 V battery bank, with the bank sensor fed into A:

q = batteryCharge(0.8 + 0.4 * A)
rs(q > 0.6, q < 0.3)

That uses q twice, pays for batteryCharge only once, totals 15 operators, and runs on 4 Cheap Chips. Every single operator price is listed in the cost table.

The Rules That Bite

Four rules will save you from chasing ghosts with a voltmeter:

  1. Set comes first in rs(set, reset). Either input counts as on above 0.5, and if both are high at once, reset wins. A simple boiler thermostat is rs(A < 0.6, A > 0.8) for 2 Cheap Chips: on when cold, off when hot. Put those two arguments the wrong way round and the heater sits cold in a frost and runs flat out while the boiler screams.
  2. Logic uses 0.5, and a single = is not a test. &, |, !, and if treat anything above 0.5 as on and return 1 or 0. So !A gives 1—full 5 V—whenever A sits at or below 0.5. To test equality, use == or !=, which match within 0.01. A single = only assigns a name or a default like A = 0.5; put one inside a condition and the compiler rejects it.
  3. Know the order of binding. Powers ^ bind tightest, then unary -, then * and /, then + and -, then comparisons, then !, then &, and finally |. That means !A > 0.5 reads as !(A > 0.5), and & binds tighter than |. Brackets are free, so never be proud—use them. More sharp corners live in the logic traps.
  4. Dawn is zero, and timers never sleep. The built-in daytime clock runs from 0 at sunrise, 0.25 at noon for 1.25 V, 0.5 at sunset, and 0.75 at midnight for 3.75 V, back to 0 at the next dawn. Railway time it is not, but daytime > 0.5 switches the yard lamps on at dusk and off at sunrise for 1 Cheap Chip. Time functions like rc, ramp, derivate, integrate, and pid measure in seconds across the electrical sub-steps, and every stateful function keeps stepping even inside an if branch you did not take. Clicking Save recompiles the code and resets every state back to zero.

A few last bench notes before I blow the lamp out: separate statements by newlines or ;, start comments with #, and watch your letter case because names are case-sensitive. pi is built in, min and max take two arguments each, and scientific shorthand like 1e-3 will not compile—write 0.001 like a civilised human being.

I copied the full specification into the back of the ledger so neither of us has to probe pins in the dark again: The Signal Processor: Complete Manual. Keep it open on the bench beside you.


Previous: Fire and the Kettle: A Kettle with a Dynamo · Next: The Real Steam Plant: The Day the Valve Sang

Back to the contents