参考手册

本文档由其贡献者拥有版权 © 2010-2018,如下所列。您可以根据 GNU 通用公共许可证(http://www.gnu.org/licenses/gpl.html),版本 3 或更高版本,或知识共享署名许可证(http://creativecommons.org/licenses/by/3.0/),版本 3.0 或更高版本的条款分发和/或修改它。

本指南中的所有商标均属于其合法所有者。

贡献者

Jean-Pierre Charras, Fabrizio Tappero.

翻译人员

taotieren <admin@taotieren.com>, 2019, 2020, 2021.

Telegram 简体中文交流群: https://t.me/KiCad_zh_CN

反馈

请将任何错误报告、建议或新版本引导到此处:

Software version

KiCad 6.0

简介

KiCad 是一个开源软件工具,用于创建电子原理图和 PCB 图形。 在其独特的表面下,KiCad 融合了以下软件工具的优雅集合:

  • KiCad :工程管理器

  • Eeschema :原理图编辑器和元件编辑器

  • Pcbnew :电路板布局编辑器和封装编辑器

  • GerbView :Gerber 查看器

还包括3个实用工具:

  • Bitmap2Component :LOGO 的元件制造器。 它创建了一个原理图 元件或来自位图图片的封装。

  • PcbCalculator :一个计算器,有助于计算 调节器元件,轨道宽度与电流,传输 线等

  • Page Layout Editor: A tool to create drawing templates (worksheets) to be used on schematics and PCBs.

这些工具通常从工程管理器运行,但也可以作为独立工具运行。

KiCad does not present any board-size limitation and it can handle up to 32 copper layers, 14 technical layers and 13 auxiliary layers.

KiCad 可以创建构建印刷电路板所需的所有文件,包括:

  • Gerber 文件为光绘机

  • 钻孔文件

  • 元件位置文件

作为开源 (GPL 许可)软件, KiCad 是面向有意创建开源电子硬件的工程的工程师的理想工具。

KiCad 适用于 Linux,Windows 和 Apple macOS。

System Requirements

KiCad is capable of running on a wide variety of hardware and operating systems, but some tasks may be slower or more difficult on lower-end hardware. For the best experience, a dedicated graphics card and display with 1920x1080 or higher resolution is recommended.

Please check the KiCad website for the latest system requirements: https://kicad-pcb.org/help/system-requirements/

KiCad 文件和文件夹

KiCad 创建并使用具有以下特定文件扩展名(和文件夹)的文件进行原理图和电路板编辑。

工程管理器文件:

*.kicad_pro

Project file, containing settings that are shared between the schematic and PCB

*.pro

Legacy (KiCad 5.x and earlier) project file. Can be read and will be converted to a .kicad_pro file by the project manager.

原理图编辑器文件:

*.kicad_sch

Schematic files containing all info and the components themselves.

*.kicad_sym

Schematic symbol library file, containing the component descriptions: graphic shape, pins, fields.

*.sch

Legacy (KiCad 5.x and earlier ) schematic file. Can be read and will be converted to a .kicad_sch file on write.

*.lib

Legacy (KiCad 5.x and earlier ) schematic library file. Can be read but not written.

*.dcm

Legacy (KiCad 5.x and earlier ) schematic library documentation. Can be read but not written.

*-cache.lib

Legacy (KiCad 5.x and earlier ) schematic component library cache file. Required for proper loading of a legacy schematic (.sch) file.

sym-lib-table

Symbol library list (symbol library table): list of symbol libraries available in the schematic editor.

板编辑器文件和文件夹:

*.kicad_pcb

Board file containing all info but the page layout.

*.pretty

Footprint library folders. The folder itself is the library.

*.kicad_mod

Footprint files, containing one footprint description each.

*.kicad_dru

Design rules file, containing custom design rules for a certain .kicad_pcb file.

*.brd

Legacy (KiCad 4.x and earlier ) board file. Can be read, but not written, by the current board editor.

*.mod

Legacy (KiCad 4.x and earlier ) footprint library file. Can be read by the footprint or the board editor, but not written.

fp-lib-table

Footprint library list (footprint library table): list of footprint libraries available in the board editor.

fp-info-cache

Cache to speed up loading of footprint libraries.

*公共文件:*

*.kicad_wks

Page layout (drawing border and title block) description file

*.net

Netlist file created by the schematic, and read by the board editor. This file is associated to the .cmp file, for users who prefer a separate file for the component/footprint association.

*.kicad_prl

Local settings for the current project, helps Kicad remember the last used settings such as layer visibility or selection filter. May not need to be distributed with the project or put under version control.

其他文件:

*.cmp

原理图中使用的元件与其封装之间的关联。 它可以由 Pcbnew 创建并由 Eeschema 导入。 其目的是为用户导入从 Pcbnew 到 Eeschema 的更改 谁更改 Pcbnew 内的封装(例如使用 改变封装 命令) 并希望在原理图中导入这些更改。

其他文件:

它们由 KiCad 生成用于制作或文档。

*.gbr

Gerber 文件,用于制作。

*.drl

钻孔文件(Excellon 格式),用于制作。

*.pos

位置文件(ASCII 格式),用于自动插入机器。

*.rpt

报告文件(ASCII 格式),用于文档。

*.ps

绘图文件(Postscript),用于文档。

*.pdf

绘图文件(PDF 格式),用于文档。

*.svg

绘图文件(SVG 格式),用于文档。

*.dxf

绘图文件(DXF 格式),用于文档。

*.plt

绘图文件(HPGL 格式),用于文档。

Storing and and sending KiCad files

KiCad schematic and board files contain all the schematic symbols and footprints used in the design, so you can back up or send these files by themselves with no issue. Some important design information is stored in the project file (.kicad_pro), so if you are sending a complete design, make sure to include it.

Some files, such as the project local settings file (.kicad_prl) and the fp-info-cache file, are not necessary to send with your project. If you use a version control system such as Git to keep track of your KiCad projects, you may want to add these files to the list of ignored files so that they are not tracked.

Installing and Upgrading KiCad

Importing settings

Each major release of KiCad has its own configuration, so that you may run multiple KiCad versions on the same computer without the configurations interfering. The first time you run a new version of KiCad, you will be asked how to initialize the settings:

configure settings

If a previous version of KiCad is detected, you will have the option to import the settings from that version. The location of the previous configuration files is detected automatically, but you may override it to choose another location if desired.

By default, the schematic symbol and footprint library tables from the previous version of KiCad will also be imported. If you would like to start with no library configuration, uncheck the Import library configuration from previous version checkbox.

You may also choose to start with default settings if you do not want to import settings from a previous version.

KiCad stores the settings files in a folder inside your user directory. Each KiCad version will store its settings in a subfolder of that folder (except for KiCad 5.1 and earlier, which did not use subfolders). Those folders are:

Windows

%APPDATA%\kicad

Linux

~/.config/kicad

Mac OS

/Users/<username>/Library/Preferences/kicad

Migrating files from previous versions

Modern versions of KiCad can open files created in earlier versions, but can only write files in the latest formats. This means that in general, there are no special steps to migrate files from a previous version besides opening the files. In some cases, the file extension for a file has changed from one KiCad version to the next. After opening these files, they will be saved in the new format with the new file extension. The old files will not be deleted automatically.

In general, files created or modified by one version of KiCad cannot be opened by older versions of KiCad. For this reason, it is important to keep backup copies of your projects when testing a new KiCad release, until you are confident that you will not need to use the older KiCad version anymore.

Hotkey configurations are not imported from previous versions at this time. You can manually import hotkey configurations by copying the various *.hotkeys files from the old version configuration directory to the new one. If you do so, please note that KiCad will not automatically detect conflicts such as one key being assigned to multiple actions.

使用 KiCad 工程管理器

KiCad project manager (kicad or kicad.exe) is a tool which can easily run the other tools (schematic and board editors, Gerber viewer and utility tools) when creating a design.

从 KiCad 管理器运行其他工具有一些优点:

  • 在原理图编辑器和电路板编辑器之间交叉探测。

  • synchronization of the design between the schematic editor and board editor (without creating netlist files)

KiCad currently only supports having one project open at a time. When running the schematic and board editors from the KiCad project manager, you can only edit the schematics and board associated with the open project. When these tools are run in stand alone mode, you can open any file in any project, but cross probing between tools can give strange results.

工程管理器窗口

main window

The KiCad project manager window is composed of a project tree view, a launch pane containing buttons used to run the various software tools, and a message window. The menu and the toolbar can be used to create, read and save project files.

Tool launcher

The tool launcher opens the different KiCad tools from the project manager. When opening the schematic or board editor, the project files will automatically be loaded.

The 8 buttons in the launcher correspond to the following commands (1 to 8, from left to right):

launch pane

1

Eeschema

Schematic editor.

2

LibEdit

Schematic symbol editor and symbol library manager.

3

Pcbnew

Board layout editor.

4

FootprintEditor

Footprint editor and footprint library manager.

5

Gerbview

Gerber file viewer. It can also display drill files.

6

Bitmap2component

Tool to build a footprint or a component from a B&W bitmap image to create logos.

7

Pcb Calculator

Tool to calculate track widths, and many other things.

8

Page Layout Editor

Page layout (drawing border and title block) editor

工程树视图

The tree view shows a list of files inside the project folder.

project tree

双击原理图文件运行原理图编辑器,在本例中打开文件 picProgrammer.kicad_sch

双击电路板文件运行布局编辑器,在这种情况下打开文件 pic_programmer.kicad_pcb

右键单击工程树中的任何文件都可以进行通用文件操作。

Only files that KiCad understands how to open are displayed in the project tree view.

顶部工具栏

main toolbar

KiCad 顶部工具栏允许一些基本的文件操作:

new project

创建一个新工程。 如果找到默认模板文件(kicad.kicad_pro) kicad/template ,将其复制到工作目录中。

new project with template

从现有模板创建新工程。

open project

打开现有工程。

zip

创建整个工程的 zip 压缩。 这包括原理图 文件,库,PCB 等。

unzip

将工程 zip 压缩包解压到目录中。 目标目录中的文件将被覆盖。

reload

刷新树视图,有时在树更改后需要。

directory browser

在文件资源管理器中打开工程工作目录。

创建一个新工程

Most KiCad designs start with the creation of a project. There are two ways to create a project from the KiCad project manager: you may create an empty project, or create a project based on an existing template. This section will cover the creation of a new, empty project. Creating projects from templates is covered in the Project Templates section.

To create a new project, use the New Project…​ command in the File menu, click the New Project button in the top toolbar, or use the keyboard shortcut (Ctrl+N by default).

You will be prompted for a name to give your project. By default, a directory will be created for your project with the same name. For example, if you enter the name MyProject, KiCad will create the directory MyProject and the project file MyProject/MyProject.kicad_pro inside it.

If you already have a directory to store your project files in, you can uncheck the Create a new directory for the project checkbox in the New Project dialog.

It is strongly recommended that you store each KiCad project inside its own directory.

Once you select the name of your project, KiCad will create the following files inside the project directory:

example.kicad_pro

KiCad project file.

example.kicad_sch

Main schematic file.

example.kicad_pcb

Printed circuit board file.

Importing a project from another EDA tool

KiCad is able to import files created by some other software packages. Currently the following types of project are supported:

*.sch, *.brd

Eagle 6.x or newer (XML format)

*.csa, *.cpa

CADSTAR archive format

To import a project from one of these tools, choose the appropriate option from the Import Non-KiCad Project submenu of the File menu.

You will be prompted to select either a schematic or a board file in the import file browser dialog. The imported schematic and board files should have the same base file name (e.g. project.sch and project.brd). Once the requested files are selected, you will be asked to select a directory to store the resulting KiCad project.

KiCad configuration

The KiCad preferences can always be accessed from the Preferences menu, or by using the hotkey (default Ctrl+,). The Preferences dialog is shared between the running KiCad tools. Some preferences apply to all tools, and some are specific to a certain tool (such as the schematic or board editor).

Common preferences

preferences common

Auto save: When editing schematics and board files, KiCad can automatically save your work periodically. Set to 0 to disable this feature.

File history size: Configure the number of entries in the list of recently-opened files

3D cache file duration: KiCad creates a cache of 3D models in order to speed up the 3D viewer. You can configure how long to keep this cache before deleting old files.

Accelerated graphics antialising: KiCad can use different methods to prevent aliasing (jagged lines) when rendering using a graphics card. Different methods may look better on different hardware, so you may want to experiment to find the one that looks best to you.

Fallback graphics antialiasing: KiCad can also apply antialiasing when using the fallback graphics mode. Enabling this feature may result in poor performance on some hardware.

Text editor: Choose a text editor to use when opening text files from the project tree view.

PDF viewer: Choose a program to use when opening PDF files

Icon scale: Sets the size of the icons used in menus and buttons throughout KiCad. Choose Automatic to pick an appropriate icon scale automatically based on your operating system settings.

Canvas scale: Sets the scale of the drawing canvas used in the KiCad editors. Choose Automatic to pick an appropriate canvas scale automatically based on your operating system settings.

Show icons in menus: Enables icons in drop-down menus throughout the KiCad user interface.

Icons in menus are not displayed on some operating systems.

Prefer selection to dragging: When enabled, clicking and dragging the mouse will always perform a selection operation, even when you start dragging on top of an object. When disabled, clicking and dragging on top of an object that can be moved will perform a move operation.

Warp mouse to origin of moved object: When enabled, the mouse cursor will be repositioned (warped) to the origin of an object when you start a move command on that object.

First hotkey selects tool: When disabled, pressing the hotkey for a command such as Add Wire will immediately start the command at the current cursor location. When enabled, pressing the hotkey the first time will just select the Add Wire tool but will not immediately begin a wire.

Automatically backup projects: When enabled, KiCad projects will be archived to ZIP files automatically according to the settings below. The archives will be stored in a subfolder of the project folder. Backups are created when saving files in the project.

Create backups when auto save occurs: When enabled, a backup will be created every time an automatic file save occurs (if the backup is permitted by the settings below). This setting has no effect if the auto save interval is set to 0 (disabled).

Maximum backups to keep: When creating a new backup, the oldest backup file will be deleted to keep the total number of backup files below this limit.

Maximum backups per day: When creating a new backup, the oldest backup file created on the current day will be deleted to stay below this limit.

Minimum time between backups: If backup is triggered (for example, by saving a board file), the backup will not be created if an existing backup file is newer than this limit.

Maximum total backup size: When creating a new backup file, the oldest backup files will be deleted to keep the total size of the backup files directory below this limit.

Remember open files for next project launch: When checked, KiCad will re-open the schematic and board editor if they were open the last time you closed the project manager.

Mouse and touchpad preferences

preferences mouse and touchpad

Center and warp cursor on zoom: When enabled, zooming using the hotkeys or mouse wheel will cause the view to be centered on the cursor location.

Use zoom acceleration: When enabled, scrolling the mouse wheel or touchpad faster will cause the zoom to change faster.

Zoom speed: Controls how much the zoom changes for a given amount of scrolling the mouse wheel or touchpad. Use Automatic to set a default value depending on your operating system.

Automatically pan while moving object: When enabled, the view can be panned while moving an object by moving close to the edge of the canvas.

Auto pan speed: Controls how fast the canvas pans while moving an object.

Mouse buttons: You can set the behavior of dragging the middle and right mouse buttons to zoom the view, pan the view, or have no effect.

The left mouse button is always used for selecting and manipulating objects.

Mouse wheel and touchpad scrolling: You can set the behavior of scrolling the mouse wheel or vertical motion of the touchpad while pressing certain modifier keys.

Pan lef/tright with horizontal touchpad or scroll wheel movement: When enabled, you can pan the view using the touchpad or horizontal scroll wheel (if present on your mouse).

Hotkey preferences

preferences hotkeys

You can use this dialog to customize the hotkeys used to control KiCad. The hotkeys in the Common section are shared between every KiCad program. Hotkeys for each specific KiCad program are shown when that program is running. You can assign the same hotkey to a different action in different KiCad programs (for example, the schematic editor and the board editor), but you cannot assign a hotkey to more than one action in the same program.

There are many available commands, and so not all of them have a hotkey assigned by default. You can add a hotkey to any command by double-clicking on the command in the list. If you choose a hotkey that is already assigned to a different command, you can choose to use that hotkey on your chosen command, which will remove the hotkey assignment from the conflicting command.

Changes that you have made to hotkey assignments are shown with a * character at the end of the command name. You can undo changes to a specific command by right-clicking that command and selecting Undo Changes, or you can undo all changes with the button below the command list.

Importing hotkeys

Hotkey preferences are stored in .hotkeys files in the KiCad settings directory (see the Settings section for information about where the settings directory is on your operating system). If you have configured KiCad hotkeys the way you like on one computer, you can transfer that configuration to another computer by importing the appropriate .hotkeys file(s).

路径配置

在 KiCad 中,可以使用 environment 变量 定义路径。 一些环境变量由 KiCad 在内部定义,可用于定义库,3D 形状等的路径。

当绝对路径未知或可能发生变化时(例如,当您将工程传输到另一台计算机时),以及许多类似工程共享一个基本路径时,这非常有用。 请考虑以下可能安装在不同位置的内容:

  • Schematic symbol libraries

  • Footprint libraries

  • 封装定义中使用的 3D 形状文件

例如,使用 KISYSMOD 环境变量时,connect.pretty 封装库的路径将被定义为 ${KISYSMOD}/connect.pretty

The PreferencesConfigure Paths…​ menu allows you to define paths for some built-in KiCad environment variables, and add your own environment variables to define personal paths, if needed.

KiCad 环境变量:

KICAD6_SYMBOL_DIR

Base path of symbol library files.

KICAD6_FOOTPRINT_DIR

Base path of footprint library files.

KICAD6_3DMODEL_DIR

Base path of 3D models used in footprints.

KICAD6_TEMPLATE_DIR

Location of project templates installed with KiCad.

KICAD_USER_TEMPLATE_DIR

Location of personal project templates.

KICAD6_SCRIPTING_DIR

Location of Python scripts installed with KiCad.

KICAD6_USER_SCRIPTING_DIR

Location of personal Python scripts.

configure path dlg

Some advanced environment variables can be set to customize KiCad’s behavior. These variables are not shown in the environment variable configuration dialog by default. Changing these variables will not result in KiCad moving any files from the default location to the new location, so if you change these variables you will need to copy any desired settings or files manually.

Additional environment variables:

KICAD_CONFIG_HOME

Base path of KiCad configuration files. Subdirectories will be created within this directory for each KiCad minor version.

KICAD_DOCUMENTS_HOME

Base path of KiCad user-modifiable documents, such as templates, Python scripts, libraries, etc. Subdirectories will be created within this directory for each KiCad minor version.

另请注意,环境变量 KIPRJMOD 始终由 KiCad 内部定义,并且是 当前工程绝对路径

例如,${KIPRJMOD}/connect.pretty 总是在 connect.pretty 文件夹(漂亮的封装库)中找到的 当前工程文件夹

如果您修改路径配置,请退出并重新启动 KiCad 避免路径处理中的任何问题。

库配置

首选项管理符号库…​ 菜单中,可以管理名为 符号库表(sym-lib-table)的库列表文件。

同样,使用 首选项管理封装库…​ 菜单管理称为 封装库表(fp-lib-table)的库列表文件。

有两个库列表文件:第一个文件(位于用户主目录中)是所有工程的全局文件,第二个文件(位于工程目录中)是可选的,且特定于工程。

工程模板

使用工程模板有助于使用预定义设置设置新工程。 模板可能包含预定义的电路板边框,连接器位置,原理图元素,设计规则等。甚至可以包括用作新工程的种子文件的完整原理图和/或 PCB。

使用模板

文件→新工程→模板 菜单中的新工程将打开工程模板选择器对话框:

template selector

单击模板的图标将显示模板信息,再单击“确定”按钮将创建新工程。 模板文件将复制到新工程位置并重命名以反映新工程的名称。

选择模板后:

template selected

模板位置:

KiCad 在以下路径中查找模板文件:

  • 环境变量 KICAD_USER_TEMPLATE_DIR 中定义的路径

  • 环境变量 KICAD_TEMPLATE_DIR 中定义的路径

  • 系统模板:<kicad bin dir>/../share/kicad/template/

  • 用户模板:

    • Unix: ~/kicad/template/

    • Windows: C:\Documents and Settings\username\My Documents\kicad\template or C:\Users\username\Documents\kicad\template

    • Mac: ~/Documents/kicad/template/

创建模板

模板名称是存储模板文件的目录名称。 元数据目录是名为 meta 的子目录,其中包含描述模板的文件。

元数据由一个必需文件组成,可能包含可选文件。 所有文件必须由用户使用文本编辑器或以前的 KiCad 工程文件创建,并放入所需的目录结构中。

使用模板创建工程时,模板中的所有文件和目录都将复制到新的工程路径,但 meta 除外。包含模板名称的文件和目录将使用新的工程文件名重命名。

例如,从名为 示例 的模板创建名为 新工程 的工程:

模板 示例 目录中的文件。

在工程 新工程 目录中创建的文件

示例.kicad_pro
示例.kicad_sch
示例.kicad_pcb
示例-第一次.kicad_sch
第二次-示例.kicad_sch
第三次.kicad_sch
第三次.kicad_pcb

新工程.kicad_pro
新工程.kicad_sch
新工程.kicad_pcb
新工程-第一次.kicad_sch
第二次-新工程.kicad_sch
第三次.kicad_sch
第三次.kicad_pcb

A template does not need to contain a complete project, if a required project file is missing, KiCad will create it using its default create project behavior:

模板 示例 目录中的文件。

新工程 目录中创建的文件

示例.kicad_sch
第一次-示例.kicad_sch
第一次-示例.kicad_pcb
第二次-示例.kicad_sch
第二次-示例.kicad_pcb

新工程.kicad_sch
第一次-新工程.kicad_sch
第一次-新工程.kicad_pcb
第二次-新工程.kicad_sch
第二次-新工程.kicad_pcb
新工程.kicad_pro (默认)
新工程.kicad_pcb (默认)

作为模板名称重命名规则的例外,如果存在一个工程文件(.kicad_pro),并且其名称与模板名称不匹配,则 KiCad 将基于该工程文件名称进行重命名:

模板 示例 目录中的文件。

新工程 目录中创建的文件

示例.kicad_sch
示例.kicad_pcb
第一次-示例.kicad_pro
第一次-示例.kicad_sch
第一次-示例.kicad_pcb
第二次-示例.kicad_sch
第二次-示例.kicad_pcb

示例.kicad_sch
示例.kicad_pcb
新工程.kicad_pro
新工程.kicad_sch
新工程.kicad_pcb
第二次-示例.kicad_sch
第二次-示例.kicad_pcb

It is not recommended to create a template with multiple project files.

模板示例

这是一个显示 raspberrypi-gpio 模板的工程文件的示例:

template tree

和元数据文件:

template tree meta

所需文件:

meta/info.html

描述模板的 HTML 格式信息。

<title> 标记确定向用户公开以供选择模板的模板的实际名称。请注意,如果工程模板名称太长,它将被截断。

使用 HTML 意味着可以轻松地对图像进行内联,而无需发明新方案。 本文档中只能使用基本 HTML 标记。

这是一个示例 info.html 文件:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html;
charset=windows-1252">
<TITLE>Raspberry Pi - 扩展板</TITLE>
</HEAD>
<BODY LANG="fr-FR" DIR="LTR">
<P>这个工程模板是扩展板的基础
<A HREF="http://www.raspberrypi.org/" TARGET="blank">Raspberry Pi $25
ARM 板。</A> <BR><BR>该基础工程包括一个PCB边缘,
其尺寸与Raspberry-Pi PCB相同,
连接器正确放置以对齐两块板。Raspberry-Pi 板上的所有 IO 都通过
0.1&quot;连接到工程。扩展
头。 <BR><BR>板轮廓如下所示:
</P>
<P><IMG SRC="brd.png" NAME="brd" ALIGN=BOTTOM WIDTH=680 HEIGHT=378
BORDER=0><BR><BR><BR><BR>
</P>
<P>(c)2012 Brian Sidebotham<BR>(c)2012 KiCad Developers</P>
</BODY>
</HTML>

可选文件:

meta/icon.png

一个 64 x 64 像素的 PNG 图标文件,用作 模板选择对话框中的可单击图标。

meta/info.html 使用的任何其他图像文件(例如上面对话框中的电路板文件图像)也会放在此文件夹中。