Posts | Comments

Planet Arduino

Archive for the ‘Kicad Tutorials’ Category

Feb
27

Kicad Tutorial: Gerber file generation

kicad, kicad tutorial, Kicad Tutorials, open source, pcb Commenti disabilitati su Kicad Tutorial: Gerber file generation 

This is part of a series of short tutorials on advanced topics of using Kicad, the favorite schematic/PCB design software here at Wayne and Layne.

Once you’ve finished working on your PCB and are ready to send it off for fabrication, one step remains: “Plotting” the PCB design to Gerber files. The Gerber file format is a very old format with its roots in the 1960s, and is used to completely describe a single layer of a PCB design. You need to generate one gerber file per layer of your PCB design (Copper, SolderMask, and SilkScreen, for both the top and bottom sides, plus the PCB Edges layer). The information about where the holes are drilled, and what size the hole should be, are stored in a separate file with a different format, called the Excellon format, named after the market leader in CNC drilling machines during the 1980s.

To generate the gerber and drill files for production, click on the Plot toolbar button in PCBNEW. It is located in the top toolbar and looks like a printer with a “P” overlaid. This brings up the plot dialog box. (Click to enlarge image.)

gerbers_01_plot

Here, ensure that the “Plot format” is “Gerber”. Leave the “Output directory” field blank, and it will default to saving the files into the project directory. Make sure you check all the layers you want to send to production. If you didn’t use back-side silkscreen, or don’t want to use any back-side silkscreen (some places charge extra for that), you can un-check the B.SilkS layer. The other checkmark boxes are the defaults, but ensure that “Exclude PCB edge layer from other layers” and “Use proper filename extensions” are checked. Press “Plot” to generate the files, one per layer. You will see output in the “Messages:” box at the bottom. When that is finished, click “Generate Drill File” to bring up the next dialog box. (Click to enlarge image.)

gerbers_02_drill

Again, leave the “Output directory” text field empty. The settings here are very important, especially the Drill Units (Inches), Zeros Format (Suppress leading zeros), and Options (Minimal header). You absolutely must check “Minimal header” and un-check “Mirror Y-Axis”. Since we aren’t making a drill map, the “Drill Map File Format” option doesn’t matter. Click the “Drill File” button to generate the drill file. Then press “Close” and “Close”.

Now you can zip up the generated gerber/drill files and send them off for fabrication. At Wayne and Layne, we really like the prototype PCB fabrication services from OSH Park. They describe themselves as

This is a community printed circuit board (PCB) order. We take designs from lots of people, put them all together on a panel and then order the panel from a fab. Since we’re all splitting the panel setup cost, this lets us make circuit boards inexpensively.

This service grew out of the DorkbotPDX PCB Order run by @laen and now comprises of a two-layer panel every other day, a four-layer panel every three weeks and a periodic two-layer medium run service for people needing more than 150 square inches of board.

They have very inexpensive rates, decent production time, and very high-quality output. Plus, the gold and purple boards just look very nice! Here are the details about pricing and design rules (minimum clearance and trace width, minimum hole size, etc).


Other tutorials in this series:
Feb
27

Kicad Tutorial: Using the autorouter

kicad, kicad tutorial, Kicad Tutorials, open source, pcb Commenti disabilitati su Kicad Tutorial: Using the autorouter 

This is part of a series of short tutorials on advanced topics of using Kicad, the favorite schematic/PCB design software here at Wayne and Layne.

Routing, the process of connecting all the pads of a printed circuit board (PCB) layout, can be a time-consuming and tedious process. To avoid the time and frustration of manually routing your PCB, there are various software tools called autorouters which can do this for you. This post will show you how to use the external autorouter from the FreeRouting website.

First, ensure that you have selected the proper trace thickness and clearance values in Kicad’s PCBNEW application, by going to “Design Rules”->”Design Rules”. Once you have confirmed the design rule settings, press the “traffic sign” icon in the top toolbar to bring up the FreeRoute interface.

autorouter_01_button

The three buttons on the left will let us export the DSN file that is input to the autorouter, launch the autorouter application, and finally import the SES file that was exported from the autorouter. To start with, press the top button on the left, “Export a Specctra Design (*.dsn) File”. This will open up a file save dialog box, and you can just accept the filename as the default filename is correct.

autorouter_02_export_dsn

Now, click the second button to launch the autorouter. This utilizes the Java Network Launching Protocol (JNLP), which downloads a small XML file that is used by your Java system to download the rest of the autorouter. You may see a browser window open up briefly when the JNLP file is downloaded. Chrome gives a warning about the file type, you can press “keep” to retain the file for use. Your browser might do the Right Thing with the .jnlp file, and open it with Java. If not, you can probably double-click the downloaded freeroute.jnlp file to launch it, or on Linux you can type “javaws freeroute.jnlp”. When the Freerouter window opens up, click “Open Your Own Design”.

autorouter_03_load_own_design

Due to the Java security restrictions, unsigned applets downloaded from the web are not trusted very much, so you have to give it permission to read files on your machine. For whatever reason, on my computer it won’t let me check “Always allow this action”, so it asks me every time.

autorouter_04_read_warning

Click “Allow” and then navigate to select the .dsn file you exported from PCBNEW earlier. Click on “Open” and it will load your design.

autorouter_05_select_dsn

When your design has finished loading (which may take a minute or two) all you need to do is to click the “Autorouter” button, then sit back and watch the magic happen. The autorouter will do an initial route, then go through a series of optimization steps to try and reduce the number of vias used, as well as trying to reduce the total trace length.

autorouter_06_autoroute

You can wait for the optimization steps to finish, or you can click once in the board area to interrupt the optimization if you are in a hurry, or the results are already good enough.

autorouter_07_done_routing

When you are satisfied with the routing, use the “File”->”Export Specctra Session File” menu option to save the routing results to the .ses file. You will likely get another security warning, click “Allow” to continue. Navigate the file system to where you found the .dsn file, and save as the same filename but with a .ses extension.

autorouter_08_save_ses

In PCBNEW, select the third and final button on the left. It will open a file select dialog box, and it should already have selected the .ses file you just exported from the autorouter. Accept the filename and Kicad will load the file into your design. It will ask if you want to reload the board connectivity. I’m not exactly sure what this means, but I always click “Yes”.

As a side note, some people dislike autorouters, considering their own manually-routed designs to be superior, and there’s some truth to that feeling. Sometimes the autorouter makes silly decisions, sometimes I can spot ways to route things different and save a via or two, but generally I prefer to let the autorouter have a go at it, then clean up the results.


Other tutorials in this series:
Feb
26

Kicad Tutorial: Copper pours / fills

kicad, kicad tutorial, Kicad Tutorials, open source, pcb Commenti disabilitati su Kicad Tutorial: Copper pours / fills 

This is part of a series of short tutorials on advanced topics of using Kicad, the favorite schematic/PCB design software here at Wayne and Layne.

A copper pour or fill refers to an area on a printed circuit board where the original copper is not etched away, and remains in place, usually electrically connected to the Ground signal, producing a “Ground Plane”. This has a number of advantages, including decreasing the amount of etching fluid required during manufacturing, as well as reducing the amount of electrical noise and signal crosstalk experienced by the circuit elements.

It is relatively easy to create a copper fill in Kicad. We usually add fills after having already drawn in the PCB outline in the Edges layer. First, ensure that you have selected one of the copper layers (such as “Front” or “F.Cu”). Then, select the “Add Filled Zones” from the toolbar on the right side of the screen.

Select Tool

Next, click in one corner of the PCB outline to start drawing the copper fill.

Click board corner

Once you click in the first corner, the following properties box will appear. Select the relevant copper layer (here, either “F.Cu” or “B.Cu”) and the desired net for the fill (usually you want “GND”, but sometimes you might want some other net, or “<no net>” which will make an isolated copper fill). The settings in the bottom half are important for controlling the drawing of the filled area as well as the “thermals”. One potential problem with adding ground fill is that the ground pads will become very difficult to solder, as the ground plane will suck away all the heat from your soldering iron, and the pad won’t ever heat up hot enough for the solder to flow. To avoid this problem, you almost always want to add “thermal relief” to your ground pads, which means there is a keep-out area adjacent to each ground pad where there is no fill, and instead each ground pad is connected by a number of thinner traces. This still provides a very good electrical connection for the ground pad, but makes it much easier to solder. The “Clearance” setting controls the general clearance between the filled area and pads/traces of other nets. The “Minimum width” setting controls the thinnest that the fill can be when flowing around other pads/traces. The “Thermal Reliefs” settings control the clearance around the ground pads (0.040″ here) and the width of the traces connecting from the fill to the ground pads (0.009″ here). We’ve found these settings to work pretty well for most of our projects. You also want to select “Arbitrary” for the “Outline Slope” setting to make it easier to draw the zone outline. Click “OK” to close this window and continue drawing the fill outline. (Click the image to enlarge)

Zone properties

Once you have closed the zone properties window, click once in each of the other three corners (in order) on the board outline. Then, to complete the final segment, double-click on the original corner to end the zone. You should see red or green hatching (depending on which copper layer you used) on the edges of your PCB indicating the filled region, as shown in the image below.

Outline hatching

Generally you want to have a copper fill on both the top and bottom of the PCB. To add the fill on the other side, the easiest way is to right-click on the existing board edge, select “Zone outline”, then go to “Zones”->”Duplicate Zone”. This brings up the zone properties box for the new zone, so select the other copper layer and press “OK”.

To see the copper fills in your design, click on the “Show filled areas in zones” button, the 10th button in the left-size toolbar. The button below that will hide the fills. Then, you can run the DRC tool (Ladybug Checkmark in the top toolbar) which will fill all your zones. You should see something like the image below. The brown-yellow color is the combination of red (top side) and green (bottom side) copper fills. We can see the 20 mil clearance between the fill and non-ground copper, and the larger 40 mil clearance between the fill and GND pads.

Finished fills


Other tutorials in this series:
Feb
26

Kicad Tutorial: PCB edges

kicad, kicad tutorial, Kicad Tutorials, open source, pcb Commenti disabilitati su Kicad Tutorial: PCB edges 

This is part of a series of short tutorials on advanced topics of using Kicad, the favorite schematic/PCB design software here at Wayne and Layne.

An important part of designing a PCB is to clearly indicate the outline of the board, so the board house will know how to cut your boards apart. Most PCBs are rectangular, but sometimes you want to add a more complex outline (like a circle or hexagon) or a very complex outline (like the PCB for the Video Game Shield, shown below).

vgs_complex

To make it easier to determine where the PCB edges should be, you probably watch to switch your cursor to be the full-screen cross, by clicking the cursor toggle button in the left-most toolbar (6th down from the top).

edges_2_cursor_switch

Then, select the “Edge.Cuts” layer from the list on the right side of the screen. Select the blue dashed line toolbar icon to draw graphic lines in the Edge.Cuts layer. Using the full-screen cross cursor, it is easy to find the corner of your design. Make sure to leave a little bit of clearance between the outer-most components and the PCB edge. Click to start drawing the edges, and click once in each corner of the PCB. Double-click to end the drawing.

edges_3_layer_corner

If your edge lines are not very thin, we suggest reducing their width. Right-click on each line (you might have to zoom in to ensure that your mouse cursor is pointing at the yellow line itself) and select “Edit Drawing”. Then, change the Item and Default thickness values to be 0.001″ each. We feel that this reduces confusion with the board house as to where exactly the board should be cut (“Inside of the thick line? Outside of the thick line? Middle of the thick line?” With a thin line there is no ambiguity.)

edges_4_settings


Other tutorials in this series:


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook