Tensorflow based autorouter

I would love to write a sketch router for KiCad.

Very nice feature. What’s your ideas on how to fit it in the existing UI?

Maybe the simplest starting implementation for this feature would by to find pads/vias within some distance from starting and ending points of sketched line, then intersect two sets of nets and try to connect them so that it would resemble the line drawn.

Tricky part here is if one tries to route a bus (for example SPI) from MCU to several slave nodes the traces might start twisting all over the pcb like crazy, probably need to limit traces length difference somehow.

This aspect might become easier with the planned implementation of smarter busses in Eeschema. Once that gets hammered out, make room in the PCBnew data model for that information for a bus based autorouter to recognize similar grouping and apply impedance matching and line length rules.

@davidsrsb I agree in part; the auto-routing problem isn’t just the routing part, it is placement + routing. The problem I have with “experienced humans are much better at…” is that this is a true statement considering the current state of the art, not the future state. Most (all?) inventions started out rather humbly and did not greately enhance ones abilities or comfort. But it is the continuously nibbling away at the hard edges that makes the big difference.

In my opinion, placement and routing is a boring boring job. Yes, for small designs and if not done too often it can feel therapeutic but repetion boredom sets in quickly. Additionally, mistakes can be costly. That combo is an ideal job for an algorithm. All such problems eventually are done automatically. So therefore, I’d say this is teritory for development.

However, I cannot quite agree with @threelegs to use Tensorflow. It might be the right tool, or it might not; the tool should not pick the problem. I think it would be great to work on clearly working out the problem domain, stating the most ideal outcome and working how to get from a to b. I dont think this is a “lets throw Tensorflow at it and look its solved” problem.

2 Likes

I have put a lot of thought into it and I think what I really want is a vertically integrated system between the PCB layout and the schematic. I get the best layouts when I move the pin configuration around on MCUs and other components with generic pins. What we need is a “sticky” label that you can toggle if it can be moved to another pin on the component depending on the placement of the components on the PCB. This would vastly improve any auto routers performance.

Thanks for your detailed post!

for autoplacement, the smartest way you could probably begin it would be singling out what groups of components have the most unique interconnections, pretty much if an IC has 40 passives that mostly connect to this IC and 2 voltage rails, you can begin clustering those components to reduce the total amount of traces that will have to traverse the rest of the board.

the behaviour from your Pads video is very close to the CERN efforts for interactive push and shoove. Pads PCB is the small sister from Mentors Xpedition PCB. The push & shoove algorithm is from a russian programmer who sold the code to Veribest in about 1996. Veribest integrated this in a product called “advanced router” what nothing did but interactive routing. Later the complete tools kicked out the Bentley Microstation universal CAD (what was required for that plugin) to build the Xpedition toolsuite. In first years the interactive push & shoove was awfull instable and caused crashes all few minutes probably becouse of heap/stack allocation bugs. From about 2003 the feature went stable and PCB sold as Pinnacle without Microstation. Later Mentor aqcuired PADs becouse of the shocking license fees for the big toolset and finally it copied the interactive push and shoove also to the small sister.

I am going to make a video from further push and shoove capabilities with components and traces. Even todays Altium cannot shoove traces by pushing components and vice versa. Moving a component like balls on the billiard table is still a missing interactive feature more worth than any autorouter (and autoplacement) feature. In comparison to chess algorithms, routing algorithms seems less developed. I am using high end routers for over 30 years but prefer interactive routing for best results. Most time I do the joke: When design finished 100% by interactive routing, I delete all traces and start the autorouter. There is rarely over 80% when autorouter ends. All autorouters I know, depend from preferable trace direction per layer. With interactive routing, most time I do not respect that rules, mainly at boards edge. For time critical projects a good attempt is finishing up to over 90% or less than 50 open traces, then start the autorouter for finishing. Most time autorouters finish the remaining lines much faster than interactive routing. The lower quality of those lines (e.g. more vias used) does not hurt much for the end stage of design but blocks progress in early stages

I doubt that AI helps for routing becouse rules for routing are well known in comparison to typical AI things like face recognition or music track separation. Learning a neuronal net would required to feed too much sucessfull layouts and too much associated electronics and functional background knowledge for the design what even human cannot recognize only watching the board. Best way to practice routing for humans is to start with a single layer design only using variable length wire jumpers. This sharpens view for the problems with lower complexity. Later moving to double layer design will finish most things using the new layer. Thats what we did former times with pencil and paper. What todays autorouters seems missing, is a continiued weighting of existing rules in dependance of several complex but well described environement situations of the board. There are certain situations where the efforts to solve next open line increase by square instead linear. From this moment it can bee foreseen that nothing ends successfull and strategy should be changed.

Efforts for autoplace seems futil. There are too much rules to announce e.g. for connectors or poti and more mechanical restraints. High end tools have this but I never used. Maybe AI is a good trick to sell any licenses to unexperienced pcb desingers but that feature seems not useful for Kicad. Good interactive features will be much faster until I see something commercial to convice me

5 Likes

Very much agree on this one, if is placed well, routing will be made much easier. Space is usually the constraint to allowing a good functional placement. Some rules need to break and bend to allow things to happen.

For easy access, the independend Keras project is now part of tensorflow. Another possibility to try try yourself even more easy is the Google neuronal network playground

https://developers.google.com/machine-learning/crash-course/introduction-to-neural-networks/playground-exercises

Everything graphical runs on browser without installing and invoking compilers.
Another attempt is lurking in the Nvidia Jetson forum

there is more and more hardware what executes tensorflows calls directly (e.g. Lattice)
Possibly routing has more in common with algorithms for chess ?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.