diff --git a/docs/elements/copperpour.mdx b/docs/elements/copperpour.mdx index ef09d415..4b9b44c9 100644 --- a/docs/elements/copperpour.mdx +++ b/docs/elements/copperpour.mdx @@ -120,6 +120,7 @@ without changing the mesh spacing. | `traceMargin` | Minimum distance from traces on other nets. Overrides `clearance`. | `"0.1mm"` | | `boardEdgeMargin` | Minimum distance from the board edge. Overrides `clearance`. | `"2mm"` | | `cutoutMargin` | Minimum distance from board cutouts. Overrides `clearance`. | `"0.1mm"` | +| `unbroken` | Reserve the pour region during autorouting so other nets' traces can't split it. Same-net pads then connect to the pour with a via instead of traces. See [Keeping a pour unbroken](#keeping-a-pour-unbroken). | `true` | | `useThermalReliefs` | Connect same-net plated holes through four thermal spokes instead of solid copper. | `true` | | `outline` | Optional polygon describing a custom pour boundary. | `[{ x: -10, y: -8 }, { x: 10, y: -8 }, ...]` | @@ -185,6 +186,50 @@ explicit pours with a fanout routing phase: See [``](./autoroutingphase.mdx#terminate-power-connections-on-copper-planes) for details. +## Keeping a Pour Unbroken + +By default the autorouter treats a pour's layer like any other, so it can +connect same-net pads with traces and run other signals across the pour area. +Set `unbroken` to reserve the pour region instead. The autorouter keeps other +nets out of it, and each pad on the pour's net connects with a short trace and +a via down to the pour. + + ( + + + + + + + + + + + + + + + + + + +) +`} +/> + +Here U1's and C1's ground pads each get their own via, and no signal crosses +the bottom layer. Without `unbroken`, the same board joins the ground pads +with traces on the top layer instead. + ## Tips for Effective Groundplanes - Keep sensitive signal traces short and route them over solid groundplane diff --git a/docs/guides/tscircuit-essentials/placing-components-for-autorouting.mdx b/docs/guides/tscircuit-essentials/placing-components-for-autorouting.mdx new file mode 100644 index 00000000..2eb79173 --- /dev/null +++ b/docs/guides/tscircuit-essentials/placing-components-for-autorouting.mdx @@ -0,0 +1,154 @@ +--- +title: Placing Components for Autorouting +description: >- + Get cleaner autorouted boards by placing parts in the right order, pointing + connected pins at each other, and fixing placement instead of fighting + routing. +--- + +import CircuitPreview from "@site/src/components/CircuitPreview" + +The autorouter can only route the placement you give it. When a board comes out +with long detours, extra vias or failed connections, the cause is usually where +the parts sit, not the router. Move or rotate parts, rebuild, and check again. + +## A Placement-First Workflow + +Place a few parts, check how they route, and only then place more. Work from +the parts with the least freedom to the most: + +1. **Fixed parts.** Connectors, buttons, LEDs, knobs and mounting holes are set + by the enclosure and the user. Place them first. +2. **Critical circuits.** High-current paths, switching regulators, decoupling + capacitors, crystals and sensitive analog parts. Keep these loops small and + place them before anything else crowds them out. +3. **Everything else, in functional groups.** Keep each block (power, + microcontroller, sensor, outputs) together, and arrange the blocks so + signals flow in one direction across the board. A + [``](./using-groups-for-pcb-layout.mdx) lets you move a block as one + unit. +4. **Route, check, adjust.** Build, look at the result, and go back to + placement whenever a connection is forced to be ugly. + +## Point Connected Pins at Each Other + +Rotate parts so that pins connected to each other face each other, and keep +the same pin order on both ends of a bus. A reversed order makes every +connection cross every other one. + +In this board, J2 is rotated so its pin order runs opposite to J1's. The +autorouter needs vias and a second layer to untangle the crossing: + + ( + + + + + + + + +) +`} +/> + +Rotating J2 to match J1 gives four straight traces on one layer, with no vias: + + ( + + + + + + + + +) +`} +/> + +The same applies to chips. If a chip's output pin faces away from the part it +drives, try rotating the chip by 180° and moving its passive parts to the other +side. + +## Place Decoupling Capacitors and Ground First + +Put each decoupling capacitor right next to the power pin it serves, before +placing other parts around the chip. For ground, a solid pour on one layer +with [`unbroken`](../../elements/copperpour.mdx#keeping-a-pour-unbroken) +lets every ground pin connect with a short via instead of long traces, and +keeps other signals from cutting the plane apart. + + ( + + + + {/* decoupling capacitor next to the VCC pin */} + + + + + + + + + + + + + + + +) +`} +/> + +## When to Move Parts Instead + +Go back to placement when you see any of these: + +- A connection detours around a large part of the board or needs several vias. +- The same two groups of connections keep crossing each other. +- A decoupling capacitor or high-current loop ended up far from its chip. +- Routing errors stay in the same area after small changes. + +Small placement changes can change the routed result a lot, so it is worth +trying a few variants (a different rotation, a part moved by 0.5–1mm) and +keeping the one with the fewest errors and vias. + +## Checking a Layout + +Build a PCB image to look at the routing, then run the checks: + +```bash +tsci build --pcb-png +tsci check placement +tsci check routing-difficulty +tsci check shorts +tsci check pcb-style +``` + +`routing-difficulty` points out congested areas before you spend time on them. +See [`tsci check`](../../command-line/tsci-check.md) for all checks. If the +autorouter itself fails on a reasonable placement, please +[report an autorouter bug](../../contributing/report-autorouter-bugs.md).