You are the electric utility -- thrice over!
Your configuration, with a generator and an inverter/charger, requires special care as you have not one, not two, but three electrical systems, all isolated from each other and completely off the mains electrical grid. This is outside the norm for a residence, and requires careful application of the NEC rules for separately derived systems starting in 250.30.
Start with the easy stuff first
The easy part of this all is making sure that all the panelboard (aka load center/electrical panel) cabinets, the inverter's safety earth terminal, and the generator frame are all solidly connected together. This makes sure you have an effective fault-current path everywhere it's needed as per 250.4(A)(5) and 250.92. These conductors can be sized as per 250.122 in your case due to 250.102(D) and this rule from 250.32(A)(2):
A supply-side bonding jumper shall not be required to be
larger than the derived ungrounded conductors.
Getting down to earth (ground)
You'll need a grounding electrode, of course. This defaults to the metal-cold-water-pipe electrode (or structural steel, but you don't have that) in 250.30(A)(4), but I'd put another 250.52(A)-compliant one in to protect against plumber-induced losses of grounding, as they can leave your system completely floating which is a problem if lightning strikes nearby.
Since you have multiple separately derived systems, though, this is where things get hairball. You'll either need to:
- Run completely separate grounding electrode conductors from the generator grounding electrode attach point and inverter AC output bonding point to each of your grounding electrode(s). This is straightforwardly permitted by 250.30(A)(6), but can lead to a proverbial spaghetti bowl of grounding electrode conductors, a minimum of four in your case, all of which must be at least as large as required by 250.66.
- Or, run a single grounding electrode bus conductor between all the grounding electrodes and then tap it with 250.66-compliant conductors to feed the various grounding electrode attach points. This bus conductor must be enormous though, as 250.30(A)(6)(a) requires it to be a minimum of 3/0 copper or 250kcmil aluminum. That's the same size as a 200A service conductor!
In any case, you'll need to use listed grounding clamps or exothermic welds to make all grounding electrode and grounding electrode bus connections.
Bonding it all together
You'll now need to make sure that your supply bonds are in the correct places, and nothing's cross-wired between your grounds and your neutrals. This means that you will need to practice good ground bar discipline -- both of your panels must have separate ground and neutral bars, with all the neutrals going to the neutral bar and all the grounds going to the ground bar. Typical residential-sparky-in-a-hurry slobbering of everything onto one bar will not fly here!
First, the generator in your case is supplying the ground-to-neutral bond for its part of the system. This means that you must pull the service bond out of the panel for the generator-powered stuff, wherever it might be (on a modern panel, it'll be a green screw in the neutral bar). You will also need to install a ground bar kit into the panel if one is not present already and transfer all the ground wires to the new ground bar.
Second, thankfully, since you are dealing with a 24V DC system that is derived from a grounded AC system by a rectifier (battery charger), you don't need to bond the DC system to ground (as per 250.162(A) including Exception 2). I would make sure that any metallic, non-current-carrying parts that may short to the DC system, such as metal battery racks, are bonded to the generator (inverter/charger AC input) system ground, though.
Finally, since your inverter's AC output is floating, you'll need to bond it to ground somewhere as per 250.20(B) point 1. This can either be at the inverter with a jumper from the inverter output to both the inverter safety ground terminal and the grounding electrode conductors for the inverter system, or at the panelboard using the green screw or link (i.e. configuring the inverter-circuits panelboard as service equipment) as well as terminating the grounding electrode conductors onto the panelboard ground bar instead of the inverter bonding jumper.
Ok you wrote a book. Proposing all manner of third rate hackery. And what does it boil down to? You want to get 5000W out of your 5000W generator. Quick question.
What is 240 x 21 ?
By my math, it's 5040. There's your 5000W. You do get it out of the big NEMA L14-20 connector.
I have no idea where you got 41A. I'm pretty sure you made that up, probably by dividing 5000 by 120. I seriously doubt it was on the generator spec. There's a way if you really really want that, but as you get educated, you will realize you do not.
What is it you're missing? The odd idiom of North American 2-pole service. I don't blame you for not getting it... It's weird.
Your house is served by +120V, neutral (0V), and -120V. I just described an instant in time, they're AC so they will reverse position 120 times a second. The poles are called L1 and L2 and the middle is Neutral.
240V loads grab L1 and L2. 120V loads grab either pole and neutral. Which pole they grab is nearly random and that's the idea, to make them average out so loads are balanced.
For you, with 21A on each pole, balancing is a big deal. You'll have a problem if you put 30A of load on one pole. So you'll need to get into the gory details of what is on which pole, and manage accordingly.
Step 1: Control MWBCs so they don't kill you
I don't recommend rearranging things on a panel because you can break a type of wiring called a multi-wire branch circuit. Find an electrician and tell him to do exactly this:
find every multi-wire branch circuit in my home, and make sure both its hot wires are served from the same 2-pole breaker.
Step 2: get rid of double-stuff breakers
If your panel is stuffed, and has lots of breakers that have 2 breakers in 1 space, those will drive you absolutely bat crazy. ack... You know what, to heck with all that.
Let's just get you a new subpanel with the appropriate interlocks, and move the loads you want the generator to power into this new subpanel. Make this subpanel quite large (at least 20 space) realizing you'll use 4 spaces just for the interlock.
In a perfect world, your new panel will have ammeters which will tell you how close to 21A each pole is getting. Even better get one of those new fangled whole house monitoring systems. Ask a new question on how to get one to work in a generator interlocked panel.
Step 3: rearrange your loads in the panel
Now finally, it's time to learn the gory details of how poles are assigned in a panel. Read my posting here. Your panel may differ, but probably not by much.
Move your loads into the new panel, and consciously and carefully balance the loads. For instance if your table saw is on L1, put your dust collector on L2. Stuff like that.
Best Answer
Running all the wires in the conduit is fine, but there are better choices than that URD cable!
Bumping up to 2" Schedule 80 and putting all the wires inside it is more than fine (there is an 80% ampacity derate because of this, but it won't bother you one bit here); however, that 4/4/4/4 URD cable is probably not going to be the easiest thing to pull through the conduit. Using individual 4AWG Al XHHW-2s for the generator feed instead would be a better choice, and you can also save fill by running a 10AWG bare copper ground wire that's shared between the generator feed and the shed circuit. The remaining wires for the shed can be 10AWG copper THHN/THWN-2s -- this will make your conduit-pulling job quite a bit easier than trying to stuff cables down your conduit.
TORQUE LUGS TO SPEC (so you don't come off looking like a loose lugnut)
In addition, that URD cable uses AA-1350 aluminum conductors -- while legal for URD cables, it would mean that you would have to take extra care to make a perfect termination on your lugs at each end. Getting individual aluminum XHHW-2s instead would mean you are getting AA-8000 series alloy conductors, which are somewhat more forgiving than the old AA-1350 stuff. Even with AA-8000 series conductors, though, it's still highly recommended (and even required if your AHJ is up to speed with the 2017 NEC, see 110.14(D) for details) to use a torque tool to torque the lug setscrews to the manufacturer's specified torque values. Considering that a mistorqued lug can lose you your house, not just a race, an inch-pound torque wrench, applied correctly, is cheap insurance, no?
Temperature ratings matter!
Last but not least on the electrical front, in order to use 4 AWG aluminum cable for this run, you'll need to pigtail it to some copper (10AWG is fine, given that you can change the pigtails out if you get a bigger generator and inlet) at the inlet end, presuming that you're putting a NEMA L14-30 inlet in, that is. This is because most inlets that size a) can't accept 4AWG aluminum wire and b) are only rated to a 60°C termination, not a 75°C one, which won't limit you at 30A, but would keep you from using the full 60A of your wire should you get a bigger generator and inlet. You'll need to use set-screw type splice blocks (rated Al7Cu/Al9Cu) to connect the pigtails, not wirenuts, by the way -- don't forget that these need to be torqued to spec, too!
As to that gas line...
Co-trenching of dry utilities (electric/gas) is not an uncommon practice, although it does carry some risk of gas migration into the conduit system for a conduit run in case of a buried gas leak. You'll need a yellow-insulated, direct burial rated, single conductor (minimum size 18AWG) laid atop the gas line in the trench with a stubbed-up termination at one end to meet IFGC 404.17.3 tracer wire requirements for the gas run, by the way.
If you do wish to run the gas line in a separate trench, I would recommend a minimum of 36" separation between the trenches, so that it's an effective barrier against digging both up in one go with an excavator. (The NESC specifies 12" of radial separation, which isn't sufficient to keep that from happening.)