Gridworks

An electrical grid for Minecraft 26.3 (Fabric): DC and AC, house wiring and overhead lines, transformers, batteries, solar panels and fuel generators. Overloaded cables smoke, catch fire and burn out, and a multimeter shows what is going on. LiFePO4 batteries with a realistic voltage curve and BMS run radios in the field, and a charger refills handhelds, test gear and battery packs.

With Ham Radio installed as well, radios, amplifiers, antenna tuners and rotors need power from the grid.

1.6.0: German translation; the game language follows the system language.

1.5.1: the grid solves about ten times faster. Each network keeps its layout in arrays and its spanning tree from one solve to the next, and cables within their rating that aren't cooling down are skipped. On the Funkstadt server, Gridworks' share of the server thread drops from about 4 % to about 0.5 %, and a side-by-side check gives bit-identical currents. Also fixed: the current on overhead lines (multimeter, Atlas) used to read 0 A on every network except the last of each voltage.

1.5.0: the power coupling ties two networks of the same voltage (12 V DC, 230 V, 10 kV or 110 kV) together or separates them into two grids, by hand or by redstone, shows which side is live and opens by itself when overloaded.

1.4.0: the wall passthrough takes a cable through a wall, floor or ceiling without leaving a hole: thread any cable through it, clad it in the wall's own block (bricks, concrete, planks...), and an overloaded cable burns out inside it while the wall stays.

1.3.4: battery banks live by the sun: they run on Minecraft time (storageTimeScale 72), so a night of about 9 real minutes drains them like the 12 hours it shows, and the panels fill them again by day. Before, a night took about 0.1 % and solar fields stayed at 100 %. A village field (30 panels, 9 banks, about 240 W of load) now dips to about 88 % by dawn and is full again by mid-morning. Electricity meters keep counting in real time, so a meter between a bank and its load shows 1/72 of what the bank gave.

1.3.3: /gridworks net <x> <y> <z> (operators) prints what the grid makes of a block: its entry and, for every network it belongs to, the offered, demanded and delivered power, the voltage and the number of devices. Made for finding breaks and dead chains in a large built grid.

1.3.2: a broken LiFePO4 pack keeps its charge (it dropped without it, so a flat pack came back full).

1.3.1: radio batteries last longer: batteryTimeScale 22 instead of 128, with Ham Radio 1.9.1 (a full handheld transmits for 5 minutes at 5 W). A Ham Radio 1.9.2 world receiver (about 2.5 W) runs about 1 h 20 min on a 6 Ah pack; configs still on 128 move to 22.

1.3.0: the batteries of radio gear run at the same pace as Ham Radio 1.9.0's handheld (30 minutes of listening on a full battery): LiFePO4 packs drain and charge 128 times faster than the rest of the grid, and so does everything in a charger. A 15 W world receiver now empties a 6 Ah pack in about 2½ minutes, and the charger fills it in under a minute (batteryTimeScale in config/gridworks.json, 1 = real time as in 1.2.0). Battery banks, generator fuel and meters stay in real time.

1.2.0: energy runs in real time: batteries, packs, chargers, generator fuel and meters count real seconds, not Minecraft time (energyTimeScale in config/gridworks.json, 72 = the old behaviour).

1.1.3: an inverter (or any converter) with nothing on its input no longer powers its output; devices of other mods can accept several voltages (the Ham Radio world receiver runs on 230 V or 12 V).

New in 1.1.0: LiFePO4 batteries (6, 8, 18 and 50 Ah; 1.1.2: the BMS trips after a second above 3C), the charger, and network voltage that follows the batteries (DC devices see the sag and drop out when it gets too low).

Source code: github.com/Lamisator/mc_gridworks

Generator, meter, breaker and step-up transformer feeding a 10 kV line

Generator, meter, breaker and step-up transformer feeding a 10 kV line

Installing with Prism Launcher

  1. In Prism, create a new instance (Add Instance), choose Minecraft 26.3, and pick Fabric as the mod loader (at least 0.19.5).
  2. Open Edit → Mods, click Download mods, search for Fabric API and install it.
  3. Click Add file and pick gridworks-1.2.0.jar.
  4. Start the instance. Everything is in the Gridworks creative tab, and the crafting recipes are in the recipe book.
The Gridworks creative tab

The Gridworks creative tab

For a server, put the same jar plus Fabric API into the server's mods folder. Every player needs it too.

The four voltage levels

Every grid block belongs to one of four voltage levels. Blocks of the same level that touch each other, or are joined by an overhead line, form a network. Different levels never connect directly: power only passes between them through a transformer, power supply or inverter.

Level Used for Typical source
12 V DC Radios, LED lamps, battery banks, solar panels Solar panels, batteries, power supply
230 V AC House wiring, street lamps, heaters Generator, inverter, distribution transformer
10 kV AC Medium-voltage lines between villages Distribution transformer (step-up)
110 kV AC Long-distance transmission on pylons Substation transformer (step-up)

The amps a cable carries depend on the voltage: 2 kW is 145 A at 13.8 V, 8.7 A at 230 V and 0.2 A at 10 kV. That is why long distances are bridged at high voltage, and why a fat battery bank needs heavy cable.

Cables and lines

Cables are blocks that connect to their neighbours like fences do. Each has a current rating:

Cable Level Rating ≈ Power
DC Cable 12 V DC 30 A 414 W
Heavy DC Cable 12 V DC 200 A 2.8 kW
Power Cable 230 V 16 A 3.7 kW
LV Underground Cable 230 V 100 A 23 kW
MV Cable 10 kV 40 A 400 kW

Overhead lines run between insulators. Mount an insulator on top of a cable, pole or machine, take a line coil, click the first insulator, then the second. The line sags between them.

Coil Insulator Rating Max span
LV Line Coil LV Insulator 100 A 24 blocks
MV Line Coil MV Pin Insulator 60 A 48 blocks
HV Line Coil HV Insulator String 200 A 96 blocks

An insulator holds up to six lines. The wire cutters take all lines off an insulator and give the coils back. Breaking an insulator drops its lines as well. Lines keep working through unloaded chunks, so a long line to a remote station does not need chunk loaders.

Poles (wooden and concrete), crossarms, pylon lattice and pylon arms are decoration to hang lines on.

10 kV line over a concrete pole

10 kV line over a concrete pole

Wall passthrough

A cable block is thin and joins whatever is next to it, so a cable run through a wall leaves a hole. The Wall Passthrough is a solid wall section with a cable gland on each side. It takes one cable straight through.

Recipe: 4 smooth stone, 4 iron ingots and a black dye make 4 passthroughs.

A DC cable and a power cable enter a brick wall through passthroughs

A DC cable and a power cable enter a brick wall through passthroughs

Clad in bricks, only the gland plate shows; inside, the cable comes out of the gland to an LED lamp

Clad in bricks, only the gland plate shows; inside, the cable comes out of the gland to an LED lamp

A 16 A power cable overloaded by 6 kW of heaters burnt out in its gland; the wall stays

A 16 A power cable overloaded by 6 kW of heaters burnt out in its gland; the wall stays

Overload: smoke, fire and burnt cables

When a cable carries more than its rating, it heats up. A little over the rating makes it smoke and it takes a while to fail. Twice the rating has it in flames within seconds. A cable that burns out disappears and may set nearby blocks on fire. An overloaded overhead line snaps with a bang. A cable that is back under its rating cools down again.

Smoke Flames Burnt out

A 16 A Power Cable feeding 6 kW of heaters.

Circuit breakers prevent this. A breaker connects its left and right side (seen from the front). Use it to switch it on or off; sneak-use to cycle its trip rating. When more current flows through it than its rating, it trips with a clack before the cable gets hot. Set it at or below the rating of the weakest cable behind it.

Power coupling

A Power Coupling is a switch cabinet that ties two networks of the same voltage together into one grid, or separates them into two independent grids (a bus coupler). It works on every level: 12 V DC, 230 V, 10 kV and 110 kV (mount insulators on its sides for overhead lines).

Use it to split a town into districts that can run on their own, to keep a generator island apart from the mains until you want them joined, or to cut a faulty section out of the grid. Separated, each side is its own grid with its own sources: two generators keep two islands live at once.

Recipe: 5 iron ingots, 2 circuit breakers, a lever and a comparator.

A power coupling between two 230 V networks, coupled: both street lamps are lit

A power coupling between two 230 V networks, coupled: both street lamps are lit

Separated: the side without a generator goes dark

Separated: the side without a generator goes dark

A 12 V coupling between three battery banks and three inverters with heaters trips at 261 A

A 12 V coupling between three battery banks and three inverters with heaters trips at 261 A

Sources

Solar yard: panels, heavy DC cable, battery banks, inverter and a street lamp

Solar yard: panels, heavy DC cable, battery banks, inverter and a street lamp

LiFePO4 batteries

Portable 12 V packs for radios: put one on the ground and a radio right next to it runs from it. No cable is needed, because every side of the pack is a 12 V DC terminal. DC cable leads further, and packs touching each other work in parallel. Each pack is four 3.2 V LiFePO4 cells in series (4S, 12.8 V nominal), like every "12 V" LiFePO4 battery. Three cells would only give 9.6 V, too little for 13.8 V radio gear.

Pack Energy Max current (3C) Charge current Good for
6 Ah 77 Wh 18 A 3 A Handhelds, QRP and VHF/UHF rigs; a 100 W transmission (about 18 A with the sag) trips it
8 Ah 102 Wh 24 A 4 A A 100 W HF rig for a short activation
18 Ah 230 Wh 54 A 9 A A 100 W HF station for an afternoon
50 Ah 640 Wh 150 A 10 A A whole station for a field day, or an inverter for 230 V gear
The four packs: 50, 18, 8 and 6 Ah; the LEDs show the charge

The four packs: 50, 18, 8 and 6 Ah; the LEDs show the charge

Voltage curve. The voltage follows the real resting curve of a LiFePO4 pack: 13.6 V when full, a long flat plateau of 13.0–13.3 V from 20 to 90 %, then a steep drop (12.5 V at 10 %, 11.0 V at 1 %, 10.0 V empty):

Charge 100 % 90 % 70 % 40 % 20 % 10 % 5 % 1 % 0 %
Volts at rest 13.60 13.30 13.20 13.10 12.90 12.52 12.20 11.00 10.00

Under load the voltage sags across the pack's internal resistance (50 mΩ for the 6 Ah pack, 12 mΩ for the 50 Ah). While charging it rises above the curve, up to 14.6 V. The current through the pack is worked out from that, so the charge is counted in ampere-hours like a real battery monitor.

BMS. Each pack has a battery management system:

Right-click a pack to see its voltage, charge, current and BMS state. A comparator reads the charge, and the multimeter shows the pack's own terminal voltage. A pack you pick up keeps its charge; the item shows it as a bar and in the tooltip. A pack charges on any DC network with spare power (a power supply, solar panels) or in the charger.

Rigs standing on packs: 18 Ah, a flat 6 Ah, and a 6 Ah tripped by a 100 W transmission (over 3C)

Rigs standing on packs: 18 Ah, a flat 6 Ah, and a 6 Ah tripped by a 100 W transmission (over 3C)

The multimeter on a 70 % pack: 13.20 V

The multimeter on a 70 % pack: 13.20 V

Charger

A four-bay bench charger on 230 V (connect the mains to its back, sides or bottom). It takes:

Each bay charges at full rate up to 80 %, then tapers off. The charger is 85 % efficient and draws at most 400 W from the mains. Its window shows each bay's charge and charging power. The LEDs on the front blink amber while it charges and turn green when everything is full. A comparator reads that too (7 = charging, 15 = done).

The charger window: handheld, VNA, analyzer and a 6 Ah pack

The charger window: handheld, VNA, analyzer and a 6 Ah pack

The charger on the 230 V cable

The charger on the 230 V cable

Transformers and converters

Each has a back (input) and a front (output). Sneak-use a transformer to turn it around (step up instead of down). Plain use shows what it is passing through.

Block Back Front Rating
Substation Transformer 110 kV 10 kV 5 MW
Distribution Transformer 10 kV 230 V 250 kW
13.8 V Power Supply 230 V AC 12 V DC 1.5 kW
Inverter 12 V DC 230 V AC 2 kW

They lose a few percent along the way and only draw what the far side needs, plus a 2 W standby while switched in. A converter passes on only what its input supplies: with nothing (or a flat battery) on the input side, the output side is dead within a second.

Step-down transformer feeding lamps and a heater

Step-down transformer feeding lamps and a heater

Consumers

Block Level Draw
Street Lamp 230 V 70 W
12 V LED Lamp 12 V DC 10 W
Electric Heater 230 V 2 kW
At night the battery banks keep the solar yard's lamps on

At night the battery banks keep the solar yard's lamps on

Lamps light up when supplied. If a network has less supply than demand, every device on it gets the same share. Lamps go dark below 90 %.

Street lamps at night

Street lamps at night

Measuring

Electricity Meter — put it between two cables. Its counter shows the kWh that have passed through, and the disc spins faster the more power flows.

Electricity meter and circuit breaker

Electricity meter and circuit breaker

Multimeter — use it on any cable, insulator, machine or radio. It opens a handheld multimeter:

Current Voltage Battery

/gridworks net <x> <y> <z> (operators, since 1.3.3) — the server's view of a grid block: its kind, conductor and which voltage each face carries, then one line per network it belongs to with the number of nodes (and how many are in loaded chunks), the power offered, demanded and delivered in the last solve, the fraction of demand met, the voltage and the number of devices. A transformer lists both of its networks. Handy when a lamp stays dark in a big grid: a network that reports offered 0 W has no live source, and a tiny node count next to a long cable means a gap.

Ham Radio

When the Ham Radio mod (1.6.0 or newer) is installed next to Gridworks, its equipment needs power. Run a cable of the right level to any side of the device, or put a LiFePO4 pack right next to a 12 V rig.

Device Feed Draw
HF / VHF-UHF transceiver, CW bot 12 V DC 15–25 W, plus 2× output power while transmitting
Repeater, beacon 12 V DC 5–12 W, plus 2× output power on air
Antenna tuner / rotor 12 V DC 8 W / 20 W
World receiver, FM studio 230 V 1.5–3 W (by volume) / 150 W
HF / VHF linear amplifier 230 V 40 W, plus output ÷ 0.6 while keyed
Broadcast transmitter 10 kV 2 kW, plus output ÷ 0.75 on air

A 100 W transceiver draws about 225 W (16 A) while transmitting, so a DC Cable is enough. A 13.8 V Power Supply on the mains or a battery bank works as a station supply. A rig without power shows NO POWER, cannot transmit or receive, and an unpowered amplifier or tuner simply passes the signal through.

Powered from a battery No power
Left: a rig without a feed; right: a rig on DC cable from a battery bank

Left: a rig without a feed; right: a rig on DC cable from a battery bank

Low voltage. 13.8 V gear works down to 11.7 V (13.8 V − 15 %), as real rigs are specified. On a pack that is nearly flat, or one that sags under a transmission, the rig drops out before the BMS does.

Portable gear has batteries. The handheld drains while it is switched on: 0.3 W receiving, about 10 W while it transmits at 5 W. The VNA uses a little per sweep and the pattern analyzer per analysis. Their charge shows as a bar on the item and in the tooltip, and the handheld's window has a battery gauge. Empty, the handheld shows BATTERY EMPTY and neither receives nor transmits, and the instruments refuse to measure. The charger refills them.

Handheld on battery Battery empty

To use Ham Radio with Gridworks installed but without the power requirement, set requireGridPower to false in config/hamradio.json.

A whole town: DARC Funkstadt

The Ham Radio sample map DARC Funkstadt is wired up with Gridworks from end to end: a 100 kWp solar park with 360 kWh of battery banks, transformer stations up to 10 kV, a 110 kV pylon line to a substation, buried 10 kV cables to transformer stations in town, and meters, breakers and 13.8 V supplies in every club station. Each of the four villages has its own solar field and a 10 kV pole line. See the Ham Radio handbook.

The solar park of DARC Funkstadt

The solar park of DARC Funkstadt

Building a simple station

  1. Put down a Generator, fill it with coal, and run Power Cable from one of its sides.
  2. Add a Circuit Breaker set to 16 A, then a 13.8 V Power Supply (back to the cable).
  3. Run DC Cable from the supply's front to the radio.
  4. Optional: put a Battery Bank on the DC side. It charges from the supply and keeps the radio running when the generator runs dry.
  5. Off the grid: Solar Panels → Heavy DC Cable → Battery Banks → DC Cable → radio.
  6. In the field: put the radio down next to an 18 Ah LiFePO4 pack. Charge the pack and the handheld in a Charger back home.

Energy and time

The grid books energy in real time: a coal item keeps a generator at full load for 1.6 hours, and meters count real kilowatt-hours. Power in watts is the same either way.

Battery banks follow the sun instead (since 1.3.4): they run on Minecraft time, 72 times faster, because the day and night they bridge are Minecraft days and nights. A bank (2.4 kWh) feeds 100 W for 24 Minecraft hours, which is 20 real minutes, and one night at 100 W costs it about half its charge.

The small batteries of radio gear run 22 times faster (since 1.3.1; 128 in 1.3.0), so that a Ham Radio handheld gives 5 minutes of air time at 5 W and a pack in the field has to be watched:

Real time (1.2.0) Since 1.3.1
World receiver (about 2.5 W, Ham Radio 1.9.2) on a 6 Ah pack 30 hours 1 h 20 min
100 W rig receiving (about 2 A) on an 18 Ah pack 9 hours 25 minutes
6 Ah pack in the charger, empty to full 1¾ hours 5 minutes
Ham Radio handheld in the charger 3 hours 8 minutes

config/gridworks.json:

Setting Default
energyTimeScale 1 Seconds of energy per real second, for LiFePO4 packs, chargers, generator fuel and meters (battery banks: times storageTimeScale). 72 = Minecraft time as in 1.1 (a Minecraft day counts as 24 hours)
batteryTimeScale 22 Extra factor for LiFePO4 packs and everything in a charger, on top of energyTimeScale. 1 = the same pace as the grid (as in 1.2.0)
storageTimeScale 72 Extra factor for battery banks, on top of energyTimeScale. 72 = Minecraft time, so nights drain them as long as they look; 1 = real time (as in 1.2.0 to 1.3.3)

Ham Radio's handheld, VNA and analyzer batteries have the same two settings in config/hamradio.json.

Building from source

./gradlew build            # build/libs/gridworks-1.5.1.jar
./gradlew runClientGameTest # builds a test grid in a flat world and saves screenshots
./gradlew runClientGameTest -PwithHam   # the same with Ham Radio (libs/hamradio-*.jar)
./gradlew runClientGameTest -Pscenes=passthrough   # wall passthrough: thread, clad, pull, overload
./gradlew runClientGameTest -Pscenes=coupling      # power coupling: couple, separate, redstone, islands, voltages, trip
./gradlew runClientGameTest -Pmap=<world dir> -Pshots=<file> -PmapMods=<jars>   # photograph a saved map

tools/gen_assets.py generates all textures, models, recipes, language files and sounds.

License

MIT