Introduction简介
If you’re like me and you’ve decided to take the plunge from EAGLE PCB to KiCad it can be really jarring. EAGLE had many quirks and rough edges that I’m sure I cursed when I first learned it back in 2005. Since then EAGLE has become a second language to me and I’ve forgotten all the hard bits. So as you migrate to KiCad remember to take breaks and breathe (and say ‘Key-CAD’ in your head). You’ll be dreaming in KiCad in no time!
如果你像我一样,决定从EAGLE PCB转到KiCad,那么这篇分享一起入门经验的教程就应该可以帮助你。这背后的原因可能很多,我们另文讨论。 当我在2005年第一次学习EAGLE时,EAGLE画图过程中有很多奇怪和粗糙的边缘,对此我当时也是颇有怨言的。但从那以后,EAGLE成为我的第二语言,我很快克服了所有的困难适应了这个环境。 因此,当您迁移到KiCad时,请记住同样的道理,人总有先入为主的思维惯性,对于改变的不适应觉得别扭,但正如老话说,工具上手了就没有好坏之分, 你很快就会在KiCad开展你新的工作!
This tutorial will walk you through a KiCad example project from schematic capture to PCB layout. We’ll also touch on library linking, editing, and creation. We’ll also export our PCB to gerbers so the board can be fabricated.
本教程将引导您完成从原理图画图到PCB布局的KiCad项目范例。 我们还将涉及元件库的链接,编辑和创作。 我们还将PCB导出成gerbers文件,因此可以制造电路板。
While this tutorial is aimed at beginners I am going to use terms such as ‘schematic components’ and ‘polygon pours’. If something doesn’t make sense that’s ok, just take a moment to do a quick search. If you really get stuck please use the comments section on the right. We always want to improve our tutorials to make them easier.
虽然本教程针对的是初学者,但我将使用“原理图元件”和“多边形覆铜”等术语。 如果你觉得有不理解的名词,可以进行快速搜索Google获得相关概念的解释。 如果你发现在学习过程中卡在某些位置了,请在教程下方的评论告知我们。 我们总是希望改进我们的教程使它们更易上手。
站长推荐超霸机器人(高品质乐高兼容)点击这里了解更多
全网最低价 点击或使用微信扫描上述二维码即可购买
Scratch编程超霸机器人 https://weidian.com/item.html?itemID=4270851520
KiCad Project Window
KiCad项目窗口
Download and Install KiCad
下载并安装KiCad
Let’s get started! Head over to KiCad’s download page and download the latest version of the software for your specific platform:
DOWNLOAD KICAD FOR YOUR OPERATING SYSTEM/DISTRIBUTION
备注:
让我们开始吧! 前往KiCad的下载页面并下载适用于您特定平台的最新版软件:
Run KiCad
运行KiCad
Once installed, run KiCad. A main navigation window will display where you will be able to open all the periphery programs like schematic capture and PCB layout.
安装完成后,运行KiCad。 将显示一个导航主窗口,您可以在其中打开所有附加程序,如原理图绘制和PCB布局。
点击上图可以看到更清晰完整的截图
The KiCad project window looks quite empty and sad. Let’s open an example!
KiCad项目窗口看起来很空白。 让我们开始创建一个范例吧!
Setting Up a Project
设置项目
The ZOPT2201 UV sensor designed originally in SparkX is a great I2C UV Index sensor and will serve as our starting example for this tutorial. Download the ZOPT220x UV Sensor Breakout designs for KiCad and unzip the four files into a local directory:
最初在SparkX实验室中设计的ZOPT2201紫外线传感器是一款出色的I2C紫外线指数传感器,将作为本教程的起始示例。 点击下面链接下载KiCad的ZOPT220x UV传感器电路板模块设计,并将这四个文件解压缩到本地目录:
ZOPT220X UV SENSOR BREAKOUT KICAD BOARD FILES
Once the four files are located in a local directory (try looking in your downloads folder for …\ZOPT220x_UV_Sensor_Breakout-Tutorial), click File -> Open Project and open the ZOPT220x UV Sensor Breakout.profile.
当这四个文件已下载并解压到本地目录中(尝试在下载文件夹中查找… \ ZOPT220x_UV_Sensor_Breakout-Tutorial),单击File -> Open 并打开ZOPT220x UV传感器Breakout.profile。
点击上图可以看到更清晰完整的截图
Click the image for a closer look
What are all these files?
- *.pro – Main project file to keep track of the file structure.
- *.cmp – Defines which footprints go with which schematic components.
- *.kicad_pcb – The PCB layout.
- *.sch – The schematic.
这些文件分别是什么?
- *.pro – 用于跟踪文件结构的主项目文件。
- *.cmp – 定义原理图元件的封装与原理图元件的关联。
- *.kicad_pcb – PCB布局。
- *.sch – 原理图。
These four files are all you need to share a KiCad design with a fellow collaborator. You may also need to share a footprint file, which will be explained more later on in this tutorial.
这四个文件是发布KiCad设计所需的全部文件。 您可能还需要发布一个封装文件,稍后将在本教程中对此进行说明。
You may have had your first critical-judgment-eye-squint. Why is there a file to define which footprints go with which schematic components? This is fundamental to KiCad and is very different from how EAGLE works. It’s not a bad thing, just different.
你可能已经开始感到困惑。 为什么有一个文件来定义哪些脚印与哪些原理图元件一起使用? 这是KiCad的基础,与EAGLE的工作方式截然不同。 这没有好坏之分,只是不同的处理方式而已。
Setting Up Schematic Component Libraries
设置原理图元件库
Double click on the schematic file with Kicad’s Eeschema schematic editor. You’ll probably get an error:
使用Kicad的Eeschema原理图编辑器双击原理图文件。 可能会弹出一个错误:
Ignore this for now. Click ‘Close’.
暂时忽略这个问题。点击“关闭”。
The schematic will load with lots of components with question marks (i.e.??). KiCad is missing the link to the devices within this schematic. Let’s get them linked!
原理图将加载许多带有问号的元件(即?? ??)。 KiCad缺少此原理图中元器件的关联。 让它们关联起来吧!
Linking Component Libraries w/ Eeschema
链接具有Eeschema的组件库
From within EeSchema, click on Preferences -> Component Libraries. This will open a new window. In the image below you can see that the project file contains information about where it should look for “Component library files”. Each project has its own connections to different file structures. We need to tell this project where to find the symbols for this schematic.
在EeSchema中,单击Preferences – > Component Libraries。 这将打开一个新窗口。 在下图中,您可以看到项目文件包含有关“元件库文件”的查找位置的信息。 每个项目都有自己与不同文件结构的连接。 我们需要告诉这个项目在哪里找到这个原理图的符号。
We will need the SparkFun_SchematicComponents.lib file. Download and store it in a local directory:
DOWNLOAD “SPARKFUN_SCHEMATICCOMPONENTS.LIB”
我们需要SparkFun_SchematicComponents.lib文件。 下载并将其存储在本地路径中:
下载 “SPARKFUN_SCHEMATICCOMPONENTS.LIB”
From the KiCad window, click the top ‘Add’ button. We’ll show you how to create your own schematic symbols in a bit.
在KiCad窗口中,单击顶部的“Add”按钮。 我们将展示如何创建自己的原理图符号。
Navigate to the directory where you stored the SparkFun_SchematicComponents.lib file and click ‘Open’. This file contains all the schematic components.
导航到存储SparkFun_SchematicComponents.lib文件的路径,然后单击“Open”。 该文件包含所有原理图元件。
Once you’ve added the SparkFun schematic components library file, you should see it added to the list.
一旦添加了SparkFun原理图元件库文件,您应该看到它已添加到列表中。
The astute will note the slightly different directory structure in the window:
细心观察的你可能会注意到窗口中的路径略有不同:
C:\Users\Nathan…
和
C:\Users\nathan.seidle…
That’s the difference between my home PC and my work PC. To avoid future errors when opening this schematic, let’s remove the entry from the active library files. Highlight the C:\Users\Nathan… entry from the list and click on the ‘Remove’ button.
这是我的家用电脑和我的工作电脑之间的区别。 为了避免将来打开此原理图时出现错误,我们将从活动库文件中删除该条目。 从列表中突出显示C:\ Users \ Nathan …条目,然后单击“删除”按钮。
Click on ‘OK’ to close out the Component Libraries manager. Now close and re-open the schematic to refresh.
单击“确定”关闭元件库管理器。 现在关闭并重新打开原理图以刷新。
Congrats! No more ?? boxes. For more information about using schematic component libraries across multiple computers, check the next subsection about the “user defined search path.” Otherwise, let’s start editing the schematic!
恭喜你! 再也没有??框。 有关在多台计算机上使用原理图元件库的更多信息,请查看有关“用户定义的搜索路径”的下一小节。另外,让我们开始编辑原理图!
User Defined Search Path: Using Component Libraries on Multiple Computers
用户定义的搜索路径:在多台计算机上使用元件库
The schematic component libraries are assigned using KiCad’s Component Library Manager. If you’re like me and have schematic libraries shared across multiple computers, adding a “User defined search path” is helpful:
使用KiCad的元件库管理器分配原理图元件库。 如果您像我一样并且在多台计算机之间共享原理图库,则添加“用户定义的搜索路径”会很有帮助:
In the image , I have “..\..\SparkFun-KiCad-Libraries” defined. This is the local relative path to a Dropbox folder. These component library paths are specific to this project and *.pro file. When I open this project on my laptop, it will first look for the files in the “C:\Users\nathan.seidle…” location. It will fail and then search the relative path of “ ..\SparkFun-KiCad-Libraries” and find the files. It allows me to share libs between computers and between GitHub repos without having to reassign the libraries every time I open the project on a different computer.
在上图中,我定义了“.. \ .. \ SparkFun-KiCad-Libraries”。 这是Dropbox文件夹的本地相对路径。 这些元件库路径特定于此项目和* .pro文件。 当我在笔记本电脑上打开这个项目时,它将首先在“C:\ Users \ nathan.seidle …”位置查找文件。失败了,然后搜索“.. \ SparkFun-KiCad-Libraries”的相对路径并找到文件。 它允许我在计算机之间和GitHub repos之间共享库,而不必每次在另一台计算机上打开项目时重新分配库。
For now, you should continue with the tutorial. In the future, you may want to revisit this if you use KiCad across multiple computers.
现在,您应该继续学习本教程。 将来,如果您在多台计算机上使用KiCad,则可能需要重新浏览这里所说的路径范例。
Editing a Schematic
编辑原理图
If I get you to do nothing else, I will get you to learn the keyboard shortcuts! Yes, you can click on the equivalent buttons. However, the speed and efficiency of KiCad really shines when muscle memory kicks in so start memorizing. Here are the keyboard shortcuts in KiCad’s Eeschema that we will be using frequently in this tutorial:
如果我没有说明该如何操作,我就会让你学习如何使用快捷键完成! 是的,您可以单击等效的图形按钮。 然而,当完整记忆快捷键开始时,KiCad的速度和效率真的很高,所以还是尽快开始记一下吧。 以下是我们将在本教程中经常使用的KiCad Eeschema中的快捷键:
- a – To add component.
- c – Copy a component when the cursor is over another component.
- w – To wire components.
- v – Edit component value.
- Esc – Escape mode or whatever command in progress and return to normal pointer mode.
- ctrl+z – Undo. Use liberally to undo any mistakes.
- ctrl+s – To save. Make sure to save often!
- a – 添加元件。
- c – 当光标位于另一个元件件上时复制元件。
- w – 连接元件件。
- v – 编辑元件值。
- Esc – 转义模式或正在进行的任何命令并返回正常指针模式。
- ctrl+z – 撤消。 使用自由来消除任何错误。
- ctrl+s – 保存。 一定要经常保存!
This breakout board needs a larger 4.7uF decoupling cap (because I say so). Let’s add it!
这个模块电路板需要一个更大的4.7uF去耦电容(因为我这么说)。 我们加上吧!
Adding Component to Schematic
将元件添加到原理图
Press ‘a’ to add a device to the schematic. This will open the component window. (If you are using a different tool you may need to click on the schematic as well):
按’a’将设备添加到原理图中。 这将打开元件窗口。 (如果您使用的是其他工具,则可能还需要单击原理图):
There are hundreds of components (668 items according to the title bar). Feel free to dig around but to quickly find what we need type ‘cap’ into the field Filter:. Select the device labeled as C_Small from the device library. Then hit enter or click ‘OK’.
有数百个元件(根据标题栏所示共有668项)。 随意翻找,但为了更快速找到所需元件,我们需要输入’cap’到字段到查询过滤器Filter。 从设备库中选择标记为C_Small的器件。 然后按Enter键或单击“确定”。
Place it on the schematic next to the 0.1uF cap.
将其放在原理图上0.1uF电容旁边。
After you place the capacitor, you’ll notice you’re still in placement mode. Hit the ‘Esc’ button on your keyboard to return to normal pointer mode. I find myself hitting escape twice a lot just to be sure I’m back in default state.
放置电容器后,你会注意到仍处于放置模式。 按键盘上的“Esc”按钮返回正常指针模式。 为了确保我恢复到默认状态,我自己经常两次按“Esc”。
Copying Component复制元件
Once in default state put your mouse pointer on top of the 3.3V marker on the 0.1uF cap. Press ‘c’ to copy that device and place it above the new capacitor.
处于默认状态时,将鼠标指针放在0.1uF上方的3.3V标记处。 按’c’复制该标记并将其放在新电容上方。
Do the same for the ground marker. Press ‘ctrl+s’ to save your work.
对GND标记执行相同操作。 按’ctrl + s’保存您的工作。
Wiring Components元件连线
Now let’s wire them together. You guessed it, press ‘w’ but here’s the catch: have your mouse pointer over one of the bubbles before you press ‘w’.
现在让我们将元件连线, 你猜对了,按’w’。请注意:在你按’w’之前先将鼠标指针放在其中一个气泡上。
Move your mouse to the other bubble and left click on the mouse to complete the wiring for GND. Remember if you mess up, press ‘Esc’ once or twice to return to default. Then move your mouse pointer to the bubble you want to connect and press ‘w’ and begin wiring 3.3V. The shortcut ‘w’ stands for wire.
将鼠标移动到另一个气泡,然后左键单击鼠标以完成GND的接线。 请记住,如果出现问题,按“Esc”一次或两次返回默认状态。 然后再将鼠标指针移动到要连接的气泡上,按“w”键开始接线3.3V。 快捷键“w”代表接线。
Did something go wrong? Use ‘ctrl+z’ liberally to undo any mistakes.
出了什么问题? 大胆地使用’ctrl + z’来撤销任何误操作。
Power and ground are now connected to our capacitor.
我们的电容器现在连接到电源和接地标记上了。
Changing a Component Value更改元件值
Let’s change the value from C_Small to 4.7uF. Hover the mouse pointer over C_Small and press ‘v’ (for value change). Change C_Small in the Text field by typing 4.7uF. Then hit enter or click ‘OK’.
让我们将值从C_Small更改为4.7uF。 将鼠标指针悬停在C_Small上并按“v”(进行值更改)。 通过键入4.7uF更改文本字段中的C_Small。 然后按Enter键或单击“确定”。
Congrats! You’ve just wired up your first schematic component. Press ctrl+s to save your work.
恭喜! 您刚刚连接了第一个原理图的元件。 按ctrl + s保存您的工作。
Annotate Schematic Components原理图元件标注
But what about the C? designator?! Don’t worry about it! One of the many benefits of KiCad is the ability to auto-annotate a schematic.
但那C?标志呢? 别担心! KiCad的众多优点之一是能够自动注释原理图。
Click on the Annotate schematic components button.
单击Annotate schematic components按钮。
Use the default settings and simply click on Annotate button to confirm.
使用默认设置,只需单击“Annotate”按钮进行确认。
KiCad confirming annotation
KiCad确认标注
KiCad will ask you if you’re sure, simply press return or click ‘OK’ again.
KiCad会询问您是否确定,只需按回车键或再次点击“OK”即可。
Capacitor with correct value and designator! We are all set. Time to edit the PCB.
电容器具有正确的值和标注! 我们都准备好了。 是时候编辑PCB了。
Editing a PCB Layout编辑PCB布局
Before we start editing the PCB, here are the keyboard shortcuts in KiCad’s Pcbnew that we will be using frequently in this tutorial:
- + – Press to switch next layer.
- – – Press to switch to previous layer.
- m – Move item.
- b – Update ground polygon pours.
- Delete – Remove a trace or component.
- x – Route new track.
- v – Add through via.
- n – Next grid size. Use with caution. There will be tears if you use a grid outside of 50mils or 25 mils.
- Page Up – Return to the top copper layer.
- Esc – Escape mode or whatever command in progress and return to normal pointer mode.
- ctrl+z – Undo. Use liberally to undo any mistakes.
- ctrl+s – To save. Make sure to save often!
在我们开始编辑PCB之前,先罗列在本教程中经常使用的KiCad Pcbnew中的键盘快捷键:
- + – 按下切换下一层。
- – – 按下切换到上一层。
- m – 移动项目。
- b – 更新接地多边形覆铜区域。
- Delete – 删除迹线或元件。
- x – 添加新迹线.
- v – 添加过孔.
- n – 下一种网格大小。 谨慎使用。 如果你使用50密耳或25密耳以外的网格会有走线泪滴产生。
- Page Up – 返回顶部铜层。
- Esc – 退出转义模式或正在进行的任何命令并返回正常指针模式。
- ctrl+z – 撤消。 使用返回上一个状态来消除任何错误。
- ctrl+s – 保存。 一定要经常保存!
Generate Netlist生成网表
We’ve got our schematic, now let’s get the new 4.7uF cap placed on the board. From the schematic, click on the ‘Generate netlist’ button.
我们已经获得了原理图,现在让我们将新的4.7uF电容放在电路板上。 从原理图中,单击“Generate netlist”按钮。
You’ll see the following window:
您将看到以下窗口:
KiCad is powerful. And with this power, comes an overwhelming number of options. Lucky for us, we are just scrapping the surface so we don’t need to fiddle with any of these options. Simply press enter or click ‘Generate’ to confirm this screen. KiCad will ask you where you want to save the netlist as a *.net file with the default location being the project folder. Again, press enter or click ‘Save’ to confirm.
KiCad很强大。 基于这种强度功能,就有了大量的选项可供选择。 对我们来说幸运的是,我们只使用最基本的功能,所以我们不需要配置任何这些选项。 只需按Enter键或单击“Generate”即可完成此对话框。 KiCad会询问您要将网表保存为* .net文件的位置,默认位置为项目文件夹。 再次按enter键或单击“Save”进行确认。
Configuring Layer Colors配置图层颜色
Return to the main project window and double click the *.kicad_pcb file.
返回主项目窗口并双击* .kicad_pcb文件。
Welcome to PCB editing. Of all the differences between EAGLE and KiCad it was the look within PCB layout that threw me off the most. Under the View menu you will find three other views: Default, OpenGL, and Cairo. I prefer OpenGL. Lets switch Canvas to OpenGL for now.
欢迎来到PCB编辑。 在EAGLE和KiCad之间的所有差异中,PCB布局中的外观让我花了最多时间去摸索。 在“视图”菜单下,您将找到其他三个视图:Default,OpenGL和Cairo。 我更喜欢OpenGL。 让我们暂时将Canvas切换到OpenGL。
Your mouse wheel does what you expect: Zoom In/Out and Pan by Clicking.
您的鼠标滚轮如您习惯的思维:放大/缩小并通过单击进行平移。
I don’t like the layer colors! Ya, me either. To change the layer colors, on the right side menu use your mouse wheel to click on the green square next to B.Cu (bottom copper layer). I prefer the following layer colors:
你不喜欢这图层颜色! 对,我也是。 要更改图层颜色,请在右侧菜单中使用鼠标滚轮单击B.Cu旁边的绿色方块(底部铜层)。 我更喜欢以下图层颜色:
- Red 2 (Default) for F.Cu (Top Copper)
- Blue 4 for B.Cu (Bottom Copper)
- White for F.SilkS (Front Silk Screen)
- Yellow 3 for B.SilkS (Bottom Silk Screen)
- Gray 3 for Edge.Cuts (a.k.a board outline or dimensional layer in EAGLE)
- Gray 2 (Default) for F.CrtYd (Denotes the total board space required on the top layer for the component)
- Red 2 (Default) 表示 F.Cu (Top Copper顶层铜走线)
- Blue 4 表示 B.Cu (Bottom Copper底层铜走线)
- White 表示 F.SilkS (Front Silk Screen正面丝印)
- Yellow 3 表示 B.SilkS (Bottom Silk Screen底层丝印)
- Gray 3 表示 Edge.Cuts (如字面意思板子的外轮廓,就像Eagle中的dimensional层)
- Gray 2 (Default) 表示 F.CrtYd (表示顶层元件所需总空间)
Pressing ‘+’ and ‘-’ will switch between top and bottom copper layers. This is useful when you need to view a certain layer.
按“+”和“ – ”将在顶部和底部走线之间切换。 当您需要查看某个图层时,这非常有用。
It’s all cosmetic but these layer colors make it easier for me to see what’s going on.
这些都是表面上的,但这些层颜色让我更容易看到发生了什么。
Be sure to poke around the Render tab (next to the Layer tab), namely the Values and References check boxes.
请务必在“渲染”选项卡(“图层”选项卡旁边)中查看,即“值和参考”复选框。
I find the Values and References extremely distracting when turned on so I leave them OFF. Many designers live and die by these values, so use as needed.
我发现数值和参考在开启时非常分散注意力,所以我将它们关闭。 许多电路板设计者工作中严重依靠这些数值,死活离不开,因此按需决定开启还是关闭。
Adding a Footprint添加封装
Aren’t we here to add a 4.7uF cap to the board? Where is it? It’s nowhere, sorry.
我们不是要在电路板上添加4.7uF电容吗? 它在哪里? 没有
What’s going on? We failed to assign a footprint to the capacitor we added in the schematic. Remember, KiCad does not link schematic components to footprints the same way EAGLE does. We have to specifically connect a footprint to each schematic component that was added.
这是怎么回事? 我们未能为原理图中添加的电容分配封装。 请记住,KiCad不会像EAGLE那样将原理图组件链接到封装。 我们必须专门将封装连接到添加的每个原理图元件。
Navigate to back to schematic and click on the ‘Run CvPcb’ button to associate components and footprints:
导航回原理图并单击“Run CvPcb”按钮以关联元件和封装:
If this is the first time you’ve run CvPcb you’ll get this warning:
如果这是您第一次运行CvPcb,您将收到此警告:
Simply click through it.
只需点击它即可。
Depending on how many libraries you have installed, this may take up to 30 seconds. We will make this better later in the tutorial but for now, be patient.
根据您安装的库数量,这可能需要30秒。 我们将在本教程后面说明如何能运行得更快,但是现在,请耐心等待。
In the left column is all the footprint libraries that KiCad ships with. In the middle is the list of components in your schematic. On the right is any footprint that may work with the highlighted component in the middle. Your job is to double click on the footprint on the right that goes with the component in the middle.
在左栏中是KiCad附带的所有封装库。 中间是原理图中的元件列表。 右侧是可以与中间突出显示的元件一起使用的任何封装。 你的工作是双击右边的封装,中间的元件。
To make life easier click on the ‘View selected footprint’ button.
为了让一切操作更简单,请点击“View selected footprint”按钮。
Now you can preview the footprint as you click down the list in the right.
现在,您可以单击右侧列表时预览封装。
In Windows, I press and hold the Windows button and press the left arrow and release. This will lock the CvPcb window on one side. Then select and lock the Footprint Preview Window to the right. This allows us to flip through footprints in the left window while seeing the preview on the right.
在Windows中,我按住Windows按钮并按向左箭头并松开。 这将锁定一侧的CvPcb窗口。 然后选择并将“封装预览窗口”锁定到右侧。 这使我们可以在左侧窗口中翻阅脚印,同时在右侧看到预览。
Highlight C2 in the middle column. Then double click the Capacitors_SMD:C_0603 in the right column. C2 should now be assigned a footprint.
突出显示中间列中的C2。 然后双击右栏中的Capacitors_SMD:C_0603。 现在应该为C2选择封装。
Re-Generate Netlist重新生成网表
Close the CvPcb window and click ‘Save and Exit’. We need to re-export the Netlist. Remember how to do that? Click the ‘Generate netlist’ button again, press enter twice. Open to the PCB editor either from the schematic or from the project window.
关闭CvPcb窗口,然后单击“保存并退出”。 我们需要重新导出网表。 还记得怎么做吗? 再次单击“生成网表”按钮,按两次Enter键。 从原理图或项目窗口打开PCB编辑器。
Hey! It’s still missing! We changed things, so we need to import the netlist! Remember how? Click on the ‘Read netlist’ button and you should see this window:
嘿! 它仍然缺失! 我们改变了一些东西,所以我们需要导入网表! 记得怎么样? 点击“Read netlist”按钮,您会看到此窗口:
Click ‘Read Current Netlist’ and ‘YES’ to confirm. You can also hit enter twice. You should see the new capacitor near the board.
单击“Read Current Netlist”和“YES”进行确认。 您也可以按两次输入。 您应该在电路板附近看到新的电容。
This is a decoupling cap so let’s put it next to the 0.1uF cap that is already there. Start by hovering over the new cap and press ’m’ for move.
这是一个去耦电容,所以我们把它放在已经存在的0.1uF电容旁边。 首先将鼠标悬停在新电容上,然后按“m”移动。
Left click to place the capacitor. Now press ’m’ over the 0.1uF cap in the way by moving it to the left.
左键单击放置电容器。 现在按下“m”在0.1uF电容元件上,将其向左移动。
Press ‘b’ to update the GND polygon pours.
按’b’更新GND多边形覆铜。
We’ve got some traces to fix but this isn’t too bad. Hover over the bits of traces that you want to remove and press ‘Delete’. Let’s delete the trace and via that is under the capacitor’s +3v3 terminal. If your pointer is over multiple items (as shown in the image below with the cursor over both the trace and capacitor), KiCad will pop up a menu to clarify your selection. This is basically asking you to pick which one you want to operate on.
我们有一些修复的迹线,但这并不算太糟糕。 将鼠标悬停在要删除的迹线上,然后按“Delete”。 让我们删除电容器的+ 3v3端子下的走线和通孔。 如果您的指针位于多个项目上(如下图所示,光标位于迹线和电容上),KiCad将弹出一个菜单以确定您的选择。 这要求您选择要操作的对象。
If you ever run into a problem press ‘Esc’ to return to default pointer mode. If you ever delete something wrong press ‘ctrl+z’.
如果您遇到问题,请按“Esc”返回默认指针模式。 如果您删除了错误的内容,请按’ctrl + z’。
Once you’ve removed most of the offending traces, you can begin routing by pressing ‘x’.
删除大部分叠交的错误迹线后,您可以按“x”开始走线。
Single click on the pad that has the gray air-wire and drag it to the pad that it needs to connect to. Single click again to lock the wire in place. Press ‘b’ to update the polygons.
单击具有灰色鼠迹线的待连接焊盘并将其拖动到需要连接的焊盘。 再次单击以将导线锁定到位。 按’b’更新多边形。
In the image below, KiCad is trying to route this trace in an odd way. If we place the trace here it will create an acute angle which is generally bad (read up on “acid traps”). We want the trace to be a T intersection. We need to change the grid.
在下图中,KiCad试图以奇怪的方式走线。 如果我们在这里放置迹线,它将产生一个通常电气性能和工艺较差的锐角。 我们希望轨迹是T交点。 我们需要改变网格。
Well that’s annoying!
那太烦人了!
Press ‘n’ to go to the next grid size. I needed to hit ‘n’ only once to go to the 0.25mil grid to get this nice intersection, you may need to get to a finer grid. You can also find this in the menu options under “Grid: 0.0635mm (2.5mils).”
按’n’转到下一个网格大小。 我只需要点击’n’一次就可以到达0.25mil网格来获得这个漂亮的交叉点,你可能需要更精细的网格。 您也可以在“网格:0.0635毫米(2.5密耳)”下的菜单选项中找到它。
Nice T intersection!
不错的T交叉口!
In the image below, I am routing the GND air wires. This is not really needed because the polygon pour connects the two pads but it does illustrate how good the ‘magnetic’ routing assistance is in KiCad. It’s very quick and easy to go from pad to pad.
在下图中,我正在布置GND走线。 这不是真正需要的,因为多边形覆铜连接了两个焊盘,但它确实说明了KiCad中“磁性”布线辅助的好坏。 从焊盘到焊盘都非常快速给力。
We have two air-wires left. To get these we’ll need to place vias down to the bottom layer. Start by pressing ‘x’ and clicking on the start of the capacitor’s air wire for GND again.
我们还剩下两根走线。 为了完成这些走线,我们需要将过孔放到底层。 首先按“x”并再次点击电容灰色鼠迹线的起点再次接地。
Bring the trace out.
带出走线。
When you’ve reached open ground press ‘v’ to create a via. Single click to place the via and KiCad will automatically start routing on the bottom layer. Press ‘Esc’ to stop laying down traces; the polygon pour will take it from here. Pressing ‘Page Up’ will take you back to the top layer.
当你到达空地时,按’v’创建一个通道。 单击以放置通道,KiCad将自动开始在底层布线。 按’Esc‘停止产生走线; 多边形覆铜将从此处产生。 按“Page Up”将返回顶层。
One air wire left!
留下一根辅助鼠迹线!
To get this last air wire, you can try clicking on the GND pad of the 0.1uF cap but annoyingly KiCad won’t start routing?! Why?! It’s actually a good thing: the SDA trace is too close (overlapping actually) to the GND pad on the 0.1uF cap. By not letting you start routing KiCad is saying that trying to put a trace here would violate the DRC rules. What to do? Rip up the SCL and SDA lines to make some room.
要获得最后一根辅助鼠迹线,您可以尝试点击0.1uF电容的GND焊盘,但令人恼火的是KiCad不会开始布线?! 为什么?! 这实际上是一件好事:SDA走线与0.1uF电容上的GND焊盘相距太近(实际上重叠)。 不让你开始布线KiCad说,试图在这里设置跟踪会违反DRC规则。 该怎么办? 撤销SCL和SDA走线以腾出空间。
Aha! Much better. Press ‘x’, click on the capacitor’s GND terminal, bring the trace out, and press ‘v’ to drop a via in this area. Hit escape to stop routing (let the polygon take care of it). Finally, press ‘Page Up’ to return to the top layer view.
啊哈! 好多了。 按’x‘,单击电容器的GND端子,将走线移出,然后按’v’在此区域放置一个通孔。 点击转义以停止路由(让多边形处理它)。 最后,按“Page Up”返回顶层视图。
Use the ‘Delete’ and ‘x’ buttons to re-route the SDA and SCL lines to finish up this board. Then press ‘b’ to update the polygons. The board should look similar to the image below.
使用“Delete”和“x”按钮重新布线SDA和SCL线以完成此板。 然后按’b‘更新多边形覆铜。 该板应类似于下图。
Routed with no air wires!
路线没有辅助鼠迹线!
Congrats! We have finished routing the footprints. Now let’s run the DRC to see if we’re legal.
恭喜! 我们已经完成了器件引脚的布线。 现在让我们运行设计规则检查,看看我们是否符合。
How to Remove a Component’s Footprint from a PCB Layout
如何从PCB布局中删除元器件引脚占用的空间
Before we continue let’s go over the process for modifying or removing a component from a PCB layout. For example, let’s say that you wanted to remove an extra capacitor or resistor from a design. You would do all the regular steps:
在我们继续之前,让我们回顾一下从PCB布局修改或删除器件的过程。 例如,假设您想从设计中移除多余的电容器或电阻器。 你会做所有常规步骤:
- Delete device from the schematic.
- Export the netlist by clicking the generate netlist button.
- Import the netlist into PCB Layout by clicking on the read netlist button.
- 删除电路原理图中的器件。
- 按generate netlist按钮导出网表。
- 按read netlist按钮导出网表。
The difference is a few import settings:
不同的是一些导入设置要修改:
During the netlist import the default settings are to ‘Keep’ exchange footprint and to ‘Keep’ extra footprints.
在网表导入期间,默认设置是“Keep”交换引脚且“Keep”额外的引线。
Here, we need to change two things:
在这里,我们需要改变两件事:
- Exchange Footprint -> Change: This will allow footprints to change
- Extra Footprints -> Delete: This will remove any extra footprints that remain
- Exchange Footprint -> Change: 此项操作将允许引脚变更
- Extra Footprints -> Delete: 此项操作将去掉多余的引脚
You may also want to ‘Delete’ unconnected tracks to clean up any left over tracks from the component you removed.
您可能还想“Delete”未连接的迹线,以清除您删除的元件中的任何剩余迹线。
Running Design Rule Check运行设计规则检查
Click on the ladybug with the green check mark on it to open the Design Rule Check (DRC) window.
单击绿色瓢虫复选标记的图标,打开设计规则检查(DRC)窗口。
Let’s take a moment to talk trace width, trace spacing, and vias. In general, SparkFun designs boards with:
我们花点时间谈谈走线宽度,走线间距和过孔。 一般来说,SparkFun设计板具有:
- 10mil 走线宽度
- 10mil 走线间隔
- 20mil 过孔直径
We go smaller than this on many designs but if you’re designing your first PCB, do not design it with 4mil traces and 8mil vias. You shouldn’t need to go that small on your first board.
我们在许多设计上比这更小,但如果你正在设计你的第一块PCB,不要设计4mil走线和8mil过孔。 初学者在未熟悉操作和工艺要求时采用更精细的设计容易出错。
Why design in 10mil trace/space when a fab house allows 8mil or smaller for the same price?
当制造商允许8mil或更小的尺寸单价格相同,为什么在设计中使用10mil的走线/间隔?
Making PCBs is tricky and for each increment of tolerance you remove you increase the chances that the PCB (proto or not) will be fabricated with an error. And those errors can be hard to identify. We design with 10mil trace/space in order to insure and reduce the probability that we’ll see PCBs with errors on the production floor. There’s nothing worse than troubleshooting a faulty product and asking yourself: “I’ve tried every rework and soldering trick in the book, is it the PCB that’s bad?”
PCB生产工艺繁复精密,每增加一个误差,就会增加PCB(原型或非原型)制造缺陷的可能性。 而这些缺陷很难确定。 我们设计了10mil的迹线/空间,以确保并降低我们在生产车间看到PCB问题的可能性。 没有什么比对故障产品进行故障排除更糟糕的事了。
That stated, we are seeing many PCB fab houses charge low prices for 7mil trace/space and 12mil vias. If you’ve got a complex board with tight layout challenges, it’s better use the smaller trace/space and vias. Save yourself the layout time and rely on the PCB fab house to correctly fabricate your board.
这就是说,我们看到许多PCB制造商的以低价格提供密度高于7mil走线/间隔和12mil过孔。 如果您的复杂电路板存在严峻的布局挑战,那么确实该使用较小的走线/间隔和过孔。 这可以节省布局时间,但需要确认PCB制造工厂的工艺水平和能力能达到要求。
We generally use the KiCad defaults of:
我们通常使用KiCad默认值:
- Clearance: By Netclass
- Min Track Width: 0.2mm = 0.0079mil
- Min Via Size: 0.4mm = 0.0157mil
Press enter again to run the DRC with the default settings.
再次按Enter键以使用默认设置运行DRC。
ErrType(): Via near track
ErrType()错误类型:通过近轨道
Aw shucks! What’s wrong with my board? The vias marked with red arrows are too close to the traces near by. The error message will show up in the window as an error indicating: “Via near track.” Fix them by ripping up (press ‘Delete’) any traces near the vias and re-route them (press ‘x’).
哎呀! 我的电路板有什么问题? 标有红色箭头的过孔太靠近附近的走线。 错误消息将在窗口中显示为错误,指示:“Via near track。”通过取消走线(按“Delete”)过孔附近的任何迹线并重新布线(按“x”)来修复它们。
After adjusting the traces causing the issues, re-run the DRC. These three flags should disappear.
在调整导致问题的迹线后,重新运行DRC。 这三个标志应该消失。
DRC markers have been cleared
DRC标记已被清除
Congrats! You’ve fixed those “Via near track” issues.
恭喜! 你修复了那些“Via near track”的问题。
ErrType(): Pad near pad
ErrType()错误类型:焊盘过于靠近
But wait, we are not done yet! There are still two DRC error arrows left with the error indicating: “Pad near pad”. KiCad is trying to tell us the pads on this solder jumper are too close together. SparkFun has used this footprint for years and is comfortable with the design so let’s change the Netclass clearance constraint.
但是等等,我们还没有完成! 仍然有两个DRC错误箭头,错误指示:“Pad near pad”。 KiCad试图告诉我们这个用于焊料跳线的焊盘太靠近了。 SparkFun已经使用了这个引脚间距多年,并且设计可以确保不会造成问题,所以让我们改变Netclass的间隔约束。
Open the DRC rules from the Design Rules menu.
从“设计规则”菜单中打开DRC规则。
Here is where you can create specific rules for specific traces and classes of traces. The problem that we are running into is the Default Clearance is 0.079mil (0.2mm). If we decrease this to 7mil (0.01778mm), click ‘OK’, and re-run the DRC…
您可以在此处为特定走线和走线间距创建特定规则。 我们遇到的问题是Default Clearance为0.079mil(0.2mm)。 如果我们将其降低到7mil(0.01778mm),请单击“OK”,然后重新运行DRC …
DRC errors resolved! Now reducing the DRC clearances in order to get your board to pass DRC is not an ideal solution. We want the pads on the solder jumper to be close enough to be easily jumpered with solder so increasing the distance between the pads on the footprint would be counterproductive. In general, you should set your DRC rules and stick to them.
DRC错误已解决! 现在减少DRC间隙以使您的电路板通过DRC并不是一个理想的解决方案。 我们希望焊料跳线上的焊盘足够接近,以便能够容易地用焊料跳线,因此增加焊盘上焊盘之间的距离会适得其反。 通常,您应该设置DRC规则并坚持使用它们。
Watch Your Airwires!
看你的辅助鼠迹线!
One last note about DRC: Leaving airwires on your PCB is a sure fire way to generate coasters (bad, unusable PCBs).
关于DRC的最后一个注意事项:在PCB上留下未走线的辅助鼠迹线是产生悲剧(错误的,坏的,无法使用的PCB)的必然原因之一。
From the DRC window there is a ‘List Unconnected’ button. This will show you the location of any unconnected traces (I had to rip up the SDA trace on the bottom right side of the PCB to show this error). It’s very important that you check for airwires before ordering your PCBs. As you progress through your layout, I recommend focusing on the ‘Unconnected’ count at the bottom of the screen (circled in pink). If you think you are done routing a board but still show a few unconnected wires that you can’t find, the DRC window will help you locate them.
在DRC窗口中有一个“List Unconnected”按钮。这将显示任何未连接迹线的位置(我必须取消PCB底部右侧的SDA迹线以显示此错误)。在订购PCB之前检查走线是非常重要的。当您逐步完成布局时,我建议您关注屏幕底部的“未连接”计数(以粉红色圈出)。如果您认为已完成布线板但仍显示一些您无法找到的未连接线路,则DRC窗口将帮助您找到它们。
Press ‘ctrl+s’ to save your work.
按’ctrl + s’保存您的工作。
Well done. You’ve made it through design rule checking! Now it’s time to order boards.
做得好。 你已经通过设计规则检查了! 现在是外发生产电路板的时候了。
Exporting Gerbers
导出Gerber文件
We added a component to the schematic, we modified the PCB layout, and we checked for errors. Now we are confident and ready to have our boards made! Time to export the gerber files.
我们在原理图中添加了一个元件,我们修改了PCB布局,并检查了错误。 现在我们有信心并准备好制作我们的电路板! 是时候导出gerber文件了。
Generate Drill and Gerber Files生成Drill和Gerber文件
Gerber files are the ‘artwork’ or the layers that the PCB fabrication house will use to construct the board. We’ve got a great tutorial on the different layers of a PCB so be sure to read up if all this is new to you.
Gerber文件是PCB制造商用于构建电路板的“图形”或层的数据。 我们在PCB的基础知识有一个很棒的教程,所以如果这些对你来说都是不熟悉的,请务必阅读。
Click on the ‘Plot’ button next to the printer icon in the top bar to open the ‘Plot’ window.
单击顶部栏中打印机图标旁边的“Plot”按钮,打开“Plot”窗口。
In general, there are 8x layers you need to have a PCB fabricated:
通常,制造PCB需要8x层:
- Top Copper (F.Cu)+ Soldermask (F.Mask) + Silkscreen (F.SilkS) 顶层铜走线+顶层阻焊+顶层丝印
- Bottom Copper (B.Cu) + Soldermask (B.Mask) + Silkscreen (B.SilkS)底层铜走线+底层阻焊+底层丝印
- Board outline (Edge.Cuts) 电路板外轮廓
- Drill file 钻孔文件
In the Plot window with the Plot format set for Gerber, be sure these Layers are checked:
在Plot窗口中为Gerber设置Plot格式,请确保选中这些图层:
- ☑ F.Cu
- ☑ B.Cu
- ☑ B.SilkS
- ☑ F.SilkS
- ☑ B.Mask
- ☑ F.Mask
- ☑ Edge.Cuts
Additionally, click on ‘Generate Drill File’ button. You can use the defaults here as well. More on the PTH vs. NPTH check box in a minute. For now just click ‘Drill File’ or press enter to generate the drill file.
此外,单击“Generate Drill File”按钮。 您也可以在此处使用默认值。 更多关于PTH与NPTH复选框的信息。 现在只需单击“Drill File”或按Enter键生成钻孔文件。
Click on ‘Close’ in the ‘Drill Files Generation’ window.
单击“Drill Files Generation”窗口中的“Close”。
Click ‘Plot’ to generate the gerber files for the layers and then click ‘Close’.
单击“Plot”以生成各层的gerber文件,然后单击“关闭”。
Time to Review Your Gerbers是时候复习你的Gerbers了
This is the last chance to catch any errors before paying real money. Reviewing the gerber layers often shows you potential errors or problems before you send them off to fab.
这是在支付真金白银前发现任何错误的最后机会。 在将它们发送到电路板制造商之前,检查gerber层通常能发现潜在的错误或问题。
Return to the main KiCad project window and open up GerbView by clicking on the button.
返回主KiCad项目窗口,单击按钮打开GerbView。
Once KiCad’s GerbView is open, click on File -> Load Gerber File. Select all the files shown and click Open.
一旦KiCad的GerbView打开,File -> Load Gerber File。 选择显示的所有文件并单击“Open”。
Next, click File -> Load EXCELLON Drill File. Load your drill files by selecting the all the drill files shown and click ‘Open’. They should be in the same directory.
接下来,单击File -> Load EXCELLON Drill File。 通过选择显示的所有钻取文件加载钻取文件,然后单击“Open”。 它们应该在同一目录中。
The layout looks very different but this is a good thing. You’ve been staring at your design for hours and it’s hard for your brain to see issues. I generally do not change the layer colors unless I have to. I want the gerber review to be jarring and different from my layout practices so that I’m more likely to catch issues.
布局看起来非常不同,但这是一件好事。 你已经盯着你的设计好几个小时,你的大脑很难看到问题。 除非必须,否则我通常不会更改图层颜色。 我希望gerber复查能发现和我设计意图不同的地方,这样我就更容易发现问题。
From this view, turn off all the layers but the Top Copper (layer 5). Additionally from the Render menu, turn off the Gridand DCodes. This will make the review less cluttered.
从该视图中,关闭所有层,但 Top Copper (layer 5)。 此外,从“Render”菜单中,关闭Grid和DCode。 这将使复查起来不那么混乱。
Now step through the different layers by toggling them on and off. You’re looking for irregularities and things that look out of place. Here are some things I look for:
现在通过打开和关闭它们来逐步完成不同的层。 你正在寻找不合理和看起来不正确的东西。 以下是我要重点关注的一些潜在问题:
- Do any traces have weird routing that could be improved?
- Do the vias line up with the top copper where they should?
- Does the top solder mask make sense with the SMD IC’s footprint?
- Are the via’s covered in soldermask (also called ‘tented vias’) or are they exposed?
- Does the top silkscreen look good? Make sense? Everything aligned the way I want it? Are pin 1 indicators clear?
- 有任何走线有奇怪的路径可以改善?
- 过孔是否与顶部铜走线对齐?
- 顶部阻焊层是否与SMD IC的占位与面积相关?
- 过孔盖油(也称为“接通过孔”)是否覆盖过孔或是否暴露在外?
- 顶层丝网印刷看起来正确吗? 合理吗? 一切都按我想要的方式调整? 针脚1指示灯是否清晰?
Now turn everything off and repeat for the bottom layers.
现在关闭所有内容并重复底层。
Did you catch it? There are a handful of things wrong with this example.
你懂了吗? 这个例子有一些问题。
- The bottom silkscreen is missing the GND indicator.
- The top GND silkscreen indicator is in italics.
- There are two drill files for some reason.
- 底部丝网缺少GND指示。
- 顶部GND丝网印刷标识以斜体显示。
- 出于某种原因,有两个钻取文件。
Leaving a silkscreen indicator off won’t break your board but it’s small defects like this that the gerber review is meant to catch.
没有丝网印刷标识不会破坏您的电路板,但这样的小缺陷是Gerber复查希望发现的。
Whoops! Bottom silkscreen for GND is missing!
哎呦! GND的底部丝网印刷缺失!
Homework:
家庭作业:
Take a moment and return to the PCB layout window to edit the make these corrections.
花一点时间返回到PCB布局窗口,编辑进行这些修正。
- Add the a silkscreen to the bottom layer for GND. To do this, select the bottom silk layer (B.SilkS) in Pcbnew. Click on Place -> Text, type “GND” in the Text: field, and click ‘OK’. You can also copy text on the bottom silkscreen layer by right clicking it, selecting Duplicate, and placing text next to the GND pad. Make sure to change text to GND by right clicking the text, selecting Properties, changing the text, and clicking ‘OK’.
- Change the top GND indicator so it’s not italics. To do this, edit the text properties and change the Style: to Normal.
- Plot new gerber files.
- Review your work in GerbView to verify the fixes.
- 将丝网添加到底层以获得GND。 为此,请在Pcbnew中选择底部丝印层(B.SilkS)。 单击Place -> Text,在Text:字段中键入“GND”,然后单击“OK”。 您还可以通过右键单击底部丝层复制文本,选择Duplicate,然后将文本放在GND焊盘旁边。 通过右键单击文本,选择“Properties”,更改文本,然后单击“OK”,确保将文本更改为GND。
- 更改顶层GND标识,使其不是斜体。 为此,请编辑文本属性并将Style:更改为Normal。
- 导出新的gerber文件。
- 查看您在GerbView中的工作以验证修复情况。
Now, we need to deal with the two drill files.
现在,我们需要处理这两个钻取文件。
PTH vs NPTH
PTH和NPTH
When generating the drill file for this design two files where generated:
为此设计生成钻取文件时,生成两个文件:
- *.drl – The standard EXCELLON drill file you need to send to PCB fab house.
- *-NPTH.drl – The non-plated through hole drill file.
- *.drl – 您需要发送到PCB fab house的标准EXCELLON钻孔文件。
- *-NPTH.drl – 非电镀通孔钻孔文件。
Non-plated through holes are holes on your PCB that do not have copper covering the vertical walls of the hole. This is sometimes required for advanced designs where thorough electrical isolation is needed. However, it is rare. While plated through holes (PTH) are common and cheap, NPTH requires an extra step in the PCB fabrication process and will often cost extra.
非镀通孔是PCB上的孔,没有铜覆盖孔的垂直壁。 对于需要彻底电气隔离的高级设计,有时需要这样做。 但是,这种情况很少见。 虽然镀通孔(PTH)很常见且价格便宜,但NPTH需要在PCB制造过程中额外增加一步,并且通常需要额外费用。
We don’t need NPTH for this design, so what happened? The ‘STAND-OFF’ footprint (i.e. used for the drill holes top of the board for mounting holes) was imported from the SparkFun Eagle library and KiCad seems to think it is a non-plated hole for some reason.
我们这个设计不需要NPTH,那么发生了什么? ‘STAND-OFF’占地面积(即用于安装孔的钻孔顶部)是从SparkFun Eagle库导入的,KiCad似乎认为它是出于某种原因的非镀层孔。
To correct this go back to the PCB layout, click on the Plotter, click ‘Generate Drill File’ and select the box that says ‘Merge PTH and NPTH holes into one file’. In a later section, we’ll go over how to edit the ‘STAND-OFF’ footprint to use a regular PTH hole.
要更正这一点,请返回PCB布局,单击绘图仪,单击“Generate Drill File”,然后选择“Merge PTH and NPTH holes into one file”框。 在后面的部分中,我们将讨论如何编辑’STAND-OFF’引脚以使用常规PTH孔。
Solder Paste Stencils焊锡膏钢网模板
Are you doing SMD reflow? Need to order a stencil to apply the solder paste to your board? Turn on F.Paste in the Plot window to generate the top paste layer.
你在做SMD回流焊吗? 需要订购钢网模板才能将焊膏涂在电路板上? 在Plot窗口中打开F.Paste以生成顶部焊锡膏钢网印刷层。
This *.gtp file is sent to a stencil fabricator to create the stainless steel or mylar solder paste stencil. If you’re unfamiliar with stenciling solder paste we have a fabulous tutorial.
此* .gtp文件被发送到模板制造商,以创建不锈钢或聚酯薄膜焊膏钢网。 如果您不熟悉模板焊膏,我们有一个很棒的教程。
We use OSHStencils for our proto stencils. The top paste layer is not needed to fabricate a PCB.
我们将OSHStencils用于我们的原型模板。 制造PCB不需要顶部焊膏层。
Order Your Board!下单订购你的电路板!
If you’re happy with your layout, let’s order some PCBs! Every fab house understand and works with gerber files, so navigate to the directory on your computer where your KiCad project resides.
如果您对电路图布局感到满意,那就让我们订购一些PCB吧! 每个工厂都了解并使用gerber文件,因此请进入到计算机上KiCad项目所在的路径。
Select and zip the following 8x files:
选择并压缩以下8x文件:
- *.drl – Drill file
- *.gbl – Gerber Bottom Layer
- *.gbs – Gerber Bottom Soldermask
- *.gbo – Gerber Bottom Silkscreen (Overlay)
- *.Edge.Cuts.gm1 – Board Outline (Gerber Mechanical 1)
- *.gtl – Gerber Top Layer
- *.gts – Gerber Top Soldermask
- *.gto – Gerber Top Silkscreen (Overlay)
- *.drl – 钻孔文件
- *.gbl – Gerber底层铜走线
- *.gbs – Gerber底层阻焊层
- *.gbo – Gerber底层丝印层
- *.Edge.Cuts.gm1 – 电路板轮廓层
- *.gtl – Gerber顶层铜走线
- *.gts – Gerber顶层阻焊层
- *.gto – Gerber顶层丝印层
You could zip all the files in the directory and send them off to your fab house but I don’t recommend it. There are a tremendous number of PCB layout software packages generating all sorts of different file names and formats. It’s often difficult to tell if *.cmp is a gerber file or something else. Does the customer care about the *.gtp file or is that just extra? It’s better to give the fab house only what you want fabricated.
您可以压缩目录中的所有文件并将它们发送到您的工厂,但我不推荐它。 有大量的PCB布局软件包生成各种不同的文件名和格式。 通常很难判断* .cmp是否是一个gerber文件或其他东西。 客户是否关心* .gtp文件或仅仅是额外的? 最好只为工厂提供你想要的东西。
The final step? Order your boards! The gerbers are the universal way to communicate with a PCB vendor. There are hundreds if not thousands of PCB vendors out there. Shop around!
最后一步? 订购你的电路板gerber文件是与PCB供应商沟通的通用方式。 网上有数百家,甚至数千家PCB供应商。 到处逛逛看!
In addition to your gerbers, you’ll need to specify via email or the PCB vendor’s website various elements of the PCB:
除了你的gerbers,你还需要通过电子邮件或PCB供应商的网站指定PCB的各种参数:
- What thickness PCB? 1.6mm is standard but 0.8mm is just as rigid and may help with 50 ohm trace impedance matching.
- What color soldermask? Green is default but red looks awesome.
- What color silkscreen? White is most common but other colors are available.
- How many layers? This example is a 2x layer board meaning there is just a top copper and bottom copper. However, some designs need to have 4x, 10x, and even 16x layers to route the board. Additional layers increase the cost significantly.
- PCB的厚度? 1.6mm是标准配置,但0.8mm也是可以的,并且可能有助于50欧姆的走线阻抗匹配。
- 阻焊层颜色? 绿色是默认的,但红色看起来很棒。
- 丝印颜色? 白色最常见,其它可选,需与阻焊层颜色有较大区分才能显得清晰。
- 电路板层数? 这个例子是一个2x层板,意味着只有顶部铜和底部铜。 但是,有些设计需要4x,10x甚至16x层来布线电路板。 附加层显著地增加了成本,对供应商的制造能力也提出了更高的要求。
The Soldermask Looks Big
阻焊层看起来很大
If you had a look at the soldermask on this PCB and wondered why it looked odd, you’re not alone. Let’s compare the PCB’s soldermask for KiCad (as shown in green) and Eagle (as shown in pink). You should notice two things:
如果你看一下这块PCB上的焊接层并想知道为什么它看起来很奇怪,不止你这么觉得。 让我们比较用于KiCad(如绿色所示)和Eagle(如粉红色所示)的PCB焊接层。 你应该注意两件事:
- In the KiCad design, I have a pad on the main sensor that looks like it’s slightly mis-placed. Pad 1 doesn’t line up with the other pads. Weird. It’s a problem that needs to be fixed, but the error won’t kill the board.
- More importantly, the soldermask on the Eagle design has gaps between the pins on the connector and the sensor IC. This will help reduce solder bridging between pins. In the KiCad version, the mask apertures look too big.
- 在KiCad设计中,我在主传感器上有一个焊盘,看起来有点错位。 焊盘1不与其他焊盘对齐。 奇怪的。 这是一个需要修复的问题,但错误不会导致失败。
- 更重要的是,Eagle设计上的阻焊层在连接器上的引脚和传感器IC之间存在间隙。 这将有助于减少引脚之间的连锡。 在KiCad版本中,阻焊区看起来太大了。
KiCad Soldermask
KiCad的阻焊
Eagle Soldermask
Eagle 的阻焊
In the image below, we can see the SMD Qwiic connector within Eagle. The default soldermask clearance is 0.1mm per side in Eagle.
在下图中,我们可以看到Eagle中的SMD Qwiic连接器。 Eagle的默认焊接掩模间隙为每边0.1mm。
In KiCad’s Pcbnew, open the ZOPT220x Breakout and click on Dimensions -> Pads Mask Clearance. KiCad’s solder mask clearance has a default of 0.2mm per side. We recommend you change this value to 0.1mm. Most fab houses will use 0.1mm as their default as well. You will then need to re-export your gerbers and load them back into GerbView.
在KiCad的Pcbnew中,打开ZOPT220x Breakout并点击Dimensions – > Pads Mask Clearance。 KiCad的阻焊区间隙默认为每边0.2mm。 我们建议您将此值更改为0.1毫米。 大多数电路板制造商也将使用0.1mm作为默认值。 然后,您需要重新导出Gerber并将其加载回GerbView。
Making the clearance smaller than 0.1mm will cause difficulties for the fab house to get the registration correct.
使间隙小于0.1mm将导致电路板制造商难以定位。
Creating a Custom KiCad Footprint Library创建自定义KiCad封装库
This section will show you how to create your own local custom footprints so that you can use them and connect them to schematic components using CvPcb. We’re going to assume you’ve already been through the previous sections of this tutorial; you should have KiCad downloaded and installed.
本节将向您展示如何创建自定义封装,以便您可以使用它们并使用CvPcb将它们连接到原理图元件。 我们假设您已经完成了本教程的前几部分; 你应该下载并安装KiCad。
Open KiCad’s project manager and then click on the PCB footprint editor button.
打开KiCad的项目管理,然后单击PCB footprint editor按钮。
You may get the warning. That’s ok, just click through it. This is KiCad’s way of telling you it’s going to create the default table of libraries that link to KiCad’s extensive GitHub repos.
你可能会得到警告。 没关系,只需点击它即可。 这是KiCad告诉你它将创建链接到KiCad广泛的GitHub上默认存储。
Click Preferences -> Footprint Libraries Manager. This will open the list of all the footprint libraries now accessible to you.
单击Preferences -> Footprint Libraries Manager。 这将打开您现在可以访问的所有封装库的列表。
This is a tremendous list of libraries! Click ‘OK’ to close the manager.
这是一个巨大的元件库! 单击“OK”关闭管理窗口。
Let’s poke around these libraries. Click on ‘Load footprint from library’ button and then ‘Select by Browser’. This is a handy tool for perusing the available footprints.
让我们来看看这些库。 单击“Load footprint from library”按钮,然后单击“Select by Browser”。 这是一个用于细读可用封装的便利工具。
Navigate to the LEDs -> LED_CREE-XHP50_12V footprint. Here is an example footprint in LEDs library. Double click on this footprint to open it up in the editor.
导航至LEDs -> LED_CREE-XHP50_12V封装。 以下是LED库中的示例封装。 双击此封装可在编辑器中将其打开。
Note the title bar of the editor window has changed. The active library is now LEDs and it is read only. Obviously KiCad wants to control their libraries; not just anyone can save to their repos. If we want to edit this footprint we need our own local copy.
请注意编辑器窗口的标题栏已更改。 活动库现在是LED,它是只读的。 显然KiCad想控制他们的封装库; 不只是任何人都可以保存修改到他们的线上库。 如果我们想要编辑这个封装,我们需要在本地创建副本。
Let’s create a local directory to keep all our local footprints. For this tutorial, please create a local folder called ‘C:\KiCadLibs\’ (or your platform’s equivalent).
让我们创建一个本地目录来保留我们所有的本地封装。 在本教程中,请创建一个名为“C:\ KiCadLibs”的本地文件夹(或您的平台等效文件夹)。
Now click on File->Save Footprint in New Library.
现在单击New Library中的File-> Save Footprint。
I recommend using different directory names for different sets of footprints (resistors, connectors, LEDs, etc). Select the ‘KiCadLibs’ folder that was created and then type ‘\LEDs’. KiCad will create the new ‘LEDs.pretty’ directory with a file ‘C:\KiCadLibs\LEDs.pretty\LED_CREE-XHP50_12V.kicad_mod’. And we’re off to the races. Except, not quite yet.
我建议为不同的封装组(电阻器,连接器,LED等)使用不同的目录名称。 选择已创建的“KiCadLibs”文件夹,然后键入“\ LEDs”。 KiCad将使用文件‘C:\ KiCadLibs \ LEDs.pretty \ LED_CREE-XHP50_12V.kicad_mod’创建新的’LEDs.pretty’目录。 而我们正在参加比赛。 除了,还没有。
Notice the title bar in the Footprint Editor still states the active library is LEDs and is read only. We need to switch the active directory to our local folder. I’m going to head you off: File->Set Active Directory doesn’t work as it only gives you the list of libraries that KiCad ships with. Oh KiCad!
请注意,“封装编辑器”中的标题栏仍指出活动库是LED并且是只读的。 我们需要将活动目录切换到本地文件夹。 我要告诉你:File->Set Active Directory 不起作用,因为它只提供了KiCad附带的库列表。
Before we can set our new footprint directory as active, we need to make KiCad aware of it. Re-open the Preferences -> Footprint Libraries Manager.
在我们将新的封装路径设置为活动之前,我们需要让KiCad知道它。 重新打开Preferences -> Footprint Libraries Manager。
Click on the ‘Append with Wizard’ button. You’ll be asked to locate the directory you want to add. In this case, we want to add the ‘Files on my computer’. Click on the ‘Next >’ button, select the directory we created (i.e. ‘C:\KiCadLibs\LEDs.pretty’. Click on ‘Next >’ a few times. When prompted ‘Where do you wish the new libraries to be added’, select ‘To Global library configuration (visible to all projects)’ and click ‘Finish’.
单击“Append with Wizard”按钮。 系统会要求您找到要添加的目录。 在这种情况下,我们要添加“我的计算机上的文件”。 单击“Next>”按钮,选择我们创建的目录(即’C:\KiCadLibs\LEDs.pretty‘。点击’下一步>’几次。出现提示’你希望在哪里添加新库 ‘,选择’To Global library configuration(对所有项目都可见)’并单击’Finish‘。
KiCad may throw an error because the ‘LEDs’ nickname is used twice. I renamed mine to ‘LEDs-Custom’ then click on ‘OK’ to close out the Footprint Libraries Manager.
KiCad可能会抛出错误,因为“LED”昵称被使用了两次。 我将我的名字重命名为’LEDs-Custom‘,然后点击’OK‘关闭Footprint Libraries Manager。
If you inspect the Footprint Editor tool bar again, you’ll see the LEDs library is still active and read only. Now we can click on ‘File->Set Active Library’. Here is where KiCad shines – the Filter works well. Type LED and select the LEDs-Custom library.
如果再次检查“封装编辑器”工具栏,您将看到LED库仍处于活动状态且只读。 现在我们可以点击’File->Set Active Library‘。 这是KiCad的一大亮点 – 过滤器效果很好。 键入LED并选择LED-Custom库。
At last! We have an active local library. Now when you click ‘Save footprint in local library’ or press ‘ctrl+s’ KiCad will prompt you with a Save Footprint window with Name (annoyingly every time). Press enter and your modifications will be saved.
最后! 我们有一个激活的本地库。 现在,当您单击“在本地库中保存足迹”或按“ctrl + s”时,KiCad将提示您使用名称保存封装窗口(每次都很烦人)。 按enter键,您的修改将被保存。
Now you can explore creating and editing footprints using the Footprint Editor.
现在,您可以使用“封装编辑器”探索创建和编辑引脚封装。
After you’ve created your first footprint or two be sure to read KiCad’s KiCad Library Conventions (KLC). It’s a well documented system for creating community share-able footprints. Left to our own devices we will all create things a little differently; the KLC tries to get us all on the same page and SparkFun follows it.
在您创建了第一个或第二个封装之后,请务必阅读KiCad的KiCad库约定(KLC)。 它是一个记录良好的系统,用于创建社区可共享的封装。 留给我们自己的设备,我们都会创造一些不同的东西; KLC试图让我们所有人都遵循同一标准,SparkFun也会遵循。
In the future, if you’re creating a lot of footprints consider using git repo to manage the changes. At SparkFun, we use the following structure:
将来,如果您要创建大量封装,请考虑使用git repo来管理更改。 在SparkFun,我们使用以下结构:
- \SparkFun-KiCad-Libraries – A git repo directory containing all KiCad schematic component files (*.lib)
- \SparkFun-KiCad-Libraries\Footprints – Contains directories of footprints
- \SparkFun-KiCad-Libraries\Footprints\LEDs.pretty – Directory containing all the LED footprints (*.kicad_mod)
- \SparkFun-KiCad-Libraries\Footprints\Sensors.pretty – Directory containing all the sensor footprints (*.kicad_mod)
- etc.
- \SparkFun-KiCad-Libraries – 包含所有KiCad原理图元件文件(* .lib)的git repo目录
- \SparkFun-KiCad-Libraries\Footprints – 包含封装目录
- \SparkFun-KiCad-Libraries\Footprints\LEDs.pretty – 包含所有LED封装的目录(* .kicad_mod)
- \SparkFun-KiCad-Libraries\Footprints\Sensors.pretty – 包含所有传感器封装的目录(* .kicad_mod)
- 以此类推…
By using a git repo, SparkFun engineers and our users can contribute schematic components and footprints.
通过使用git repo,SparkFun工程师和我们的用户可以提供原理图元件和封装。
Paring Down the KiCad Libraries削减KiCad库
When opening CvPcb to assign footprints to the schematic components, it can take a very long time to load. This is because KiCad is pinging all the KiCad github repos and pulling down 93 libraries. To make this faster, we recommend removing the libraries that are either deprecated or libraries that you will never use.
打开CvPcb以将封装分配给原理图元件时,可能需要很长时间才能加载。 这是因为KiCad正在检索所有KiCad github repos并拆除93个库。 为了加快速度,我们建议您删除不推荐使用的库或永远不会使用的库。
It’s quick and easy to remove a library: select a row in the Footprint Libraries Manager and click the ‘Remove Library’ button. If something goes wrong, don’t panic! Simply click ‘Cancel’ in the manager window and the library manager will close without saving changes. If things go really wrong, you can always delete the ‘fp-lib-table’ file and restart KiCad. This will cause it to create the footprint table with the KiCad defaults.
删除库快速简便:在Footprint Libraries Manager中选择一行,然后单击“Remove Library”按钮。 如果出现问题,请不要惊慌! 只需在管理器窗口中单击“取消”,库管理器将关闭而不保存更改。 如果出现问题,您可以随时删除’fp-lib-table’文件并重启KiCad。 这将导致它使用KiCad默认值创建封装表。
The footprint libraries table file (on Windows 10) is located in your AppData. It should look similar to: ‘C:\Users\Nathan\AppData\Roaming\kicad\fp-lib-table’ .
封装库文件(在Windows 10上)位于AppData中。 它应该类似于:’C:\ Users \ Nathan \ AppData \ Roaming \ kicad \ fp-lib-table‘。
The contents of ‘fp-lib-table’
‘fp-lib-table’的内容
Removing the deprecated libraries brings the default count down to 75 and CvPcb still takes an annoyingly long time to load. This is where you’ll have to make some tough decisions. Do you plan to ever need the ‘Shielding-Cabinets’ library? Perhaps. Perhaps not. If I ever do need an RF shield for a design, it will most likely be a custom part or a part that is notin the library. So that one gets the toss.
删除已弃用的库会将默认数降低到75,并且CvPcb仍然需要花费很长时间才能加载。 这是你必须做出一些艰难决定的地方。 你打算永远需要’Shielding-Cabinets’库吗? 也许是,也许不是。
SparkFun is taking a blended approach. We’re becoming very familiar with the default KiCad libraries and using their footprints wherever it makes sense. When we find or use a package we like, we copy it over to the SparkFun-KiCad-Libraries GitHub repo. At the same time, we’re continuing to leverage all our custom Eagle footprints that we’ve been using and creating for over a decade. We know and trust these footprints. I have had many PCBs ruined because I trusted someone else’s footprint so I tend to be very paranoid. Use the community where you can but be very rigorous about checking them for correctness.
SparkFun采用混合方式。 我们对默认的KiCad库非常熟悉,并在任何有意义的地方使用它们的封装。 当我们找到或使用我们喜欢的软件包时,我们将其复制到SparkFun-KiCad-Libraries GitHub repo。 与此同时,我们将继续利用我们十多年来一直使用和创造的所有定制Eagle封装。 我们了解并信任这些封装。 我已经损坏了许多PCB,因为我相信别人的封装,所以我往往非常偏执。 尽可能使用社区,但要非常严格地检查它们的正确性。
If you’re needing a generic 2×5 pin male header, check the KiCad libraries. It should work fine. However, if you’re using a more eclectic part, you may be better off creating the footprint from scratch. Even if the KiCad libraries contain the part, you’ll want to check it against the datasheet very closely and do a one to one test print.
如果您需要通用的2×5针公头,请检查KiCad库。 它应该工作正常。 但是,如果您使用的是更特殊的元件,那么最好从头开始创建封装。 即使KiCad库包含该部件,您也需要非常仔细地检查数据表并进行一对一的打印测试。
Using Eagle Footprints in KiCad
在KiCad中使用Eagle Footprints
If you’re familiar with Eagle, it can be scary to think all the time spent creating footprints will be lost when switching to KiCad. Don’t fear! KiCad inherently reads Eagle footprints! Yep, it’s built right in. Now don’t get too excited. KiCad can’t read your Eagle schematic components but we have a solution for that in a later section.
如果您熟悉Eagle,那么在切换到KiCad时,可能会觉得创建的所花费时间封装都会浪费。 别怕! KiCad可以可靠继承地读取Eagle的封装! 是的,它是内置的。先别太兴奋。 KiCad无法读取您的Eagle原理图元件,但我们在后面的部分中提供了解决方案。
The approach we are taking at SparkFun is to link to a local copy of all our classic Eagle Librarie Anytime we need one of the Eagle footprints, we copy and paste it into a modern KiCad library. We don’t have to re-create the footprint but by moving it over to a KiCad library. We are able to then edit the footprint as needed. Furthermore, any new footprints are created from scratch and saved to the appropriate SparkFun KiCad library.
我们在SparkFun采用的方法是链接到我们所有经典Eagle Librarie的本地副本。任何时候我们需要一个Eagle封装,我们将其复制并粘贴到现代的KiCad库中。 我们不必重新创建封装,而是将其移动到KiCad库。 然后我们可以根据需要编辑封装。 此外,任何新的封装都是从头开始创建的,并保存到相应的SparkFun KiCad库中。
You should have already opened the PCB Footprint Editor at least once by now. This will have created a ‘fp-lib-table’ file that we will be editing shortly. Now to get started, be sure that KiCad is closed.
您应该至少已经打开了PCB封装编辑器一次。 这将创建一个我们将很快编辑的’fp-lib-table’文件。 现在开始,确保KiCad关闭。
Download the SparkFun Eagle Libraries from GitHub.
从GitHub下载SparkFun Eagle Libraries。
SPARKFUN EAGLE LIBRARY GITHUB REPOSITORY
Unzip them into a local directory of your choice. I store our Eagle libraries in a DropBox folder so both my desktop and laptop can access the same set of files.
将它们解压缩到您选择的本地路径中。 我将Eagle库存储在DropBox文件夹中,因此桌面和笔记本电脑都可以访问同一组文件。
You could use the Footprint Libraries Manager located in the footprint editor but adding or removing many libraries becomes tedious; it’s easier to edit the table file directly.
您可以使用封装编辑器中的封装库管理器,但添加或删除许多库变得乏味; 直接编辑表文件更容易。
The contents of fp-lib-table
p-lib-table的内容
The ‘fp-lib-table’ tells KiCad where to find all the various libraries and what types of libraries they are (KiCad, github, EAGLE, etc).
‘fp-lib-table’告诉KiCad在哪里可以找到所有各种库以及它们是什么类型的库(KiCad,github,EAGLE等)。
We are going to edit this file to add in the SparkFun libraries as well as remove the deprecated libraries and libraries that SparkFun doesn’t use.
我们将编辑此文件以添加到SparkFun库中,以及删除SparkFun不使用的已弃用的库和库。
Here are the files of importance:
以下是重要文件:
- original fp-lib-table – This is what KiCad creates by default. You don’t really need to download it. It’s just for reference.
- sparkfun fp-lib-table – The list of SparkFun libraries. You don’t need to download it, just for reference.
- combined fp-lib-table – This is the combination of the original table, with extraneous libraries removed and SparkFun libraries added.
- original fp-lib-table – 这是KiCad默认创建的。 你无需下载。 仅供参考。
- sparkfun fp-lib-table – SparkFun库列表。 您无需下载,仅供参考。
- combined fp-lib-table – 这是原始表的组合,删除了无关的库并添加了SparkFun库。
Download the ‘combined fp-lib-table’ to a local folder. Rename it to ‘fp-lib-table’. Now move the file to where KiCad expects it. The footprint libraries table file (on Windows 10) is located in the AppData folder similar to: ‘C:\Users\Nathan\AppData\Roaming\kicad\fp-lib-table’. You’ll want to overwrite the file that is there.
将’combined fp-lib-table’下载到本地文件夹。 将其重命名为’fp-lib-table’。 现在将文件移动到KiCad指定的路径。 封装库表文件(在Windows 10上)位于AppData文件夹中,类似于:’C:\ Users \ Nathan \ AppData \ Roaming \ kicad \ fp-lib-table‘。 你会想要覆盖那里的文件。
Once the file is in place, re-open KiCad, open the PCB footprint editor, and finally the Footprint Libraries Manager. You should see a long list of libraries including the new SparkFun libraries.
注意:AppData是一个隐藏目录,因此您需要使隐藏文件夹可见。
文件到位后,重新打开KiCad,打开PCB封装编辑器,最后打开Footprint Libraries Manager。 您应该看到一长串库,包括新的SparkFun库。
The last step is to tell KiCad the local path to the SparkFun libraries. Currently it’s a variable called SFE_LOCAL. We need to assign this to something. Close the Library Manager window, click on Preferences -> Configuration Paths. Click the ‘Add’ button. Edit the Name and Path fields.
最后一步是告诉KiCad SparkFun库的本地路径。 目前它是一个名为SFE_LOCAL的变量。 我们需要将其分配给某些东西。 关闭Library Manager窗口,单击Preferences – > Configuration Paths。 单击“Add”按钮。 编辑名称和路径字段。
In the image below, you can see I’ve set the ‘SFE_LOCAL’ variable to a local path of ‘C:\Users\nathan.seidle\Dropbox\Projects\SparkFun-Eagle-Libraries\’. Set this variable to wherever you locally stored the SparkFun Eagle Libraries.
在下图中,您可以看到我已将’SFE_LOCAL‘变量设置为’C:\Users\nathan.seidle\Dropbox\Projects\SparkFun-Eagle-Libraries\‘的本地路径。 将此变量设置为本地存储SparkFun Eagle Libraries的位置。
Congratulations! You can now see, use, and copy all the SparkFun Eagle libraries.
恭喜! 您现在可以查看,使用和复制所有SparkFun Eagle库。
Creating Custom KiCad Schematic Components创建自定义KiCad原理图元件
Once you’ve learned to create your own schematic parts and custom footprints, you become unlimited by what technologies you can play with. Let’s get started!
一旦您学会了创建自己的原理图元件和自定义封装,您就可以通过您可以自由的使用该软件了。 让我们开始吧!
From the main project window start the Schematic library editor.
从主项目窗口启动Schematic库编辑器。
This process is similar to how we started a custom footprint library. First, let’s find a schematic symbol we want to start our custom library with. The photocell is just as common as it gets. Let’s pull in the ‘R_PHOTO’ schematic component from the device library and use it to start our new custom schematic component library.
此过程类似于我们启动自定义封装库的方式。 首先,让我们找一个我们想要启动自定义库的原理图符号。它就像光敏电阻一样普遍。 让我们从设备库中提取“R_PHOTO”原理图组件,并使用它来启动我们新的自定义原理图元件库。
Start by clicking on the ‘Selecting working library’ (i.e. book) icon located in the upper left corner. Then select ‘device’to set the working library.
首先单击位于左上角的“Selecting working library”(即书籍)图标。 然后选择“device”以设置工作库。
Click on the ‘Load component to edit from current library’ button and type r_photo in the filter to quickly locate the photoresistor component. When located, click ‘OK’.
单击“Load component to edit from current library”按钮并在过滤器中键入r_photo以快速定位光敏电阻元件。 找到后,单击“OK”。
Click on ‘Save current component to new library’ button
单击“Save current component to new library”按钮
I recommend you store this *.lib file in the same ‘C:\KiCadLibs\’ directory we stored the footprint library within. I called my lib file ‘CustomComponents.lib’ so that I know these are mine.
我建议你将这个* .lib文件存储在我们存储封装库的同一个’C:\ KiCadLibs \’目录中。 我调用了我的lib文件’CustomComponents.lib‘,以便我知道这些是我的。
Once you click ‘Save’, a warning will pop up. This is just KiCad’s polite way of letting you know that you can’t access your library until you link to it. So let’s do that.
单击“Save”后,将弹出警告。 这只是KiCad礼貌的方式,让您知道在链接到您的库之前无法访问您的库。 所以,让我们这样做。
Click on Preferences -> Component Libraries to view the current set of libraries. In the image below, we can see the stock schematic component libraries that ship with KiCad. Next to the ‘Component library files,’ click ‘Add’.
单击Preferences – > Component Libraries查看当前的库集。 在下图中,我们可以看到KiCad附带的库存原理图元件库。 在“Component library files”旁边,单击“Add”。
Navigate to your ‘C:\KiCadLibs’ directory and then open ‘CustomComponents.lib’. It should now appear at the bottom of the Component library files list. Click ‘OK’ to return to the library editor.
导航到“C:\KiCadLibs”目录,然后打开“CustomComponents.lib”。 它现在应该出现在元件库文件列表的底部。 单击“OK”返回库编辑器。
Again, click on the ‘Select working library’ button but this time either scroll to your custom list or type ‘Custom’ to find the ‘CustomComponents’ library. Click ‘OK’.
再次单击“Select working library”按钮,但这次要么滚动到自定义列表,要么键入“Custom”以查找“CustomComponents”库。点击“OK”。
Then click on ‘Load component to edit from the current library’ button and we should see only the photoresistor schematic component. Double click on R_PHOTO to begin editing it.
然后单击“Load component to edit from the current library”按钮,我们应该只看到光敏电阻原理图元件。 双击R_PHOTO开始编辑。
Now at this point, we can add new symbols from scratch to our library and we can also copy from one library to another.
现在,我们可以从头开始向我们的库添加新符号,我们也可以从一个库复制到另一个库。
How to Copy a Component to Your Custom KiCad Library如何将元件复制到自定义KiCad库
KiCad is always changing and they’ve made leaps and bounds improvements but copying a schematic component from one library to another is still a bit wild.
KiCad总是在变化,他们已经实现了跨越式的改进,但是将原理图元件从一个库复制到另一个库仍然有点疯狂。
For example, let’s copy the CP2104 from the silabs library into our custom library. Start by setting the active library to the one that contains the part you want to copy by clicking on the ‘Select working library’ button. In our example, we want to set silabs as the active library.
例如,让我们将CP2104从silabs库复制到我们的自定义库中。 首先将活动库设置为包含要复制的部分的库,方法是单击“Select working library”按钮。 在我们的示例中,我们希望将silabs设置为活动库。
Load the CP2104 component by clicking on the ‘Load component to edit from the current library’ button.
通过单击“Load component to edit from the current library”按钮加载CP2104元件。
Now set the active library to the library we want to copy the CP2104 into. For this example, that means that we need to click on the ‘Select working library’ button and set the active library to ‘CustomComponents’.
现在将活动库设置为我们要将CP2104复制到的库。 对于此示例,这意味着我们需要单击“Select working library”按钮并将活动库设置为“CustomComponents”。
Click on the ‘Update current component in current library’ button to save the component in CustomComponents.lib. The ‘Save current library to disk’ button will become enabled and you can save this component to your custom library.
单击“Update current component in current library”按钮,将元件保存在CustomComponents.lib中。 “Save current library to disk”按钮将变为启用状态,您可以将此元件保存到自定义库中。
To verify it’s now in the library click on the ‘Load component to edit from the current library’ button. You should see your new shiny CP2104 in the list.
要验证它现在在库中,请单击“Load component to edit from the current library”按钮。 您应该在列表中看到新的闪亮CP2104。
How to Delete a Component from Your Custom KiCad Library如何从自定义KiCad库中删除元件
Bad CP2104! Bad component.
错误的CP2104! 错误的元件。
To remove a component, be sure you’ve set your custom library as the active one. Let’s try removing the component that we just added in our custom library CustomComponents.lib. If you have not already, click on ‘Select working library’ to set the active library to CustomComponents. Click on the ‘Delete component in current library’ (i.e. the trash can) button. You’ll be prompted for which component you want to remove. Select CP2104 from the list.
要删除元件,请确保将自定义库设置为活动库。 让我们尝试删除我们刚刚在自定义库CustomComponents.lib中添加的组件。 如果您还没有,请单击“Select working library”以将活动库设置为CustomComponents。 单击“Delete component in current library”(即垃圾箱)按钮。 系统将提示您输入要删除的元件。 从列表中选择CP2104。
Click ‘OK’ and then ‘Yes’ to delete the component from the library. Click the ‘Current library to disk’ button and ‘Yes’ to save.
单击“OK”,然后单击“Yes”从库中删除组件。 单击“Current library to disk”按钮,然后单击“‘Yes”进行保存。
Shout out to Joan_Sparky! He is the best! (No relation)
向Joan_Sparky喊道! 他是最棒的! (没关系)
KiCad Library Convention
KiCad库的约定
Be sure to check KiCad’s KiCad Library Convention once you get comfortable creating components. These conventions take into account a heap of industry specialized knowledge that we can all benefit from.
一旦您熟悉元件,请务必查看KiCad的KiCad库的约定。 这些惯例考虑了我们都可以从中受益的一系列业界专业知识。
Resources and Going Further相关资料和更多详情
Congratulations! That was a big tutorial and you made it through.
恭喜! 这是一个很长的教程,你已经完成了它。
For more information related to KiCad, check out the resources below:
有关KiCad的更多信息,请查看以下资源:
- KiCad – Official KiCad page.
- Download KiCad – KiCad software download page for your operating system or distribution.
- KiCad Library Github Repo – The schematic and 3D libraries supported by KiCad team.
- Kicad Library Convention – Online document that outlines the requirements for contributing schematic-symbols and footprints to the official KiCad library repositories.
- Contextual Electronics KiCad YouTube Video Series
- Lachlan’s Eagle to KiCad Converter GitHub Repo – Eagle schematic/library to KiCad schematic/library ULP conversion script.
- ZOPT220x UV Sensor Breakout KiCad Files (ZIP) – Example KiCad Files used in this tutorial.
- SparkFun_SchematicComponents.lib – Library used to link components in in this tutorial for the ZOPT220x UV Sensor Breakout schematic.
- original fp-lib-table – This library is what KiCad creates by default.
- sparkfun fp-lib-table – The list of SparkFun libraries. You don’t need to download it, it’s just for reference.
- combined fp-lib-table– This is the combination of the original KiCad table, with extraneous libraries removed and SparkFun libraries added.
- SparkFun Eagle Library GitHub Repo – Classic SparkFun Eagle library.
- SparkFun KiCad Library GitHub Repo – SparkFun’s Eagle library ported to a Kicad library.
Now that you’ve learned how to modify schematics, PCB layouts, and libraries, it’s time to try out your skills on your own custom project. We recommend using the ZOPT220x UV Sensor Breakout KiCad files as the starting point for your next project. From this example project, you can delete or add devices as you need rather than starting from a blank canvas.
现在您已经学会了如何修改原理图,PCB布局和库,现在是时候在自己的自定义项目上尝试自己的技能了。 我们建议使用ZOPT220x UV Sensor Breakout KiCad文件作为下一个项目的起点。 在此示例项目中,您可以根据需要删除或添加元件,而不是从空白画布开始。
Also, check out SparkFun’s Enginursday blog post about KiCad.
另外,查看SparkFun的关于KiCad的Enginursday博客文章。
Enginursday: KiCad and Open-Source Design
Enginursday:KiCad和开源设计
Eagle to KiCad
Eagle到KiCad
If you are an EAGLE guru starting to get your feet wet with KiCad, be sure to checkout Lachlan’s Eagle to KiCad converter for converting your Eagle PCB layouts to KiCad. It’s not perfect but Lachlan has done a tremendous amount of groundwork.
如果你是一个EAGLE熟手开始尝试使用KiCad,请务必检查Lachlan的Eagle到KiCad转换器,将Eagle PCB布局转换为KiCad。 这并不完美,但拉克兰已经做了大量的基础工作。
Thanks for reading and if you have any comments or questions please ask them in the comments section.
感谢阅读,如果您有任何意见或问题,请在评论部分留下高见。
原始文章采用CC BY-SA 4.0,您可以自由地:
- 分享 — 在任何媒介以任何形式复制、发行本作品
- 演绎 — 修改、转换或以本作品为基础进行创作
- 在任何用途下,甚至商业目的。
- 只要你遵守许可协议条款,许可人就无法收回你的这些权利。
本文由翻译美国开源硬件厂商Sparkfun(火花快乐)的相关教程翻译,原始教程采用同样的CC BY-SA 4.0协议,为便于理解和方便读者学习使用,部分内容为适应国内使用场景稍有删改或整合,这些行为都是协议允许并鼓励的。
原始文章及相关素材链接:
https://learn.sparkfun.com/tutorials/beginners-guide-to-kicad/introduction