New KiCad Autorouter: PathFinder-Based PCB Routing Explained
Key Moment
- 0:00 Introduction: Why Build a Custom Autorouter
- 0:40 Demo Board & FreeRouting Results
- 1:50 Problems with FreeRouting (Right Angles & Vias)
- 2:44 Running the New Autorouter
- 3:12 Comparing Results on First Board
- 3:42 Routing Only Selected Nets
- 4:58 Autorouter Options Overview
- 5:42 Testing on Arduino Leonardo Board
- 6:37 FreeRouting on the Complex Board
- 8:33 New Autorouter Results (Much Better)
- 9:42 DRC Check & Remaining Issues
- 10:38 How the Autorouter Was Built
- 11:52 Partial Routing & Placement Iteration
- 13:00 Final Demo & Closing Thoughts
What This Video Covers
This video introduces a custom KiCad autorouter developed using the negotiated-congestion PathFinder algorithm, demonstrating how multi-pass routing can resolve PCB layout conflicts more systematically than conventional autorouting tools. Unlike traditional workflows that export Specctra DSN files and import routing sessions, this plugin operates directly within KiCad or through the command line, allowing engineers to route selected nets or an entire PCB.
The demonstration explains how A* search calculates routing paths, how congestion history and present routing costs encourage nets to find alternative paths, and how directional preferences, bend penalties, and via costs influence routing decisions. It also shows real-time routing visualization through heatmaps, browser-based displays, and GIF exports.
For engineers preparing designs for PCB prototyping, understanding routing constraints early can reduce layout revisions before fabrication. Similarly, designers working with multilayer PCBs need to consider layer utilization, via placement, and signal routing priorities. Once the layout is finalized, PCB fabrication requirements should also be considered to ensure the design can be manufactured reliably.
Key Highlights
- PathFinder-Based Multi-Pass Routing: The custom KiCad autorouter uses negotiated congestion to redistribute overlapping nets across multiple routing passes instead of relying on a single shortest-path calculation.
- A* Search With Adjustable Routing Costs: Routing decisions account for congestion history, existing net usage, layer direction preferences, bend penalties, and via costs.
- Visual Routing Analysis and Manual Optimization: Engineers can monitor congestion heatmaps, identify unrouted nets, prioritize critical connections, and refine automatically generated tracks before fabrication.
How the New KiCad Autorouter Differs from FreeRouting
KiCad users have traditionally relied on external autorouting tools such as FreeRouting to automate PCB trace connections. This workflow typically involves exporting a Specctra DSN file from KiCad, processing the board in the external router, and importing the resulting session file back into the original PCB project.
Although this approach can automate many connections, it has limitations when dealing with complex layouts. Routing patterns may contain excessive bends, dense areas can become difficult to resolve, and some copper connections may require additional inspection. Automatically generated tracks also do not necessarily reflect the designer's priorities for critical signals, power distribution, or routing aesthetics.
The custom autorouter demonstrated in this video takes a different approach by integrating directly into the KiCad workflow. It can be launched through a toolbar button or command line, and engineers can select individual nets or process the entire board. This reduces the need to move repeatedly between separate applications.
Another important difference is routing transparency. Instead of treating autorouting as a black-box operation, the plugin displays the routing process as it happens. Engineers can observe the search wavefront, congestion patterns, tentative tracks, and optimization progress. This makes it easier to understand why particular nets are difficult to route and where layout adjustments may be necessary.
Original Source: https://www.youtube.com/watch?v=XbzPrRnQ-lk
Watch the original video on YouTube.
FAQs
Q1: Is the new KiCad autorouter better than FreeRouting?
A1: The custom KiCad autorouter offers a different approach to PCB routing by using a multi-pass PathFinder-based algorithm with negotiated congestion. It also provides routing heatmaps and progress visualization. FreeRouting remains a useful established option, while the custom implementation is still experimental and requires further testing on different board designs.
Q2: Can the KiCad autorouter route an entire PCB automatically?
A2: Yes. The demonstrated plugin supports routing all nets or only selected nets. However, successful completion depends on component placement, routing density, available copper layers, and design constraints. Critical signals may still require manual routing.
Q3: Why does a KiCad autorouter leave some PCB nets unrouted?
A3: Unrouted nets commonly result from insufficient routing space, component placement issues, existing copper obstacles, via restrictions, or competing connections. Reviewing the affected routing area and adjusting placement or routing priorities can help resolve these problems.
Q4: Does automated PCB routing guarantee signal integrity?
A4: No. Autorouting primarily addresses physical connectivity and pathfinding. It does not independently guarantee impedance control, signal integrity, crosstalk performance, or suitable return paths. High-speed and sensitive analog connections require additional engineering analysis and verification.
Q5: Should engineers use autorouting for production PCB designs?
A5: Autorouting can be useful for completing non-critical connections and accelerating PCB layout development. For production designs, engineers should combine automation with manual routing of critical nets, DRC verification, signal integrity checks, and manufacturer-specific DFM review.
Welcome back. Today we're looking at a new autorouter I put together for KiCad. It's something I've been working on, and it runs right inside KiCad with a toolbar button, or you can run it from the command line. It can route all the nets or just the ones you select, and the nice part is it shows you what it's thinking while it works.
First, a quick look at free routing. It's what a lot of people use with KiCad. You export a Specctra DSN, run it, and bring the session file back. It works, but it has its quirks. It likes 45-degree angles, it can leave floating grounds, and on denser boards it sometimes struggles. That's what got me thinking about building something different.
So here's my custom autorouter. It's a multi-pass router based on the negotiated-congestion PathFinder algorithm, the same kind of thing used in FPGA routing. Pass one is simple: every net just takes its own shortest path. That means they pile on top of each other. You can see the yellow squares where everything is fighting for the same copper. Each later pass raises the price of contested copper. The orange heat is the congestion memory the router has learned. Nets that have alternatives move away. On the right you can watch the overuse curve fall toward zero.
It uses A* search for each connection. The cost of a cell is one plus history, times one plus a present factor times the other nets already in that cell, plus direction factors—F.Cu prefers horizontal, B.Cu prefers vertical—plus bend and via costs. It only allows 0° and 45° turns. After each pass it updates the history on overused cells and increases the present factor so contention gets more expensive. It also checks pours: a pad only counts as connected by a zone if it actually sits inside that zone's outline.
You can watch the whole process. There's a browser view in the plugin, or you can use matplotlib, or export a GIF. You see the A* wavefront, the tentative tracks, the overused cells, and the learned congestion heatmap. For selected nets or the whole board you can choose to remove existing tracks first, or keep them so the router treats existing copper as obstacles and connected pieces as single terminals.
On more complex boards it still needs help. Placement matters a lot. If things are packed too tight or the critical nets aren't prioritized, it can leave some unrouted. The router will tell you which net is stuck and suggest how to free it. The workflow I like is iterative: route the critical nets by hand or with tight constraints, let the autorouter finish the rest, then clean up anything that looks ugly. It straightens routes at the end, turning zig-zags into straight or 45-degree segments using only free cells.
Compared to just throwing a board at free routing and hoping, this one gives you more visibility and control. It's still an experiment more than a finished product, but the code is up on GitHub if you want to try it or improve it. That's the new KiCad autorouter, IMSAI Guy style. Thanks for watching.