logoalt Hacker News

ElFitzyesterday at 12:09 PM2 repliesview on HN

> Placement is probably the big issue that needs to be solved now.

Would some sort of constraint-solving algorithm help with that? Something like (but not necessarily) Cassowary[0]? Maybe I'm misunderstanding what is meant by placement though; I don't have much domain knowledge in PCBs / electronics.

[0]: https://news.ycombinator.com/item?id=43362528


Replies

lambdaoneyesterday at 12:49 PM

I've written my own autoplacer/autorouter. Placement is where you put the components on the board, routing is how you shape the traces to interconnect them.

It does a pretty decent job on small hobby-project boards of ~40 components (which is my use case at the moment), and I'm working part-time in the background on scaling it further.

The resulting designs pass all the KiCad electrical and geometry checks. Granted, I've spent about a year working on this problem, and it's hard, but not that hard a problem, providing you can avoid falling off the exponential cliff by decomposing it into hierarchical subproblems.

Quick-and-dirty unsupervised whole-board synthesis from schematic takes about 5 minutes, longer if you want cleaner output with nicer-looking better-routed traces.

As others here have said, placing is the real problem to solve, and that's where the magic happens. Place the components right, and routing is a relatively easy loosely-coupled constraint programming problem, place them wrongly, and you will have to get used to seeing the word UNFEASIBLE in your log output.

show 2 replies
seveibaryesterday at 6:37 PM

We work on this a lot at tscircuit, and we've used cassowary (i.e. flexbox-style) constraint solvers. The issue with cassowary/flexbox is PCBs are not as uniform as webpages w.r.t. alignment, and often have a much less nested structure (3 layers) vs web pages which have many many nested layers. CSS grid-style constraints are a much better fit IMO, but we eventually settled on sequential optimal packing[1] for "seeding" a placement so that AI can get initial positions before working in a feedback loop. I like sequential optimal packing because it's very very deterministic and the constraints are specified pretty close to how a human would specify them

[1] https://blog.autorouting.com/p/sequential-optimal-packing-fo...

show 1 reply