Why are we humans still wasting our time doing a crappy job at manually routing printed circuit board traces? If a computer can beat the best Go player on earth, surely it can route a mess of traces better than idiot me!
Let’s try out a few of the latest and greatest auto-routing programs to see how useful they are routing my new board!
A new PCB for the Blinks gaming platform. It is basically an Arduino with RGB LEDs for blinking and IR LEDs for communicating. This new version adds a Service Port so developers can talk to their programs at 0.5Mbs while debugging (way cool, right?!).
Many (but not all) components on the board must be in fixed locations:
I’m guessing it would take me at least 10 hours to manually route this board, and I would be grumpy the whole time, and I would not be happy with the results because I demand better quality than I have the skills or time to be able to produce.
Topographical routing with smoothly curved, minimal length traces. Sign me up!
This is what TopoR looks like while routing….
Look at all those crazy topographically guided spiderwebs! After about an hour of my CPU blowing at full blast while I watched cat videos, TopoR suggested that it had done about all it could do. It presented a layout with every trace routed and not a single design rule violation…
Wow! I do so love the optimal directness of the traces! This is a nice route!
I am a little concerned about the way the traces sometimes connect to the corners of the LED pads. Will this make them harder to inspect after reflow? We’ll see! Maybe there is a way to turn this off, but I can’t find it.
Here are the numbers…
After seeing this output, I was ready to buy TopoR. Even if it only worked on this design, it would have already paid for itself. Unfortunately, it seems to be hard to buy. You have to register on the website to place an order, and the registration doesn’t seem to work. Grumble. I will report if/when I am finally able to buy it!
Conclusion: TopoR is very, very cool and gets so much so right. It gave me a usable (actually excellent!) design with only a couple minutes worth of work on my part. I’ll try on future designs to see if the magic lasts, and will report back here!
Shape based, optimal routing solution adapting to the natural flow of the nets while following advanced DFM and timing constraints. This is what I’m talking about!
This is ELECTRA whilst routing…
This first time I ran it, it finished in a couple of seconds with 12 unroutes. Not a good default behavior! So I bumped up all the the iterations so it would at least try.
Here is the best route it could come up with after about 15 minutes…
Not bad looking from afar, but there are still 4 unroutes! Looking closer, one of them is a silly no brainer. Really computer, you couldn’t figure this one out on your own?…
The others, not so easy. Everything is totally walled into a corner, with no obvious way out. It would have taken hours and hours of doing large parts of the route over to get everything connected.
Conclusion: Give me reasonable defaults – or at least ask me what I want. Don’t give me an almost finished route where you do all the easy parts, leaving me to try and clean up your seemingly unroutable mess. No value, at least for this board.
As far as Windows EDA goes, I am a Diptrace fan. While Diptrace is far from perfect, at least it doesn’t continually punch me in the face like EagleCAD does.
Diptrace has an autorouter baked in, and it is only one click away. I picked “shape-based”. It looks like this while routing…
After about 10 minutes of taping and ripping, it passed back this route…
There are two unroutes… but they are far from deal breakers. There were visually obvious paths for each of them, even to a stupid human like me. Why would it leave these easy ones for me? Just to make me feel invested in the process?
It only took about 5 minutes to manually complete the board and I had a working layout with no design rule violations.
I think took another 45 minutes or so to do some optional clean up, like pulling in the corners of wide turns to shorten the traces, and straightening the kinks out of twisted segments around the angled LEDs. The computer should have done all this for me in an automatic last pass that might have taken a couple milliseconds.
Here are the final the numbers…
Not bad, and if I had not already seen the TopoR results I would have been very happy with this route and the amount of time it took to get there.
Conclusion: Considering it is free (either with Diptrace you buy or the free version) and so fast and easy, there is value here. While it took a little time to get a usable design and even more time to get a decent design, either way saved me many hours compared to manual routing and probably I ended up with a better result.
The real FreeRouting mysteriously disappeared from the web many years ago, but has recently resurfaced in many places and many forms. I tested this version that seems to have been well cared for recently.
The real promise of FreeRouting is that it is open source, so if you don’t like something about it, you can fix it. Let’s see if it offers a good starting base for that!
It looks like this while routing…
After letting it do it thing all night, we ended up with this hot mess…
Hundreds of rule violations and lots of unrouted nets. Hmmm. This is not promising.
Conclusion: Unless I picked a really wrong fork, or I am doing something else something terribly wrong then this autorouter is not useful.
What I Really Really Want
While TopoR and (to a lesser extent) DipTrace are useful and time saving tools, what I really want is an autorouter that always does a better job than the best human router and takes no human time to do it.
We need to give the router more freedom.
Freedom of location. In this design, I only care where the LEDs and button are placed. All the other parts could be moved to pretty much anywhere they will fit. There is currently no way to tell this to the autorouter.
Freedom of rotation. The RGB LEDs could be rotated to any angle as long as the centroid stays in the same place. Imagine how much better the router could do if it was not locked in to these arbitrary fixed angles!
Freedom of connection. In this example, each LED pin could have been connected to almost any GPIO pin on the chip. Big EDA systems like Altium have limited pin swapping abilities, but I want more. I should be able to state my connection constraints like this…
Which means “You can connect either pin of IR3 to any of the following pins on U1: 1-23, 26, or 29”.
Now I’d also add…
IR3-1.endPoint != IR3-2.endPoint
Which means “…but the two pins of IR3 must be connected to different pins on U1.”
Now designing a circuit board becomes more like writing a program, and the autorouter is more like a compiler/constraint solver than an interactive CAD tool. Besides spitting out the board design files, it would also give me header files to include in my firmware so it would know which pins ended up connected to what.
Next I’d want the autorouter to be able to run headless from a command line so I could launch hundreds of parallel instances on a cloud computing platform like AWS or AppEngine. I’d enter my circuit constraints, hit “compile” and then watch as all the instances spun up and started delivering better and better routes until one met all my constraints.
How would this crazy complicated, highly dimensional topological multi-constraint solver actually work?
I have no fricken idea. I’m not smart enough to write it. Maybe no one is. But that’s ok.
Computers have recently gotten very good at teaching themselves how to find solution paths though astronomically huge search spaces defined by geometry and arbitrary rule sets. Amazingly good at it.
We can let our autorouter teach itself how to do autorouting and it will likely come up with strategies we could could have never imagined (and we might not even understand when we see them).
With all this freedom and smarts, we should see much much better boards than possible now. Imagine today’s standard 4 layer boards routinely being fit into 2 layers without any human effort. Think how much time and money that will save!
How to make $100,000,000
- Write the kernel of the above self-learning, constraint solving autorouter.
- Train it long enough that it is an order of magnitude better than any human.
- Use your new autorouter to re-process a few famous open-source boards. Publish (and even start selling) a single sided Arduino and 4-layer Raspberry Pi. People will notice. Bask in the Hack-a-day & Slashdot glory.
- Start offering a cloud-based service were anyone can upload their Electra DSN files. Let them optionally click on some parts to indicate they can be moved or rotated if they want an even better result. Then do a smash-up job autorouting the board and tell the person about the results… but don’t give them the actual output files until they pay up. “Congratulations! We were able to reroute your board from 12 layers down to 8! Click here to pay $25,000 and download your SES file!”.
- Sleep well at night knowing that you never ever let your magic IP free in the wild. People only download their output files, your software and weights never leave the safety of your cozy servers.
- Wait for the phone to ring. It is Autodesk/Google/Apple/Amazon. They want to buy you for $100,000,000.
- Agree, sign the paper work, fly to NYC (private) and buy me a cup of coffee.
So this is happening…
I submitted the above PCB to their service but got back only a partial route, with a promise that it will do better after they fix an internal error.
I will report back any news here!
Q: So what’s this article about?
People say autorouters will never be better than humans, and only wimps use autorouters and they get crappy layouts. Those people are wrong. Using TopoR, I got a much better layout than I could have done by hand and saved probably a dozen hours of work. Soon, autorouters will always do a better than humans on all routes – and I have some ideas on how to make that happen better.
Q: What versions of software did you use?
- TopoR 8 Layer 6.3.17786 (x64)
- DipTrace 3.1 (May 29, 2017)
- Electra Demo Version 6.30
- /freerouting release 1.3.0
Q: Do you work for Emerex or something?
No, and they won’t even seem to let me register for an account on their website so I can buy the damn program. I never even heard of TopoR up until recently – I found it by lucky google search. But I have been looking for (waiting for?) it for a long time. I am going to buy it as soon as I figure out how.
Q: I am trying to follow your instructions to make $100,000,000, but I can not afford the compute time on AWS to do the enforcement phase training since I am only 12 years old and am living in eastern Europe.
Just do the same thing you did last time.
Q: My mother said I am not allowed to write GPU cycle stealing worms anymore. She also made me give the Corvette to my uncle. :(
If you can really convince me that you are on the right track to training up a neural network to do first class autorouting, get in touch and I will make sure you have access to whatever resources you need to take the next steps. Note that this means that you will only make $75,000,000 because I will take 25% of the company, so try really hard to do it yourself first.
Q: Why didn’t you try [tool x]?
Either because (1) [tool x] is Eagle and I hate getting punched in the face, (2) [tool x] costs more than a car and doesn’t have a trial version, so I don’t have it, or (3) I don’t know about [tool x].
If you have access to [tool x], please run the DSN file for this board here and send me the SES file so I can report back on how awesome/awful [tool x] is!
Q: You set all the settings wrong when testing [tool x], no wonder it sucked for you.
See above question. Please rerun the file with your favorite settings and LMK how it does!
Q: I could have done such a better manual route than your stupid program.
I don’t think you can, but even if you can- why would you?
Q: I’ll only ever buy “Designed By Humans” products, and you should too or they’ll come for your job next!
You will need to get used to buying inferior and more expensive stuff soon, and eventually you will only be able to be crappy old stuff on ebay.
And they will definitely come for your job first.
Q: If you let a computer layout your circuits, then anyone can copy your boards and you can’t stop them.
Q: Every time I did like you said and got TopoR and let it run for like 20 hours and it made a great route, but now when I try to import the SES file back into DipTrace, it just kinda blinks… and then nothing. I am ready to kill myself.
A: Yea, the “DipTrace” profile on the TopoR export settings turns out to not make files liked by DipTrace, and DipTrace’s way of puking on those files is completely unhelpful. Here are the settings that actually work…
I got back the first batch of the TopoR routed boards… and they work perfectly!
I may have manually routed my last board ever, folks – and I have no nostalgia for all those countless hours I’ve wasted in the past!