Manual de referencia

Este documento está protegido por Copyright © 2010 a 2015 de sus autores, mencionados a continuación. Puede distribuirlo y/o modificarlo bajo los términos de la GNU General Public License (http://www.gnu.org/licenses/gpl.html), versión 3 o posterior, o la Creative Commons Attribution License (http : //creativecommons.org/licenses/by/3.0/), versión 3.0 o posterior.

Todas las marcas mencionadas en esta guía pertenecen a sus legítimos propietarios.

Contribuidores

Jean-Pierre Charras, Fabrizio Tappero.

Traducción

Antonio Morales <antonio1010.mr@gmail.com>, 2015-2016

Realimentación

Por favor dirija cualquier reporte de fallo, sugerencia o nuevas versiones a:

Fecha de publicación y versión del software

17 de Marzo de 2014

1. Introduction to Pcbnew

1.1. Description

Pcbnew is a powerful printed circuit board software tool available for the Linux, Microsoft Windows and Apple OS X operating systems. Pcbnew is used in association with the schematic capture program Eeschema to create printed circuit boards.

Pcbnew manages libraries of footprints. Each footprint is a drawing of the physical component including its land pattern (the layout of pads on the circuit board). The required footprints are automatically loaded during the reading of the Netlist. Any changes to footprint selection or annotation can be changed in the schematic and updated in pcbnew by regenerating the netlist and reading it in pcbnew again.

Pcbnew provides a design rules check (DRC) tool which prevents track and pad clearance issues as well as preventing nets from being connected that aren’t connected in the netlist/schematic. When using the interactive router it continuously runs the design rules check and will help automatically route individual traces.

Pcbnew provides a rats nest display, a hairline connecting the pads of footprints which are connected on the schematic. These connections move dynamically as track and footprint movements are made.

Pcbnew has a simple but effective autorouter to assist in the production of the circuit board. An Export/Import in SPECCTRA dsn format allows the use of more advanced auto-routers.

Pcbnew provides options specifically provided for the production of ultra high frequency microwave circuits (such as pads of trapezoidal and complex form, automatic layout of coils on the printed circuit, etc).

1.2. Principal design features

The smallest unit in pcbnew is 1 nanometer. All dimensions are stored as integer nanometers.

Pcbnew can generate up to 32 layers of copper, 14 technical layers (silk screen, solder mask, component adhesive, solder paste and edge cuts) plus 4 auxiliary layers (drawings and comments) and manages in real time the hairline indication (rats nest) of missing tracks.

The display of the PCB elements (tracks, pads, text, drawings…) is customizable:

  • In full or outline.

  • With or without track clearance.

For complex circuits, the display of layers, zones, and components can be hidden in a selective way for clarity on screen. Nets of traces can be highlighted to provide high contrast as well.

Footprints can be rotated to any angle, with a resolution of 0.1 degree.

Pcbnew includes a Footprint Editor that allows editing of individual footprints that have been on a pcb or editing a footprint in a library.

The Footprint Editor provides many time saving tools such as:

  • Fast pad numbering by simply dragging the mouse over pads in the order you want them numbered.

  • Easy generation of rectangular and circular arrays of pads for LGA/BGA or circular footprints.

  • Semi-automatic aligning of rows or columns of pads.

Footprint pads have a variety of properties that can be adjusted. The pads can be round, rectangular, oval or trapezoidal. For through-hole parts drills can be offset inside the pad and be round or a slot. Individual pads can also be rotated and have unique soldermask, net, or paste clearance. Pads can also have a solid connection or a thermal relief connection for easier manufacturing. Any combination of unique pads can be placed within a footprint.

Pcbnew easily generates all the documents necessary for production:

  • Fabrication outputs:

    • Files for Photoplotters in GERBER RS274X format.

    • Files for drilling in EXCELLON format.

  • Plot files in HPGL, SVG and DXF format.

  • Plot and drilling maps in POSTSCRIPT format.

  • Local Printout.

1.3. General remarks

Due to the degree of control necessary it is highly suggested to use a 3-button mouse with pcbnew. Many features such as panning and zooming require a 3-button mouse.

In the new release of KiCad, pcbnew has seen wide sweeping changes from developers at CERN. This includes features such as a new renderer (OpenGL and Cairo view modes), an interative push and shove router, differential and meander trace routing and tuning, a reworked Footprint Editor, and many other features. Please note that most of these new features only exist in the new OpenGL and Cairo view modes.

2. Installation

2.1. Installation of the software

The installation procedure is described in the KiCad documentation.

2.2. Modifying the default configuration

A default configuration file kicad.pro is provided in kicad/share/template. This file is used as the initial configuration for all new projects.

This configuration file can be modified to change the libraries to be loaded.

To do this:

  • Launch Pcbnew using kicad or directly. On Windows is in C:\kicad\bin\pcbnew.exe and on Linux you can run /usr/local/kicad/bin/kicad or /usr/local/kicad/bin/pcbnew if the binaries are located in /usr/local/kicad/bin.

  • Select Preferences - Libs and Dir.

  • Edit as required.

  • Save the modified configuration (Save Cfg) to kicad/share/template/kicad.pro.

2.3. Managing Footprint Libraries: legacy versions

You can have access to the library list initialization from the Preferences menu:

images/Library_list_menu_item.png

The image below shows the dialog which allows you to set the footprint library list:

images/Footprint_library_list.png

You can use this to add all the libraries that contain the footprints required for your project. You should also remove unused libraries from new projects to prevent footprint name clashes. Please note, there is an issue with the footprint library list when duplicate footprint names exist in more than one library. When this occurs, the footprint will be loaded from the first library found in the list. If this is an issue (you cannot load the footprint you want), either change the library list order using the "Up" and "Down" buttons in the dialog above or give the footprint a unique name using the footprint editor.

2.4. Managing Footprint Libraries: .pretty repositories

As of release 4.0, Pcbnew uses the new footprint library table implementation to manage footprint libraries. The information in the previous section is no longer valid. The library table manager is accessible by:

images/Library_tables_menu_item.png

The image below shows the footprint library table editing dialog which can be opened by invoking the "Footprint Libraries Manager" entry from the "Preferences" menu.

images/Footprint_tables_list.png

The footprint library table is used to map a footprint library of any supported library type to a library nickname. This nickname is used to look up footprints instead of the previous method which depended on library search path ordering. This allows Pcbnew to access footprints with the same name in different libraries by ensuring that the correct footprint is loaded from the appropriate library. It also allows Pcbnew to support loading libraries from different PCB editors such as Eagle and gEDA.

2.4.1. Global Footprint Library Table

The global footprint library table contains the list of libraries that are always available regardless of the currently loaded project file. The table is saved in the file fp-lib-table in the user’s home folder. The location of this folder is dependent on the operating system.

2.4.2. Project Specific Footprint Library Table

The project specific footprint library table contains the list of libraries that are available specifically for the currently loaded project file. The project specific footprint library table can only be edited when it is loaded along with the project board file. If no project file is loaded or there is no footprint library table file in the project path, an empty table is created which can be edited and later saved along with the board file.

2.4.3. Initial Configuration

The first time CvPcb or Pcbnew is run and the global footprint table file fp-lib-table is not found in the user’s home folder, Pcbnew will attempt to copy the default footprint table file fp_global_table stored in the system’s KiCad template folder to the file fp-lib-table in the user’s home folder. If fp_global_table cannot be found, an empty footprint library table will be created in the user’s home folder. If this happens, the user can either copy fp_global_table manually or configure the table by hand. The default footprint library table includes all of the standard footprint libraries that are installed as part of KiCad.

2.4.4. Adding Table Entries

In order to use a footprint library, it must first be added to either the global table or the project specific table. The project specific table is only applicable when a board file is open. Each library entry must have a unique nickname. This does not have to be related in any way to the actual library file name or path. The colon : character cannot be used anywhere in the nickname. Each library entry must have a valid path and/or file name depending on the type of library. Paths can be defined as absolute, relative, or by environment variable substitution. The appropriate plug in type must be selected in order for the library to be properly read. Pcbnew currently supports reading KiCad legacy, KiCad Pretty, Eagle, and gEDA footprint libraries. There is also a description field to add a description of the library entry. The option field is not used at this time so adding options will have no effect when loading libraries. Please note that you cannot have duplicate library nicknames in the same table. However, you can have duplicate library nicknames in both the global and project specific footprint library table. The project specific table entry will take precedence over the global table entry when duplicated names occur. When entries are defined in the project specific table, an fp-lib-table file containing the entries will be written into the folder of the currently open netlist.

2.4.5. Environment Variable Substitution

One of the most powerful features of the footprint library table is environment variable substitution. This allows you to define custom paths to where your libraries are stored in environment variables. Environment variable substitution is supported by using the syntax ${ENV_VAR_NAME} in the footprint library path. By default, at run time Pcbnew defines the $KISYSMOD environment variable. This points to where the default footprint libraries that were installed with KiCad are located. You can override $KISYSMOD by defining it yourself which allows you to substitute your own libraries in place of the default KiCad footprint libraries. When a board file is loaded, Pcbnew also defines the $KPRJMOD using the board file path. This allows you to create libraries in the project path without having to define the absolute path to the library in the project specific footprint library table.

2.4.6. Using the GitHub Plugin

The GitHub plugin is a special plugin that provides an interface for read-only access to a remote GitHub repository consisting of pretty (Pretty is name of the KiCad footprint file format) footprints and optionally provides "Copy-On-Write" (COW) support for editing footprints read from the GitHub repo and saving them locally. Therefore the "GitHub" plugin is for read-only for accessing remote pretty footprint libraries at https://github.com. To add a GitHub entry to the footprint library table the "Library Path" in the footprint library table entry must be set to a valid GitHub URL.

For example:

https://github.com/liftoff-sr/pretty_footprints

Typically GitHub URLs take the form:

https://github.com/user_name/repo_name

The "Plugin Type" must be set to "Github". To enable the "Copy-On-Write" feature the option allow_pretty_writing_to_this_dir must be added to the "Options" setting of the footprint library table entry. This option is the "Library Path" for local storage of modified copies of footprints read from the GitHub repo. The footprints saved to this path are combined with the read-only part of the GitHub repository to create the footprint library. If this option is missing, then the GitHub library is read-only. If the option is present for a GitHub library, then any writes to this hybrid library will go to the local *.pretty directory. Note that the github.com resident portion of this hybrid COW library is always read-only, meaning you cannot delete anything or modify any footprint in the specified GitHub repository directly. The aggregate library type remains "Github" in all further discussions, but it consists of both the local read/write portion and the remote read-only portion.

The table below shows a footprint library table entry without the option allow_pretty_writing_to_this_dir:

Nickname Library Path Plugin Type Options Description

github

https://github.com/liftoff-sr/pretty_footprints

Github

Liftoff’s GH footprints

The table below shows a footprint library table entry with the COW option given. Note the use of the environment variable ${HOME} as an example only. The github.pretty directory is located in ${HOME}/pretty/path. Anytime you use the option allow_pretty_writing_to_this_dir, you will need to create that directory manually in advance and it must end with the extension .pretty.

Nickname Library Path Plugin Type Options Description

github

https://github.com/liftoff-sr/pretty_footprints

Github

Liftoff’s GH footprints

Footprint loads will always give precedence to the local footprints found in the path given by the option allow_pretty_writing_to_this_dir. Once you have saved a footprint to the COW library’s local directory by doing a footprint save in the Footprint Editor, no GitHub updates will be seen when loading a footprint with the same name as one for which you’ve saved locally.

Always keep a separate local *.pretty directory for each GitHub library, never combine them by referring to the same directory more than once. Also, do not use the same COW (*.pretty) directory in a footprint library table entry. This would likely create a mess. The value of the option allow_pretty_writing_to_this_dir will expand any environment variable using the ${} notation to create the path in the same way as the "Library Path" setting.

What’s the point of COW? It is to turbo-charge the sharing of footprints. If you periodically email your COW pretty footprint modifications to the GitHub repository maintainer, you can help update the GitHub copy. Simply email the individual *.kicad_mod files you find in your COW directories to the maintainer of the GitHub repository. After you’ve received confirmation that your changes have been committed, you can safely delete your COW file(s) and the updated footprint from the read-only part of GitHub library will flow down. Your goal should be to keep the COW file set as small as possible by contributing frequently to the shared master copies at https://github.com.

Finally, Nginx can be used as a cache to the github server to speed up the loading of footprints. It can be installed locally or on a network server. There is an example configuration in KiCad sources at pcbnew/github/nginx.conf. The most straightforward way to get this working is to overwrite the default nginx.conf with this one and export KIGITHUB=http://my_server:54321/KiCad, where my_server is the IP or domain name of the machine running nginx.

2.4.7. Usage Patterns

Footprint libraries can be defined either globally or specifically to the currently loaded project. Footprint libraries defined in the user’s global table are always available and are stored in the fp-lib-table file in the user’s home folder. Global footprint libraries can always be accessed even when there is no project net list file opened. The project specific footprint table is active only for the currently open net list file. The project specific footprint library table is saved in the file fp-lib-table in the path of the currently open board file. You are free to define libraries in either table.

There are advantages and disadvantages to each method:

  • You can define all of your libraries in the global table which means they will always be available when you need them.

    • The disadvantage of this is that you may have to search through a lot of libraries to find the footprint you are looking for.

  • You can define all your libraries on a project specific basis.

    • The advantage of this is that you only need to define the libraries you actually need for the project which cuts down on searching.

    • The disadvantage is that you always have to remember to add each footprint library that you need for every project.

  • You can also define footprint libraries both globally and project specifically.

One usage pattern would be to define your most commonly used libraries globally and the library only require for the project in the project specific library table. There is no restriction on how you define your libraries.

3. General operations

3.1. Toolbars and commands

In Pcbnew it is possible to execute commands using various means:

  • Text-based menu at the top of the main window.

  • Top toolbar menu.

  • Right toolbar menu.

  • Left toolbar menu.

  • Mouse buttons (menu options). Specifically:

    • The right mouse button reveals a pop-up menu the content of which depends on the element under the mouse arrow.

  • Keyboard (Function keys F1, F2, F3, F4, Shift, Delete, +, -, Page Up, Page Down and Space bar). The Escape key generally cancels an operation in progress.

The screenshot below illustrates some of the possible accesses to these operations:

images/Right-click_legacy_menu.png

3.2. Mouse commands

3.2.1. Basic commands

  • Left button

    • Single-click displays the characteristics of the footprint or text under the cursor in the lower status bar.

    • Double-click displays the editor (if the element is editable) of the element under the cursor.

  • Centre button/wheel

    • Rapid zoom and some commands in layer manager.

    • Hold down the centre button and draw a rectangle to zoom to the described area. Rotation of the mouse wheel will allow you to zoom in and zoom out.

  • Right button

    • Displays a pop-up menu

3.2.2. Operations on blocks

Operations to move, invert (mirror), copy, rotate and delete a block are all available via the pop-up menu. In addition, the view can zoom to the area described by the block.

The framework of the block is traced by moving the mouse while holding down the left mouse button. The operation is executed when the button is released.

By holding down one of the hotkeys Shift or Ctrl, or both keys Shift and Ctrl together, while the block is drawn the operation invert, rotate or delete is automatically selected as shown in the table below:

Action Effect

Left mouse button held down

Trace framework to move block

Shift + Left mouse button held down

Trace framework for invert block

Ctrl + Left mouse button held down

Trace framework for rotating block 90°

Shift + Ctrl + Left mouse button held down

Trace framework to delete the block

Centre mouse button held down

Trace framework to zoom to block

When moving a block:

  • Move block to new position and operate left mouse button to place the elements.

  • To cancel the operation use the right mouse button and select Cancel Block from the menu (or press the Esc key).

Alternatively if no key is pressed when drawing the block use the right mouse button to display the pop-up menu and select the required operation.

For each block operation a selection window enables the action to be limited to only some elements.

3.3. Selection of grid size

During element layout the cursor moves on a grid. The grid can be turned on or off using the icon on the left toolbar.

Any of the pre-defined grid sizes, or a User Defined grid, can be chosen using the pop-up window, or the drop-down selector on the toolbar at the top of the screen. The size of the User Defined grid is set using the menu bar option Dimensions → User Grid Size.

3.4. Adjustment of the zoom level

The zoom level can be changed using any of the following methods:

  • Open the pop-up window (using the right mouse button) and then select the desired zoom.

  • Use the following function keys:

    • F1: Enlarge (zoom in)

    • F2: Reduce (zoom out)

    • F3: Redraw the display

    • F4: Centre view at the current cursor position

  • Rotate the mouse wheel.

  • Hold down the middle mouse button and draw a rectangle to zoom to the described area.

3.5. Displaying cursor coordinates

The cursor coordinates are displayed in inches or millimetres as selected using the In or mm icons on the left hand side toolbar.

Whichever unit is selected Pcbnew always works to a precision of 1/10,000 of inch.

The status bar at the bottom of the screen gives:

  • The current zoom setting.

  • The absolute position of the cursor.

  • The relative position of the cursor. Note the relative coordinates (x,y) can be set to (0,0) at any position by pressing the space bar. The cursor position is then displayed relative to this new datum.

In addition the relative position of the cursor can be displayed using its polar co-ordinates (ray + angle). This can be turned on and off using the icon in the left hand side toolbar.

images/Pcbnew_coordinate_status_display.png

3.6. Keyboard commands - hotkeys

Many commands are accessible directly with the keyboard. Selection can be either upper or lower case. Most hot keys are shown in menus. Some hot keys that do not appear are:

  • Delete: deletes a footprin or a track. (Available only if the Footprint mode or the Track mode is active)

  • V: if the track tool is active switches working layer or place via, if a track is in progress.

  • + and -: select next or previous layer.

  • ?: display the list off all hot keys.

  • Space: reset relative coordinates.

3.7. Operation on blocks

Operations to move, invert (mirror), copy, rotate and delete a block are all available from the pop-up menu. In addition, the view can zoom to that described by the block.

The framework of the block is traced by moving the mouse while holding down the left mouse button. The operation is executed when the button is released.

By holding down one of the keys Shift or Ctrl, both Shift and Ctrl together, or Alt, while the block is drawn the operation invert, rotate, delete or copy is automatically selected as shown in the table below:

Action Effect

Left mouse button held down

Move block

Shift + Left mouse button held down

Invert (mirror) block

Ctrl + Left mouse button held down

Rotate block 90°

Shift + Ctrl + Left mouse button held down

Delete the block

Alt + Left mouse button held down

Copy the block

When a block command is made, a dialog window is displayed, and items involved in this command can be chosen.

Any of the commands above can be cancelled via the same pop-up menu or by pressing the Escape key (Esc).

images/Pcbnew_legacy_block_selection_dialog.png

3.8. Units used in dialogs

Units used to display dimensions values are inch and mm. The desired unit can be selected by pressing the icon located in left toolbar: images/icons/unit_inch.png images/icons/unit_mm.png However one can enter the unit used to define a value, when entering a new value.

Accepted units are:

1 in

1 inch

1 "

1 inch

25 th

25 thou

25 mi

25 mils, same as thou

6 mm

6 mm

The rules are:

  • Spaces between the number and the unit are accepted.

  • Only the first two letters are significant.

  • In countries using an alternative decimal separator than the period, the period (.) can be used as well. Therefore 1,5 and 1.5 are the same in French.

3.9. Top menu bar

The top menu bar provides access to the files (loading and saving), configuration options, printing, plotting and the help files.

images/Pcbnew_top_menu_bar.png

3.9.1. The File menu

images/Pcbnew_file_menu.png

The File menu allows the loading and saving of printed circuits files, as well as printing and plotting the circuit board. It enables the export (with the format GenCAD 1.4) of the circuit for use with automatic testers.

3.9.2. Edit menu

Allows some global edit actions:

images/Pcbnew_edit_menu.png

3.9.3. View menu

images/Pcbnew_view_menu.png

Zoom functions and 3D board display.

3D Viewer

Opens the 3D Viewer. Here is a sample:

images/Sample_3D_board.png
Switch canvas

Allows switching canvas.

  • default

  • OpenGL

  • Cairo

3.9.4. Place menu

Same function as the right-hand toolbar.

images/Pcbnew_place_menu.png

3.9.5. Route menu

Routing function.

images/Pcbnew_route_menu.png

3.9.6. The Preferences menu

images/Pcbnew_preferences_menu.png

Allows:

  • Selection of the footprint libraries.

  • Hide/Show the Layers manager (colors selection for displaying layers and other elements. Also enables the display of elements to be turned on and off).

  • Management of general options (units, etc.).

  • The management of other display options.

  • Creation, editing (and re-read) of the hot keys file.

3.9.7. Dimensions menu

images/Pcbnew_dimensions_menu.png

An important menu. Allows adjustment of:

  • User grid size.

  • Size of texts and the line width for drawings.

  • Dimensions and characteristic of pads.

  • Setting the global values for solder mask and solder paste layers

3.9.8. Tools menu

images/Pcbnew_tools_menu.png

3.9.9. The Design Rules menu

images/Pcbnew_design_rules_menu.png

Provides access to 2 dialogs:

  • Setting Design Rules (tracks and vias sizes, clerances).

  • Setting Layers (number, enabled and layers names)

3.9.10. The Help menu

Provides access to the user manuals and to the version information menu (Pcbnew About).

3.10. Using icons on the top toolbar

This toolbar gives access to the principal functions of Pcbnew.

images/Pcbnew_top_toolbar.png

images/icons/new.png

Creation of a new printed circuit.

images/icons/open_brd_file.png

Opening of an old printed circuit.

images/icons/save.png

Save printed circuit.

images/icons/sheetset.png

Selection of the page size and modification of the file properties.

images/icons/module_editor.png

Opens Footprint Editor to edit library or pcb footprint.

images/icons/modview_icon.png

Opens Footprint Viewer to display library or pcb footprint.

images/icons/undo.png images/icons/redo.png

Undo/Redo last commands (10 levels)

images/icons/print_button.png

Display print menu.

images/icons/plot.png

Display plot menu.

images/icons/zoom_in.png images/icons/zoom_out.png

Zoom in and Zoom out (relative to the centre of screen).

images/icons/zoom_redraw.png

Redraw the screen

images/icons/zoom_fit_in_page.png

Fit to page

images/icons/find.png

Find footprint or text.

images/icons/netlist.png

Netlist operations (selection, reading, testing and compiling).

images/icons/drc.png

DRC (Design Rule Check): Automatic check of the tracks.

images/Pcbnew_toolbar_layer_select_dropdown.png

Selection of the working layer.

images/Pcbnew_layer_pair_indicator.png

Selection of layer pair (for vias)

images/icons/mode_module.png

Footprint mode: when active this enables footprint options in the pop-up window.

images/icons/mode_track.png

Routing mode: when active this enables routing options in the pop-up window

images/icons/web_support.png

Direct access to the router Freerouter

images/icons/py_script.png

Show / Hide the Python scripting console

3.10.1. Auxiliary toolbar

images/Pcbnew_track_thickness_dropdown.png

Selection of thickness of track already in use.

images/Pcbnew_via_size_dropdown.png

Selection of a dimension of via already in use.

images/icons/auto_track_width.png

Automatic track width: if enabled when creating a new track, when starting on an existing track, the width of the new track is set to the width of the existing track.

images/Pcbnew_grid_size_dropdown.png

Selection of the grid size.

images/Pcbnew_zoom_factor_dropdown.png

Selection of the zoom.

3.11. Right-hand side toolbar

This toolbar gives access to the editing tool to change the PCB shown in Pcbnew.

images/Pcbnew_right_toolbar.png

images/icons/cursor.png

Select the standard mouse mode.

images/icons/net_highlight.png

Highlight net selected by clicking on a track or pad.

images/icons/tool_ratsnest.png

Display local ratsnest (Pad or Footprint).

images/icons/module.png

Add a footprint from a library.

images/icons/add_tracks.png

Placement of tracks and vias.

images/icons/add_zone.png

Placement of zones (copper planes).

images/icons/add_keepout_area.png

Placement of keepout areas ( on copper layers ).

images/icons/add_dashed_line.png

Draw Lines on technical layers (i.e. not a copper layer).

images/icons/add_circle.png

Draw Circles on technical layers (i.e. not a copper layer).

images/icons/add_arc.png

Draw Arcs on technical layers (i.e. not a copper layer).

images/icons/add_text.png

Placement of text.

images/icons/add_dimension.png

Draw Dimensions on technical layers (i.e. not the copper layer).

images/icons/add_mires.png

Draw Alignment Marks (appearing on all layers).

images/icons/delete.png

Delete element pointed to by the cursor

Note: When Deleting, if several superimposed elements are pointed to, priority is given to the smallest (in the decreasing set of priorities tracks, text, footprint). The function "Undelete" of the upper toolbar allows the cancellation of the last item deleted.

images/icons/pcb_offset.png

Offset adjust for drilling and place files.

images/icons/grid_select_axis.png

Grid origin. (grid offset). Useful mainly for editing and placement of footprints. Can also be set in Dimensions/Grid menu.

  • Placement of footprints, tracks, zones of copper, texts, etc.

  • Net Highlighting.

  • Creating notes, graphic elements, etc.

  • Borrar elementos.

3.12. Left-hand side toolbar

The left hand-side toolbar provides display and control options that affect Pcbnew’s interface.

images/Pcbnew_left_toolbar.png

images/icons/drc_off.png

Turns DRC (Design Rule Checking) on/off. Caution: when DRC is off incorrect connections can be made.

images/icons/grid.png

Turn grid display on/off Note: a small grid may not be displayed unless zoomed in far enough

images/icons/polar_coord.png

Polar display of the relative co-ordinates on the status bar on/off.

images/icons/unit_inch.png images/icons/unit_mm.png

Display/entry of coordinates or dimensions in inches or millimeters.

images/icons/cursor_shape.png

Change cursor display shape.

images/icons/general_ratsnest.png

Display general rats nest (incomplete connections between footprints).

images/icons/local_ratsnest.png

Display footprint rats nest dynamically as it is moved.

images/icons/auto_delete_track.png

Enable/Disable automatic deletion of a track when it is redrawn.

images/icons/show_zone.png

Show filled areas in zones

images/icons/show_zone_disable.png

Do not show filled areas in zones

images/icons/show_zone_outline_only.png

Show only outlines of filled areas in zones

images/icons/pad_sketch.png

Display of pads in outline mode on/off.

images/icons/via_sketch.png

Display of vias in outline mode on/off.

images/icons/showtrack.png

Display of tracks in outline mode on/off.

images/icons/contrast_mode.png

High contrast display mode on/off. In this mode the active layer is displayed normally, all the other layers are displayed in gray. Useful for working on multi-layer circuits.

images/icons/layers_manager.png

Hide/Show the Layers manager

images/icons/mw_toolbar.png

Access to microwaves tools. Under development

3.13. Pop-up windows and fast editing

A right-click of the mouse opens a pop-up window. Its contents depends on the element pointed at by the cursor.

This gives immediate access to:

  • Changing the display (centre display on cursor, zoom in or out or selecting the zoom).

  • Setting the grid size.

  • Additionally a right-click on an element enables editing of the most commonly modified element parameters.

The screenshots below show what the pop-up windows looks like.

3.14. Available modes

There are 3 modes when using pop-up menus. In the pop-up menus, these modes add or remove some specific commands.

images/icons/mode_module.png and images/icons/mode_track.png disabled

Normal mode

images/icons/mode_module.png enabled

Footprint mode

images/icons/mode_track.png enabled

Tracks mode

3.14.1. Normal mode

  • Pop-up menu with no selection:

images/Pcbnew_popup_normal_mode.png
  • Pop-up menu with track selected:

images/Pcbnew_popup_normal_mode_track.png
  • Pop-up menu with footprint selected:

images/Pcbnew_popup_normal_mode_footprint.png

3.14.2. Footprint mode

Same cases in Footprint Mode ( images/icons/mode_module.png enabled)

  • Pop-up menu with no selection:

images/Pcbnew_popup_footprint_mode.png
  • Pop-up menu with track selected:

images/Pcbnew_popup_footprint_mode_track.png
  • Pop-up menu with footprint selected:

images/Pcbnew_popup_footprint_mode_footprint.png

3.14.3. Tracks mode

Same cases in Track Mode ( images/icons/mode_track.png enabled)

  • Pop-up menu with no selection:

images/Pcbnew_popup_track_mode.png
  • Pop-up menu with track selected:

images/Pcbnew_popup_track_mode_track.png
  • Pop-up menu with footprint selected:

images/Pcbnew_popup_track_mode_footprint.png

4. Schematic Implementation

4.1. Linking a schematic to a printed circuit board

Generally speaking, a schematic sheet is linked to its printed circuit board by means of the netlist file, which is normally generated by the schematic editor used to make the schematic. Pcbnew accepts netlist files made with Eeschema or Orcad PCB 2. The netlist file, generated from the schematic is usually missing the footprints that correspond to the various components. Consequently an intermediate stage is necessary. During this intermediate process the association of components with footprints is performed. In KiCad, CvPcb is used to create this association and a file named *.cmp is produced. CvPcb also updates the netlist file using this information.

CvPcb can also output a "stuff file" *.stf which can be back annotated into the schematic file as the F2 field for each component, saving the task of re-assigning footprints in each schematic edit pass. In Eeschema copying a component will also copy the footprint assignment and set the reference designator as unassigned for later auto-incremental annotation.

Pcbnew reads the modified netlist file .net and, if it exists, the .cmp file. In the event of a footprint being changed directly in Pcbnew the .cmp file is automatically updated avoiding the requirement to run CvPcb again.

Refer to the figure of "Getting Started in KiCad" manual in the section KiCad Workflow that illustrates the work-flow of KiCad and how intermediate files are obtained and used by the different software tools that comprise KiCad.

4.2. Procedure for creating a printed circuit board

After having created your schematic in Eeschema:

  • Generate the netlist using Eeschema.

  • Assign each component in your netlist file to the corresponding footprint (often called footprint) used on the printed circuit using Cvpcb.

  • Launch Pcbnew and read the modified Netlist. This will also read the file with the footprint selections.

Pcbnew will then load automatically all the necessary footprints. Footprints can now be placed manually or automatically on the board and tracks can be routed.

4.3. Procedure for updating a printed circuit board

If the schematic is modified (after a printed circuit board has been generated), the following steps must be repeated:

  • Generate a new netlist file using Eeschema.

  • If the changes to the schematic involve new components, the corresponding footprints must be assigned using Cvpcb.

  • Launch Pcbnew and re-read the modified netlist (this will also re-read the file with the footprint selections).

Pcbnew will then load automatically any new footprints, add the new connections and remove redundant connections. This process is called forward annotation and is a very common procedure when a PCB is made and updated.

4.4. Reading netlist file - loading footprints

4.4.1. Dialog box

Accessible from the icon images/icons/netlist.png

images/Pcbnew_netlist_dialog.png

4.4.2. Available options

Footprint Selection

Components and corresponding footprints on board link: normal link is Reference (normal option Timestamp can be used after reannotation of schematic, if the previous annotation was destroyed (special option)

Exchange Footprint:

If a footprint has changed in the netlist: keep old footprint or change to the new one.

Unconnected Tracks

Keep all existing tracks, or delete erroneous tracks

Extra Footprints

Remove footprints which are on board but not in the netlist. Footprint with attribute "Locked" will not be removed.

Single Pad Nets

Remove single pad nets.

4.4.3. Loading new footprints

When new footprints are found in the netlist file, they will be automatically loaded and placed at coordinate (0,0).

images/Pcbnew_stacked_footprints.png

New footprints can be moved and arranged one by one. A better way is to automatically move (unstack) them:

Activate footprint mode ( images/icons/mode_module.png )

Move the mouse cursor to a suitable (free of component) area, and click on the right button:

images/Pcbnew_move_all_modules.png
  • Automatically Place New Footprints, if there is already a board with existing footprints.

  • Automatically Place All Footprints, for the first time (when creating a board).

The following screenshot shows the results.

images/Pcbnew_unstacked_footprints.png

5. Setting up working layers

Pcbnew can work on 50 different layers:

  • 32 copper layers (for routing of tracks).

  • 14 technical layers (includes 1 board outline layer).

  • 4 auxiliary layers.

The number of copper layers, and if needed their names and attributes, should be set. Unused technical layers can be disabled.

5.1. Select copper layers

5.1.1. Introduction

Copper layers are the usual working layers used by the automatic router to place and re-arrange tracks. Layer 0 is the copper (solder) layer. Layer 31 is the component layer. Other layers are the inner layers, from In1 to In30.

5.1.2. Select number of layers

To enable navigation between layers, it is necessary to select the number of working layers. To do this you can use the menu bar and select Design Rules → Layers Setup.

images/Pcbnew_layer_setup_menu_item.png

Then select the number of layers wanted, from 2 to 32.

images/Pcbnew_layer_setup_dialog.png

5.1.3. Copper layers

The name of any copper layer is editable. Copper layers have attributes useful when using the external router Freerouter.

images/Pcbnew_layer_setup_dialog_layer_properties.png

5.2. Auxiliary technical layers

Some are associated in pairs, others not. When they appear as a pair this affects the behaviour of footprints. The elements making up a footprint (pads, drawing and text) appearing on a layer (solder or component), appear on the other complementary layer when the footprint is inverted (mirrored).

The technical layers are:

5.2.1. Paired layers

  • The Adhesives layers (Copper and Component):

    • These are used in the application of adhesive to stick SMD components to the circuit board, generally before wave soldering.

  • The Solder Paste layers paste SMD (Copper and Component):

    • Used to produce a mask to allow solder paste to be placed on the pads of surface mount components, generally before reflow soldering. Usually only surface mount pads occupy these layers.

  • The Silk Screen layers (Copper and Component):

    • They are the layers where the drawings of the components appear.

  • The Solder Mask layers (Copper and Component):

    • These define the solder masks. Normally all pads appear on one or the other of these layers (or both for through pads) to prevent the varnish covering the pads.

5.2.2. Layers for general use

  • Comments

  • E.C.O. 1

  • E.C.O. 2

  • Drawings

These layers are for any use. They can be used for text such as instructions for assembly or wiring, or construction drawings, to be used to create a file for assembly or machining.

5.2.3. Special layer

  • Edge Cuts layer:

    • This layer is reserved for the drawing of circuit board outline. Any element (graphic, texts…) placed on this layer appears on all the other layers. Use this layer only to draw board outlines.

5.3. Selection of the active layer

The selection of the active working layer can be done in several ways:

  • Using the right toolbar (Layer manager).

  • Using the upper toolbar.

  • With the pop-up window (activated with the right mouse button).

  • Using the + and - keys (works on copper layers only).

  • By hot keys.

5.3.1. Selection using the layer manager

images/Pcbnew_layer_manager_pane.png

5.3.2. Selection using the upper toolbar

images/Pcbnew_layer_selection_dropdown.png

This directly selects the working layer.

Hot keys to select the working layer are displayed.

5.3.3. Selection using the pop-up window

images/Pcbnew_layer_selection_popup.png

The Pop-up window opens a menu window which provides a choice for the working layer.

images/Pcbnew_layer_selection_dialog.png

5.4. Selection of the Layers for Vias

If the Add Tracks and Vias icon is selected on the right hand toolbar, the Pop-Up window provides the option to change the layer pair used for vias:

images/Pcbnew_via_layer_pair_popup.png

This selection opens a menu window which provides choice of the layers used for vias.

images/Pcbnew_via_layer_pair_dialog.png

When a via is placed the working (active) layer is automatically switched to the alternate layer of the layer pair used for the vias.

One can also switch to an other active layer by hot keys, and if a track is in progress, a via will be inserted.

5.5. Using the high-contrast mode

This mode is entered when the tool (in the left toolbar) is activated: images/icons/contrast_mode.png

When using this mode, the active layer is displayed like in the normal mode, but all others layers are displayed in gray color.

There are two useful cases:

5.5.1. Copper layers in high-contrast mode

When a board uses more than four layers, this option allows the active copper layer to be seen more easily:

Normal mode (back side copper layer active):

images/Pcbnew_copper_layers_contrast_normal.png

High-contrast mode (back side copper layer active):

images/Pcbnew_copper_layers_contrast_high.png

5.5.2. Technical layers

The other case is when it is necessary to examine solder paste layers and solder mask layers which are usually not displayed.

Masks on pads are displayed if this mode is active.

Normal mode (front side solder mask layer active):

images/Pcbnew_technical_layers_contrast_normal.png

High-contrast mode (front side solder mask layer active):

images/Pcbnew_technical_layers_contrast_high.png

6. Crear y modificar una placa

6.1. Crear una placa

6.1.1. Dibujando el cortorno de la placa

Por lo general, es una buena idea definir al principio el contorno de la placa. El contorno se dibuja como una secuencia de segmentos de línea. Seleccione Edge.Cuts como la capa activa y use de la herramienta Añadir línea gráfica o polígono para trazar el borde, haciendo clic en la posición de cada vértice y doble clic para terminar el contorno. Las placas de circuito normalmente tienen unas dimensiones muy precisas, por lo que puede ser necesario utilizar la visualización de las coordenadas del cursor mientras traza el contorno. Recuerde que las coordenadas relativas pueden ser puestas a cero en cualquier momento usando la barra espaciadora, y que las unidades de la pantalla también se puede activar mediante "Ctrl-U '. Las coordenadas relativas permiten un trazado muy preciso. Es posible dibujar un contorno circular (o en forma de arco):

  1. Seleccione la herramienta Añadir círculo gráfico o Agregar arco gráfico herramienta

  2. Haga clic para definir el centro del círculo

  3. Ajuste el radio moviendo el ratón

  4. Finalice haciendo clic de nuevo

Nota
El ancho del contorno puede ajustarse en el menú Parámetros (la anchura recomendada es de 150 en 1/10 milésimas de pulgada) o a través del menú Opciones, pero esto no será visible a menos que los gráficos se muestren en un modo distinto del modo esquematizado.

El contorno resultante podría ser algo parecido a esto:

images/Pcbnew_simple_board_outline.png

6.1.2. Usando dibujos DXF para el borde de placa

Como alternativa a dibujar el contorno de la placa directamente en Pcbnew, éste también puede importarse desde un dibujo en formato DXF.

Esta característica permite crear formas para el contorno mucho más complejas de lo que sería posible con las herramientas de dibujo de Pcbnew.

Por ejemplo, un paquete de CAD para modelado mecánico puede utilizarse para definir una forma para la placa que se adapte a una carcasa particular.

Preparación del dibujo DXF para la importación en KiCad

La capacidad de importar DXF en KiCad no soporta características propias de DXF como POLILÍNEAS y ELIPSES y los archivos DXF que utilicen estas características requieren algunos pasos previos de conversión con en fin de prepararlos para su importación.

Un paquete de software como LibreCAD puede utilizarse para esta conversión.

Como un primer paso, cualquier POLILÍNEA necesita ser dividida (Exploded) en sus formas originales más simples. En LibreCAD puede utilizar los siguientes pasos:

  1. Abra una copia del archivo DXF.

  2. Seleccione el borde de la placa (las formas seleccionadas se muestran con líneas de puntos).

  3. En el menú Modificar, seleccione Descomponer.

  4. presione ENTER

En el siguiente paso, las curvas complejas como las ELIPSES necesitan ser divididas en pequeños segmentos de línea que se aproximen a la forma requerida. Esto sucede automáticamente cuando el archivo DXF se exporta o se guarda en el antiguo formato de archivo DXF R12 (como el formato R12 no es compatible con formas curvas complejas, las aplicaciones CAD convierten estas formas a segmentos de línea. Algunas aplicaciones CAD permiten la configuración del número o la longitud de los segmentos de línea que se utilizarán). En LibreCAD la longitud del segmento por lo general es lo suficientemente pequeño para usarlo como forma para el borde de las placas.

En LibreCAD, utilice los siguientes pasos para exportar al formato de archivo DXF R12:

  1. En el menú Archivo, use Guardar como…

  2. En la ventana Guardar Dibujo Como, hay una selección Guardar como tipo: cerca de la parte inferior del diálogo. Seleccione la opción Drawing Exchange DXF R12.

  3. Opcionalmente, escriba un nombre de archivo en el campo nombre del archivo:.

  4. Haga clic en Guardar

Su archivo DXF ya está listo para su importación en KiCad.

Importando el archivo DXF en KiCad

Los siguientes pasos describen la importación del fichero DXF preparado como contorno de la PCB en KiCad. Tenga en cuenta que el comportamiento de la importación es ligeramente diferente dependiendo de qué tipo de lienzo se utilice.

Usando el lienzo "predeterminado":

  1. En el menú Archivo, seleccione Importar y después la opción Fichero DXF

  2. En la ventana Importar fichero DXF use "Examinar" para seleccionar el archivo DXF previamente preparado para ser importado.

  3. En la opción Coloque el punto origen DXF (0,0):, seleccione la ubicación del origen DXF relativo a las coordenadas de la placa (la placa en KiCad tiene su (0,0) en la esquina superior izquierda). Para la posición definida del usuario introduzca los campos de coordenadas para la Posición X y la posición Y.

  4. En la selección de Capas, seleccione la capa Edge.Cuts para importar el contorno de la placa.

  5. Haga clic en OK.

Utilización de los modos de lienzo "OpenGL" o "Cairo":

  1. En el menú Archivo, seleccione Importar y después la opción Fichero DXF

  2. En la ventana Importar fichero DXF use "Examinar" para seleccionar el archivo DXF previamente preparado para ser importado.

  3. La opción Ubicar el punto de origen DXF (0,0): es ignorada en este modo.

  4. En la selección de Capas, seleccione la capa Edge.Cuts para importar el contorno de la placa.

  5. Haga clic en OK.

  6. La forma ahora está anclada al cursor y puede ser movida por el área de la placa.

  7. Haga clic para depositar la forma sobre la placa.

Ejemplo de forma DXF importada

A continuación se muestra un ejemplo de una forma DXF importada con una placa que tiene varios arcos elípticos aproximados por un número de segmentos de lineas cortos:

images/Pcbnew_board_outline_imported_from_a_DXF.png

6.1.3. Leyendo el netlist generado a partir del esquema

Active el icono images/icons/netlist.png para mostrar la ventana de carga de netlist:

images/Pcbnew_netlist_dialog.png

Si el nombre (o ruta) del netlist en el titulo de la ventana es incorrecto, use el botón Examinar para buscar el netlist correspondiente. Después Lea el netlist. Cualquier huella que no se haya cargado antes aparecerá, superpuestas una sobre otra (debajo veremos como moverlas automáticamente).

images/Pcbnew_board_outline_with_dogpile.png

Si ninguna de las huellas se había cargado, todas las huellas aparecerán en la placa en el mismo lugar, haciendo que sea difícil reconocerlos. Es posible organizarlos automáticamente (utilizando el comando Esparcir y Posicionar Global accedido a través del botón derecho del ratón). Aquí está el resultado de tal disposición automática:

images/Pcbnew_board_outline_with_globally_placed_modules.png
Nota
Si una placa se modifica mediante la sustitución de una huella existente por una nueva (por ejemplo, cambiando una resistencia de 1/8W por una de 1/2W) en CvPcb, será necesario eliminar el componente existente antes de que Pcbnew cargue la huella de reemplazo. Sin embargo, si una huella va a ser reemplazado por una huella existente, esto es más fácil de hacer utilizando la ventana huella accedida haciendo clic con el botón derecho del ratón sobre la huella de que se trate.

6.2. Corrigiendo una placa

A menudo es necesario corregir una placa tras la correspondiente modificación del esquema.

6.2.1. Pasos a seguir

  1. Cree un nuevo netlist a partir del esquema modificado. Si se han añadido nuevos componentes, asígneles sus huellas correspondientes en CvPcb.

  2. Lea el nuevo netlist en Pcbnew.

6.2.2. Borrando pistas incorrectas

Pcbnew le permite borrar automáticamente las pistas que sean incorrectas como resultado de las modificaciones en el netlist. Para realizarlo, marque la opción Eliminar del cuadro Pistas sin conectar de la ventana de carga de netlist:

images/Pcbnew_bad_tracks_deletion_option.png

Sin embargo, a menudo es más rápido modificar tales pistas a mano (la función DRC permite su identificación).

6.2.3. Componentes eliminados

Pcbnew puede borrar las huellas correspondientes a los componentes que hayan sido eliminados del esquema. Esta acción es opcional.

Esto es necesario porque a menudo hay huellas (agujeros para tornillos de fijación, por ejemplo) que se agregan durante el diseño de la PCB y que nunca aparecen en el esquema.

images/Pcbnew_extra_footprints_deletion_option.png

Si la opción "Huellas extra" está marcada, se eliminarán cualquier huella correspondiente a un componente que no se encuentra en el fichero netlist, a menos que tengan la opción "Bloqueada" activa. Es buena idea activar esta opción para huellas de elementos "mecánicos":

images/Pcbnew_unlock_footprint_option.png

6.2.4. Huellas modificadas

Si se modifica una huella en el netlist (utilizando CvPcb), la huella que ya se ha colocado no será modificada por Pcbnew a menos que se marque la opción correspondiente de Intercambiar huella en la ventana de importación del netlist:

images/Pcbnew_exchange_module_option.png

Cambiar una huella (sustituir una resistencia por otra de tamaño diferente, por ejemplo) puede realizarse directamente mediante la edición de la huella.

6.2.5. Opciones avanzadas - selección usando las marcas de tiempo

A veces se cambia la notación del esquema, sin cambios significativos en el circuito (esto afectaría por ejemplo a las referencias - como R5, U4 …). La PCB permanece, por tanto, sin cambios (a excepción de las marcas de serigrafía). Sin embargo, internamente, los componentes y las huellas están representados por sus referencias. En esta situación, la opción "Marca de tiempo" en la ventana de importación del netlist puede seleccionarse antes de volver a leer el fichero de netlist:

images/Pcbnew_module_selection_option.png

Con esta opción, Pcbnew ya no identifica las huellas por su referencia, sino por su marca de tiempo. La marca de tiempo se genera automáticamente por Eeschema (es la fecha y la hora cuando el componente fue colocado en el esquema).

Aviso
Debe tener mucho cuidado cuando utilice esta opción (¡Guarde el archivo antes!). Esto es asi dado que esta técnica es complicada en el caso de componentes que contengan múltiples partes (por ejemplo, un 7400 que tiene 4 partes dentro del mismo encapsulado). En esta situación, la marca de tiempo no se define de forma única (para el 7400 habrá hasta cuatro - una para cada parte). Sin embargo, la opción de marca de tiempo generalmente resuelve los problemas de re-anotación.

6.3. Intercambio directo de huellas ya colocadas en la placa

Cambiar una huella (o algunas huellas idénticas) por otra huella es algo útil, y muy fácil de realizar:

  1. Haga clic en una huella para abrir la ventana de Edición.

  2. Seleccione Cambiar Huellas

images/Pcbnew_change_modules_button.png

Opciones para Cambiar Huella(s):

images/Pcbnew_footprint_exchange_options.png

Debe elegir un nuevo nombre huella y uso:

  • Cambie la huella de xx para la huella actual

  • Cambie las huellas yy para todas las huellas iguales a la actual.

  • Cambiar huellas con el mismo valor par todas las huellas como la huella actual, restringido a los componentes que tengan el mismo valor.

  • Actualizar todas las huellas de la placa para recargar todas las huellas en la placa.

7. Footprint placement

7.1. Assisted placement

Whilst moving footprints the footprint ratsnest (the net connections) can be displayed to assist the placement. To enable this the icon images/icons/modratsnest.png of the left toolbar must be activated.

7.2. Manual placement

Select the footprint with the right mouse button then choose the Move command from the menu. Move the footprint to the required position and place it with the left mouse button. If required the selected footprint can also be rotated, inverted or edited. Select Cancel from the menu (or press the Esc key) to abort.

Here you can see the display of the footprint ratsnest during a move:

images/Pcbnew_ratsnest_during_move.png

The circuit once all the footprints are placed may be as shown:

images/Pcbnew_circuit_after_placement.png

7.3. General re-orientation of footprints

Initially all footprints inherit the same orientation that they had in the library (normally 0).

If an alternative orientation is required for an individual footprint, or all footprints (for example all vertical) use the menu option AutoPlace/Orient All Footprints. This orientation can be selective (for example to relate only to the footprints whose reference starts with "IC".

images/Pcbnew_footprints_orientation_dialog.png

7.4. Automatic Footprint Distribution

Generally speaking, footprints can only be moved if they have not been "Fixed". This attribute can be turned on and off from the pop-up window (click right mouse button over footprint) whilst in Footprint Mode, or through the Edit Footprint Menu.

As stated in the last chapter, new footprints loaded during the reading of the netlist appear piled up at a single location on the board. Pcbnew allows an automatic distribution of the footprints to make manual selection and placement easier.

  • Select the option "Footprint Mode" (Icon images/icons/mode_module.png on the upper toolbar).

  • The pop-up window activated by the right mouse button becomes:

If there is a footprint under the cursor:

images/Pcbnew_context_module_mode_module_under_cursor.png

If there is nothing under the cursor:

images/Pcbnew_context_module_mode_no_module_under_cursor.png

In both cases the following commands are available:

  • Spread out All Footprints allows the automatic distribution of all the footprints not Fixed. This is generally used after the first reading of a netlist.

  • Spread out Footprints not Already on Board allows the automatic distribution of the footprints which have not been placed already within the PCB outline. This command requires that an outline of the board has been drawn to determine which footprints can be automatically distributed.

7.5. Automatic placement of footprints

7.5.1. Characteristics of the automatic placer

The automatic placement feature allows the placement of footprints onto the 2 faces of the circuit board (however switching a footprint onto the copper layer is not automatic).

It also seeks the best orientation (0, 90, -90, 180 degrees) of the footprint. The placement is made according to an optimization algorithm, which seeks to minimize the length of the ratsnest, and which seeks to create space between the larger footprints with with many pads. The order of placement is optimized to initially place these larger footprints with many pads.

7.5.2. Preparation

Pcbnew can thus place the footprints automatically, however it is necessary to guide this placement, because no software can guess what the user wants to achieve.

Before an automatic placement is carried out one must:

  • Create the outline of the board (It can be complex, but it must be closed if the form is not rectangular).

  • Manually place the components whose positions are imposed (Connectors, clamp holes, etc).

  • Similarly, certain SMD footprints and critical components (large footprints for example) must be on a specific side or position on the board and this must be done manually.

  • Having completed any manual placement these footprints must be "Fixed" to prevent them being moved. With the Footprint Mode icon images/icons/mode_module.png selected right click on the footprint and pick "Fix Footprint" on the Pop-up menu. This can also be done through the Edit/Footprint Pop-up menu.

  • Automatic placement can then be carried out. With the Footprint Mode icon selected, right click and select Glob(al) Move and Place - then Autoplace All Footprints.

During automatic placement, if required, Pcbnew can optimize the orientation of the footprints. However rotation will only be attempted if this has been authorized for the footprint (see Edit Footprint Options).

Usually resistors and non-polarized capacitors are authorized for 180 degrees rotation. Some footprints (small transistors for example) can be authorized for +/- 90 and 180 degrees rotation.

For each footprint one slider authorizes 90 degree Rot(ation) and a second slider authorizes 180 degree Rot(ation). A setting of 0 prevents rotation, a setting of 10 authorizes it, and an intermediate value indicates a preference for/against rotation.

The rotation authorization can be done by editing the footprint once it is placed on the board. However it is preferable to set the required options to the footprint in the library as these settings will then be inherited each time the footprint is used.

7.5.3. Interactive auto-placement

It may be necessary during automatic placement to stop (press Esc key) and manually re-position a footprint. Using the command Autoplace Next Footprint will restart the autoplacement from the point at which it was stopped.

The command Autoplace new footprints allows the automatic placement of the footprints which have not been placed already within the PCB outline. It will not move those within the PCB outline even if they are not "fixed".

The command Autoplace Footprint makes it possible to re-place the footprint pointed to by the mouse, even if its fixed attribute is active.

7.5.4. Additional note

Pcbnew automatically determines the possible zone of placement of the footprints by respecting the shape of the board outline, which is not necessarily rectangular (It can be round, or have cutouts, etc).

If the board is not rectangular, the outline must be closed, so that Pcbnew can determine what is inside and what is outside the outline. In the same way, if there are internal cutouts, their outline will have to be closed.

Pcbnew calculates the possible zone of placement of the footprints using the outline of the board, then passes each footprint in turn over this area in order to determine the optimum position at which to place it.

8. Setting routing parameters

8.1. Current settings

8.1.1. Accessing the main dialog

The most important parameters are accessed from the following drop-down menu:

images/Pcbnew_design_rules_dropdown.png

and are set in the Design Rules dialog.

8.1.2. Current settings

Current settings are displayed in the top toolbar.

images/Pcbnew_design_rules_top_toolbar.png

8.2. General options

The General options menu is available via the top toolbar link Preferences → General dialog.

images/Pcbnew_preferences_menu.png

The dialog looks like the following:

images/Pcbnew_general_options_dialog.png

For the creation of tracks the necessary parameters are:

  • Tracks 45 Only: Directions allowed for track segments are 0, 45 or 90 degrees.

  • Double Segm Track: When creating tracks, 2 segments will be displayed.

  • Tracks Auto Del: When recreating tracks, the old one will be automatically deleted if considered redundant.

  • Magnetic Pads: The graphic cursor becomes a pad, centered in the pad area.

  • Magnetic Tracks: The graphic cursor becomes the track axis.

8.3. Netclasses

Pcbnew allows you to define different routing parameters for each net. Parameters are defined by a group of nets.

  • A group of nets is called a Netclass.

  • There is always a netclass called "default".

  • Users can add others Netclasses.

A netclass specifies:

  • The width of tracks, via diameters and drills.

  • The clearance between pads and tracks (or vias).

  • When routing, Pcbnew automatically selects the netclass corresponding to the net of the track to create or edit, and therefore the routing parameters.

8.3.1. Setting routing parameters

The choice is made in the menu: Design Rules → Design Rules.

8.3.2. Netclass editor

The Netclass editor allows you to:

  • Add or delete Netclasses.

  • Set routing parameters values: clearance, track width, via sizes.

  • Group nets in netclasses.

images/Pcbnew_design_rules_editor_netclass_tab.png

8.3.3. Global Design Rules

The global design rules are:

  • Enabling/disabling Blind/buried Vias use.

  • Enabling/disabling Micro Vias use.

  • Minimum Allowed Values for tracks and vias.

A DRC error is raised when a value smaller than the minimum value specified is encountered. The second dialog panel is:

images/Pcbnew_design_rules_editor_global_tab.png

This dialog also allows to enter a "stock" of tracks and vias sizes.

When routing, one can select one of these values to create a track or via, instead of using the netclass’s default value.

Useful in critical cases when a small track segment must have a specific size.

8.3.4. Via parameters

Pcbnew handles 3 types of vias:

  • Through vias (usual vias).

  • Blind or buried vias.

  • Micro Vias, like buried vias but restricted to an external layer to its nearest neighbor. They are intended to connect BGA pins to the nearest inner layer. Their diameter is usually very small and they are drilled by laser.

By default, all vias have the same drill value.

This dialog specifies the smallest acceptable values for via parameters. On a board, a via smaller than specified here generates a DRC error.

8.3.5. Track parameters

Specify the minimum acceptable track width. On a board, a track width smaller than specified here generates a DRC error.

8.3.6. Specific sizes

images/Pcbnew_specific_size_options.png

One can enter a set of extra tracks and/or vias sizes. While routing a track, these values can be used on demand instead of the values from the current netclass values.

8.4. Examples and typical dimensions

8.4.1. Track width

Use the largest possible value and conform to the minimum sizes given here.

Units CLASS 1 CLASS 2 CLASS 3 CLASS 4 CLASS 5

mm

0.8

0.5

0.4

0.25

0.15

mils

31

20

16

10

6

8.4.2. Insulation (clearance)

Units CLASS 1 CLASS 2 CLASS 3 CLASS 4 CLASS 5

mm

0.7

0.5

0.35

0.23

0.15

mils

27

20

14

9

6

Usually, the minimum clearance is very similar to the minimum track width.

8.5. Examples

8.5.1. Rustic

  • Clearance: 0.35mm (0.0138 inches).

  • Track width: 0.8mm (0.0315 inches).

  • Pad diameter for ICs and vias: 1.91mm (0.0750 inches ).

  • Pad diameter for discrete components: 2.54mm (0.1 inches).

  • Ground track width: 2.54mm (0.1 inches).

images/Pcbnew_dr_example_rustic.png

8.5.2. Standard

  • Clearance: 0.35mm (0.0138 inches).

  • Track width: 0.5mm (0.0127 inches).

  • Pad diameter for ICs: make them elongated in order to allow tracks to pass between IC pads and yet have the pads offer a sufficient adhesive surface (1.27 x 2.54 mm -→0.05x 0.1 inches).

  • Vias: 1.27mm (0.0500 inches).

images/Pcbnew_dr_example_standard.png

8.6. Manual routing

Manual routing is often recommended, because it is the only method offering control over routing priorities. For example, it is preferable to start by routing power tracks, making them wide and short and keeping analog and digital supplies well separated. Later, sensitive signal tracks should be routed. Amongst other problems, automatic routing often requires many vias. However, automatic routing can offer a useful insight into the positioning of footprins. With experience, you will probably find that the automatic router is useful for quickly routing the obvious tracks, but the remaining tracks will best be routed by hand.

8.7. Help when creating tracks

Pcbnew can display the full ratsnest, if the button images/icons/modratsnest.png is activated.

The button images/icons/net_highlight.png allows one to highlight a net (click to a pad or an existing track to highlight the corresponding net).

The DRC checks tracks in real time while creating them. One cannot create a track which does not match the DRC rules. It is possible to disable the DRC by clicking on the button. This is, however, not recommended, use it only in specific cases.

8.7.1. Creating tracks

A track can be created by clicking on the button images/icons/add_tracks.png . A new track must start on a pad or on another track, because Pcbnew must know the net used for the new track (in order to match the DRC rules).

images/Pcbnew_creating_new_track.png

When creating a new track, Pcbnew shows links to nearest unconnected pads, link number set in option "Max. Links" in General Options.

End the track by double-clicking, by the pop-up menu or by its hot key.

images/Pcbnew_track_in_progres_context.png

8.7.2. Moving and dragging tracks

When the button images/icons/add_tracks.png is active, the track where the cursor is positioned can be moved with the hotkey M. If you want to drag the track you can use the hotkey G.

8.7.3. Via Insertion

A via can be inserted only when a track is in progress:

  • By the pop-up menu.

  • By the hotkey V.

  • By switching to a new copper layer using the appropriate hotkey.

8.8. Select/edit the track width and via size

When clicking on a track or a pad, Pcbnew automatically selects the corresponding Netclass, and the track size and vias dimensions are derived from this netclass.

As previously seen, the Global Design Rules editor has a tool to insert extra tracks and vias sizes.

  • The horizontal toolbar can be used to select a size.

  • When the button images/icons/add_tracks.png is active, the current track width can be selected from the pop-up menu (accessible as well when creating a track).

  • The user can utilize the default Netclasses values or a specified value.

8.8.1. Using the horizontal toolbar

images/Pcbnew_track_toolbar.png

images/Pcbnew_track_toolbar_track_width_selection.png

Track width selection. The symbol * is a mark for default Netclass value selection.

images/Pcbnew_track_toolbar_track_width_selection_in_use.png

Selecting a specific track width value. The first value in list is always the netclass value. Others values are tracks widths entered from the Global Design Rules editor.

images/Pcbnew_track_toolbar_via_size_selection.png

Via size selection. The symbol * is a mark for default Netclass value selection.

images/Pcbnew_track_toolbar_via_size_selection_in_use.png

Selecting a specific via dimension value. The first value in list is always the netclass value. Others values are vias dimensions entered from the Global Design Rules editor.

images/icons/auto_track_width.png

When enabled: Automatic track width selection. When starting a track on an existing track, the new track has the same width as the existing track.

images/Pcbnew_track_toolbar_grid_size_selection.png

Grid size selection.

images/Pcbnew_track_toolbar_zoom_selection.png

Zoom selection.

8.8.2. Using the pop-up menu

One can select a new size for routing, or change to a previously created via or track segment:

images/Pcbnew_track_context_menu.png

If you want to change many via (or track) sizes, the best way is to use a specific Netclass for the net(s) that must be edited (see global changes).

8.9. Editing and changing tracks

8.9.1. Change a track

In many cases redrawing a track is required.

New track (in progress):

images/Pcbnew_new_track_in_progress.png

When finished:

images/Pcbnew_new_track_completed.png

Pcbnew will automatically remove the old track if it is redundant.

8.9.2. Global changes

Global tracks and via sizes dialog editor is accessible via the pop-up window by right clicking on a track:

images/Pcbnew_track_global_edit_context_menu.png

The dialog editor allows global changes of tracks and/or vias for:

  • The current net.

  • The whole board.

images/Pcbnew_track_global_edit_dialog.png

9. Interactive Router

The Interactive Router lets you quickly and efficiently route your PCBs by shoving off or walking around items on the PCB that collide with the trace you are currently drawing.

Following modes are supported:

  • Highlight collisions, which highlights all violating objects with a nice, shiny green color and shows violating clearance regions.

  • Shove, attempting to push and shove all items colliding with the currently routed track.

  • Walk around, trying to avoid obstacles by hugging/walking around them.

9.1. Setting up

Before using the Interactive Router, please set up these two things:

  • Clearance settings To set the clearances, open the Design Rules dialog and make sure at least the default clearance value looks sensible.

Rules editor
  • Enable OpenGL mode By selecting View→Switch canvas to OpenGL menu option or pressing F11.

OpenGL mode

9.2. Laying out tracks

To activate the router tool press the Interactive Router button Interactive Router Button or the X key. The cursor will turn into a cross and the tool name, will appear in the status bar.

To start a track, click on any item (a pad, track or a via) or press the X key again hovering the mouse over that item. The new track will use the net of the starting item. Clicking or pressing X on empty PCB space starts a track with no net assigned.

Move the mouse to define shape of the track. The router will try to follow the mouse trail, hugging unmovable obstacles (such as pads) and shoving colliding traces/vias, depending on the mode. Retreating the mouse cursor will cause the shoved items to spring back to their former locations.

Clicking on a pad/track/via in the same net finishes routing. Clicking in empty space fixes the segments routed so far and continues routing the trace.

In order to stop routing and undo all changes (shoved items, etc.), simply press Esc.

Pressing V or selecting Place Through Via from the context menu while routing a track attaches a via at the end of the trace being routed. Pressing V again disables via placement. Clicking in any spot establishes the via and continues routing.

Pressing / or selecting Switch Track Posture from the context menu toggles the direction of the initial track segment between straight or diagonal.

Nota
By default, the router snaps to centers/axes of the items. Snapping can be disabled by holding Shift while routing or selecting items.

9.3. Setting track widths and via sizes

There are several ways to pre-select a track width/via size or to change it during routing:

  • Use standard KiCad shortcuts.

  • Press W or select Custom Track Width from the context menu to type in a custom track width/via size.

  • Pick a predefined width from the Select Track Width sub-menu of the context menu.

  • Select Use the starting track width in the Select Track Width menu to pick the width from the start item (or the traces already connected to it).

9.4. Dragging

The router can drag track segments, corners and vias. To drag an item, click on it with Ctrl key pressed, hover the mouse and press G or select Drag Track/Via from the context menu. Finish dragging by clicking again or abort by pressing Esc.

9.5. Options

The router behavior be configured by pressing E or selecting Routing Options from the context menu while in the Track mode. It opens a window like the one below:

The options are:

Router options window screenshot
  • Mode - select how the router handles DRC violation (shoving, walking around, etc.)

  • Shove vias - when disabled, vias are treated as un-movable objects and hugged instead of shoved.

  • Jump over obstacles - when enabled, the router tries to move colliding traces behind solid obstacles (e.g. pads) instead of "reflecting" back the collision

  • Remove redundant tracks - removes loops while routing (e.g. if the new track ensures same connectivity as an already existing one, the old track is removed). Loop removal works locally (only between the start and end of the currently routed trace).

  • Automatic neckdown - when enabled, the router tries to break out pads/vias in a clean way, avoiding acute angles and jagged breakout traces.

  • Smooth dragged segments - when enabled, the router attempts to merge several jagged segments into a single straight one (dragging mode).

  • Allow DRC violations (Highlight collisions mode only) - allows to establish a track even if is violating the DRC rules.

  • Optimizer effort - defines how much time the router shall spend optimizing the routed/shoved traces. More effort means cleaner routing (but slower), less effort means faster routing but somewhat jagged traces.

10. Creating copper zones

Copper zones are defined by an outline (closed polygon), and can include holes (closed polygons inside the outline). A zone can be drawn on a copper layer or alternatively on a technical layer.

10.1. Creating zones on copper layers

Pad (and track) connections to filled copper areas are checked by the DRC engine. A zone must be filled (not just created) to connect pads. Pcbnew currently uses track segments or polygons to fill copper areas.

Each option has its advantages and its disadvantages, the main disadvantage being increased screen redraw time on slower machines. The final result is however the same.

For calculation time reasons, the zone filling is not recreated after each change, but only:

  • If a filling zone command is executed.

  • When a DRC test is performed.

Copper zones must be filled or refilled after changes in tracks or pads are made. Copper zones (usually ground and power planes) are usually attached to a net.

In order to create a copper zone you should:

  • Select parameters (net name, layer…). Turning on the layer and highlighting this net is not mandatory but it is good practice.

  • Create the zone limit (If not, the entire board will be filled.).

  • Fill the zone.

Pcbnew tries to fill all zones in one piece, and usually, there will be no unconnected copper blocks. It can happen that some areas remain unfilled. Zones having no net are not cleaned and can have insulated areas.

10.2. Creating a zone

10.2.1. Creating the limits of a zone

Use the tool images/icons/add_zone.png . The active layer must be a copper layer. When clicking to start the zone outline, the following dialog box will be opened.

images/Pcbnew_zone_properties_dialog.png

You can specify all parameters for this zone:

  • Net

  • Layer

  • Filling options

  • Pad options

  • Priority level

Draw the zone limit on this layer. This zone limit is a polygon, created by a left-clicking at each corner. A double-click will end and close the polygon. If the starting point and ending point are not at the same coordinate, Pcbnew will add a segment from the end point to the start point.

Nota
  • The DRC control is active when creating zone outlines.

  • A corner which creates a DRC error will not be accepted by Pcbnew.

In the following image you can see an example of a zone limit (polygon in thin hatched line):

images/Pcbnew_zone_limit_example.png

10.2.2. Priority level

Sometimes a small zone must be created inside a large zone.

This is possible if the small zone has a higher priority level than the large zone.

Level setting:

images/Pcbnew_zone_priority_level_setting.png

Here is an example:

images/Pcbnew_zone_priority_example.png

After filling:

images/Pcbnew_zone_priority_example_after_filling.png

10.2.3. Filling the zone

When filling a zone, Pcbnew removes all unconnected copper islands. To access the zone filling command, right-click on the edge zone.

images/Pcbnew_zone_context_menu.png

Activate the "Fill Zone" command. Below is the filling result for a starting point inside the polygon:

images/Pcbnew_zone_filling_result.png

The polygon is the border of the filling area. You can see a non-filled area inside the zone, because this area is not accessible:

  • A track creates a border, and

  • There is no starting point for filling in this area.

Nota
You can use many polygons to create cutout areas. Here you can see an example:
images/Pcbnew_zone_filled_with_cutout.png

10.3. Filling options

images/Pcbnew_zone_filling_options.png

When you fill an area, you must choose:

  • The mode for filling.

  • The clearance and minimum copper thickness.

  • How pads are drawn inside the zone (or connected to this zone).

  • Thermal relief parameters.

10.3.1. Filling mode

Zones can be filled using polygons or segments. The result is the same. If you have problems with polygon mode (slow screen refresh) you should use segments.

10.3.2. Clearance and minimum copper thickness

A good choice for clearance is a grid that is a bit bigger than the routing grid. Minimum copper thickness value ensures that there are no too small copper ares.

Aviso
if this value is too large, small shapes like thermal stubs in thermal reliefs cannot be drawn.

10.3.3. Pad options

Pads of the net can either be included or excluded from the zone, or connected by thermal reliefs.

  • If included, soldering and un-soldering can be very difficult due to the high thermal mass of the large copper area.

images/Pcbnew_zone_include_pads.png
  • If excluded, the connection to the zone will not be very good.

    • The zone can be filled only if tracks exists to connect zones areas.

    • Pads must be connected by tracks.

images/Pcbnew_zone_exclude_pads.png
  • A thermal relief is a good compromise.

    • Pad is connected by 4 track segments.

    • The segment width is the current value used for the track width.

images/Pcbnew_zone_thermal_relief.png

10.3.4. Thermal reliefs parameters

images/Pcbnew_thermal_relief_settings.png

You can set two parameters for thermal reliefs:

images/Pcbnew_thermal_relief_parameters.png

10.3.5. Choice of parameters

The copper width value for thermal reliefs must be bigger than the minimum thickness value for the copper zone. If not, they cannot be drawn.

Additionally, a too large value for this parameter or for antipad size does not allow one to create a thermal relief for small pads (like pad sizes used for SMD components).

10.4. Adding a cutout area inside a zone

A zone must already exist. To add a cutout area (a non-filled area inside the zone):

  • Right-click on an existing edge outline.

  • Select Add Cutout Area.

images/Pcbnew_add_cutout_menu_item.png
  • Create the new outline.

images/Pcbnew_zone_unfilled_cutout_outline.png

10.5. Outlines editing

An outline can be modified by:

  • Moving a corner or an edge.

  • Deleting or adding a corner.

  • Adding a similar zone, or a cutout area.

If polygons are overlapping they will be combined.

images/Pcbnew_zone_modification_menu_items.png

To do that, right-click on a corner or on an edge, then select the proper command.

Here is a corner (from a cutout) that has been moved:

images/Pcbnew_zone_corner_move_during.png

Here is the final result:

images/Pcbnew_zone_corner_move_after.png

Polygons are combined.

10.5.1. Adding a similar zone

Adding the similar zone:

images/Pcbnew_zone_add_similar_during.png

Final result:

images/Pcbnew_zone_add_similar_after.png

10.6. Editing zone parameters

When right-clicking on an outline, and using Edit Zone Params the Zone params Dialog box will open. Initial parameters can be inputted . If the zone is already filled, refilling it will be necessary.

10.7. Final zone filling

When the board is finished, one must fill or refill all zones. To do this:

  • Activate the tool zones via the button images/icons/add_zone.png .

  • Right-click to display the pop-up menu.

  • Use Fill or Refill All Zones: images/Pcbnew_fill_refill_all_zones.png

Aviso
Calculation can take some time if the filling grid is small.

10.8. Change zones net names

After editing a schematic, you can change the name of any net. For instance VCC can be changed to +5V.

When a global DRC control is made Pcbnew checks if the zone net name exists, and displays an error if not.

Manually editing the zone parameters will be necessary to change the old name to the new one.

10.9. Creating zones on technical layers

10.9.1. Creating zone limits

This is done using the button . The active layer must be a technical layer.

When clicking to start the zone outline, this dialog box is opened:

images/Pcbnew_technical_layer_zone_dialog.png

Select the technical layer to place the zone and draw the zone outline like explained previously for copper layers.

Nota
  • For editing outlines use the same method as for copper zones.

  • If necessary, cutout areas can be added.

10.10. Creating a Keepout area

Select the tool images/icons/add_keepout_area.png

The active layer should be a copper layer.

After clicking on the starting point of a new keepout area, the dialog box is opened:

images/Pcbnew_keepout_area_properties.png

One can select disallowed items:

  • Tracks.

  • Vias.

  • Copper pours.

When a track or a via is inside a keepout which does not allow it, a DRC error will be raised.

For copper zones, the area inside a keepout with no copper pour will be not filled. A keep-out area is a like a zone, so editing its outline is analogous to copper zone editing.

11. Files for circuit fabrication

Let us see now what are the steps necessary for the creation of the necessary files for the production of your printed circuit board.

All files generated by KiCad are placed in the working directory which is the same directory that contains the xxxx.brd file for the printed circuit board.

11.1. Final preparations

The generation of the necessary files for the production of your printed circuit board includes the following preparatory steps.

  • Mark any layer (e.g., top or front and bottom or back) with the project name by placing appropriate text upon each of the layers.

  • All text on copper layers (sometimes called solder or bottom) must be mirrored.

  • Create any ground planes, modifying traces as required to ensure they are contiguous.

  • Place alignment crosshairs and possibly the dimensions of the board outline (these are usually placed on one of the general purpose layers).

Here is an example showing all of these elements, except ground planes, which have been omitted for better visibility:

images/Pcbnew_final_preparation_example_board.png

A color key for the 4 copper layers has also been included: images/Pcbnew_layer_colour_key.png

11.2. Final DRC test

Before generating the output files, a global DRC test is very strongly recommended.

Zones are filled or refilled when starting a DRC. Press the button images/icons/drc.png to launch the following DRC dialog:

images/Pcbnew_DRC_dialog.png

Adjust the parameters accordingly and then press the "Start DRC" button.

This final check will prevent any unpleasant surprises.

11.3. Setting coordinates origin

Set the coordinates origin for the photo plot and drill files, one must place the auxiliary axis on this origin. Activate the icon images/icons/pcb_offset.png . Move the auxiliary axis by left-clicking on the chosen location.

images/Pcbnew_setting_pcb_origin.png

11.4. Generating files for photo-tracing

This is done via the Files/Plot menu option and invokes the following dialog:

images/Pcbnew_plot_dialog.png

Usually, the files are in the GERBER format. Nevertheless, it is possible to produce output in both HPGL and POSTSCRIPT formats. When Postscript format is selected, this dialog will appear.

images/Pcbnew_plot_postscript_dialog.png

In these formats, a fine scale adjust can be used to compensate for the plotter accuracy and to have a true scale of 1 for the output:

images/Pcbnew_plot_fine_scale_setting.png

11.4.1. GERBER format

For each layer, Pcbnew generates a separate file following the GERBER 274X standard, by default in 4.6 format (each coordinate in the file is represented by 10 digits, of which 4 are before the decimal point and 6 follow it), units in inches, and a scale of 1.

It is normally necessary to create files for all of the copper layers and, depending on the circuit, for the silkscreen, solder mask, and solder paste layers. All of these files can be produced in one step, by selecting the appropriate check boxes.

For example, for a double-sided circuit with silkscreen, solder mask and solder paste (for SMD components), 8 files should be generated (xxxx represents the name of the .brd file).

  • xxxx-F_Cu.gbr for the component side.

  • xxxx-B_Cu.gbr for the copper side.

  • xxxx-F_SilkS.gbr for the component-side silkscreen markings.

  • xxxx-B_SilkS.gbr for the copper-side silkscreen markings.

  • xxxx-F_Paste.gbr for the component-side solder paste.

  • xxxx-B_Paste.gbr for the copper-side solder paste.

  • xxxx-F_Mask.gbr for the component-side solder mask.

  • xxxx-B_Mask.gbr for the copper-side solder mask.

GERBER file format:

The format used by Pcbnew is RS274X format 4.6, Imperial, Leading zero omitted, Abs format. These are very usual settings.

11.4.2. POSTSCRIPT format

The standard extension for the output files is .ps in the case of postscript output. As for HPGL output, the tracing can be at user-selected scales and can be mirrored. If the Org = Centre option is active, the origin for the coordinates of the tracing table is assumed to be in the centre of the drawing.

If the Print Sheet Ref option is active, the sheet cartridge is traced.

11.4.3. Plot options

Gerber format:

images/Pcbnew_plot_options_gerber.png

Other formats:

images/Pcbnew_plot_options_other_formats.png

GERBER format specific options:

Use Protel filename extensions

Use .gbl .gtl .gbs .gts .gbp .gtp .gbo .gto instead of .gbr for file name extensions.

Include extended attributes

Output extended attributes to file.

Subtract soldermask from silkscreen

Remove all Silk from solder paste areas.

11.4.4. Other formats

The standard extension depends on the output file type.

Some options are not available for some formats.

The plot can be done at user-selected scales and can be mirrored.

The Print Drill Opt list offers the option of pads that are filled, drilled to the correct diameter or drilled with a small hole (to guide hand drilling).

If the Print Sheet Ref option is active, the sheet cartridge is traced.

11.5. Global clearance settings for the solder stop and the solder paste mask

Mask clearance values can be set globally for the solder mask layers and the solder paste layers. These clearances can be set at the following levels.

  • At pads level.

  • At footprint level.

  • Globally.

And Pcbnew uses by priority order.

  • Pad values. If null:

  • Footprint values. If null:

  • Global values.

11.5.1. Access

The menu option for this is available via the Dimensions menu:

images/Pcbnew_pad_mask_clearance_menu_item.png

The dialog box is the following:

images/Pcbnew_pad_mask_settings_dialog.png

11.5.2. Solder mask clearance

A value near to 0.2 mm is usually good. This value is positive because the mask is usually bigger than the pad.

One can set a minimum value for the solder mask width, between 2 pads.

If the actual value is smaller than the minimum value, the 2 solder mask shapes will be merged.

11.5.3. Solder paste clearance

The final clearance is the sum of the solder paste clearance and a percentage of the pad size.

This value is negative because the mask is usually smaller than the pad.

11.6. Generating drill files

The creation of a drill file xxxx.drl following the EXCELLON standard is always necessary.

One can also produce an optional drill report, and an optional drill map.

  • The drill map can be plotted using several formats.

  • The drill report is a plain text file.

The generation of these files is controlled via:

  • "Create Drill File" button, or

  • Files/Fabrication Outputs/Drill file menu selection.

The Drill tools dialog box will be the following:

images/Pcbnew_drill_file_dialog.png

For setting the coordinate origin, the following dialog box is used:

images/Pcbnew_drill_origin_setting.png
  • Absolute: absolute coordinate system is used.

  • Auxiliary axis: coordinates are relative to the auxiliary axis, use the icon (right toolbar) to set it.

11.7. Generating wiring documentation

To produce wiring documentation files, the component and copper silkscreen layers can be traced. Usually, just the component-side silkscreen markings are sufficient for wiring a PCB. If the copper-side silkscreen is used, the text it contains should be mirrored in order to be readable.

11.8. Generation of files for automatic component insertion

This option is accessed via the Postprocess/Create Cmp file menu option. However, no file will be generated unless at least one footprint has the Normal+Insert attribute activated (see Editing Footprints). One or two files will be produced, depending upon whether insertable components are present on one or both sides of the PCB. A dialogue box will display the names of the file(s) created.

11.9. Advanced tracing options

The options described below (part of the Files/Plot dialogue) allow for fine-grained control of the tracing process. They are particularly useful when printing the silkscreen markings for wiring documentation.

images/Pcbnew_advanced_tracing_options.png

The available options are:

Plot sheet reference on all layers

Trace sheet outline and the cartridge.

Plot pads on silkscreen

Enables/disables printing of pad outlines on the silkscreen layers (if the pads have already been declared to appear on these layers). Prevents any pads from being printed in the disabled mode.

Plot footprint values

Enables printing of VALUE text on the silkscreen.

Plot footprint references

Enables printing of the REFERENCE text on the silkscreen.

Force plotting of invisible values/references

Forces printing of fields (reference, value) declared as invisible. In combination with Plot footprint values and Plot footprint references, this option enables production of documents for guiding wiring and repair. These options have proven necessary for circuits using components that are too small (SMD) to allow readable placement of two separate text fields.

Do not tent vias

Delete the mask over the vias.

Exclude PCB edge layer from other layers

GERBER format specific. Do not plot graphic items on edge layer.

Use Protel filename extensions

GERBER format specific. When creating files, use specific extensions foe each file. If disabled the Gerber file extension is .gbr.

12. Footprint Editor - Managing Libraries

12.1. Overview of Footprint Editor

Pcbnew can simultaneously maintain several libraries. Thus, when a footprint is loaded, all libraries that appear in the library list are searched until the first instance of the footprint is found. In what follows, note that the active library is the library selected within the Footprint Editor, the program will now be described

Footprint Editor enables the creation and the editing of footprints:

  • Añadir y eliminar pads.

  • Changing pad properties (shape, layer) for individual pads or globally for all pads of a footprint.

  • Editing graphic elements (lines, text).

  • Editing information fields (value, reference, etc.).

  • Editar la documentación asociada (descripción, palabras clave).

Footprint Editor allows the maintenance of the active library as well by:

  • Listing the footprints in the active library.

  • Deletion of a footprint from the active library.

  • Saving a footprint to the active library.

  • Saving all of the footprints contained by a printed circuit.

It is also possible to create new libraries.

The library extension is .mod.

12.2. Accessing Footprint Editor

The Footprint Editor can be accessed in two different ways:

  • Directly, via the icon images/icons/module_editor.png in the main toolbar of Pcbnew.

  • In the edit dialog for the active footprint (see figure below: accessed via the context menu), there is the button Footprint Editor.

images/Pcbnew_module_properties.png

In this case, the active footprint of the board will be loaded automatically in Footprint Editor, enabling immediate editing or archiving.

12.3. Footprint Editor user interface

By calling Footprint Editor the following window will appear:

images/Modedit_main_window.png

12.4. Top toolbar in Footprint Editor

images/Modedit_top_toolbar.png

From this toolbar, the following functions are available:

images/icons/library.png

Select the active library.

images/icons/save_library.png

Save the current footprint to the active library, and write it to disk.

images/icons/new_library.png

Create a new library and save the current footprint in it.

images/icons/modview_icon.png

Open the Footprint Viewer

images/icons/delete.png

Access a dialog for deleting a footprint from the active library.

images/icons/new_footprint.png

Create a new footprint.

images/icons/module_wizard.png

Create a footprint using a wizard

images/icons/load_module_lib.png

Load a footprint from the active library.

images/icons/load_module_board.png

Load (import) a footprint from the printed circuit board.

images/icons/update_module_board.png

Export the current footprint to the printed circuit board. when the footprint was previously imported from the current board. It will replace the corresponding footprint on the board (i.e., respecting position and orientation).

images/icons/insert_module_board.png

Export the current footprint to the printed circuit board. It will be copied on to the printed circuit board at position 0.

images/icons/import_module.png

Import a footprint from a file created by the Export command.

images/icons/export_module.png

Export a footprint. This command is essentially identical to that for creating a library, the only difference being that creates a library in the user directory, while creates a library in the standard library directory (usually kicad/modules).

images/icons/undo.png images/icons/redo.png

Undo and Redo

images/icons/module_options.png

Invokes the footprint properties dialog.

images/icons/print_button.png

Call the print dialog.

images/icons/zoom_in.png images/icons/zoom_out.png images/icons/zoom_redraw.png images/icons/zoom_fit_in_page.png

Standard zoom commands.

images/icons/options_pad.png

Call the pad editor.

images/icons/module_check.png

Perform a check of footprint correctness

12.5. Creating a new library

The creation of a new library is done via the button images/icons/new_library.png , in this case the file is created by default in the library directory or via the button images/icons/export_module.png , in which case the file is created by default in your working directory.

A file-choosing dialog allows the name of the library to be specified and its directory to be changed. In both cases, the library will contain the footprint being edited.

Aviso
If an old library of the same name exists, it will be overwritten without warning.

12.6. Saving a footprint in the active library

The action of saving a footprint (thereby modifying the file of the active library) is performed using this button images/icons/save_library.png . If a footprint of the same name already exists, it will be replaced. Since you will depend upon the accuracy of the library footprints, it is worth double-checking the footprint before saving.

It is recommended to edit either the reference or value field text to the name of the footprint as identified in the library.

12.7. Transferring a footprint from one library to another

  • Select the source library via the button images/icons/library.png .

  • Load the footprint via the button images/icons/load_module_lib.png .

  • Select the destination library via the button images/icons/library.png .

  • Save the footprint via the button images/icons/save_library.png

You may also wish to delete the source footprint.

  • Reselect the source library with images/icons/library.png

  • Delete the old footprint via the button images/icons/delete.png

12.8. Saving all footprints of your board in the active library

It is possible to copy all of the footprints of a given board design to the active library. These footprints will keep their current library names. This command has two uses:

  • To create an archive or complete a library with the footprints from a board, in the event of the loss of a library.

  • More importantly, it facilitates library maintenance by enabling the production of documentation for the library, as below.

12.9. Documentation for library footprints

It is strongly recommended to document the footprints you create, in order to enable rapid and error-free searching.

For example, who is able to remember all of the multiple pin-out variants of a TO92 package? The Footprint Properties dialog offers a simple solution to this problem.

images/Modedit_module_properties.png

This dialog accepts:

  • A one-line comment/description.

  • Varias palabras clave.

The description is displayed with the component list in Cvpcb and, in Pcbnew, it is used in the footprint selection dialogs.

The keywords enable searches to be restricted to those footprints corresponding to particular keywords.

When directly loading a footprint (the icon images/icons/module.png of the right-hand Pcbnew toolbar), keywords may be entered in the dialog box. Thus, entering the text =CONN will cause the display of the list of footprints whose keyword lists contain the word CONN.

It is recommended to create libraries indirectly, by creating one or more auxiliary circuit boards that constitute the source of (part of) the library, as follows: Create a circuit board in A4 format, in order to be able to print easily to scale (scale = 1).

Create the footprints that the library will contain on this circuit board. The library itself will be created with the File/Archive footprints/Create footprint archive command.

images/Pcbnew_archive_footprints_menu.png

The "true source" of the library will thus be the auxiliary circuit board, and it is on this circuit that any subsequent alterations of footprints will be made. Naturally, several circuit boards can be saved in the same library.

It is generally a good idea to make different libraries for different kinds of components (connectors, discretes,…), since Pcbnew is able to search many libraries when loading footprints.

Here is an example of such a library source:

images/Pcbnew_example_library.png

This technique has several advantages:

  • The circuit can be printed to scale and serve as documentation for the library with no further effort.

  • Future changes of Pcbnew may require regeneration of the libraries, something that can be done very quickly if circuit-board sources of this type have been used. This is important, because the circuit board file formats are guaranteed to remain compatible during future development, but this is not the case for the library file format.

12.11. Footprint Libraries Management

The list of footprint libraries in Pcbnew can be edited using the Footprint Libraries Manager. This allows you to add and remove footprint libraries by hand, and also allows you to invoke the Footprint Libraries Wizard by pressing the "Append With Wizard" button.

The Footprint Libraries Wizard can also be invoked through the Preferences menu, and can automatically add a library (detecting its type) from a file or from a Github URL. The URL for the official libraries is: https://github.com/KiCad

More details about footprint library tables and the Manager and Wizard can be found in the CvPcb Reference Manual in the section Footprint Library Tables.

12.12. 3D Shapes Libraries Management

The 3D shape libraries can be downloaded by 3D Shape Libraries Wizard. It can be invoked from the menu Preferences → 3D Shapes Libraries Downloader.

13. Editor de huellas - Creando y Editando Huellas

13.1. Resumen del Editor de Huellas

El Editor de Huellas es usado para crear y editar huellas de componentes. Esto incluye:

  • Añadir y eliminar pads.

  • Cambiar la propiedades de los pads (forma, capa), para cada pad o para todos los pads de la huella

  • Añadir y editar elementos gráficos (contorno, texto).

  • Editar campos (valor, referencia, etc.).

  • Editar la documentación asociada (descripción, palabras clave).

13.2. Elementos de las huellas

Una huella es la representación física (huella) del componente que va a ser insertado en la PCB y debe estar relacionada con el símbolo representado en el esquema. Cada huella incluye tres elementos diferentes:

  • Los pads.

  • El contorno gráfico y textos.

  • Campos.

Además, cierto número de parámetros adicionales deben definirse correctamente si se utiliza la función de auto-colocación. Lo mismo vale para la generación de archivos de auto-inserción.

13.2.1. Pads

Dos propiedades de los pads son importantes:

  • Su geometría (forma, capas, taladros).

  • Su número de pad, que está constituido por un máximo de cuatro caracteres alfanuméricos. Por lo tanto, los siguientes son números de pad válidos: 1, 45 y 9999, y también AA56 y ANOD. El número del pad debe ser idéntico al número del pin correspondiente del esquema, porque esto define las parejas de pin y pad que serán enlazados por Pcbnew.

13.2.2. Contorno

El contorno gráfico se utiliza para dibujar la forma física de la huella. Existen diferentes tipos de contorno disponibles: líneas, círculos, arcos y texto. El contorno no contiene significado eléctrico, son simplemente ayudas gráficas.

13.2.3. Campos

Estos son elementos de texto asociados a una huella. Dos de ellos son obligatorios y siempre están presentes: el campo referencia y el campo valor. Estos son automáticamente leídos y actualizados por Pcbnew cuando se lee el netlist durante la carga de has huellas a la placa. La referencias es reemplazada por la referencia apropiada del esquema (U1, IC3, etc.). El valor es reemplazado por el valor del correspondiente componente en el esquema (47K, 74LS02, etc.). Pueden añadirse otros campos y se comportaran también como elementos gráficos de texto.

13.3. Iniciar el Editor de Huellas y seleccionar una huella a editar

El editor de huellas puede iniciarse de dos maneras:

  • Directamente vía el icono images/icons/module_editor.png desde la barra de herramientas principal de Pcbnew. Esto permite la creación o modificación de una huella en la biblioteca.

  • Haciendo doble clic sobre una huella se abre el menú de Propiedades de la huella, el cual le ofrece el botón Editor de huellas. Si se usa esta opción, la huella de la placa se cargará en el editor, para su modificación o para guardarla.

13.4. Barras de Herramientas del Editor de Huellas

Ejecutar el Editor de Huellas lanzará una nueva ventana parecida a esta:

images/Modedit_main_window.png

13.4.1. Barra de herramientas de edición (lado derecho)

Esta barra de herramientas contiene herramientas para:

  • Colocar pads.

  • Añadir elementos gráficos (contornos, texto).

  • Posicionar el punto de anclaje.

  • Borrar elementos.

Las funciones especificas son las siguientes:

images/icons/cursor.png

Ninguna herramienta seleccionada.

images/icons/pad.png

Añadir pads.

images/icons/add_polygon.png

Dibujar segmentos de línea y polilíneas

images/icons/add_circle.png

Dibujar círculos.

images/icons/add_arc.png

Dibujar arcos de círculo.

images/icons/add_text.png

Añadir texto como elementos gráficos (Los campos no se gestionan con esta herramienta).

images/icons/anchor.png

Posicionar el punto de anclaje de la huella.

images/icons/delete.png

Borrar elementos.

images/icons/grid_select_axis.png

Origen de la rejilla (desplazamiento) Útil para la colocación de los pads. El origen de la rejilla puede situarse sobre un punto concreto (el primer pad a situar), y después puede ajustarse el tamaño de la rejilla a la distancia entre pads De esta forma, colocar los pads resulta muy sencillo.

13.4.2. Barra de herramientas de visualización (lado izquierdo)

Estas herramientas controlan las opciones de visualización del Editor de Huellas:

images/icons/grid.png

Muestra la rejilla.

images/icons/polar_coord.png

Muestra las posiciones como coordenadas polares.

images/icons/unit_mm.png images/icons/unit_inch.png

Usa las unidades en milímetros o pulgadas

images/icons/cursor_shape.png

Activa la visualización extendida del cursor

images/icons/pad_sketch.png

Muestra los pads en modo contorno.

images/icons/text_sketch.png

Muestra los textos en modo contorno.

images/icons/show_mod_edge.png

Muestra los bordes en modo contorno.

images/icons/contrast_mode.png

Activa el modo alto-contraste

13.5. Menús Contextuales

El botón derecho del ratón despliega un menú que depende de que elemento se encuentre bajo el cursor.

El menú contextual para la edición de los parámetros en las huellas:

images/Modedit_context_menu_module_parameters.png

El menú contextual para la edición de pads:

images/Modedit_context_menu_pads.png

El menú contextual para la edición de elementos gráficos:

images/Modedit_context_menu_graphics.png

13.6. Ventana de propiedades de huellas

Esta ventana puede ejecutarse cuando el cursor esta sobre una huella haciendo clic con el botón derecho y eligiendo Editar con el Editor de Huellas

images/Modedit_module_properties_dialog.png

Esta ventana puede usarse para definir los principales parámetros de las huellas.

13.7. Creando una nueva huella

Puede crearse una nueva huella mediante el icono images/icons/new_footprint.png . Se solicitará el nombre de la nueva huella. Este será el nombre con el que la huella será identificada dentro de la biblioteca.

Este texto también sirve como el valor de la huella, y se sustituye en última instancia por su valor real (100uF_16V, 100_0.5W, …).

La nueva huella requiere:

  • Contornos (y posiblemente elementos de texto).

  • Pads.

  • Un valor (texto oculto que es reemplazado por el valor real cuando se use).

Método alternativo.

Cuando una huella nueva es similar a una huella ya existente en una biblioteca o en una placa de circuito, puede seguir un método alternativo y mas rápido para crear la nueva huella así:

  • Cargue la huella similar ( images/icons/load_module_lib.png , images/icons/load_module_board.png o images/icons/import_module.png ).

  • Modifique el campo "Nombre de la Huella en la Biblioteca" para generar un nuevo identificador (nombre).

  • Edite y guarde la nueva huella.

13.8. Añadiendo y editando pads

Una vez que se ha creado una huella, pueden añadirse pads, borrarse o modificarse. La modificación de los pads puede ser local, afectando solo al pad bajo e cursor, o global, afectando a todos los pads de la huella.

13.8.1. Añadiendo pads

Seleccione el icono images/icons/pad.png de la barra de herramientas del lado derecho. Los pads pueden añadirse haciendo clic en la posición deseada con el botón izquierdo del ratón. Las propiedades del pad pueden predefinirse en el menú de opciones de pad.

No olvide añadir el numero del pad.

13.8.2. Propiedades de ajustes del pad

Estas pueden realizarse de tres maneras distintas.

  • Seleccionando el icono images/icons/options_pad.png de la barra de herramientas horizontal.

  • Haciendo clic en un pad existente y seleccionando Editar Pad. Los ajustes del pad ahora pueden editarse.

  • Haciendo clic sobre un pad existente y seleccionando Exportar Ajustes de pad. En este caso, las propiedades geométricas del pad seleccionado se convertirán en las propiedades de pad predeterminadas.

En los dos primeros casos, se mostrará la siguiente ventana:

images/Modedit_pad_properties_dialog.png

Debe poner cuidado en definir correctamente las capas a las que pertenecen los elementos del pad. En particular, aunque las capas de cobre son fáciles de definir, la gestión del resto de capas (mascara de soldadura, pasta de soldadura …) son igualmente importante para la fabricación y documentación de la placa.

El selector de Tipo de Pad selecciona automáticamente un conjunto de capas que generalmente es suficiente.

Pads rectangulares

Para huellas SMD del tipo VQFP/PQFP que tienen pads de forma rectangular en cada una de sus cuatro caras (tanto horizontales como verticales) es recomendado usar solo una forma (por ejemplo, un rectángulo horizontal) y colocarlo con distintas orientaciones (0 para horizontal y 90 grados para vertical). Cambiar el tamaño de los pads de forma global puede realizarse con una simple operacion.

Rotar pads

Las rotaciones de -90 o -180 grados solo son requeridas para pads trapezoidales usados en huellas de microondas.

Pads tipo taladro no metalizado

Los pads pueden definirse como taladros no metalizados (pads NPTH, del ingles Non-Plated Through Hole).

Estos pads deben ser definidos en una o todas las capas de cobre (obviamente, el taladro existe en todas las capas de cobre).

Este requisito le permite definir un parámetro de margen especifico (por ejemplo, margen para un tornillo).

Cuando el tamaño del agujero de un pad es igual que el tamaño del pad, para un pad circular u oval, este pad no se representa en las capas de cobre en los ficheros GERBER.

Estos pads se usan con propósitos mecánicos, por lo que no esta habilitados los campos de nombre del pad o del nodo. No es posible conectarlos a ningún nodo del circuito.

Pads en capas no metalicas

Este tipo de pads son poco usuales. Esta opción puede usarse para crear fiduciales o mascaras en las capas técnicas.

Parámetro offset

El pad 3 tiene un offset en Y = 15 mils:

images/Modedit_pad_offset_example.png
Parámetro delta (pads trapezoidales)

El pad 1 tiene su parámetro Delta X = 10 mils

images/Modedit_pad_delta_example.png

13.8.3. Ajustes de margen para las capas de máscara de soldadura y máscara de pasta de soldadura

El ajuste de los margenes puede ser realizado a 3 niveles:

  • Nivel global.

  • Nivel de huella.

  • Nivel de pad.

Pcbnew establece el siguiente orden de prioridad para calcular el margen:

  • Ajustes del pad. Si no existen,

  • Ajustes de la huella. Si no existen,

  • Ajustes globales.

Observaciones

La forma de la máscara de soldadura del pad normalmente es mas grande que el propio pad. Por lo tanto el valor del margen es positivo. La forma de las máscara de pasta de soldadura del pad normalmente es mas pequeña que el propio pad. Por ello el valor de margen es negativo.

Parámetros de la mascara de pasta de soldadura

Para la mascara de pasta de soldadura existen dos parámetros:

  • Un valor fijo.

  • Un porcentaje sobre el tamaño del pad.

El valor real es la suma de estos dos valores.

Ajustes a nivel de huella:

images/Modedit_footprint_level_pad_settings.png

Ajustes a nivel de pad:

images/Modedit_pad_level_pad_settings.png

13.9. Propiedades de Campos

Existen al menos dos campos: referencia y valor

Sus parámetros (atributos, tamaño, ancho) deben definirse. Puede acceder a la ventana de configuración haciendo doble clic sobre el campo, o mediante la ventana de propiedades de la huella:

images/Modedit_footprint_text_properties.png

13.10. Colocación automática de las huellas

Si quiere explotar todas la posibilidades de la función de colocación automática es necesario que defina las orientaciones permitidas para la huella (ventana de Propiedades de Huella).

images/Modedit_module_autoplace_settings.png

Normalmente, una rotación de 180 grados se permite para resistencias, condensadores sin polaridad y otros elementos simétricos.

Algunas huellas (transistores pequeños, por ejemplo) a menudo se permite rotarlas +/- 90 o 180 grados. De forma predeterminada, una nueva huella tendrá sus permisos de rotación ajustados a cero. Estos pueden ajustarse de acuerdo a las siguiente regla:

Un valor de 0 deshabilita la rotación, 10 permite una rotación completa, y cualquier valor intermedio representa una rotación limitada. Por ejemplo, una resistencia puede tener un permiso de 10 par rotar 180 grados (sin restricciones) y un permiso de 5 para una rotación de +/- 90 grados (permitido, pero no recomendado)

13.11. Atributos

La ventana de atributos se muestra a continuación:

images/Modedit_module_attributes.png
  • Normal es el atributo estándar.

  • Normal+Insertar indica que el la huella debe aparece en el fichero de inserción automática (para maquinas de inserción automática). Este atributo es útil para componentes de montaje en superficie (SMDs).

  • Virtual indica que el componentes esta formado directamente por la placa de circuito. Ejemplos podrían ser conectores creados en el borde de la placa o inductores creados por una forma de pista particular (como los que pueden verse en los circuitos de microondas).

13.12. Documentando huellas en la biblioteca

Es altamente recomendable documentar las nuevas huellas creadas, con el fin de facilitar su reutilización rápida y precisa. ¿Quien es capaz de recordar las múltiples variantes de pineado para una huella TO92?

La ventana de Propiedades de Huella ofrecen una manera simple y potente de generar la documentación.

images/Modedit_module_properties_documentation_fields.png

Este menú permite:

  • Añadir una linea de comentario (descripción).

  • Varias palabras clave.

La linea de comentario se muestra el la lista de componentes en CvPcb y en los menús de selección de huellas en Pcbnew. Las palabras clave pueden ser usadas para restringir búsquedas a aquellos componentes que contengan cierta palabra clave.

Por lo tanto, al utilizar el comando de carga de huellas (icono en la barra de herramientas derecha en Pcbnew), es posible escribir el texto =TO220 en la ventana para que Pcbnew muestre una lista de las huellas que posean la palabra clave TO220

13.13. Visualización en 3 dimensiones

Una huella puede tener asociada un fichero que contenga una representación en tres dimensiones del componente. Con el fin de asociar cada fichero con una huella, seleccione la pestaña de Opciones 3D. El panel de opciones se muestra a continuación:

images/Modedit_module_3d_options.png

Deben suministrarse los siguientes datos:

  • El fichero que contiene la representación en 3D (creado por el modelador en 3D Wings3D, en formato vrml, a través del comando exportar a vrml).

  • La ruta predeterminada es kicad/modules/package3d. En el ejemplo, el nombre del fichero es discret/to_220horiz.wrl, usando la ruta predeterminada.

  • Los factores de escala x, y, z.

  • El desplazamiento con respecto al punto de anclaje de la huella (normalmente cero)

  • La rotación inicial en grados sobre cada eje (normalmente cero).

Los ajustes de escala permiten:

  • Usar el mismo fichero 3D para huellas con formas similares pero tamaños diferentes (resistencias, condensadores, componentes SMD…)

  • Para encapsulados pequeños (o muy grandes), lo ideal es usar unos ajustes de rejilla en en Wings3D de forma que 0.1 pulgadas en Pcbnew sean igual a 1 unidad de rejilla en Wings3D.

Si se ha especificado un archivo, es posible ver el componente en 3D.

images/Modedit_footprint_3d_preview.png

El modelo 3D aparecerá automáticamente en la representación en 3D de la placa de circuito impreso.

13.14. Guardando una huella dentro de la bibliotSaving a footprint into the active libraryeca activa

El comando guardar (modificar el archivo en la biblioteca activa) se activa mediante el icono images/icons/save_library.png

Si existe una huella con el mismo nombre (una versión anterior), ésta será sobrescrita. Debido a que es importante poder tener confianza en las huellas presentes en la biblioteca, merece la pena revisar dos veces la huella en busca de errores antes de guardar.

Antes de guardar, también se recomienda cambiar la referencia o el valor de la huella para que sea igual al nombre de la huella en la biblioteca.

13.15. Guardando una huella en la placa

Si la huella editada proviene del diseño de la placa actual, el icono images/icons/update_module_board.png actualizará esta huella en la placa.

14. Herramientas de edición de PCB avanzadas

Hay algunas herramientas de edición más avanzadas disponibles en Pcbnew y el Editor de Huellas, que pueden ayudarle a colocar eficientemente los componentes en el lienzo.

14.1. Duplicando elementos

El duplicado es un método para clonar un elemento y recogerlo en la misma acción. Es muy parecido a copiar y pegar, pero le permite "esparcir" componentes sobre la PCB y le permite disponer manualmente los componentes utilizando la herramienta "Mover con exactitud" (ver más abajo) con más facilidad.

El duplicado se realiza mediante el uso de su tecla de acceso rapido (que de forma predeterminada es Ctrl-D) o la opción duplicar huella en el menú contextual. En el renderizado tipo legado, éstos aparecen como se muestra debajo, dependiendo del tipo de elemento:

images/icons/duplicate_pad.png images/icons/duplicate_line.png images/icons/duplicate_text.png images/icons/duplicate_module.png images/icons/duplicate_target.png images/icons/duplicate_zone.png

14.2. Mover elementos con exactitud

La herramienta "Mover con exactitud" le permite mover un elemento (o grupo de elementos) una cantidad determinada, que puede introducirse en formato cartesiano o polar y que puede introducirse en cualquier unidad compatible. Esto es útil cuando de otro modo sería engorroso al tener que cambiar a un tamaño de rejilla diferente, o cuando una característica no está espaciada de acuerdo a la rejilla actual.

Para utilizar esta herramienta, seleccione los elementos que desea mover y luego utilice su tecla de acceso rápido (por defecto, Ctrl-M) o los elementos del menú contextual para lanzar la ventana. También puede invocar la ventana la tecla de acceso rápido al mover o duplicar objetos, que pueden hacer que sea fácil aplicar repetidamente un desplazamiento a múltiples componentes.

Mover con exactitud especificando un vector de movimiento cartesiano

images/Pcbnew_move_exact_cartesian.png

Mover con exactitud especificando un vector de movimiento polar

image::images/Pcbnew_move_exact_polar.png [scaledwidth="45%"]

La casilla de selección le permite cambiar entre sistemas de coordenadas cartesianas y polares. Lo que esté actualmente en el formulario se convierte automáticamente al otro sistema de coordenadas.

Luego se introduce el vector de movimiento deseado. Puede utilizar las unidades indicadas en las etiquetas ("mm" en las imágenes de arriba) o puede especificar las unidades en la cantidad (por ejemplo, "1 in" para una pulgada, o "2 rad" para 2 radianes).

Al pulsar Aceptar se aplicará la translación a la selección, y Cancelar cerrará la ventana y los elementos no serán movidos. Si se pulsa Aceptar, el vector de movimiento se guardará y será cargado la próxima vez que se abra la ventana, lo que permite la aplicación repetida del mismo vector a varios objetos.

14.3. Herramientas de Matrices

Tanto Pcbnew como el Editor de Huellas tienen asistentes para la creación de matrices de características y componentes, que pueden ser utilizados para diseñar fácilmente y con precisión elementos repetitivos sobre la PCB o en las huellas.

14.3.1. Activando la herramienta matriz

La herramienta matriz actúa sobre el componente bajo el cursor, o, en el modo de GAL, en una selección. Se puede acceder ya sea a través del menú contextual de la selección o mediante su tecla rápida (por defecto Ctrl-N). En el modo tradicional, los iconos del menú contextual indican una matriz del tipo seleccionado:

images/icons/array_pad.png images/icons/array_line.png images/icons/array_text.png images/icons/array_module.png images/icons/array_target.png images/icons/array_zone.png

La herramienta matriz se presenta como una ventana, con un panel para los tipos de matriz. Hay dos tipos de matriz soportados hasta ahora: rectangular y circular.

Cada tipo de matriz puede especificarse completamente en sus respectivos paneles. Las opciones geométricas (cómo se realiza la red) van a la izquierda; las opciones de numeración (incluyendo el orden de los números a través de la red) están a la derecha.

14.3.2. Matrices rectangulares

Las matrices rectangulares son matrices que sitúan los componentes de acuerdo a una cuadrícula de 2 dimensiones. Este tipo de matriz también puede producir una matriz lineal con sólo trazar una única fila o columna.

La ventana de ajustes para las matrices rectangulares es la siguiente:

images/Pcbnew_array_dialog_grid.png
Opciones geométricas

Las opciones geométricas son los siguientes:

  • Cantidad horizontal: el número de "columnas" en la matriz.

  • Cantidad vertical: el número de "filas" en la matriz.

  • Espaciado horizontal: es la distancia horizontal entre elementos contiguos en la misma fila. Si éste es negativo, la matriz avanza de derecha a izquierda.

  • Espaciado vertical: es la distancia vertical entre elementos contiguos en la misma columna. Si éste es negativo, la matriz avanza desde abajo hacia arriba.

  • Desplazamiento horizontal: empieza cada fila esta distancia a la derecha de la anterior

  • Desplazamiento vertical: empezar cada columna esta distancia por debajo de la anterior

images/Pcbnew_array_grid_offsets.png
Figura 1. matriz 3x3 con desplazamientos x e y
  • Escalonado: Agrega un desplazamiento a cada conjunto de "n" filas/columnas, con cada fila desplazando 1/n del total del valor especificado en el campo separación:

images/Pcbnew_array_grid_stagger_rows_2.png
Figura 2. matriz con un escalonado en filas de 2
images/Pcbnew_array_grid_stagger_cols_3.png
Figura 3. matriz 4x3 con un escalonado en columnas de 3
Opciones de numeración
  • Dirección de la Numeración: Determina si los números avanzan a lo largo de las filas y después saltan a la siguiente fila, o lo hacen por columnas hacia abajo y luego salta a la siguiente columna. Tenga en cuenta que la dirección en la numeración se define por el signo de la separación especificada: un valor negativo dará lugar a una numeración de derecha a izquierda o de abajo hacia arriba.

  • Invertir numeración en filas o columnas alternas: Si se selecciona, el orden de numeración (de izquierda a derecha o de derecha a izquierda, por ejemplo) en filas o columnas alternas depende de la dirección de numeración. Esta opción es útil en paquetes tipo DIP, donde la numeración avanza en un lado y desciende en el otro.

  • Reiniciar numeración: Si realiza la matriz a partir de elementos que ya están numerados, restablece la numeración al inicio, de lo contrario continuará si es posible a partir del numero del elemento

  • Esquema de Numeración

    • Continuous: the numbering just continues across a row/column break - if the last item in the first row is numbered "7", the first item in the second row will be "8".

    • Coordinate: the numbering uses a two-axis scheme where the number is made up of the row and column index. Which one comes first (row or column) is determined by the numbering direction.

  • Axis numberings: what "alphabet" to use to number the axes. Choices are

    • Números para índices numéricos de tipo entero

    • Hexadecimal for base-16 indexing

    • Alphabetic, minus IOSQXZ, a common scheme for electronic components, recommended by ASME Y14.35M-1997 sec. 5.2 (previously MIL-STD-100 sec. 406.5) to avoid confusion with numerals.

    • Full alphabet from A-Z.

14.3.3. Circular arrays

Circular arrays lay out items around a circle or a circular arc. The circle is defined by the location of the selection (or the centre of a selected group) and a centre point that is specified. Below is the circular array configuration dialog:

images/Pcbnew_array_dialog_circular.png
Opciones geométricas
  • Horizontal center, Vertical center: The centre of the circle. The radius field below will update automatically when you adjust these.

  • Angle: The angular difference between two adjacent items in the array. Set this to zero to evenly divide the circle with "count" elements.

  • Count: Number of items in the array (including the original item)

  • Rotate: Rotate each item around its own location. Otherwise, the item will be translated but not rotated (for example, a square pad will always remain upright if this option is not set).

Opciones de numeración

Circular arrays have only one dimension and a simpler geometry than grids. The meanings of the available options are the same as for grids. Items are numbered clockwise - for an anticlockwise array, specify a negative angle.

15. KiCad Scripting Reference

Scripting allow you to automate tasks within KiCad using the Python language.

Also see the doxygen documentation on Python Scripting Reference.

You can see python module help by typing pydoc pcbnew on your terminal.

Using scripting you can create:

  • Plugins: this type of script is loaded when KiCad starts. Examples:

    • Footprint Wizards: To help you build footprints easily filling in parameters. See the dedicated section Footprint Wizards below.

    • File I/O (planned): To let you write plugins to export/import other filetypes

    • Actions (planned): Associate events to scripting actions or register new menus or toolbar icons.

  • Command Line Scripts: scripts that can be used from the command line, load boards or libraries, modify them, and render outputs or new boards.

It shall be noted that the only KiCad applicaiton that supports scripting is Pcbnew. It is also planned for Eeschema in the future.

15.1. KiCad Objects

The scripting API reflects the internal object structure inside KiCad/pcbnew. BOARD is the main object, that has a set of properties and a set of MODULEs, and TRACKs/SEGVIAs, TEXTE_PCB, DIMENSION, DRAWSEGMENT. Then MODULEs have D_PADs, EDGEs, etc.

  • See the BOARD section below.

15.2. Basic API Reference

All the pcbnew API is provided from the "pcbnew" module in Python. GetBoard() method will return the current pcb open at editor, useful for commands written from the integrated scripting shell inside pcbnew or action plugins.

15.3. Loading and Saving a Board

  • LoadBoard(filename): loads a board from file returning a BOARD object, using the file format that matches the filename extension.

  • SaveBoard(filename,board): saves a BOARD object to file, using the file format that matches the filename extension.

  • board.Save(filename): same as above, but it’s a method of BOARD object.

Example that loads a board, hides all values, shows all references
#!/usr/bin/python
import sys
from pcbnew import *

filename=sys.argv[1]

pcb = LoadBoard(filename)
for module in pcb.GetModules():
    print "* Module: %s"%module.GetReference()
    module.GetValueObj().SetVisible(False)      # set Value as Hidden
    module.GetReferenceObj().SetVisible(True)   # set Reference as Visible

pcb.Save("mod_"+filename)

15.4. Listing and Loading Libraries

Enumerate library, enumerate modules, enumerate pads
#!/usr/bin/python

from pcbnew import *

libpath = "/usr/share/kicad/modules/sockets.mod"
lst = FootprintEnumerate(libpath)

for name in lst:
    m = FootprintLoad(libpath,name)
    print name,"->",m.GetLibRef(), m.GetReference()
    for p in m.GetPads():
        print "\t",p.GetPadName(),p.GetPosition(),p.GetPos0(), p.GetOffset()

15.5. BOARD

Board is the basic object in KiCad pcbnew, it’s the document.

BOARD contains a set of object lists that can be accessed using the following methods, they will return iterable lists that can be iterated using "for obj in list:"

  • board.GetModules(): This method returns a list of MODULE objects, all the modules available in the board will be exposed here.

  • board.GetDrawings(): Returns the list of BOARD_ITEMS that belong to the board drawings

  • board.GetTracks(): This method returns a list of TRACKs an SEGVIAs inside a BOARD

  • board.GetSegZones(): Returns a list of SEGZONEs

  • board.GetFullRatnest(): Returns the list of ratsnets (connections still not routed)

  • board.GetLocalRatsnest(): Returns the list of ratsnest of a moving footprint (as it’s dragged)

  • board.GetNetClasses(): Returns the list of net classes

  • board.GetCurrentNetClassName(): Returns the current net class

  • board.GetViasDimensionsList(): Returns the list of Via dimensions available to the board.

  • board.GetTrackWidthList(): Returns the list of Track Widths available to the board.

Board Inspection Example
#!/usr/bin/python
import sys
from pcbnew import *

filename=sys.argv[1]
pcb = LoadBoard(filename)

ToUnits=ToMils
FromUnits=FromMils

print "LISTING VIAS:"
for item in pcb.GetTracks():
    if type(item) is SEGVIA:

        pos = item.GetPosition()
        drill = item.GetDrillValue()
        width = item.GetWidth()
        print " * Via:   %s - %f/%f "%(ToUnits(pos),ToUnits(drill),ToUnits(width))

    elif type(item) is TRACK:

        start = item.GetStart()
        end = item.GetEnd()
        width = item.GetWidth()

        print " * Track: %s to %s, width %f" % (ToUnits(start),ToUnits(end),ToUnits(width))

    else:
        print "Unknown type    %s" % type(item)

print ""
print "LISTING DRAWINGS:"
for item in pcb.GetDrawings():
    if type(item) is TEXTE_PCB:
        print "* Text:    '%s' at %s"%(item.GetText(),item.GetPosition())
    elif type(item) is DRAWSEGMENT:
        print "* Drawing: %s"%item.GetShapeStr() # dir(item)
    else:
        print type(item)

print ""
print "LIST MODULES:"
for module in pcb.GetModules():
    print "* Module: %s at %s"%(module.GetReference(),ToUnits(module.GetPosition()))

print ""
print "LIST ZONES:"
for zone in pcb.GetSegZones():
    print zone

print ""
print "RATSNEST:",len(pcb.GetFullRatsnest())

15.6. Examples

15.6.1. Change a component pins paste mask margin

We only want to change pins from 1 to 14, 15 is a thermal pad that must be keep as it is.
b = pcbnew.GetBoard()
u304 = b.FindModuleByReference('U304')
pads = u304.GetPads()

for p in pads:
    print p.GetPadName(), pcbnew.ToMM(p.GetLocalSolderPasteMargin())
    id = int(p.GetPadName())
    if id<15: p.SetLocalSolderPasteMargin(0)

15.7. Footprint Wizards

The footprint wizards are a collection of python scripts that can be access via from the Footprint Editor. If you invoke the footprint dialog you select a given wizard that allows you to see the footprint rendered, and you have some parameters you can edit.

If the plugins are not properly distributed to your system package, you can find the latest versions in the KiCad source tree at launchpad.

They should be located in for example C:\Program Files\KiCad\bin\scripting\plugins.

On linux you can also keep your user plugins in $HOME/.kicad_plugins.

Build footprints easily filling in parameters.
#!/usr/bin/python

from pcbnew import *

class FPCFootprintWizard(FootprintWizardPlugin):
    def __init__(self):
        FootprintWizardPlugin.__init__(self)
        self.name = "FPC"
        self.description = "FPC Footprint Wizard"
        self.parameters = {
             "Pads":
                {"*n":40,           # not internal units preceded by "*"
                 "pitch":           FromMM(0.5),
                 "width":           FromMM(0.25),
                 "height":          FromMM(1.6)},
             "Shield":
                {"shield_to_pad":   FromMM(1.6),
                 "from_top":        FromMM(1.3),
                 "width":           FromMM(1.5),
                 "height":          FromMM(2)}
        }

        self.ClearErrors()

    # build a rectangular pad
    def smdRectPad(self,module,size,pos,name):
            pad = D_PAD(module)
            pad.SetSize(size)
            pad.SetShape(PAD_RECT)
            pad.SetAttribute(PAD_SMD)
            pad.SetLayerMask(PAD_SMD_DEFAULT_LAYERS)
            pad.SetPos0(pos)
            pad.SetPosition(pos)
            pad.SetPadName(name)
            return pad

    # This method checks the parameters provided to wizard and set errors
    def CheckParameters(self):
        p = self.parameters
        pads            = p["Pads"]["*n"]
        errors = ""
        if (pads<1):
            self.parameter_errors["Pads"]["n"]="Must be positive"
            errors +="Pads/n has wrong value, "
        p["Pads"]["n"] = int(pads)  # make sure it stays as int (default is float)

        pad_width       = p["Pads"]["width"]
        pad_height      = p["Pads"]["height"]
        pad_pitch       = p["Pads"]["pitch"]
        shl_width       = p["Shield"]["width"]
        shl_height      = p["Shield"]["height"]
        shl_to_pad      = p["Shield"]["shield_to_pad"]
        shl_from_top    = p["Shield"]["from_top"]

        return errors

    # build the footprint from parameters
    def BuildFootprint(self):

        print "parameters:",self.parameters
        #self.ClearErrors()
        #print "errors:",self.parameter_errors

        module = MODULE(None) # create a new module
        self.module = module

        p = self.parameters
        pads            = int(p["Pads"]["*n"])
        pad_width       = p["Pads"]["width"]
        pad_height      = p["Pads"]["height"]
        pad_pitch       = p["Pads"]["pitch"]
        shl_width       = p["Shield"]["width"]
        shl_height      = p["Shield"]["height"]
        shl_to_pad      = p["Shield"]["shield_to_pad"]
        shl_from_top    = p["Shield"]["from_top"]

        size_pad = wxSize(pad_width,pad_height)
        size_shld = wxSize(shl_width,shl_height)

        module.SetReference("FPC"+str(pads))   # give it a reference name
        module.m_Reference.SetPos0(wxPointMM(-1,-2))
        module.m_Reference.SetPosition(wxPointMM(-1,-2))

        # create a pad array and add it to the module
        for n in range (0,pads):
            pad = self.smdRectPad(module,size_pad,wxPoint(pad_pitch*n,0),str(n+1))
            module.Add(pad)

        pad_s0 = self.smdRectPad(module,
                            size_shld,
                            wxPoint(-shl_to_pad,shl_from_top),
                            "0")
        pad_s1 = self.smdRectPad(module,
                            size_shld,
                            wxPoint((pads-1)*pad_pitch+shl_to_pad,shl_from_top),
                            "0")

        module.Add(pad_s0)
        module.Add(pad_s1)

        e = EDGE_MODULE(module)
        e.SetStartEnd(wxPointMM(-1,0),wxPointMM(0,0))
        e.SetWidth(FromMM(0.2))
        e.SetLayer(EDGE_LAYER)
        e.SetShape(S_SEGMENT)
        module.Add(e)

        module.SetLibRef("FPC"+str(pads))

# create our footprint wizard
fpc_wizard = FPCFootprintWizard()

# register it into pcbnew
fpc_wizard.register()