See the page http://www.delorie.com/pcb/bg-image.html at DJ Delorie's PCB HID website.
This is a great way to trace hand-drawn artwork or another PCB, say one you made in software with a proprietary format, which you'd now like to 'unlock'. Furthermore, you can use the background image as tool for making board revisions or redesigns.
If you don't like to use PCB confined to the area of the board, i.e. if you want margins around your board, then add them in the GIMP. I like to make a 1.00000 inch margin around the board. When you set your PCB size in PCB, you'll want to add the margin area. CTRL-M will help you verify the scaling. Also, the time to correct distortions from your scanner, or from your drawing is before you load it, in the GIMP or the like.
Question: I want to copy a section of my existing layout to another spot.
I can select the existing area. Everything turns pretty blue.
Buffer → Copy Selection To Buffer seems to succeed (no complaints).
Then I go to paste the copied area… and all that moves are a couple of traces and some vias. The pads I've painstakingly created aren't copied. What gives!?!?!?
Answer: If the silk layer is off, you can't copy elements through the paste buffer. Weird, but that's how it works.
Therefore, turn on the silk layer before trying to copy a section of a layout.
Use rectangles and polygon planes. These items will always avoid vias, pads and pins. Tracks are also avoided, if they have the clear polygons flag set (menu: Settings → New lines, arcs clear polygons). Since version 20070208 of pcb the resulting polygon will be one contiguous piece. Isolated snippets are removed.
Polygons are not “assigned” to nets, they're connected to them. Pads are the only carriers of netnames in pcb. This means, you need to design some copper to connect the polygon with a pad. The net of the pad automatically transfers to the polygon.
There are different ways to adequately connect different types of objects to a polygon:
- tracks: Set the join flag of the track.
You can do this with the J key, while the mouse hovers above
the track. Alternatively you can select the lines and apply the
command
SetFlag(selected,join)
. For new lines, you can uncheck theNew lines, arcs clear polygons
in the Settings menu. The polygon will immediately flow into the track. - pads: Currently, there is no way to directly connect a polygon to a pad. Draw a track without the join flag from the pad to the polygon (see above).
- pins and vias: Choose the thermal tool (THRM). Select the layer the polygon sits on. Shift-Click on the via to circle through the available styles of the connection.
- polygons: Just define them geometrically overlapping.
You didn't have New lines, arcs clear polygons checked in the Settings menu when you layed down the tracks.
Enter changejoin(selected)
in the command window to toggle this
flag for all tracks that are currently selected.
The keyboard shortcut to this action is Shift+J.
If you want to set or clear the join flag rather than toggle it, you can
use the commands SetFlag(selected, join)
and
ClrFlag(selected, join)
.
See the SetFlag description in the pcb manual for more details on these commands.
In pcb, the polygon itself has no built-in clearance. It is the tracks, pads and pins that bear this property.
This means, you can adjust the clearance individually:
- Make sure, the soldermask layer is not active. Else the following will apply to the soldermask rather than to the polygon.
- Press K to increase the clearance of the object under the cursor.
- Use Ctrl+K to increase the clearance of selected objects. Add the Shift modifier to decrease the clearance.
- To change a whole track press F to find all segments that are
connected to the object under the cursor and apply the action
select(connection)
.
The amount of the increment can be configured in the dialog File → Preferences… → Increments.
(Note, this setting is currently ignored)
The above only applies to one object at a time.
You can manipulate the clearance of all selected objects with the
action ChangeClearSize(Selected,<amount>,<unit>)
.
The parameter <amount> should be a number.
A prefixed sign means increment, or decrement.
A prefixed = sets the clearance to the following value.
The parameter can be mil or mm.
If not specified the units will default to the internal unit of 0.01
mil.
In addition, there is a special action that acts only on objects with
clearance below a given minimum: MinClearGap(Selected,<amount>,<unit>)
.
- Put the polygons (and rectangles) on a separate layer.
- Use the Preferences… dialog to make sure, this layer is not in the same group as the tracks.
- Disable the layer by a click on the corresponding layer button in the main window.
- After you are finished with the changes, use the Preferences… dialog to let the polygon layer join the layer of the tracks.
- You will have to save and reload the layout to trigger recalculation of polygons so they are adapted to your edits.
Alternatively a restart will recalculate the polygons too.
Parts of the polygon that are not connected to some net are automatically eliminated. This effectively removes dead copper. While this is desirable for the actual board, it requires calculation of quite extensive algorithms. So it is not necessarily a bug, but a price to be paid for a powerful feature.
Still, there is a couple of things you can do to improve the situation:
- Temporarily hide the polygons (see above).
- Choose Thin draw poly from the Settings menu to display only the outlines of the polygons and disable dead copper removal. In recent versions of pcb, i.e. later than September 2007, you can select through the polygons.
- Make sure, you don't have redundant polygons defined, which multiply overlay the same area. These polygons won't display because they shade each other. But they demand calculation resources. The best way to check for redundant polygons is to edit the source of your layout with an ascii editor.
Polygon calculation is potentially an expensive operation in terms of processor cycles. Unless your layout is pretty complex, you most likely have redundant polygons defined. Look into the source of your layout to find and delete unnecessary polygons.
If this does not apply, see above for possible measures to ameliorate the situation.
There are four basic ways to edit polygon outlines. You can move and delete vertices and you can insert vertices using two techniques. Polygons can be edited equally well in “thin line draw” mode (Settings → Thin draw poly) or in "normal mode". Moving a vertex is easily accomplished by un-selecting your polygon and then clicking and dragging that vertex to a new location. To delete a vertex, a corner in your polygon, put your crosshairs over the point and hit Delete on the keyboard. To insert a vertex, you’ll use the insert tool (Insert keystroke). Start by clicking the edge you want to split with a new point. Click and drag a new point into the polygon. A variation on this technique is:
- click to select, followed by
- click to place new vertex.
NOTE: Inserting points into polygon will generally work ONLY with “all direction lines” enabled (Settings → 'All direction' lines). This is because PCB has a powerful 45/90 degree constraints system. If you try to insert new vertices into a polygon that don’t fall onto lines of proper 45 and 90 degree constraints, PCB disallows the action !
How do I place vias that connect to a polygon for full thermal dissipation or full shielding integrity?
Often it’s useful to have vias connect completely to a polygon (a field of copper) for heat transfer – the apparent problem is that PCB polygons have only a single “clear pins/vias” flag for the entire polygon (toggled by the S key). Our goal is to only connect some of the pins/vias to the polygon, but to connect them better than a thermal does.
Here are a few ways to do this:
One way, you’ll make an object that’s almost just like a thermal in that it goes between your via and the polygon – the difference is that you’ll actually create an annulus to completely fill the space between the hole and polygon (which because it’s clearance is turned on, is not connected to the pin). This annulus is four arc segments. You can copy these four items to the buffer to create a “zero-clearance thermal tool”. The drawback of this trick is that when you change via size, you’ll also have to modify the size of these filler parts.
The arcs allow you to use this fill trick in tight places by only placing, say two of the four arcs.
Another trick is to make a zero-length line. Take a single line segment and move the end-point on top of the start-point. Now you have a “single point line” (a circle) with the diameter equal to the line thickness. Move to different layers (M key) as you see fit. Place this object centered on your via to connect it to a polygon.
Power-users may want to keep a small custom library of these parts by saving them as elements. It’s also handy to put these “parts” in one of your PCB buffers so they’re at your fingertips.
You can also add another polygon on-top of the polygon to which you want to connect you vias. You’ll un-set the “clear pins/vias” flag and the vias will be connected to the larger polygon underneath.
Currently, there is no way to directly make polygons clear solder mask. The usual workaround is to work with pads.
- Draw a track in the middle of the desired no solder mask area. Every track will become a pad.
- Select the tracks
- Do Convert selection to element from the Select menu
- Activate the solder mask layer. The solder mask should keep clear of the tracks
- Increase the clearance of the pads to match the desired bare copper area. To do this, press K while the mouse cursor hovers above the pads.
- Optionally press Q to set the square flag of the pads.
While the pad width is limited to 250 mil, clearance can be arbitrary.
This is a two step process. First select the objects you want to manipulate. Then act on the selection:
- select all components. You may shut off all layers except silk so the select tool doesn't catch tracks.
- from the menu choose Select → Change size of selected objects → Pins +10 mil
You may rip off the sub menu at the dashed line to make it stay on the screen for convenient repeated application.
Alternatively, issue the ChangeSize action with the command tool:
- Type : to open the command line.
- In the command line type:
ChangeSize(SelectedPins, SIZE)
Replace SIZE with the desired size, given in 1/100 mil. 1 mm = 3937. If SIZE is prefixed by “-” the size is decreased. If the prefix is “+”, the size is increased. If there is no sign, it is interpreted as an absolute value. Refer to the pcb manual for the syntax of the ChangeSize action.
Use a footprint for the mounting hole or place a via.
If the pads surrounding the mounting hole need to be electrically connected then you should show the connection in your schematic. Add a symbol for the mounting hole and change its footprint attribute.
My preference is to create PCB footprints for the various types of mounting hardware. I have a variety of silkscreens for various hardware combinations (hex nut, hex nut with washer, etc.). The silkscreen provides a convenient placement reference during PCB layout.
For footprint examples see http://www.luciani.org/geda/pcb/pcb-footprint-list.html#Hardware.
The reason is that pins usually have sufficient spacing that the plane surrounding them remains intact on all sides and pads usually are so tightly spaced that they do not. Because of this you must manually draw the thermal “fingers” to connect the pad to the ground plane. Be sure that you have the settings such that new lines connect to planes when you draw them. If you need to make several such thermals, spend a little time making the first one just the way you want then copy the fingers to the buffer and paste it where you want the others.
It's all just names when you're doing single sided. There's no such thing as a single sided board in pcb - just a double sided board with nothing on one side.
Design for two-sided, but with all the traces on the solder side. If you use the autorouter, turn off all but the bottom layer. This will make the autorouter stick to that layer. If you need wire jumpers, you have two options to let pcb know there is a valid connection: You can draw tracks on top layer similar to a two layer layout. Alternatively you can Create a “jumper” symbol in the schematic and put that in places where you need a jumper. This is likely to be a major pain, but you can enforce dimensions of the jumpers this way if you care.
Single sided boards do not have plated holes, so pad diameter for pins must be greater, usually two to three times the drill size. Some footprints in the default library have very small pads which will be too weak if used for single sided board. Tweak them to your needs and place them in a local library.
When you dump your gerbers, delete the component side one and rename the plated-holes one to unplated-holes. Voila! A single sided board.
One of PCB's great features is that it uses an easily understood ASCII file format. Therefore, many people use scripts (commonly Perl) to process their boards in various ways. You can use these scripts either as they are, or modify them to suit your own goals. Here are some links to available scripts:
- John Luciani has a large number of scripts available on his website. Included in his collection are scripts for generating footprints, as well as
- David Rowe has scripts for updating elements as well as adding/subtracting PCB files from each other on his [website](404 - Not found error).
- Stuart Brorson wrote a simple script which generates footprints for two terminal SMT passives. A gzipped tarball is available [here](404 - Not found error).
- The website gedasymbols.org has gathered a collection of footprints, symbols, scripts, and other materials from many different gEDA contributors. The website is organized by contributor, so if you take the time to browse around there, you may find exactly what you are looking for !
There is a third party open source utility called pstoedit that converts postscript data to pcb format. It is included in most major Linux distributions. You can use your favorite vector graphics utility to produce a logo or any kind of fancy layout. Export as eps if you can and make sure that your logo fits into the bounding box (check with a postscript viewer such as ggv). If there is no eps export available, you can produce postscript by printing to a file. In this case you may add a bounding box with ps2epsi. Call pstoedit with the option “-f pcb” to produce a valid pcb file that contains the graphics as tracks on layer 1. Load this file to pcb. The graphics will sit somewhere on the lower left of the view port. You may have to zoom out to get it on the screen.
Import of external vector graphics is useful if an irregular shape of the pcb is required. Use the cut buffer to copy the shape to your actual design.
There is no import filter to directly load a DXF file to pcb. However, the open source application qcad can open DXF files and export them as postscript. The tool pstoedit can turn this postscript file into a format readable by pcb (see above).
Sometimes footprints call for shapes that are difficult to achieve with the restricted graphics GUI of pcb. It may be easier to start with the vector drawing application inkscape and convert to pcb.
In inkscape:
- draw the weird shape with lines. Lines don't have to be straight.
- save as eps (uncheck “make bounding box around page”)
Convert to pcb format:
pstoedit -f pcb > footprint.pcb
In pcb do:
- File → Load layout data to paste-buffer
- edit to your needs (lines only, no polygons)
- select the bunch of lines
- copy to buffer (Ctrl-C)
- Buffer → Convert buffer to element
- Buffer → Save buffer elements to file
In a text editor:
- add the same pin number to all the lines with search and replace
- save as *.fp at a place where pcb is looking for footprint libraries
You can set the name of the current pcb with menu Edit → Edit name of → layout. This sets the title attribute of the layout. This attribute is used for the export actions. It does not interfere with the file name.
The GUI provides no way to do similar subcircuits automatically. You can copy groups of tracks and vias. However, you have to place the footprints manually. Deactivate Auto enforce DRC clearance in the Settings menu during placement. Else pcb won't let you connect the footprints with the copied tracks and vias.
John Luciani wrote a pair of perl scripts that can do better than that. The script sch-matrix places multiple copies of a basic block on the sheet. It increments the numbers and positions of the symbols as needed. The layout script pcb-matrix arranges multiple copies of a sample layout in a matrix way. The result is a matching pair of schematic and layout with a subcircuit repeated multiple times. See Johns website for the details and a download of the scripts.
The pair of scripts was written a few years ago and is not used regularly. They may need to be updated when used with recent versions of pcb. Contribution of bug reports and/or patches are welcome.
There is a special option to put a bitmap graphic in the background of the canvas. The image can be in jpg, png, or ppm format. Use gimp, or any other image manipulation program to make the image look hazy so it does not interfere too much with the actual layout colors.
Call PCB like this:
$ pcb --bg-image background.png layout.pcb
The image will be scaled to the size of the canvas. See the howto page by DJ Delorie for a screenshot of pcb with background image.