Discussion:
Anelok: towards KiCad 4
Werner Almesberger
2016-01-15 15:00:19 UTC
Permalink
This is a somewhat long story about the journey towards KiCad 4.
This journey is still not over, but I'm beginning to feel that it
may have a destination that is not a circle.


It all began with an Ubuntu update last December. My 14.04 LTS
("Trusty") was getting long in the teeth, so I thought it was time
to upgrade to "Wily" 15.10. Alas, when trying to trick the upgrader
into going from LTS to non-LTS, I ended up with "Xenial", the
experimental 16.04.

This caused a number of problems, e.g., Chromium failing to do SSL
with Google services (but getting along with most of the rest of the
world), and Xfig becoming very eager to segfault, but eventually I
solved all that.

However, one big problem remained: KiCad. I had been using an older
version of KiCad (I think it was bzr 4150), but some of the libraries
it depended on were no longer available under Xenial.

As it happens, new and shiny KiCad 4 (bzr around 6400) had been
released recently. Since holding on to an increasingly distant past
is usually not the most sustainable of plans, I decided to try moving
on and to welcome the new.


The first thing I tried was to see how pcbnew performed. When I had
poked at newer KiCad versions before, I had always experienced
extreme slowness in the "legacy" canvas. The OpenGL canvas was snappy
but lacked (and still lacks) some of the functions available in
"legacy", so one has to switch back and forth between the two.

To my dismay I found that "legacy" was still slow. Worse, I found
that eeschema had adopted the new zeitgeist, and had become
unbearably slow as well.

This did not look good at all. In the past, when people reported
poor graphics performance of KiCad, their complaints were brushed
aside with the argument that developer time was precious and they
couldn't waste time on supporting slow hardware.

I had used weak video cards in the past since most of what I do is
2D anyway, and I'm already replacing broken fans way too often, so
I prefer my video cards to be without them. So I had accepted that
my hardware may just not be elite enough.

But I recently had to replace a failing ATI card with a more modern
Radeon HD 2400, which is even sufficient for some games. So was that
*still* not good enough to draw a few lines in KiCad ?

After a bit of searching I found this bug report
https://bugs.launchpad.net/kicad/+bug/1003859

Lo and behold, disabling EXAPixmaps did the trick, and both eeschema
and pcbnew's "legacy" canvas both returned to decent performance.

[ I could have sworn I had written about the EXAPixmaps problem
before. But I can't seem to find a trace of it. Maybe that mail
was somehow lost without me ever sending it. ]


The next problem I hit was that the title block (the info box on the
bottom right) of schematics sheets has grown considerably. So now it
overlaps with a good part of the circuit.

The solution for this is to define one's own page layout. There is a
tool for this, called "pl_editor". I made a page layout that is
reasonably close to the original version:
https://gitlab.com/anelok/anelok/blob/master/common/eeschema-layout.kicad_wks

I still may adjust it some more to match exactly the old version.
Then I'll move it over to the eda-tools repo.


This solved the most glaring issues with eeschema. I made some
changes to the schematics (replaced the slider with tactile switches),
then launched CvPcb to update the footprint associations. This was
instantly rewarded with all hell breaking loose.

CvPcb cheerfully informed me that the old definitions had to be
replaced, and offered to lend a help with that upgrade. Of course,
this didn't work.

So I manually created the new footprint table and copied over the
libraries from anelok.pro:
https://gitlab.com/anelok/anelok/blob/master/hw2/fp-lib-table


Alas, CvPcb wasn't completely satisfied with this either, and only
picked up a tiny number of footprints. I had to redo all the rest of
the associations. (The main change seems to be that footprint names
are now prefixed by the name of the library they come from, e.g.,
"0402" is now "stdpass:0402".) Oh well, fortunately Anelok isn't all
that big a circuit ...

At the end of this, I could delete anelok.cmp. All the information
in it now seems to be contained in the netlist.


There may still be surprises in eeschema, and I haven't really tried
pcbnew yet, but I'm beginning to feel more confident about that
migration to KiCad 4.

The benefits of using KiCad 4 include:
- easy installation from pre-build distribution packages,
- files compatible with what other people are likely to use,
- access to the CERN push router in pcbnew, and
- scripting capabilities.

I have high hopes for the push router. And the scripting may give us
back the automation for which Wolfgang had added command-line options
so many years ago, but that was lost after incompatible changes to
the internals of KiCad.

To be continued ...

- Werner
Bas Wijnen
2016-01-16 02:30:11 UTC
Permalink
Post by Werner Almesberger
This is a somewhat long story about the journey towards KiCad 4.
Ah, this is interesting. Perhaps you have some tips for me as well.
Post by Werner Almesberger
The first thing I tried was to see how pcbnew performed. When I had
poked at newer KiCad versions before, I had always experienced
extreme slowness in the "legacy" canvas. The OpenGL canvas was snappy
but lacked (and still lacks) some of the functions available in
"legacy", so one has to switch back and forth between the two.
My main problem with OpenGL is that for some reason it doesn't draw any
circles. So the traces look like a collection of rectangles, round pads are
completely missing, and oval pads are thin rectangles. My guess is that my
graphics card is too old, but it also uses the radeon driver, so you may know
something I don't.

The card has two outputs and shows up in lspci as:
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV370 [Radeon X600/X600 SE]
01:00.1 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] RV380 [Radeon X300/X550/X1050 Series] (Secondary)
Post by Werner Almesberger
To my dismay I found that "legacy" was still slow. Worse, I found
that eeschema had adopted the new zeitgeist, and had become
unbearably slow as well.
I've never seen slowness of the legacy mode. I do agree that I switch between
them (legacy and cairo; not seeing circles is unacceptable), for deleting
entire traces (cairo defaults to deleting only a segment).
Post by Werner Almesberger
After a bit of searching I found this bug report
https://bugs.launchpad.net/kicad/+bug/1003859
Lo and behold, disabling EXAPixmaps did the trick, and both eeschema
and pcbnew's "legacy" canvas both returned to decent performance.
I just tried this, and I don't notice any difference. Is there any reason to
keep it disabled, or to enable it? A search for exapixmaps suggests that I may
want to keep it disabled; there are a lot of problems with it on radeon.
Post by Werner Almesberger
At the end of this, I could delete anelok.cmp. All the information
in it now seems to be contained in the netlist.
Yes. In the old version that was also possible (or at least pcbnew had a
switch for getting the info from the netlist; that switch is now gone), but now
it's the only option.
Post by Werner Almesberger
I have high hopes for the push router.
It is indeed nice (although cairo mode is slow, which is especially annoying
with the push router, which doesn't work in legacy mode). However, for some
reason they didn't enable it by default. So you need to go to
Preferences->Interactive Routing, and set Mode to "Shove".
Post by Werner Almesberger
And the scripting may give us back the automation for which Wolfgang had
added command-line options so many years ago, but that was lost after
incompatible changes to the internals of KiCad.
Oh, I didn't know they added scripting support. That could be useful.

Thanks,
Bas
Werner Almesberger
2016-01-16 03:21:30 UTC
Permalink
Post by Bas Wijnen
My main problem with OpenGL is that for some reason it doesn't draw any
circles.
Interesting. No problems with that here. Tried filled pads,
non-copper circles, solder mask around circular pads, and trace
ends if in outline mode. All the circles and discs look right
in OpenGL.
Post by Bas Wijnen
(legacy and cairo; not seeing circles is unacceptable),
Oh, Cairo. That is where things get painfully slow for me, again.
Perhaps the reason for having three different canvas modes is that
one has a better chance to find at least one that works ;-)
Post by Bas Wijnen
Is there any reason to
keep it disabled, or to enable it?
KiCad is the only program where I noticed a problem with having the
EXAPixmaps enabled. I have problems with the pixmaps of tooltips
in Chromium being shifted (and thus partially garbled) on my Radeon,
which may or may not be related to EXAPixmaps being turned off. But
just closing and re-opening the tooltip corrects this, so it's not
too much of a nuisance.
Post by Bas Wijnen
Oh, I didn't know they added scripting support. That could be useful.
If you get KiCad from bzr, there are two examples in
kicad/demos/python_scripts_examples/

It's a little chatty, but better than nothing.


Some more quirks I found with KiCad 4, all still in eeschema:

- one line drawing inexplicably moved, and in another one, a line
segment disappeared. Strange.

- now that all the footprint data moved into the schematics, any
previously empty "Footprint" field that had visibility turned on
will proudly display the footprint name.

- the rendering quality of text is a little worse than it used to
be. Maybe we lost anti-aliasing.

Next: work up the courage to run ERC.

- Werner
Werner Almesberger
2016-01-17 16:22:16 UTC
Permalink
Post by Werner Almesberger
Next: work up the courage to run ERC.
That was painless. (Or, rather, not more painful than usual. It would
still be nice if one could save the ERC setting instead of having to
tell KiCad each time that tristate and power can be mixed, etc.)

There is a different quirk, though: some of the component labels have
developed a migratory instinct. Here is an example:

Loading Image...

The big component selection dialog shows that "POWERED" should be in
the middle of the rectangle. This is also where KiCad used to show it,
and still does (left symbol on the right), if the schematics have been
originally drawn with an older version.

However, if adding a new "POWERED" symbol fresh from the library, KiCad
seems to ignore the field positions and uses defaults, as shown on the
very right.

I've also seen this with other symbols, though in many cases it's less
obvious. Not entirely sure what the pattern is, though.

- Werner

Loading...