# Electrical Panel

A flat 12V mounting panel for the Transit, in the trekMount style. Plates cut
from aluminum on the xTool MetalFab, components through bolted to the front,
cables behind, printed standoffs over a wood backer.

- `configurator.html`: self contained, works offline. The 3D view shows or hides
  components, spacers, bolts, wires, the wood backer, keep outs and the plate.
  The MPPT and shunt meshes come from Victron's published STEP files (`src/tools/`).
  Other part shapes and all wire routes are schematic.
- `src/engine.js`: `PARAMS` and `LAYOUTS` hold every dimension and placement.
- `src/export.mjs`: `node export.mjs <layout> [outdir] ['{"CHARGER2":true}']`
  writes all outputs. `src/check.mjs` runs the layout rules. `src/build.mjs`
  rebuilds the configurator.
- `samples/`: cut SVG and DXF, engrave SVG, tiled 1:1 template PDF, layout PNG,
  hole table CSV and spacer STL for each plate set.

## Layouts

| Layout | Plates | Use |
|---|---|---|
| `cabinet` | 530 x 370 | Default. Shortest battery runs; slots both sides of the fuse block. Two 32 x 150 mm oval slots, above and below the MPPT, pass MC4 connectors behind the plate. Two 1 in round lighted switches (25.4 mm hole, 40 mm bezel) sit in the lower right corner, on 40 mm spacers |
| `cabinet_trio` | 530 x 370, 300 x 262, 300 x 83 | The balanced panel plus two plates to its right, 25 mm gaps, right column no taller than the balanced panel. Charger 2 plate at the bottom with a 32 x 239 mm oval as wide as the charger body and one tie row below it; its bottom spacers sit in the corners at 18 mm, on 40 mm spacers. Switch plate above it with two 1 in round switches and three Contura II rockers, on 60 mm spacers for the Contura depth, so it stands 20 mm forward. A 1/4 in hex ply backer (931 x 446 mm, 10 mm corners) reaches 38.1 mm (1.5 in) past the plates, with 8 mm tee nut holes behind every spacer and no other holes: place the wall mounts by hand |
| `cabinet_left` | 530 x 370 | The balanced layout turned end for end, battery parts at the left, for a battery to the left of the panel |
| `cabinet_wires` | 530 x 370 | 40 mm clear each side of the fuse block, with load wire grommets |
| `cabinet_fit` | 500 x 370 | Built for the 11.5 in driver cabinet. One plate in the rear compartment beside the batteries, with circuit wires run behind it |
| `cabinet_switch` | 450 x 370, 270 x 150 | Built for the 11.5 in driver cabinet. Battery fuse and switch on a small plate above the batteries, and a narrower main plate with room for circuit wires each side |
| `cabinet_wood` | Wood 920 x 276, metal 254 x 340 and 270 x 150 | Built for the 11.5 in driver cabinet. No metal under the shelf. Parts bolt to a wood wall in front of the well, with the battery switch above the batteries |
| `cabinet_wood_fuse` | Wood 920 x 276, metal 254 x 340, 200 x 300 and 270 x 150 | Wood wall, with the fuse block on its own plate in the middle compartment |
| `cabinet_wood_battery` | Wood 920 x 276, metal 254 x 340 and 420 x 150 | Wood wall, with the shunt, battery fuse and switch above the batteries |
| `cabinet_switch_narrow` | 430 x 370, 420 x 150 | Narrow main plate in a two compartment cabinet, with the shunt, battery fuse and switch above the batteries |
| `cabinet_storage` | Metal 254 x 340 flat sheet and 250 x 370 | MPPT on the back wall, small plate beside it, battery switch and fuse on the divider, storage in front |
| `cabinet_walls` | Metal 254 x 340 flat sheet and 200 x 340 | Same, with the fuse block on the rear face of the divider |
| `well_wall` | 500 x 336 (19 11/16 x 13 1/4 in) | No cabinet. Wall above the wheel well with one battery behind the well. Battery parts at the rear end, fuse block at the front end, MPPT mounted elsewhere with its leads through grommets. Fits the cabinet compartment later with the batteries at the rear. Exported twice: `samples/well_wall_aluminum` (1/8 in aluminum, laser) and `samples/well_wall_hex_ply` (1/4 in hex ply, CNC, no tie grid; drill the holes under 9.5 mm) |
| `cabinet_rear` | Metal 254 x 340 flat sheet and the 500 x 336 wall panel | The wall panel in the cabinet: battery compartment at the rear sized for one battery, then the MPPT, then the panel with the fuse block forward |
| `cabinet_rear2` | Metal 254 x 340 flat sheet and the 500 x 336 wall panel | Two batteries in the rear compartment, wall panel in the front one, MPPT on the outside of the rear end panel |
| `combined` | 610 x 336 (24 x 13 1/4 in) | One panel with everything, MPPT included. Battery parts at the left, then MPPT, bus bars, fuse block at the right. Goes on the wall above the wheel well now and into the cabinet electrical compartment later, with the batteries crossways at the rear end. A PV breaker box (HT-5, 160 x 120 x 92) mounts beside it from its own drill pattern, plate B |
| `cabinet_fuse_left` | 530 x 370 | Fuse block at the far edge, with most room for load wires; longer 4 AWG |
| `single` | 560 x 420 | The original envelope. Too tall for the space above the cabinet shelf |
| `cabinet_fuse_right` | 530 x 370 | Fuse block at the right edge by the batteries, with the middle holding the switch, MEGA fuses and bus bars |
| `cabinet_long` | 480 x 270, 420 x 270, 254 x 340 | For a 14.5 in deep driver cabinet. Two low plates sit under the battery shelf and the MPPT sits above it, beside the batteries |
| `tall` | 300 x 660 | Portrait, 26 in high, for a narrow wall. Does not fit above the cabinet shelf |
| `tall_pair` | 380 x 325.4 and 380 x 335 | Two plates, 26 in high together. Each fits the laser bed |
| `tall_pair_right` | 380 x 325.4 and 380 x 335 | Two plates with the fuse block at the right edge, so circuit wires leave clean |
| `split` | 420 x 420 and 190 x 420 | Side by side. Too tall for the cabinet as well |

The Driver cabinet toggle in the 3D view shows the cabinet from `wheel_well_cabinet/` at 11.5 or 14.5 in deep, for the long layout and the cabinet layouts on the back panel above the shelf. The build reads the cabinet engine, and the page reports what fits and what collides.

Slots beside the fuse block (14 x 110, on by default) take circuit wires behind the plate. Fit rubber edge trim, since the plate is conductive. Every layout has one on each side.

Circuit wires off the fuse block have their own show switch and four bundles, each sent up, down, left or right. The page lists any part a bundle crosses. Those routes are schematic.

The Dimensions switch adds plate size and spacer spacing to both views. The stats bar
shows approximate 4 AWG and 6 AWG run lengths for the chosen layout.

An optional laser switch plate exists but stays off; the switches are moving to a printed box.

Charger 2 is an option on any layout and adds a 300 x 243 plate, landscape. Hole pattern
252 x 80 is scaled from the manual's drawing, so the plate uses short slots. Its manual asks
for 200 mm clear all round and no compartment with batteries, so it does not belong in
the electrical cabinet. Its BAT port takes BLUETTI products only.


## Layout editor

`layout_editor.html` is a drag and drop editor for one panel. Start from any configurator layout or a blank panel, then drag parts, grommets, spacers, the GND hole and the circuit wire slots. Wires redraw and every engine rule reruns as you move things; failures list below the panel, and clicking one marks the spot. Arrow keys nudge the selected item (Shift for 5 steps), R rotates the MEGA fuses, shunt and breaker box, Delete removes it. Cmd or Ctrl + Z undoes and Cmd or Ctrl + Shift + Z redoes; Cmd or Ctrl + X cuts the selected item. The 3D view button shows the current panel in the configurator's 3D renderer, updated with each edit. The build inlines the whole configurator into the editor, so the file works on its own. Layouts save in the browser by name, export and import as JSON, and "Copy for Claude" puts the layout and its rule results on the clipboard for review. Cut DXF, SVG, the 1:1 template PDF and the hole table export once the panel passes every rule. It runs the same `src/engine.js`, inlined by `src/build.mjs` from `src/editor.html`.

## Changes from the brief

- Second MEGA block: 60 A at battery out, 60 A at the MPPT in.
- One fuse block, not two.
- MPPT keeps 100 mm clear above and below, from Victron's manual. The brief said 50.
- Every cable on a post ends in a ring lug, drawn in 3D, and leaves the post in plane.
- MPPT follows Victron's dimension drawing (SCC110050210): 186 x 132 x 71 landscape,
  holes 176 x 71.5 for its 8 mm open slots, cables entering from below. The brief had
  130 x 186 and 75 x 175.
- Spacers for heavy parts sit beside the footprint, so no bolt head sits under a
  part and the plate comes off with everything mounted.
- 5026 follows Blue Sea's drawing: four round holes for #8 or M4 on 63.5 x 138.66.
  The brief had two slots.
- SmartShunt from Victron's drawing: 120 x 52.5, holes on 101 and offset 13.75 from the
  body center, because the electronics sit to one side. The brief had 54 wide, 101.5,
  centered.
- Optional printed adapter under the 5026, on by default: 191.8 x 84.2 x 10, read from
  Vice Designs' SLDPRT. The plate gets two M6 holes on 177.8 and the block's four holes
  go in the adapter. The adapter's file stays out of this repo.
- MEGA blocks from Blue Sea's 5001 drawing: 103.38 x 38.1 x 41.87, two round M5 holes
  on 88.58. The brief had 130 x 45, M6 and 20 mm slots.
- Bus bars from the listing photos: 150 x 27 x 36 with a lift off cover, so no swing
  zone. The brief had 35 wide with a flip cover.
- Switch from the listing photos: 63.5 square, 73.7 tall, studs inside a hollow back.
  Cables leave through the side pads by default; a setting puts two grommets under it
  instead. Slots run diagonally on 52 centers.
- Tie slots at 32 pitch and grid slots at 4.5 x 13 to hold the 12 mm web.
- Spacer: 6 mm flanges and 45 degree cones, so it prints with no supports.

## Cutting on the xTool MetalFab

The balanced panel is `samples/cabinet/plate_A_cut.svg` (or the `.dxf`), 530 x
370 mm, one cut layer in mm. It fits the 610 x 610 mm cutting bed. The file cuts
every hole first in back and forth bands, and the outline last, so the plate
stays held until the end. The smallest opening is 4.5 mm, wider than the sheet.

1. In xTool Studio, choose Cutting with fixture and pick aluminum at the sheet
   thickness.
2. Insert the SVG. Check the size reads 530 x 370 mm after import.
3. Add lead in lines. Keep the holes' lead ins inside the holes.
4. xTool lists 2 to 4 mm aluminum at over 1.2 MPa (about 175 psi) of
   compressed air or nitrogen with the ordinary nozzle. Confirm the shop
   compressor reaches that before cutting 1/8 in.
5. Cut a scrap test first: one 25.4 mm switch hole, one grid slot and one MC4
   slot. Check the switch fits and the slot edges are clean.

The MetalFab can't mark aluminum, so the engrave file (labels) is optional.

The configurator and the layout editor both have an xTool MetalFab SVG button.
Untick Cut part mounting holes to leave out the holes and slots that bolt the
components (MPPT, fuse block, bus bars, MEGA fuses, shunt, battery switch). Grommet
openings, switch holes, spacer bolts, GND and grid slots still cut. To drill
the mounting holes by hand, print the Drill template PDF at 100 percent, tape it
to the plate by its outline, and center punch each cross. Samples:
`plate_A_cut_no_mounts.svg` and `plate_A_drill_template.pdf`.

## Cutting on the CNC (1/4 in hex ply)

The CNC DXF button (configurator and layout editor) sorts every cut by the bit
size you enter, 6.35 mm (1/4 in) by default. Geometry stays at true size, so set
the offsets in VCarve:

- `OUTSIDE`: the plate outline. Profile outside.
- `INSIDE`: openings at least 1.2 bit widths across (grommets, switch holes,
  GND). Profile inside.
- `DRILL`: round holes too small for the bit (spacer bolts). Drill toolpath, or
  drill by hand.
- `TOO_SMALL`: slots narrower than the bit (grid and tie slots, bus bar and
  battery switch slots). No toolpath; leave the layer off.

It follows Cut part mounting holes too. Sample:
`samples/cabinet_hex_ply/plate_A_cnc_6.35mm_bit_inches_no_mounts.dxf` (inches, for VCarve at CCM), with starting settings in `vcarve_settings.pdf`. The MPPT needs a
non flammable surface, so put aluminum sheet behind it on a wood panel.

## Parts to consider later

- DIHOOL DZ47-B63 32 A two pole DC breaker in a narrow enclosure, cable gland
  top and bottom. Body 120 mm tall, 180 mm with glands, 55 mm wide, two
  diagonal mounting holes. Not placed on any layout yet. Photo:
  `reference/dihool_dc_breaker_box.png`.

### Tested on the MetalFab (Nov 7 2026)

xTool MetalFab 1200 W, xTool air compressor, 2.2 mm (0.087 in) aluminum sheet.
Cut clean with these settings:

| Setting | Value |
|---|---|
| Mode | Cutting with fixture |
| Material preset | 5/64 in (2 mm, Ga.12) 5083 Aluminum |
| Thickness | 0.087 in |
| Gas, nozzle | xTool Air Compressor, SaveGas nozzle |
| Power, speed | 100%, 40 mm/s |
| Following height | 0.02 in |
| Duty cycle, frequency | 90%, 3000 Hz |
| Perforate before cut | on: 100%, 200 ms, 10 mm, 60%, 3000 Hz, 200 ms delay |
| Soft-Start | on, 5 mm at 5 mm/s (needs lead-in lines) |
| Kerf offset, tabs | off |
| Compressor target | 1.0 MPa |

Engraving on the MetalFab is capped at 20% power and 20% duty in Studio. 20%
at 10 mm/s, 2 passes, 150 lines/cm gave a light mark. Use the F2 Ultra for
dark marks.

## Not done

Uses plain controls, not the Tweakpane chrome of `molle_panel/`. Not cut or test fit. Status: draft.

© Ryan Mitchell — CC BY 4.0

## Printed grommets

Every grommet hole and slot gets a printed grommet, sized from the cut itself and the sheet thickness. Print in TPU 95A, flat side down, no supports. The profile: a 2 mm wall lines the hole, a 2.5 mm lip sits flat on the back face, the groove holds the sheet with 0.2 mm to spare, and the front lip rises at 45 degrees so it prints clean and squeezes through the hole from the back. Settings live in `PARAMS` (`GR_WALL`, `GR_LIP`, `GR_FLANGE`, `GR_CAP`, `GR_GAP`, `GR_FIT`). `GR_FIT` moves the groove floor out past the hole edge so the grommet presses against the cut. Tested Nov 2026 on 2.8 mm aluminum: the 1.5 mm lip pushes in by hand, 2.0 and 2.5 are too hard. At gap 0.2 and fit 0 it rattled: the 45 degree lip sags, so the printed groove runs about 1 mm wider than the file. A second fit test picked gap -1.0 mm (a 1.8 mm groove in the file) with fit 0.2 mm, now the defaults. Tested in TPU, Nov 13 2026. The configurator and the layout editor download them as one STL (Grommets STL); each `samples/<layout>/grommets_all.stl` holds every grommet for that layout, and `grommets.txt` lists the count of each size. Starting point, not yet tested on a printer.


Two types, picked in the configurator and the layout editor (Grommets):

- TPU, one piece (`grommets_all.stl`): the profile above, closed by a 0.8 mm
  membrane across the opening at the flange end (`GR_MEMBRANE`, 0 leaves it
  open). The membrane prints flat on the bed as the first four layers. Cut the
  slits with a razor blade once the cable runs are known: an X on round holes, one
  slit down the long axis of an oval with a short crosscut at each cable. A blade
  cut leaves no gap, so the flaps close around the cable. A raised 0.2 mm line
  on the membrane marks where to cut (`GR_GUIDE`, 0 leaves it off). The
  membrane is the default; the rigid type below stays open. The configurator
  and the layout editor export both TPU sets (Grommets STL, TPU membrane and TPU
  open), and each sample folder has `grommets_all.stl` (membrane) and
  `grommets_all_open.stl`. The `cabinet_trio` samples use the measured 2.8 mm sheet.
- ASA or PETG, front piece plus clip (`grommets_rigid.stl`): the front piece
  has a 2 mm flange on the front face and a 2.4 mm sleeve that lines the hole
  with 0.2 mm clearance. Behind the sheet the sleeve has a 0.8 mm groove. A flat
  1.6 mm C clip snaps into the groove from the side and holds the grommet. On
  the oval slots the clip is open at one end and slides on along the slot, so
  fit the P5 clip before the P7 grommet. Both pieces print flat with no
  supports, and the clip flexes along its layers. Use ASA behind the MPPT. The groove is sheet thickness plus 0.2 mm, so set the sheet thickness to the measured sheet before printing.
  Skip carbon fiber filaments: they conduct a little and wear on insulation.
  Settings: `GRR_*` in `PARAMS`. Starting point, not printed yet.