Maybe a bug between KiCAD and freerouting.jar?

I’m a newbie for KiCAD. KiCAD is a nice EDA.
I’m trying to draw a layout with KiCAD 5.1.9. I have all footprint created.
And I tried to make an auto-route by “Freerouting.jar”, I found that it can never be finished.
Then I take a deeper look, I found that a component’s footprint seems changed, the footprint itself can’t fulfill the clearance in design rules already.
Picture to show the difference between KiCAD (PCBnew) and freerouting.jar:
https://drive.google.com/file/d/1S9OTtOBV6EntK4Eg2Hs4Qksf5TpjT-IM/view?usp=sharing
PCBnew file of my foorprint:
https://drive.google.com/file/d/1E0VWMeLk7YFEWYezQs2iXWobY5aPZmQP/view?usp=sharing

Anyone can advise me any solution?

Looks like freerouting bug.

You can try temporarily changing those weird pads to standard ones, do routing in freerouter then change them back and possibly fixup some traces.

I’ve had an infinite loop error in freeRouting before but I forgot the exact situation. I think it boiled down to the fact that I had a DRC error or an overlap of pads or tracks in pcbnew and once that was that fixed, the problem went away.

oh, after I changed the 4pads to regular sharp, I can see it display fine in freerouting.jar.
But after I click started autorouting, it still can never be finished.
I see from the bottom of the window:
The number next to “Pass” is kept accumulating (now is up to 81xxx)
The number next to “to route” is kept changing between “0”, “1” and “2”
The number next to “failed” is kept changing between “0”, “1” and “2”
sign…

https://drive.google.com/file/d/1wCwXiRPOu-Vif50WThaI6IdTitvX4Wux/view?usp=sharing

That usually happens when you have clearance rules that prevent some nets from connecting to some pads. You can stop the autorouting, import mostly routed pcb back to kicad and see what fails to connect. Likely you will have to tweak clearance and then just manually connect the few remaining traces.

It can also be because autorouter is dumb and routed itself into a corner it can’t get out of but it’s pretty rare.

after I import the semi-finished layout (.ses file) back to KiCAD, I found that there’s via close to the pad (the rectangle pad of the ratsnest), the via makes no trace can be routed from the pad to its left hand side (under the trace and clearance rules).
After I moved the via lower, then I can finish the layout.
Something ridiculous is: the via is placed by the auto-route…

Or maybe I didn’t aware something wrong I made.
If anyone can spare time to give it a try, and then let me know the result?
https://drive.google.com/file/d/1wCwXiRPOu-Vif50WThaI6IdTitvX4Wux/view?usp=sharing

Beginners with PCB design sometimes seem to have the misconception that an “autorouter” is some kind of magic tool. You draw the schematic, press a few buttons, and then your PCB is finished.

It does not work that way. Just do a general search and read a bit about the opinions of autorouters.

Even after 50 years of PCB design apparently nobody has been able to make an autorouter that “just works”.
Usually there are a lot of constraints (such as placement of decoupling capacitors and their routing to the power pins, quality of GND plains, mixed digital & analog PCB’s with both noisy and sensitive signals and many more) that simple autorouters can not handle properly.

Some more powerful routers apparently exist, but these require some specialized knowledge because of their complexity and it also takes a lot of time to set up properly. And after that you still have to thoroughly inspect the PCB for mistakes it may have made and correct them.

If you hand-route a PCB, you consider and judge special conditions for each and every connection. Most are easy, some are not.

Autorouters can be useful tools. Especially because they can lay down a lot of tracks quickly. But if you use them as a beginner, you miss an opportunity to learn about signal integrity, EMI, quality of decoupling and a lot of other details that are essential to a properly designed PCB. I’d say it’s much better to first learn to design a proper PCB by hand, and only after you have learned to design a proper PCB go back to autorouters, and try and see what they make of it. Many “professional” PCB designers never use an autorouter, because fixing the mistakes that autorouters make can easily be more work then routing the PCB manually in the first place.

I once read a story about a PCB designer who looked at a 12 layer auto routed PCB and then contacted the company and told them he could route the PCB manually on 8 layers and pass EMI tests, for a hefty sum. At first they did not take him seriously, then did some calculations and he got the job on a no-cure-no-pay basis. He finished the PCB and got his money. The company was happy too because it saved them a lot of money on production costs for the PCB.

2 Likes

Perhaps you have a stray trace joining copper on each side belonging to the same net which might be of zero length and therefore invisible in the rats nest? freeRouting will then attempt to join the pads with a via. The only time I caught freeRouting going in a loop was when, as I said, I had errors on the board before exporting. Was it you who indicated that you fed it a partially routed board? Generally if it doesn’t make progress from one round to the next you have managed to confuse it, no need to wait more than a few rounds of looping. Also when starting freeRouting, do not accept the default of reloading the saved settings at the first popup dialog, particularly if you have changed any design parameters. The cached settings may be wrong.

I made a manual route without error. (The design rule I set is loose)
Then I used “global delete” to delete all traces and zones. (I also posted the PCB file)
So I suppose there shouldn’t be any trace on the PCB.

I think making an auto-route on the PCB should be easy (lot of space and easy design rule). So I think maybe I made some mistake somewhere, and hope I can find it out soon, or if anyone can tell me.

Thanks for your information.
Agree with you that we can’t compare auto-route with a experienced engineer’s manual route.
I made a manual route by KiCad. When I want to evaluate its auto-route (I found that KiCad doesn’t provide auto-route itself, its document refers to use freerouting.jar). I “global delete” all the traces and zones, so only board outline and components’ placement are left. But the auto-router can’t finish all the connects for me.
Before I conclude it, I want to see is there any stupid mistake(s) I made during my operations, so I posted the PCB file.

I don’t expect it can provide a workable PCB layout, but providing a layout with all connections meet design rules should be feasible from my point of view.

The reason why autorouting is appealing is the physical routing can be daunting… going from a 2d abstract representation of the design in the form of a circuit, to a 3d representation in connectivity can be a massive step to those who have no experience.

The funny thing is, the placement is very important and if time was spent thinking about the optimum placement and orientation then manual tracking suddenly becomes less daunting as there is a natural flow.

It is of course perfectly all right to experiment a bit with an autorouter, get some experience and compare results.

In addition to Naibs remark about footprint placement. This is indeed a very important step of the PCB design. Just try a simple circuit and then deliberately botch the footprint placement so footprints in the upper left corner have to be connected to the lower right corner and the lower left corner has to be connected to footprints in the upper right corner…

Good footprint placement needs some experience, and you get the necessary experience from routing manually. You do not gain much experience in footprint placement by pushing the buttons of an auto router.

I would not describe PCB design as daunting. It can be overwhelming to beginners, but if you get the hang of it, then it becomes a challenge and fun puzzle to solve. It’s a much more interesting puzzle then laying colored pieces of cardboard next to each other on a table.

I took a video on what I did:

  1. manual route without error in DRC
  2. global delete of trace and zone
  3. export to “freeRouting.jar”
  4. start auto route which can’t finish the last trace
  5. export back to KiCad
  6. moved via and finish the last trace manually
  7. DRC without error
    https://drive.google.com/file/d/1SwwS3eFhBe8arCgs_v-DF6vV8mtg21ds/view?usp=sharing

Anyone can see what I did wrong which cause freeRouting.jar can’t finish all the connections?

just found that I keep posting the wrong link.
The PCB file should be:
https://drive.google.com/file/d/1SShy0CgmVh0EotymQv8ySUP4iPoXSRLn/view?usp=sharing

I loaded your board, exported the DSN, and then ran it through freeRouting. It halted with this message after a few seconds of routing:

2021-03-19 20:30:50.577 [Thread-0] WARN eu.mihosoft.freerouting.FreeRouting - This board was already evaluated, so we stop autorouter to avoid the endless loop.

I went ahead and exported the SES file anyway and loaded it into pcbnew, then ran DRC. There was one unconnected item.

** Found 1 unconnected pads **
ErrType(2): Unconnected items
@(126.121 mm, 74.200 mm): Track 0.250 mm [/PB_DM] on B.Cu, length: 1.619 mm
@(126.430 mm, 73.550 mm): Pad A7 of J4 on F.Cu and others

So you have probably hit a bug in freeRouting where it cannot handle the last unrouted connection. It also seems that you are running an older release where the infinite loop was not detected and aborted. But freeRouting is not part of Kicad so nobody here can give you help with it. You should report the problem on the author’s Github site: https://github.com/miho/freerouting

It’s highly unlikely to be a KiCad export/import issue. The DSN is just a dump of the nets, and the SES contains the resulting tracks. Those are file formats not particular to freeRouting.

Retiredfeline
thank you for spending time on my issue, and provide detail reply.
:slight_smile:

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