差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
kicad使用指南 [2018/10/04 00:45]
gongyu [编辑短点4]
kicad使用指南 [2018/10/04 11:43] (当前版本)
gongyu
行 1: 行 1:
-====== 1. KiCad介绍 ====== 
-KiCad是一种免费、开源的EDA设计工具,它能够创建电路原理图并进行PCB布局布线,它具有一个集成化的开发环境,在其之下KiCad包含了如下非常精致、独立的软件工具。 
- 
-^程序名字 ​ ^描述  ​  ​^文件扩展名 ^ 
-|KiCad |项目管理 |*.pro | 
-|Eeschema |原理图和元器件编辑 |*.sch, *.lib, *.net | 
-|Pcbnew ​ |电路板和封装编辑 |*.kicad_pcb,​ *.kicad_mod | 
-|GerbView |Gerber和钻孔文件查看 |*.g\*, *.drl, etc.| 
-|Bitmap2Component |将bitmap图像转换成元器件或封装 |*.lib, *.kicad_mod,​ *.kicad_wks| 
-|PCB 计算器 |能够计算元器件、线宽、电气间距、颜色代码、及更多 | 
-|Pl Editor |Page布局编辑 |*.kicad_wks | 
- 
-注:此处的文件扩展名并不完整,只包含了KiCad支持的文件的子集,主要是用来初步理解每种KiCAD应用支持的文件类型。 
-{{ :​screen_shot_2018-10-02_at_7.36.33_am.png |}} <WRAP centeralign>​ **Wikipedia上关于KiCad的介绍** </​WRAP>​ 
- 
- 
-KiCad这个工具已经很成熟,完全可以用来开发或维护比较复杂的电子电路板。 
- 
-Eeschema:它的功能包括分层原理图,自定义元器件原理图符号库创建和ERC(电气规则检查)。 Eeschema中的原理图符号库与Pcbnew中的封装库非常松散地耦合,以方便重复使用封装和原理图符号(例如,单个0805封装可用于电容器、电阻器、电感器等)。 
- 
-{{ :​kicad_eeschema_multi-level_schematic.png |用KiCad设计的原理图}} <WRAP centeralign>​ **用KiCad设计的原理图** </​WRAP>​ 
- 
- 
-Pcbnew:内部Pcbnew支持多达32个铜层和32个技术层。尺寸以纳米精度存储在带符号的32位整数中,使理论最大PCB尺寸为2.14米。 
- 
-KiCad有一个自带的自动布线器,用于基本的单连接。也可以使用外部的自动布线工具,例如Alfons Wirtz开发的基于Java的开源FreeRouting,Anthony Blake于2008年开发用于gEDA PCB的Toporouter是一款拓扑自动布线器,最初是由Google资助的开源项目,由Delorie指导,现在也可用于KiCad。 
- 
-{{ :​kicad_pcbnew_diff_pairs.png |用KiCad设计的PCB板图}} <WRAP centeralign>​ **用KiCad设计的PCB板图** </​WRAP>​ 
- 
- 
-3D PCB查看功能基于VRML模型,可以导出板模型以进行CAD集成。 
-{{ :​kicad_3d_with_idf.png |KiCad的3D视图}} ​ <WRAP centeralign>​ **用KiCad的3DView查看板子的3D视图** </​WRAP>​ 
- 
-KiCad对板子的大小没有限制,很容易支持到32铜层的电路板,到最多14层技术层和最多4层附加层。它能够产生用于生产制造PCB板的所有必要文件:用于光绘的Gerber文件、钻孔文件、元器件定位文件等等。 
- 
-KiCad是一个跨平台的程序,用具有wxWidgets的C++编写,可在FreeBSD,Linux,Microsoft Windows和Mac OS X上运行。许多元器件库都可用,用户可以添加自定义元器件。 自定义元器件可以按项目提供,也可以安装在任何项目中使用。 还有一些工具可以帮助从其他EDA应用程序导入元器件,例如EAGLE。 配置文件有明确记录的纯文本,这有助于连接到版本控制系统以及自动元器件生成脚本。 
- 
-KiCad支持多种语言,包括中文。 
- 
-**KiCad的官方网址**:http://​www.kicad-pcb.org/​ 
- 
-**相关的资源**: 
-  * 一步一步跟我学习KiCad:https://​learn.sparkfun.com/​tutorials/​beginners-guide-to-kicad/​all,这是Sparkfun上的一篇针对KiCad初学者的文章 
-  * KiCad 5.0的官方库资源: 
-    * 原理图符号库:​ https://​kicad.github.io/​symbols 
-    * PCB封装库:​ https://​kicad.github.io/​footprints 
-    * 3D模型库:​ https://​kicad.github.io/​packages3d 
-  * 第三方库文件: 
-    * KiCAD - SamacSys(www.samacsys.com/​kicad/​) 
-    * KiCad PCB Libraries | Ultra Librarian (https://​www.ultralibrarian.com/​solutions/​cad-vendors/​kicad-pcb-libraries)该网站提供了上百万种元器件的技术资料搜索以及各种CAD工具的元器件原理图库、封装库以及3D模型库的搜索和下载 
- 
-**KiCad下载和安装** 
-KiCad 可以运行在GNU/​Linux,​ Apple macOS以及Windows环境下. 你可以通过访问http://​www.kicad-pcb.org/​download/​获取最新的介绍以及下载链接:​ 
- 
-GNU/​Linux环境下 
-KiCad的稳定版本可以在大多数发行版的软件包管理器中找到,如kicad和kicad-doc。 如果您的发行版未提供最新的稳定版本,请按照不稳定版本的说明进行操作,并选择、安装最新的稳定版本。 
- 
-在Ubuntu下,安装不稳定、连夜发布的KiCad版本的最简单方法是通过PPA和Aptitude,在你的Terminal中键入以下内容: 
-  - sudo add-apt-repository ppa:​js-reynaud/​ppa-kicad 
-  - sudo aptitude update && sudo aptitude safe-upgrade 
-  - sudo aptitude install kicad kicad-doc-en 
- 
-或者,您可以下载并安装KiCad的预编译版本,或直接下载源代码,编译和安装KiCad。 
- 
-苹果macOS环境下KiCad稳定版本的下载链接:http://​downloads.kicad-pcb.org/​osx/​stable/​ 
- 
-Windows环境下的稳定版本下载链接:​ http://​downloads.kicad-pcb.org/​windows/​stable/​ 
- 
- 
-====== 2. KiCad 工作流程 ====== 
-尽管与其他PCB设计软件具有相似性,但KiCad的特点是独特的工作流程,其中原理图元件和封装是分开的。 仅在创建原理图之后才会为元器件分配封装。 
-===== 2.1. 概述 ===== 
- 
-像其它的CAD工具软件一样,KiCad工作流程包括两个重要的任务:原理图绘制和电路板的布局布线,为实现这两个任务就需要原理图源器件符号库和PCB封装库的构建。 KiCad工具自身包含了很多元器件的原理图符号库和封装库,并且还具有创建新元器件符号库和封装库的工具。 
-  * KiCad: 项目管理 
-  * Eeschema: 原理图编辑器和元器件编辑器 
-  * Pcbnew: 电路板布局布线编辑以及封装库编辑器 
-  * GerbView: Gerber查看 
- 
-还包含了3种实用工具:​ 
-  * Bitmap2Component:​ 可以制作图标的元器件制作工具,它能够从一个Bitmap图像来创建原理图元器件或封装库。 
-  * PcbCalculator:​ 很有用的一个计算器,用来计算稳压器、线宽和电流的关系、传输线等。 
-  * Pl Editor: 页面布局编辑器。 
- 
-这些工具一般是通过项目管理页面启动运行,也可以作为单独的工具进行运行。 
- 
-下图就是一个KiCad工作流程图,它标明了您需要采取的步骤以及相应的顺序。 适用时,会添加图标以方便使用。 
-{{ :​kicad_flowchart.png |}} <WRAP centeralign>​ **KiCad流程图** </​WRAP>​ 
- 
- 
-有关创建组件的更多信息,请阅读“制作原理图组件”这部分内容。想了解如何创建新封装库,请参阅“制作元器件封装”。 
- 
-Quicklib是一个能够基于Web的界面快速创建KiCad元器件符号库的工具,你可以参阅“使用Quicklib制作原理图符号库”来获取相关的使用信息。 
-===== 2.2. 前向注释和后向注释 ===== 
-完成电子原理图设计后,下一步就是将其传输到PCB。通常,可能需要添加其它元器件、元器件的封装调整为不同的大小、网络重命名等。这可以通过两种方式来完成:前向注释或后向注释。 
- 
-正向注释是将原理图信息发送到相应PCB布局的过程。这是一个基本功能,因为您必须至少执行一次才能将原理图导入PCB。在此以后,正向注释允许向PCB发送增量的原理图更改。有关前向注释的详细信息,请参阅“前向注释”一节。 
- 
-后向注释是将PCB布局更改的信息发回到相应的原理图的过程。最常见的两种后向注释就是进行“门交换”和“引脚交换”。在这些情况下,有功能相同的“门”或“引脚”,但只有在布局期间才能够根据布线的便利来最终确定“门”或“引脚”的最佳安排。一旦在PCB中做出选择,则将此更改传递给原理图。 
- 
- 
-====== 3. 使用KiCad ====== 
- 
-===== 3.1. 快捷键 ===== 
-KiCad有两种相关但不同的快捷键:加速键和热键。 两者都用于通过使用键盘而不是鼠标来更改命令来加速KiCad的工作。 
- 
-==== 3.1.1. 加速键 ==== 
-加速键与单击菜单或工具栏图标具有相同的效果:将输入命令,但在单击鼠标左键之前不会发生任何操作。 如果要进入命令模式但不想立即采取任何操作,可以使用加速键。 
- 
-加速键显示在所有菜单窗格的右侧: 
-{{ :​gsik_accelerator_keys.png |}}<WRAP centeralign>​ **加速键** </​WRAP>​ 
-==== 3.1.2. 热键 ==== 
-热键等于加速键和鼠标左键的组合功能。 使用热键可以立即在当前光标位置启动命令。 使用热键快速更改命令,而不会中断工作流程。 
-要查看任何KiCad工具中的热键,请转到“帮助→列出热键”或按**Ctrl + F1**: 
-{{ :​gsik_hotkeys.png |}}<WRAP centeralign>​ **热键** </​WRAP>​ 
- 
- 
-您可以从“首选项→热键选项”菜单中编辑热键的分配,然后导入或导出它们。 
- 
-注意:在本文档中,热键用括号表示,如下所示:[a]。 如果看到[a],只需在键盘上键入“a”键即可。 
-==== 3.1.3. 举例 ==== 
-考虑在原理图中添加导线的简单示例。 
- 
-要使用加速键,请按“Shift + W”调用“添加线”命令(注意光标将改变)。 接下来,左键单击所需的连线的起始位置以开始绘制连线。 
- 
-使用热键,只需按[w],连线将立即从当前光标位置开始。 
- 
-====== 安装和配置工作环境 ====== 
-===== 显示配置 ===== 
- 
-Hardware accelerated renderer in Pcbnew and Gerbview requires video card with support of OpenGL v2.1 or higher. 
-===== Initialization of the default configuration ===== 
- 
-The default configuration file named kicad.pro is supplied in kicad/​template. It serves as a template for any new project and is used to set the list of library files loaded by Eeschema. A few other parameters for Pcbnew (default text size, default line thickness, etc.) are also stored here. 
-Another default configuration file named fp-lib-table may exist. It will be used only once to create a footprint library list; otherwise the list will be created from scratch. 
-===== 2.3. Modifying the default configuration ===== 
- 
-The default kicad.pro file can be freely modified, if desired. 
-Verify that you have write access to kicad/​template/​kicad.pro 
-Run KiCad and load kicad.pro project. 
-Run Eeschema via KiCad manager. Modify and update the Eeschema configuration,​ to set the list of libraries you want to use each time you create new projects. 
-Run Pcbnew via KiCad manager. Modify and update the Pcbnew configuration,​ especially the footprint library list. Pcbnew will create or update a library list file called footprint library table. There are 2 library list files (named fp-lib-table):​ The first (located in the user home directory) is global for all projects and the second (located in the project directory) is optional and specific to the project. 
-===== 2.4. Paths configuration ===== 
- 
-In KiCad, one can define paths using an environment variable. A few environment variables are internally defined by KiCad, and can be used to define paths for libraries, 3D shapes, etc. 
-This is useful when absolute paths are not known or are subject to change (e.g. when you transfer a project to a different computer), and also when one base path is shared by many similar items. Consider the following which may be installed in varying locations: 
-Eeschema component libraries 
-Pcbnew footprint libraries 
-3D shape files used in footprint definitions 
-For instance, the path to the connect.pretty footprint library, when using the KISYSMOD environment variable, would be defined as ${KISYSMOD}/​connect.pretty 
-This option allows you to define a path using an environment variable, and add your own environment variables to define personal paths, if needed. 
-KiCad environment variables: 
-KICAD_PTEMPLATES 
-Templates used during project creation. If you are using this variable, it must be defined. 
-KICAD_SYMBOL_DIR 
-Base path of symbol library files. 
-KIGITHUB 
-Frequently used in example footprint lib tables. If you are using this variable, it must be defined. 
-KISYS3DMOD 
-Base path of 3D shapes files, and must be defined because an absolute path is not usually used. 
-KISYSMOD 
-Base path of footprint library folders, and must be defined if an absolute path is not used in footprint library names. 
-images/​configure_path_dlg.png 
-Note also the environment variable KIPRJMOD is always internally defined by KiCad, and is the current project absolute path. 
-For instance, ${KIPRJMOD}/​connect.pretty is always the connect.pretty folder (the pretty footprint library) found inside the current project folder. 
-If you modify the configuration of paths, please quit and restart KiCad to avoid any issues in path handling. 
-===== 2.5. Initialization of external utilities ===== 
- 
-You may define your favorite text editor and PDF viewer. These settings are used whenever you want to open a text or PDF file. 
-These settings are accessible from the Preference menu: 
-images/​preferences_menu.png 
- 
-2.5.1. Selection of text editor 
- 
-Before using a text editor to browse/edit files in the current project, you must choose the text editor you want to use. 
-Select Preferences → Set Text Editor to set the text editor you want to use. 
- 
-2.5.2. Selection of PDF viewer 
- 
-You may use the default PDF viewer or choose your own. 
-To change from the default PDF viewer use Preferences → PDF Viewer → Set PDF Viewer to choose the PDF viewer program, then select Preferences → PDF Viewer → Favourite PDF Viewer. 
-On Linux the default PDF viewer is known to be fragile, so selecting your own PDF viewer is recommended. 
-===== 2.6. Creating a new project ===== 
- 
-In order to manage a KiCad project consisting of schematic files, printed circuit board files, supplementary libraries, manufacturing files for photo-tracing,​ drilling and automatic component placement files, it is recommended to create a project as follows: 
-Create a working directory for the project (using KiCad or by other means). 
-In this directory, use KiCad to create a project file (file with extension .pro) via the "​Create a new project"​ or "​Create a new project from template"​ icon. 
-Warning 
-Use a unique directory for each KiCad project. Do not combine multiple projects into a single directory. 
-KiCad creates a file with a .pro extension that maintains a number of parameters for project management (such as the list of libraries used in the schematic). Default names of both main schematic file and printed circuit board file are derived from the name of the project. Thus, if a project called example.pro was created in a directory called example, the default files will be created: 
-example.pro 
-Project management file. 
-example.sch 
-Main schematic file. 
-example.kicad_pcb 
-Printed circuit board file. 
-example.net 
-Netlist file. 
-example.* 
-Various files created by the other utility programs. 
-example-cache.lib 
-Library file automatically created and used by the schematic editor containing a backup of the components used in the schematic. 
-===== 2.7. Importing a foreign project ===== 
- 
-KiCad is able to import files created using other software packages. Currently only Eagle 6.x or newer (XML format) is supported. 
-To import a foreign project, you need to select either a schematic or a board file in the import file browser dialog. Imported schematic and board files should have the same base file name (e.g. project.sch and project.brd). Once the requested files are selected, you will be asked to select a directory to store the imported files, which are going to be saved as a KiCad project. 
- 
- 
-====== 4. 电路原理图的绘制 ====== 
-无论任何一个PCB设计工具软件在设计原理图都会大致经历如下的10个步骤,KiCad也不例外。因此要想尽快熟悉KiCad在原理图这部分如何使用,就按照如下的10个步骤去体会每个步骤对应的功能是如何实现的,都需要什么样的操作,要注意哪些核心的要点和技巧,再自己动手设计一个项目,就能有所深刻体会。 
- 
-  - 创建工程和文件 
-  - 设置图纸大小: 根据图纸的复杂程度、各元器件的原理图库,一般A3比较合适,一个设计可以采用多页 
-  - 设置文件环境:格点大小、格点属性、光标属性、电气格点属性、图纸颜色等 
-  - 加载元器件库:如果有已经构建好的符号,则直接加载来用,如果没有的话需要依照数据手册进行构建 
-  - 放置元器件: 合理化、按照信号流程、可以翻转、旋转放置,方便连线、清晰理解 
-  - 原理图连线: 减少交叉,尽量少用最好是不用文字的Net进行标记 
-  - 调整修改原理图: 网标有没有重复、错误的连接、虚连接 
-  - ERC检查(电气规则检查):电气连接上的错误 
-  - 报表输出: 产生用于布局布线的Netlist、用于采购元器件的BOM清单 
-  - 文件输出:保存、备份、导出到PDF或其它格式、打印 
- 
- 
-在此部分将介绍如何使用KiCAD开绘制原理图 
-===== 4.1. 使用Eeschema绘制原理图 ===== 
-1 在Windows下运行kicad.exe,在Linux环境下可以在Terminal下键入“kicad”。 您现在就来到KiCad项目管理的主窗口中。 从这里您可以访问八个独立的软件工具:\\ 
- {{ :​kicad_main_window.png |}} <WRAP centeralign>​ KiCad主窗口 </​WRAP>​ 
-  - Eeschema: 原理图输入 
-  - Schematic Library Editor: 原理图库编辑器 
-  - Pcbnew: PCB布局布线 
-  - PCB Footprint Editor: PCB封装编辑器 
-  - GerbView: Gerber 查看 
-  - Bitmap2Component:​ 图片转元件 
-  - PCB Calculator: PCB计算器 
-  - Pl Editor: Pl编辑器。 ​ 
- 
-  请参阅工作流程图,了解如何使用这些工具。 
- 
-2 创建一个新项目:**文件→新建→项目**。 将项目文件命名为//​tutorial1//​,系统将自动为项目文件采用扩展名“.pro”。 对话框的确切外观取决于你使用的平台,但应该有一个用于创建新目录的复选框。 如果你没有专用的目录,可以选中使用系统推荐的目录,您的所有项目文件都会保存在那里。\\ 
-3 那我们就开始创建原理图了。点击左侧的第一个按钮启动//​Eeschema//​(原理图编辑器){{:​eeschema.png|}}\\ 
-4 单击顶部工具栏上的//​Page Setting//​(页面设置) 图标{{:​sheetset.png|}}。设置合适的//​纸张尺寸(A4,​8.5x11//​等)并输入标题为//​Tutorial1//​。如有必要,您将在此处看到可以输入更多信息。单击确定。此信息将填充右下角的原理图表。使用鼠标滚轮放大。保存整个原理图:文件→保存\\ 
- 
-5 我们现在将放置第一个元器件。单击右侧工具栏中的//​Place Symbol//​(放置符号)图标{{:​add_component.png|}}。您也可以按//​Add Symbol//​(添加符号)热键[a]。\\ 
- 
-6 单击原理图表的中间部分,屏幕上将出现一个//​选择符号//​窗口。我们要放一个电阻器,在电阻器类别的R上搜索/​过滤。您可能会注意到电阻器上方的//​Device(器件)//​标题。此器件标题是元器件所在库的名称,这是一个非常通用且有用的库。{{ :​choose_component.png |}} 
- 
-7 双击它,这将关闭//​Choose Symble(选择符号)//​窗口。单击要放置的器件的位置将选中的器件放在原理图页面中。 
- 
-8 鼠标指在元器件上单击放大镜图标就可以放大元器件。或者使用鼠标滚轮放大和缩小。按下滚轮(中央)鼠标按钮可水平和垂直平移。 
- 
-9 尝试将鼠标悬停在器件//​R//​上并按[r]。该器件就会发生旋转。你无需实际单击该器件即可旋转它。 
- 
-  注意:如果您的鼠标也在//​Field Reference(R)//​或//​Field Value(R?)//​上,则会出现一个菜单。 您将在KiCad中经常看到//​Clarify Selection//​菜单;​ 它允许处理彼此重叠的对象。 在这种情况下,告诉KiCad你想对Symbol ... R ...执行操作。 
- 
-10 右键单击器件的中间位置,然后选择//​属性→编辑值//​。 将鼠标悬停在器件上并按[v]可以获得相同的结果。 或者,[e]将带你进入更通用的属性窗口。 请注意下面的右键单击菜单如何显示所有可用操作的热键。 
- 
-{{ :​edit_component_dropdown.png |}}  
- 
-11 将出现“编辑值字段”窗口,用1k替换当前值R,单击确定。 
- 
-  注:不要改变元器件的参考标注字段(R?​),​ 在后面系统将会自动编号,电阻器内的电阻“值”应该设置成了1k. 
-{{ :​resistor_value.png |}} 
- 
-12 要再放置一个电阻器,只要用鼠标点击你要放置的位置,器件符号选择窗口将会再次出现。 
- 
-13 你先前选用的元器件会在你的历史列表中,以R的形式出现,点击OK就可以放置该器件。 
-{{ :​component_history.png |}} 
- 
-14 如果你放错了器件想删除它,可以点击你要删除的器件,再点击“删除”就可以将该器件从原理图中移除,你也可以将鼠标悬浮在想要删除的器件上面,然后按“删除”。 
- 
-15 如果你要复制放置在原理图上面的器件,将鼠标悬浮在想要复制的器件上面,按[c]. 鼠标点击你要放置器件的位置即可。 
- 
-16 右键单击第二个电阻,选择“拖动”,重新定位器件并左键单击以放置。将鼠标悬停在器件上并按[g]可以实现相同的功能。 [r]将旋转器件,而[x]和[y]将围绕其x轴或y轴翻转。 
- 
-  注:右键单击→移动或[m]也是移动任何物体的有用选项,但最好仅将其用于尚未连接的器件标签和器件。 我们稍后会看到为什么会这样。 
- 
-17 通过将第二个电阻悬停在其上并按[v]编辑第二个电阻。 将R替换为100. 您可以使用Ctrl + Z撤消任何编辑操作。 
- 
-18 更改网格大小。 您可能已经注意到,在原理图表上所有元器件都被捕捉到大间距网格上。 您可以通过//​右键单击→网格//​轻松更改网格的大小,通常我们建议在原理图中使用50mil的网格。 
- 
-19 我们将从还没有在默认项目中配置的库中添加元器件。 在菜单中,选择“首选项”→“管理符号库”。 在“符号库”窗口中,您可以看到两个选项卡:Global Libraries(全局库)和Project Specific Libraries(项目专用库)。 每一个库都有一个sym-lib-table文件。 如果要让一个库(.lib文件)可用,它必须位于其中一个sym-lib-table文件中。 如果你的文件系统中已经有某个库文件但却没有在这里显示出来,你可以通过“浏览库”将其添加到其中一个的sym-lib-table文件中。 为了方便练习,我们现在将添加一个已经可用的库。 
- 
-20 您需要找到计算机上安装官方KiCad库的位置,查找包含数百个.dcm和.lib文件的库目录。 尝试C:\Program Files(x86)\KiCad\share\(Windows)和/​usr/​share/​kicad/​library/​(Linux)。 找到目录后,选择并添加//​MCU_Microchip_PIC12.lib//​库并关闭窗口。 您将收到一个警告 - 该名称已存在于列表中;​ 但不用管,点击添加即可。 它将添加到列表的末尾。现在单击其昵称并将其更改//​microchip_pic12mcu//​。 单击"​确定"​关闭符号库窗口。 
- 
-21 重复添加器件步骤,但这次选择//​microchip_pic12mc//​u库而不是//​Device//​库并选择//​PIC12C508A-ISN//​器件。 
- 
-22 将鼠标悬停在微控制器器件上,[x]和[y]再次翻转器件,将器件返回到其原始方向。 
- 
-23 重复添加器件步骤,这次选择//​Device//​(设备)库并从中选择LED器件。 
- 
-24 有序排列原理图页面上的所有器件,如下所示。 
-{{ :​gsik_tutorial1_010.png |}} 
- 
-25 我们现在需要为我们的3针连接器创建原理图器件符号//​MYCONN3//​。 你可以跳转到KiCad中标题为“Make Schematic Components”的部分,了解如何从头开始制作该器件的符号库,然后返回本节继续使用该电路板。 
- 
-26 现在可以放置新制作的器件。 按[a]并选择//​myLib//​库中的//​MYCONN3//​器件。 
- 
-27 器件标记符J?将出现在//​MYCONN3//​标签下。 如果要更改其位置,请右键单击J? 然后单击//​Move Field//​(相当于[m])。 在执行此操作之前/​之后放大可能会有所帮助。 重新定位J? 在如下所示的器件下。 标签可以随意移动多次。 
-{{ :​gsik_tutorial1_010.png |}} 
- 
-28 现在我们放置“电源”和“地”符号。 单击右侧工具栏上的//​放置电源端口//​按钮{{:​add_power.png|}}。 或者,按[p]。 在器件选择窗口中,向下滚动并从//​Power(电源)//​库中选择//​VCC//​。 单击确定。 
- 
-29 在1k电阻的引脚上方单击以放置VCC部件。单击微控制器//​VDD//​上方的区域。 在//​器件选择历史//​部分中,选择//​VCC//​并将其放在//​VDD//​引脚旁边。 再次重复添加过程,并在//​MYCONN3//​的//​VCC//​引脚上方放置一个//​VCC//​部件。 
- 
-30 重复添加引脚步骤,但这次选择GND部分。 将GND部分放在//​MYCONN3//​的GND引脚下。 在微控制器的VSS引脚左侧放置另一个GND符号。 原理图现在应该看起来像这样: 
-{{ :​gsik_tutorial1_020.png |}} 
- 
-31 接下来,我们将连接所有器件。 单击右侧工具栏上的“放置导线”图标{{:​add_line.png|}}。 
- 
-  注:小心不要选择//​Place bus(放置总线)//​,它直接显示在此按钮下方,但线条较粗。 KiCad中的“总线连接”部分将详细介绍如何使用总线连接。 
- 
-32 单击微控制器引脚7末端的小圆圈,然后单击LED引脚1上的小圆圈,在放置连接的时候你可以放大显示。 
- 
-  注:如果要重新定位已经被连线连接的器件,要使用[g](抓取)而不是[m](移动)。 使用“抓取”将保持电线连接。 如果你忘记了如何移动器件,请查看步骤24。 
-{{ :​gsik_tutorial1_030.png |}} 
- 
-33 重复此过程并连接所有其他器件,如下面的图所示。 要想终止继续连线,你可以双击即可。 当连接VCC和GND符号时,导线应接触VCC符号的底部和GND符号的中间顶部。 请参见下面的屏幕截图 
-{{ :​gsik_tutorial1_040.png |}} 
- 
- 
-34 我们现在将考虑另外一种建立连接的方式 - 使用“标签”。 通过单击右侧工具栏上的//​放置网络标签//​图标{{:​add_line_label.png|}}选择网络标签工具,你也可以用热键[l]。 
- 
-35 单击连接到微控制器引脚6的导线的中间部位,将此“标签”命名为//​INPUT//​。 
- 
-36 按照相同的步骤在100欧姆电阻的右侧放置另一个标签,也将其命名为//​INPUT//​。这两个标签具有相同的名称,在PIC的引脚6和100欧姆的电阻之间产生不可见的连接。 有些设计非常复杂,如果全部使用直接的连线将会使电路图非常杂乱,在这种情况下使用“标签”就比较合适。要放置标签,你不一定需要连线,只需将标签贴在管脚上即可。 
- 
-37 标签也可用于简单地标记连线用于提供信息。 在PIC的引脚7上放置一个标签。 输入名称//​uCtoLE//​D。 将电阻器和LED之间的连线命名为//​LEDtoR//​。 将//​MYCONN//​3和电阻之间的连线命名为//​INPUTtoR//​。 
- 
-38 您不必标记VCC和GND线,因为标签是从它们所连接的电源对象中隐含的。 
- 
-39 最后的结果如下图所示: 
-{{ :​gsik_tutorial1_050.png |}} 
- 
-40 我们现在处理未连接的连线。 当KiCad检查时,任何未连接的引脚或连线都会给出警告。为了避免这些警告,您可以告诉程序某些未连接的连线是故意这样设置的,或者手动将每个未连接的连线或引脚标记为未连接。 
- 
-41 单击右侧工具栏上的//​放置无连接标志//​图标{{:​noconn.png|}}。 单击引脚2,​3,​4和5. 放置一个“X”表示此缺少连线是故意的。 
-{{ :​gsik_tutorial1_060.png |}} 
-===== 编辑短点4 ===== 
-42 某些器件有隐藏起来的的电源引脚,你可以通过单击左侧工具栏上的显示隐藏的图钉{{:​hidden_pin.png|}}来使它们可见。 如果遵守VCC和GND命名,则隐藏的电源引脚会自动连接。 一般来说,你应该尽量不要制作隐藏的电源引脚。 
- 
-43 现在需要添加一个//​Power Flag//​来向KiCad表明电源是从某个地方进来的。 按[a]并搜索//​Power//​(电源)库中的//​PWR_FLAG//​。 放置其中两个。 将它们连接到GND引脚和VCC,如下所示。 
-{{ :​gsik_tutorial1_070.png |}} 
- 
-  注意:这将避免经典的原理图检查警告:“警告引脚power_in未驱动(Net xx)” 
- 
-44 有时候很在这里和那里写评论是件好事。要在原理图上添加注释,请使用右侧工具栏上的放置文本图标{{:​text.png|}}。 
- 
-45 现在,所有器件都需要具有唯一标识符。 事实上,我们的许多器件仍被命名为R? 还是J? 通过单击顶部工具栏上的//​Annotate schematic symbols icon//​(标注原理图符号){{:​annotate.png|}},可以自动完成标识符分配。 
- 
-46 在Annotate Schematic(标注原理图)窗口中,选择//​Use the entire schematic//​并单击//​Annotate//​按钮。 在确认消息中单击“确定”,然后单击“关闭”。 请注意所有的?已被数字取代。 每个标识符现在都是唯一的,在我们的示例中,它们被命名为R1,R2,U1,D1和J1。 
- 
-47 我们现在来检查一下原理图是否有错误。 单击顶部工具栏上的//​执行电气规则//​检查图标{{:​erc.png|}},单击“运行”按钮。 生成一个报告,通知你任何错误或警告,例如断开的连线。 你应该有0个错误和0个警告。 如果出现错误或警告,原理图中将出现一个绿色小箭头,表示错误或警告所在的位置。 选中“创建ERC文件”报告,然后再次按“运行”按钮以接收有关错误的更多信息。 
- 
-  注意:如果您收到“未找到默认编辑器,你必须选择它”的警告,请尝试将路径设置为c:**\windows\notepad.exe**(windows)或**/​usr/​bin/​gedit**(Linux)。 
- 
-48 原理图现已完成。我们现在可以创建一个Netlist文件,我们将添加每个元器件的封装。单击顶部工具栏上的//​Generate netlist icon//​(生成网表){{:​netlist.png|}}。单击//​Generate Netlist//​按钮并保存在默认文件名下。 
- 
-49 生成Netlist文件后,单击顶部工具栏上的//​Run Cvpcb icon//​{{:​cvpcb.png|}}。如果弹出丢失文件错误的窗口,请忽略它并单击“确定”。 
- 
-50 Cvpcb允许你将原理图中的所有元器件与KiCad库中的封装链接起来。中心的窗格显示原理图中使用的所有元器件。在这里选择//​D1//​。在右侧窗格中,您可以看到所有可用的封装,此处向下滚动到//​LED_THT:​LED-D5.0mm//​并双击它。 
- 
-51 有可能右侧窗格仅显示可用封装的选定子组。这是因为KiCad正试图向您推荐一些合适的封装。单击图标{{:​module_filtered_list.png|}},{{:​module_pin_filtered_list.png|}}和{{:​module_library_list.png|}}以启用或禁用这些过滤器。 
- 
-52 对于U1,选择//​Package_DIP:DIP-8_W7.62mm//​封装。对于J1,选择//​Connector:Banana_Jack_3Pin//​封装。对于R1和R2,选择//​Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_Vertical//​封装。 
- 
-53 如果您想知道您选择的封装是什么样的,您可以单击//​“查看所选封装图标”//​{{:​show_footprint.png|}}以预览当前的封装。 
- 
-54 搞定!您可以通过单击**文件→保存原理图**或使用按钮**应用**,保存原理图并继续 
- 
-55 你可以关闭//​Cvpcb//​并返回Eeschema//​斜体//​原理图编辑器。如果你没有将其保存在Cvpcb中,请单击**文件→保存**立即保存。再次创建网表。您的网表文件现已更新,包含所有封装。请注意,如果您缺少任何设备的封装,则需要制作自己的封装。这将在本文档的后续部分中解释。 
- 
-56 切换到KiCad项目管理界面。 
- 
-57 网表文件描述了所有器件及其各自的引脚连接。网表文件实际上是一个文本文件,您可以轻松地检查,编辑或编写脚本。 
- 
-  注意:库文件(*.lib)是文本文件,它们可以非常容易地编辑或写成脚本. 
- 
-58 要创建物料清单(BOM),请转到//​Eeschema//​原理图编辑器,然后单击顶部工具栏上的“生成物料清单”图标{{:​bom.png|}}。 默认情况下,没有活动的插件。 您可以通过单击“添加插件”按钮添加一个。 选择要使用的*.xsl文件,在这种情况下,我们选择bom2csv.xsl。 
- 
-  注意 
-  Linux的:如果缺少xsltproc,您可以下载并安装它:sudo apt-get install xsltproc 
- 
-  对于像Ubuntu这样的Debian派生发行版,或者 
-  sudo yum install xsltproc 
- 
-  对于RedHat派生的发行版。如果您不使用这两种发行版,请使用您的发行版软件包管理器命令来安装xsltproc软件包。 
- 
-  xsl文件位于:/​usr/​lib/​kicad/​plugins/​。 
- 
-  Apple OS X:如果缺少xsltproc,您可以从应该包含它的Apple站点安装Apple Xcode工具,或者下载并安装它:brew install libxslt 
- 
-  xsl文件位于:/​ Library / Application Support / kicad / plugins /。 
- 
-  Windows:xsltproc.exe和包含的xsl文件将分别位于//<​KiCad安装目录>​\bin//​和//<​KiCad安装目录>​\bin\scripting\plugins//​。 
- 
-  对于所有平台: 
-  您可以通过以下方式获取最新的bom2csv.xsl: 
-  https://​raw.githubusercontent.com/​KiCad/​kicad-source-mirror/​master/​eeschema/​plugins/​xsl_scripts/​bom2csv.xsl 
- 
-KiCad自动生成命令,例如: 
-xsltproc -o“%O”“/​home/<​user>/​kicad/​eeschema/​plugins/​bom2csv.xsl”“%I” 
- 
-  您可能想要添加扩展名,因此请将此命令行更改为: 
-xsltproc -o“%O.csv”“/​ home / <>>​ / kicad / eeschema /plugins / bom2csv.xsl”“%I” 
- 
-  按“帮助”按钮可以获取更多信息。 
- 
-59 现在按//​Generate//​。该文件(与项目同名)位于项目文件夹中。使用LibreOffice Calc或Excel打开* .csv文件。将出现导入窗口,按OK。 
- 
-您现在可以转到PCB布局部分,这将在下一节中介绍。但是,在继续之前,让我们快速了解如何使用总线连接组件引脚。 
- 
-===== 4.2.KiCad中的总线连接 ===== 
-有时候你需要将器件A上的多根顺序排列的线连接到器件B上的一些顺序排列的管脚上,在这种情况下你有两种选择:前面介绍的“标签”技术以及使用总线连接,我们看看如何实现总线连接: 
- 
-- 让我们假设您有三个4针连接器,您想要将引脚连接在一起。 使用标签选项(按[l])标记P4部件的引脚4。 将此标签命名为a1。 现在按[Insert]将相同的项目自动添加到引脚4(PIN 3)下方的引脚上。 注意标签是如何自动重命名为a2的 
-- 再按[插入]两次。 这个键将会重复最后一次的动作,它是一个无限有用的命令,可以让你的生活更轻松。 
-- 在另外两个连接器CONN_2和CONN_3上重复相同的标签操作,您就完成了。 如果继续制作PCB,您将看到三个连接器相互连接。 图2显示了我们描述的结果。 为了美观的目的,还可以使用图标{{:​add_line2bus.png|}}将“连线连接到总线入口”执行多次和图标{{:​add_bus2bus.png|}}将连线连接到总线上,如图3所示。但是,记住这对PCB没有影响。 
- 
-- 应该指出的是,连接到图2中的引脚的短导线并非严格必要。 实际上,标签可以直接应用于引脚。 
- 
-- 让我们更进一步,假设你有一个名为CONN_4的第四个连接器,无论出于什么原因,它的标签恰好有点不同(b1,b2,b3,b4)。 现在我们想要以引脚到引脚的方式将总线a与总线b连接起来。 我们希望不使用引脚标记(这也是可能的),而是使用总线上的标签,每个总线一个标签。 
- 
-- 使用之前说明的标记方法连接并标记CONN_4。 将引脚命名为b1,b2,b3和b4。 使用图标{{:​add_line2bus.png|}}将引脚连接到一系列Wire to bus输入,并使用{{:​add_bus.png|}}图标连接到总线。 见图4。 
-- 在CONN_4的总线上放一个标签(按[l])并命名为b[1..4]。 
-- 在前一个总线上放一个标签(按[l])并将其命名为a[1..4]。 
-- 我们现在可以做的是使用带有按钮{{:​add_bus.png|}}的总线连接总线a[1..4]和总线b[1..4]。 
-- 通过将两条总线连接在一起,引脚a1将自动连接到引脚b1,a2将连接到b2,依此类推。 图4显示了最终结果的样子。 
- 
-注意: 通过[插入]可访问的//​重复最后一项//​选项可以成功用于重复期间项目插入。 例如,连接到图2,图3和图4中所有引脚的短导线都已放置此选项。 
-    
-- 通过[Insert]访问的//​Repeat last item//​选项也被广泛用于使用图标{{:​add_line2bus.png|}}将多个Wire系列放入总线入口。 
-{{ :​gsik_bus_connection.png |}} 
-====== 5. PCB布局布线 ====== 
-现在可以根据产生的网表(netlist)来进行PCB的布局布线了,这个过程是通过Pcbnew工具来做的。 
- 
-===== 5.1. Using Pcbnew ===== 
- 
-From the KiCad project manager, click on the Pcb layout editor icon  pcbnew_png . The Pcbnew window will open. If you get an error message saying that a *.kicad_pcb file does not exist and asks if you want to create it, just click Yes. 
-Begin by entering some schematic information. Click on the Page settings icon  sheetset_png on the top toolbar. Set the appropriate paper size (A4,8.5x11 etc.) and title as Tutorial1. 
-It is a good idea to start by setting the clearance and the minimum track width to those required by your PCB manufacturer. In general you can set the clearance to 0.25 and the minimum track width to 0.25. Click on the Setup → Design Rules menu. If it does not show already, click on the Net Classes Editor tab. Change the Clearance field at the top of the window to 0.25 and the Track Width field to 0.25 as shown below. Measurements here are in mm. 
-Design Rules Window 
-Click on the Global Design Rules tab and set Minimum track width to 0.25. Click the OK button to commit your changes and close the Design Rules Editor window. 
-Now we will import the netlist file. Click on the Read netlist icon  netlist_png on the top toolbar. The netlist file tutorial1.net should be selected in the Netlist file field if it was created from Eeschema. Click on Read Current Netlist. Then click the Close button. 
-All components should now be visible. They are selected and follow the mouse cursor. 
-Move the components to the middle of the board. If necessary you can zoom in and out while you move the components. Click the left mouse button. 
-All components are connected via a thin group of wires called ratsnest. Make sure that the Show/hide board ratsnest button general_ratsnest_png is pressed. In this way you can see the ratsnest linking all components. 
-You can move each component by hovering over it and pressing [m]. Click where you want to place them. Alternatively you can select a component by clicking on it and then drag it. Press [r] to rotate a component. Move all components around until you minimise the number of wire crossovers. 
-gsik_tutorial1_080_png 
-Note how one pin of the 100 ohm resistor is connected to pin 6 of the PIC component. This is the result of the labelling method used to connect pins. Labels are often preferred to actual wires because they make the schematic much less messy. 
-Now we will define the edge of the PCB. Select the Edge.Cuts layer from the drop-down menu in the top toolbar. Click on the Add graphic lines icon  add_dashed_line_png on the right toolbar. Trace around the edge of the board, clicking at each corner, and remember to leave a small gap between the edge of the green and the edge of the PCB. 
-Select the Edge.Cuts layer 
-Next, connect up all the wires except GND. In fact, we will connect all GND connections in one go using a ground plane placed on the bottom copper (called B.Cu) of the board. 
-Now we must choose which copper layer we want to work on. Select F.Cu (PgUp) in the drop-down menu on the top toolbar. This is the front top copper layer. 
-Select the Front top copper layer 
-If you decide, for instance, to do a 4 layer PCB instead, go to Setup → Layers Setup and change Copper Layers to 4. In the Layers table you can name layers and decide what they can be used for. Notice that there are very useful presets that can be selected via the Preset Layer Groupings menu. 
-Click on the Route tracks icon  add_tracks_png on the right toolbar. Click on pin 1 of J1 and run a track to pad R2. Double-click to set the point where the track will end. The width of this track will be the default 0.250 mm. You can change the track width from the drop-down menu in the top toolbar. Mind that by default you have only one track width available. 
-pcbnew_select_track_width_png 
-If you would like to add more track widths go to: Setup → Design Rules → Global Design Rules tab and at the bottom right of this window add any other width you would like to have available. You can then choose the widths of the track from the drop-down menu while you lay out your board. See the example below (inches). 
-custom_tracks_width_png 
-Alternatively,​ you can add a Net Class in which you specify a set of options. Go to Setup → Design Rules → Net Classes Editor and add a new class called power. Change the track width from 8 mil (indicated as 0.0080) to 24 mil (indicated as 0.0240). Next, add everything but ground to the power class (select default at left and power at right and use the arrows). 
-If you want to change the grid size, Right click → Grid. Be sure to select the appropriate grid size before or after laying down the components and connecting them together with tracks. 
-Repeat this process until all wires, except pin 3 of J1, are connected. Your board should look like the example below. 
-gsik_tutorial1_090_png 
-Let’s now run a track on the other copper side of the PCB. Select B.Cu in the drop-down menu on the top toolbar. Click on the Route tracks icon  add_tracks_png . Draw a track between pin 3 of J1 and pin 8 of U1. This is actually not necessary since we could do this with the ground plane. Notice how the colour of the track has changed. 
-Go from pin A to pin B by changing layer. It is possible to change the copper plane while you are running a track by placing a via. While you are running a track on the upper copper plane, right click and select Place Via or simply press [v]. This will take you to the bottom layer where you can complete your track. 
-place_a_via_png 
-When you want to inspect a particular connection you can click on the Highlight net icon  net_highlight_png on the right toolbar. Click on pin 3 of J1. The track itself and all pads connected to it should become highlighted. 
-Now we will make a ground plane that will be connected to all GND pins. Click on the Add filled zones icon  add_zone_png on the right toolbar. We are going to trace a rectangle around the board, so click where you want one of the corners to be. In the dialogue that appears, set Default pad connection to Thermal relief and Outline slope to H,V and 45 deg only and click OK. 
-Trace around the outline of the board by clicking each corner in rotation. Finish your rectangle by clicking the first corner second time. Right click inside the area you have just traced. Click on Zones→'​Fill or Refill All Zones'​. The board should fill in with green and look something like this: 
-gsik_tutorial1_100_png 
-Run the design rules checker by clicking on the Perform design rules check icon  drc_png on the top toolbar. Click on Start DRC. There should be no errors. Click on List Unconnected. There should be no unconnected items. Click OK to close the DRC Control dialogue. 
-Save your file by clicking on File → Save. To admire your board in 3D, click on View → 3D Viewer. 
-pcbnew_3d_viewer_png 
-You can drag your mouse around to rotate the PCB. 
-Your board is complete. To send it off to a manufacturer you will need to generate all Gerber files. 
- 
-===== 5.2. Generate Gerber files ===== 
- 
-Once your PCB is complete, you can generate Gerber files for each layer and send them to your favourite PCB manufacturer,​ who will make the board for you. 
-From KiCad, open the Pcbnew board editor. 
-Click on File → Plot. Select Gerber as the Plot format and select the folder in which to put all Gerber files. Proceed by clicking on the Plot button. 
-To generate the drill file, from Pcbnew go again to the File → Plot option. Default settings should be fine. 
-These are the layers you need to select for making a typical 2-layer PCB: 
-Layer KiCad Layer Name Default Gerber Extension "​Use Protel filename extensions"​ is enabled 
-Bottom Layer 
-B.Cu 
-.GBR 
-.GBL 
-Top Layer 
-F.Cu 
-.GBR 
-.GTL 
-Top Overlay 
-F.SilkS 
-.GBR 
-.GTO 
-Bottom Solder Resist 
-B.Mask 
-.GBR 
-.GBS 
-Top Solder Resist 
-F.Mask 
-.GBR 
-.GTS 
-Edges 
-Edge.Cuts 
-.GBR 
-.GM1 
- 
-===== 5.3. Using GerbView ===== 
- 
-To view all your Gerber files go to the KiCad project manager and click on the GerbView icon. On the drop-down menu or in the Layers manager select Graphic layer 1. Click on File → Open Gerber file(s) or click on the icon  gerber_file_png . Select and open all generated Gerber files. Note how they all get displayed one on top of the other. 
-Open the drill files with File → Open Excellon Drill File(s). 
-Use the Layers manager on the right to select/​deselect which layer to show. Carefully inspect each layer before sending them for production. 
-The view works similarly to Pcbnew. Right click inside the view and click Grid to change the grid. 
- 
-===== 5.4. Automatically route with FreeRouter ===== 
- 
-Routing a board by hand is quick and fun, however, for a board with lots of components you might want to use an autorouter. Remember that you should first route critical traces by hand and then set the autorouter to do the boring bits. Its work will only account for the unrouted traces. The autorouter we will use here is FreeRouting. 
-Note 
-FreeRouting is an open source java application. Currently FreeRouting exists in several more or less identical copies which you can find by doing an internet search for "​freerouting"​. It may be found in source only form or as a precompiled java package. 
-From Pcbnew click on File → Export → Specctra DSN and save the file locally. Launch FreeRouter and click on the Open Your Own Design button, browse for the dsn file and load it. 
-FreeRouter has some features that KiCad does not currently have, both for manual routing and for automatic routing. FreeRouter operates in two main steps: first, routing the board and then optimising it. Full optimisation can take a long time, however you can stop it at any time need be. 
-You can start the automatic routing by clicking on the Autorouter button on the top bar. The bottom bar gives you information about the on-going routing process. If the Pass count gets above 30, your board probably can not be autorouted with this router. Spread your components out more or rotate them better and try again. The goal in rotation and position of parts is to lower the number of crossed airlines in the ratsnest. 
-Making a left-click on the mouse can stop the automatic routing and automatically start the optimisation process. Another left-click will stop the optimisation process. Unless you really need to stop, it is better to let FreeRouter finish its job. 
-Click on the File → Export Specctra Session File menu and save the board file with the .ses extension. You do not really need to save the FreeRouter rules file. 
-Back to Pcbnew. You can import your freshly routed board by clicking on File → Import → Spectra Session and selecting your .ses file. 
-If there is any routed trace that you do not like, you can delete it and re-route it again, using [Delete] and the routing tool, which is the Route tracks icon  Add Track icon on the right toolbar. 
- 
-====== 6. Forward annotation in KiCad ====== 
- 
-Once you have completed your electronic schematic, the footprint assignment, the board layout and generated the Gerber files, you are ready to send everything to a PCB manufacturer so that your board can become reality. 
-Often, this linear work-flow turns out to be not so uni-directional. For instance, when you have to modify/​extend a board for which you or others have already completed this work-flow, it is possible that you need to move components around, replace them with others, change footprints and much more. During this modification process, what you do not want to do is to re-route the whole board again from scratch. Instead, this is how you do it: 
-Let’s suppose that you want to replace a hypothetical connector CON1 with CON2. 
-You already have a completed schematic and a fully routed PCB. 
-From KiCad, start Eeschema, make your modifications by deleting CON1 and adding CON2. Save your schematic project with the icon  Save icon and c lick on the Netlist generation icon  netlist_png on the top toolbar. 
-Click on Netlist then on save. Save to the default file name. You have to rewrite the old one. 
-Now assign a footprint to CON2. Click on the Run Cvpcb icon  cvpcb on the top toolbar. Assign the footprint to the new device CON2. The rest of the components still have the previous footprints assigned to them. Close Cvpcb. 
-Back in the schematic editor, save the project by clicking on File → Save Whole Schematic Project. Close the schematic editor. 
-From the KiCad project manager, click on the Pcbnew icon. The Pcbnew window will open. 
-The old, already routed, board should automatically open. Let’s import the new netlist file. Click on the Read Netlist icon netlist_png on the top toolbar. 
-Click on the Browse Netlist Files button, select the netlist file in the file selection dialogue, and click on Read Current Netlist. Then click the Close button. 
-At this point you should be able to see a layout with all previous components already routed. On the top left corner you should see all unrouted components, in our case the CON2. Select CON2 with the mouse. Move the component to the middle of the board. 
-Place CON2 and route it. Once done, save and proceed with the Gerber file generation as usual. 
-The process described here can easily be repeated as many times as you need. Beside the Forward Annotation method described above, there is another method known as Backward Annotation. This method allows you to make modifications to your already routed PCB from Pcbnew and updates those modifications in your schematic and netlist file. The Backward Annotation method, however, is not that useful and is therefore not described here. 
- 
-====== 7. Make schematic symbols in KiCad ====== 
- 
-Sometimes a symbol that you want to place on your schematic is not in a KiCad library. This is quite normal and there is no reason to worry. In this section we will see how a new schematic symbol can be quickly created with KiCad. Nevertheless,​ remember that you can always find KiCad components on the Internet. 
-In KiCad, a symbol is a piece of text that starts with DEF and ends with ENDDEF. One or more symbols are normally placed in a library file with the extension .lib. If you want to add symbols to a library file you can just use the cut and paste commands of a text editor. 
- 
-===== 7.1. Using Component Library Editor ===== 
- 
-We can use the Component Library Editor (part of Eeschema) to make new components. In our project folder tutorial1 let’s create a folder named library. Inside we will put our new library file myLib.lib as soon as we have created our new component. 
-Now we can start creating our new component. From KiCad, start Eeschema, click on the Library Editor icon  libedit_png and then click on the New component icon  new_component_png . The Component Properties window will appear. Name the new component MYCONN3, set the Default reference designator as J, and the Number of units per package as 1. Click OK. If the warning appears just click yes. At this point the component is only made of its labels. Let’s add some pins. Click on the Add Pins icon  pin_png on the right toolbar. To place the pin, left click in the centre of the part editor sheet just below the MYCONN3 label. 
-In the Pin Properties window that appears, set the pin name to VCC, set the pin number to 1, and the Electrical type to Power input then click OK. 
-Pin Properties 
-Place the pin by clicking on the location you would like it to go, right below the MYCONN3 label. 
-Repeat the place-pin steps, this time Pin name should be INPUT, Pin number should be 2, and Electrical Type should be Passive. 
-Repeat the place-pin steps, this time Pin name should be GND, Pin number should be 3, and Electrical Type should be Passive. Arrange the pins one on top of the other. The component label MYCONN3 should be in the centre of the page (where the blue lines cross). 
-Next, draw the contour of the component. Click on the Add rectangle icon  add_rectangle_png . We want to draw a rectangle next to the pins, as shown below. To do this, click where you want the top left corner of the rectangle to be (do not hold the mouse button down). Click again where you want the bottom right corner of the rectangle to be. 
-gsik_myconn3_l_png 
-If you want to fill the rectangle with yellow, set the fill colour to yellow 4 in Preferences → Select color scheme, then select the rectangle in the editing screen with [e], selecting Fill background. 
-Save the component in your library myLib.lib. Click on the New Library icon  new_library_png , navigate into tutorial1/​library/​ folder and save the new library file with the name myLib.lib. 
-Go to Preferences → Component Libraries and add both tutorial1/​library/​ in User defined search path and myLib.lib in Component library files. 
-Click on the Select working library icon  library_png . In the Select Library window click on myLib and click OK. Notice how the heading of the window indicates the library currently in use, which now should be myLib. 
-Click on the Update current component in current library icon  save_part_in_mem_png in the top toolbar. Save all changes by clicking on the Save current loaded library on disk icon  save_library_png in the top toolbar. Click Yes in any confirmation messages that appear. The new schematic component is now done and available in the library indicated in the window title bar. 
-You can now close the Component library editor window. You will return to the schematic editor window. Your new component will now be available to you from the library myLib. 
-You can make any library file.lib file available to you by adding it to the library path. From Eeschema, go to Preferences → Library and add both the path to it in User defined search path and file.lib in Component library files. 
-===== 7.2. Export, import and modify library components ===== 
- 
-Instead of creating a library component from scratch it is sometimes easier to start from one already made and modify it. In this section we will see how to export a component from the KiCad standard library device to your own library myOwnLib.lib and then modify it. 
-From KiCad, start Eeschema, click on the Library Editor icon  libedit_png , click on the Select working library icon  library_png and choose the library device. Click on Load component to edit from the current lib icon  import_cmp_from_lib_png and import the RELAY_2RT. 
-Click on the Export component icon  export_png , navigate into the library/ folder and save the new library file with the name myOwnLib.lib. 
-You can make this component and the whole library myOwnLib.lib available to you by adding it to the library path. From Eeschema, go to Preferences → Component Libraries and add both library/ in User defined search path and myOwnLib.lib in the Component library files. Close the window. 
-Click on the Select working library icon  library_png . In the Select Library window click on myOwnLib and click OK. Notice how the heading of the window indicates the library currently in use, it should be myOwnLib. 
-Click on the Load component to edit from the current lib icon  import_cmp_from_lib_png and import the RELAY_2RT. 
-You can now modify the component as you like. Hover over the label RELAY_2RT, press [e] and rename it MY_RELAY_2RT. 
-Click on Update current component in current library icon  save_part_in_mem_png in the top toolbar. Save all changes by clicking on the Save current loaded library on disk icon  save_library_png in the top toolbar. 
-===== 7.3. Make schematic components with quicklib ===== 
- 
-This section presents an alternative way of creating the schematic component for MYCONN3 (see MYCONN3 above) using the Internet tool quicklib. 
-Head to the quicklib web page: http://​kicad.rohrbacher.net/​quicklib.php 
-Fill out the page with the following information:​ Component name: MYCONN3 Reference Prefix: J Pin Layout Style: SIL Pin Count, N: 3 
-Click on the Assign Pins icon. Fill out the page with the following information:​ Pin 1: VCC Pin 2: input Pin 3: GND. Type : Passive for all 3 pins. 
-Click on the icon Preview it and, if you are satisfied, click on the Build Library Component. Download the file and rename it tutorial1/​library/​myQuickLib.lib.. You are done! 
-Have a look at it using KiCad. From the KiCad project manager, start Eeschema, click on the Library Editor icon  libedit_png , click on the Import Component icon  import_png , navigate to tutorial1/​library/​ and select myQuickLib.lib. 
-gsik_myconn3_quicklib_png 
-You can make this component and the whole library myQuickLib.lib available to you by adding it to the KiCad library path. From Eeschema, go to Preferences → Component Libraries and add library in User defined search path and myQuickLib.lib in Component library files. 
-As you might guess, this method of creating library components can be quite effective when you want to create components with a large pin count. 
-===== 7.4. Make a high pin count schematic component ===== 
- 
-In the section titled Make Schematic Components in quicklib we saw how to make a schematic component using the quicklib web-based tool. However, you will occasionally find that you need to create a schematic component with a high number of pins (some hundreds of pins). In KiCad, this is not a very complicated task. 
-Suppose that you want to create a schematic component for a device with 50 pins. It is common practise to draw it using multiple low pin-count drawings, for example two drawings with 25 pins each. This component representation allows for easy pin connection. 
-The best way to create our component is to use quicklib to generate two 25-pin components separately, re-number their pins using a Python script and finally merge the two by using copy and paste to make them into one single DEF and ENDDEF component. 
-You will find an example of a simple Python script below that can be used in conjunction with an in.txt file and an out.txt file to re-number the line: X PIN1 1 -750 600 300 R 50 50 1 1 I into X PIN26 26 -750 600 300 R 50 50 1 1 I this is done for all lines in the file in.txt. 
-Simple script 
-#​!/​usr/​bin/​env python 
-'''​ simple script to manipulate KiCad component pins numbering'''​ 
-import sys, re 
-try: 
-    fin=open(sys.argv[1],'​r'​) 
-    fout=open(sys.argv[2],'​w'​) 
-except: 
-    print "oh, wrong use of this app, try:", sys.argv[0],​ "​in.txt out.txt"​ 
-    sys.exit() 
-for ln in fin.readlines():​ 
-    obj=re.search("​(X PIN)(\d*)(\s)(\d*)(\s.*)",​ln) 
-if obj: 
-    num = int(obj.group(2))+25 
-    ln=obj.group(1) + str(num) + obj.group(3) + str(num) + obj.group(5) +'​\n'​ 
-    fout.write(ln) 
-fin.close();​ fout.close() 
-# 
-# for more info about regular expression syntax and KiCad component generation: 
-# http://​gskinner.com/​RegExr/​ 
-# http://​kicad.rohrbacher.net/​quicklib.php 
-While merging the two components into one, it is necessary to use the Library Editor from Eeschema to move the first component so that the second does not end up on top of it. Below you will find the final .lib file and its representation in Eeschema. 
-Contents of a *.lib file 
-EESchema-LIBRARY Version 2.3 
-#encoding utf-8 
-# COMP 
-DEF COMP U 0 40 Y Y 1 F N 
-F0 "​U"​ -1800 -100 50 H V C CNN 
-F1 "​COMP"​ -1800 100 50 H V C CNN 
-DRAW 
-S -2250 -800 -1350 800 0 0 0 N 
-S -450 -800 450 800 0 0 0 N 
-X PIN1 1 -2550 600 300 R 50 50 1 1 I 
- 
-... 
- 
-X PIN49 49 750 -500 300 L 50 50 1 1 I 
-ENDDRAW 
-ENDDEF 
-#End Library 
-gsik_high_number_pins_png 
-The Python script presented here is a very powerful tool for manipulating both pin numbers and pin labels. Mind, however, that all its power comes for the arcane and yet amazingly useful Regular Expression syntax: http://​gskinner.com/​RegExr/​. 
-====== 8. Make component footprints ====== 
- 
-Unlike other EDA software tools, which have one type of library that contains both the schematic symbol and the footprint variations, KiCad .lib files contain schematic symbols and .kicad_mod files contain footprints. Cvpcb is used to map footprints to symbols. 
-As for .lib files, .kicad_mod library files are text files that can contain anything from one to several parts. 
-There is an extensive footprint library with KiCad, however on occasion you might find that the footprint you need is not in the KiCad library. Here are the steps for creating a new PCB footprint in KiCad: 
-8.1. Using Footprint Editor 
-From the KiCad project manager start the Pcbnew tool. Click on the Open Footprint Editor icon  edit_module_png on the top toolbar. This will open the Footprint Editor. 
-We are going to save the new footprint MYCONN3 in the new footprint library myfootprint. Create a new folder myfootprint.pretty in the tutorial1/ project folder. Click on the Preferences → Footprint Libraries Manager and press Append Library button. In the table, enter "​myfootprint"​ as Nickname, enter "​${KIPRJMOD}/​myfootprint.pretty"​ as Library Path and enter "​KiCad"​ as Plugin Type. Press OK to close the PCB Library Tables window. Click on the Select active library icon  open_library_png on the top toolbar. Select the myfootprint library. 
-Click on the New Footprint icon  new_footprint_png on the top toolbar. Type MYCONN3 as the footprint name. In the middle of the screen the MYCONN3 label will appear. Under the label you can see the REF* label. Right click on MYCONN3 and move it above REF*. Right click on REF__*, select Edit Text and rename it to SMD. Set the Display value to Invisible. 
-Select the Add Pads icon  pad_png on the right toolbar. Click on the working sheet to place the pad. Right click on the new pad and click Edit Pad. You can also use [e]. 
-Pad Properties 
-Set the Pad Num to 1, Pad Shape to Rect, Pad Type to SMD, Shape Size X to 0.4, and Shape Size Y to 0.8. Click OK. Click on Add Pads again and place two more pads. 
-If you want to change the grid size, Right click → Grid Select. Be sure to select the appropriate grid size before laying down the components. 
-Move the MYCONN3 label and the SMD label out of the way so that it looks like the image shown above. 
-When placing pads it is often necessary to measure relative distances. Place the cursor where you want the relative coordinate point (0,0) to be and press the space bar. While moving the cursor around, you will see a relative indication of the position of the cursor at the bottom of the page. Press the space bar at any time to set the new origin. 
-Now add a footprint contour. Click on the Add graphic line or polygon button ​ add_polygon_png in the right toolbar. Draw an outline of the connector around the component. 
-Click on the Save Footprint in Active Library icon  save_library_png on the top toolbar, using the default name MYCONN3. 
- 
 ====== 9. Note about portability of KiCad project files ====== ====== 9. Note about portability of KiCad project files ======