2011 July 19

Designing a printed-circuit board

One of my projects for this summer is to learn to do printed-circuit board design.

Some of my constraints:

  • The software must run under Mac OS X.  I’m not getting a Windows machine.
  • The software must be cheap (or free).  This is a hobby, not a profession, and I’m not willing to pay the sort of prices that tools like Cadence cost.
  • The printed-circuit boards have to be cheap.  There is not much point in designing something if I don’t get it made, and I don’t want to spend huge amounts on designs that may turn out to be awful.

After looking around for a while, it seems like there is really only one choice for Mac users: the Eagle software from CadSoft.  (There may be some other choices in a few years—but none of the other Mac products I found seemed to be widely accepted.) There is a slightly crippled freeware version of Eagle (only 2 layers and 8cm × 10cm max size) which should meet my needs fine.

For the past several days, I’ve been learning to use Eagle and laying out a board to have 6 motor channels, each with up to 2.5A at 12v.  Some of the design is overkill (I could go to 36v by replacing the capacitors with higher voltage ones, and I could deliver up to 5A per motor, as long as I don’t exceed 15A total).

Eagle has been a struggle to learn to use—the user interface feels like it was frozen in the 1980s, with really awkward multi-click actions for everything.  The software reminds me a lot of  Magic, the free VLSI layout software written around 1982, except that Magic had a much nicer user interface.

All the functionality seems to be there in Eagle, but is hard to find—you really need to consult the 327-page manual a lot. Normal actions are not done in normal ways.  For example, to operate on a group of objects, you have to click on the tool you want to use, then on the group tool, then click-and-drag to select the group, then right-click to perform the action on the group—about twice as many operations as on a modern interface, and in a non-intuitive order.

When I say “all the functionality seems to be there”, I’m using a rather generous definition.  For example, if you make a mistake when defining a new packaging variant for a part in the library, there is no way to undo it.  You can start over from a backup file or create a new part with a different name and do all the work over.  There is no universal “delete” option (say by right-clicking to pop up a menu) that works for variants, and the command-line commands don’t allow removing packages from devices.

Copying subcircuits is possible (something I needed to do to make 6 identical H-bridge circuits), but you have to be careful—if you name any of the nets, it will short the nets together, since it has no way to generate unique names other than the automatic ones it generates.

It would probably cost a lot to redo the user interface into something like a modern program, and the number of engineers and hobbyists using PCB-layout programs is probably not a big enough market to justify the cost.  I am glad that it was a free version, though, as I would have felt really annoyed if I’d paid money for such an incredibly awful interface.

Despite the struggles to learn Eagle, I think I have finally gotten a design done.  It uses the whole 8cm × 10cm area.  At first, I had an incredibly difficult time packing everything in (and the freeware version of  Eagle doesn’t let you unplace things once they’ve been placed). After making some circuit design changes (removing the superfluous freewheeling diodes, for example, since they are included in the H-bridge chips I chose) and some packaging changes (using 3.5mm pitch screw terminal blocks, instead of 5mm pitch ones), managed to end up with room to spare.

At first I did tried doing all the routing by hand, then discovered the follow-me single-net router, then the autorouter.  It turns out that autorouter had no trouble completing, but I ended up hand-routing all the high-current wires anyway.  I didn’t see any way to tell Eagle which parts of the GND net needed to be fat wires and which could be skinny wires, for example.  A net has only one width, and the design-rule checker checks that width throughout.

Some little gotchas included that the default drill size for vias is smaller than the default minimum drill size for the design rule check.  Luckily I did a design-rule check very early, before I’d done much routing, so I could increase the drill size for the vias without having to rip everything up and start over.

Actually, I ended up doing the whole design almost from beginning to end three times, because of design modifications (getting rid of the freewheeling diodes, for example, or deciding to add headers for servo outputs).

My design now meets the default design rule checks provided by CadSoft, so it is time to see about getting it fabricated.  I looked into a few different PC board houses.  The one that the “PCB Quote” button in the software connects you to is ridiculously expensive (so I’m not even going to provide a link to them).  One that I’ve had recommended to me is Advanced Circuits at  http://www.4pcb.com, which has very low pricing, but does not accept Eagle files.  You have generate Gerber RS247X files for each layer and Excellon drilling files.

Eagle is capable of doing this, but once again the interface is incredibly clunky—luckily there are some scripts that automate the process, if you can figure out how to make them work.  I started working with one from SparkFun, described in the SparkFun Eagle tutorial, but it turned out not to work with the latest version of Eagle.  I had to compare it with the “cam” scripts provided with Eagle to see that the output now needs to include “%N” to generate the file names.

Once I got that sorted out, I could change the layers that were specified for the top silkscreen (I had designed the board to use tPlace, tNames, and tValues, while SparkFun just used tPlace) and generate the Gerber and Excellon files.

I’ve not yet figured out what Mac OS X tools there are for viewing Gerber files, to check to see if the conversion worked, but Advanced Circuits has a Free File Check option.  I submitted the files there and expect to get a feedback email either in half an hour or tomorrow.




  1. Thanks for taking the time to document all the details. I’m re-orienting myself from a research lab’s budget to a classroom’s, so I can no longer afford the suppliers and manufacturers I used to use. I look forward to hearing about the results.

    Re: specifying trace width — in some software packages, you can “lock pre-routes” to prevent the autorouter from tearing up what’s already there. If that’s the case, it may be possible to set the design rule for your widest width, select only the components and nets that require it, autoroute those, lock them in place, then change the design rule and autoroute the rest of the nets.

    You may have already done this, but it is also useful to hand-route the connections to decoupling caps, since the autorouter will sometimes use surpringly long traces to connect components that are right next to each other.

    If it makes you feel any better, the user interfaces for Cadence and Altium Designer (one of their competitors) are also insultingly bad. Poor human-machine interface seems to be pervasive in the industry.

    If you haven’t come across this trace width calculator, you might want to check it out. It accepts parameters for required current draw, acceptable temperature increase, etc. and solves for required trace width, resistance, etc.

    Comment by Mylène — 2011 July 19 @ 20:21 | Reply

    • More posts on this coming soon.

      Eagle’s auto-router automatically locks all preroutes. You have to explicitly rip up routing to get things re-routed. I noticed that power and ground got badly routed, so I did all those by hand, especially the areas where I wanted to do a flood fill with copper to get really fat traces (power buses to the 6 H-bridge chips).

      I used Cadence tools for VLSI design classes about 20 years ago and hated them. I hear that they have hardly changed since. The electronics industry puts up with some of the crappiest user interfaces in existence, and pays enormous prices for the privilege (Eagle is pretty cheap by comparison with most). I wish someone had built a PCB tool around the Magic layout programming—it has a much nicer interface.

      Thanks for the trace width calculator. I just checked the part of the board I was most worried about, and it looks like it will get too hot (they’re predicting a 50 degree rise for the half inch that is constricted). Damn, I’m going to need to move stuff around to make the ground line fatter.

      Comment by karplus — 2011 July 19 @ 20:53 | Reply

  2. […] got back the results of the free check of the design rules from FreeDFM.com that I mentioned in my earlier post, and there are a lot of […]

    Pingback by More on PC boards « karplus4arduino — 2011 July 19 @ 22:31 | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: