参考手册

本手册正在修订中,以涵盖KiCad的最新稳定发布版本。 它包含一些内容尚未编写完成。 我们希望您能耐心等待我们的志愿技术作者完成这项工作。 同时我们也欢迎新的贡献者加入我们的行列,帮助我们使 KiCad 的文档比以前更好。

This document is Copyright © 2010-2024 by its contributors as listed below. You may distribute it and/or modify it under the terms of either the GNU General Public License (http://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0/), version 3.0 or later.

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

贡献人员

Jean-Pierre Charras, Fabrizio Tappero, Wayne Stambaugh, Graham Keeth

翻译人员

Liu HanCheng <[email protected]>, 2018.

Qinghan Hu <[email protected]>, 2023.

taotieren <[email protected]>, 2019-2023.

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

反馈

The KiCad project welcomes feedback, bug reports, and suggestions related to the software or its documentation. For more information on how to submit feedback or report an issue, please see the instructions at https://www.kicad.org/help/report-an-issue/

KiCad 原理图编辑器简介

描述

KiCad 原理图编辑器用于原理图设计,属于 KiCad 的发行的一部分,可在以下操作系统下使用:

  • Linux

  • Apple OS X

  • Windows

无论是什么操作系统,所有的 KiCad 文件都能 100% 兼容所有操作系统。

原理图编辑器是一个集成的应用程序,所有绘图、控制、布局、库管理和访问 PCB 编辑器功能都在原理图编辑器中进行。

KiCad 原理图编辑器旨在与 KiCad PCB 编辑器协同,后者是 KiCad 的印刷电路设计软件。它还可以为其他软件包输出网表文件,网表列出了所有的电气连接。

原理图编辑器包括一个符号库编辑器,它可以创建和编辑符号并管理库。 它还集成了现代原理图设计软件所需的额外但基本的功能:

  • 电气规则检查(ERC),用于自动查找错误和缺失的连接

  • 以多种格式导出绘图文件(Postscript,PDF,HPGL 和 SVG)

  • 物料清单生成(通过 Python 或 XSLT 脚本,允许许多灵活的格式)。

原理图编辑器以几种方式支持多原理图设计:

  • 扁平的层次结构(原理图页面在主图中没有明确的连接)。

  • 简单的层次结构(每张原理图只使用一次)。

  • 复杂的层次结构(有些原理图页面被多次使用)。

层次结构原理图会在后续章节详细描述。

初始配置

当原理图编辑器首次运行时,如果在 KiCad 配置文件夹中没有找到全局符号库表文件 sym-lib-table,那么 KiCad 将询问如何创建该文件:

符号库表的初始配置

推荐使用第一个选项(复制默认全局符号库表(推荐))。默认的符号库表包括所有标准符号库,作为 KiCad 的一部分安装。

如果该选项被禁用,则 KiCad 无法找到默认的全局符号库表。这可能意味着你没有和 KiCad 一起安装标准符号库,或者它们没有被安装在 KiCad 期望找到的地方。在某些系统中,KiCad 库是作为一个单独的软件包安装的)。

  • 如果你已经安装了标准的 KiCad 符号库并想使用它们,但第一个选项被禁用,请选择第二个选项并浏览到安装 KiCad 库的目录中的 sym-lib-table 文件。

  • 如果你已经有一个你想使用的自定义符号库表,选择第二个选项并浏览你的 sym-lib-table 文件。

  • 如果你想从头开始构建一个新的符号库表,选择第三个选项。

符号库管理将在待续中详细描述。

原理图编辑器的用户界面

原理图编辑器概览

原理图编辑器的主要用户界面如上图所示。中间包含主编辑画布,其周围有:

  • 顶部工具栏(文件管理、缩放工具、编辑工具)。

  • Left toolbar (display options), Hierarchy Navigator and Properties Manager at left

  • 信息面板和底部的状态栏

  • Right toolbar (drawing and design tools)

浏览编辑画布

编辑画布显示正在设计的原理图。你可以平移和缩放到原理图的不同部分,并打开设计中的任何原理图页。

默认情况下,用鼠标中键或右键拖动会平移画布视图,滚动鼠标滚轮会放大或缩小视图。你可以在偏好设置中的鼠标和触摸板部分改变这一行为(详见配置和定制 )。

在顶部的工具栏中还有其他几个缩放工具:

  • 放大图标 放大视口中心。

  • 缩小图标 缩小视口中心。

  • 放大到页面图标 放大到适合原理图页大小。

  • 缩放到对象图标 缩放到适合原理图中的每个对象(不包括图框)。例如,如果有对象放置在图框之外,在放大到对象之后,它们就会显现出来。

  • 缩放到选择图标 允许你画一个方框来确定缩放的区域。

光标的当前位置显示在窗口的底部(X 和 Y),还有当前的缩放系数(Z)、光标的相对位置(dx、dy 和 dist)、网格设置和显示单位。

Space 可以将相对坐标重置为零(dx, dy, and dist)。这对于测量两点之间的距离或对齐物体很有用。

快捷键

Ctrl+F1 快捷键显示当前快捷键列表。默认的快捷键列表包括在本手册的 操作参考 部分。

本手册中描述的快捷键使用了标准 PC 键盘上的按键布局。在苹果键盘布局中,使用 Cmd 键来代替 Ctrl,使用 Option 键来代替 Alt

许多操作默认没有分配快捷键,但可以使用快捷键编辑器(偏好设置偏好设置…​快捷键)分配或重新定义快捷键。

许多通过快捷键进行的操作也可以在上下文菜单中使用。要访问上下文菜单,在编辑画布上点击右键。 根据所选择的内容或所使用的工具,将有不同的操作。

快捷键存储在 KiCad 的配置目录下的 user.hotkeys 文件中。这个位置是平台相关的:

  • Windows: %APPDATA%\kicad\8.0\user.hotkeys

  • Linux: ~/.config/kicad/8.0/user.hotkeys

  • macOS: ~/Library/Preferences/kicad/8.0/user.hotkeys

KiCad 可以使用快捷键编辑器中的 导入快捷键 按钮从 user.hotkeys 文件中导入快捷键设置。

鼠标操作和选择

使用鼠标左键选择编辑画布中的对象。 单击一个对象将选择它。点击并拖动将执行一个框选。从左到右的框选将只选择完全在框内的对象。从右到左的方框选择将选择任何接触到方框的对象。从左到右的选择框是用黄色画的,光标表示排他性选择,从右到左的选择框是用蓝色画的,光标表示包容性选择。

在点击或拖动时按住辅助按键,可以修改选择动作。在点击选择单个对象时,以下辅助键适用:

辅助键 (Windows) 辅助键 (Linux) 辅助键 (macOS) 选择效果

Ctrl

Ctrl

Cmd

切换选择。

Shift

Shift

Shift

将对象添加到现有的选择中。

Ctrl+Shift

Ctrl+Shift

Cmd+Shift

从现有的选择中删除对象。

长按

长按或 Alt

长按或 Option

从弹出菜单中澄清选择。

以下辅助键适用于使用拖拽执行框选操作时:

辅助键 (Windows) 辅助键 (Linux) 辅助键 (macOS) 选择效果

Ctrl

Ctrl

Cmd

切换选择。

Shift

Shift

Shift

在现有的选择中添加对象。

Ctrl+Shift

Ctrl+Shift

Cmd+Shift

从现有的选择中删除对象。

选择一个对象会在窗口底部的信息面板上显示该对象的信息。双击一个对象可以打开一个窗口来编辑该对象的属性。

Esc 将取消当前的工具或操作并返回到选择工具。在选择工具处于活动状态时按下 Esc 将清除当前的选择。

左侧工具栏显示控制

左侧工具栏提供了改变原理图编辑器中对象显示的选项。

grid visibility icon

Turns grid display on/off.

Note: by default, hiding the grid does not disable grid snapping. This behavior can be changed in the Display Options section of Preferences.

grid override enable button

Turns item-specific grid overrides on/off.

inch unit icon

mil unit icon

millimeter unit icon

Display/entry of coordinates and dimensions in inches, mils, or millimeters.

cursor shape icon

Switches between full-screen and small editing cursor (crosshairs).

hidden pin icon

Turns invisible pin display on/off.

free angle wire icon

90deg angle wire icon

45deg angle wire icon

Switches between free angle, 90 degree mode, and 45 degree mode for placement of new wires, buses, and graphical shapes.

hierarchy navigator icon

Opens and closes the docked hierarchy navigator pane.

Properties Manager icon

Opens and closes the docked Properties Manager pane.

原理图创建和编辑

简介

用 KiCad 设计的原理图不仅仅是一个电子设计的简单图形表示。它通常是开发链的切入点,可用于:

原理图主要由符号、导线、标签、结点、总线和电源符号组成。为了使原理图更清晰,你可以放置纯图形元素,如总线入口、注释和折线。

符号是从符号库中添加到原理图中的。原理图制作完成后,网络连接和封装的集合被导入 PCB 编辑器,用于设计电路板。

原理图可以使用单一的原理图页面,也可以分割成多个原理图页面。在 KiCad 中,多张原理图是按层次组织的,有一个根原理图和子原理图。每个原理图都是它自己的 .kicad_sch 文件,它本身就是一个完整的 KiCad 原理图。层次原理图的工作在层次原理图章节中描述。

原理图编辑操作

原理图编辑工具位于右侧工具栏中。 当一个工具被激活时,它将一直处于活动状态,直到选择了另一个工具或用 Esc 键取消该工具。当其他工具被取消时,选择工具总是被激活。

Selection tool icon

Selection tool (the default tool)

Highlight net icon

Highlight a net by marking its wires and net labels with a different color. If the PCB Editor is also open then copper corresponding to the selected net will be highlighted as well. Net highlighting can be cleared by clicking with the highlight tool in an empty space, or by using the Clear Net Highlighting hotkey (~).

New Symbol icon

Display the symbol selector dialog to place a new symbol.

Add Power icon

Display the power symbol selector dialog to place a new power symbol.

Draw Wire icon

Draw a wire.

Draw Bus icon

Draw a bus.

Draw wire to bus icon

Draw wire-to-bus entry points. These elements are only graphical and do not create a connection, thus they should not be used to connect wires together.

draw no connect flag icon

Place a "no-connection" flag. These flags should be placed on symbol pins which are meant to be left unconnected. "No-connection" flags indicate to the Electrical Rule Checker that the pin is intentionally unconnected and not an error. They also affect schematic connectivity for stacked symbol pins.

place junction icon

Place a junction. This connects two crossing wires or a wire and a pin, which can sometimes be ambiguous without a junction (i.e. if a wire end or a pin is not directly connected to another wire end).

Local label icon

Place a local label. Local labels connect items located in the same sheet. For connections between two different sheets, use global or hierarchical labels.

Local label icon

Place a net class directive label.

Global label icon

Place a global label. All global labels with the same name are connected, even when located on different sheets.

Hierarchical label icon

Place a hierarchical label. Hierarchical labels are used to create a connection between a subsheet and the sheet’s parent sheet. See the Hierarchical Schematics section for more information about hierarchical labels, sheets, and pins.

Hierarchical subsheet icon

Place a hierarchical subsheet. You must specify the file name for this subsheet.

Import hierarchical label icon

Import a hierarchical pin from a subsheet. This command can be executed only on hierarchical subsheets. It will create hierarchical pins corresponding to hierarchical labels placed in the target subsheet.

place text icon

Place a text comment.

place textbox icon

Place a text box.

draw rectangle icon

Draw a rectangle.

draw circle icon

Draw a circle.

draw arc icon

Draw an arc.

draw line icon

Draw a graphic lines.

Note: Lines are graphical objects and are not the same as wires placed with the Wire tool. They do not connect anything.

place bitmap icon

Place a bitmap image.

interactive delete tool icon

Delete clicked items.

Grids and snapping

Schematic elements such as symbols, wires, text, and graphic lines are snapped to the grid when moving, dragging, and drawing them. Additionally, the wire tool snaps to pins even when grid snapping is disabled.

Both grid and pin snapping can be disabled while moving the mouse by using the modifier keys in the table below.

在苹果键盘上,使用 Cmd 键而不是 Ctrl
辅助键 效果

Ctrl

禁用网格捕捉。

Shift

禁用将导线捕捉在引脚上。

The default grid size is 50 mil (0.050") or 1.27 millimeters. This is the recommended grid for placing symbols and wires in a schematic and for placing pins when designing a symbol in the Symbol Editor. Smaller grids can also be used, but this is intended only for text and symbol graphics, and not recommended for placing pins and wires.

导线只有在两端完全重合的情况下才能与其他导线或引脚连接。因此,保持符号引脚和导线与网格对齐是非常重要的。建议在放置符号和绘制导线时始终使用 50 mil 的网格,因为 KiCad 标准符号库和所有遵循其风格的库也使用 50 mil 的网格。使用 50 mil 以外的网格尺寸将导致原理图没有正确的连接!
符号、导线和其他没有对准网格的元素,可以通过选择它们,点击右键,并点击 将元素对准网格,将它们重新对准网格。

You can adjust the grid size by right-clicking and selecting a new grid from the list in the Grid submenu. Pressing the n or N hotkeys will cycle to the next and previous grid in the list, respectively.

You can also select a new grid or edit the available grids in the Grids pane of the preferences dialog. As a shortcut to reach this dialog, right click the show grid button button on the left toolbar and select Edit Grids…​.

grid settings dialog

In this dialog you can select an active grid from the list of grids, reorder the list of grids, and add or remove grids. Grids defined in this dialog can have unequal X and Y spacing as well as an optional name.

This dialog also lets you designate two grids from the list as "Fast Grids", which can be quickly selected using Alt+1 and Alt+2.

Finally, you can configure grid overrides for different types of objects. Grid overrides let you set particular grid sizes for different types of objects which will be used instead of the default grid when working with those objects. For example, you can set a 50 mil grid for wires and connected items while using smaller grids to finely position text and graphics. Grid overrides can be individually enabled and disabled in this dialog, or globally enabled and disabled using the grid override enable button button on the left toolbar (Ctrl+Shift+G).

The visual appearance of the grid can also be customized in several ways. You can change the thickness of the grid markings, switch their shape (dots, lines, or crosses), and set the minimum displayed spacing in the Display Options page of the preferences dialog, and you can change the grid color in the Colors page of the preferences dialog.

The grid can be shown or hidden using the show grid button button on the left-hand toolbar. By default the grid is still active even if it is hidden, but this is configurable in the Display Options preferences page. There you can set the grid to be disabled when it is hidden or even disable the grid entirely.

编辑对象属性

All objects have properties that are editable in a dialog. Use the hotkey E or select Properties from the right-click context menu to edit the properties of selected item(s).

符号属性对话框

You can only use the properties dialog to edit one item at a time. To edit multiple items, use the Properties Manager, described below. There are also other tools that can be used to edit specific types of objects in bulk, such as the Edit Text and Graphics tool for editing text, labels, and graphic shapes, or the Symbol Fields Table for editing symbol fields in bulk.

You can also view and edit item properties using the Properties Manager. The Properties Manager is a docked panel that displays the properties of the selected item or items for editing. If multiple types of items are selected at once, the properties panel displays only the properties shared by all of the selected item types.

Properties Manager showing properties for a symbol

Editing a property in the Properties Manager immediately applies the change. When multiple items are selected, property modifications are applied to each selected item individually, not to the whole selection as a group. For example, when changing the orientation of multiple items, each item is individually rotated around its own origin, not the group’s origin.

Show the Properties Manager with ViewShow Properties Manager or the Properties Manager icon button on the left toolbar.

In properties dialogs and many other dialogs, any field that contains a numeric value can also accept a basic math expression that results in a numeric value. For example, a dimension may be entered as 2 * 2mm, resulting in a value of 4mm. Basic arithmetic operators as well as parentheses for defining order of operations are supported.

使用符号

放置符号

要将符号摆放到原理图中,可以使用图标 新建符号图标 或者快捷键 A 。 出现选择符号对话框,让您选择要添加的符号。 符号按符号库分组。

选择元件对话框

默认情况下,仅显示符号/库名称和描述列。 可以通过右键单击列标题并选择“选择列”来添加其他列。

The Choose Symbol dialog filters symbols by name, keywords, description, and all additional symbol fields according to what you type into the search field. You can choose to sort search results alphabetically or by best match by clicking on the sort button button.

有一些高级筛选器可用:

  • 通配符: * 匹配任意数量的任意字符,包括无字符,而 ? 匹配任意单个字符。

  • 键值对: 如果一个库部分的描述或关键词包含一个格式为 "Key:123" 的标签,你可以通过输入 "Key>123"(大于)、"Key<123"(小于)等进行相对匹配。数字可以包括以下不区分大小写的后缀之一。

    p

    n

    u

    m

    k

    meg

    g

    t

    10-12

    10-9

    10-6

    10-3

    103

    106

    109

    1012

    ki

    mi

    gi

    ti

    210

    220

    230

    240

  • 正则表达式: 如果您熟悉正则表达式,也可以使用。 使用的正则表达式风格是 wxWidgets 高级正则表达式风格,类似于 Perl 正则表达式。

如果符号指定了一个默认的封装,这个封装将在右下方预览。如果符号包括封装过滤器,可以在右边的封装下拉菜单中选择满足封装过滤器的备用封装。

选择一个要放置的符号后,该符号将被吸附在光标上。 左键点击原理图中所需要摆放的位置,将符号放入原理图中。在将符号放入原理图之前,可以通过快捷键或右键菜单来旋转、镜像或编辑它的字段。这些操作也可以在放置后进行。

如果 放置重复副本 选项被选中,在放置一个符号后 KiCad 将开始放置该符号的另一个副本。这个过程一直持续到用户按下 Esc

对于有多个单元的符号,如果 放置所有单元 选项被选中,在放置符号后 KiCad 将开始放置该符号中的下一个单元。 这将持续到最后一个单元被放置或用户按下 Esc

放置电源符号

电源符号是代表与电源网络连接的符号。 这些符号被分组在 power 库中,所以可以使用符号选择器来放置。 然而,由于电源的放置很频繁,添加电源图标 工具是可用的。这个工具使用方法类似,只是搜索是直接在 power 库和其他包含电源符号的库中进行。

移动符号

符号可以用移动(M)或拖动(G)工具移动。这些工具将作用于选定的符号,如果没有选定符号,则作用于光标下的符号。

移动 工具移动符号本身,而不保持与符号引脚的导线连接。

拖动 工具在移动符号时不会破坏其引脚的导线连接,因此也会移动连接的导线。

你也可以用鼠标点击并拖动符号,这取决于偏好设置中 鼠标和触摸板 部分的 左键拖动手势 设置。

符号也可以旋转(R)或在X(X)或Y(Y)方向上进行镜像。

编辑符号属性

符号的字段可以在符号的属性窗口中进行编辑。用快捷键 E 或通过双击符号来打开符号属性窗口。

符号属性对话框

The Symbol Properties window displays all the fields of a symbol in a table. New fields can be added, and existing fields can be deleted, edited, reordered, moved, or resized. Fields can be arbitrarily named, but names beginning with ki_, e.g. ki_description, are reserved by KiCad and should not be used for user fields.

每个字段的名称和值可以是可见的或隐藏的,并且有几个格式化选项:水平和垂直对齐、方向、位置、字体、文本颜色、文本大小和黑体/斜体。字段的自动放置也可以在每个字段的基础上启用。显示位置始终针对正常显示的符号(无旋转或镜像)指示,并且与符号的锚点相关。

符号字段的格式化选项可以通过右击符号字段表的标题行来显示或隐藏,并启用或禁用所需的列。默认情况下,不是所有的列都显示。

The Update Symbol from Library…​ button is used to update the schematic’s copy of the symbol to match the copy in the library. The Change Symbol…​ button is used to swap the current symbol to a different symbol in the library. These functions are described later.

编辑符号…​ 打开符号编辑器,编辑原理图中的符号副本。注意,库中的原始符号将不会被修改。编辑库中的符号…​ 按钮可以打开符号编辑器来编辑库中的原始符号。在这种情况下,原理图中的符号将不会被修改,直到用户点击 更新库中的符号…​ 按钮。

符号有几个属性,它们会影响 KiCad 其他部分对符号的处理方式。

从仿真中排除 防止该符号被包括在 SPICE 模拟中。

从 BOM 中排除 防止该元件被包括在BOM 导出中。

从电路板中排除 意味着该符号仅用于原理图,相应的封装不会被添加到 PCB 上。

不安装 意味着该元件不应该被安装到 PCB 上,虽然相应的封装仍然应该被添加到电路板上。如下图所示,DNP 符号在原理图中显示为不饱和状态,上面有一个红色的 "X"。

设置有 DNP 属性的符号
单独编辑符号字段

可以用 E 快捷键直接编辑单个符号文本字段(选择字段而不是符号),或者双击字段。

一些符号字段有自己的快捷键,可以直接编辑它们。选定符号后,可分别用 UVF 快捷键编辑位号、值和封装字段。

Edit Reference Field dialog

该对话框中的选项与完整的 "符号属性" 对话框中的选项相同,但都是针对单个字段的。

Symbol fields can be automatically moved to an appropriate location with the Autoplace Fields action (select a symbol and press O). Field autoplacement is configurable in the Schematic Editor’s Editing Options, including a setting to always autoplace fields. You can also disable autoplacement for individual fields in the Symbol Properties or Field Properties dialogs.

Updating and exchanging symbols

When a symbol is added to the schematic, KiCad embeds a copy of the library symbol in the schematic so that the schematic is independent of the system libraries. Symbols that have been added to the schematic are not automatically updated when the library changes. Library symbol changes are manually synced to the schematic so that the schematic does not change unexpectedly.

You can use the Compare Symbol with Library tool to inspect the differences between a symbol in a schematic with its corresponding library symbol.

To update symbols in the schematic to match the corresponding library symbol, use ToolsUpdate Symbols from Library…​, or right click a symbol and select Update Symbol…​. You can also access the tool from the symbol properties dialog.

update symbol from library dialog

The top of the dialog has options to choose which symbols will be updated. You can update all symbols in the schematic, update only the selected symbols, or update only the symbols that match a specific reference designator, value, or library identifier. The reference designator and value fields support wildcards: * matches any number of any characters, including none, and ? matches any single character.

The middle of the dialog has options to control what parts of the symbol will be updated. You can select specific fields to update or not update, which properties of the fields to update (text, visibility, size and style, and position), and how to handle fields that are missing or empty in the library symbol. You can also choose whether to update symbol attributes, such as do not populate and exclude from simulation / bill of materials / board.

The bottom of the dialog displays messages describing the update actions that have been performed.

To change an existing symbol to a different symbol, use EditChange Symbols…​, or right click an existing symbol and select Change Symbol…​. This dialog is also accessible from the symbol properties dialog.

change symbol dialog

The options for the Change Symbols dialog are very similar to the Update Symbols from Library dialog.

Another way to swap existing symbols for new ones is to use ToolsEdit Symbol Library Links…​. This dialog contains a table of every symbol in the design, grouped by current library symbol. By choosing a new symbol in the New Library Reference column, you can make all instances of the existing symbol instead point to the new symbol. If the Update symbol fields from new library option is used, the contents of the existing symbols' fields will be updated to match the new symbols' fields.

The Map Orphans button attempts to automatically remap orphaned symbols to symbols with the same name in an active library. For example, if there is a symbol with the current library reference mylib:symbol123, but the mylib library cannot be found, the Map Orphans button will attempt to find a symbol named symbol123 in any of the libraries that are present. This button is only enabled if orphaned symbols are present in the schematic (see the legacy schematics section).

change symbol dialog

This dialog is primarily useful for managing symbols that appear in multiple libraries, when you want to switch from one library to another. For example, if a schematic uses symbols that are in both a global library and a project-specific library, the Symbol Library References dialog could be used to switch between using the global symbols or the equivalent project-specific symbols. It does not have features for fine-grained control of how fields are updated; for that, use the Change Symbols dialog.

Comparing symbols between schematic and library

When a symbol in a schematic diverges from the corresponding symbol in the original symbol library, you can use the Compare Symbol with Library tool to inspect the differences between the two versions of the symbol. Run the tool using InspectCompare Symbol With Library.

Compare Symbol with Library Summary tab

The Summary tab shows the name of the symbol, including its library and schematic reference designator, and provides a list of the differences between the schematic and library versions of the symbol.

Compare Symbol with Library Visual tab

The Visual tab shows a visual comparison of the schematic and library versions of the symbol. This can be used as a visual diff tool.

By default, the comparison displays both versions of the symbol superimposed on each other. To see the changes more easily, you can drag the slider at the bottom of the tab to the right to emphasize the library version of the symbol in the superimposed view (making the schematic version of the symbol more transparent) or drag it to the left to emphasize the schematic version (making the library version more transparent). At the far right and left ends of the slider, the schematic and library versions of the symbol, respectively, are fully hidden. It may be helpful to drag the slider back and forth to see the changes more clearly.

The screenshot above shows a visual comparison with the schematic version of the symbol deemphasized. You can see a partially transparent pin 5 (from the schematic version of the symbol) is in a different location than the fully opaque pin 5 (from the library symbol). This indicates that the pin was moved in either the schematic or library version of the symbol.

符号字段表

符号字段表允许你在电子表格界面中查看和修改所有符号的字段值。你可以用 符号字段表图标 按钮打开符号字段表。

符号字段表

Cells are navigated with the arrow keys, or with Tab / Shift+Tab to move right / left and Enter to move down, respectively.

通过点击和拖动可以选择一个单元格范围。选定的整个单元格范围可以通过(Ctrl+C)或(Ctrl+V)进行复制或粘贴。从表中复制单元格的对于创建 BOM 非常有用。下面将介绍复制和粘贴单元格的更多细节。

Any symbol field can be shown or hidden using the Show checkboxes on the left or by right-clicking on the header of the table. New symbol fields can be added using the plus icon button; a field with that name will be added to every symbol. Each field can have its own label, which doesn’t have to be the same as the field name, and is used as the column header. Fields can be renamed with the pencil icon button or deleted with the delete icon button.

Similar symbols can optionally be grouped by any symbol field using the Group By checkboxes. Symbols are grouped into a single row in the table if all of their Group By fields are identical. The grouped row can be expanded to show the individual symbols by clicking the arrow at the left of the row. The Group Symbols checkbox enables or disables symbol grouping, and the refresh icon button recalculates groupings.

Presets are available to configure the list of fields. Presets store which fields are displayed, which fields are used for grouping, and the column order. You can create and save your own presets or use one of several default presets. Custom presets can be deleted in this dialog or in the Schematic Setup dialog.

Symbols can be filtered by reference designator using the Filter textbox at the top. The filter supports wildcards: * matches any number of any characters, including none, and ? matches any single character. You can also change the display scope, showing only symbols in the current sheet, the current sheet and all of its subsheets, or the entire project. Symbols with the DNP (do not populate) attribute set can be optionally excluded by checking the Exclude DNP box.

You can cross-probe from this dialog by selecting a row in the table. Depending on the Cross-probe action setting at the bottom of the dialog, this can highlight the corresponding symbol in the schematic, select the corresponding symbol in the schematic, or do nothing. The selection action can also select the symbol’s footprint in the board editor, depending on the PCB Editor cross-probing settings.

The Symbol Fields Table is also a bill of materials tool. You can use the Export button to save the symbol fields to an external file. The fields are exported to the BOM exactly as they are currently shown in the spreadsheet view. File format settings are configured in the Export tab. For more information about exporting a BOM, see the BOM tool documentation.

Virtual fields

If you create a field in the Symbol Fields Table whose name begins with a text variable, a virtual field will be created. Virtual fields have a value that is evaluated for each symbol based on the contents of the field name. For example, a virtual field named ${SYMBOL_NAME} will evaluate to the symbol’s name for each symbol. A virtual field can contain any text, as long as it starts with a text variable, so a virtual field named ${SYMBOL_LIBRARY}:${SYMBOL_NAME} will evaluate to <library name>:<symbol name> for each symbol.

Virtual fields exist only in the Symbol Fields Table and in BOM exports. While they are displayed as a column in the dialog and BOMs, and they can be used to group or sort symbols in BOM exports just like regular fields, adding a virtual field in the Symbol Fields Table does not add a corresponding field to each symbol in the schematic.

Any text variable can be used in virtual fields, including sheet and project text variables.

Text variables that correspond to symbol attributes (${DNP}, ${EXCLUDE_FROM_BOARD}, ${EXCLUDE_FROM_SIM}, ${EXCLUDE_FROM_BOM}) are displayed specially. In the Symbol Fields Table, they are shown as checkboxes for each symbol that directly set or unset the corresponding symbol attribute. In BOM exports, they expand to the friendly name of the attribute if the attribute is set (e.g. Excluded from board for ${EXCLUDE_FROM_BOARD} and DNP for ${DNP}) or to an empty string if the attribute is not set.

Finally, there are two special virtual fields that can be created:

  • ${QUANTITY} is a virtual field that contains the number of grouped instances of each symbol.

  • ${ITEM_NUMBER} is a virtual field that contains the row number of each symbol in the table.

简化填写字段的技巧

电子表格中有几种特殊的复制/粘贴方法,用于将数值粘贴到更大的区域,包括自动增加粘贴的单元格。这些功能在粘贴几个符号中共享的数值时可能很有用。

这些方法如下所示。

1. 复制(Ctrl+C 2. 选择目标单元格 3. 粘贴 (Ctrl+V)

1复制

1选择

1粘贴

2复制

2选择

2粘贴

3复制

3选择

3粘贴

4复制

4选择

4粘贴

5复制

5选择

5粘贴

这些技巧在其他带有网格控制元素的对话框中也可以使用。

位号和符号批注

位号是设计中元件的唯一标识符。它们通常被印在 PCB 和装配图上,使你能够将原理图中的符号与电路板上的相应元件相匹配。

在 KiCad 中,位号由一个表示元件类型的字母(R 表示电阻,C 表示电容,U 表示集成电路,等等)及后面的数字组成。如果符号有多个单元,那么位号也会有一个表示单位的尾部字母。没有设置位号的符号有一个 ? 字符,而不是数字。位号必须是唯一的。

位号可以在符号添加到原理图时自动设置,也可以通过手动编辑单个符号的位号字段或使用批注工具批量设置或重置位号。

设置一个符号的位号的过程被称为 批注

自动批注

启用自动批注后,符号被添加到原理图中时将被自动批注。你可以在 偏好设置原理图编辑器批注选项 窗格中选中 自动批注符号 复选框来启用自动批注。自动批注也可以通过左侧工具栏的 自动批注图标 按钮进行切换。

alt=

当同时添加多个符号时,它们会根据 顺序 设置进行批注,按 X 或 Y 位置排序。

编号 选项为新的位号设置起始编号。 可以是最小的可用数字,也可以是基于原理图页码的数字。

关于批注选项的更多信息,请参见批注工具的文档。

批注工具

批注工具会自动为原理图中的符号指定位号。要启动批注工具,请点击顶部工具栏上的 批注图标 按钮。

批注对话框

该工具提供了几个选项来控制符号的批注方式。

范围: 选择批注是否适用于整个原理图、仅适用于当前原理图或仅适用于选定的符号。如果选择了 递归到子原理图 的选项,所选范围内子原理图中的符号将被重新批注;否则子原理图中的符号将不会被重新批注。例如,如果同时选择递归到子原理图仅选择,所有选定范围内子原理图中的符号将被重新批注。

Options: Selects whether annotation should apply to all symbols and reset existing reference designators, or apply only to unannotated symbols.

顺序: 选择编号的方向。如果符号按 X 位置排序,原理图页面左侧的所有符号将比页面右侧的符号编号小。如果符号按 Y 位置排序,则原理图顶部的所有符号的编号将小于原理图底部的符号的编号。

编号: 选择位号的起始编号。每一个位号都会选择在起始编号之上的最小的未使用的数字。起始编号可以是一个任意的数字(通常是 0),也可以是原理图页码乘以 100 或 1000,这样每个元件的位号就与它所在的原理图页相对应。

清除批注 按钮可以清除所选范围内的所有位号。

批注信息可以用底部的复选框进行过滤,或用 保存…​ 按钮保存到报告中。

电气连接

有两种主要的方式来建立连接:导线和标签。导线进行直接连接,而标签则与具有相同名称的其他标签连接。下面的原理图中显示了导线和标签的情况。

导线标签

可以用总线进行连接,也可以通过隐藏的电源引脚进行隐性连接。

本节还将讨论两种特殊类型的符号,可以用右侧工具栏上的 "电源符号" 按钮添加:

  • 电源符号:用于将导线连接到电源或地网络的符号。

  • PWR_FLAG:一个特定的符号,用于表示一个电源网络在没有连接到电源输出引脚时(例如,一个由板外连接器提供的电源网络)。

导线

导线用于在两点之间直接建立电气连接。 要建立连接,必须将一段导线的末端与另一段导线或一个引脚相连。只有导线的末端才能建立连接;如果一根导线穿过另一根导线的中间,不会建立连接。

未连接的导线端有一个小方块,表示连接点。 当连接到导线端时,这个方块就会消失。未连接的引脚有一个圆圈,连接完成时时也会消失。

导线只有在两端完全重合的情况下才能与其他导线或引脚连接。因此,保持符号引脚和导线与网格对齐很重要。建议在放置符号和绘制导线时始终使用 50 mil 的网格,因为 KiCad 标准符号库和所有遵循其风格的库也使用 50 mil 的网格。
符号、导线和其他没有对准网格的元素,可以通过选择它们,右键点击,并选择 将元素对准网格,来将它们重新对准网格。
绘制和编辑导线

用导线连接对象,请使用右侧工具栏中的导线工具 导线工具图标w)。也可以通过点击未连接的符号引脚或导线末端进行导线连接。

可以用左侧工具栏的 90 度导线图标 按钮将导线限制在 90 度角,或者用 45 度导线图标 按钮将导线限制在 45 度角。自由角度导线图标 按钮允许你以任何角度放置导线。可以使用 Shift+Space 在这些模式中循环,或者在 偏好设置原理图编辑器编辑选项 中选择所需的模式。这些模式除了影响导线外,还影响 图形线

PCB编辑器中一样, 快捷键 / 切换导线的模式。

可以使用移动(M)或拖动(G)工具来移动和编辑导线。 与符号一样,移动 工具只移动选定的线段,而不保持与其他导线的现有连接。而 拖动 工具则保持现有的连接。

可以使用 选择连接 工具(Alt+4)选择连接的导线。这个工具可以从所选导线或光标下的导线开始,选择所有与之相连的导线,直到到达一个结点。 再次使用该工具可以将现有的选择范围扩大到下一个结点。

你可以通过右击导线并选择 分割 将一个导线分成两段。该导线将在当前的鼠标位置被分开。你也可以通过右击一个导线并选择 断开 将其与相邻的导线分开。

通常情况下,导线的样式遵照网络的网络类设置(如果没有指定其他网络类,网络就属于 默认 网络类)。然而,所选导线的样式可以在导线的属性对话框中被覆盖(当导线被选中时点击 E)。可以设置导线的宽度、颜色和导线的样式(实线、虚线、点线等)。将宽度设置为 0,清除颜色,并使用 默认 导线样式,将分别使用网络类设置中的默认宽度、颜色和样式。如果在选择中包含了一个导线结点,结点的大小也可以在这里进行编辑。

导线和总线属性对话框
导线结点

交叉的导线不是隐式连接的。如果需要连接,必须明确地添加结点来连接它们(添加结点图标按钮在右侧工具栏)。结点将被自动添加到开始或结束于现有导线之上的导线。

在上面的原理图中,连接到 P1 引脚 18、19、20、21、22 和 23 的导线上使用了结点。

结点大小自动遵循原理图的 结点大小 设置,在 原理图设置通用格式化。颜色遵循 网络类设置。自动尺寸和颜色可以在每个连接点的属性中被覆盖;尺寸为 0 相当于原理图的默认尺寸,而清除颜色则使用网络类颜色。

结点属性对话框

标签

标签是用来给导线和引脚分配网络名称的。具有相同网络名称的导线被认为是连接在一起的,所以标签可以用来进行连接,而不需要直接画线连接。

A net can only have one name. If two different labels are placed on the same net, an ERC violation will be generated. Only one of the net names will be used in the netlist. The final net name is determined according to the rules described below.

有三种类型的标签,每种都有不同的连接范围。

  • 局部标签,也被简单地称为标签,只在一个原理图页面内有效。使用右侧工具栏的 局部标签图标 按钮添加一个局部标签。

  • 全局标签 可以在原理图的任何地方进行连接,无论在哪个原理图页面。用右侧工具栏的 全局标签图标 按钮添加一个全局标签。

  • 层次标签 连接到层次原理图引脚,在层次原理图中使用,用于连接子原理图和其父原理图。用右侧工具栏的 层次标签图标 按钮添加层次标签。

如果在同一个原理图页面,无论标签类型如何,具有相同名称的标签将被连接。
You can convert from one type of label to another type of label using the Change To tools.
添加和编辑标签

使用相应按钮或快捷键创建标签后,会出现标签属性对话框。

全局标签属性对话框

标签 字段设置了标签的文本,它决定了标签分配给其连接线的网络。标签文本支持上划线、下标等标记 ,也支持变量替换。 使用对话框中的 语法帮助 链接获得帮助。

有几个选项可以控制标签的外观。你可以改变文本的 字体、大小和颜色,并设置粗体和斜体以便强调。 你还可以设置文本相对于标签连接点的方向。层次和全局标签有几个额外的选项:自动 选项根据连接的原理图元素自动设置标签方向,形状 选项控制标签轮廓的形状(输入输出双向三态被动)。轮廓形状纯粹是视觉上的,没有电气上的影响。

默认文本大小可以在原理图设置中设置,默认字体可以在优选项中设置。
原理图设置对话框 中,全局标签有额外的设置来控制标签文本周围的边距。

标签也可以添加字段。有两个字段有特殊的意义("网络类" 和 "页面位号",下面会介绍),但也可以添加任意字段。标签字段的行为类似于符号字段:你可以显示或隐藏它们的名称和值,调整对齐方式、方向、位置、大小、字体、颜色或进行强调。

通过右击标签字段表的标题行,可以显示或隐藏标签字段的格式化选项,并启用或禁用所需的列。默认情况下,并非所有的列都显示。

与符号字段一样,标签字段可以通过从原理图中打开特定标签字段的属性进行单独编辑(双击标签字段,或使用 E)。

确认标签属性后,标签将被粘附到光标上进行放置。标签的连接点是标签角落里的小方块。当标签被连接到导线或引脚的末端时,这个方块就会消失。

未连接的标签

连接点相对于标签文本的位置可以通过在标签的属性中选择不同的标签方向,或通过镜像/旋转标签来改变。

通过选择一个标签并使用 E 快捷键、双击该标签或在右键菜单中使用 属性…​,可以随时访问标签属性对话框。

用标签分配网络类

除了分配网络名外,标签还可以用来分配网络类。一个名为 "网络类" 的标签字段将指定的网络类分配给与该标签相关的网络。为了便于以这种方式分配网络类,"网络类" 是新标签字段的默认名称,"网络类" 字段显示设计中所有网络类的下拉列表。网络类必须在原理图设置电路板设置 窗口中创建,然后才能为其分配标签字段。

For more information about assigning netclasses, see the netclass documentation.

页面间引用

全局标签可以显示页面间引用,它展示了原理图中出现同一全局标签的其他地方的页码列表。 点击页面间引用就可以进入所列出的页面。如果列出了多个引用,点击引用列表会弹出一个菜单来选择所需的页面。

页面间引用在 原理图设置 窗口的格式页面中进行全局控制。 可以启用或禁用引用,并且可以调整列表的显示格式,包括可选的前缀或后缀字符。

下图显示了一个全局标签,其中有对其他两个原理图页面的引用。在原理图设置中,分别添加了前缀和后缀 []

全局标签与表间参考

全局标签会自动添加一个 "页面参考" 字段,其值为 "${INTERSHEET_REFS}",用于控制该标签的页面间引用。${INTERSHEET_REFS} 文本变量会被扩展为全局标签页面间引用的完整列表,和在原理图设置中的一致。页面间引用的可见性在 "原理图设置" 中全局控制,而不是通过 "页面间引用" 字段的可见性控制。对于其他类型的标签,"页面间引用" 字段没有意义。

总线

总线是一种在原理图中分组相关信号的方法,以简化复杂的设计。 总线可以像导线一样用总线工具画出来 总线工具图标,并像信号线一样用标签命名。

在下面的原理图中,许多引脚都连接到总线上,也就是中间的蓝色粗线。

带总线的原理图示例
总线成员

在 KiCad 6.0 及以后版本中,有两种类型的总线:矢量总线和分组总线。

一个 矢量总线 是一个信号的集合,以一个共同的前缀开始,以一个数字结束。 矢量总线被命名为 <前缀>[M..N],其中`前缀`是任何有效的信号名称,M 是第一个后缀数字,N 是最后的后缀数字。 例如,总线 DATA[0…​7] 包含信号 DATA0DATA1,以此类推,直到 DATA7。 指定 MN 的顺序并不重要,但两者必须是非负数。

一个 分组总线 是一个或多个信号和/或矢量总线的集合。 分组总线可以用来把相关的信号捆绑在一起,即使它们有不同的名字。 分组总线使用一种特殊的标签语法:

<OPTIONAL_NAME>{SIGNAL1 SIGNAL2 SIGNAL3}

该分组的成员被列在大括号({})内,用空格字符隔开。 在大括号的前面有一个可选的分组名。 如果分组总线没有命名,PCB 中产生的网络将作为该分组内的信号名称。 如果分组总线有名字,产生的网络将以名字为前缀,用句号(.)分隔前缀和信号名称。

例如,总线 {SCL SDA} 有两个信号成员,在网表中这些信号将是 SCLSDA。 总线 USB1{DP DM} 将产生名为 USB1.DPUSB1.DM 的网表。 对于在几个类似电路中重复出现的较大的总线的设计,使用这种技术可以节省时间。

分组总线也可以包含矢量总线。 例如,总线 MEMORY{A[7..0] D[7..0] OE WE} 同时包含了矢量总线和普通信号,并将在 PCB 上形成 MEMORY.A7MEMORY.OE 这样的网络。

总线的绘制和连接方式与信号线相同,包括使用结点来创建交叉线之间的连接。 与信号线一样,总线不能有一个以上的名称—​如果在同一总线上有两个冲突的标签,将产生一个 ERC 违规。

总线成员之间的连接

总线相同成员之间连接的引脚必须通过标签连接。不可能将一个引脚直接连接到总线上;这种连接方式将被 KiCad 忽略。

在上面的例子中,连接是通过放置在连接到引脚的导线上的标签来实现的。连接总线的总线入口(45 度的线段)只是图形化的,并不是形成逻辑连接的必要条件。

事实上,使用重复命令(Insert),如果元件引脚以递增的顺序排列,可以非常快速地进行连接(在实践中,这种情况常见于存储器、微处理器等元件):

  • 放置第一个标签(例如:PCA0)。

  • 尽量使用重复命令来放置成员。 KiCad 将自动创建下一个标签(PCA1PCA2…​)垂直对齐,理论上是在其他引脚的位置上。

  • 在第一个标签下画线。然后使用重复命令将其他导线放在标签下。

  • 如果需要,以同样的方式放置总线入口(放置第一个入口,然后使用重复命令)。

在偏好设置菜单的 原理图编辑器编辑选项 部分,你可以设置重复的参数:

  • 水平间距

  • 垂直间距

  • 标签递增(标签可以递增或递减 1、2、3,等等)。

总线展开

展开工具允许你快速地从总线上分离出信号。 要展开一个信号,请右击一个总线对象(一个总线导线等),并选择 从总线上展开。 或者,当光标在一个总线对象上时,使用 展开总线 快捷键(默认:C)。 该菜单允许你选择要展开的总线成员。

在选择总线成员后,下一次点击将把总线成员的标签放在所需的位置。 该工具会自动生成一个总线入口和通向标签位置的导线。 放置完标签后,你可以继续放置额外的导线(例如,连接到一个元件引脚),并以任何正常方式完成布线。

总线别名

总线别名是一种快捷方式,可以让你更有效地处理大型分组总线。 它允许你定义一个分组总线,并给它一个简短的名称,然后可以在整个原理图中代替完整的分组名称。

要创建总线别名,请在原理图设置中打开 总线别名定义 窗格。

总线别名的定义

一个别名可以被命名为任何有效的信号名称。 使用该对话框,你可以向别名添加信号或矢量总线。 作为一种快捷方式,你可以输入或粘贴信号和/或总线的列表,用空格隔开,它们将全部被添加到别名定义中。 在这个例子中,我们定义了一个名为 USB 的别名,成员为 DPDMVBUS

After defining an alias, it can be used in a group bus label by putting the alias name inside the curly braces of the group bus: {USB}. This has the same effect as labeling the bus {DP DM VBUS}. You can also add a prefix name to the group, such as USB1{USB}, which results in nets such as USB1.DP. For complicated buses, using aliases can make the labels on your schematic much shorter. Keep in mind that the aliases are just a shortcut, and the name of the alias is not included in the netlist.

总线别名被保存在创建别名时打开的原理图文件中。在 总线别名定义 窗口中,与所选别名相关的原理图文件显示在别名列表的底部。在一个给定的原理图页面中创建的任何别名都可以在同一层次设计中的任何其他原理图页面中使用。如果一个层次设计中的多个原理图包含相同名称的总线别名,这些别名必须都有相同的成员。如果多个同名的总线别名没有一致的成员,ERC 将报告违规情况

有多个标签的总线

KiCad 5.0 或更早的版本允许将具有不同标签的总线连接在一起,并在网表编制时将这些总线的成员连接起来。这种行为在 KiCad 6.0 中被移除了,因为它与分组总线不兼容,而且还会导致网表的混乱,因为一个给定的信号将得到的名称不容易预测。

如果您在现代版本的 KiCad 中打开使用此功能的设计,您将看到“迁移总线”对话框,该对话框将指导您更新原理图,以便在任何给定的总线线路上只存在一个标签。

总线迁移对话框

对于具有多个标签的每组总线,您必须选择要保留的标签。 下拉名称框允许您在设计中存在的标签之间进行选择,或者您可以选择一个不同的名称并手动将新名称输入名称字段。

电源符号

Power symbols are symbols that are conventionally used to represent a connection to a power net, such as VCC or GND. Power symbols are virtual: they do not represent a physical component on the PCB.

In addition to being a visual indicator that the attached net is a power rail, power symbols make global connections: two power symbols with the Value connect to each other anywhere in the schematic, regardless of sheet. The power symbol’s Value field determines the name of the attached net.

In previous versions of KiCad, power symbols used invisible power input pins, which make implicit global connections based on the pin name as described below. Beginning in KiCad 8, power symbols do not need to use invisible pins, and the global connection is made based on the power symbol’s value.

在下图中,电源符号用于将电容器的正负极分别连接到 VCCGND 网络上。

电源符号的示例

In the KiCad standard library, power symbols are found in the power library, but power symbols can be created in any library. Creating custom power symbols is described in the symbol editor documentation. Instead of making a new symbol, you can also modify an existing power symbol in the schematic: changing its Value field will change the net the power symbol connects to.

网络名分配规则

原理图中的每个网络都被分配了一个名称,无论这个名称是由用户指定还是由 KiCad 自动生成。

当多个标签附加到同一个网时,最终的网络名将按以下顺序确定,从最高优先级到最低:

  1. 全局标签

  2. 电源符号

  3. 局部标签

  4. 层次标签

  5. 层次原理图引脚

如果一个网络有多个同一类型的标签,则按字母顺序排序,使用第一个。

如果一个网络经过层次的多张原理图,它的名字将取决于层次结构中优先级最高的标签。通常,局部标签优先级高于层次标签。

如果以上标签类型都没有添加到网络中,那么网络的名称将根据连接的符号引脚自动生成。

PWR_FLAG

上面的截图中可以看到两个 PWR_FLAG 符号。它们向 ERC 表明,两个电源网络 VCCGND 实际上连接到一个电源上,虽然没有明确的电源输出(如电压调节器输出)连接到以上两个网络。

如果没有这两个标志,ERC 工具会诊断出:错误:输入电源引脚没有被任何输出电源引脚驱动。

PWR_FLAG 符号可以在 power 符号库中找到。将任何电源输出引脚连接到网络上,可以达到同样的效果。

无连接标志

No-connection flags (No-connection icon) are used to indicate that a pin is intentionally unconnected. These flags prevent "unconnected pin" ERC warnings for pins that are intentionally unconnected. Also, while symbol pins that are stacked on top of each other are normally connected to the same net, if a no-connection flag is added to the stacked pins they will instead be connected to separate nets.

Note that no-connection flags are distinct from the "unconnected" symbol pin type, although they both prevent "unconnected pin" ERC warnings on the pin in question and prevent stacked pins from connecting to each other.

隐藏电源引脚

When the power pins of a symbol are visible, they must be connected, as with any other signal. However, symbols are sometimes drawn with hidden power input pins, which are connected implicitly. KiCad automatically connects invisible pins with type Power Input to a global net with the same name as the pin. For example, if a symbol has a hidden power input pin named VCC, this pin will be globally connected to the VCC net on all sheets. This kind of implicit connection is not recommended in new designs.

Care must be taken with hidden power input pins because they can create unintentional connections. By nature, hidden pins are invisible and do not display their pin name. This makes it easy to accidentally connect two power pins to the same net. For this reason, using invisible power pins in symbols is not recommended and is only supported for compatibility with legacy designs and symbols.
隐藏的引脚可以在原理图中显示,方法是在 原理图编辑器 → 偏好设置的 显示选项 部分勾选 显示隐藏的引脚,或者选择 视图显示隐藏的引脚。在左侧工具栏上还有一个切换是否显示隐藏引脚的图标 hidden pin 24

网络类

网络类是可以被分配设计规则(用于 PCB)和图形属性(用于原理图)的网络分组。在 KiCad 中,每个网络都是某个网络类的一部分。如果你没有将网络添加到一个特定的网络类中,它将是“默认类”的一部分,“默认类”总是存在。

网络类可以在原理图或电路板设置对话框中创建和编辑。可以使用下面描述的基于模式的分配将网络添加到原理图或电路板的网络类中。在原理图中,也可以通过图形标识的方式,如网络类标识符或网络标签将网络分配到网络类中。

选择一个导线或标签会在窗口底部的信息面板中显示该网络的网络类。

所选导线的网络类显示在状态窗格中

在原理图设置中管理网络类

网络类在 原理图设置 对话框的 网络类 面板中管理。

原理图设置网络类面板

顶部的窗格列出了设计中存在的网络类。默认 网络类总是存在的,你可以通过 添加网络类图标 按钮添加额外的网络类,或者通过 删除网络类图标 按钮删除选定的网络类。

每个网络类可以有独特的图形属性,它决定该网络类的导线如何在原理图中显示。导线和总线的厚度、颜色和线条风格(实线、虚线、点线等)都可以调整。将颜色设置为透明将使用主题的默认导线/总线颜色,该颜色可在偏好设置中配置。

您还可以为每个网类设置电路板设计规则,但默认情况下 DRC 字段是隐藏的。 右键单击标题行以显示或隐藏其他列。 有关设置网络类设计规则的更多信息,请参阅 PCB editor documentation

底部窗格列出了基于模式的网络类分配。 每行都有一个网络名称模式和一个网络类; 名称与模式匹配的网络被分配给指定的网络类。 如果网络匹配多个模式,则使用第一个匹配项。 基于模式的网络类分配是动态的:当添加与现有模式匹配的新网络时,它将自动分配给关联的网络类。 网络模式可以使用通配符( * 匹配任意数量的任意字符,包括无字符,以及 ? 匹配任意字符)和 正则表达式 。匹配所选模式的网络显示在模式列表的右侧。

例如, net* 模式匹配名为 net , net1, network, 和任何其他以 net 开头的网络名称的网络。 因为 * 在正则表达式中的含义略有不同(* 匹配零个或多个前面的字符), net* 模式也匹配名为 ne 的网络。

记住,网络名必须包括完整的原理图页面路径。例如,一个在根原理图中本地标记的网络有一个以 / 为前缀的名称。

使用 添加网络类图标 按钮来添加网络类分配模式,或 删除网络类图标 按钮来删除模式。

仅包含 * 通配符的网络类模式将匹配所有明确命名的网络,但不会匹配未标记的网络。 要匹配未标记的网络,您可以在通配符之前包含更多网络名称特点。 所有未标记的网络的名称都以 Net- 开头,因此模式 Net-* 将匹配所有未标记的网络。 您还可以使用 网络类标识符 为未标记的网络分配一个网络类。

Instead of adding netclass patterns in the Schematic Setup dialog, you can directly create netclass patterns from the schematic canvas. Right click a net and select Assign Netclass…​ to bring up the Add Netclass Assignment dialog. The netclass pattern is pre-filled with the name of the selected net, but the pattern can be changed if desired. All nets matching the pattern are displayed in the dialog. This method can only be used on nets with an assigned name.

从原理图中指定一个网络类

在原理图中以图形方式分配网络类

作为基于模式的网络类分配的替代方法,网络类可以用 网络类标识符标签 以图形方式分配给原理图中的网络。网络类必须在原理图设置中创建,然后才能以图形方式分配。

在下面的图片中,一个网络类标识符被用来给 50R 网络类分配信号。

一个连接到总线的网络类标识符

网络类标识符通过右侧工具栏的 网络类指令图标 按钮添加的。网络类标识符除了不能被用来命名网络之外,行为类似于标签。根据标识符的 网络类 字段的值,与标识符关联的网络被分配了一个网络类。`网络类`字段提供了设计中所有网络类的下拉列表。

如果一个标识符被附加到一个总线上,总线上的所有成员都被分配到指定的网络类。

网络类标识符窗口

除了相关的网络类,你还可以在标识符的属性中编辑标识符的形状(点、圆、菱形或矩形)、方向引脚长度颜色

也可以用网络标签给网络分配网络类,方法是在标签中添加一个 网络类 字段。

如果一个网络被图形化分配了两个不同的网络类,ERC 将报告一个问题。图形化的网络类分配优先于基于模式的分配:如果一个网络与网络类模式分配相匹配,并且也有一个图形化的网络类分配,那么将使用图形化的网络类分配。

You can show or hide netclass directives in the schematic using the ViewShow Netclass Directives option.

图形对象

文字、图形和图像可以被添加到原理图中,用于文档的目的。这些对象对原理图没有任何电气影响。

下面的图片除了符号和几种类型的标签外,还显示了图形线和文字("COMMUNICATION DSP")。

带注释的框架示例

Text and text boxes

Two kinds of text can be added to schematics, which are referred to as text (Add text icon) and text boxes (Add textbox icon). Both are added using their respective buttons in the right toolbar. Text boxes are similar to regular text except that they have an optional border and they automatically reflow text within that border.

原理图文本和文本框示例

这两种文本项目都支持多行文本和基本的格式设置功能,文本框还可以将文本换行以适应文本框外框,并有额外的格式选项。所有的文本都有可调整的字体、颜色、大小、黑体和斜体,左右对齐,以及垂直和水平方向。文本框还支持水平居中,垂直对齐选项,以及彩色边框和填充。

默认文本大小可以在原理图设置中设置,默认字体可以在优选项中设置。
文本框属性对话框
链接

文本和文本框可以通过在文本属性的 链接 框中输入一个目标而成为一个链接。链接目标可以是一个本地文件(使用 file:// 协议前缀,后跟文件路径),或者是一个网站(使用 http://https://,后跟其余的 URL),或导航到同一原理图设计中的另一个页面(使用 # 后跟页码)。这些也可以使用链接目标框中的下拉菜单自动填写。

字体

文本和文本框支持自定义字体,可通过文本的属性对话框中的 字体 下拉选择。除了 KiCad 字体外,你还可以使用安装在你电脑上的任何 TTF 字体。

用户字体不会被嵌入工程中。如果该工程在另一台没有安装所选字体的计算机上打开,将会被替换为不同的字体。为了获得最大的兼容性,请使用 KiCad 字体。
Text markup

文本标记支持上标, 下标, 评估工程变量和访问符号字段值。

功能 标记语法 结果

上标

text^{superscript}

textsuperscript

下标

text_{subscript}

textsubscript

上划线

~{text}

text

[原理图 - 设置 - 文本 - 变量,变量]

${variable}

variable_value

[文本 - 变量,符号字段]

${refdes:field}

field_value of symbol refdes

变量必须在 原理图设置 中定义才可以 使用。 还有一些 内置系统文本变量
Simulation directives

Text and textboxes can contain simulation directives for SPICE simulations. The Exclude from simulation checkbox prevents text from being interpreted as a simulation directive.

图形形状

Graphic rectangles (Add rectangle icon), circles (Add circle icon), arcs (Add arc icon), and lines (Add line icon) can all be added using their respective buttons in the right toolbar.

原理图中的矩形、圆形、圆弧和直线

线宽、颜色和样式(实线、虚线或点线)可以在每个图形(E)的属性对话框中进行配置。矩形、圆形和弧形也可以设置填充颜色并去除其轮廓线。

图形矩形属性对话框

将形状的线宽设置为 0,则使用原理图的默认线宽,该线宽可在 <schematic-setup,原理图设置>> 中配置。虚线的间距也可以在那里配置。移除线条或填充物的颜色将会使用颜色主题的图形颜色,这可以在 偏好设置 中配置。

导线一样,图形的线条服从线条的绘制模式设置(90 度,45 度,或自由角度),可以用左侧工具栏的切换按钮来设置 (90 degree wire icon, 45 degree wire icon, and free angle wire icon)。 Shift+Space 循环切换这些模式。

与 PCB 布线一样/ 快捷键切换线条模式。

位图图像

位图图像可以通过 添加位图图像图标 按钮添加到原理图中。原理图中的图像可以被移动和缩放。属性对话框允许设置位置和比例,以及将图像转换为灰度。

批量编辑文本和图形

文本和图形的属性可以通过 编辑文本和图形属性 对话框(工具编辑文本和图形属性…​)进行批量编辑。该工具还可以修改导线和总线的视觉属性。

eeschema edit text and graphics properties
范围和筛选器

范围 设置限制了该工具只能编辑某些类型的对象。如果没有选择范围,就不会有任何东西被编辑。

过滤器 将工具限制为编辑选定范围内的特定对象。 仅当对象匹配所有已启用和相关过滤器时才会修改对象 (某些过滤器不适用于某些类型的对象。例如,符号 字段过滤器不适用于电线,并且出于更改导线属性的目的而被忽略)。 如果未启用过滤器,则将修改所选范围内的所有对象。 对于带有文本框的过滤器,支持通配符: * 匹配任意数量的任意字符,包括无字符,? 匹配任意单个 字符。

按名称筛选 筛选指定的符号、标签或图纸页面字段。

按父级位号筛选 筛选具有指定位号的符号中的字段。通过父级符号库 ID 筛选具有指定库位号的符号中的字段。*通过父级符号类型*筛选到选定类型(电源或非电源)的符号中的字段。

通过网络筛选 筛选指定网络上的导线和标签。

仅包括选定的项目 筛选当前选择。

可编辑的属性

可以在对话框的底部为被筛选对象的属性设置新值。

下拉列表和文本框可以被设置为 --保持不变-- 以保留现有值。复选框可以被选中或不被选中来启用或禁用一个变化,但也可以切换到第三个 "保持不变" 的状态。颜色属性必须被选中以改变值;棋盘式的色块表示颜色将从原理图设置或网络类属性的默认值中继承下来。

可以修改的文本属性有 字体文本大小文本方向(右/上/左/下)、水平垂直对齐文本颜色、强调(粗体*和*斜体)以及字段和字段名的 可见性

可以修改的图形和导线属性有:线宽线样式(实线、虚线和点线)、线颜色、图形的 填充颜色,以及导线结点的 结点尺寸结点颜色

原理图标题栏

标题栏是用页面设置工具(页面设置工具)编辑的。

页面设置对话框

可以编辑标题栏中的每个字段,以及纸张大小和方向。 如果为某个字段选中了 导出到其他原理图页 选项,则该字段将在所有原理图页的标题栏中更新,而不仅仅是当前原理图页。

你可以用 发布日期 旁的左箭头按钮将日期设置为今天或其他任何日期,但原理图中的日期不会自动更新。

也可以选择一个原理图模板文件。

标题栏

原理图页码(页面X/Y)会自动更新,也可以用 编辑编辑原理图页码…​ 手动设置。

Schematic editing convenience functions

There are several convenience features in the Schematic Editor that make some common editing and connection operations faster.

Pin helpers

You can quickly add wires, labels, or no-connection markers to a selection of pins using the Pin Helpers tools in the right-click context menu. This can help you quickly break out unconnected pins from a symbol or hierarchical sheet. By selecting Pin HelpersWire, the wire tool will begin drawing a wire from all selected pins at once. If you select No Connect, no-connection markers will be added to the end of each selected pin. And if you choose Net Label, Hierarchical Label, or Global Label, a label of the respective type will be placed at the end of each selected pin. Each label’s name will be set to the corresponding pin name. The new labels will remain selected, so you can easily move them away from the symbol using M or G, depending on whether you wish to maintain a wired connection between the pins and the labels.

Pin helpers require you to select individual pins, not their parent symbol or sheet. Symbol pins cannot be individually selected if the clicking on a pin selects the symbol option is enabled in the Editing Options pane of the Schematic Editor preferences. Therefore, this option must be disabled to use the Pin Helper tools.

pin helpers global labels

Converting between object types

Existing labels and text objects can be changed to another type of label or text by right clicking the object(s) and selecting the target object type from the Change To submenu. The allowed types for source and target objects are local labels, global labels, hierarchical labels, directive labels, text objects, and text boxes. The value of the original object is preserved in the resulting object: when a text object is converted to a label, the label’s value (net name) will be the original text, and vice versa.

Swapping objects

You can swap the position of two selected objects using the Swap command (S; also available in the right-click context menu). This works on symbols, labels, and graphical items. The first object is assigned the location and rotation of the second object, and vice versa. If there are more than two objects selected, the locations are cycled: the last object gets the position of the first object, the first object gets the location of the second, and so on.

One possible use of the swap command is to exchange two units within a a symbol, for example the two amplifiers in a dual op-amp. You could also use swap with a selection of labels to quickly modify net assignments to symbol pins. In combination with cross-selection from the PCB, this can be a convenient way to make schematic changes for easier routing. This is sometimes known as pin or gate swapping.

原理图设置

原理图设置窗口用于设置当前活动原理图的原理图选项。例如,原理图设置窗口包含格式化选项、电气规则配置、网络类设置和原理图文本变量设置。

您可以使用 从另一个项目导入设置…​ 按钮从已有项目导入原理图设置。 这允许您选择一个项目用作模板并选择要导入的设置 (格式首选项, 字段名称模板, 管脚冲突映射, 违规严重性设置和网络类)。

原理图格式

原理图设置格式

格式化面板包含符号、文本、标签、图形和导线的外观设置。

符号单元表示法 设置多单元符号的每个单元在其位号中的引用方式。 默认情况下,每个单元的不同字母会添加到到没有分隔符的位号后,例如符号 U1 的第二个单元为 U1B ,但这可以更改。 可以使用数字代替字母,并且可以在符号的位号和单元标识符之间使用各种分隔符(.-_ 或无)。

Default text size sets the default text height used by the text, text box, and label tools. Overbar offset ratio controls the vertical spacing between text and an overbar (~{}) over that text, as a ratio of the text height. Label offset ratio controls the vertical spacing between a local label’s text and the attached wire, relative to the label’s text size. This also affects the spacing between symbol pins and their pin number. Global label margin ratio defines the size of the box around a global label, relative to the global label’s text size. Increasing the margin may be useful to avoid overlapping text with overbars (~{}) or letters with descenders, but this may cause closely packed global labels to overlap with each other.

如果符号不覆盖默认线宽,默认线宽 设置定义了符号图形的默认线宽。 引脚符号大小 缩放符号引脚图形样式标注,例如倒置引脚上的气泡。

Junction dot size sets the schematic’s default wire junction dot size. The default size can be overridden by editing an individual junction dot’s properties. Connection width specifies the grid size used for the Symbol pin or wire end off connection grid ERC check. Schematics typically use a 50 mil grid for electrical connections, so this should usually remain set at 50 mils.

The Operating Point Overlay settings configure how operating point simulation results are displayed on the schematic canvas. The significant digits settings control the number of significant digits printed on voltage and current overlays. The range settings control the units used to display voltage and current measurements.

显示页面间引用 启用或禁用 页面间引用 的显示,它是全局标签旁边的页码列表,链接到原理图中相同名称全局标签出现的位置。 显示当前页面引用 控制当前页面是否包含在页码列表中。 标准缩略 确定是显示完整的页码列表还是仅显示第一页和最后一页的页码。 前缀后缀 字段在页码列表前后添加可选字符。 在下面的页面间引用图例中,分别添加了 [] 的前缀和后缀。

全局标签与表间参考

虚线外观在格式部分中控制。 虚线长度 控制破折号的长度,而 间隙长度 控制破折号和点之间的间距。 破折号和间隙长度是相对于线宽的:间隙长度为 2 则表示线宽的两倍。

字段名称模板

原理图设置字段名称模板

字段名称模板是空的符号字段,会自动添加到原理图中的所有符号。 当原理图中的每个符号都需要在符号中定义的默认字段之外的其他字段时,这可能很有用,例如制造商部件号的字段。

模板字段可以设置为可见或不可见,也可以设置为URL 字段。

在原理图设置中定义的字段名称模板仅适用于当前项目。 字段名称模板也可以在偏好设置中定义,它适用于在您的计算机上编辑的所有项目。

BOM presets

Schematic Setup BOM presets panel

BOM presets are saved configurations for the Symbol Fields Table and BOM export tool. There are two types of presets. BOM presets configure which fields are displayed in the symbol fields table, which order they are displayed in, and how they are used to group symbols. These fields are also directly used in the BOM output. BOM formatting presets configure the output BOM file format, including which separator characters are used to separate fields. Both types of presets are created in the Symbol Fields Table, but can are listed and can be deleted here.

ERC 违规严重性和管脚冲突映射

违规严重性 面板可让您配置应将哪些类型的 ERC 消息报告为错误、警告或忽略。

原理图 ERC 严重程度设置

引脚冲突映射 允许您配置连接规则,以根据相互连接的引脚类型定义错误和警告的电气条件。 例如,默认情况下,当输出引脚连接到另一个输出引脚时会产生错误。

原理图 ERC 引脚冲突图

这些面板在 [ERC - 配置,ERC 章节] 中有更详细的解释。

网络类

原理图设置网络类面板

网络类 面板允许您管理项目的网络类,并使用模式将网络分配给网络类。 在此面板中管理网络类等同于在 电路板设置对话框 管理它们。 也可以使用带有 [网络类 - 标识符,网络类标识符][标签 - 网络类,网络标签] 的图形分配方法将网络分配给原理图中的网络类。

基于模式的网络类分配在 网络类章节 中有更详细的解释。

总线别名的定义

总线别名的定义

总线别名定义 面板允许您创建总线别名,这是总线中信号组的名称。 有关总线别名的更多信息,请参阅 [总线-别名,总线别名文档]

文本变量

原理图设置文本变量

文本替换变量可以在文本变量部分创建。 这些变量允许您用变量名替换任何文本字符串。 这种替换发生在变量名称在 ${VARIABLENAME} 的变量替换语法中使用的任何地方。

例如,您可以创建一个名为 VERSION 的变量并将文本替换设置为“1.0”。 现在,在 PCB 上的任何文本对象中,您可以输入 ${VERSION},KiCad 将其替换为 1.0。 如果将文本替换更改为 2.0,则包含 ${VERSION} 的每个文本对象都将自动更新。 您还可以混合使用常规文本和变量。 例如,您可以使用文本 Version: ${VERSION} 创建一个文本对象,它将被替换为 Version: 1.0

文本变量也可以在 电路板设置中创建。 文本变量是项目范围的; 在原理图编辑器中创建的变量在电路板编辑器中也可用,反之亦然。

还有一些内置系统文本变量

Opening legacy schematics

Modern versions of KiCad can always open projects created in older versions of KiCad. However, schematics created in some older versions of KiCad have special considerations that must be observed when opening them in order to prevent any data loss.

Opening KiCad 5.0 and 5.1 schematics

Modern versions of KiCad can open schematics created in versions prior to KiCad 6.0, but the cache library file (<projectname>-cache.lib) must be present to load the schematic correctly.

Since version 6.0, KiCad stores all symbols used in a project in the schematic. This means that you can open a schematic made in KiCad 6.0 or later on any computer, even if the libraries used in the project are not installed or have changed. Modern KiCad schematic files use the .kicad_sch extension.

Prior to version 6.0, KiCad did not store symbols in the schematic. Instead, KiCad stored references to the symbols and their libraries. It also stored a copy of every symbol used by the project in a separate cache library file (<projectname>-cache.lib). As long as the cache library was included with the project, the project could be distributed without the system library files, because KiCad could load any needed symbols from the cache library as a fallback if the libraries referenced in the schematic were missing. Legacy KiCad schematic files use the .sch extension.

When you open a legacy schematic, KiCad will look in the cache library to find all of the symbols used in the schematic in the cache library. When you save the legacy schematic, KiCad will save it as a new file in the modern schematic format (.kicad_sch), with the necessary symbols embedded in the schematic itself. The original legacy schematic and the cache library will remain, unmodified, but they are no longer necessary once the schematic has been saved in the modern format.

Projects created in KiCad prior to version 6.0 must have a cache library. If the cache library is missing, the schematic will lose symbol information if the system symbol libraries are modified, reorganized, moved, or deleted. The libraries included with legacy versions of KiCad are substantially different than the modern KiCad libraries, so in practice KiCad will almost always fail to open legacy projects unless the cache library is present.

When you open a legacy schematic, KiCad may display the Project Rescue Helper dialog. This means that one or more symbols in the cache library do not match the corresponding symbol in the external library. The dialog helps you "rescue" symbols from the cache library into your schematic, if desired. You can also open the rescue dialog at any time using ToolsRescue Symbols…​. The cache library file must be present in order to use the rescue tool.

恢复冲突对话框

The rescue dialog lists all symbols that don’t match between the cache library and the external symbol library. The discrepancy can be because:

  • the cached symbol or the library symbol has been modified, so the two symbols no longer match, or

  • the cached symbol does not have a corresponding symbol in the symbol library, because the symbol or library was moved, renamed, deleted, or is not present on the current computer.

For each symbol in the list, selecting the symbol displays the reference designator and value for each instance of the symbol, and shows a visual preview of the symbol. If a corresponding symbol exists in the system symbol library, the dialog shows both copies of the symbol for comparison. If the symbol only exists in the cache library, the dialog only shows the cached symbol.

In this example, the project originally used a diode with the cathode facing left, but the library now contains one with the cathode facing right. This change would break the design, so it would be important to use the cached symbol as the original designer intended.

Pressing Rescue Symbols here will cause the selected symbols from the cache library to be saved into a special rescue library (<projectname>-rescue.kicad_sym). The corresponding symbols in the schematic will be updated to use the newly rescued symbols. Any unselected symbols will not be rescued, but their symbol linkage can be updated in the schematic later.

Alternatively, pressing Skip Symbol Rescue will exit the dialog without rescuing any symbols. KiCad will use the versions of the symbols found in the external libraries. You can run the rescue function again with ToolsRescue Symbols…​, or manually edit symbol linkage in the symbol’s properties.

If you would prefer not to see this dialog, you can press Never Show Again. This has the same effect as pressing Skip Symbol Rescue for the current schematic and all future schematics.

If a symbol in a legacy schematic cannot be found in either the cache library or the external library, KiCad cannot rescue that symbol. A placeholder symbol is inserted into the schematic in its place, as shown below.

You can attempt to remap these orphaned symbols using the Change Symbols or Edit Symbol Library Links dialogs, but either option may require manual corrections to the schematic. These tools are explained in more detail in the Updating and exchanging symbols section.

Missing symbol in an incompletely rescued schematic

Opening pre-5.0 schematics

Modern versions of KiCad can open schematics created in versions prior to KiCad 5.0, but you will need to go through a symbol remapping process to open the schematic without losing symbol information.

Since version 5.0, KiCad schematics refer to specific symbols using both the symbol and library name. Even if multiple libraries each contain a symbol with the same name, the designer’s intended symbol is unambiguously specified.

Prior to version 5.0, KiCad schematics stored only the symbol name, not the library name. Symbols in the schematic were indirectly mapped back to the original library by searching through the project’s library list for a matching symbol. When you open a pre-5.0 schematic, KiCad will attempt to automatically "remap" the symbols so that each bare symbol name is replaced with a fully-specified symbol library and symbol name pair. The original schematics will be backed up in a rescue-backup folder.

You can skip the automatic remapping, but you will need to remap the symbols yourself using the Change Symbols dialog. You can also re-run the Remap Symbols tool using ToolsRemap Legacy Library Symbols…​.

Remap symbols dialog

层次原理图

简介

在 KiCad 中,多张原理图可以形成层次结构:有一个根原理图,其他图作为根原理图或另一个子原理图的子原理图被创建。如果需要的话,原理图可以被多次包含在一个层次结构中。

仔细地将原理图绘制成层次设计,可以提高原理图的可读性,减少重复绘制。

创建层次原理图是从根原理图开始的。其过程是创建一个子原理图,然后在子原理图中绘制电路,并在原理图之间进行必要的电气连接。可以使用层次引脚和标签为子原理图和父原理图的网络建立连接,也可以使用全局标签为层次中的任意网络建立连接。

在设计中添加原理图

你可以用 "添加层次原理图" 工具(S 快捷键,或右边工具栏上的 添加层次原理图图标按钮)在设计中添加一个子原理图。启动该工具,然后在画布上点击两次,绘制子原理图符号的左上角和右下角。使子原理图符号的轮廓足够大,以放下后续添加的层次引脚

绘制层次原理图

原理图属性对话框将出现,并提示输入原理图名称和文件名。

层次原理图属性

Sheetname 原理图名称必须是唯一的,因为它被用于子原理图中任何网络的全局网络名称中。例如,在原理图 sheet1 中具有局部标签 net1 的网络将具有 /sheet1/net1 的全局网络名称。原理图名称也被用来在图形用户界面的不同地方指代原理图,包括原理图标题块层次导航

Sheetfile 原理图文件指定将被保存或加载的原理图文件。原理图文件的路径可以是相对的或绝对的。通常最好是将子原理图文件保存在工程目录中,并使用相对路径,这样便于工程的移植。

通过为每个重复的原理图指定相同的文件名,一个原理图文件可以在一个工程中使用多次;原理图中绘制的电路将在每次使用时被实例化一次,任意实例中的任何编辑都将反映在其他实例中。

原理图文件可以在多个工程之间共享,以允许在工程之间的设计复用。然而,对路径可移植性的考量,以及在编辑共享图纸时无意中改变其他工程的风险,不建议这样做。

原理图的 页码 在这里是可以配置的。页码显示在原理图标题块层次导航中,原理图在层次导航器及打印或绘制中按页码排序。

还有几个图形选项可用。边界宽度 设置图纸形状周围的边界宽度。边界颜色背景填充 分别设置图纸形状的边界和填充的颜色。如果没有设置颜色,就会显示一个棋盘式的色块,并使用颜色主题的默认值。

原理图页支持任意自定义字段,可以分别使用 加号图标垃圾桶图标 按钮添加和删除。 通过选中它们的 显示 框,可以选择在原理图上显示页面字段,并且可以使用 文本变量 从图纸内部或其他图纸字段中访问它们。

通过选择一个页面符并使用 E 快捷键,或者通过右键单击页面符并选择 属性…​,可以随时访问页面符属性对话框。

你可以通过双击父原理图的图框,或右击图框并选择 进入原理图,从父原理图进入一个层次化的子原理图

通过使用顶部工具栏中的 向上箭头图标 按钮,或者在原理图的空白部分点击右键,然后点击 离开原理图,返回到父原理图。

你可以用 右箭头图标 按钮跳到下一个原理图,或者用 左箭头图标 按钮跳到上一个原理图。

另外,你也可以通过层次结构导航器跳转到任何原理图。要打开层次结构导航器,请点击左边工具栏上的 层次结构导航器图标 按钮。层次结构导航器会停靠在屏幕的左边。设计中的每个原理图都显示为工作区中的一个项目。点击原理图的名字就可以在编辑画布上打开该原理图。

层次结构导航器

原理图之间的电气连接

标签概述

原理图之间的电气连接是通过 标签进行的。在 KiCad 中,有几种标签,每种都有不同的连接范围。

  • 局部标签 只在某个原理图内部有效。因此,局部标签不能用于不同原理图之间的连接。局部标签的添加方法是 局部标签图标 按钮添加。

  • 全局标签 在所有的原理图中有效,无论是哪个子原理图。 全局标签可以使用 全局标签图标 按钮添加。

  • 层次化标签 连接到父原理图中*层次原理图引脚*。层次化设计依靠层次化标签和层次原理图引脚来实现父原理图和子原理图之间的连接;你可以把层次原理图引脚看成是父原理图与子原理图的接口。层次化标签可以使用 分层标签图标 按钮添加。

如果在同一个原理图页面,无论标签类型如何,具有相同名称的标签将被连接。
隐藏电源引脚也可以被认为是全局标签,因为它们可以连接到原理图层次结构中的任何地方。

层次原理图引脚

在子原理图内放置层次标签后,可以在父原理图内的子原理图符号上添加匹配的 层次原理图引脚。然后,你可以用导线、标签及总线与层次原理图引脚进行连接。子原理图符号中的层次原理图引脚与子原理图中匹配的层次化标签相连。

在原理图页面符中导入相应的层次原理图引脚之前,必须先在子原理图中定义层次化标签。
带层次原理图引脚的层次化原理图页面符

对于子原理图中的每一个层次化标签,可以通过点击右侧工具栏中的 导入分层标签图标 按钮,然后点击原理图页面符,将相应的层次化标签导入原理图页面符中。第一个与层次化标签匹配的层次化引脚将附在光标上,可以将它放在原理图页面符边界的任何地方。再次点击该工具将继续导入更多的层次原理图引脚,直到没有更多的层次化标签需要从子原理图中导入。层次原理图引脚也可以通过在原理图页面符的右键菜单中选择 导入层次原理图引脚 来导入。

你可以在原理图页面引脚属性对话框中编辑页面引脚的属性。 通过双击原理图页面引脚,或选择页面引脚并使用快捷键 E ,或者右击原理图页面引脚并选择 属性…​ 来打开这个对话框。

原理图页面引脚属性对话框

原理图页面引脚的 名称 可以在文本框中编辑,也可以从子原理图的层次化标签的下拉列表中选择。原理图页面引脚的名称必须与子原理图中相应的层次化标签相匹配,所以如果页面引脚的名称被改变,标签也必须改变。

形状 区域可以改变页面引脚的形状,但没有电气效果。它可以被设置为输入、输出、双向、三态或无源。 引脚的*字体*、文本大小、*颜色*和强调(粗体或斜体)也可以 被改变。

层次化设计实例

层次化设计可以被归入几个类别中的一个:

  • 简单: 每张原理图只使用一次。

  • 复杂: 一些原理图被多次使用。

  • 扁平化: 简单的 层次结构的一个子案例,在子原理图和其父原理图之间没有连接。扁平的层次结构可以用来表示一种非层次结构设计。

每种层次结构模型都可能是有用的;最合适的模型取决于设计需求。

简单的层次结构

一个简单的层次结构的例子是 KiCad 包含的 video 演示工程。根原理图包含七个独特的子原理图,每个子原理图都有层次化标签和原理图页面引脚,将子原理图与根原理图相互连接。下面是其中两个子原理图的页面符。

这个 video 演示工程的简单层次结构

复杂的层次结构

复杂的层次结构 演示工程是一个复杂层次结构的例子。 根原理图包含两个子原理图页面符,它们都指向同一个原理图文件(ampli_ht.kicad_sch)。这使得设计中包含了同一个放大器电路的两个副本。尽管这两个原理图页面符指向同一个文件名,但原理图的名称是唯一的(ampli_ht_verticalampli_ht_horizontal)。在每个子原理图内,除了位号外,其他的电路都是相同的,而位号也是唯一的。

这个工程不包含原理图层次引脚连接。根原理图和子原理图之间的唯一连接是用电源符号进行的全局连接。如果设计需要,复杂层次结构中的原理图可以包括原理图层次引脚的连接。

Complex_hierarchy 演示工程中的复杂层次结构

扁平化层次结构

flat_hierarchy 演示工程是一个扁平化层次结构的例子。根原理图包含两个不同的子原理图页面符,没有层次化原理图引脚。在这个工程中,根原理图除了容纳子原理图外没有任何作用,子原理图只是作为原理图中的附加页使用。

这是在 KiCad 中创建多页原理图的最简单方法。
这是 flat_hierarchy 演示工程的扁平化层次结构

检查原理图

查找工具

查找工具在原理图中搜索文本,包括位号、引脚名称、符号字段和图形文本。当该工具找到一个匹配的文本时,画布会被放大并居中显示该匹配的文本。使用顶部工具栏上的 查找图标 按钮启动该工具。

查找对话框

查找工具有几个选项:

区分大小写: 选择搜索是否对大小写敏感。

关键词: 选择后,搜索将只与原理图中完整的搜索词相匹配。当未选择时,如果搜索词是原理图中一个较大的关键词的一部分,搜索将匹配。

通配符: 当选择时,通配符可以在搜索词中使用。? 匹配任何单个字符,而 * 则匹配任何数量的字符。请注意,当选择这个选项时,不会返回部分匹配:搜索 abc* 将匹配字符串 abcd,但搜索 abc 不会。

搜索引脚名称和编号: 选择搜索是否应用于引脚名称和编号。

搜索隐藏字段: 选择搜索是否只应用于可见字段,或是否应包含隐藏的符号字段。

Search the current sheet only: Selects whether the search should be limited to the current schematic sheet.

Search the current selection only: Selects whether the search should be limited to the current selection.

还有一个查找和替换工具,可以通过顶部工具栏上的 查找和替换图标 按钮激活。这个工具的作用与查找工具相同,但还可以用不同的文本替换部分或全部匹配的文本。

查找和替换对话框

当选中 替换位号中的匹配内容 选项时,如果包含匹配的文本,位号将被修改。否则,位号将不会受到影响。

Search panel

The search panel is a docked panel that lists information about symbols, text, and labels from the schematic. You can optionally filter the list based on a search string. When no filter is used, all items in the design are listed in the corresponding tab. Items from the entire schematic are listed, not just items in the current sheet.

Search panel

Items are filtered based on their properties: symbols are filtered by all non-hidden fields, text (text and textboxes) by the text content, and labels by their netname. You can sort the filtered results in ascending or descending order of the value in a particular column by clicking on that column header.

Filters support wildcards: * matches any characters, and ? matches any single character. You can also use regular expressions, such as /symbol value/.

The displayed information depends on the item type. Items list their name and/or value, page number, and X/Y location in the sheet. Symbols also list their footprint and attributes (Exclude from Simulation, Exclude from BOM, Exclude from Board, and Do Not Populate). Text and labels list their type, e.g. textbox or hierarchical.

When you click an item in the search panel, the schematic editor switches to the item’s schematic sheet, and the item is selected in the editing canvas. Double-clicking an item in the search panel opens its properties dialog.

Show or hide the search panel with ViewShow Search Panel or use the Ctrl+G shortcut.

网络高亮显示

在原理图编辑器中,电气网络可以在原理图中所有出现的位置高亮显示。网络高亮显示可以在原理图编辑器中激活,也可以在启用交叉探测高亮时在 PCB 编辑器中高亮相应的网络是激活(见下文)。当网络高亮显示激活时,高亮的网络将以不同的颜色显示。默认情况下,这种颜色是粉红色,但可以在 "偏好设置" 对话框的颜色部分进行配置。

可以通过点击右边工具栏中的高亮显示网络工具(Net Highlight图标)高亮显示网络。另外,高亮网络的快捷键(`)也可以高亮显示光标下的网络。

可以使用清除网络高亮操作(快捷键 ~)或在原理图中的空白区域使用网络高亮显示工具来清除网络高亮网络。 默认情况下,Esc 也可以清除网络高亮显示,但如果需要,可以在 首选项原理图编辑器编辑选项 中将其禁用。

Net navigator

The net navigator is a docked panel that shows the location of every occurrence of a highlighted net in a schematic.

net navigator

When you highlight a net in the schematic, every place where that net is shown in the schematic is listed in the net navigator panel. All labels, symbol pins, and sheet pins connected to the net are listed. Each occurrence is sorted under its schematic sheet. Clicking on an occurrence displays that item in the editing canvas.

The net navigator displays highlighted nets, not selected nets.

Show or hide the net navigator with ViewShow Net Navigator.

从 PCB 上交叉探测

KiCad 允许在原理图和 PCB 之间进行双向交叉探测。 有几种不同类型的交叉探测。

Selection cross-probing allows you to select a symbol or pin in the schematic to select the corresponding footprint or pad in the PCB (if one exists) and vice-versa. By default, cross-probing will result in the display centering on the cross-probed item and zooming to fit. You can disable the centering and zooming behavior, or disable selection cross-probing entirely, in the Display Options section of the Preferences dialog. Even when selection cross-probing is disabled, you can manually cross-probe from the schematic to the PCB by right-clicking an object and selecting Select on PCB, or from the PCB to the schematic by right-clicking an object and choosing *SelectSelect on Schematic*.

高亮显示交叉探测 允许你在原理图和 PCB 中同时高亮显示一个网络。 如果在 "偏好设置" 对话框的 "显示选项" 部分启用了 "高亮显示交叉探测的网络" 选项,那么在原理图编辑器中高亮显示一个网络或总线将导致 PCB 编辑器中相应的网络或网络被高亮显示,反之亦然。

电气规则检查

电气规则检查(ERC)工具检查你的原理图中特定的错误,如未连接的引脚、未连接的层次符号、短路的输出或其他非法连接,等等。ERC 的违规会根据检测到的问题的严重程度,以错误或警告的形式报告。

ERC 不是完美的,无法检测所有的错误,但它可以检测到许多常见的问题和疏忽。在继续设计之前,所有检测到的问题都应该进行检查和处理。ERC 的质量与符号创建过程中声明电气引脚属性的谨慎程度直接相关。如果符号设计不正确,ERC 将不会报告准确的信息。

ERC 可以通过点击顶部工具栏的 ERC 图标 按钮并点击 运行 ERC 按钮来启动。

ERC 对话框

任何警告或错误都会在 违规行为 标签中报告,每个违规行为的标记都会放在原理图中,指向原理图的相关部分。警告用黄色箭头表示,错误用红色箭头表示。被排除的违规行为显示为绿色箭头。

在 ERC 窗口中选择一个违规,就会跳转到原理图中相应的违规行为。

窗口底部的数字显示错误、警告和排除的违规数量。每种类型的违规行为都可以用各自的复选框从列表中过滤出来。点击 删除标记 将清除所有违规行为,直到 ERC 再次运行。

可以在对话框中右键点击违规行为,以忽略它们或改变其严重程度:

忽略 ERC 警告
  • 排除此违规行为: 忽略此特定违规行为,但不影响其他违规行为。

  • 改变严重程度: 将一个违规类型从警告改为错误,或将错误改为警告。这会影响到给定类型的所有违规行为。

  • 忽略所有: 忽略所有给定类型的违规行为。这个测试现在将出现在 忽略的测试 标签,而不是 违规 标签。

你也可以用 检查排除标记 排除所选标记,用 查看 菜单显示或隐藏每一类标记(错误、警告和排除)。

在设计规则检查器运行期间,排除的和忽略的违规行为会被记住。

ERC 例子

ERC 的指向

在上面的截图中,有三个错误。

  • 两个输出被连接在一起(右边的红色箭头)。

  • 有两个输入没有连接(左边的红色箭头)。实际上每个引脚都有两个错误:引脚未连接,而且每个引脚都是没有被输出引脚驱动的输入引脚。

选择一个 ERC 标记会在窗口底部的信息窗格中显示违规描述。

信息窗格中的 ERC 违规描述

电源引脚和电源标志

如下面的例子所示,在电源引脚上出现 "输入电源引脚未被任何输出电源引脚驱动" 的错误是很常见的,即使电源引脚似乎正确地连接到电源导线。这种情况发生在通过连接器或其他没有被标记为电源输出的元件提供电源的设计中。在这些情况下,ERC 不会检测到任何连接到网络的输出电源引脚,而会判断输入电源引脚没有被电源驱动。

电源引脚和错误标志

为了避免这个警告,可以将类似的电源网络连接到 PWR_FLAG 符号上,如下例所示。PWR_FLAG 符号可以在 power 符号库中找到。当然,也可以将任意电源输出引脚连接到该网络;PWR_FLAG 只是一个具有单一电源输出引脚的符号。

带有 PWR_FLAG 的电源引脚

接地网络通常也需要一个 PWR_FLAG,因为电压调节器的输出被声明为电源输出,但其接地引脚通常被标记为电源输入。因此,除非使用 PWR_FLAG 符号,否则地线可能看起来没有与电源相连。

关于电源引脚和电源标志的更多信息,请参见PWR_FLAG 文档

ERC 配置

原理图设置中的 违规严重性 面板让你配置哪些类型的 ERC 应被报告为错误、警告或忽略。

原理图 ERC 严重程度设置

原理图设置中的 引脚冲突映射 面板允许你配置连接规则,根据哪些类型的引脚相互连接来定义错误和警告的电气条件。例如,默认情况下,当一个输出引脚与另一个输出引脚连接时,会产生错误。

原理图 ERC 引脚冲突图

可以通过点击矩阵中的方块来改变规则,使其在各种选择中循环:允许、警告、错误。

ERC 检查清单

下表列出了 KiCad 检查的电气规则和每个检查的默认违规严重程度。所有严重程度都是可配置的。

Connections ERC checks

These ERC checks look for issues with wire and label connections in the schematic.

Violation Description Default Severity

Pin not connected

This violation occurs when a symbol pin is not connected to a net, unless the pin has a no-connect flag or has electrical type Unconnected.

Error

Input pin not driven by any Output pins

This violation occurs when a symbol pin with electrical type Input is not connected to an Output pin.

Error

Input Power pin not driven by any Output Power pins

This violation occurs when a symbol pin with electrical type Input Power is not connected to an Output Power pin. A common cause of this violation is described above.

Error

A pin with a "no connection" flag is connected

The violation occurs when a symbol pin with a no connection flag is connected to a net.

Warning

Unconnected "no connection" flag

This violation occurs when a No connection flag is not connected to a pin or label.

Warning

Label not connected to anything

This violation occurs when a global, hierarchical, or local label is not connected to a pin or another label.

Error

Global label not connected anywhere else in the schematic

This violation occurs when there are fewer than two pins on a net with a global label (if there are fewer than two pins, then the label isn’t being used to connect anything).

Warning

Wires not connected to anything

This violation occurs when a wire is not connected to any pin or label.

Error

Bus Entry needed

This violation only applies to projects imported from EAGLE projects. It indicates places where the importer was unable to automatically add bus entries to the imported schematic, so you must add them by hand.

Error

Symbol pin or wire end off connection grid

This violation occurs when a symbol pin or wire end is not aligned to the connection grid. Symbol pins and wire ends need to be aligned to the grid in order to connect to each other. The grid used for this check is defined by the connection grid setting in Schematic SetupFormattingConnection grid.

Warning

Conflicts ERC checks

These ERC checks look for conflicting information in symbols, sheets, and buses.

Violation Description Default Severity

Duplicate reference designators

This violation occurs when two symbols have the same reference designator.

Error

Units of same symbol have different values

This violation occurs when units of a single symbol have different values.

Error

Different footprint assigned in another unit of the symbol

This violation occurs when units of a single symbol have different assigned footprints.

Error

Different net assigned to a shared pin in another unit of the symbol

This violation occurs when a pin that is shared between multiple units of a symbol is not connected to the same net in each unit.

Error

Duplicate sheet names within a given sheet

This violation occurs when two hierarchical sheets in the same parent sheet have the same name.

Error

Mismatch between hierarchical labels and sheet pins

This violation occurs when a hierarchical label does not have a corresponding hierarchical sheet pin in the parent sheet, or a hierarchical sheet pin does not have a corresponding hierarchical label in the child sheet.

Error

More than one name given given to this bus or net

This violation occurs when a net has multiple labels attached. Nets can only have a single name, so if multiple labels are attached to a net, one name will be selected and used as the canonical name.

Warning

Conflict between bus alias definitions across schematic sheets

This violation occurs when a bus alias has different members in different sheets. If the same bus alias name is used in multiple sheets, the members of the alias must be the same for each sheet.

Error

Buses are graphically connected but share no bus members

This violation occurs when buses that are graphically connected do not have bus members in common.

Error

Invalid connection between bus and net items

This violation occurs when a bus is connected to a net item, such as a wire, a label referring to a single net, or a sheet pin referring to a single net. Labels and sheet pins can only be connected to buses if they refer to buses rather than individual signals.

Error

Net is graphically connected to a bus but not a bus member

This violation occurs when a net is connected to a bus with a bus entry but the net is not a member of that bus.

Warning

Conflicting netclass assignments

This violation occurs when more than one netclass is assigned to a net.

Error

Miscellaneous ERC checks

These ERC checks look for other miscellaneous issues in the schematic.

Violation Description Default Severity

Symbol is not annotated

This violation occurs when a symbol is not annotated with a unique reference designator.

Error

Unresolved text variable

This violation occurs when a text variable (${variable_name}) is used without being defined in Schematic Setup.

Error

SPICE model issue

This violation occurs when a SPICE model has a syntax error or other problem.

Ignore

Labels are similar (lower/upper case difference only)

This violation occurs when two labels are similar and differ only by the case of some letters. This may be a typo causing two labels to be disconnected when they are intended to be connected.

Warning

Library symbol issue

This violation occurs when one of several symbol library issues is detected:

  • The symbol library for a symbol is not included and enabled in the library table

  • A symbol in the schematic does not exist in its symbol library

  • A symbol in the schematic does not match the copy in its symbol library

Warning

Symbol has more units than are defined

This violation occurs when a symbol has more units placed in the schematic than are defined in the symbol. Units in the schematic must correspond exactly to the symbol definition.

Error

Symbol has units that are not placed

This violation occurs when a unit from a multi-unit symbol is not placed in the schematic. Unplaced units will not be connected to anything.

Warning

Symbol has input pins that are not placed

This violation occurs when a multi-unit symbol has units with input pins that are not placed, so those input pins will not be connected to anything.

Warning

Symbol has bidirectional pins that are not placed

This violation occurs when a multi-unit symbol has units with bidirectional pins that are not placed, so those input pins will not be connected to anything.

Warning

Symbol has power input pins that are not placed

This violation occurs when a multi-unit symbol has units with power input pins that are not placed, so those input pins will not be connected to anything.

Error

Conflict problem between pins

This violation occurs when a connection between pins is not allowed per the allowed connections in the Pin Conflicts Map.

From Pin Conflicts Map

ERC 报告文件

可以通过点击 ERC 对话框中的 保存…​ 按钮来生成和保存 ERC 报告文件。ERC 报告文件的扩展名为 .rpt。下面给出一个 ERC 报告文件的例子。

ERC report (Fri 21 Oct 2022 02:07:05 PM EDT, Encoding UTF8)

***** Sheet /
[pin_not_driven]: Input pin not driven by any Output pins
    ; Severity: error
    @(149.86 mm, 60.96 mm): Symbol U1B [74LS00] Pin 4 [, Input, Line]
[pin_not_connected]: Pin not connected
    ; Severity: error
    @(149.86 mm, 60.96 mm): Symbol U1B [74LS00] Pin 4 [, Input, Line]
[pin_not_connected]: Pin not connected
    ; Severity: error
    @(149.86 mm, 66.04 mm): Symbol U1B [74LS00] Pin 5 [, Input, Line]
[pin_to_pin]: Pins of type Output and Output are connected
    ; Severity: error
    @(165.10 mm, 63.50 mm): Symbol U1B [74LS00] Pin 6 [, Output, Inverted]
    @(165.10 mm, 46.99 mm): Symbol U1A [74LS00] Pin 3 [, Output, Inverted]
[pin_not_driven]: Input pin not driven by any Output pins
    ; Severity: error
    @(149.86 mm, 66.04 mm): Symbol U1B [74LS00] Pin 5 [, Input, Line]

 ** ERC messages: 5  Errors 5  Warnings 0

分配封装

在对 PCB 进行布线之前,需要为每一个将要装配在电路板上的元件选择封装。封装定义了物理元件和电路板上的布线之间的铜连接。

有些符号预分配了封装,但对许多符号来说,有多种可能的封装,所以用户需要选择合适的封装。

KiCad 提供了几种分配封装的方法:

  • 符号属性

    • 符号属性对话框

    • 符号字段表

  • 在放置符号的同时

  • 封装分配工具

下面将对每种方法进行解释。使用哪种方法是一个偏好的问题;根据情况,某种方法可能更方便。所有这些方法都是等效的,它们在符号的 封装 字段中存储所选封装的名称。

封装库表需要在分配封装之前进行配置。关于配置封装库表的信息, 请参见 PCB Editor manual

在符号属性中分配封装

符号的 封装 字段可以直接在符号的属性窗口中编辑。

在符号属性中分配封装

Clicking the library icon button in the Footprint field opens the Footprint Chooser, which shows the available footprints sorted by footprint libraries.

The Footprint Chooser filters footprints by name, description, and keywords, as well as any fields that are shown as columns, according to what you type into the search field. * and ? wildcards are available. The footprint search behaves the same as in the symbol chooser dialog.

If the symbol defines any footprint filters, the apply footprint filters option can be used to hide footprints that don’t match those filters. If the filter by pin count option is selected, only footprints that match the symbol’s pincount will be listed. You can choose to sort search results alphabetically or by best match by clicking on the sort button button.

Single clicking a footprint name selects the footprint and displays it in the preview pane on the right. You can switch between a 2D and 3D preview of the footprint by clicking the 2D component icon and 3D component icon buttons. Double clicking on a footprint closes the chooser and sets the symbol’s Footprint field to the selected footprint.

Selecting a footprint in Footprint Chooser

用符号字段表分配封装

和单独编辑每个符号的属性相比,符号字段表可以用来在一个地方查看和编辑设计中所有符号的属性。这包括通过编辑每个符号的 封装 字段来分配封装。

符号字段表可以通过 工具编辑符号字段…​,或者通过顶部工具栏上的 符号字段表图标 按钮进入。

`封装`字段在这里的作用与符号属性窗口的作用相同:可以直接编辑,也可以用封装库浏览器直观地选择封装。

用符号字段表批量编辑封装

关于符号字段表的更多信息,请参见关于编辑符号属性章节

放置符号时分配封装

当符号第一次被添加到原理图中时,可以为符号分配封装。

Some symbols are defined with a default footprint. These symbols will have this footprint preassigned when they are added to the schematic. If a symbol has a default footprint, the footprint will be graphically previewed in the symbol chooser dialog when the symbol is selected. For symbols without a default symbol defined, the footprint dropdown will say "No default footprint", and the footprint preview canvas will say "No footprint specified".

添加符号对话框中的默认封装

符号可以有封装过滤器,指定哪些封装适合与该符号一起使用。如果为选定的符号定义了封装过滤器,那么所有符合封装过滤器的封装都会作为选项出现在封装下拉菜单中。选定的封装将显示在预览画布中,当符号被添加到原理图中时,将被分配给该符号。

除非加载封装库,否则封装选项不会出现在封装下拉菜单中。在一个会话中第一次打开 "封装编辑器" 或 "封装库浏览器" 时,将加载封装库。

关于封装过滤器的更多信息,请参阅符号编辑器文档

用封装分配工具分配封装

封装分配工具允许你将原理图中的符号与印制电路板布线时用到的封装关联起来。它提供了封装列表过滤、封装查看和3D元件模型查看,以确保将正确的封装与每个元件联系起来。

元件可以手动或通过创建等效文件(.equ 文件)自动分配到其相应的封装。等效文件是将每个元件与它的封装联系起来的查找表。

点击 工具分配封装…​ 来运行该工具,或者点击顶部工具栏上的 封装分配工具的图标 图标。

封装分配工具概述

下面的图片显示了封装分配工具的主窗口。

封装分配工具的主窗口
  • 左边的窗格包含了与该工程相关的可用封装库的列表。

  • 中间窗格包含原理图中的符号列表。

  • 右边的窗格包含了从工程封装库加载的可用封装列表。

  • 底部的窗格描述了应用于封装列表的过滤器,并打印了在最右边窗格中选择的封装的信息。

顶部的工具条包含以下命令:

save 24

将当前的封装关联到原理图中。

library table 24

编辑全局和工程封装库表。

icon footprint browser 24

在封装查看器中查看选定的封装。

left 24

选择没有封装关联的前一个符号。

right 24

选择下一个没有封装关联的符号。

undo 24

撤消上次的编辑。

redo 24

重做最后一次编辑。

auto associate 24

使用等效文件执行自动封装关联

delete association 24

删除所有的封装分配。

module filtered list 24

通过所选符号中定义的封装过滤器来过滤封装列表。

module pin filtered list 24

按所选符号的引脚数过滤封装列表。

module library list 24

按选定的库过滤封装列表。

下表列出了封装分配工具的键盘命令:

向右箭头/Tab

激活当前窗格右侧的窗格。 如果当前激活的是最后一个窗格,则绕到第一个窗格。

向左箭头

激活当前窗格左侧的窗格。 如果当前激活的是第一个窗格,则绕到最后一个窗格。

向上箭头

选择当前所选列表中的前一个项目。

向下箭头

选择当前选择的列表中的下一个项目。

Page Up

选择当前所选项目向上翻一整页的项目。

Page Down

选择当前所选项目向下一整页的项目。

Home

选择当前选择的列表中的第一个项目。

End

选择当前所选列表的最后一个项目。

使用 "封装分配工具" 手动分配 "封装"

要手动将一个封装与一个元件关联起来,首先在元件(中间)窗格中选择一个元件。然后在封装(右)窗格中选择一个封装,双击所需封装的名称。封装将被分配给选定的元件,而下一个没有分配封装的元件将被自动选择。

如果没有封装出现在封装窗格中,检查封装过滤选项是否正确应用。

当所有的元件都有封装时,点击 OK 按钮来保存分配并退出工具。或者,点击 取消,放弃更新的赋值,或者点击 应用,保存原理图并继续,保存新的赋值,而不退出工具。

筛选 "封装" 列表

有四个过滤选项可以限制哪些封装显示在封装窗格中。过滤选项是通过顶部工具栏的三个按钮和一个文本框来启用和禁用的。

  • module filtered list 24:激活 过滤器可以在每个符号中定义。 例如,一个运算放大器符号可以定义过滤器,只显示 SOIC 和 DIP 封装。

  • module pin filtered list 24:只显示符合所选符号引脚数的封装。

  • module library list 24:只显示左侧窗格中选择的库的封装。

  • 在文本框中输入文本,会隐藏与文本不匹配的封装。当文本框为空时,该过滤器被禁用。

当所有的过滤器被禁用时,会显示完整的封装列表。

窗口的底部窗格中描述了应用的过滤器,以及符合所选过滤器的封装数量。例如,当符号的封装过滤器和引脚数过滤器被启用时,底部窗格会打印封装过滤器和引脚数:

启用符号封装过滤器和引脚数过滤器时的过滤器细节

可以同时使用多个过滤器来帮助缩小封装窗格中可能合适的封装列表。KiCad 标准库中的符号定义了封装过滤器,旨在与引脚数过滤器结合使用。

使用封装分配工具自动分配封装

封装分配工具允许你在一个外部文件中存储封装分配,并在以后加载这些分配,甚至在不同的工程中。这使你能够自动将符号与适当的封装联系起来。

外部文件被称为等效文件,它存储了一个符号到相应的封装的映射。等效文件通常使用 .equ 文件扩展名。等效文件是具有简单语法的纯文本文件,必须由用户用文本编辑器来创建。语法描述如下。

你可以在 "封装分配工具" 中点击 偏好设置管理 "封装关联文件" 来选择使用哪些等效文件。

管理等效文件
  • 通过点击 添加 按钮添加新的等效文件。

  • 点击 删除 按钮,删除所选的等效文件。

  • 通过点击 上移下移 按钮改变等效文件的优先级。如果一个符号的值在多个等效文件中被发现,最后一个匹配的等效文件的封装将覆盖早期的等效文件。

  • 点击 编辑文件 按钮,打开所选的等效文件。

相关的环境变量显示在窗口的底部。当 相对 路径选项被选中时,这些环境变量将被自动用于使所选等效文件的路径与项目或封装库相对。

一旦所需的等效文件以正确的顺序载入,就可以通过点击封装分配工具顶部工具栏上的 执行自动封装分配图标 按钮来进行自动封装分配。

所有在加载的等效文件中找到的符号都将自动分配其封装。然而,已经分配了封装的符号将不会被更新。

等效文件格式

等效文件中每一行代表一个符号。每行都有以下结构:

'<symbol value>' '<footprint library>:<footprint name>'

每个名称/值必须用单引号(')包围,并由一个或多个空格隔开。以 # 开头的行是注释。

例如,如果你想让所有值为 LM4562 的符号被分配到 Package_SO:SOIC-8_3.9x4.9_P1.27mm 的封装,等效文件中的一行应该是:

'LM4562' 'Package_SO:SOIC-8_3.9x4.9_P1.27mm'

下面是一个等效文件的例子:

#integrated circuits (smd):
'74LV14' 'Package_SO:SOIC-14_3.9x8.7mm_P1.27mm'
'EL7242C' 'Package_SO:SOIC-8_3.9x4.9_P1.27mm'
'DS1302N' 'Package_SO:SOIC-8_3.9x4.9_P1.27mm'
'LM324N' 'Package_SO:SOIC-14_3.9x8.7mm_P1.27mm'
'LM358' 'Package_SO:SOIC-8_3.9x4.9_P1.27mm'
'LTC1878' 'Package_SO:MSOP-8_3x3mm_P0.65mm'
'24LC512I/SM' 'Package_SO:SOIC-8_3.9x4.9_P1.27mm'
'LM2903M' 'Package_SO:SOIC-8_3.9x4.9_P1.27mm'
'LT1129_SO8' 'Package_SO:SOIC-8_3.9x4.9_P1.27mm'
'LT1129CS8-3.3' 'Package_SO:SOIC-8_3.9x4.9_P1.27mm'
'LT1129CS8' 'Package_SO:SOIC-8_3.9x4.9_P1.27mm'
'LM358M' 'Package_SO:SOIC-8_3.9x4.9_P1.27mm'
'TL7702BID' 'Package_SO:SOIC-8_3.9x4.9_P1.27mm'
'TL7702BCD' 'Package_SO:SOIC-8_3.9x4.9_P1.27mm'
'U2270B' 'Package_SO:SOIC-16_3.9x9.9_P1.27mm'

#regulators
'LP2985LV' 'Package_TO_SOT_SMD:SOT-23-5_HandSoldering'

查看当前封装

封装分配工具包含一个封装查看器。点击顶部工具栏上的 封装查看器图标 按钮可以启动封装查看器,并显示选定的封装。

查看封装

顶部的工具条包含以下命令:

refresh 24

刷新视图

zoom in 24

放大

zoom out 24

缩小

zoom fit in page 24

放大到适合显示区域

shape 3d 24

显示 3D 查看器

左边的工具条包含以下命令:

cursor 24

使用选择工具

measurement 24

在两点之间交互测量

grid 24

显示网格点或线

polar coord 24

在极坐标系和卡迪尔坐标系之间切换

unit inch 24

使用英寸

unit mil 24

以mil(1/1000英寸)为单位显示坐标

unit mm 24

以毫米为单位显示坐标

cursor shape 24

切换全窗口十字准线的显示

pad number 24

在草图或正常模式下的焊盘显示切换

pad sketch 24

在正常模式或轮廓模式下的焊盘显示切换

text sketch 24

在正常模式或大纲模式下的文本显示切换

show mod edge 24

在正常模式或大纲模式下的图形线显示切换

查看当前 3D 模型

点击 3D 视图图标 按钮在 3D 模型查看器中打开封装。

如果当前的封装不存在 3D 模型,那么在 3D 浏览器中只显示封装本身。
3D 模型查看

3D查看器在 PCB Editor manual中描述。

正向和反向批注

从原理图更新 PCB(正向批注)

使用 "从原理图更新 PCB" 工具将设计信息从原理图编辑器同步到电路板编辑器。在原理图编辑器和电路板编辑器中都可以用 工具从原理图更新 PCBF8)来访问该工具。你也可以使用电路板编辑器顶部工具栏上的 从原理图更新 PCB图标。这个过程通常被称为正向批注。

从原理图更新 PCB 是将设计信息从原理图转移到 PCB 的首选方法。在旧版本的 KiCad 中,相应的过程是将网表从原理图编辑器中导出并导入到电路板编辑器中。现在已经没有必要使用网表文件了。
从原理图更新 PCB

该工具将每个符号的封装添加到电路板上,并将更新的原理图信息传输到电路板上。同时,电路板的网络连接会被更新以匹配原理图。带有排除在电路板属性之外 的符号不会被更新到 PCB 上。

将对 PCB 进行的修改列在 待应用修改 窗格中。点击 更新 PCB 按钮之前,PCB 不会被修改。

你可以使用窗口底部的复选框来显示或隐藏不同类型的信息。可以使用 保存…​ 按钮将更改的报告保存到文件中。

选项

该工具有几个选项可以控制其行为。

选项 描述

根据位号将封装重新链接到原理图符号上

封装通常是通过符号添加到原理图中时创建的唯一标识符与原理图符号相连。符号的唯一标识符不能被改变。

如果选中,PCB 中的每个封装将被重新链接到与该封装具有相同位号的符号上。

如果不勾选,封装和符号将像往常一样通过唯一的标识符连接,而不是通过位号。每个封装的位号将被更新以匹配其链接符号的位号。

这个选项一般不应该被选中。它对于依赖改变原理图符号和封装之间的联系的特定工作流程是很有用的,例如重构原理图以方便布局,或者在设计的相同通道之间复制布局。

删除没有符号的封装

如果选中,PCB 中任何在原理图中没有相应符号的封装都将从 PCB 中删除。带有 "不在原理图中" 属性的封装将不受影响。

如果不勾选,没有相应符号的封装将不会被删除。

用原理图中指定的封装替换封装

如果选中,PCB 中的封装将被替换成相应原理图符号中指定的封装。

如果不勾选,即使原理图符号被更新以指定不同的封装,PCB 中已经存在的封装也不会被改变。

从 PCB 上更新原理图(反向批注)

KiCad 的典型工作流程是在原理图中进行修改,然后使用 "从原理图更新 PCB" 工具将修改内容同步到电路板上。然而,相反的过程也是可行的:可以在电路板上进行设计修改,然后在原理图或电路板编辑器中使用 工具从 PCB 更新原理图 同步回原理图。这个过程也被称为 "反向批注"。

从 PCB 上更新原理图

The tool syncs changes in reference designators, values, attributes (like DNP or Exclude From BOM), footprint assignments, other fields, and net names from the board to the schematic. Each type of change can be individually enabled or disabled.

将对原理图进行的修改列在 待应用的修改 窗格中。在您点击 更新原理图 按钮之前,原理图不会被修改。

你可以使用窗口底部的复选框来显示或隐藏不同类型的信息。可以使用 保存…​ 按钮将更改的报告保存到文件中。

选项

该工具有几个选项可以控制其行为。

Option

Description

Re-link footprints to schematic symbols based on their reference designators

If checked, each footprint in the PCB will be re-linked to the symbol that has the same reference designator as the footprint. This option is incompatible with updating symbol reference designators.

If unchecked, footprints and symbols will be linked by unique identifier as usual, rather than by reference designator.

Reference designators

If checked, symbol reference designators will be updated to match the reference designators of the linked footprints.

If unchecked, symbol reference designators will not be updated.

Values

If checked, symbol values will be updated to match the values of the linked footprints.

Values

If checked, symbol attributes (like exclude from BOM and DNP) will be updated to match the corresponding attributes of the linked footprints.

If unchecked, symbol values will not be updated.

Footprint assignments

If checked, footprint assignments will be updated for symbols which have had their footprints changed or replaced in the board.

If unchecked, symbol footprint assignments will not be updated.

Net names

If checked, the schematic will be updated with any net name changes that have been made in the board. Net labels will be updated or added to the schematic as necessary to match the board.

Other fields

If checked, other symbol fields will be updated to match the corresponding fields of the linked footprints. Reference designator, value, and footprint are each controlled by their own separate option.

If unchecked, net names will not be updated in the schematic.

The 按位置重新批注 该功能可以与反向批注位号结合使用 根据设计中的元件的位置重新批注所有元件。

用 CMP 文件进行反向批注

通过从 PCB 编辑器中导出 CMP 文件(文件导出封装关联(.cmp)文件…​)并在原理图编辑器中导入(文件导入封装分配…​),也可以将变化从 PCB 同步到原理图。

这种方法只能同步对封装分配和封装字段的修改。建议使用 "从 PCB 更新原理图" 工具来代替。

生成输出

打印

KiCad 可以使用 文件打印…​ 将原理图发送到标准打印机。

打印对话框

打印选项

打印图框: 在打印的原理图中包括图纸的边框和标题块。

输出模式: 以彩色或黑白方式打印原理图。

打印背景色: 包括打印的原理图中的背景色。该选项只在 仅以黑白打印 被禁用时才会启用。

使用不同的颜色主题进行打印: 选择不同的颜色方案进行打印,与在原理图编辑器中选择的显示方案不同。

页面设置…​: 打开一个页面设置对话框,用于设置纸张大小和方向。

预览: 打开一个打印预览对话框。

关闭: 关闭对话框,不打印。

打印: 打开系统打印对话框。

打印时使用平台及打印机特有的驱动程序,可能会产生意想不到的结果。当打印到一个文件时,建议使用 绘图 而不是 打印

绘图

KiCad 可以使用 文件绘图…​ 将原理图绘制到文件中。

支持的输出格式是 Postscript、PDF、SVG、DXF 和 HPGL。

绘制对话框

输出信息 窗格显示有关生成文件的信息。 可以用复选框显示或隐藏不同种类的信息,还可以用 保存…​ 按钮将信息保存到文件中。

点击绘制当前页 按钮绘制原理图的当前页。绘制全部页面 按钮可以绘制原理图的所有页面。每一页都会生成一个文件,但 PDF 输出除外,它将原理图的每一页作为单独的一页绘制在一个 PDF 文件中。

绘制选项

输出目录: 指定保存绘图文件的位置。如果是一个相对路径,它是相对于项目目录创建的。

输出格式: 选择要绘制的格式。有些格式有不同的选项。

页面大小: 设置用于绘制输出的页面大小。这可以被设置为匹配原理图的尺寸或其他页面尺寸。

绘制图框: 在打印的原理图中包括图纸边框和标题块。

输出模式: 设置输出为彩色或黑白。不是所有的输出格式都支持彩色。

颜色主题: 选择用于绘制输出的颜色主题。

绘图背景色: 绘图输出包含原理图背景色。如果输出格式不支持彩色,或者输出模式是黑白,则不会绘制背景色。

Minimum line width: Selects the minimum width for lines.

位置和单位: 设置绘图仪原点和单位。这个选项只 适用于 HPGL 输出。

笔宽: 设置绘图仪的笔宽。这个选项只适用于 HPGL 输出。

Generate property popups: Enables or disables the interactive PDF features described below. This option only applies for PDF output.

绘制后打开文件: 在绘制完成后自动打开绘制的输出文件。

PDF 交互功能

Plotted PDFs can optionally have several interactive features.

符号字段弹出
  • 可以点击超链接。

  • 目录中填充了原理图页以及每张页面中的符号和层次标签。

  • 点击原理图对象会弹出一个包含相关信息的菜单。

    • 符号显示其符号字段。

    • 层次的子页显示它们的原理图页名称和文件名,以及一个可以进入子页的选项。

    • 标签显示已解决的网络和网络类。

    • 总线显示其成员。

其中一些功能并非所有 PDF 阅读器都支持。

Generating a bill of materials

KiCad can generate a bill of materials that lists all of the components in the design. BOMs are configurable: you can select which components are included, how components are ordered, which symbol fields are included and in what order, and what the output format is.

BOMs are exported using the Symbol Fields Table. As a shortcut to open the Export tab of this dialog, you can select ToolsGenerate Bill of Materials…​ or use the BOM icon button on the top toolbar.

The contents of the BOM are configured in the Edit tab. The format of the exported BOM file is configured in the Export tab. The BOM is written when you press the Export button at the bottom of the dialog.

BOM contents

The exported BOM will contain exactly the components (rows) and fields (columns) shown in the Edit tab, with the same grouping and sorting. Components with the Exclude from BOM attribute set are shown in the Edit tab but will not be included in the BOM export. Components with the DNP (do not populate) attribute set can be optionally excluded from both the table in the Edit tab and the exported BOM by checking the Exclude DNP box. You can also limit the displayed components to those in the current sheet, the current sheet and all of its subsheets, or the entire schematic.

Symbol Fields Table Edit tab

Fields with the Show box checked will be included as columns in the BOM, and fields with the Group By box checked are used to group components together. Components are grouped into the same line if all of their Group By fields are identical and the Group symbols box is checked. You can set an arbitrary column name for each field and reorder columns by dragging their headers.

Presets are available to configure the list of fields. Presets store which fields are displayed, which fields are used for grouping, and the column order. You can create and save your own presets or use one of several default presets. Custom presets can be deleted in this dialog or in the Schematic Setup dialog.

The built-in presets "Grouped By Value" and "Grouped By Value and Footprint" replicate legacy BOM scripts, while "Attributes" shows only the reference and value fields and the DNP, exclude from board, exclude from simulation, and exclude from BOM attributes.

Some virtual fields are available that may be useful in BOM exports. Adding a field in the Symbol Fields Table beginning with a text variable will not create a new field in the symbols, but will create a special column in the table and BOM with auto-generated values for each component. The following variables may be especially useful for creating virtual fields in custom BOM formats:

  • ${QUANTITY} creates a field that contains the number of grouped instances of that component.

  • ${ITEM_NUMBER} creates a field that contains the row number of the component in the BOM.

  • ${SYMBOL_NAME} creates a field that contains the name of the schematic symbol.

  • ${SYMBOL_LIBRARY} creates a field that contains the name of the schematic symbol library.

  • ${DNP} creates a field with a checkbox that controls the component’s DNP attribute. In the BOM, this field resolves to the string "DNP" if the component’s DNP attribute is set, or an empty string otherwise.

  • ${EXCLUDE_FROM_BOARD} creates a field with a checkbox that controls the component’s exclude from board attribute. In the BOM, this field resolves to the string "Excluded from board" if the component’s exclude from board attribute is set, or an empty string otherwise.

  • ${EXCLUDE_FROM_SIM} creates a field with a checkbox that controls the component’s exclude from simulation attribute. In the BOM, this field resolves to the string "Excluded from simulation" if the component’s exclude from simulation attribute is set, or an empty string otherwise.

  • ${EXCLUDE_FROM_BOM} creates a field with a checkbox that controls the component’s exclude from BOM attribute. Components with the exclude from BOM attribute set are not included in the BOM.

Other text variables are also available.

The full functionality of the Edit tab, including virtual field behavior, is explained in more detail in the Symbol Fields Table documentation.

BOM format

The Export tab contains settings concerning the output file format for the BOM and displays a preview of the raw BOM file output.

Symbol Fields Table Export tab

At the top you can specify the output file. Pressing the Export button will write the BOM to this file path. This path can contain text variables.

The settings on the left control how the BOM information is formatted in the file. You can change the delimiter between fields, the delimiter that surrounds each field, the delimiter that separates a sequence of references (e.g. the comma in R1,R3), and the delimiter for a range of references (e.g. the dash in R1-R3). If no range delimiter is given, ranges will not be used: R1-R3 will be written out as R1,R2,R3, for example, assuming , as a reference delimiter. Tabs and newlines in fields can be preserved or stripped, depending on the Keep tabs and Keep line breaks settings.

Several default format presets are available. You can select a comma-separated value (CSV) format, a tab-separated value (TSV) format, or a semicolon-separated format. You can also create and save your own presets. Custom presets can be deleted in this dialog or in the Schematic Setup dialog.

Legacy BOM generation

Previous versions of KiCad used external scripts to process the design information into the desired output format. This BOM generation tool is still available by selecting ToolsGenerate Legacy Bill of Materials…​.

BOM 对话框

Several BOM generator scripts are included with KiCad, and users can also create their own. BOM generator scripts generally use Python or XSLT, but other tools can be used as long as you can specify a command line for KiCad to execute when running the generator.

您可以在 BOM 发生器脚本 列表中选择要使用的 BOM 生成器。 对话框的其余部分显示所选生成器的信息。您可以用 生成器昵称 文本框来改变生成器的显示名称。

右边的窗格显示所选脚本的信息。当生成器被执行时,右边的窗格会显示脚本的输出。

底部的文本框包含了 KiCad 用来执行生成器的命令。当选择脚本时,该文本框会自动填充,但对于某些生成器来说,该命令可能需要手工编辑。当关闭 BOM 工具时,KiCad 会保存每个生成器的命令行,因此定制的命令行会被保留下来。关于命令行的更多细节,请参阅 高级文档

在 Windows 下,BOM 生成器对话框有一个额外的 *显示控制台窗口*选项。当这个选项未被选中时,BOM 生成器在一个隐藏的控制台窗口中运行,任何输出都会被重定向并打印在对话框中。当该选项被选中时,BOM 生成器在一个可见的控制台窗口中运行,如果生成器插件提供了一个图形用户界面,这可能是必要的。

BOM 生成器脚本

By default, the legacy BOM tool presents three output script options.

  • bom_csv_grouped_extra outputs a CSV with a single section containing every component in the design. Components are grouped by value, footprint, DNP (do not populate), and any additional fields that are specified on the command line. To specify extra fields, add the desired field names as quoted strings at the end of the command line. For example, to include the MPN field, the end of the command line would be: <path to script>/bom_csv_grouped_extra.py "%I" "%O.csv" "MPN". The columns in the BOM are:

    • 行编号

    • 位号

    • 数量

    • 封装

    • 不安装

    • 指定的额外字段

  • bom_csv_grouped_by_value 输出的CSV有两个部分。第一部分包含了设计中的每个元件,每行都有一个元件。 第二部分也包含每个元件,但元件是按符号名称、值、封装和 DNP(不安装)分组的。BOM 中的列是:

    • 行编号

    • 数量

    • 位号

    • 符号库和符号名称

    • 封装

    • 数据手册

    • 不安装

    • 任何其他符号字段

  • bom_csv_grouped_by_value_with_fp 输出一个 CSV,其中有一个单独的部分,包含设计中的每个元件。元件按值、封装和 DNP(不安装)进行分组。BOM 中的列是:

    • 位号

    • 数量

    • 符号名称

    • 封装

    • 符号描述

    • 供应商

    • 不安装

额外的生成器脚本与 KiCad 一起安装,但默认情况下不会在生成器脚本列表中填入。这些脚本的位置取决于操作系统,并可能根据安装位置而有所不同。

Operating System Location

Windows

C:\Program Files\KiCad\8.0\bin\scripting\plugins\

Linux

/usr/share/kicad/plugins/

macOS

/Applications/KiCad/KiCad.app/Contents/SharedSupport/plugins/

通过点击 加号图标 按钮,可以在 BOM 生成器脚本列表中添加其他脚本。点击 删除图标 按钮,可以删除脚本。编辑图标 按钮在文本编辑器中打开所选的脚本。

关于创建和使用自定义 BOM 生成器的更多信息,请参见 高级文档

BOM export from PCB editor

The PCB Editor can export a BOM through FileFabrication OutputsBOM…​. This method provides no control over the output format and does not include all symbol information, but is useful for PCB-only workflows that do not involve a schematic. In general, it is recommended to use the schematic editor’s BOM export tool instead.

生成网表

网表是一个描述符号引脚之间电气连接的文件。 这些连接被称为网络。网表文件包含:

  • 符号及其引脚的列表。

  • 符号引脚之间的连接(网络)列表。

存在许多不同的网表格式。有时符号表和网表是两个独立的文件。网表是使用原理图设计软件的基础,因为网表建立了与其他电子 CAD 软件,如 PCB 布局软件、仿真器和可编程逻辑编译器的联系。

KiCad 支持几种网表格式:

  • KiCad 格式,可由 KiCad PCB 编辑器导入。然而,应该使用 "从原理图更新 PCB" 工具而不是将 KiCad 网表导入 PCB 编辑器。

  • OrCAD PCB2 格式,用于 OrCAD 设计 PCB。

  • CADSTAR 格式,用于 CADSTAR 设计 PCB。

  • Spice 格式,用于各种外部电路仿真器。

在 KiCad 5.0 及以后的版本中,将设计从原理图编辑器转移到 PCB 编辑器时,没有必要创建网表。推荐使用 "从原理图更新PCB" 工具。
其他使用网表的软件工具可能对元件名称、引脚、网络和其他字段中的空格和特殊字符有限制。为了兼容性,请注意其他工具中的这种限制,并相应地命名元件、网络等。

网表格式

网表是通过导出网表对话框(文件导出网表…​)导出的。

KiCad 网表导出

KiCad 支持导出多种格式的网表。KiCad、OrcadPCB2、CADSTAR、Spice 和 Spice Model。每种格式都可以通过选择窗口顶部的相应标签来选择。一些网表格式有额外的选项。

点击 导出网表 按钮,会提示输入网表文件名并保存网表。

对于大型原理图,网表的生成可能需要几分钟。

其他网表格式的自定义生成器可以通过点击 添加生成器…​ 按钮添加。自定义生成器是由 KiCad 调用的外部工具,例如 Python 脚本或 XSLT 样式表。关于自定义网表生成器的更多信息,请参见添加自定义网表生成器章节。

Spice 网表格式
Spice 网表导出

Spice 网表格式提供了几个选项。

当选择 使用当前图纸作为根图纸 时,只有当前页图纸导出到子电路模型中。否则,所有原理图图纸将被导出。

The save all voltages option adds a .save all command to the netlist, which causes the simulator to save all node voltages. The save all currents option adds a .probe alli command to the netlist, which causes the simulator save all node currents. The save all power dissipations adds .probe commands to save the power dissipation in each component.

不同仿真工具之间的行为可能有所不同。

无源符号值会自动调整,以便与各种 Spice 仿真器兼容。具体而言:

  • μM 作为单位前缀,分别被替换成 uMeg

  • 单位被删除(例如,4.7kΩ 被改为 4.7k

  • RKM 格式的数值被改写为与 Spice 兼容(例如,4u7 被改成 4.7u

Spice 网表导出器还提供了一种简单的方法,可以用外部仿真器对生成的网表进行仿真。这对于在不使用KiCad 的内部 ngspice 仿真器的情况下运行仿真,或者使用 KiCad 的仿真器工具不支持的选项运行 ngspice 仿真是很有用的。

Enter the path to the external simulator in the text box, with %I representing the generated netlist. Check the run external simulator command box to generate the netlist and automatically run the simulator.

默认的仿真器命令(spice "%I")必须调整为指向系统上安装的仿真器。

Spice 仿真器预期仿真命令(.PROBE.AC.TRAN 等)包含在网表中。原理图中包含的任何以句号(.)开始的文本行都将被包含在网表中。如果一个文本对象包含多行,只有以句号开头的行将被包含在内。

根据原理图中符号的 Spice 模型设置,用于包括模型库文件的 .include 指令被自动添加到网表。

Spice 模型网表格式
Spice 网表导出

KiCad 还可以将原理图的网表导出为 Spice 子电路模型,这可以包含在一个单独的 Spice 仿真中。原理图中的任何层次标签都被用作子电路模型的引脚。模型中的每个引脚都有批注,描述该引脚的电气方向:

  • 输入 的层次标签被映射到一个 输入 的批注上

  • 输出 的层次化标签被映射到 输出 批注上

  • 双向 层次标签被映射到 输入输出 批注上

  • 三态 的层次标签被映射到 三态 批注上

  • 被动 层次标签被映射到 被动 批注上

当选择 使用当前图纸作为根图纸 时,只有当前页图纸导出到子电路模型中。否则,所有原理图图纸将被导出。

网表示例

下面是 KiCad 仿真示例的 sallen_key 工程的原理图。

sallen_key 演示原理图

该原理图的 KiCad 格式网表如下:

(export (version "E")
  (design
    (source "/usr/share/kicad/demos/simulation/sallen_key/sallen_key.kicad_sch")
    (date "Sun 01 May 2022 03:14:05 PM EDT")
    (tool "Eeschema (6.0.4)")
    (sheet (number "1") (name "/") (tstamps "/")
      (title_block
        (title)
        (company)
        (rev)
        (date)
        (source "sallen_key.kicad_sch")
        (comment (number "1") (value ""))
        (comment (number "2") (value ""))
        (comment (number "3") (value ""))
        (comment (number "4") (value ""))
        (comment (number "5") (value ""))
        (comment (number "6") (value ""))
        (comment (number "7") (value ""))
        (comment (number "8") (value ""))
        (comment (number "9") (value "")))))
  (components
    (comp (ref "C1")
      (value "100n")
      (libsource (lib "sallen_key_schlib") (part "C") (description ""))
      (property (name "Sheetname") (value ""))
      (property (name "Sheetfile") (value "sallen_key.kicad_sch"))
      (sheetpath (names "/") (tstamps "/"))
      (tstamps "00000000-0000-0000-0000-00005789077d"))
    (comp (ref "C2")
      (value "100n")
      (fields
        (field (name "Fieldname") "Value")
        (field (name "SpiceMapping") "1 2")
        (field (name "Spice_Primitive") "C"))
      (libsource (lib "sallen_key_schlib") (part "C") (description ""))
      (property (name "Fieldname") (value "Value"))
      (property (name "Spice_Primitive") (value "C"))
      (property (name "SpiceMapping") (value "1 2"))
      (property (name "Sheetname") (value ""))
      (property (name "Sheetfile") (value "sallen_key.kicad_sch"))
      (sheetpath (names "/") (tstamps "/"))
      (tstamps "00000000-0000-0000-0000-00005789085b"))
    (comp (ref "R1")
      (value "1k")
      (fields
        (field (name "Fieldname") "Value")
        (field (name "SpiceMapping") "1 2")
        (field (name "Spice_Primitive") "R"))
      (libsource (lib "sallen_key_schlib") (part "R") (description ""))
      (property (name "Fieldname") (value "Value"))
      (property (name "SpiceMapping") (value "1 2"))
      (property (name "Spice_Primitive") (value "R"))
      (property (name "Sheetname") (value ""))
      (property (name "Sheetfile") (value "sallen_key.kicad_sch"))
      (sheetpath (names "/") (tstamps "/"))
      (tstamps "00000000-0000-0000-0000-0000578906ff"))
    (comp (ref "R2")
      (value "1k")
      (fields
        (field (name "Fieldname") "Value")
        (field (name "SpiceMapping") "1 2")
        (field (name "Spice_Primitive") "R"))
      (libsource (lib "sallen_key_schlib") (part "R") (description ""))
      (property (name "Fieldname") (value "Value"))
      (property (name "SpiceMapping") (value "1 2"))
      (property (name "Spice_Primitive") (value "R"))
      (property (name "Sheetname") (value ""))
      (property (name "Sheetfile") (value "sallen_key.kicad_sch"))
      (sheetpath (names "/") (tstamps "/"))
      (tstamps "00000000-0000-0000-0000-000057890691"))
    (comp (ref "U1")
      (value "AD8051")
      (fields
        (field (name "Spice_Lib_File") "ad8051.lib")
        (field (name "Spice_Model") "AD8051")
        (field (name "Spice_Netlist_Enabled") "Y")
        (field (name "Spice_Primitive") "X"))
      (libsource (lib "sallen_key_schlib") (part "Generic_Opamp") (description ""))
      (property (name "Spice_Primitive") (value "X"))
      (property (name "Spice_Model") (value "AD8051"))
      (property (name "Spice_Lib_File") (value "ad8051.lib"))
      (property (name "Spice_Netlist_Enabled") (value "Y"))
      (property (name "Sheetname") (value ""))
      (property (name "Sheetfile") (value "sallen_key.kicad_sch"))
      (sheetpath (names "/") (tstamps "/"))
      (tstamps "00000000-0000-0000-0000-00005788ff9f"))
    (comp (ref "V1")
      (value "AC 1")
      (libsource (lib "sallen_key_schlib") (part "VSOURCE") (description ""))
      (property (name "Sheetname") (value ""))
      (property (name "Sheetfile") (value "sallen_key.kicad_sch"))
      (sheetpath (names "/") (tstamps "/"))
      (tstamps "00000000-0000-0000-0000-000057336052"))
    (comp (ref "V2")
      (value "DC 10")
      (fields
        (field (name "Fieldname") "Value")
        (field (name "Spice_Node_Sequence") "1 2")
        (field (name "Spice_Primitive") "V"))
      (libsource (lib "sallen_key_schlib") (part "VSOURCE") (description ""))
      (property (name "Fieldname") (value "Value"))
      (property (name "Spice_Primitive") (value "V"))
      (property (name "Spice_Node_Sequence") (value "1 2"))
      (property (name "Sheetname") (value ""))
      (property (name "Sheetfile") (value "sallen_key.kicad_sch"))
      (sheetpath (names "/") (tstamps "/"))
      (tstamps "00000000-0000-0000-0000-0000578900ba"))
    (comp (ref "V3")
      (value "DC 10")
      (fields
        (field (name "Fieldname") "Value")
        (field (name "Spice_Node_Sequence") "1 2")
        (field (name "Spice_Primitive") "V"))
      (libsource (lib "sallen_key_schlib") (part "VSOURCE") (description ""))
      (property (name "Fieldname") (value "Value"))
      (property (name "Spice_Primitive") (value "V"))
      (property (name "Spice_Node_Sequence") (value "1 2"))
      (property (name "Sheetname") (value ""))
      (property (name "Sheetfile") (value "sallen_key.kicad_sch"))
      (sheetpath (names "/") (tstamps "/"))
      (tstamps "00000000-0000-0000-0000-000057890232")))
  (libparts
    (libpart (lib "sallen_key_schlib") (part "C")
      (footprints
        (fp "C?")
        (fp "C_????_*")
        (fp "C_????")
        (fp "SMD*_c")
        (fp "Capacitor*"))
      (fields
        (field (name "Reference") "C")
        (field (name "Value") "C"))
      (pins
        (pin (num "1") (name "") (type "passive"))
        (pin (num "2") (name "") (type "passive"))))
    (libpart (lib "sallen_key_schlib") (part "Generic_Opamp")
      (fields
        (field (name "Reference") "U")
        (field (name "Value") "Generic_Opamp"))
      (pins
        (pin (num "1") (name "+") (type "input"))
        (pin (num "2") (name "-") (type "input"))
        (pin (num "3") (name "V+") (type "power_in"))
        (pin (num "4") (name "V-") (type "power_in"))
        (pin (num "5") (name "") (type "output"))))
    (libpart (lib "sallen_key_schlib") (part "R")
      (footprints
        (fp "R_*")
        (fp "Resistor_*"))
      (fields
        (field (name "Reference") "R")
        (field (name "Value") "R"))
      (pins
        (pin (num "1") (name "") (type "passive"))
        (pin (num "2") (name "") (type "passive"))))
    (libpart (lib "sallen_key_schlib") (part "VSOURCE")
      (fields
        (field (name "Reference") "V")
        (field (name "Value") "VSOURCE")
        (field (name "Fieldname") "Value")
        (field (name "Spice_Primitive") "V")
        (field (name "Spice_Node_Sequence") "1 2"))
      (pins
        (pin (num "1") (name "") (type "input"))
        (pin (num "2") (name "") (type "input")))))
  (libraries
    (library (logical "sallen_key_schlib")
      (uri "/usr/share/kicad/demos/simulation/sallen_key/sallen_key_schlib.kicad_sym")))
  (nets
    (net (code "1") (name "/lowpass")
      (node (ref "C1") (pin "1") (pintype "passive"))
      (node (ref "U1") (pin "2") (pinfunction "-") (pintype "input"))
      (node (ref "U1") (pin "5") (pintype "output")))
    (net (code "2") (name "GND")
      (node (ref "C2") (pin "2") (pintype "passive"))
      (node (ref "V1") (pin "2") (pintype "input"))
      (node (ref "V2") (pin "2") (pintype "input"))
      (node (ref "V3") (pin "1") (pintype "input")))
    (net (code "3") (name "Net-(C1-Pad2)")
      (node (ref "C1") (pin "2") (pintype "passive"))
      (node (ref "R1") (pin "1") (pintype "passive"))
      (node (ref "R2") (pin "2") (pintype "passive")))
    (net (code "4") (name "Net-(C2-Pad1)")
      (node (ref "C2") (pin "1") (pintype "passive"))
      (node (ref "R2") (pin "1") (pintype "passive"))
      (node (ref "U1") (pin "1") (pinfunction "+") (pintype "input")))
    (net (code "5") (name "Net-(R1-Pad2)")
      (node (ref "R1") (pin "2") (pintype "passive"))
      (node (ref "V1") (pin "1") (pintype "input")))
    (net (code "6") (name "VDD")
      (node (ref "U1") (pin "3") (pinfunction "V+") (pintype "power_in"))
      (node (ref "V2") (pin "1") (pintype "input")))
    (net (code "7") (name "VSS")
      (node (ref "U1") (pin "4") (pinfunction "V-") (pintype "power_in"))
      (node (ref "V3") (pin "2") (pintype "input")))))

在 Spice 格式中,网表如下:

.title KiCad schematic
.include "ad8051.lib"
XU1 Net-_C2-Pad1_ /lowpass VDD VSS /lowpass AD8051
C2 Net-_C2-Pad1_ GND 100n
C1 /lowpass Net-_C1-Pad2_ 100n
R2 Net-_C2-Pad1_ Net-_C1-Pad2_ 1k
R1 Net-_C1-Pad2_ Net-_R1-Pad2_ 1k
V1 Net-_R1-Pad2_ GND AC 1
V2 VDD GND DC 10
V3 GND VSS DC 10
.ac dec 10 1 1Meg
.end

符号和符号库

KiCad 将符号组织到符号库中,符号库是符号的集合。原理图中的每个符号都由一个完整的名称作为唯一标识,完整的名称由库的名称和符号名称组成。例如,标识符 Audio:AD1853 是指 Audio 库中的 AD1853 符号。

管理符号库

KiCad 使用一个符号库表将符号库名称映射到磁盘上的符号库。 KiCad 使用一个全局的符号库表,以及一个针对每个工程的表。要编辑符号库表,请使用 偏好设置管理符号库…​

符号库列表对话框

全局符号库表包含了无论当前加载的工程是什么,都可以使用的库列表。该表保存在 KiCad 配置文件夹下的 sym-lib-table 文件中。该文件夹的位置 取决于使用的操作系统。

工程专用的符号库表包含了专门为当前加载工程提供的库的列表。如果有任何工程专用的符号库,该表将保存在工程文件夹下的 sym-lib-table 文件中。

KiCad’s symbol library management system allows directly using many types of symbol libraries, including formats that are native to other non-KiCad EDA tools:

  • KiCad symbol libraries (.kicad_sym files)

  • KiCad Legacy symbol libraries (.lib files)

  • Altium Designer libraries (.SchLib or .IntLib files)

  • CADSTAR Schematic Archive libraries (.lib files)

  • KiCad database library configuration files (.kicad_dbl files)

  • Eagle libraries (.xml files)

  • EasyEDA (JLCEDA) Standard Edition libraries (.json files)

  • EasyEDA (JLCEDA) Professional Edition libraries (.elibz, .epro, or .zip files)

  • KiCad HTTP library configuration files (.kicad_httplib files)

Non-KiCad symbol libraries, including KiCad Legacy symbol libraries, can be migrated to KiCad .kicad_sym format using the Migrate Libraries button (see the migrating libraries section).

KiCad only supports writing to KiCad’s native .kicad_sym format symbol libraries. All other symbol library formats are read-only. To modify a non-KiCad format symbol library, you must first convert it to KiCad format.

初始配置

第一次运行 KiCad 原理图编辑器时,如果在 KiCad 配置文件夹中没有找到全局符号表文件 sym-lib-table,KiCad 将引导用户设置一个新的符号库表。这个过程将在 初始配置中描述。

管理表格条目

符号库只有在它们被添加到全局或工程专用的符号库表中时才能使用。

通过点击 文件夹图标 按钮然后选择一个库或点击 加号图标 按钮然后输入库文件的路径来添加一个库。选定的库将被添加到当前打开的库表中(全局或特定工程)。可以通过选择所需的库条目并点击 删除图标 按钮来删除库。

The Up icon and Down icon buttons move the selected library up and down in the library table. This does not affect the display order of libraries in the Symbol Editor or Symbol Chooser.

通过取消选中第一列中的 Active 复选框,可以使库处于非活动状态。非活动状态的库仍然在库表中,但不会出现在任何库的浏览器中,也不会从磁盘加载,这可以减少加载时间。

通过点击范围内的第一个库,然后 Shift - 点击范围内的最后一个库,可以选择一系列的库。

每个库必须有一个独特的名称:在同一个表中不允许有重复的库名称。然而,名称可以在全局和工程库表中重复。工程表中的库比全局表中的同名库优先级更高。

库的名称不一定要与库的文件名或路径有关。冒号字符(:)不能在库的名称或符号名称中使用,因为它被用作名称和符号之间的分隔符。

Each library entry must have a valid path. Paths can be defined as absolute, relative, or by path variable substitution.

The appropriate library format must be selected in order for the library to be properly read. The supported formats are listed above. Only KiCad format libraries (.kicad_sym) can be saved. Other symbol library formats are read-only and must be converted to KiCad format before you can modify them.

有一个可选的描述字段,用于添加库条目的描述。选项字段目前不使用,所以添加选项在加载库时不会有任何影响。

Path Variable Substitution

The symbol library tables support path variable substitution, which allows you to define path variables containing custom paths to where your libraries are stored. Path variable substitution is supported by using the syntax ${PATH_VAR_NAME} in the symbol library path.

By default, KiCad defines several path variables which are described in the project manager documentation. Path variables can be configured in the PreferencesConfigure Paths…​ dialog.

Using path variables in the symbol library tables allows libraries to be relocated without breaking the symbol library tables, so long as the path variables are updated when the library location changes.

${KIPRJMOD} is a special path variable that always expands to the absolute path of the current project directory. ${KIPRJMOD} allows libraries to be stored in the project folder without having to use an absolute path in the project library table. This makes it possible to relocate projects without breaking their project library tables.

使用模式

符号库可以全局定义,也可以专门为当前加载的工程定义。在用户的全局表中定义的符号库总是可用的,并存储在用户的 KiCad 配置文件夹中的 sym-lib-table 文件中。工程专用的符号库表只对当前打开的工程文件有效。

每种方法都有其优点和缺点。在全局表中定义所有的库意味着它们在需要时总是可用的。这样做的缺点是,加载时间会增加。

在工程的基础上定义所有的符号库,意味着你只有工程所需的库,这减少了符号库的加载时间。缺点是你总是要记住添加每个工程所需的每个符号库。

一种使用模式是在全局范围内定义常用的库,并在工程专用的库表中定义工程所需的库。对于如何定义库没有任何限制。

Migrating symbol libraries to KiCad format

Non-KiCad format libraries, including legacy libraries (.lib files), are read-only. They need to be converted to KiCad format (.kicad_sym files) before you can save changes to them.

As with most KiCad files, newer versions of KiCad can open older-format library files, but older versions of KiCad cannot read files once they have been saved by a newer version of KiCad.

Libraries in other formats can be converted to KiCad libraries by selecting them in the symbol library table and clicking the Migrate Libraries button. Multiple libraries can be selected and migrated at once by Ctrl-clicking or shift-clicking.

也可以一次转换一个库,方法是在符号编辑器中打开它们并将它们另存为新库。

遗留工程重新映射

当加载在符号库表实现之前创建的原理图时,KiCad 将尝试将原理图中的符号库链接重新映射到适当的库表符号。 这个过程的成功与否取决于几个因素:

  • 原理图中使用的原始库仍然可用,并且与符号被添加到原理图中时相比没有变化。

  • 所有恢复操作都是在检测到创建恢复库或保持现有恢复库最新时进行的。

  • 工程符号缓存库的完整性没有被破坏。

重新映射将在工程文件夹中的 rescue-backup 文件夹中备份所有在重新映射期间被改变的文件。 在重新映射之前,一定要对你的工程做一个备份,以防出错。

即使恢复操作已被禁用,也会被执行,以确保正确的符号可用于重新映射。 不要取消这个操作,否则重新映射将不能正确地重新映射原理图符号。 任何错误的符号链接将不得不手动修复。

如果原来的库已经被删除,并且没有进行恢复,作为最后的手段,缓存库可以作为恢复库使用。将缓存库复制到一个新的文件名,并使用符号库表实现之前的 KiCad 版本将新的库文件添加到库列表的顶部。

创建和编辑符号

符号是一个元件的在原理图上的表述。一个符号由以下部分组成:

  • 图形对象(直线、圆形、圆弧、文字等),决定了符号在原理图中的外观。

  • 引脚,具有图形属性(直线、时钟、反相、低电平有效等)和电气属性(输入、输出、双向等),由电气规则检查(ERC)工具使用。

  • 字段,如位号、值、PCB 设计的对应封装名称等。

A symbol library is composed of one or more symbols. Generally the symbols are logically grouped by function, type, and/or manufacturer. Each symbol library is a single file with the .kicad_sym extension.

符号可以从同一库中的另一个符号衍生出来。派生符号共享基础符号的图形形状和引脚定义,但可以覆盖基础符号的属性字段(值、封装、封装筛选器、数据手册、描述等)。派生符号可用于定义与基本部件相似的符号。例如,74LS00、74HC00 和 7437 符号都可以从 7400 符号衍生出来。在以前的 KiCad 版本中,派生符号被称为别名。

符号编辑器概述

KiCad provides a symbol editing tool that allows you to create libraries; add, edit, delete, or transfer symbols between libraries; export symbols to files; and import symbols from files. The Symbol Editor can be launched from the KiCad Project Manager or from the Schematic Editor (ToolsSymbol Editor).

一般来说,设计一个符号的流程包括:

  • 定义符号是否由一个或多个单元组成。

  • 定义符号是否有替代的主体风格(也称为德摩根代号)。

  • 使用直线、矩形、圆形、多边形和文字设计其符号外观。

  • 添加引脚,并仔细定义每个引脚的图形元素、名称、编号和电气属性(输入、输出、三态、电源输出等)。

  • 确定该符号是否应从另一个具有相同图形设计和引脚定义的符号中衍生出来。

  • 添加可选的字段,如 PCB 设计软件使用的封装名称和/或定义其可见性。

  • 通过添加描述字符串和数据手册链接来记录该符号,等等。

  • 将其保存在所需的库中。

The Symbol Editor main window is shown below. It has three toolbars for quick access to common features and a symbol viewing/editing canvas. Not all commands are available on the toolbars, but all commands are available in the menus.

In addition to the toolbars, there are collapsible panels for the symbol tree and Properties Manager on the left. The bottom of the window contains a message panel that shows details about the selected object.

符号编辑器主窗口
Top toolbar

主工具栏位于主窗口的顶部。工具栏的按钮包括撤销/重做命令、缩放命令、符号属性对话框和单元外观管理控制等。

新建符号图标

在选定的库中创建一个新的符号。

保存图标

保存当前选定的库。库中所有修改过的符号都将被保存。

撤消图标

撤销上次的编辑。

重做图标

重做最后一次撤消。

刷新图标

刷新显示。

放大图标

放大。

缩小图标

缩小。

放大到适合页面的图标

放大到适合显示的符号。

放大到选择图标

放大到适合选择。

逆时针旋转图标

逆时针旋转。

顺时针旋转图标

顺时针旋转。

水平镜像图标

水平镜像。

垂直镜像图标

垂直镜像。

符号属性图标

编辑当前的符号属性。

引脚表图标

在一个表格界面中编辑符号的引脚。

数据手册图标

打开符号的数据手册,如果它被定义的话。

ERC图标

测试当前符号是否有设计错误。

普通主体样式图标

选择正常的主体风格。如果当前符号没有备选的主体样式,该按钮将被禁用。

备用主体样式图标

选择备用的主体风格。如果当前的符号没有备用的主体风格,该按钮将被禁用。

单元下拉

选择要显示的多单元符号的某个单元。如果当前的符号不是来自于多单元的符号,则下拉控件将被禁用。

同步引脚编辑模式图标

启用同步引脚编辑模式。启用该模式后,任何引脚的修改都会传播到所有其他符号单元。引脚编号的变化不会被传播。这种模式对有多个可互换单元的符号自动启用,对只有一个单元的符号不能启用。

左侧工具栏显示控制

The left toolbar provides options to change the display of items in the Symbol Editor.

Grid icon

Toggle grid visibility on and off.

Grid override icon

Toggle grid overrides on and off.

Inch unit icon

Set units to inches.

Millimeter unit icon

Set units to mils (0.001 inch).

Millimeter unit icon

Set units to millimeters.

Cursor shape icon

Toggle full screen cursor on and off.

Show pintype icon

Toggle display of pin electrical types.

Symbol tree icon

Toggle display of library and symbol tree.

Symbol tree icon

Toggle display of Properties Manager pane.

Right toolbar tools

Placement and drawing tools are located in the right toolbar.

Cursor icon

Select tool. Right-clicking with the select tool opens the context menu for the object under the cursor. Left-clicking with the select tool displays the attributes of the object under the cursor in the message panel at the bottom of the main window. Double-left-clicking with the select tool will open the properties dialog for the object under the cursor.

Pin icon

Pin tool. Left-click to add a new pin.

Text icon

Graphical text tool. Left-click to add a new graphical text item.

Textbox icon

Graphical textbox tool. Left-click to add a new graphical textbox item.

Add rectangle icon

Rectangle tool. Left-click to begin drawing the first corner of a graphical rectangle. Left-click again to place the opposite corner of the rectangle.

Add circle icon

Circle tool. Left-click to begin drawing a new graphical circle from the center. Left-click again to define the radius of the circle.

Add arc icon

Arc tool. Left-click to begin drawing a new graphical arc item from the first arc end point. Left-click again to define the second arc end point. Adjust the radius by dragging the arc center point.

Add line icon

Connected line tool. Left-click to begin drawing a new graphical line item in the current symbol. Left-click for each additional connected line. Double-left-click to complete the line.

Add line icon

Connected line tool. Left-click to begin drawing a new graphical line item in the current symbol. Left-click for each additional connected line. Double-left-click to complete the line.

Anchor icon

Anchor tool. Left-click to set the anchor position of the symbol.

Delete icon

Delete tool. Left-click to delete an object from the current symbol.

Browsing, modifying, and saving symbols

The Symbol tree icon button displays or hides the list of available libraries, which allows you to select an active library. When a new symbol is created, it will be placed in the active library.

Clicking on a symbol name opens that symbol in the editor, and hovering the cursor over the name of a symbol displays a preview of the symbol.

有些符号是由其他符号衍生出来的。派生的符号名称在树状图中以 大写字母 显示。如果一个派生符号被打开,它的符号图形将不能被编辑。它的符号字段将可以正常编辑。要编辑一个基本符号及其所有衍生符号的图形,请打开基本符号。

After modification, a symbol can be saved in the current library or a different library. To save the modified symbol in the current library, click the Save icon icon.

保存一个修改过的符号也会保存同一库中所有其他修改过的符号。

To save the symbol changes to a new symbol, click FileSave Copy As…​. The symbol can be saved in the current library or a different library, and a new name can be set for the symbol.

To create a new file containing only the current symbol, click FileExportSymbol…​. This file will be a standard symbol library file which will contain only one symbol.

Creating a new symbol library

You can create a new symbol library by clicking FileNew Library…​. At this point you must choose whether the new library should be added to the global symbol library table or the project symbol library table. Libraries in the global library table will be available to all projects, while libraries in the project library table will only be available in the current project.

symbol editor new library

Following selection of the library table, you must choose a name and location for the new library. A new, empty library will be created at the specified location.

创建一个新符号

To create a new symbol in the current symbol library, click the New symbol icon button. You will be asked for a number of symbol properties.

  • 符号名称

  • 一个可选的基础符号,用于派生新的符号。新符号将使用基础符号的图形形状和引脚配置,但其他符号信息可以在派生符号中修改。基础符号必须与新派生符号在同一个库中。

  • 位号前缀(U, C, R)。

  • 每个符号的单元数,以及这些单元是否可以互换(例如,一个 7400 四路 NAND 符号可以有 4 个单元,每个门一个)。

  • 是否需要另一种主体样式(有时被称为 "德-摩根等价")。

  • Whether the symbol is a power symbol. Power symbols appear in the Add Power Symbol dialog in the Schematic editor, make global net connections based on their value, cannot be assigned a footprint, and are excluded from the PCB and bill of materials.

  • 该符号是否应从物料清单中排除。

  • 该符号是否应从 PCB 中排除。

还有几种图形选项。

  • 每个引脚的末端和它的引脚名称之间的偏移。

  • 是否应显示引脚编号和引脚名称。

  • 引脚名称是否应显示在引脚旁边,或显示在符号主体内的引脚末端。

这些属性以后也可以在符号属性窗口中修改。

新建符号属性

一个新的符号将使用上述属性被创建,并将出现在编辑器中,如下图所示。

新建的符号

The blue cross in the center is the symbol anchor, which specifies the symbol origin i.e. the coordinates (0, 0). The anchor can be repositioned by selecting the Anchor icon button and clicking on the new desired anchor position.

Editing Symbol Properties

符号属性是在创建符号时设置的,但它们可以在任何时候被修改。要改变符号属性,请点击 符号属性图标 图标,显示符号属性对话框。你也在编辑画布中空白位置双击打开属性对话框。

符号属性

设置 单元数量,并检查 所有单元都可互换具有交替的主体风格(如适用)是很重要的,因为这些设置会影响引脚和图形被添加到每个符号单元的方式。

如果你在向符号添加引脚后再改变符号的单元数,你将需要做额外的工作来为额外的单元添加引脚和图形。如果最初正确设置了这些属性,引脚和图形就会自动添加到每个单元。尽管如此,还是可以在任何时候修改这些属性。

图形选项 显示引脚编号显示引脚名称 用来定义引脚编号和引脚名称文本的可见性。选项 将引脚名称置于内部 定义了引脚名称相对于引脚主体的位置。如果该选项被选中,引脚名称将被显示在符号的轮廓内。在这种情况下,引脚名称位置偏移 属性定义了文字远离引脚末端的位置。通常,0.02 到 0.05 英寸是合理的。

下面的例子显示了一个没有勾选 将引脚名称置于内部 选项的符号。注意名称和引脚编号的位置。

未勾线将引脚名称置于内部
Symbol Name and Keywords

Symbol name is the symbol’s name in the library. Symbols are identified by a combination of the library and symbol name.

在以前的 KiCad 版本中,符号名称与 字段相连。 在 KiCad 7.0 及以后的版本中,这种联系被删除。

The keywords should contain additional terms related to the component. Keywords are primarily used, in combination with the symbol name and the Description field, for searching for the symbol in the Symbol Chooser and the Symbol Editor. Those three items are also displayed when you select a symbol in the Symbol Chooser.

符号字段

Symbols contain multiple fields, which are named values containing information related to the symbol. Fields can be displayed on the schematic or hidden and only shown in the symbol’s properties. Some fields have special meaning to KiCad: Reference and Footprint are both critical for creating a PCB, for example. Other fields may contain information that is important for a design but is not interpreted by KiCad, like pricing or stock information for a part.

Any fields defined in a library symbol will be included in the symbol when it is added to a schematic. You can also add new fields to symbols in the schematic. Whether they are in the library symbol or not, these fields can then be edited on a per-symbol basis in the schematic. They are also transferred to the symbol’s corresponding footprint in the PCB.

Symbol fields are different than graphic text. In addition to being named, fields can be moved and edited in the schematic, while symbol text can only be edited in the symbol editor.

All library symbols are defined with five default fields: Reference, Value, Footprint, Datasheet, and Description, which are added whenever a symbol is created. These default fields cannot be deleted. Only the Reference field is required to have a value: the contents of a library symbol’s Reference field is used as the reference designator prefix when the symbol is added to a schematic. In the schematic, the symbol’s Reference field contains the entire reference designator.

如果使用 封装 字段,则包含符号与封装关联。格式是 LIBNAME:FOOTPRINTNAME,其中 LIBNAME 是封装库表中的封装库名称(见 PCB 编辑器手册中的 封装库表部分),FOOTPRINTNAMELIBNAME 库中的封装名称。

The Description field can contain text describing the symbol such as the component function, distinguishing features, and package options. Together with the symbol’s name and keywords, text in this field is used when searching for symbols in the Symbol Chooser or Symbol Editor. Before KiCad version 8.0, this was a dedicated property (like the symbol name and keywords) rather than a symbol field.

Symbols defined in libraries are typically defined with only these five default fields. Additional fields such as vendor, part number, unit cost, etc. can be added to library symbols but generally this is done in the schematic editor so the additional fields can be added to every symbol in the schematic, not just all symbols of one type.

创建额外的空符号字段的一种便捷方法是使用定义字段名称模板。字段名称模板定义空字段,当每个符号插入原理图时,这些字段会被添加到每个符号中。字段名称模板可以在原理图编辑器首选项中全局定义(针对所有原理图),也可以在原理图设置对话框中局部定义(针对每个工程)。
如果你想在符号字段中管理大量的元件数据,可以考虑使用数据库关联库

要编辑一个现有的符号字段,请双击该字段,选择它或悬停并按 E,或右击字段文本并选择 属性…​

To add new fields, delete optional fields, or edit existing fields, use the Component properties icon icon on the main tool bar to open the Symbol Properties dialog. Fields can be arbitrarily named, but names starting with ki_, e.g. ki_description, are reserved by KiCad and should not be used for user fields.

Fields have a number of properties, each of which is shown as a column in the properties grid. Not all columns are shown by default; columns can be shown or hidden by right clicking on the grid header and selecting or deselecting columns from the menu.

Footprint Filters

封装筛选器标签用于定义哪些封装适合与符号一起使用。筛选器可以在封装分配工具中使用,以便只显示每个符号合适的封装。

可以定义多个封装筛选器。符合任何一个筛选器的封装将被显示;如果没有定义筛选器,那么所有的封装都将被显示。

筛选器可以使用通配符。* 匹配任何数量的字符,包括零,而 ? 匹配零或一个字符。例如,SOIC-* 将匹配 SOIC-8_3.9x4.9mm_P1.27mm 封装以及任何其他以 SOIC- 开头的封装。筛选器 SOT?23 匹配 SOT23 以及 SOT-23

封装筛选器

Symbol Units and Alternate Body Styles

Symbols can have more than one unit per package, each with different graphics and pin configurations. This is often used for logic gates, opamps, or other components that have multiple subunits within one physical package. Symbols can also have up to two body styles, a standard symbol and an alternate symbol often referred to as a "De Morgan equivalent".

For example, consider a relay with two switches, which can be designed as a symbol with one body style and three different units: a coil, switch 1, and switch 2. Designing a symbol with multiple units per package and/or alternate body styles is very flexible. A pin or a body symbol item can be common to all units or specific to a given unit or they can be common to both symbolic representation so are specific to a given symbol representation.

By default, pins are specific to a unit and body style. When a pin is common to all units or all body styles, it only needs to be created once, no mattery how many units or body styles are used. This is also the case for the body style graphic shapes and text, which may be common to each unit, but typically are specific to each body style.

要向一个符号添加额外的单元,在符号属性对话框中将 单元数量 属性设置为适当的数字。默认情况下,符号单元被命名为 单元 A单元 B 等,但你可以使用 编辑设置单元显示名称…​ 为当前单元设置一个任意的名称。

Use the unit selection dropdown unit selection dropdown to select the unit you wish to edit.

要添加一个备用的主体样式,请在符号属性对话框中设置 存在备用的主体样式(德摩根) 属性。

If the symbol has an alternate body style defined, one body style must be selected for editing at a time. To edit the normal representation, click the Normal representation icon icon. To edit the alternate representation, click on the Alternate representation icon icon.

同步引脚编辑模式 可以通过点击 同步引脚编辑模式图标 图标启用。在这种模式下,引脚的修改会在符号单元之间同步;一个单元中的修改也会反映在其他单元中。当这种模式被禁用时,一个单元中的引脚修改不会影响其他单元。当 所有单元可互换 被选中时,该模式会自动启用,但它可以被禁用。当 所有单元可互换 未被选中或符号只有一个单元时,该模式不能被启用。
具有多个不可互换单元的符号示例

对于具有多个不能互换单元的符号的例子,思考一下继电器,它的符号 3 个单元:一个线圈、开关 1 和开关 2。

这三个单元并不都是一样的,所以在符号属性对话框中应取消选择 所有单元都可以互换。另外,这个选项可以在最初创建符号时指定。

取消勾选所有单元都可互换
单元 A
继电器单元 A
单元 B
继电器单元 B
单元 C
继电器单元 C

单元 A 与单元 B、单元 C 的符号和引脚布局不一样,所以这些单元不能互换。

Symbol Graphics

Graphical elements create the visual representation of a symbol and contain no electrical connection information. You can draw new graphic shapes using the buttons on the right toolbar. The following types of objects are available:

  • Lines (line icon) and polygons (polygon icon) defined by start and end points.

  • Rectangles (rectangle icon) defined by two diagonal corners.

  • Circles (circle icon) defined by the center and radius.

  • Arcs (arc icon) defined by the starting and ending point of the arc and its center.

  • Graphical text (Text icon) and textboxes (textbox icon), which is automatically oriented to be readable, even when the symbol is mirrored. Note that graphic text items are not the same as symbol fields.

Each graphic item (line, arc, circle, etc.) can be defined as common to all units and/or body styles or specific to a given unit and/or body style.

Element options can be quickly accessed by right-clicking on the element to display the context menu for the selected element. You can also double-left-click on an element to modify its properties, or edit its properties using the Properties Manager pane.

Below is the properties dialog for a polygon element.

图形线属性

图形元素的属性是:

  • 边界 决定是否应该绘制形状的边框。

  • 宽度颜色 定义了边框的线宽和颜色。边界宽度为 0 时,使用原理图的默认符号线宽。风格 决定了边框的线条样式(实线、虚线、点线等)。

  • 填充样式 决定了图形元素所定义的形状是否需要填充。填充颜色可以是颜色主题的主体边框颜色、主体背景颜色或自定义颜色。

  • 符号中所有单的共有 决定了对于具有一个单元以上的符号,图形元素是否为符号中的每个单元绘制,或者只为当前单元绘制。

  • 对所有主体风格通用(德摩根) 决定图形元素是否为具有替代主体风格的符号中的每个符号表示绘制,或者图形元素是否只为当前的主体风格绘制。

  • 专用于符号编辑器 决定了形状仅在符号编辑器中编辑符号时可见。当符号被添加到原理图中时,该形状将被隐藏。

Symbol Pins

可以点击 引脚图标 按钮来创建和插入一个引脚。可以通过双击引脚来编辑引脚的属性。也可以删除或移动你已经添加的引脚。必须小心地创建引脚,因为任何错误都会对 PCB 设计产生影响。

一个引脚是由它的图形表示、名称和编号定义的。引脚的名称和编号可以包含字母、数字和符号,但不能包含空格。 为了使电气规则检查(ERC)工具发挥作用,引脚的电气类型(输入、输出、三态…​)也必须被正确定义。如果这个类型定义不正确,原理图上的 ERC 检查结果可能是无效的。

要点:

  • 符号的引脚按编号与封装的焊盘相匹配。符号中的引脚编号必须与封装中相应的焊盘编号相对应。

  • 不要在引脚名称和数字中使用空格。空格将被自动替换成下划线(_)。

  • 要定义带有反转信号(上划线)的引脚名称,请使用 ~ (波浪号)字符后跟文本以在大括号中反转。 例如 ~{FO}O 会显示 FO O。

  • 如果引脚名称为空,则认为该引脚未被命名。

  • 引脚名称可以在一个符号中重复。

  • 引脚编号在一个符号中必须是唯一的。

引脚属性
引脚属性

引脚属性对话框允许你编辑引脚的所有属性。当你创建一个引脚或双击一个现有的引脚时,这个对话框会自动弹出。对话框允许你修改:

  • 引脚名称和文字大小。

  • 引脚编号和文字大小。

  • 引脚的长度。

  • 引脚的电气类型和图形风格。

  • 单元和备用主体。

  • 引脚可见性。

  • 备用引脚定义

引脚图形样式

不同的引脚图形风格如下图所示。这些样式是纯粹的图形,不影响引脚的电气类型。

引脚图形样式
引脚电气类型

Each pin in a symbol has an electrical type, such as input, output, or tri-state.

选择正确的电气类型对原理图 ERC 工具很重要。 ERC 将检查引脚的连接是否恰当,例如,确保输入引脚被驱动,电源输入从适当的来源接收电源。

You can use the Pin Conflicts Map in the schematic editor to configure which pin types are allowed to connect and which will conflict. The default Pin Conflicts settings are briefly explained below. For more information, see the ERC documentation.

Additionally, some pin types have special behavior outside of ERC. In the router, pads corresponding to a free pin can be connected to copper of any other net without causing a DRC error, and multiple pads corresponding to a single unconnected pin do not need to be connected to each other in the board.

Pin Type

Description

Input

A pin which is exclusively an input. The default Pin Conflicts settings allow input pins to connect to most other types of pin.

Output

A pin which is exclusively an output. The default Pin Conflicts settings allow output pins to connect to most types of pin that aren’t also outputs.

Bidirectional

A pin that can be either an input or an output, such as a microcontroller data bus pin. The default Pin Conflicts settings allow bidirectional pins to connect to most other types of pins, though there are a few more restrictions than with input pins.

Tri-state

A three state output pin (high, low, or high impedance). The default Pin Conflicts settings allow tri-state pins to connect to most other types of pins, but warnings are generated when they are connected to most types of output or power pins.

Passive

A pin that is not connected to active electronics, for example pins on a resistor or connector. The default Pin Conflicts settings allow passive pins to connect to most other types of pin.

Free

A pin that does not electrically affect the operation of the device. These pins typically represent package leads that are not internally connected to the chip. The default Pin Conflicts settings allow free pins to connect to most other types of pin.

In the PCB editor, pads corresponding to free pins can be connected to copper of any other net without causing a DRC error.

Unspecified

A pin which has an unspecified type. With the default Pin Conflicts settings, ERC generates warnings when unspecified pins are connected to most other types of pins.

Power input

A pin that powers the device. The default Pin Conflicts settings allow power input pins to connect to most other pin types. However, power input pins that are not connected to a power output pin generate an ERC violation.

Additionally, power input pins that are marked invisible are automatically connected to the net with the same name as the pin. This behavior is supported primarily for legacy projects and is not recommended for new designs. See the Hidden Power Pin section for more information.

Power output

A pin that provides power to other pins, such as a regulator output. The default Pin Conflicts settings allow power output pins to connect to most types of output pins, but not input pins.

Open collector

An open collector logic output. The default Pin Conflicts settings allow open collector pins to connect to most input pins and other open collector pins, but not to most other types of outputs.

Open emitter

An open emitter logic output. The default Pin Conflicts settings allow open collector pins to connect to most input pins and other open emitter pins, but not to most other types of outputs.

Unconnected

A pin that should not be connected to anything. ERC does not allow pins of type unconnected to connect to any other type of pin, and ERC will not generate an "unconnected pin" violation when pins of this type are left unconnected. Unconnected pins are not configurable in the ERC Pin Conflicts map.

If a footprint has multiple pads corresponding to a single unconnected pin, the pads do not need to be connected to each other in the board.

When multiple pins of type unconnected are stacked in a symbol, they are connected to separate nets, whereas stacked pins of other types are connected to the same net.

Note that this pin type is different than placing a no connect flag on a pin in the schematic. The unconnected pin type indicates that the pin should never be connected in any schematic, while a no connect flag indicates that the pin is intentionally unconnected in the current schematic.

将引脚属性推送到其他引脚

你可以通过右击一个引脚,并分别选择 推送引脚长度推送引脚名称大小推送引脚编号大小,将该引脚的长度、名称大小或数字大小应用于符号中的其他引脚。符号中的所有其他引脚将被更新。

为多个单元和备用主体样式定义引脚

Symbols with multiple units and/or graphical representations are particularly problematic when creating and editing pins. Most commonly, pins are specific to each symbol unit (because each unit has a different set of pins) and to each body style (because the form and position is different between the normal body style and the alternate form).

符号库编辑器允许同时创建引脚。默认情况下,对引脚所做的修改是针对一个多单元符号的所有单元,以及对具有替代符号主题样式的两种表示法。 唯一的例外是引脚的图形类型和名称,它们在符号单元和主体样式之间保持无关联。建立这种依赖关系是为了在大多数情况下更容易创建和编辑引脚。这个依赖关系可以通过切换主工具栏上的 同步引脚编辑模式图标 图标来禁用。这将允许你完全独立地为每个单元和代表创建引脚。

引脚可以是共用的,也可以是不同单元所特有的。引脚可以是两个符号主体样式共有的,也可以是每个符号主体特有的。当一个引脚对所有单元都通用时,它只需要绘制一次。引脚可以在引脚属性对话框中设置为通用或特定。

一个例子是 7400 四路双输入 NAND 门的输出引脚。由于有四个单元和两个符号表示,在符号定义中有八个独立的输出引脚。当创建一个新的 7400 符号时,常用主体样式的单元 A 将显示在库编辑器中。要编辑备用主体样式中的引脚,必须首先通过点击工具栏上的 备用表示法图标 按钮切换到备用样式。要编辑各个单元的引脚编号,请使用 单元选择下拉 下拉控件选择合适的单元。

引脚表

另一种编辑引脚的方法是使用引脚表,可以通过 引脚表图标 图标访问。引脚表以表格的形式显示符号中的所有引脚及其属性,所以它对批量修改引脚很有用。

任何引脚属性都可以通过点击相应的单元格进行编辑。可以用 加号图标垃圾桶图标 图标分别添加和删除引脚。

可以通过分组来同时编辑多个引脚的同一属性。 引脚可以按名称自动分组,也可以通过选择几个引脚并点击 选择的分组 来手动分组。点击 small refresh 16 按钮来清除手动分组。 你也可以过滤表格,只显示某些单元的引脚。

通过右键单击标题行并勾选或取消附加列,可以显示或隐藏引脚表的各列。有些列是默认隐藏的。

The screenshot below shows the pin table for a dual opamp.

引脚表
Alternate Pin Function Definitions

Pins can have alternate pin function definitions added to them. Alternate pin functions allow a user to select a different name, electrical type, and graphical style for a pin when the symbol has been placed in the schematic. This can be used for pins that have multiple functions, such as microcontroller pins.

Alternate pin functions are added in the Pin Properties dialog as shown below. Each alternate definition contains a pin name, electrical type, and graphic style. This microcontroller pin has all of its peripheral functions defined in the symbol as alternate pin names.

备用引脚定义

Alternate pin functions are selected in the Schematic Editor once the symbol has been placed in the schematic. The alternate pin is assigned in the Pin Functions tab of the Symbol Properties dialog. Alternate definitions are selectable in the dropdown in the Alternate Assignment column. You can also select an alternate pin by right-clicking the pin and selecting a new function from the Pin Function menu.

选择一个备用引脚定义

创建电源符号

Power symbols are symbols that are used to label a wire as part of a global power net, like VCC or GND. The power symbol’s Value field determines the net label. The behavior of power symbols is described in the electrical connections section. Power symbols are handled and created the same way as normal symbols, but there are several additional considerations described below.

将电源符号放在一个专门的库中可能是有用的。KiCad 的符号库将电源符号放在 power 库中,用户可以创建库来存储自己的电源符号。如果在符号的属性中勾选了 定义为电源符号 框,该符号就会出现在原理图编辑器的 添加电源符号 对话框中,以便于访问。

Power symbols consist of a single pin of type Power Input. They must also have the Define as power symbol property checked.

In previous versions of KiCad, a power symbol’s pin needed to be both a power input pin and invisible, and the pin’s name determined the name of the net that the power symbol connected with. Beginning in KiCad version 8, the pin in a power symbol does not need to be invisible, and the net is determined by the power symbol’s Value field.

下面是一个 GND 电源符号的例子。

编辑电源符号
电源符号引脚

要创建一个电源符号,请使用以下步骤:

  • Add a pin of type Power input. Make the pin number 1, the length 0, set the graphic style to Line, and make the pin visible. The pin number, name, length, and line style do not matter electrically.

  • Place the pin on the symbol anchor. This is not required but makes it easier to place the power symbol in the schematic.

  • 使用形状工具来绘制符号图形。

  • Set the symbol value to the desired net name. The symbol value is electrically important: it determines the symbol’s connected net name. This field can be changed later, after the symbol has been placed in the schematic, which will change which net the symbol connects to.

  • Check the Define as power symbol box in Symbol Properties window. This makes the symbol appear in the Add Power Symbol dialog, prevents the symbol from being assigned a footprint, and excludes the symbol from the board, BOM, and netlists.

  • Also deselect the Show pin number and Show pin name options in the Symbol Properties window. This is not necessary but improves the symbol’s appearance.

  • 设置符号的位号并取消勾选 显示 框。位号第一个字符应为 # ,后续文本并不重要。对于上面所示的电源符号,位号可以是 #GND。位号以 # 开头的符号不会被添加到 PCB 上,不包括在物料清单的输出或网表中,也不会在封装分配工具中分配一个封装。如果一个电源符号的位号不是以 \# 开头,当运行批注或封装分配工具时,该符号会被自动插入到符号表中。

检查符号

符号编辑器可以检查符号中的常见问题。使用顶部工具栏上的 符号检查器图标 按钮运行符号检查器。

符号检查器检测到一个不在网格上的引脚

符号检查器检查的是:

  • Pins that are off-grid (pins are considered off grid if their position is not a multiple of the current symbol editor grid. It is strongly recommended to use a 50 mil grid for symbol pins)

  • Pins that are duplicated

  • Issues with graphical shapes, such as zero-sized shapes

  • 非法的位号前缀:位号前缀不能用数字或 ?

  • 设计不正确的电源符号。电源符号应该有:

    • 一个单元

    • 没有备用的主体样式

    • A single pin which is either of type Power Output (see PWR_FLAG) or visible and of type Power Input (see power symbols)

  • 在非电源符号中,出现了隐藏的电源输入引脚:这将产生隐形的连接,不推荐使用

In previous versions of KiCad, power symbols required an invisible power input pin so that they would make a global connection. In KiCad 8, the power input pin does not need to be invisible. Therefore the symbol checker will report if invisible power input pins are detected.

浏览符号库

The Symbol Library Browser allows you to quickly examine the contents of symbol libraries. The Symbol Library Viewer can be accessed by clicking Library viewer icon icon on the main Symbol Editor toolbar or with ViewSymbol Library Browser.

To examine the contents of a library, select a library from the list in the left hand pane. All symbols in the selected library will appear in the second pane. Select a symbol name to view the symbol.

符号库浏览器

双击符号名称或使用 添加符号到原理图图标 按钮将符号添加到原理图中。

顶部的工具条包含以下命令:

Previous symbol icon

Select previous symbol in library.

Next symbol icon

Select next symbol in library.

refresh 24 zoom in 24 zoom out 24 zoom fit in page 24

Zoom tools.

morgan1 24 morgan2 24

Select standard or alternate De Morgan representation of symbol, if applicable.

symbol editor unit selector

Select the unit of a multi-unit symbol.

icons/datasheet_png

Open the symbol’s datasheet, if it is defined.

Add symbol to schematic icon

Insert current symbol into the schematic.

仿真器

KiCad provides an embedded electrical circuit simulator using ngspice as the simulation engine. ngspice is a SPICE simulator derived from the original widely used Berkeley SPICE program.

When working with the simulator, the Simulation_SPICE symbol library, installed with KiCad by default, may be useful. It contains common elements used for simulation such as voltage and current sources, DC and AC signal sources, a ground reference, ideal passive circuit elements such as resistors, inductors and capacitors, and numerous other generic semiconductor device models.

While these elements enable a great variety of simulation work, users familiar with SPICE in other environments will be used to incorporating models of commercially-available semiconductors, integrated circuits and other devices as more complex SPICE models. Indeed, semiconductor manufacturers often freely supply these to help users simulate and develop circuits using their parts. Note that while KiCad does not include any commercial SPICE models in its distribution, you are free to use any models you may have, or have used with other circuit simulators, in KiCad’s simulator.

In general, if a model works with other SPICE simulators, it should work with the KiCad simulator, although some SPICE simulators implement extensions that are unsupported by ngspice. ngspice offers several compatibility modes to improve compatibility with other simulators.

Finally, to quickly showcase the capabilities of the KiCad simulator, some demonstration projects are included in the KiCad distribution. They can be found in the demos/simulation directory.

值的表示

仿真器支持多种书面的数值表示法:

  • 简单表示法 : 10100, 0.003,

  • 科学表示法: 1.01e4, 3e-3,

  • 前缀表示法: 10.1k, 3m.

  • RKM 表示法: 4k7, 10R.

You can mix prefix and scientific notations. As such, 3e-4k is a valid input and is equivalent to 0.3. The list of valid prefixes is shown below. They are case sensitive.

Prefix Name Multiplier

a

atto

10-18

f

femto

10-15

p

pico

10-12

n

nano

10-9

u

micro

10-6

m

milli

10-3

k

kilo

103

M

mega

106

G

giga

109

T

tera

1012

P

peta

1015

E

exa

1015

原始 SPICE 元素 模型和 标识符 直接传递给 ngspice,无需 KiCad 重新格式化值以供 ngspice 使用。 Ngspice 使用不同的、不区分大小写的表示法:1 兆 (106) 表示为`1Meg`,而 1M 是 1 毫 (10-3)。 根据所选的兼容模式,ngspice 可能不支持与 KiCad 相同的值表示法,因此在使用原始 SPICE 元素和仿真标识符时应小心。

分配模型

您需要先将仿真模型分配给符号,然后才能仿真您的电路。

每个符号只能分配一个模型, 即使该符号包含多个单元也是如此。 对于具有多个单元的符号, 您应该将模型分配给第一个单元。

SPICE 模型信息以文本形式存储在符号字段中。 因此,您可以在符号编辑器或原理图编辑器中定义它。 要将仿真模型分配给符号,请打开符号属性对话框并单击 仿真模型…​ 按钮,这将打开仿真模型编辑器对话框。

您可以通过选中“符号属性”对话框中的从仿真中排除复选框从仿真中排除一个符号。

推断模型

电阻、电感和电容的模型是可以推断,这意味着 KiCad 将检测到它们是无源的并自动分配适当的仿真模型。 因此它们不需要任何特殊设置; 用户只需要设置符号的 字段即可。

KiCad 根据以下标准推断符号的仿真模型:

  • 该符号恰好有两个引脚,

  • 位号以 R, LC 开头。

Inferred models are ideal models. If the simulation requires a non-ideal model, for example an inductor with parasitic capacitance included, you must explicitly assign a model that includes it.

内置模型

KiCad offers several standard simulation models. They do not require an external model file, and their parameters can be edited in KiCad’s Simulation Model Editor GUI. The following devices are available:

  • Resistors (including potentiometers)

  • Capacitors

  • Inductors

  • 传输线

  • 开关

  • 电压源和电流源

  • 二极管

  • Transistors (BJTs, MOSFETs, MESFETs, and JFETs)

  • XSPICE code models

  • 原始SPICE元素

To add a built-in model to a symbol, open the Simulation Model Editor dialog (Symbol PropertiesSimulation Model…​) and select Built-in SPICE model. You can then select the kind of device from the device dropdown and the device subtype from the device type dropdown.

Refer to the ngspice documentation for more details about these models and their parameters.

设置内置模型的界面

元件 设置要仿真的元件类型:电阻、BJT、电压源等。此值存储在符号的 Sim.Device 字段中。

Device type selects the type of model to use for the device. Most devices have several types of models to choose from. Models may vary in their degree of accuracy, which characteristics they are optimized for, what parameters they have available, and how many pins they have. For example, the ideal resistor type models a simple resistor with two terminals and a single resistance parameter, while the potentiometer resistor type models an adjustable resistor with three terminals and an additional parameter for wiper position. Some devices have an especially large number of types to choose from: N-channel MOSFETs, for example, have 17 available types, each of which uses a different mathematical model to simulate the transistor behavior. One model may be more or less appropriate than another for simulating a specific device or circuit or for performing a particular analysis. Refer to the ngspice documentation for detailed information about models and their parameters. The device type value is stored in the symbol’s Sim.Type field.

参数 选项卡显示元件的参数并允许您编辑它们。 例如,电阻器的电阻、电压源的波形、MOSFET 的宽度和长度等。任何与模型默认值不同的参数都存储在符号的 Sim.Params 字段中。

编码 选项卡显示生成的 SPICE 模型,因为它将被写入 SPICE 网表以进行仿真。

在值字段中的保存参数 '<parameter name>' 复选框使用符号的 字段而不是 Sim.Params 字段来存储参数。 这可以更轻松地从原理图编辑简单模型,而无需打开仿真模型编辑器。 此选项仅适用于理想的无源模型(R、L、C)和直流电源。 如果符号中存在 Sim.Params 字段,它将优先于 字段。

库模型

KiCad can also load SPICE models from external files, and this is typically how you will add a SPICE model of a specific commercially-available part (say, a 555 timer, or a TL071 operational amplifier, for example) to your simulation. These models must be in a standard SPICE format and must not be encrypted. Models such as these are readily available from numerous sources - manufacturer’s web-sites being just one example.

要从外部文件加载模型,请打开仿真模型编辑器对话框(符号属性仿真模型…​)并从文件中选择 SPICE 模型

从文件设置库模型的接口

File is the path to the model file to use. Unencrypted model files are plain, human-readable text files and often have extensions such as .lib, .sub etc., although KiCad will accept a valid model with any extension.

The path to the file can be absolute, or relative to the project folder. The path can also be relative to the value of SPICE_LIB_DIR if you have defined that path variable. The library filename is saved in the symbol’s Sim.Library field.

Model is the name of the desired model in the model file. A model file may contain multiple models, and if so they will all be listed in the dropdown. The selected model is listed in the symbol’s Sim.Name field.

可以使用 parameters 选项卡覆盖参数(或指定其他参数)。 在所选模型或 参数 选项卡中指定的所有参数都存储在符号的 Sim.Params 字段中。

编码 选项卡显示生成的 SPICE 模型,因为它将被写入 SPICE 网表以进行仿真。

KiCad is not distributed with SPICE models for specific commercial devices. These models are usually available from device manufacturers or other internet sources.

库模型 (IBIS)

IBIS(I/O 缓冲区信息规范)文件是 SPICE 模型的替代品,用于对数字部件上的输入/输出缓冲区的行为进行建模。 为了加载 IBIS 文件,用户应遵循 SPICE 库模型的相关流程,并提供一个 .ibs 文件。

设置Ibis模型的接口

文件 是要使用的模型文件的路径。 路径可以是绝对路径,也可以是相对于项目文件夹的路径。 路径也可以是相对于 SPICE_LIB_DIR 的值,如果你已经 定义该路径变量。 库文件名保存在符号的`Sim.Library`字段中。 如果加载了 IBIS 模型文件,对话框中的其余字段将与 IBIS 模型相关。

元件 从 IBIS 文件中选择要使用的元件,因为 IBIS 文件可以包含多个元件。 元件名称保存在符号的 Sim.Name 字段。

Pin 选择 IBIS 模型中的哪个引脚进行仿真。 所选引脚必须映射到 引脚分配 选项卡中的符号引脚。 所选引脚的编号保存在符号的 Sim.Ibis.Pin 字段中。

模型 是所选引脚可用的模型列表,例如输入或输出。 所选模型名称保存在符号的 Sim.Ibis.Model 字段中。

类型 选择引脚在仿真中应该做什么。 引脚可以是不驱动任何值的无源元件; 它可以是驱动高阻抗、低阻抗或高阻抗的 DC 驱动器; 或者它可以是 矩形波PRBS 驱动器。 该值存储在符号的 Sim.Type 字段中。

参数 选项卡可让您查看和编辑模型的参数。 对于每个参数,您可以在 IBIS 文件中定义的最小值、典型值或最大值之间切换。 您还可以根据引脚选择的类型来选择驱动波形的参数。 任何不同于默认值的参数都存储在符号的 Sim.Params 字段中。

KiCad 不附带符号的 IBIS 模型。 IBIS 模型通常可从设备制造商处获得。
KiCad 的 Simulation_SPICE 符号库提供了几个可能对 IBIS 仿真有用的符号。 IBIS_DEVICE 可用于元件(输入)引脚,而 IBIS_DRIVER 可用于仿真驱动器引脚。 每个差分引脚也有类似符号。

引脚分配

Simulation models may have their pins numbered differently than the corresponding symbol. For example, SPICE models for diodes usually consider pin 1 to be the anode, while schematic symbols are usually drawn with pin 1 as the cathode. Operational amplifier models are also very likely to have model pin assignments that do not match package or schematic pin numbers.

您可以使用仿真模型编辑器的 引脚分配 选项卡将符号的引脚映射到仿真模型引脚。

Always make sure symbol pins are correctly mapped to simulation model pins. Mistakes here can lead to erroneous or confusing simulation results, or a failure to simulate at all.
用于封装分配的导入工具

The left column displays the name and number of each symbol pin, i.e. the pin numbers and names that appear on the schematic part in KiCad. The right column displays the corresponding pin as defined in the model file in use. For each symbol pin, you can select the corresponding pin from the simulation model in the dropdown in the right column. In the cases where a schematic part has pins that are not in the model, as in the case of an operational amplifier with 'nulling' pins that are not modeled, the schematic part pin may be assigned to the 'Not Connected' option in the Pin Assignments dropdown. Unlike other pin assignments, 'Not Connected' may be assigned to multiple pins if necessary.

When you use a subcircuit model, the dialog displays the model’s code under the pin assignments for use as a reference while assigning pins. A well-written model will often include a helpful reference section (as a set of comments) to inform the user how the model pins are mapped.

SPICE 标识符

可以在原理图图纸的文本字段中放置 SPICE 标识符。 这种方法便于定义默认模拟类型。 文本字段中支持的标识符列表是:

  • 以点开头的标识符(例如 .tran 10n 1m

  • 电感耦合系数(例如 K1 L1 L2 0.89)

无法使用文本字段放置其他元件。

如果原理图文本中包含仿真命令,则当您打开仿真器时,仿真器将使用它作为仿真命令。 但是,您可以在“仿真命令”对话框中覆盖它。

有关 SPICE 标识符的更多详细信息,请参阅 ngspice 文档

运行仿真

Circuits for simulation are drawn in the Schematic Editor, but simulations are run in the Simulator window.

用户界面

要运行仿真,请在原理图编辑器窗口中单击 检查仿真 或使用顶部工具栏中的 simulator icon 按钮打开 SPICE 仿真器对话框。

主仿真对话框

该对话框分为几个部分:

  • 窗口顶部有一个工具栏,其中包含常用操作的按钮。

  • The main part of the window graphically shows the simulation results. Signals need to be selected from the list of available signals or probed before they are displayed in the plot.

  • 在绘图面板下方,输出控制台显示来自 ngspice 仿真引擎的日志。

  • The right side of the window displays a list of signals, a list of active cursors, measurements, and a tuning tool for adjusting component values based on simulation results.

工作簿

Workbooks are files that store information about the simulation environment, including simulation setup parameters and the list of signals available for use. They can be used to store the setup for a set of analyses, which can then be reloaded and rerun at a later time. A workbook can include more than one simulation - for example, it may contain separate tabs for Transient (TRAN), Operating Point (OP), and Small Signal AC (AC) analyses which you added as you worked.

You can save a workbook using FileSave Workbook and load one using FileOpen Workbook.

Workbooks store simulation setup information, but they do not store simulation results. You can export simulation results to PNG (graphics) or CSV (simulation data values) with FileExport Current Plot as PNG…​ and FileExport Current Plot as CSV…​. To recreate the results of simulations stored in a workbook, select the appropriate analysis tab in the Simulator window and run the simulation again (R or SimulationRun Simulation).

运行仿真

Before running a simulation, you need to select a simulation type and set the simulation parameters. This can be done using SimulationSettings…​ or the Sim Command button (config 24) and then selecting one of the available analysis types:

  • OP — DC Operating Point

  • DC — DC Sweep Analysis

  • AC — AC Small-signal Analysis

  • TRAN — Transient Analysis

  • PZ — Pole-zero Analysis

  • NOISE — Noise Analysis

  • SP — S-parameter Analysis

  • FFT — (Fourier Transform) Frequency-content Analysis

These analysis types are explained in detail in the ngspice documentation.

Another way to configure a simulation is to type SPICE directives into text fields on schematics. Any text field directives related to a simulation command are overridden by the settings selected in the dialog. This means that once a simulation has run, the dialog overrides the schematic directives until the simulator is reopened.

Once the simulation command is set, a simulation can be started with SimulationStart Simulation (Ctrl+R) or the Run/Stop Simulation button (run simulation icon).

交流分析
交流分析窗口

Calculates the small-signal AC behavior of the circuit in response to a stimulus. Performs a decade sweep of stimulus frequency.

To run an AC analysis you must choose a number of points to measure per decade and the start and end frequencies for the decade sweep.

The output is displayed as a Bode plot (output magnitude and phase vs. frequency).

直流传输分析
直流分析窗口

Calculates the DC behavior of the circuit while sweeping one or two parameters: source values (voltage or current), resistor values, or the simulation temperature.

To run a DC analysis, you must choose what type of sweep(s) to perform, which source(s), resistor(s), or temperature value(s) to sweep, and what the sweep range(s) and step(s) should be.

输出显示为绘图。

工作点分析

Calculates the DC operating point of the circuit. This analysis has no options, and results are printed to the SPICE log and also displayed as labels giving the nodal voltages and currents at the operating point, added to the circuit schematic.

瞬态分析
瞬态分析窗口

计算电路的时变行为。

要运行瞬态分析,您需要指定建议的时间步长和最终仿真时间。 您可以选择指定一个开始时间来覆盖默认值 0。

输出显示为绘图。

自定义分析
自定义分析窗口

自定义分析让您可以编写 SPICE 命令来设置分析。 按从原理图中加载标识符按钮,将原理图文本中的任何 SPICE 标识符复制到自定义分析文本框中。

有关分析命令的更多信息,请参阅 ngspice 文档

额外的仿真设置

有几个仿真选项适用于所有类型的模拟。

为 .include 库标识符添加完整路径 控制是否将原理图文本中的 .include 标识符的相对路径转换为绝对路径。

保存所有电压保存所有电流 控制仿真器是否分别为元件的内部节点保存电压和电流。 未选中时,仿真器仅保存外部节点的电压和电流。

兼容模式下拉列表选择仿真器用于加载模型的兼容模式。 用户配置 选项是指用户的 .spiceinit ngspice 配置文件。 兼容模式在 ngspice 文档 中进行了描述。

探测信号

使用信号列表

您可以使用 仿真添加信号Ctrl+A 快捷键或 添加信号图标 按钮)显示可用信号列表。 双击列表中的元素会将其添加到探测信号列表中。 使用 Ctrl / Shift 键可以一次选择多个信号。

使用探测工具

仿真器窗口的工具栏中提供了一个探测工具 (sim probe 24),它提供了一种友好的方式来选择信号进行绘图。 激活后,用户可以单击原理图编辑器中的元素。 要探测电压,请使用探测工具单击导线。 当使用该工具将鼠标悬停在导线上时,相应的网络会突出显示。 要探测电流,请单击符号引脚。 将鼠标悬停在引脚上时,光标将从电压探头符号变为电流钳符号。 无法使用此工具探测电源信号。

使用SPICE标识符

虽然 ngspice 支持 .plot 标识符,但它不能在当前版本的 KiCad 中使用。

差分电压

探测差分电压通常需要仿真符号。 在官方库的 Simulation_SPICE:VOLTMETER_DIFF 中可用。 该符号有两个用于差分电压感测的端子,用户可以探测。

名为 kicad_builtin_vdiff 的 SPICE 模型已预先分配给内置 VOLTMETER_DIFF 符号。 用户不应定义同名的 SPICE 模型。

也可以通过放置 .probe vd(X) 标识符来探测电阻器等两端元件,其中 X 是设备的名称(例如 R1)。 为了探测它,在使用信号列表添加信号时输入 vd_X 。 请注意,该信号不会出现在信号列表中,它应该由用户输入。 这种方法的优点是不向原理图图纸添加额外的符号。

删除信号探针

In order to remove a signal probe, clear its checkbox in the Signal list at the top-right of the simulator window.

调整元件

It is possible to change the value of passive (R, L, C) simulation elements using sliders in order to graphically adjust them. Whenever the slider is set to a new position, the simulation is run with the new parameters and the current simulation plot is updated. In order to add a slider for a component, use SimulationAdd Tuned Value…​, the keyboard shortcut T or the tune icon button in the toolbar, and then click on the component to tune.

  • The top text field sets the maximum component value,

  • The middle text field sets the actual component value,

  • The bottom text field sets the minimum component value,

  • The slider allows the user to modify the component value,

  • The Save button modifies component value on the schematic to the value selected with the slider,

  • 单击 垃圾桶图标 按钮将元件从调整面板中删除并恢复其原始值。

In addition, it is possible to restrict the component values to those from a particular series of Preferred Values — either of the E24, E48, E96 or E192 series. This is particularly useful when it is necessary to restrict component values to commercially available parts.

可视化结果

Plots

Simulation results from the TRAN, AC, DC, NOISE, SP and FFT analyses are visualized as plots. As multiple analyses can be performed there can be multiple plots open in separate tabs, but only the active tab is updated when a simulation is executed. In this way it is possible to compare simulation results for different runs.

Simulation results from OP and PZ analyses do not generate plots. Instead, they present their results in the Simulator output command window and, in the case of OP, as labels added to the source schematic.
Plot colors

Colors of individual plots may be set by clicking the Color field associated with each signal. You may choose from a predefined palette (Defined Colors), or select a custom color (Color Picker).

Plot legends
Plot grids
Plot backgrounds

可以使用 视图 菜单切换网格和图例可见性来自定义绘图。 当图例可见时,可以拖动它来更改其位置。 您可以使用 视图白色背景 将绘图背景从暗切换到亮,并使用 视图虚线电流/相位 将电流和相位图切换为使用虚线而不是实线。

Cursors

For precise measurement, cursors are available in the plot window. They are enabled and selected from within the signal pane on the right, using the checkboxes 'Cursor 1' and 'Cursor 2'. Each cursor is identified by a number in a triangular marker at the top of the plot pane. Cursors are moved and positioned within the plot window by clicking and dragging them.

Measurements

Measurements are associated with signals on plots.

Measurements are made over all the data resulting from the simulation, not just the data that is visible in the plot window at the current zoom setting. This may be confusing in certain circumstances.
It is not necessary to have selected a signal for plotting (by selecting its Plot checkbox) in order to make a measurement on it. Even unselected, and therefore unplotted, signals can be measured.

Predefined measurements associated with a signal are available by a right-click over a signal row which invokes a pop-up menu offering the following measurements:

  • Measure Min

  • Measure Max

  • Measure RMS

  • Measure Peak-to-peak

  • Measure Time-of-min

  • Measure Time-of-max

  • Measure Integral

Measurement results are displayed in the Measurement pane at the lower right of the Simulator window. Multiple measurements will display as multiple rows in this area.

Measure Min measures the minimum value of the entire signal,

Measure Max measures the minimum value of the entire signal,

Measure RMS measures the root-mean-square value of the entire signal,

Measure Peak-to-peak measures the peak-to-peak value of the entire signal,

Measure Time-of-min measures the time at which the minimum value of the entire signal occurs,

Measure Time-of-max measures the time at which the maximum value of the entire signal occurs,

Measure Integral computes the time integral value of the entire signal.

绘图面板可以进行以下交互:

  • scroll mouse wheel to zoom in/out,

  • right click to open a context menu to adjust the view,

  • draw a selection rectangle to zoom in the selected area,

  • drag a cursor to change its coordinates.

数值

Some analysis types, such as the DC operating point analysis (OP), do not have any graphical output to plot. Instead, their output is printed in the SPICE console. In the case of the DC operating point analysis, labels are also added to the schematic indicating the operating point voltage and current values at the nodes.

导出结果

KiCad 的仿真器提供了两种导出结果的方式:

  • as a PNG (Portable Network Graphics format) image of a simulation data plot,

  • as a plain text file of simulation data values, in CSV (Comma-Separated Value) format.

Only simulations that produce plots (see above) can be exported as an image or a CSV file. The results of OP and PZ analyses cannot be exported in this way.

Exporting the simulator plot as a graphics file

The currently-visible Simulator plot may be exported as a PNG file using the command FileExport Current Plot as PNG…​.

The size and aspect-ratio of the saved image will match that of the displayed plot in the Simulator.

Exporting the simulator plot as numerical data

The currently-visible Simulator plot may be exported as a CSV file using the command FileExport Current Plot as CSV…​.

The data in the simulation plot is exported as multiple columns. The precise format is dependent upon the analysis type. In general, there will be multiple columns of data, one corresponding to each variable selected for plotting. The first row of the file is a header row, containing the name of the variable in the column (i.e. 'time', 'V(/Vout)1' or similar).

When exporting to CSV, only variables selected using their Plot checkbox will be included in the exported file.
The data in the exported file contains all the data that would be plotted if the entire plot were displayed. If the plot is zoomed in to show a particular region this will still be the case, resulting in the output file containing more data than the user might expect.
This function exports the data with data separated by semicolons (;) rather than commas. Programs reading this data may need to be configured to expect a semicolon as a delimiter.

查错

Sometimes a simulation will fail, either with or without errors being reported. Paying attention to the error messages reported, taking care in the development and entry into KiCad of the circuit to be simulated, and making use of the KiCad, ngspice and general SPICE documentation and information from fellow users in forums is very worthwhile and can often point the way to a solution.

It’s worth noting, for users unfamiliar with SPICE, ngspice or circuit simulation in general that some 'common' and interesting circuits can sometimes be tricky to simulate accurately or reliably. These include apparently simple circuits such as oscillators, which in some cases may fail to oscillate at all! It is nearly always possible to build a working simulation but sometimes this can more require SPICE experience than might be initially apparent, or the guidance of someone who already has it. The ngspice documentation, once again, is worth reading for insights into good and effective simulation practices if you are encountering difficulty.

网表不正确

It is possible to inspect the SPICE netlist with SimulationShow SPICE netlist…​. This method of troubleshooting requires some SPICE knowledge, but spotting errors in the netlist can help determine the cause of simulation problems, as well as providing confirmation of what input ngspice is actually acting on.

Simulation error messages

The output console displays messages from the simulator. It is advisable to check the console output to verify there are no errors or warnings. Messages appearing in the console may be conveniently selected, copied, and pasted if you wish to share them.

A common error message is "timestep too small". This message means that the simulation engine is unable to calculate the next point in the simulation, even when using the minimum possible time increment. This error can have many causes, including numerical convergence issues with a simulation model used in the circuit or with the circuit itself. It can also be caused by mistakes in drawing the circuit, such as incorrectly assigning pins to the simulation model or forgetting to provide a voltage supply.

收敛问题

In case the simulation does not converge in a reasonable amount of time (or not at all), it is possible to add the following SPICE directives. More information is available in the ngspice manual.

更改收敛选项可能会导致错误的结果。 应谨慎使用这些选项。
.options gmin=1e-10
.options abstol=1e-10
.options reltol=0.003
.options cshunt=1e-15
  • gmin is the minimum conductance allowed by the program. The default value is 1e-12 (1 pS).

  • abstol is the absolute current error tolerance of the program. The default value is 1e-12 (1 pA).

  • reltol 是程序的相对容错度。 默认值为 0.001(0.1%)。

  • cshunt adds a capacitor of the specified value from each voltage node in the circuit to ground.

Incorrect assignments of pins between the schematic and the SPICE model

If unexpected results are generated by a simulation despite it running without obvious errors, it is worth double-checking that the assignments between the pins of the part instance in the KiCad schematic and that of the associated model are correct. These have to be correct for each instance of the model in the schematic.

Helpful hints

Some helpful tips, hints and advice to help you get the most from using ngspice in KiCad for simulation.

The ngspice manual is your friend!

Fundamentally the KiCad Simulator is a user-friendly front-end to the powerful ngspice circuit simulator. Therefore problems with the details of simulation, the correct use of SPICE elements, models, etc. is beyond the scope of the KiCad documentation but is very likely to be fully and completely addressed in the ngspice documentation itself. It’s therefore recommended not to overlook this valuable resource.

KiCad updates may result in changes to the ngspice version used by the simulator. The current version of ngspice used in a particular version of KiCad is shown on the HelpAbout KiCad dialog, under the Version tab. Referring to the online ngspice documentation will ensure you always have access to the latest information for reference.

Organizing third-party models

Although it is certainly possible to keep simulation models (i.e. .lib, .sub files) in the directories associated with individual KiCad projects, this will likely result in unnecessary copies of model files proliferating as you create simulations. Consider creating a dedicated storage location (directory, folder) for models, perhaps organized by manufacturer or device type, to hold these files. Then they may simply be referenced in simulations at a common location.

高级主题

配置和定制

KiCad 文档的这一部分尚未编写。 感谢您的耐心等待,我们的志愿文档编写者正在努力更新和扩展文档。

文本变量

KiCad 支持文本变量,它允许您用定义的文本字符串替换变量名称。 这种替换发生在变量名称在 ${VARIABLENAME} 的变量替换语法中使用的任何地方。

You can define project text variables in the schematic or board setup dialogs. Project text variables are defined for the whole project, so a project text variable defined in the Schematic Editor can also be used in the Board Editor.

There are also a number of built-in system text variables. System text variables may be available in some contexts and not others. The following system text variables can be used in schematic text, label names, label fields, hierarchical sheet fields, symbol text, symbol fields, and drawing sheet fields. There are also a number of variables that can be used in the PCB Editor.

除非另有说明,否则层次化原理图字段中使用的变量指的是子原理图页的属性,而不是父图的属性。 例如,${#} 在层次化原理图字段中使用时返回子原理图的页码,在父原理图中的图形文本中使用时才返回父原理图的页码。

Variables can also be used for field names. A field with a variable as its name will automatically have its value set to the same variable. For example, in a project with a project variable MY_VAR set to MY_VALUE, a user-created symbol field named ${MY_VAR} will automatically have its value set to ${MY_VAR}, which will then resolve to MY_VALUE. If the field’s Show Name property is set, the variable’s name will be displayed as the field name, for example MY_VAR: MY_VALUE.

Variable name Description

#

Sheet number.

##

Total number of schematic sheets.

COMMENT1 - COMMENT9

Contents of drawing sheet’s Comment<n> field.

COMPANY

Contents of drawing sheet’s Company field.

CURRENT_DATE

Today’s date, in ISO format.

FILENAME

Filename of the root schematic sheet, with a file extension.

FILEPATH

Full file path of the root schematic sheet, with a file extension.

ISSUE_DATE

Contents of drawing sheet’s Issue Date field.

KICAD_VERSION

Current version of KiCad. This variable is only available in drawing sheet fields.

PAPER

Current sheet’s paper size. This variable is only available in drawing sheet fields.

PROJECTNAME

Project name, without a file extension.

REVISION

Contents of drawing sheet’s Revision field.

SHEETFILE

Filename of the current sheet, with a file extension.

SHEETNAME

Sheet name of the current sheet.

SHEETPATH

Sheet path of the current sheet.

TITLE

Contents of drawing sheet’s Title field.

<variablename>

Contents of project text variable <variablename>.

<fieldname>

Contents of symbol field, symbol attribute, hierarchical sheet field, or label field <fieldname>. Fields can only be accessed from within their parent object, so symbol fields can be accessed from other text or fields within the symbol, and hierarchical sheet fields can be accessed within the sheet or in other sheet fields of the sheet.

Both built-in and user-defined fields are available. Built-in fields use all uppercase letters: for example, to access a symbol’s value, use ${VALUE}.

Built-in symbol fields are DATASHEET, DESCRIPTION, FOOTPRINT, FOOTPRINT_LIBRARY, FOOTPRINT_NAME, NET_CLASS(<pin_number>), NET_NAME(<pin_number>), OP, PIN_NAME(<pin_number>), REFERENCE, SHORT_NET_NAME(<pin_number>), SYMBOL_DESCRIPTION, SYMBOL_KEYWORDS, SYMBOL_LIBRARY, SYMBOL_NAME, UNIT, VALUE.

Built-in symbol attributes are DNP, EXCLUDE_FROM_BOARD, EXCLUDE_FROM_BOM, and EXCLUDE_FROM_SIM. These attributes expand to the friendly name of the attribute if the attribute is set (e.g. Excluded from board for EXCLUDE_FROM_BOARD and DNP for DNP), or to an empty string if the attribute is not set.

Built-in sheet fields are SHEETFILE, SHEETNAME, and SHEETPATH. These refer to the child sheet’s filename, sheet name, and sheet path, respectively, rather than the parent sheet’s.

Built-in label fields are CONNECTION_TYPE, NET_CLASS, NET_NAME, OP, SHORT_NET_NAME, and INTERSHEETREFS (global labels only).

<refdes>:<fieldname>

Contents of field or attribute <fieldname> in symbol <refdes>.

Both built-in and user-defined fields are available. Built-in fields use all uppercase letters: for example, to access the value of U1, use ${U1:VALUE}.

Built-in symbol fields are DATASHEET, DESCRIPTION, FOOTPRINT, FOOTPRINT_LIBRARY, FOOTPRINT_NAME, NET_CLASS(<pin_number>), NET_NAME(<pin_number>), OP, PIN_NAME(<pin_number>), REFERENCE, SHORT_NET_NAME(<pin_number>), SYMBOL_DESCRIPTION, SYMBOL_KEYWORDS, SYMBOL_LIBRARY, SYMBOL_NAME, UNIT, VALUE.

Built-in symbol attributes are DNP, EXCLUDE_FROM_BOARD, EXCLUDE_FROM_BOM, and EXCLUDE_FROM_SIM. These attributes expand to the friendly name of the attribute if the attribute is set (e.g. Excluded from board for EXCLUDE_FROM_BOARD and DNP for DNP), or to an empty string if the attribute is not set.

数据库关联库文件

数据库关联库是 KiCad 符号库的一种类型,它在外部 SQL 数据库中保存有关零件的数据。 数据基础库本身不包含任何符号或封装的定义。 相反,它们 引用 其他 KiCad 库中的符号和封装。每个数据库关联库文件条目都将一个 KiCad 符号(来自其他库)映射到一组属性(字段),通常还有一个 KiCad 封装(来自封装库)。

使用数据库关联库可以抛开 KiCad 符号库和封装,而创建完全自定义的元件(也可称为 最小元件),而无需在符号库中存储所有元件属性。 外部数据库可以链接到第三方工具,用于管理元件数据和生命周期。 数据库关联库的工作流程通常比标准 KiCad 库的工作流程更复杂,因此这种类型的库通常只用于大规模的元件库,因为完全自定义的元件库可以使得效率提高(这在组织或团队协同中很常见)。

KiCad 不提供编辑 SQL 数据库或定义数据库关联库的图形界面。 用户可以自行寻找最合适的工作流程和工具链来创建并更新数据库。 有些用户可能希望通过第三方数据库客户端直接编辑数据库,有些用户可能使用其他第三方软件,如元件生命周期管理(PLM)工具来创建和编辑数据。

在数据库关联库中,有一个或多个 ,每个表通常代表单一类型的元件(如电阻或电容)。 每个表可以有一个独立的结构,这意味着不同类型的元件可以有不同的属性,这些属性在 KiCad 中被转化为符号字段。 每个表必须有一个唯一的 ID 列,作为从该表放置的符号的标识符。 这个唯一的 ID 通常是一个物料号(制造商零件编号,或内部组织的零件编号)。 每张表还必须有一列包含 KiCad 符号的映射,形式为 LibraryNickname:SymbolNameLibraryNickname 必须与 KiCad 库表中的符号库相匹配。 表也可以包含一个包含 KiCad 封装的列,形式为 LibraryNickname:FootprintName。 如果这一列存在,从表中放置的符号将包括一个封装映射。

表也可以包含任意的额外列,这些列可以选择性地映射到 KiCad 中的符号字段。 KiCad 数据库关联库的配置文件控制这些字段的命名方式,是否使字段可见,以及是否将字段包含在符号选择器中显示的数据。

数据库关联库配置文件

要创建一个数据库关联库,你必须创建一个配置文件,其中包含 KiCad 连接到你的数据库的必要信息并从表中获取数据。 将下面的模板复制到一个新文件中,并以 kicad_dbl 为扩展名保存。 然后你可以使用配置符号库对话框将此文件添加到你的全局符号库表中。

{
    "meta": {
        "version": 0
    },
    "name": "My Database Library",
    "description": "A database of components",
    "source": {
        "type": "odbc",
        "dsn": "",
        "username": "",
        "password": "",
        "timeout_seconds": 2,
        "connection_string": ""
    },
    "libraries": [
        {
            "name": "Resistors",
            "table": "Resistors",
            "key": "Part ID",
            "symbols": "Symbols",
            "footprints": "Footprints",
            "fields": [
                {
                    "column": "MPN",
                    "name": "MPN",
                    "visible_on_add": false,
                    "visible_in_chooser": true,
                    "show_name": true,
                    "inherit_properties": true
                },
                {
                    "column": "Value",
                    "name": "Value",
                    "visible_on_add": true,
                    "visible_in_chooser": true,
                    "show_name": false
                }
            ],
            "properties": {
                "description": "Description",
                "footprint_filters": "Footprint Filters",
                "keywords": "Keywords",
                "exclude_from_bom": "No BOM",
                "exclude_from_board": "Schematic Only"
            }
        }
    ]
}
Database library files are in JSON format. Standard JSON syntax rules apply. To check if your file contains syntax errors, you may use a JSON validator or linter (available online).
配置数据源

KiCad 目前只支持 ODBC 连接到 SQL 数据库。 你可以用 DSN 或连接字符串进行连接。 如果提供了 DSN 名称,可选的 usernamepassword 字段将被用来连接到 DSN。 如果提供了一个连接字符串,dsnusername, 和 password 字段将被忽略。 连接字符串将直接传递给 ODBC 驱动程序,这样就可以包含 ODBC 驱动程序支持的任何参数。

When using a DSN connection, leave the connection_string property blank or omit it from the file. When using a connection string, leave the dsn, username, and password fields blank or omit them from the file. Connection strings must start with a Driver key indicating to the ODBC manager which driver should be used, and may include other keys that depend on the specific driver. Check the documentation for your ODBC driver for details. You may also find a reference site like connectionstrings.com useful when configuring a database connection.

KiCad 不推荐或认可任何特定的 ODBC 驱动程序或数据库服务器,但经测试可与 Sqlite、MySQL、MariaDB 和 PostgreSQL 兼容。

Windows users: the backslash character (\) must be escaped with a second backslash when included in a JSON quoted string. If including a file path in your connection string, make sure to use double backslashes (\\).
Flatpak users: You need to install the corresponding ODBC drivers as Flatpak extensions. You can do this via the "Add-ons" section for KiCad in your software manager (i.e. GNOME Software), or via the command line: Run flatpak install org.kicad.KiCad.ODBCDriver.sqliteodbc for SQLite, flatpak install org.kicad.KiCad.ODBCDriver.mariadb-connector-odbc for MariaDB or MySQL, or flatpak install org.kicad.KiCad.ODBCDriver.psqlodbc for PostgreSQL.
Flatpak users: Due to Flatpak sandboxing, a possible way to connect to database servers running on your local machine is via TCP/IP. Make sure that your database server allows TCP/IP connections, then add the required Port parameter to your connection string. For example, add Port=3306; for the default TCP port of MySQL/MariaDB, or Server=localhost;Port=5432; to force PostgreSQL to use a TCP connection to the local server. Using the default UNIX domain socket connections for MySQL, MariaDB, or PostgreSQL is only possible when overriding host file system permissions via flatpak override.
配置库

每个数据库关联库可以包含映射到单个数据库表的 "子库"。 配置文件中的 libraries 条目包含一个对象列表,每个对象定义一个库。 每个库必须存在以下设置:

name: The name of the sub-library (table) that will be shown in the KiCad UI and included as a prefix in each symbol name placed from this sub-library. This name can include any valid characters for a symbol name except for a forward slash (/) because the slash character is used as a separator between the sub-library name and the symbol name. If this field is left blank, no prefix will be added to symbols in this sub-library.

table: 数据库中的表的名称。

key: 包含唯一键的列名,将用于识别表中的器件。

symbols: 包含 KiCad 符号引用的列名。

footprints: 包含 KiCad 封装引用的列名。

fields: 一个字段定义的列表。 在这里定义的每个字段都会在符号被放置在原理图上时被添加到符号中。 如果源符号中已经定义了一个名称相同的字段,那么数据库表中的值将覆盖源符号中定义的任何值。每个字段定义都可以包含:

column: 应该被映射到一个字段的数据库表列的名称。

name: 要从数据库中填充的 KiCad 字段的名称。

visible_on_add: 如果是 true,当符号被添加时,这个字段将在原理图中可见。如果没有指定这个设置,它将默认为 false

visible_in_chooser: 如果 true,这个字段将在符号选择器中显示为一个列。如果没有指定这个设置,它将默认为 false

show_name: 如果是 true,除显示其值之外,该字段的名称将在原理图中显示。 如果没有指定这个设置,将默认为 false

inherit_properties: 如果是 true,并且源符号中已经存在一个给定的 name 字段,那么只有字段内容将从数据库中更新,其他属性(visible_on_addshow_name 等)将保持源符号中的设置。 如果给定的字段名在源符号中不存在,这个设置将被忽略。 如果没有指定这个设置,它将默认为 false

properties: 符号属性与数据库列的映射。 所有的属性都是可选的;任何没有在数据库库配置中指定的属性都将从为源符号设置的值中继承下来。 支持以下属性:

description: 符号的描述属性。

footprint_filters: 预留给未来的扩展。

keywords: 符号的关键词属性。

exclude_from_bom: 符号的 "不包括在 BOM 中" 设置。 该列必须是数字类型,并将被视为布尔值(0 代表假,1 代表真)。

exclude_from_board: 符号的 "排除在 PCB 之外" 设置。该列必须是数字类型,并将被当作布尔值(0 代表假,1 代表真)。

exclude_from_sim: The symbol’s "Exclude from simulation" setting. The column named here must be a numeric type, and will be taken as a boolean (0 for false, 1 for true).

数据库列可以被映射到自定义(用户定义的)字段,或某些内置的 KiCad 字段,包括 ValueDatasheet

KiCad only supports text (string) fields. If you map a database column containing a numeric SQL data type, it will be converted to a string using a general-purpose conversion algorithm that will switch to scientific notation for very large or very small numbers. This format conversion cannot be fine-tuned by the user, so if explicit control over number-to-string conversion is needed, a new column or view should be used to do the conversion in the database.

使用数据库关联库

创建配置文件并将其添加到符号库表中后,您可以使用符号选择器从数据库表中放置元件。 从数据库关联库中放置的元件可以使用 "从库中更新符号" 功能进行更新,该功能将更新数据库中被改变的任何字段,以及更新源库中被改变的符号。

请注意,数据库表所引用的任何源库也必须存在于符号库表中,这样数据库关联库库才能正常工作。 如果你想把一个库只作为数据库关联库的符号源,你可以通过清除 "管理符号库" 对话框中的 "可见" 复选框将其从符号选择器中隐藏起来。

HTTP Libraries

HTTP libraries are a type of KiCad symbol library that sources data about parts for an external source such as an ERP system. They do not contain any symbol or footprint definitions as standard KiCad libraries do. Instead, they reference symbols and footprints found in other KiCad libraries.

HTTP libraries are read only and support REST or REST-like APIs.

HTTP Library Configuration Files

To create an HTTP library, you must create a configuration file that contains the necessary information for KiCad to connect to the providing library (API) and to retrieve data from it.

Copy the template below into a new file and save it using the .kicad_httplib file extension. You should then edit this file and replace root_url and token values with your own. Once saved, add this file to your global symbol library table using the Configure Symbol Libraries dialog which can be found under Preferences→Manage Symbol Libraries…​.

Users have the option to configure two timeout settings. The timeout_parts_seconds setting dictates the validity duration of a part’s information, while the timeout_categories_seconds setting determines how long categories remain valid. The default values are set to 60 seconds and 600 seconds respectively, but if the data for either setting is anticipated to remain unchanged, users can opt for higher values. This will significantly speed up the opening of the symbol chooser. It’s important to note that KiCad will re-cache the data on the initial startup regardless of these timeout settings.

{
    "meta": {
        "version": 1.0
    },
    "name": "KiCad HTTP Library",
    "description": "A KiCad library sourced from a REST API",
    "source": {
        "type": "REST_API",
        "api_version": "v1",
        "root_url": "http://localhost:8000/kicad-api",
        "token": "usertokendatastring",
        "timeout_parts_seconds": 60,
        "timeout_categories_seconds": 600
    }
}

Authentication

Authentication is done via an Access Token only. Users need to ask their administrators to get a valid token issued if the HTTP library is maintained externally.

Caching Behaviour for Categories

KiCad caches all available Categories once when opening the Symbol Chooser Dialog. Subsequently, any alterations made to the categories on the server side will remain undetected by KiCad until the user performs a program restart. This implementation is intentionally designed to conserve bandwidth resources, as it prevents KiCad from attempting to retrieve data from the API every time the user opens the Symbol Chooser Dialog. Such continuous data fetching, especially under constrained bandwidth conditions, would severely impede KiCad’s performance.

Server Response Codes

If KiCad receives an API error, it will display an error message to the user. For more information about API errors and server responses, see the APIs and Bindings section at dev-docs.kicad.org.

自定义网表和 BOM 格式

KiCad 可以导出各种格式的网表和 BOM,如果需要,用户可以定义新的格式。

导出网表的过程在 netlist export section中描述。BOM 导出在BOM导出章节中描述。

下文描述了如何为一个新的导出格式创建一个导出器。

添加新的网表生成器

新的网表生成器可以通过点击 添加生成器…​ 按钮添加到 导出网表 对话框中。

自定义网表生成器

新的生成器需要一个名称和一个命令。名称显示在标签中,只要点击 导出网表 按钮,就会运行该命令。

当网表生成时,KiCad 会创建一个中间的 XML 文件,其中包含原理图中所有的网表信息。然后运行生成器命令,以将中间网表转换为所需的网表格式。

网表命令必须正确设置,以便网表生成器脚本将中间网表文件作为输入并输出所需的网表文件。确切的网表命令将取决于所使用的生成器脚本。下面描述了命令格式

Python 和 XSLT 是创建自定义网表生成器的常用工具。

添加新的 BOM 生成器

KiCad 还使用中间网表文件,通过 BOM生成工具生成 BOM。

BOM 对话框

通过点击 加号图标 按钮,可以在 BOM 生成器脚本列表中添加其他脚本。点击 删除图标 按钮,可以删除脚本。编辑图标 按钮在文本编辑器中打开所选的脚本。

用 Python 和 XSLT 编写的生成器脚本可以包含一个标题注释,描述生成器的功能和用法。这个标题注释会作为每个生成器的描述显示在 BOM 对话框中。标题注释必须包含字符串 @package。该字符串之后直到注释结束的所有内容都被用作生成器的描述。

当添加新的生成器脚本时,KiCad 会自动填充命令行字段,但根据生成器脚本的情况,可能需要手工调整命令行。KiCad 试图从生成器脚本标题中的示例命令行自动确定输出文件扩展名。

生成器命令行格式

网表或 BOM 导出器的命令行定义了 KiCad 将运行的命令,用以生成所选输出文件。

对于使用 xsltproc 的网表导出器,以下为一个示例:

xsltproc -o %O.net /usr/share/kicad/plugins/netlist_form_pads-pcb.asc.xsl %I

对于使用 Python 的 BOM 导出器,以下为一个示例:

/usr/bin/python3 /usr/share/kicad/plugins/bom_csv_grouped_by_value.py "%I" "%O.csv"

建议在命令行中用引号 (") 将参数括起来,以防它们包含空格或其他特殊字符。

某些字符序列(如 %I%O)在命令行中具有特殊含义,因为 KiCad 在执行命令之前将它们替换为文件名或路径。

参数 替换为…​ 描述

%I

<工程路径>/<工程名称>.xml

中间网表文件的绝对路径和文件名,它是 BOM 或网表生成器插件的输入。

%O

<工程路径>/<工程名称>

输出 BOM 或网表文件的绝对路径和文件名(没有文件扩展名)。 适当的文件扩展名可能需要在 %O 序列后指定。

%B

<工程名称>

输出 BOM 或网表文件的基本文件名(没有路径或文件扩展名)。 适当的文件扩展名可能需要在 %B 序列后指定。

%P

<工程路径>

工程目录的绝对路径,没有尾部斜线

中间网表文件格式

当输出 BOM 文件和网表时,KiCad 会创建一个中间网表文件,然后运行一个单独的工具,将中间网表后期处理成所需的网表或 BOM 格式。

中间网表使用 XML 语法。它包含有关设计的大量数据。根据输出(BOM 或网表),完整中间网表文件的不同子集将包含在最终输出文件中。

中间网表文件的结构详述 如下

由于从中间网表文件到输出网表或 BOM 的转换是文本到文本的转换,因此可以使用 Python、XSLT 或任何其他能够将 XML 作为输入的工具编写后处理过滤器。

不建议新的网表或 BOM 导出器使用 XSLT;应该改用 Python 或其他工具。从 KiCad 7 开始,xsltproc 不再随 KiCad 一起安装,尽管它可以单独安装。 不过,下面列出了使用 XSLT 的网表导出器的几个示例。

中间网表结构

此示例提供了网表文件格式的概览。

<?xml version="1.0" encoding="utf-8"?>
<export version="D">
  <design>
    <source>F:\kicad_aux\netlist_test\netlist_test.sch</source>
    <date>29/08/2010 21:07:51</date>
    <tool>eeschema (2010-08-28 BZR 2458)-unstable</tool>
  </design>
  <components>
    <comp ref="P1">
      <value>CONN_4</value>
      <libsource lib="conn" part="CONN_4"/>
      <sheetpath names="/" tstamps="/"/>
      <tstamps>4C6E2141</tstamps>
    </comp>
    <comp ref="U2">
      <value>74LS74</value>
      <libsource lib="74xx" part="74LS74"/>
      <sheetpath names="/" tstamps="/"/>
      <tstamps>4C6E20BA</tstamps>
    </comp>
    <comp ref="U1">
      <value>74LS04</value>
      <libsource lib="74xx" part="74LS04"/>
      <sheetpath names="/" tstamps="/"/>
      <tstamps>4C6E20A6</tstamps>
    </comp>
    <comp ref="C1">
      <value>CP</value>
      <libsource lib="device" part="CP"/>
      <sheetpath names="/" tstamps="/"/>
      <tstamps>4C6E2094</tstamps>
    <comp ref="R1">
      <value>R</value>
      <libsource lib="device" part="R"/>
      <sheetpath names="/" tstamps="/"/>
      <tstamps>4C6E208A</tstamps>
    </comp>
  </components>
  <libparts/>
  <libraries/>
  <nets>
    <net code="1" name="GND">
      <node ref="U1" pin="7"/>
      <node ref="C1" pin="2"/>
      <node ref="U2" pin="7"/>
      <node ref="P1" pin="4"/>
    </net>
    <net code="2" name="VCC">
      <node ref="R1" pin="1"/>
      <node ref="U1" pin="14"/>
      <node ref="U2" pin="4"/>
      <node ref="U2" pin="1"/>
      <node ref="U2" pin="14"/>
      <node ref="P1" pin="1"/>
    </net>
    <net code="3" name="">
      <node ref="U2" pin="6"/>
    </net>
    <net code="4" name="">
      <node ref="U1" pin="2"/>
      <node ref="U2" pin="3"/>
    </net>
    <net code="5" name="/SIG_OUT">
      <node ref="P1" pin="2"/>
      <node ref="U2" pin="5"/>
      <node ref="U2" pin="2"/>
    </net>
    <net code="6" name="/CLOCK_IN">
      <node ref="R1" pin="2"/>
      <node ref="C1" pin="1"/>
      <node ref="U1" pin="1"/>
      <node ref="P1" pin="3"/>
    </net>
  </nets>
</export>
通用网表文件结构

中间网表由五个部分组成。

  • “标题” 部分。

  • “元件” 部分。

  • “库元件” 部分。

  • “库” 部分。

  • “网络” 部分。

文件内容带有分隔符 <export>

<export version="D">
...
</export>
“标题”部分

标题带有分隔符 <design>

<design>
<source>F:\kicad_aux\netlist_test\netlist_test.sch</source>
<date>21/08/2010 08:12:08</date>
<tool>eeschema (2010-08-09 BZR 2439)-unstable</tool>
</design>

此部分可视为评论。

“元件”部分

元件部分带有分隔符 <components>

<components>
<comp ref="P1">
<value>CONN_4</value>
<libsource lib="conn" part="CONN_4"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>4C6E2141</tstamps>
</comp>
</components>

本部分包含原理图中的元件列表。 每个元件都是这样描述的:

<comp ref="P1">
<value>CONN_4</value>
<libsource lib="conn" part="CONN_4"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>4C6E2141</tstamps>
</comp>
元素名称 元素描述

libsource

找到该元件的库的名称。

part

该库中的元件名称。

sheetpath

层次结构中的图纸路径:用于识别图纸。

tstamps

元件的时间戳。

关于元件时间戳的注意事项

为了识别网表中的元件以及电路板上的元件,时间戳引用作为每个元件的唯一标识。然而,KiCad 提供了一种辅助的方式来识别一个元件,即电路板上的对应封装。在原理图工程中重新标注元件,不会失去元件和其封装之间的联系。

时间戳是原理图工程中每个元件或图纸的唯一标识符。但是, 在复杂的层次结构中, 同一个图纸会被多次使用, 因此该图纸包含具有相同时间戳的元件。

在一个复杂的层次结构中,一个给定的图纸有一个唯一的标识符:它的图纸路径。一个给定的元件(在一个复杂的层次结构内)有一个唯一的标识符:图纸路径和它的时间戳。

“库文件”部分

库文件部分带有分隔符 <libparts> 该部分的内容在原理图库中定义。

<libparts>
<libpart lib="device" part="CP">
  <description>Condensateur polarise</description>
  <footprints>
    <fp>CP*</fp>
    <fp>SM*</fp>
  </footprints>
  <fields>
    <field name="Reference">C</field>
    <field name="Valeur">CP</field>
  </fields>
  <pins>
    <pin num="1" name="1" type="passive"/>
    <pin num="2" name="2" type="passive"/>
  </pins>
</libpart>
</libparts>
元素名称 元素描述

<footprints>

符号的封装。每个封装都在一个单独的 <fp> 标签中。

<fields>

符号的字段。每个字段的名称和值都在一个单独的 <field name="字段名称">…​<field> 标签中给出

<pins>

符号的引脚。每个引脚都在一个单独的 <pin num="引脚编号" type="pintype"/> 标签中给出。可能的引脚类型描述如下。

可能的电气引脚类型有:

引脚类型 描述

Input

通用输入引脚

Output

通用输出引脚

Bidirectional

输入或输出(双向)

Tri-state

总线输入/输出(三态)

Passive

无源元件的通用端头

Unspecified

未知的电气类型

Power input

元件电源输入引脚

Power output

电源输出,如稳压器输出

Open collector

模拟比较器中常见的集电极开路

Open emitter

有时出现在逻辑器件中的发射极开路

Not connected

必须在原理图中保持未连接状态

库部分

库部分带有分隔符 <libraries>。该部分包含工程中使用的原理图库的列表。

<libraries>
  <library logical="device">
    <uri>F:\kicad\share\library\device.lib</uri>
  </library>
  <library logical="conn">
    <uri>F:\kicad\share\library\conn.lib</uri>
  </library>
</libraries>
“网络” 部分

网络部分的分隔符为 <nets>。这一部分通过列出所有的网络和连接到每个网络的引脚来描述原理图的连接性。

<nets>
  <net code="1" name="GND">
    <node ref="U1" pin="7"/>
    <node ref="C1" pin="2"/>
    <node ref="U2" pin="7"/>
    <node ref="P1" pin="4"/>
  </net>
  <net code="2" name="VCC">
    <node ref="R1" pin="1"/>
    <node ref="U1" pin="14"/>
    <node ref="U2" pin="4"/>
    <node ref="U2" pin="1"/>
    <node ref="U2" pin="14"/>
    <node ref="P1" pin="1"/>
  </net>
</nets>

一个网络可能包含以下内容。

<net code="1" name="GND">
  <node ref="U1" pin="7"/>
  <node ref="C1" pin="2"/>
  <node ref="U2" pin="7"/>
  <node ref="P1" pin="4"/>
</net>
元素名称 元素描述

net code

该网络的内部标识符

name

网络的名称

node

符号(由 ref 标识)的引脚(由 pin 标识),该引脚与网络连接。

网表导出器实例

下面包括一些使用 XSLT 的网表导出器的例子。

XSLT 本身是一种 XML 语言,非常适用于 XML 转换。 xsltproc 程序 可以用来读取中间的 XML 网表输入文件,应用样式表来转换输入,并将结果保存在输出文件中。使用 xsltproc 需要一个使用 XSLT 惯例的样式表文件。整个转换过程由 KiCad 处理,在它被配置为以特定方式运行 xsltproc 之后。

描述 XSL 变换(XSLT)的文件可在此获得: http://www.w3.org/TR/xslt

当编写一个新的网表导出器时,考虑使用 Python 或其他工具而不是 XSLT。
使用 XSLT 的 PADS 网表实例

下面的例子显示了如何使用 xlstproc 为 PADS 网表格式创建一个输出器。

PADS 网表格式由两部分组成:

  • 封装列表

  • 一个网络的列表,以及与每个网络相连的焊盘。

下面是一个 XSL 样式表,将中间网表文件转换为 PADS 网表格式。

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--XSL style sheet to Eeschema Generic Netlist Format to PADS netlist format
    Copyright (C) 2010, SoftPLC Corporation.
    GPL v2.

    How to use:
        https://lists.launchpad.net/kicad-developers/msg05157.html
-->

<!DOCTYPE xsl:stylesheet [
  <!ENTITY nl  "&#xd;&#xa;"> <!--new line CR, LF -->
]>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>

<xsl:template match="/export">
    <xsl:text>*PADS-PCB*&nl;*PART*&nl;</xsl:text>
    <xsl:apply-templates select="components/comp"/>
    <xsl:text>&nl;*NET*&nl;</xsl:text>
    <xsl:apply-templates select="nets/net"/>
    <xsl:text>*END*&nl;</xsl:text>
</xsl:template>

<!-- for each component -->
<xsl:template match="comp">
    <xsl:text> </xsl:text>
    <xsl:value-of select="@ref"/>
    <xsl:text> </xsl:text>
    <xsl:choose>
        <xsl:when test = "footprint != '' ">
            <xsl:apply-templates select="footprint"/>
        </xsl:when>
        <xsl:otherwise>
            <xsl:text>unknown</xsl:text>
        </xsl:otherwise>
    </xsl:choose>
    <xsl:text>&nl;</xsl:text>
</xsl:template>

<!-- for each net -->
<xsl:template match="net">
    <!-- nets are output only if there is more than one pin in net -->
    <xsl:if test="count(node)>1">
        <xsl:text>*SIGNAL* </xsl:text>
        <xsl:choose>
            <xsl:when test = "@name != '' ">
                <xsl:value-of select="@name"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:text>N-</xsl:text>
                <xsl:value-of select="@code"/>
            </xsl:otherwise>
        </xsl:choose>
        <xsl:text>&nl;</xsl:text>
        <xsl:apply-templates select="node"/>
    </xsl:if>
</xsl:template>

<!-- for each node -->
<xsl:template match="node">
    <xsl:text> </xsl:text>
    <xsl:value-of select="@ref"/>
    <xsl:text>.</xsl:text>
    <xsl:value-of select="@pin"/>
    <xsl:text>&nl;</xsl:text>
</xsl:template>

</xsl:stylesheet>

这是运行 xsltproc 后的 PADS 网表输出文件:

*PADS-PCB*
*PART*
P1 unknown
U2 unknown
U1 unknown
C1 unknown
R1 unknown
*NET*
*SIGNAL* GND
U1.7
C1.2
U2.7
P1.4
*SIGNAL* VCC
R1.1
U1.14
U2.4
U2.1
U2.14
P1.1
*SIGNAL* N-4
U1.2
U2.3
*SIGNAL* /SIG_OUT
P1.2
U2.5
U2.2
*SIGNAL* /CLOCK_IN
R1.2
C1.1
U1.1
P1.3

*END*

进行这种转换的命令行是:

kicad\\bin\\xsltproc.exe -o test.net kicad\\bin\\plugins\\netlist_form_pads-pcb.xsl test.tmp

使用 XSLT 的 Cadstar 网表例子

下面的例子显示了如何使用 xlstproc 为 Cadstar 网表格式创建一个输出器。

Cadstar 的格式由两部分组成:

  • 封装列表

  • 网络列表:按网络对焊盘进行分组

下面是一个 XSL 样式表,将中间网表文件转换为 Cadstar 网表格式。

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--XSL style sheet to Eeschema Generic Netlist Format to CADSTAR netlist format
    Copyright (C) 2010, Jean-Pierre Charras.
    Copyright (C) 2010, SoftPLC Corporation.
    GPL v2. -->

<!DOCTYPE xsl:stylesheet [
  <!ENTITY nl  "&#xd;&#xa;"> <!--new line CR, LF -->
]>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>

<!-- Netlist header -->
<xsl:template match="/export">
    <xsl:text>.HEA&nl;</xsl:text>
    <xsl:apply-templates select="design/date"/>  <!-- Generate line .TIM <time> -->
    <xsl:apply-templates select="design/tool"/>  <!-- Generate line .APP <eeschema version> -->
    <xsl:apply-templates select="components/comp"/>  <!-- Generate list of components -->
    <xsl:text>&nl;&nl;</xsl:text>
    <xsl:apply-templates select="nets/net"/>          <!-- Generate list of nets and connections -->
    <xsl:text>&nl;.END&nl;</xsl:text>
</xsl:template>

 <!-- Generate line .TIM 20/08/2010 10:45:33 -->
<xsl:template match="tool">
    <xsl:text>.APP "</xsl:text>
    <xsl:apply-templates/>
    <xsl:text>"&nl;</xsl:text>
</xsl:template>

 <!-- Generate line .APP "eeschema (2010-08-17 BZR 2450)-unstable" -->
<xsl:template match="date">
    <xsl:text>.TIM </xsl:text>
    <xsl:apply-templates/>
    <xsl:text>&nl;</xsl:text>
</xsl:template>

<!-- for each component -->
<xsl:template match="comp">
    <xsl:text>.ADD_COM </xsl:text>
    <xsl:value-of select="@ref"/>
    <xsl:text> </xsl:text>
    <xsl:choose>
        <xsl:when test = "value != '' ">
            <xsl:text>"</xsl:text> <xsl:apply-templates select="value"/> <xsl:text>"</xsl:text>
        </xsl:when>
        <xsl:otherwise>
            <xsl:text>""</xsl:text>
        </xsl:otherwise>
    </xsl:choose>
    <xsl:text>&nl;</xsl:text>
</xsl:template>

<!-- for each net -->
<xsl:template match="net">
    <!-- nets are output only if there is more than one pin in net -->
    <xsl:if test="count(node)>1">
    <xsl:variable name="netname">
        <xsl:text>"</xsl:text>
        <xsl:choose>
            <xsl:when test = "@name != '' ">
                <xsl:value-of select="@name"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:text>N-</xsl:text>
                <xsl:value-of select="@code"/>
        </xsl:otherwise>
        </xsl:choose>
        <xsl:text>"&nl;</xsl:text>
        </xsl:variable>
        <xsl:apply-templates select="node" mode="first"/>
        <xsl:value-of select="$netname"/>
        <xsl:apply-templates select="node" mode="others"/>
    </xsl:if>
</xsl:template>

<!-- for each node -->
<xsl:template match="node" mode="first">
    <xsl:if test="position()=1">
       <xsl:text>.ADD_TER </xsl:text>
    <xsl:value-of select="@ref"/>
    <xsl:text>.</xsl:text>
    <xsl:value-of select="@pin"/>
    <xsl:text> </xsl:text>
    </xsl:if>
</xsl:template>

<xsl:template match="node" mode="others">
    <xsl:choose>
        <xsl:when test='position()=1'>
        </xsl:when>
        <xsl:when test='position()=2'>
           <xsl:text>.TER     </xsl:text>
        </xsl:when>
        <xsl:otherwise>
           <xsl:text>         </xsl:text>
        </xsl:otherwise>
    </xsl:choose>
    <xsl:if test="position()>1">
        <xsl:value-of select="@ref"/>
        <xsl:text>.</xsl:text>
        <xsl:value-of select="@pin"/>
        <xsl:text>&nl;</xsl:text>
    </xsl:if>
</xsl:template>

</xsl:stylesheet>

这是 Cadstar 输出文件。

.HEA
.TIM 21/08/2010 08:12:08
.APP "eeschema (2010-08-09 BZR 2439)-unstable"
.ADD_COM P1 "CONN_4"
.ADD_COM U2 "74LS74"
.ADD_COM U1 "74LS04"
.ADD_COM C1 "CP"
.ADD_COM R1 "R"


.ADD_TER U1.7 "GND"
.TER     C1.2
         U2.7
         P1.4
.ADD_TER R1.1 "VCC"
.TER     U1.14
         U2.4
         U2.1
         U2.14
         P1.1
.ADD_TER U1.2 "N-4"
.TER     U2.3
.ADD_TER P1.2 "/SIG_OUT"
.TER     U2.5
         U2.2
.ADD_TER R1.2 "/CLOCK_IN"
.TER     C1.1
         U1.1
         P1.3

.END
使用 XSLT 的 OrcadPCB2 网表示例

这种格式只有一个部分,就是封装列表。每个封装都包括其焊盘的列表,并引用一个网络。

下面是一个 XSL 样式表,将中间网表文件转换为 Orcad 网表格式。

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--XSL style sheet to Eeschema Generic Netlist Format to CADSTAR netlist format
    Copyright (C) 2010, SoftPLC Corporation.
    GPL v2.

    How to use:
        https://lists.launchpad.net/kicad-developers/msg05157.html
-->

<!DOCTYPE xsl:stylesheet [
  <!ENTITY nl  "&#xd;&#xa;"> <!--new line CR, LF -->
]>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>

<!--
    Netlist header
    Creates the entire netlist
    (can be seen as equivalent to main function in C
-->
<xsl:template match="/export">
    <xsl:text>( { Eeschema Netlist Version 1.1  </xsl:text>
    <!-- Generate line .TIM <time> -->
<xsl:apply-templates select="design/date"/>
<!-- Generate line eeschema version ... -->
<xsl:apply-templates select="design/tool"/>
<xsl:text>}&nl;</xsl:text>

<!-- Generate the list of components -->
<xsl:apply-templates select="components/comp"/>  <!-- Generate list of components -->

<!-- end of file -->
<xsl:text>)&nl;*&nl;</xsl:text>
</xsl:template>

<!--
    Generate id in header like "eeschema (2010-08-17 BZR 2450)-unstable"
-->
<xsl:template match="tool">
    <xsl:apply-templates/>
</xsl:template>

<!--
    Generate date in header like "20/08/2010 10:45:33"
-->
<xsl:template match="date">
    <xsl:apply-templates/>
    <xsl:text>&nl;</xsl:text>
</xsl:template>

<!--
    This template read each component
    (path = /export/components/comp)
    creates lines:
     ( 3EBF7DBD $noname U1 74LS125
      ... pin list ...
      )
    and calls "create_pin_list" template to build the pin list
-->
<xsl:template match="comp">
    <xsl:text> ( </xsl:text>
    <xsl:choose>
        <xsl:when test = "tstamp != '' ">
            <xsl:apply-templates select="tstamp"/>
        </xsl:when>
        <xsl:otherwise>
            <xsl:text>00000000</xsl:text>
        </xsl:otherwise>
    </xsl:choose>
    <xsl:text> </xsl:text>
    <xsl:choose>
        <xsl:when test = "footprint != '' ">
            <xsl:apply-templates select="footprint"/>
        </xsl:when>
        <xsl:otherwise>
            <xsl:text>$noname</xsl:text>
        </xsl:otherwise>
    </xsl:choose>
    <xsl:text> </xsl:text>
    <xsl:value-of select="@ref"/>
    <xsl:text> </xsl:text>
    <xsl:choose>
        <xsl:when test = "value != '' ">
            <xsl:apply-templates select="value"/>
        </xsl:when>
        <xsl:otherwise>
            <xsl:text>"~"</xsl:text>
        </xsl:otherwise>
    </xsl:choose>
    <xsl:text>&nl;</xsl:text>
    <xsl:call-template name="Search_pin_list" >
        <xsl:with-param name="cmplib_id" select="libsource/@part"/>
        <xsl:with-param name="cmp_ref" select="@ref"/>
    </xsl:call-template>
    <xsl:text> )&nl;</xsl:text>
</xsl:template>

<!--
    This template search for a given lib component description in list
    lib component descriptions are in /export/libparts,
    and each description start at ./libpart
    We search here for the list of pins of the given component
    This template has 2 parameters:
        "cmplib_id" (reference in libparts)
        "cmp_ref"   (schematic reference of the given component)
-->
<xsl:template name="Search_pin_list" >
    <xsl:param name="cmplib_id" select="0" />
    <xsl:param name="cmp_ref" select="0" />
        <xsl:for-each select="/export/libparts/libpart">
            <xsl:if test = "@part = $cmplib_id ">
                <xsl:apply-templates name="build_pin_list" select="pins/pin">
                    <xsl:with-param name="cmp_ref" select="$cmp_ref"/>
                </xsl:apply-templates>
            </xsl:if>
        </xsl:for-each>
</xsl:template>


<!--
    This template writes the pin list of a component
    from the pin list of the library description
    The pin list from library description is something like
          <pins>
            <pin num="1" type="passive"/>
            <pin num="2" type="passive"/>
          </pins>
    Output pin list is ( <pin num> <net name> )
    something like
            ( 1 VCC )
            ( 2 GND )
-->
<xsl:template name="build_pin_list" match="pin">
    <xsl:param name="cmp_ref" select="0" />

    <!-- write pin numner and separator -->
    <xsl:text>  ( </xsl:text>
    <xsl:value-of select="@num"/>
    <xsl:text> </xsl:text>

    <!-- search net name in nets section and write it: -->
    <xsl:variable name="pinNum" select="@num" />
    <xsl:for-each select="/export/nets/net">
        <!-- net name is output only if there is more than one pin in net
             else use "?" as net name, so count items in this net
        -->
        <xsl:variable name="pinCnt" select="count(node)" />
        <xsl:apply-templates name="Search_pin_netname" select="node">
            <xsl:with-param name="cmp_ref" select="$cmp_ref"/>
            <xsl:with-param name="pin_cnt_in_net" select="$pinCnt"/>
            <xsl:with-param name="pin_num"> <xsl:value-of select="$pinNum"/>
            </xsl:with-param>
        </xsl:apply-templates>
    </xsl:for-each>

    <!-- close line -->
    <xsl:text> )&nl;</xsl:text>
</xsl:template>

<!--
    This template writes the pin netname of a given pin of a given component
    from the nets list
    The nets list description is something like
      <nets>
        <net code="1" name="GND">
          <node ref="J1" pin="20"/>
              <node ref="C2" pin="2"/>
        </net>
        <net code="2" name="">
          <node ref="U2" pin="11"/>
        </net>
    </nets>
    This template has 2 parameters:
        "cmp_ref"   (schematic reference of the given component)
        "pin_num"   (pin number)
-->

<xsl:template name="Search_pin_netname" match="node">
    <xsl:param name="cmp_ref" select="0" />
    <xsl:param name="pin_num" select="0" />
    <xsl:param name="pin_cnt_in_net" select="0" />

    <xsl:if test = "@ref = $cmp_ref ">
        <xsl:if test = "@pin = $pin_num">
        <!-- net name is output only if there is more than one pin in net
             else use "?" as net name
        -->
            <xsl:if test = "$pin_cnt_in_net>1">
                <xsl:choose>
                    <!-- if a net has a name, use it,
                        else build a name from its net code
                    -->
                    <xsl:when test = "../@name != '' ">
                        <xsl:value-of select="../@name"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:text>$N-0</xsl:text><xsl:value-of select="../@code"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:if>
            <xsl:if test = "$pin_cnt_in_net &lt;2">
                <xsl:text>?</xsl:text>
            </xsl:if>
        </xsl:if>
    </xsl:if>

</xsl:template>

</xsl:stylesheet>

这是 OrcadPCB2 输出文件。

( { Eeschema Netlist Version 1.1  29/08/2010 21:07:51
eeschema (2010-08-28 BZR 2458)-unstable}
 ( 4C6E2141 $noname P1 CONN_4
  (  1 VCC )
  (  2 /SIG_OUT )
  (  3 /CLOCK_IN )
  (  4 GND )
 )
 ( 4C6E20BA $noname U2 74LS74
  (  1 VCC )
  (  2 /SIG_OUT )
  (  3 N-04 )
  (  4 VCC )
  (  5 /SIG_OUT )
  (  6 ? )
  (  7 GND )
  (  14 VCC )
 )
 ( 4C6E20A6 $noname U1 74LS04
  (  1 /CLOCK_IN )
  (  2 N-04 )
  (  7 GND )
  (  14 VCC )
 )
 ( 4C6E2094 $noname C1 CP
  (  1 /CLOCK_IN )
  (  2 GND )
 )
 ( 4C6E208A $noname R1 R
  (  1 VCC )
  (  2 /CLOCK_IN )
 )
)
*

操作参考

以下是 KiCad 原理图编辑器中可用 操作 的列表:您可以为以下命令设置快捷键。

原理图编辑器

以下操作在原理图编辑器中可用。可以在偏好设置的 快捷键 部分中将快捷键分配给这些操作中的任何一个。

Action Default Hotkey Description

Align Elements to Grid

Annotate Schematic…​

Fill in schematic symbol reference designators

Annotate Automatically

Toggle automatic annotation of new symbols

Assign Footprints…​

Run footprint assignment tool

Clear Net Highlighting

~

Clear any existing net highlighting

Export Drawing to Clipboard

Export drawing of current sheet to clipboard

Edit Library Symbol…​

Ctrl+Shift+E

Open the library symbol in the Symbol Editor

Edit Sheet Page Number…​

Edit the page number of the current or selected sheet

Edit Symbol Fields…​

Bulk-edit fields of all symbols in schematic

Edit Symbol Library Links…​

Edit links between schematic and library symbols

Edit with Symbol Editor

Ctrl+E

Open the selected symbol in the Symbol Editor

Export Netlist…​

Export file containing netlist in one of several formats

Export Symbols to Library…​

Add symbols used in schematic to an existing symbol library (does not remove other symbols from this library)

Export Symbols to New Library…​

Create a new symbol library using the symbols used in the schematic (if the library already exists it will be replaced)

Generate Bill of Materials…​

Generate a bill of materials for the current schematic

Generate Bill of Materials (External)…​

Generate a bill of materials for the current schematic using external generator

Generate Legacy Bill of Materials…​

Generate a bill of materials for the current schematic (Legacy Generator)

Highlight Net

`

Highlight net under cursor

Highlight Nets

Highlight wires and pins of a net

Import Footprint Assignments…​

Import symbol footprint assignments from .cmp file created by board editor

Import Graphics…​

Ctrl+Shift+F

Import 2D drawing file

Line Mode for Wires and Buses

Constrain drawing and dragging to horizontal, vertical, or 45-degree angle motions

Line Mode for Wires and Buses

Draw and drag at any angle

Line Mode for Wires and Buses

Shift+Space

Switch to next line mode

Line Mode for Wires and Buses

Constrain drawing and dragging to horizontal or vertical motions

Remap Legacy Library Symbols…​

Remap library symbol references in legacy schematics to the symbol library table

Repair Schematic

Run various diagnostics and attempt to repair schematic

Rescue Symbols…​

Find old symbols in project and rename/rescue them

Save Current Sheet Copy As…​

Save a copy of the current sheet to another location or name

Schematic Setup…​

Edit schematic setup including annotation styles and electrical rules

Select on PCB

Select corresponding items in PCB editor

Set Do Not Populate

Set the do not populate attribute

Exclude from Bill of Materials

Set the exclude from bill of materials attribute

Exclude from Board

Set the exclude from board attribute

Exclude from Simulation

Set the exclude from simulation attribute

Show Directive Labels

Toggle display of directive labels

Show ERC Errors

Show markers for electrical rules checker errors

Show ERC Exclusions

Show markers for excluded electrical rules checker violations

Show ERC Warnings

Show markers for electrical rules checker warnings

Show Hidden Fields

Toggle display of hidden text fields

Show Hidden Pins

Toggle display of hidden pins

Show Net Navigator

Toggle the net navigator panel visibility

Show OP Currents

Show operating point current data from simulation

Show OP Voltages

Show operating point voltage data from simulation

Switch to PCB Editor

Open PCB in board editor

Scripting Console

Show the Python scripting console

Simulator

Show simulation window for running SPICE or IBIS simulations.

Toggle Do Not Populate

Ctrl+Alt+X

Toggle the do not populate attribute

Toggle Exclude from Bill of Materials

Toggle the exclude from bill of materials attribute

Toggle Exclude from Board

Toggle the exclude from board attribute

Toggle Exclude from Simulation

Toggle the exclude from simulation attribute

Unset Do Not Populate

Clear the do not populate attribute

Include in Bill of Materials

Clear the exclude from bill of materials attribute

Include on Board

Clear the exclude from board attribute

Include in Simulation

Clear the exclude from simulation attribute

Hierarchy Navigator

Ctrl+H

Show or hide the schematic sheet hierarchy navigator

Symbol Checker

Show the symbol checker window

Compare Symbol with Library

Show differences between schematic symbol and its library equivalent

Electrical Rules Checker

Perform electrical rules check

Show Datasheet

D

Opens the datasheet in a browser

Add Arc

Draw arcs

Add Circle

Draw circles

Add Rectangle

Draw rectangles

Add Sheet

S

Draw hierarchical sheets

Add Text Box

Draw text box items

Import Sheet Pin

Import hierarchical sheet pins

Add Wire to Bus Entry

Z

Add a wire entry to a bus

Add Net Class Directive

Add net class directive labels

Add Global Label

Ctrl+L

Add global labels

Add Hierarchical Label

H

Add hierarchical labels

Add Image

Add bitmap images

Add Junction

J

Draw junctions

Add Label

L

Draw net labels

Add No Connect Flag

Q

Draw no-connection flags

Add Power

P

Add power symbols

Add Text

T

Draw text items

Add Symbol

A

Add symbols

Add Bus

B

Add a bus

Add Lines

I

Draw graphic lines

Add Wire

W

Add a wire

Switch Segment Posture

/

Switches posture of the current segment.

Undo Last Segment

Back

Walks the current line back one segment.

Unfold from Bus

C

Break a wire out of a bus

Assign Netclass…​

Assign a netclass to nets matching a pattern

Autoplace Fields

O

Runs the automatic placement algorithm on the symbol or sheet’s fields

Break

Divide into connected segments

Change Symbol…​

Assign a different symbol from the library

Change Symbols…​

Assign different symbols from the library

Cleanup Sheet Pins

Delete unreferenced sheet pins

Edit Footprint…

F

Displays footprint field dialog

Edit Reference Designator…​

U

Displays reference designator dialog

Edit Text & Graphics Properties…​

Edit text and graphics properties globally across schematic

Edit Value…

V

Displays value field dialog

Mirror Horizontally

X

Flips selected item(s) from left to right

Mirror Vertically

Y

Flips selected item(s) from top to bottom

Pin Table…​

Displays pin table for bulk editing of pins

Properties…

E

Displays item properties dialog

Repeat Last Item

Ins

Duplicates the last drawn item

Rotate Counterclockwise

R

Rotates selected item(s) counter-clockwise

Rotate Clockwise

Rotates selected item(s) clockwise

De Morgan Alternate

Switch to alternate De Morgan representation

De Morgan Standard

Switch to standard De Morgan representation

Slice

Divide into unconnected segments

Swap

S

Swaps selected items' positions

Symbol Properties…​

Displays symbol properties dialog

Change to Directive Label

Change existing item to a directive label

Change to Global Label

Change existing item to a global label

Change to Hierarchical Label

Change existing item to a hierarchical label

Change to Label

Change existing item to a label

Change to Text

Change existing item to a text comment

Change to Text Box

Change existing item to a text box

De Morgan Conversion

Switch between De Morgan representations

Update Symbol…​

Update symbol to include any changes from the library

Update Symbols from Library…​

Update symbols to include any changes from the library

Drag

G

Drags the selected item(s)

Move

M

Moves the selected item(s)

Select Connection

Alt+4

Select a complete connection

Select Node

Alt+3

Select a connection item under the cursor

Navigate Back

Alt+Left

Move backward in sheet navigation history

Change Sheet

Change to provided sheet’s contents in the schematic editor

Enter Sheet

Display the selected sheet’s contents in the schematic editor

Navigate Forward

Alt+Right

Move forward in sheet navigation history

Leave Sheet

Alt+Back

Display the parent sheet in the schematic editor

Next Sheet

PgDn

Move to next sheet by number

Previous Sheet

PgUp

Move to previous sheet by number

Navigate Up

Alt+Up

Navigate up one sheet in the hierarchy

Push Pin Length

Copy pin length to other pins in symbol

Push Pin Name Size

Copy pin name size to other pins in symbol

Push Pin Number Size

Copy pin number size to other pins in symbol

Create Corner

Create a corner

Remove Corner

Remove corner

User-defined Signals…​

Add, edit or delete user-defined simulation signals

New Analysis Tab…​

Ctrl+N

Open Workbook…​

Ctrl+O

Probe Schematic…​

P

Add a simulator probe

Run Simulation

R

Save Workbook

Ctrl+S

Save Workbook As…​

Ctrl+Shift+S

Show SPICE Netlist

Edit Analysis Tab…​

Edit the SPICE command and plot setup for the current analysis tab

Stop Simulation

Add Tuned Value…​

T

Select a value to be tuned

Export Current Plot as CSV…​

Export Current Plot as PNG…​

Dark Mode Plots

Draw plots with a black background

Dotted Current/Phase

Draw secondary signal trace (current or phase) with a dotted line

Show Legend

Add Lines

Add connected graphic lines

Add Polygon

Draw polygons

Add Text Box

Add a text box item

Move Symbol Anchor

Specify a new location for the symbol anchor

Add Pin

P

Add a pin

Add Text

Add a text item

Add Symbol to Schematic

Add Symbol to Schematic

Copy

Cut

Delete Symbol

Remove the selected symbol from its library

Derive from Existing Symbol

Create a new symbol, derived from an existing symbol

Duplicate Symbol

Make a copy of the selected symbol

Edit Symbol

Show selected symbol on editor canvas

Export…

Export a symbol to a new library file

Export Symbol as SVG…

Create SVG file from the current symbol

Export View as PNG…

Create PNG file from the current view

Hide Symbol Tree

Import Symbol…​

Import a symbol to the current library

New Symbol…​

Ctrl+N

Create a new symbol

Paste Symbol

Rename Symbol…​

Rename the selected symbol

Save Library As…​

Ctrl+Shift+S

Save the current library to a new file.

Save Copy As…​

Save a copy of the current symbol to a different library.

Set Unit Display Name…​

Set the display name for a unit

Show Pin Electrical Types

Annotate pins with their electrical types

Show Pin Numbers

Annotate pins with their numbers

Show Symbol Tree

Synchronized Pins Mode

Synchronized Pins Mode When enabled propagates all changes (except pin numbers) to other units. Enabled by default for multiunit parts with interchangeable units.

Update Symbol Fields…​

Update symbol to match changes made in parent symbol

通用

以下操作可在 KiCad 中使用,包括在原理图编辑器中。 可以在偏好设置的 快捷键 页面将快捷键分配给这些操作中的任何一个。

Action Default Hotkey Description

Exclude Marker

Mark current violation in Checker window as an exclusion

Next Marker

Go to next marker in Checker window

Previous Marker

Go to previous marker in Checker window

Add Library…

Add an existing library folder

Click

Return

Performs left mouse button click

Double-click

End

Performs left mouse button double-click

Cursor Down

Down

Cursor Down Fast

Ctrl+Down

Cursor Left

Left

Cursor Left Fast

Ctrl+Left

Cursor Right

Right

Cursor Right Fast

Ctrl+Right

Cursor Up

Up

Cursor Up Fast

Ctrl+Up

Grid Origin…​

Set the grid origin point

Edit Grids…​

Edit grid definitions

Switch to Fast Grid 1

Alt+1

Switch to Fast Grid 2

Alt+2

Cycle Fast Grid

Alt+4

Switch to Next Grid

N

Switch to Previous Grid

Shift+N

Reset Grid Origin

Grid Origin

Place the grid origin point

Inactive Layer View Mode

Toggle inactive layers between normal and dimmed

Inactive Layer View Mode (3-state)

H

Cycle inactive layers between normal, dimmed, and hidden

Inches

Use inches

Snap to Objects on the Active Layer Only

Enables snapping to objects on the active layer only

Snap to Objects on All Layers

Enables snapping to objects on all visible layers

Toggle Snapping Between Active and All Layers

Shift+S

Toggles between snapping on all visible layers and only the active area

Millimeters

Use millimeters

Mils

Use mils

New…​

Ctrl+N

Create a new document in the editor

New Library…

Create a new library folder

Open…​

Ctrl+O

Open existing document

Page Settings…​

Settings for paper size and title block info

Pan Down

Shift+Down

Pan Left

Shift+Left

Pan Right

Shift+Right

Pan Up

Shift+Up

Pin Library

Keep the library at the top of the list

Plot…​

Plot

Print…​

Ctrl+P

Print

Quit

Close the current editor

Redo Last Zoom

Return zoom to level prior to last zoom undo

Reset Local Coordinates

Space

Revert

Throw away changes

Save

Ctrl+S

Save changes

Save All

Save all changes

Save As…

Ctrl+Shift+S

Save current document to another location

Save a Copy…​

Save a copy of the current document to another location

Select Columns…​

3D Viewer

Alt+3

Show 3D viewer window

Show Context Menu

Perform the right-mouse-button action

Footprint Library Browser

Browse footprint libraries

Footprint Editor

Create, delete and edit footprints

Switch to Project Manager

Show project window

Show Properties Manager

Show/hide the properties manager

Symbol Library Browser

Browse symbol libraries

Symbol Editor

Create, delete and edit symbols

Draw Bounding Boxes

Draw Bounding Boxes

Always Show Cursor

Ctrl+Shift+X

Display crosshairs even in selection tool

Full-Window Crosshairs

Switch display of full-window crosshairs

Show Grid

Display background grid in the edit window

Grid Overrides

Ctrl+Shift+G

Enables item-specific grids that override the current grid

Polar Coordinates

Switch between polar and cartesian coordinate systems

Switch units

Ctrl+U

Switch between imperial and metric units

Undo Last Zoom

Return zoom to level prior to last zoom action

Unpin Library

No longer keep the library at the top of the list

Update PCB from Schematic…

F8

Update PCB with changes made to schematic

Update Schematic from PCB…​

Update schematic with changes made to PCB

Center on Cursor

F4

Center on Cursor

Zoom to Objects

Ctrl+Home

Zoom to Objects

Zoom to Fit

Home

Zoom to Fit

Zoom In at Cursor

F1

Zoom In at Cursor

Zoom In

Zoom In

Zoom Out at Cursor

F2

Zoom Out at Cursor

Zoom Out

Zoom Out

Refresh

F5

Refresh

Zoom to Selection

Ctrl+F5

Zoom to Selection

Cancel

Cancel current tool

Copy

Ctrl+C

Copy selected item(s) to clipboard

Cut

Ctrl+X

Cut selected item(s) to clipboard

Cycle Arc Editing Mode

Ctrl+Space

Switch to a different method of editing arcs

Delete

Del

Deletes selected item(s)

Interactive Delete Tool

Delete clicked items

Duplicate

Ctrl+D

Duplicates the selected item(s)

Find

Ctrl+F

Find text

Find and Replace

Ctrl+Alt+F

Find and replace text

Find Next

F3

Find next match

Find Next Marker

Ctrl+Shift+F3

Find Previous

Shift+F3

Find previous match

Finish

End

Finish current tool

Paste

Ctrl+V

Paste item(s) from clipboard

Paste Special…​

Paste item(s) from clipboard with annotation options

Redo

Ctrl+Y

Redo last edit

Replace All

Replace all matches

Replace and Find Next

Replace current match and find next

Show Search Panel

Ctrl+G

Show/hide the search panel

Select All

Ctrl+A

Select all items on screen

Undo

Ctrl+Z

Undo last edit

Unselect All

Ctrl+Shift+A

Unselect all items on screen

Measure Tool

Ctrl+Shift+M

Interactively measure distance between points

Select item(s)

Select item(s)

About KiCad

Open about dialog

Configure Paths…

Edit path configuration environment variables

Donate

Open "Donate to KiCad" in a web browser

Get Involved

Open "Contribute to KiCad" in a web browser

Getting Started with KiCad

Open “Getting Started in KiCad” guide for beginners

Help

Open product documentation in a web browser

List Hotkeys…​

Ctrl+F1

Displays current hotkeys table and corresponding commands

Preferences…​

Ctrl+,

Show preferences for all open tools

Report Bug

Report a problem with KiCad

Manage Footprint Libraries…​

Edit the global and project footprint library lists

Manage Symbol Libraries…

Edit the global and project symbol library lists