差别

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

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
第38节_创建一个库中没有的封装 [2022/04/09 22:05]
gongyusu
第38节_创建一个库中没有的封装 [2022/06/19 12:51] (当前版本)
gongyu
行 1: 行 1:
 ## 第38节:创建一个库中没有的元器件封装 ## 第38节:创建一个库中没有的元器件封装
-After creating a new schematic symbol, you may need to create a matching footprint. In this recipe, you will learn how to do this manually. For some types of footprints, ​KiCad has introduced a wizard that can accelerate the process. There is a separate recipe that covers that option. +[[kicad]] 
-As with creating a new symbol, to create a new custom footprint you will need some mechanical information from the real-world component’s datasheet. If you don’t have a datasheet, you can use a calliper to take measurements. I usually use both datasheet and calliper together. The datasheet gives me the mechanical values I need for the drawing of the component (width and height of the package, pins and their positions, pin attributes etc.), and then I use the calliper to confirm the dimension and distance values. +这一节我们看一下如何创建一个新的封装,如果在KiCad的库中找不到合适的封装,在网上也搜索不到,只能自己创建,创建封装有2种方式: 
-In recipe '​Creating a new component (symbol)'​ you created a custom symbol for the 555 integrated circuit. In this recipe, you will create a footprint for that symbol. +根据向导创建,适用于管脚比较多的封装比较标准的器件,比如BGA、QFN、QFP等 
-Creating footprints is a slightly more involved process than creating a symbol because we have to consider the physical characteristics of the device, and the manufacturing requirements. We have to think about how to place information about the footprint in the various physical and design layers that KiCad uses for this purpose. For example, information about the boundary of the footprint is placed in the courtyard layer, pads are placed in the copper layers (front and back), the outline of the footprint goes in the fabrication layer, and any artwork (text and graphics) goes to the silkscreen. In Figure 37.1 you can see the elements that make up a typical KiCad footprint, and the layers where those elements are placed. The footprint in Figure 37.1 is what you will work towards creating in this recipe, even though it already exists in a library that you can import.+手动创建,也可以基于现有的封装进行改动,改动的工作量还不如自己从头创建的,就自己从头创建,我们需要知道该器件的物理参数 ​比如封装的长、宽,每个管脚的位置及属性等,如果能联系生产厂商拿到该器件的规格书,可以按照规格书来设计,如果实在拿不到,就需要测量一下了。当然,最好是二者都做,确保自己对规格书上的参数理解是正确的,没有任何忽略的地方。
  
-To create the footprint in Figure 37.1, you will work through a process in which you place the elements in one layer. The real component for which you will design this footprint is shown in Figure 37.2. +在前面创建原理图符号的视频中我们以一个1.44寸LCD模块为例,在这节视频我们来看一下如何创建它的封装,首先从销售该模块的网站 - 淘宝的中景园网店上查看一下该模块的物理参数。
-Figure 37.2: You will create a footprint for this component, the NE555N timer integrated circuit. +
-The component in Figure 37.2 has a standard DIP package with 4 pins on each side. The data sheet is available from its manufacturer. From the datasheet, you will need the mechanical data illustration towards the end of the document. For your convenience,​ I have included this illustration in Figure 37.2.+
  
-You will create this footprint by following this process: +{{ :lcd144size.png |}} <WRAP centeralign>​1.44寸LCD屏幕的尺寸</​WRAP>​
-1In the front fabrication layer ('​F.Fab'​) you will draw the outline of the +
-footprint. The fabrication layers (front and back) are used by the +
-manufacturer. Their elements do not appear in the end result. +
-2. In the top and bottom copper layers, you will draw the pads. +
-3. In the front courtyard layer ('​F.CrtYd'​),​ you will draw the external +
-outline of the footprint. No other footprint will be allowed within this +
-outline. +
-4. In the front silkscreen layer ('​F.SilkS'​),​ you will add text and graphics, +
-such as the corners of the DIP package and the side where pin is +
-facing. +
-Let’s begin. From the main KiCad window, click on the Footprint Library Editor button (Figure 37.3).+
  
-The Footprint Editor window will appear. From the File menu, select 'New Footprint'​ (Figure 37.4). +创建封装比创建原理图符号要复杂一些,因为我们要考虑到器件的物理特性以及未来加工时的需求,我们需要考虑将器件相关的物理信息合理地放置在不同的物理层以及设计层,例如封装的边界信息要放在Courtyard层,焊盘放在铜层(前面层和后面层),封装的轮廓放置在加工层,其它的文字或图形信息放置在丝印层。
-Figure 37.4: Create a new Footprint. +
-The Editor will prompt for a name for the new footprint. Since we are creating a footprint for a DIP component with 8 pins and 7.62 mm width (including the pins), type in this name: '​DIP-8_W7.62mm_PD'​. I added my initials, to differentiate from other DIP-8 footprints that might be available in other libraries. Of course, use your own initials. Click on Ok to dismiss the dialog. The Editor will show an almost blank sheet. Its only content is two text blocks, one in the front fabrication area (the name of the footprint), and one in the front silkscreen area ('​REF**'​). +
-Front Fabrication layer ('​F.Fab'​) - Outline +
-Continue with the front fabrication layer. Select '​F.Fab'​ from the layers manager, and use the polygon tool to draw a rectangle in the dimensions of the DIP package. Those dimensions appear in the documentation. Working in millimetres,​ you should draw a rectangle that is 6.60 mm in width and 10.16 mm in length. You will need to adjust the grid to make it easier to achieve those dimensions, or at least as close to them as you can get. I set my grid to 0.1270 mm and I was able to create a rectangle with the exact 6.60 mm x 10.16 mm dimensions. Also, change the cursor shape so that the crosshairs extend to the edges of the sheet, and use the dx and dy values in the status line to know the length of each segment of the rectangle as you draw it. In Figure 37.5, the arrows point to the tools that you use and functions you should enable to draw the outline of the footprint. The exact point where you start drawing is not important.+
  
-Draw the first horizontal line of the outline to a length of 6.60 mm. In Figure 37.6 notice that the dx value is 6.60 mm. Click at that point, and continue with the first vertical line. +<WRAP centeralign>​最终LCD模块的封装</​WRAP>​
-Figure 37.6: The first line, at 6.60 mm, is complete. +
-Extend the vertical line to 10.16 mm. Use the crosshairs to help you create a perfect 90-degree angle between the two lines (Figure 37.7).+
  
-Complete the rectangle so that in the end you have something like the example in Figure 37.8. +在上图中我们可以看到一个构成一个典型的封装的主要元素,以及这些元素放置的相应的层。我们来看一下如何创建这样一个封装。
- ​Figure 37.8:The completed outline in the F.Fab layer. +
-Pads +
-Continue with the placement of the pads. As per the data sheet’s mechanical specifications,​ the pad centres must be 2.54 mm apart. The pin diameter is 0.25 mm, so the pad drill must be slightly larger than that. The specification doesn’t give us the exact offset of the pins from the body of the device, so we will have to use our judgement or a calliper. I used my calliper to find that the offset is around 1 mm. With this information,​ let's go ahead and place the pads. Keep the grid size to 0.127 mm since this works well with the 2.54 pad pitch we are working with. That is because 2.54 is a multiple of 0.127. +
-From the right toolbar, click on the pad tool ( ). Follow these steps: +
-1. Move the pad to the top left of the outline. +
-2. Align the crosshair centre exactly on the vertical line, around 1 +
-mm from the corner.+
  
-3. Press the space bar to zero the dx, dy and dist values of the status +步骤: 
-4. Move the pointer slightly to the left, to separate the pad from the outline. At dx at 0.63 mm, I think this distance is good. It is smaller than the 1 mm that I measured with my calliper, but since the device pins are flexible, I opt to a narrower rather than a wider footprint+  - 在前面的生产层(F.Fab),绘制这个封装的外形轮廓,这一层是给生产加工厂的,这一层的信息不会出现在最终的电路板上 
-5. Ensure that dx is still at 0.63 mm and click to commit the pad in place. After clicking your mouse, do not move it until you press the space bar again to reset dx and dy. This will allow you to measure the distance between this pad and the next. Don’t worry about the negative sign in the dx value, we are only interested in absolute values when we measure distances for the purposes of creating this new footprint. +  - 在顶层和底层的铜层,绘制焊盘 
-The result is similar to what you can see in Figure 37.9. +  - 在前面的Courtyard层(F.CrtYd)绘制封装的外围轮廓,在做PCB布局的时候不允许任何其它的器件出现在这个轮廓内 
-Figure 37.9: The first pad is in place. +  ​- 在前面的丝印层(F.Silks),添加文本和图形信息,比如管脚1的位置
-The pad tool is still enabled, and the second pad is attached to the cursor, waiting to be placed. Hopefully, you reset dx and dy as soon as you clicked to commit pad 1. If you didn’t, move the cursor over pad 1, and press the spacebar to reset the counters. Then, follow this process: +
-1. Move the mouse downwards making sure that dx is always zero. +
-2. Look at the dy counter, and stop moving the mouse when it reads +
-'2.54 mm'. +
-3. When dy becomes 2.54 mm, click your mouse to place pad 2 in position. +
-4. Press the space bar to reset dy to zero. +
-5. Repeat this process until you have all four pads on the left of the +
-footprint’s outline. +
- 390 +
-When you place pad 4 in position, you must move the mouse across to the other side of the outline. To ensure that pad 5 is exactly horizontal from pad 4, place your mouse pointer exactly over pad 4, and press the spacebar. Then move the mouse to the right, making sure that dy is always zero. Place pad 5 in position so that it is exactly 0.63 mm from the right vertical line and click to commit it in place. Your footprint should look like the example in Figure 37.10. +
-Continue to place pads 6, 7 and 8 in the same way. Eventually, your footprint will look like the example in Figure 37.11. +
-Figure 37.11: All footprints in place. +
-Before you continue work in the other layers, you should check that the footprint drills are appropriate for the pin size of the physical device. You should also change the pad type of pad 1 to rectangular instead of circular. This is due to a convention that holds that the first pin of an integrated circuit should be square to make it possible to identify the correct orientation of the +
-chip during assembly. We will do this now, but we will also add graphics in the silkscreen to reduce the risk of error in assembly. +
-To configure a pad, use the pad’s Properties window. Place your mouse cursor over the first pad, and type '​E'​. This will bring up the pad’s Properties window. As you can see in Figure 37.12, you should change the Pad shape to rectangular. You can also confirm that the hole size is 0.762 mm, which is sufficiently larger than the pin diameter, so there is no need to change this. You can also confirm that for this pad, copper will be poured in all copper layers. If you have a good reason for doing so (perhaps you are designing a single layer board that you want to etch at home?), then you can change this setting to a bottom copper layer. If you were creating an SMD pad, you could specify the top or bottom copper layer. +
-You can leave the rest of the pads as they are, no changes are needed. Your footprint should look like the example in Figure 37.12. +
-Figure 37.12: The footprint, with fabrication layer and pads completed. +
-Front Courtyard ​layer ('F.CrtYd') +
-Let’s continue with the front courtyard layer ('​F.CrtYd'​) where you will create the outline of the boundary for the footprint. From the Layer Manager, +
-  ​392 +
-select 'F.CrtYd'​. Your objective is to draw a rectangle around the footprint that encloses the pads and the footprint outline. Allow sufficient space around the pads to ensure that they cannot overlap with other footprints. Select the polygon drawing tool and start drawing from the top right corner of the footprint (Figure 37.13).+
  
-Draw the rectangle around the footprint until the polygon is fully enclosed. In the end, your footprint should look like the example in Figure 37.14. The rectangle around the footprint is the boundary as defined in the front courtyard layer. 
-Figure 37.14: The line around the footprint is the front courtyard outline. 
-Front Silkscreen 
-While your footprint is now functionally ready, you should spend a few more minutes to add informational text and graphics in the front silkscreen ('​F.SilkS'​) layer. Since you are working on the footprint of an integrated circuit, at the very least you should mark the location of pin 1. Let’s do that now. Select '​F.SilkS'​ from the Layer Manager. Select the polygon tool. Draw four lines to mark the outline of the IC on the board, like in the example of Figure 37.15. 
-Figure 37.15:In the F.SilkS layer, mark the edges of the footprint. 
-Also draw a circle that indicates the position of pin 1, using the circle tool. The end result is in Figure 37.16. 
-Figure 37.16: A circle in the F.SilkS layer indicates the position of pin 1. 
-Tidy up 
-You are almost finished with this design. Time to tidy up before saving the new footprint. Use the '​M'​ hotkey to move the text blocks over and below the footprint. Select the complete footprint, including the text block, and move it over the center of the axes. The final footprint is in Figure 37.17. 
  
-Save the footprint +那我们开始: 
-The last thing you must do before you can use your custom footprint is to save it. If you already have a folder for your custom footprints with the '​.pretty'​ extension, you can use that to store the new footprint. If not, create this folder now. Then, click on the '​Export'​ button from the top toolbar (Figure 37.18). +从KiCad主窗口,打开封装库编辑器按钮 
-Figure 37.18: Use the Export button to save the new footprint. +#### 点击“创建新封装” 
-This will bring up the Export Footprint window. Navigate to +给出一个名字,我们敲入“LCD144-128128-FP”,点击OK,弹出仅带有两个文本块的空白图纸,这两个文本块一个位于前面的加工区域(封装的名字),另一个位于前面的丝印区域(‘REF**
-your .pretty folder, give your new footprint a name (or accept the default, as I do), and click on Save (Figure 37.19). +
-Figure 37.19: Save the new footprint. +
-Test the footprint +
-Lets go back to Pcbnew to test your new footprint by adding it to the sheet. If the .pretty folder that contains your new footprint is not in the libraries table, add it now (Figure 37.20). You can learn how to do this in the relevant recipe. +
-Once that is done, use the '​O'​ hotkey to add a new footprint. Use the browser to navigate the list of libraries. Find your custom library, and in it, you will find your new footprint (Figure 37.21). +
-Figure 37.21: Select your new footprint from the library browser. +
-Double click on the footprint, and Pcbnew will place it on the sheet (Figure 37.22). +
-Well done, this was a long process. You now have a custom footprint that you can use in your layouts as you do with any other footprint.+
  
 +####​前面的加工层 ('​F.Fab'​) - 外形轮廓
  
 +右侧层管理区菜单中选择'​F.Fab',​使用绘制多边形工具绘制一个长方形. 根据规格书的参数绘制外形,需要切换到合适的单位mm、设置合适的格距,可以使用直接输入坐标的方式来定义每个点的位置,将坐标原点设置在屏幕显示区域的正中间(比较好计算)
 +
 +####​绘制焊盘
 +SMD,只出现在单面,设置焊盘的属性以及尺寸,创建一个焊盘,长度适当比规格书上的管脚长一些,比如多出2mm,将焊盘放置在合适的位置上,第一个焊盘的位置可以根据计算坐标来确定
 +其它的焊盘形状跟第一个焊盘一致,焊盘之间的间距相同,可以用复制工具来自动放置
 +第一个焊盘的形状跟其它焊盘做一下区分 - 选择长方形,后面还会放置丝印文字和图形做标记
 +
 +#### 前面的Courtyard层('​F.CrtYd'​)
 +创建封装的边界,在层管理菜单中选择'​F.CrtYd'​.选择多边形绘制工具来绘制一个长方形的外形 ​
 +
 +#### 前面的丝印层
 +  - 在层管理菜单选择('​F.SilkS'​)层.
 +  - 标记Pin1的位置, 管脚的编号
 +  - 标记外形轮廓
 +
 +#### 保存封装
 +  - 存储在正确的目录下
 +
 +#### 测试封装
 +  - 打开PCB编辑器,加载刚才创建的封装