# Some thoughts on the new household electrical stuff in Experimental

Good morning, folks! Thanks for all your hard work on the game. I love it. This post is in no way, shape, or form intended to be critical. I just wanted to share my semi-educated opinions, as a former commercial/industrial electrician and ham radio operator.

I realize too that fun comes before realism, so yanno. But there are some fundamental differences between low-voltage high-amperage DC electrical systems (as you would find in automative applications) and high-voltage low-amperage AC electrical systems (such as you would find in household wiring).

I also apologize if this has been discussed before. As a self-employed type, my day job is busy af (ironic considering that I have the time to write all this at the moment lol), like 60 hour weeks typically. So I donâ€™t really have time to keep up with the github and discord discussion as well as I ought.

Before I share my thoughts on this though, letâ€™s make sure weâ€™re all on the same page. Please skip ahead if this is old news to you.

These explanations are not meant to be read as me talking down to anyone. I just want to make sure that everyone reading this can be on the same page once we get to the meat of this discussion.

As we recall from EE-101, the power being supplied or consumed in an electrical system (wattage) can be expressed as the voltage on the line (volts) multiplied by the current flowing through the line (amps).

This can be difficult to visualize, being that electricity is invisible, but we can use the metaphor of a water pipe to help. The metaphor starts to collapse if you examine it too closely, but I think itâ€™s sufficient for this discussion.

Imagine that power (watts) are the amount of water coming out of the end of a pipe. Imagine that voltage is the diameter of that pipe, and that current is the pressure of the water in that pipe (how fast the water is moving through it). Thus, we can supply the same amount of water (watts) using a larger pipe at a lower pressure, or using a smaller pipe at a higher pressure.

But if we apply too much pressure, the pipe bursts. Likewise, regardless of how high or low the voltage on a wire is, if we try to pass too much current (amps) through it, it will melt.

The ampacity of a wire (the amount of current it can carry before it melts) is unrelated to the voltage on the wire. Thus, we can carry more total power on a smaller (cheaper) wire using higher voltages. This is why your household power is 120v in the US and Canada, and the power up there on the power lines on the other side of your residental transformer can be up in the thousands of volts.

We also need to discuss the difference between AC and DC power.

DC power puts a constant voltage on the line, and the electrons are always flowing in one direction. The water goes in one end of the pipe and eventually comes out the other.

AC power alternates polarities, crossing over the zero threshold 120 times per second (in the US, Canada, and Japan anyway). The water in the pipe is sucked and then pushed back and forth like you might do with a butter churn. The motion of the water going in and out of the pipe at the other end can be used to do work.

AC power is easier to transmit over long distances, because itâ€™s very easy to step the voltage up and down using two coils of wire wrapped together (a transformer). This is why we typically see it used in household applications. Additionally, since the polarity is alternating, itâ€™s â€śturned offâ€ť 120 times per second (each time it crosses zero volts). If there is a short circuit, this will break the electrical arc sooner, before more of the wire has a chance to melt, and therefore is less likely to set your house on fire.

DC power is more compatible with batteries, which is why it is used in automotive applications. There is no way to store AC power in a battery. You apply a DC voltage to a battery to charge it, which changes the chemical composition inside the battery. Then you hook a DC load to it, and the battery discharges, returning the chemical composition to what you started with.

Some types of loads donâ€™t care if they are on AC or DC power. Examples of this would include incandescent light bulbs (such as in your car; most household bulbs these days are flourescent or LED, which will care what they are supplied with) and heating elements. These loads, however, are still designed to be powered with a specific voltage. You plug a car headlight into an AC receptacle, it will blow the bulb. You plug a household oven heating element into a battery, and it probably just wonâ€™t do anything to speak of (other than maybe damage the battery trying to draw too much current, depending on the battery).

Other types of loads however require either AC or DC to function properly. There are fundamental differences between AC and DC electric motors, for example. Electronic devices also require DC power (even those that plug into the wall convert to DC power internally).

(In the coming paragraphs, recall that with wire gauges larger numbers indicate smaller wire.)

So, letâ€™s look at an automotive type electrical system. Low voltage (12v typically), high current (20 or 30 amp fuses are common just for running one thing such as the fuel injection or headlights, and everything is on its own circuit). Such a system tends to use short runs of comparatively thick wire. #10 and #8 are common, and the high-power main battery and starter cables are as thick as your thumb.

(Notes: Some vehicles have a 24VDC electrical system. Mostly military vehicles and older road tractors, although itâ€™s not nearly as common as it used to be. Most automotive fuses are actually rated to 36 volts, and can be used in either application, but all the bulbs, electric motors, etc that run off 24v will be different. DC-DC converters can be used to get 12v out of such a system to power your 12v CB radio and such. Marine applications are typically 48VDC and use entirely different fuses and breakers (which are all stupidly expensive), and again the light bulbs and electric motors and stuff will all be different, but the same sort of DC-DC converter can be used to run your 12v marine radio or whatever. DC-AC inverters which weâ€™ll discuss later can be had in 12v, 24v, or 48v varieties, but the 12v ones are all youâ€™ll find at the local big box etc. The 24v and 48v units are typically only found in off-grid solar power systems or maybe in one of those power wall thingers.)

Letâ€™s look at the household wiring on the other hand. High voltage (120 volts RMS in the US and Canada), low amperage (15 or 20 amp breakers are typical, and many many devices will be plugged into the same circuit). Comparitively small wire (#12 most of the time, although you will occasionally see #8 or #6 powering something like a 50 amp electric oven). Recall the water pipe metaphor from before. Since the voltage is higher, we donâ€™t have to pull as many amps through the wire. So we can use a smaller wire. This is good, because long runs of large wire are expensive.

(Notes: Our household power in the US is actually 240v, but we only use half of it at a time with a common neutral most of the time. Two 120vac lines that are opposite in phase. This only comes into play with stuff like ovens and clothes dryers, though.)

So letâ€™s look at some situations in Cataclysm, and how this might inform what might ought to work and what ought not.

1. You hook a car (12vdc) to a buildingâ€™s household wiring. You take some 12v light bulbs salvaged from cars and use them to light the interior of the building: Realistic. As long as the wires arenâ€™t too awfully long (resulting in a voltage drop and dim lights). Even though the household wiring is small, the lights are a pretty low-amperage load (especially LED lights).

2. You hook a car (12vdc) to a buildingâ€™s household wiring. You plug a refrigerator into a receptacle inside to preserve your food: Unrealistic. The compressor that pumps the ammonia or freon (or whatever they use now) through the system operates on an electric motor. This motor will have been designed to run on 120vac, not 12vdc. A very skilled individual with the proper tools might be able to remove the 120vac motor and replace it with a 12vdc motor salvaged from a carâ€™s windshield wipers, maybe? If the motor was beefy enough to run the compressor. And if it didnâ€™t try to draw too much current and melt the small household wiring (this is probably what would happen if you tried to use a starter motor instead of a windshield wiper motor).

3. You hook a car (12vdc) to a buildingâ€™s household wiring. You plug an 240v electric range into the household wiring to cook with: Absolutely No Way In Heck. Even though the ovenâ€™s heating elements donâ€™t care about AC or DC, they are still designed to work at 240 volts. In theory, we could cut a single 240v element into 20 shorter sections and reconnect them in parallel. But recall our equation from before, power = V * A. This oven was already probably running on a 50 amp breaker at 240 volts, so it could be consuming twelve-thousand watts! To supply that much power at 12 volts would require one thousand amps. Even a small oven on a 30a breaker would require 600 amps and element modification to run at 12v. Even the main lugs of a typical household breaker box are only designed for a 200 amp service. There is just no way for this to work. All of the RV ranges Iâ€™ve seen use propane.

4. You build/repair/find a 120vac portable generator somewhere and plug it into a buildingâ€™s household wiring: Very Realistic. Most of the stuff in the house would probably run fine if the generator can supply enough power. However, turning on an electric range or a heat pump or something might trip the breaker on the generator, if it isnâ€™t made to supply that much power.

5. You build/salvage/repair a 12VDC-to-120VAC inverter somewhere, hook it to your car, and then attach that to a buildingâ€™s household wiring: Very Realistic. This is the same sort of use-case as the generator above, but remember that these inverters usually canâ€™t supply nearly as much power as a generator unless you operate many of them in parallel (which requires some special control wiring to keep them all in-phase). Running electric ranges, air conditioners, etc is pretty much out of the question. Many of the consumer-grade inverters canâ€™t even run particularly large power tools or toaster ovens. But lighting, computers, radios, small AC motors (fridge/freezer compressors), etc, that kind of stuff would be fine.

6. You supply 120vac to a house somehow using one of the methods above. You then salvage a bunch of car headlights and use them to light the interior of the building: Realistic. If you string ten 12v incandescent light bulbs together in series, you can run them on 120v. But like your Christmas dreckerations, if one bulb gets crunched by a zomboi, all the others in that series will go out too. Although given that the building would probably already have lighting, Iâ€™m not sure why someone would want to do this.

Uh, I am probably forgetting something I wanted to mention. If so, I guess Iâ€™ll reply to myself, lol.

Again, thank you all for all your hard work on this fine game. None of the above is meant to be critical at all, just to share my thoughts. I havenâ€™t contributed enough to the game or community to earn the right to complain, and even if I had I donâ€™t see anything to really complain about with this building electrical stuff. I am sure that much of the above would be too tedious to implement anyway. Although I do worry a smidge that being able to hook cars to houses and use all the household appliances without modification would be (1) unrealistic but more importantly (2) might make the game too easy starting out. But yeah, Iâ€™m not going to complain, whatever yâ€™all decide!

Thanks!!!

3 Likes

Not being a core team member, and, as such donâ€™t hold much or any weight, I find the above not to be criticism, but rather suggestion areas about realism, which is useful.

Concerning no 5: Wouldnâ€™t you work around the synchronization problem by hooking up the batteries in parallel before the inverter (which probably would have to be a beefed up version)? Note that I donâ€™t have any education in the area, so I may well be completely off the mark.

I mean the synchronization of the AC power on the output side of the inverter, when using multiple inverters in parallel (not a parallel battery bank configuration). Itâ€™s generated using some kind of oscillator that produces a square wave thatâ€™s used to switch a pair of JFETs back and forth to produce 12VAC, and then stepped up to 120VAC with a transformer (at least in the cheapo modified sine wave inverters that are common in the big box and auto parts stores, but I digress). If those oscillators arenâ€™t synchronized, then the resulting AC outputs will be out of phase, and will cancel out each other to some extent (depending on how far out of phase they are), and screw the AC waveform all up.

I must be misunderstanding something. What I meant was that youâ€™d use a single beefy inverter using merged input (and you might even combine parallel with serial to get 120VDC directly so you donâ€™t need to transform it) to avoid the synchronization problem completely, as youâ€™d only have a single waveform producer. It would require a lot of batteries, though, and might not be feasible for a lot of real world reasons.

The inverter itself can only supply so much power on the AC side, depending on how it is designed, regardless of amount of power available on the DC side. Like the water pipe metaphor, we try to put too much â€śpressureâ€ť (amps) through the inverter components, and something will let out the magic smoke (or more likely just pop the fuse on the inverter). If we want to be able to supply more current on the AC side, we can do this by using say, two inverters in parallel, such that half the power goes through one and half through the other. But the AC outputs have to be in-phase for this to work.

Likewise, an inverter only supplies 120vac on one leg and a neutral return on the other. If we want to run a 240vac appliance (such as a deep well pump, etc) on an off-grid electrical system using inverters and batteries, things get even more interesting! In this case, we rig up two 120v inverters to run 180 degrees out of phase on the AC side, and then bond oneâ€™s â€śhotâ€ť to the otherâ€™s â€śneutralâ€ť, for a center-tapped neutral and the usual sort of opposite-phase 240vac. This requires the ac outputs to be fully isolated from the dc inputs, as well as the grounds, though, so as you can imagine this starts into specialized expensive inverters, lol.

1 Like

That reminds me, I was derping about the oven example above. That would be on a 240v double pole breaker at 30-50amps, so the wattages would all double. Doubly impossible to run off 12vdc without wires as thick as your arm. :3

I fixed the OP. I hope I didnâ€™t say anything else too dumb, lol.

More thoughts:

It would surely be too tedious to model all the electrical stuff with just-so realism.

But perhaps it could be abstracted into â€ślow voltageâ€ť (car-generated electricity), â€śmedium voltageâ€ť (household current), and â€śhigh voltageâ€ť (industrial and distribution infrastructure type stuff).

Different sorts of generators could be modeled. Car and truck alternators would produce low voltage. â€śMedium Voltage Generatorsâ€ť and â€śHigh Voltage Generatorsâ€ť could produce medium and high voltage respectively, but consume a great deal more engine power to do so than alternators. So youâ€™d need v12 or turbine engines to generate high voltage, and there probably wouldnâ€™t be much left for a vehicle to move around with. Medium voltage could be generated with smaller engines but there wouldnâ€™t be much left to move around with unless you had a v8 or something.

First tier stuff could be salvaged from vehicles the same way we do already. Holding capacity of refrigeration appliances in this tier would be low, and heat-producing devices would be slower to cook things (an abstraction to represent not being able to cook as much stuff in them at the same time).

Tier 2 stuff would be household appliances, but finding/making medium voltage generators would be more difficult and require more skill. These devices would do the same jobs as the RV equivalents, could have more capacity and be faster.

The tier 3 high voltage stuff could be for top-tier industrial and lab equipment.

Some sort of â€śpower converterâ€ť appliance could convert between these power classes, but it would be as difficult or more difficult to find/make as the highest tier stuff that it connects to. ie, to make a â€ślow-voltage to medium-voltage inverterâ€ť, youâ€™d need to already have access to the medium-voltage level skills and tools.

Connecting a lower-voltage device to a higher-voltage source or wire would damage the device. Connecting a higher-voltage device to a lower-voltage wire or source would cause the device to just not-work.

Hooking two sources of different voltage levels to a span of wire would damage the lower-voltage supply (along with any lower voltage appliances connected to the wire as well. Youâ€™d need to use some kind of power-converter as above to connect two different spans of wire together to operate a mix of equipment.

It would be cool to model current and wire capacity, and set the building on fire if you made a setup with inadequate over-current protection and activated too much stuff on the circuit at the same time, but that might be a bridge too far implementation-wise.

I am not sure how to go about modeling vehicles with multiple voltage-tier devices in them. Iâ€™ve been thinking only from the perspective of building electrical stuff. But it wouldnâ€™t be unusual to see a â€ślow-to-medium voltage inverterâ€ť installed in an RV or service truck, to run various smallish tools and appliances that require household type power.

Again, these are not meant to be criticisms, just thoughts. The above isnâ€™t really â€śrealisticâ€ť per-se, but I think it would be a neat sort of gamified way to provide for different appliance tiers and keep people from doing outrageous things like running an electric oven with a car.

Hopefully one of these days Iâ€™ll have time to become more familiar with the codebase and be able to contribute PRs rather than just pulling stuff out of my butt like this. ;(

Thanks again for all yourallâ€™s work on the game!!!

2 Likes

In a perfect world, inserting realistic aspects in a game would be an opportunity to use the game for educational purposes, rather than being simple tedium.

1 Like

Thanks for the summary, I was aware of some of these complications, but not all of them (the inverter sync issue didnâ€™t occur to me for example).

So, how to put this into the game without making things overly complicated, I think itâ€™s not that hard, as Lee outlines.

Instead of calling them low/medium/high, Iâ€™d rather stick with something more specific (I think this is what Invalid_Username is saying), like â€śvehicle voltageâ€ť, â€śhouse voltageâ€ť, â€śindustrial voltageâ€ť, or something other than â€śvoltageâ€ť might be more accurate.

I think bridging networks is a step too far, the code would get complicated, the UI would get confusing, just bad news all around.

What Iâ€™m thinking is for a given current source, that sets the â€śflavorâ€ť of network, and we only allow the player to attach compatible devices*. An inverter or rectifier plus transformer can change the flavor of output, and the same thing on the device side can change the flavor of input.

Something Iâ€™m curious about now, if you have two AC generators, that has the same synchronization issue as the inverters, right? Does that imply that we should only allow one AC source to connect to a given network? Do alternators have the same issue, or can you freely stack them since theyâ€™re DC?

I think that gets us most of the complexity one would need to worry about as far as â€śI have part A and part B, can I hook them up?â€ť, while not really requiring that much complexity around how that happens.

Implications:
Household appliances become more picky about their power sources, you canâ€™t cobble together a fully functional house scale network with alternators, and in fact you must use a large enough AC generator or build/find a big enough inverter to meet the applianceâ€™s needs. THIS INCLUDES WELDERS

Something else that happens is if your circuit is DC, you can kind of freely interleave generators and batteries, but on an AC circuit, youâ€™re burning a ton of power on just translating AC/DC and back, right?

Big industrial tools, like large shop lathes (which donâ€™t exist yet so whatever) are pretty much going to require dedicated generators.

DC generators such as arrays of alternators can work and be cobbled together, and will be fine over short ranges. We can code in loss over distance just fine if itâ€™s significant, Iâ€™m leary of worrying too much about wire gague, just go get some, you know? (power lines everywhere!) Electrically speaking, is there a penalty to oversized cables?

Hrmâ€¦ actually, anything else? Iâ€™m tempted to say just make larger AC appliances require a dedicated AC generator, but I donâ€™t think we can pare it back that far, because the use case of â€śyay I found a beefy gasoline generator thatâ€™s specifically designed to run a whole houseâ€ť is too important.

So I think we have to have â€śpower network flavorsâ€ť and prevent connecting incompatible devices.

*It seems fun in principle to make devices catch on fire instead, but itâ€™s pretty much wasted effort, people will get caught out either a few times before they figure out whatâ€™s happening, or carelessly cause problems at random intervals, for no benefit above simply disallowing the connection.

3 Likes

Why use low/medium/high voltage? Just say how many volts the network is. If it device needs Â± 10% then it still works OK, over 10% it burns, under 10% and down to 50% it still â€śsomewhat worksâ€ť.

I also disagree that medium/high voltage generators need high powered motive power source. They are typically larger and thus need more power to overcome internal resistance/get them moving/etc, but the amount of power to keep them idling shouldnâ€™t be that high.

Of course good luck turning a 600MW turbine from a serious power plant with an inline4, but you should have no trouble running a ~100kW substation-level emergency power generator with 10 HP engine. Of course you cannot expect to get more than 7kW out of it.

Something Iâ€™m curious about now, if you have two AC generators, that has the same synchronization issue as the inverters, right? Does that imply that we should only allow one AC source to connect to a given network? Do alternators have the same issue, or can you freely stack them since theyâ€™re DC?

In theory you can run DC sources in parallel, but in practice unless your batteries are all identical (even down to their age/amount of wear), one battery will end up charging another and the whole battery bank will only be as good as the worst member. This can be avoided by adding some diodes, but you get a voltage drop across them, which can be undesirable.

I donâ€™t know how large power plants keep all their generators in-phase when they run several in parallel. My assumption is that they use some sort of inductor to shift the phases to match rather than trying to actually turn all of the generators in-phase at the same time. I would assume that the inductors to do something like that would be quite Large and In Charge, though. But that is something I have no direct experience with. But yes, itâ€™s much more difficult to run AC sources in parallel than DC.

THIS INCLUDES WELDERS

Itâ€™s actually somewhat common in the off-roading community to improvise an arc welder by stringing 3 or 4 car batteries together in series. Doing so is not the safest thing in the world, and thereâ€™s no way to control the current as precisely as with a real welder, but itâ€™s not an uncommon practice.

Technically you could cut your own rod out of sheet steel with a hacksaw and weld with it if you really wanted to, and apply flux separately, but if you went to all that trouble it would probably be easier to make a forge or drill and use bolts. I image the results would look even more like bird poop than my usual welding, lol, but I 'spect it would work. In fact, maybe if I have some free time this weekend Iâ€™ll try cutting my own rod from some scrap plate and see how badly it works and report back, lol.

Iâ€™ve thought about suggesting this (makeshift arc welders, I mean), as I think that welding with makeshift tools and rod is easier in RL than these recent changes make it in-game, but I understand the need to gamify it a little to make vehicles a little â€śharderâ€ť.

Sorry, not much time to reply at the moment, but Iâ€™ll be thinking about this and post back later tonight if I think of something else.

Thanks again folks!

2 Likes

Iâ€™m just going to chime in with a use case that lives rent free in my head:
Using the diesel generator from a diesel-electric locomotive for power.

That is all.

1 Like