Stitching layers between copper zones in KiCad

I’ve been working a bit with KiCad lately and have run into a problem in PCBnew with “stitching” (i.e., adding vias between) filled zones on top and bottom layers. This is something you typically do if you have flooded the unused spaces on both top and bottom of your board with copper and have connected the floods to ground or some other reference.

The KiCad FAQ outlines a process for doing this, and it works fine until you refill (i.e., re-pour) the zones — or the DRC refills them for you. When the zones are refilled, the vias you added for stitching become isolated from the zones and end up as little pads floating in space.

The problem and a workaround was discussed in a recent thread on the kicad-users mailing list. I wanted to summarize here the workaround in a slightly less terse way:

  1. Route the board and define your zones as you always have.
  2. Fill the zones as you always have.
  3. Select “Add tracks and vias” from the toolbar on the right.
  4. Click on an existing pad that’s connected to the zone’s net, drag the pointer a little bit to create a short track, then either (a) right-click and select “Place Via” or (b) type the ‘V’ shortcut.
  5. To add more stitching vias, continue to drag the pointer and type ‘V’ where you want to drop vias (or right-click and select “Place Via”).
  6. When you are done placing vias, hit the ‘End’ key on your keyboard (or right click and select “End Track”).

You can repeat this as many times as you want to create different clusters of stitches. When you refill zones, the vias will retain the connectivity information and work as expected.

LTspice and tube models

Linear Technology’s LTspice is becoming quite popular among audio circuit designers, both professional and amateur. There is a lot to recommend it, but there is at least one issue that is crucial to be aware of if you are planning to use vacuum tube or other third-party models based on arbitrary behavioral voltage or current sources. And that is: LTspice’s implementation of arbitrary behavioral voltage or current sources is not completely SPICE 3 compatible.

In particular (from the LTspice help files),

LTspice uses the caret character, ^, for Boolean XOR and “**” for exponentiation. … This means that when you import a 3rd party model that was targeted at a 3rd party simulator, you may need to translate the syntax such as x^y to x**y or even pwr(x,y).

I ran into exactly this issue when experimenting with SPICE 3 versions of my own tube models.

DIY: PCB layout tools


Update [2012-01-05]: WinQcad hasn’t been updated since May of 2011, and email enquiries to its author (who has always been very responsive to me) are going unanswered. For these reasons, I can no longer recommend it. I really hope the situation is a temporary one.

Because of the situation with WinQcad, I decided a few months ago to adopt KiCad as my primary PCB design tool. My reasons for choosing KiCad include:

  1. It’s free and open source software and enormously popular–meaning that it’s not likely to go away or suffer from midstream licensing changes.
  2. It works well on Linux (my main OS for several years now) as well as Windows. It’s reported to work on OS X as well.

It’s main drawback (for me) is the lack of a really good autorouter. The built-in one isn’t that useful. Many people use the router, but (a) it hasn’t been updated in quite a while–leaving its future status in doubt and (b) unlike KiCad itself it’s not FOSS (though it is gratis). There is a project underway to build a standalone autorouter that is compatible with KiCad, and I hope this project succeeds.

I am also using gerbv a lot for inspecting Gerber files. gerbv is part of the gEDA initiative.

I am currently working on laying out a printed circuit board for a client that is pretty dense (the board, that is, not the client). I don’t make a living off PCB layout work, so it doesn’t make sense for me to buy a mega-thousand dollar package like those offered by Cadence, Mentor Graphics, Pulsonix and the like. However, the boards I do can be fairly complex and so require pretty decent tools to support the process.

Fortunately, there are a number of low cost and open source tools that can be used to obtain professional results. (Check here for a comprehensive list of cheap and not-so-cheap tools.) A bunch of years ago, I went through a round of evaluating them, and I eventually settled on a little-known package called WinQcad. More recently, I decided to use my current project as an opportunity to re-evaluate some of the latest offerings, and the conclusion that I reached is that still nothing beats WinQcad.

Like most PCB development tools, WinQcad has a pretty steep learning curve, but it makes the entire process of schematic capture through generating production files at least as simple as any of the other solutions. However, the real deal-clincher for WinQcad is that it has hands-down the best autorouter of the bunch. Most of the autorouters I have tried fail to route even fairly simple boards, and when they succeed, they often make some very “interesting” routing decisions. In contrast, I have yet to encounter a design that WinQcad’s autorouter couldn’t handle and do a good job of as well. I can’t begin to tell you how much time and stress WinQcad’s autorouter has saved me.

You can download a free pin-limited version for small projects or evaluation purposes, and a 1000 pin license costs only $300. Highly recommended.

While WinQcad has a large library of parts and land patterns, in many cases you may still need to develop your own. To help you with this, the IPC and PCB Libraries, Inc. offer a free program that contains full specifications for standard IPC-7351A land patterns. This program is part of a larger suite sold by PCB Libraries that has all sorts of other things to help you develop land patterns; but if you are patient and are working with standard packages, this freebie will serve you well. PCB Libraries makes another subset of the suite available for free as well to help you with non-standard land patterns.

Another tool you will need if you plan to have your boards professionally made is a Gerber file viewer. Never, ever send Gerber files off for manufacturing unless you have used a viewer to confirm that they are ok. I recommend ViewMate from Pentalogix and GC-Prevue from GraphiCode. The user interfaces of these programs can be obtuse, but they get the job done.



I have more than a little sympathy for DIY loudspeaker builders, because that is how I got my start. I think I was about 10 when I built my first speaker with some scrap plywood and a 5-1/4″ driver that my brother gave me. How time flies…

The hobby itself can be quite seductive, especially if you have some woodworking skill. It seems like it’s a pretty straight-forward matter to build a box, buy some drivers, mount them along with a crossover or something, and then have a system that looks great and costs less than the commercial equivalent. However, once you start you will realize that good speaker design is actually a very complex affair. It only seems easy because of the relatively few parts that are involved. But I will let you discover all that for yourself–it’s part of the fun. If you do decide to go down the DIY path, you will do yourself a favor to have modest expectations at the start, and be prepared to get sucked into something that can take over your life if you let it.

Here are a few resources I recommend for the DIYer. Most of these will be known to experienced builders, but if you are new to the area you may not know all of them.

Drivers and other parts

Madisound Speaker Components is one of the best sources of drivers and other parts (capacitors, inductors, etc.) for both the DIYer and for small manufacturers. They have consistently been my first choice for supplying Biro’s own needs. Their service is top-notch, personal, and has never let me down.

Parts Express is another good source of drivers and parts. Professional service and good parts selection. It may be a small thing, but their selection of cabinet ports is quite good.

I have experience with Solen Electronique and MCM as well and cannot complain about either.


If you don’t like the idea of making lots of sawdust, Parts Express’ finished cabinets are really hard to beat. I have used these for some prototype projects, and the workmanship and finishes that I have seen have been really good. Madisound has a similar line of cabinets. While I expect that they are of similar quality, I have not actually seen any of these so I cannot say so with any certainty. (Madisound also sells a line of cabinets made by Woodstyle in California that some people really like, but the link shows nothing at the moment. I don’t know if that means they have been discontinued or if it’s just a bug in the website.)

Design information

If you are looking for information to help you decide what driver to use in your next project, Zapf Audio has a wealth of information to help you. John “Zaph” Krutke’s attention to detail in his measurement and methodology is admirable, as is his enthusiasm for sharing his findings. In addition to driver measurements, John has published a number of complete designs at his site. I have not heard any of them; however, they appear to have been thoughtfully and competently designed. While I don’t agree with the prioritization of all his evaluation criteria (perhaps the subject of a later post), I do have a ton of respect for his opinions, and they have enhanced my outlook. I have never met or exchanged email with John; in spite of this I feel comfortable saying that he is one of the few voices that are really worth listening to in the DIY speaker hobby realm.

Design software

You will need design software. And not just for cabinet design. You can’t really build a good system without software to help you with measurement and crossover design. While everyone seems to have their favorite in this area, I think LspCAD from IJData is just fine.


If you want good results, you must measure the performance of the drivers you have chosen in the cabinets that you will use them in. Because of the varying diffraction effects from different cabinets, you cannot use the measurements from some other source in your design. And you should never trust manufacturer data. Sometimes published curves are from preproduction prototypes, sometimes they are outright lies, and very rarely is enough information given about test conditions to let you extract useful information.

To measure your drivers you will need a microphone with a very flat and/or calibrated frequency response. Some DIYers build their own using Panasonic omnidirectional electret elements–some of which are incredibly flat. The only problem with this approach is that while the flattest of the Panasonic omni elements are quite flat, when all is said and done you may still be left with as much as 3dB error in the audio band. In my opinion, that’s not good enough. A few people make and sell complete mics using these elements and provide you with calibration data as well. This is the approach I recommend. The ones made by Kim Girardin at Wadenhome Sound are very good and very affordable. I’ve known Kim for several years as a result of our association with the Upper Midwest Chapter of the AES. He has real enthusiasm for the field and is one of the nicest people you are likely to encounter in the audio world. You may be able to plug one of Kim’s mics directly into the Mic input of your computer soundcard, but for the best results you will want a preamp with a controlled polarizing voltage. If this is the case, the Mitey-Mic II (or MM2) is a classic.

Most mics based on the Panasonic elements have simple two-conductor outputs and are meant to be interfaced to soundcard “mic” inputs or something like the Mitey-Mic II. If you want an instrumentation mic with a more conventional balanced output (and using +48V phantom power), the Behringer ECM8000 looks interesting. I have never seen one of these in real life, so it may actually be utterly poopy. But the specs and price look decent.

Laptop issues

While the soundcards in desktop PCs are usually good enough for making usable speaker measurements, laptop soundcards tend to, er, suck. I have been using Behringer’s tiny and cheap UCA202 USB soundcard with my laptop when I need to make measurements with it, and the results have been just fine. It uses decent 16-bit TI/Burr-Brown converters, and the headphone output is particularly useful for making impedance measurements and is the main reason I use it rather than similar USB devices. (Look here for some test results.) Don’t mess around with the packaged ASIO driver–just plug it into your WinXP machine and let it use WinXP’s built-in USB audio drivers. If you absolutely, positively have to have ASIO with this guy, I recommend ASIO4ALL.

In closing

I regret that I don’t have time to respond directly to DIY questions. If I don’t reply to your inquiries or address your question here, please don’t be offended. With this post I really just wanted to offer what little support to hobbyists that I can. And as time allows, I will try to post other tips and suggestions.