差别

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

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
kicad电路板布局布线 [2018/10/05 21:09]
gongyu [3. 使用GerbView查看Gerber文件]
kicad电路板布局布线 [2018/10/06 01:00] (当前版本)
gongyu [1. Pcbnew的使用]
行 1: 行 1:
-====== ​5. PCB布局布线 ======+====== PCB布局布线 ======
 一旦完成了原理图的设计,通过ERC检查无误(没有Error、最好也没有Warning)、生成Netlist,就可以进入到下一步 - PCB Layout了,这个过程应该细分为元器件的Placement(布局)和信号线的Route(布线)两个环节,在实际的设计中Placement(布局)更重要,需要花费更多的时间,基于一系列的需求和规则对每个元器件在电路板上的位置进行认真的摆放,尤其是在大型的项目中,一定要待元器件的布局被相关的人确定以后,再开始信号线的连接,也就是布线的过程。布局和布线的过程基于信号完整性、电源完整性等方面的考虑不在本教程的探讨范围,在这里我们只看看KiCad这个工具如何实现布局和布线整个流程的。 一旦完成了原理图的设计,通过ERC检查无误(没有Error、最好也没有Warning)、生成Netlist,就可以进入到下一步 - PCB Layout了,这个过程应该细分为元器件的Placement(布局)和信号线的Route(布线)两个环节,在实际的设计中Placement(布局)更重要,需要花费更多的时间,基于一系列的需求和规则对每个元器件在电路板上的位置进行认真的摆放,尤其是在大型的项目中,一定要待元器件的布局被相关的人确定以后,再开始信号线的连接,也就是布线的过程。布局和布线的过程基于信号完整性、电源完整性等方面的考虑不在本教程的探讨范围,在这里我们只看看KiCad这个工具如何实现布局和布线整个流程的。
  
行 16: 行 16:
 接下来我们来看看KiCad中的Pcbnew是如何执行这些过程的。 接下来我们来看看KiCad中的Pcbnew是如何执行这些过程的。
 ===== 1. Pcbnew的使用 ===== ===== 1. 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.+1. **执行程序** - 从KiCad项目管理处,单击//​Pcb layout editor//​(PCB布局编辑器)图标{{:​pcbnew.png|}}启动Pcbnew窗口。 ​
  
-Begin by entering some schematic informationClick on the Page settings icon  sheetset_png on the top toolbarSet the appropriate paper size (A4,​8.5x11 ​etc.) and title as Tutorial1.+2**设置页面信息** - 先输入一些原理图信息。 单击顶部工具栏上的//​Page setting//​(页面设置)图标{{:​sheetset.png|}}。设置//​Page ​size//​(纸张大小)为(A4, 8.5x11等)和title(标题)为//​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.+3. **设置布局布线规则** - 根据PCB制造商提供的要求,来设间距、最小线宽等,一般来讲可以将间距和最小线宽度都设置为0.25mm。 单击**Setup**(设置)→ **Design Rules**(设计规则)菜单来设置各个参数,这里的单位是mm。 
 +{{ :​design_rules.png |}}
  
-从KiCad项目经理处,单击Pcb布局编辑器图标pcbnew_png。 Pcbnew窗口将打开。 如果您收到错误消息,指出* .kicad_pcb文件不存在并询问您否要创建只需单击是+4. **导入网表文件** -  ​单击顶部工具栏上的//​Read netlist//​(读入网表)图标 ​{{:​netlist.png|}}。 如果是从//​Eeschema//​创建则可以在//​Netlist//​文件字段中选择网表文件//​tutorial1.net//​进行读取。 
  
-首先输一些原理图信息。 单击顶部工具栏上的页面设置标sheetset_png。 将适当纸张尺寸A4,​8.5x11等和标题置为Tutorial1+5. **查看并移动基于网表导入的器件** - 在页面中应该能够看到原理中定义了封装所有器件,这些器件都通过称为ratsnest的一组细线连接 - 你可以通过//​Show/​hide board ratsnest//显示/​隐藏电路板网络按钮{{:​general_ratsnest.png|}}来查看所有器件之间的连接关系,如果你发现这些细线的连接跟电路原理图中原本计的有出入,就要回去查看一下是哪一个地方出了问题
  
-最好将间隙和最小轨道宽度设置为PCB制造商要求宽度。 通常可以将间隙设置为0.25将最小轨道宽度设置为0.25。 ​单击→设计规则菜单。 如果尚未显示单击“网络类编辑”选项卡。 将窗口顶部的“清除”字段更改为0.25,将“轨道宽度”字段更改为0.25,如下所示。 这里的测量单位是mm+6. **调整器件位置** - 可以用鼠标选中这些器件并进行移动可以将鼠标悬停在你要移动的器件上并按[m]来移动它们然后单击要放置它们的位置将其放好也可以通过单击选择件然后拖动它按[r]可以旋转器件 
 +{{ :​gsik_tutorial1_080.png |}}
  
-Design Rules Window+7. **定义PCB板的外沿** - 从顶部工具栏的下拉菜单中选择//​Edge.Cuts//​图层。单击右侧工具栏上的//​Add graphic lines//​(添加图形线)图标{{:​add_dashed_line.png|}}。然后用走线圈定PCB的边缘,要记住在绿色边缘和PCB边缘之间留一个小间隙。 
 +{{ :​select_edge_cuts.png |}}
  
-Click on the Global Design Rules tab and set Minimum track width to 0.25Click the OK button to commit your changes and close the Design Rules Editor window.+8**布线** - 一般来讲我们都会在电路板上通过大面积铺设地平面的方式将所有GND进行连接,因此在布线的时候可以先不用考虑GND这个网络上的连线。电路板的外表面有两层 - F.Cu(顶层,我们也称为Top Layer)和B.Cu(底层,我们也称为Bottom Layer),两层板一般选择在B.Cu层铺设大面积的地平面,因为F.Cu层主要用于放置元器件。如果设计中需要用到4层板,可以转到//​设置→图层设置//​将铜图层改为4. 你可以在图层表中设置需要的图层并对它们的用途做设定。
  
-Now we will import the netlist fileClick 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+布线的时候我们先从F.Cu开始,在顶部工具栏的下拉菜单中选择F.Cu(PgUp),如图: 
-All components should now be visible. They are selected and follow the mouse cursor.+{{ :​select_top_copper.png |}}
  
-Move the components to the middle of the boardIf necessary you can zoom in and out while you move the componentsClick the left mouse button.+单击右侧工具栏上的//​Route tracks//​(布线)图标{{:​add_tracks.png|}}。 单击J1的第1个引脚连线到R2的焊盘,双击鼠标结束连线。 此走线的宽度将默认为0.250mm,你也可以从顶部工具栏的下拉菜单中更改走线的宽度。 默认只有一个走线宽度。 
 +{{ :​pcbnew_select_track_width.png |}} 
 +如果要添加更多走线宽度,可以通过//​设置→设计规则→全局设计规则选项//​卡,在此窗口的右下角添加任何其它你需要的宽度,这样在后面布线的时候你可以根据需要随时从下拉菜单中选择走线的宽度。 请参见下面的示例(单位为英寸)。 
 +{{ :​custom_tracks_width.png |}}
  
-单击“全局设计规则”选项卡,将“最小轨道宽度”设置为0.25。 单击“确定”按钮以提交更改并关闭“设计规则编辑器”窗口+你也可以通过添加一个Net Class来设定一组选项。 转到**设置→设计规则→网络类别编辑器**添加一个名为power的新类别。 ​走线的宽度从8mil(表示为0.0080)为24mil(表示为0.0240)。 接下来将除GND之外的所有网络都添加到Power类别(在左侧选择默认值,在右侧选择电源使用箭头)
  
-现在我们将导入网表文件。 单击顶部工具栏上Read netlist icon netlist_png。 如果是从Eeschema创建,则应在Netlist文件字段中选择网表文件tutorial1.net。 单击“读取当前网表”。 然后单击“关闭”按钮。 +重复此过程,直到连接除J1引脚3之外所有连线。 电路板如下 
-现在该可以看到有组件。 选择它们并按照鼠标光标+{{ :​gsik_tutorial1_090.png |}}
  
-将组件移动板的中间。 如有必要,您可以移动组件放大和缩小。 ​单击鼠标左键+9. **通过过孔进行跨层走线** - 走线一般都用2层以上,跨层走线就需用到**过孔**进行连接比如顶层(Top Layer)的铜平面上走线,右键单击并选择//​Place Via//​(放置过孔)或只需按[v],走线就改到了底层铜平面 
 +{{ :​place_a_via.png |}}
  
-All components are connected via a thin group of wires called ratsnestMake sure that the Show/hide board ratsnest button general_ratsnest_png is pressed. In this way you can see the ratsnest linking all components.+10**高亮网络进行检查** - 如果要检查特定连接,可以单击右侧工具栏上的高亮网络图标{{:​net_highlight.png|}}。 点击J1的第3针,连线本身和连接到它的所有焊盘都会被高亮显示出来。
  
-You can move each component by hovering over it and pressing [m]Click where you want to place themAlternatively you can select a component by clicking on it and then drag itPress [r] to rotate a component. Move all components around until you minimise the number of wire crossovers. +11**铺设地平面** - 在前面的连线中对所有与GND网络相连的连接都不做处理,最后通过铺设一个覆盖整个PCB板的地平面,再将所有器件上的GND管脚进行连接。具体的做法就是单击右侧工具栏上的//​Add filled zone//​(添加填充区域)图标{{:​add_zone.png|}},在电路板上走线画一个矩形框,将会在板子上铺设大面积的铜用作地线的连接,板子铺设之后的效果: 
-gsik_tutorial1_080_png+{{ :​gsik_tutorial1_100.png |}}
  
-Note how one pin of the 100 ohm resistor is connected to pin 6 of the PIC componentThis 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.+12**设计规则检查** - 单击顶部工具栏上的//​Perform design rules check//​(执行设计规则检查)图标{{:​drc.png|}}启动设计规则检查,这个过程非常重要,能够确保你最后的布局、布线符合原理图的设计以及设定的布局布线规则。
  
-Now we will define the edge of the PCBSelect 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. +26**3D查看** ​3D查看是要的一个功能能够帮助你对自己设计的板子有空间概念,有些问题只有通3D查看才能发现装配方面的冲突等,具很简单 单击View →3D Viewer。 
- +{{ :​pcbnew_3d_viewer.png |}} 
-所有组件都通过称为ratsnest的一组细线连接。确保按下显示/​隐藏板鼠标按钮general_ratsnest_png。通过这种方式,您可以到ratnest链接所有组件。 +===== 2. 生成和查看Gerber文件 =====
- +
-您可以通过将每个组件悬停在其上并按[m]来移动它们。单击要放置它们的位置。或者,您可以通过单击选择组件然后拖动它。按[r]旋转组件。移动所有组件,直到最小化电线交叉的数量。 +
-gsik_tutorial1_080_png +
- +
-注意100欧姆电阻的一个引脚如何连接到PIC组件的引脚6。这用于连接引脚的标记方法的结果。标签通比实际的电线更受欢迎,因为它们使原理图更加杂乱。 +
- +
-现在我们将定义PCB的边缘。从顶部工具栏的下拉菜单中选择Edge.Cuts图层。单击右侧工具栏上的添加图形线图标add_dashed_line_png。跟踪电路板边缘,点击每个角落,并记住在绿色边缘和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. +
- +
-接下来,连接除GND之外的所有电线。 事实上,我们将使用放置在电路板底部铜线(称为B.Cu)上的接地层一次连接所有GND连接。 +
- +
-现在我们必须选择我们想处理铜层。 在顶部工具栏的下拉菜单中选择F.Cu(PgUp)。 这是前顶部铜层。 +
- +
- +
-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. +
- +
-例如,如果您决定使用4层PCB,请转到设置→图层设置并将铜图层更改为4.在图层表中,您可以命名图层并确定它们的用途。 请注意,可以通过“预设图层分组”菜单选择非常有用的预设。 +
- +
-单击右侧工具栏上的Route tracks图标add_tracks_png。 单击J1的第1针并运行轨道以填充R2。 双击以设置轨道结束的点。 此轨道的宽度将默认为0.250 mm。 您可以从顶部工具栏的下拉菜单中更改轨道宽度。 请注意,默认情况下,您只有一个可用的轨道宽度。 +
- +
-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. +
- +
-或者,您可以添加一Net Class,在其中指定一组选项。 转到设置→设计规则→网络类编辑器,然后添加一个名为power新类。 将轨道宽度从8密耳(表示为0.0080)更改为24密耳(表示为0.0240)。 接下来将除地面之外的所内容添加到功率等级(在左侧选择默认值,在右侧选择电源并使用箭头)。 +
- +
-如果要更改网格大小,请右键单击→网格。 在放下组件并将它们与轨道连接在一起之前或之后,请务必选择合适的网格尺寸。 +
- +
-重复此直到连接除J1的引脚3之外的所有电线。 您的电路板应下所示。 +
- +
-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. +
- +
-现在让我们在PCB的另一个铜侧上运行轨道。 在顶部工具栏的下拉菜单中选择B.Cu。 单击Route tracks图标add_tracks_png。 在J1的引脚3和U1的引脚8之间画一条轨道。 这实际上没有必要,因为我们可以用地平做到这一点。 注意轨道颜色是如何变化的。 +
- +
-通过更改图层从引脚A转到引脚B. 通过放置通道可以在运行轨道时更改铜平面。 当您在上部铜平面上运行轨道时右键单击并选择“放置Via”或只需按[v]。 这会将您带到底层,您可以在其中完成曲目。 +
- +
-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: +
- +
-如果要检查特定连接,可以单击右侧工栏上突出显示网络图标net_highlight_png。 点击J1的第3针。 轨道本身和连接到它的所有打击垫都应突出显示。 +
- +
-现在我们将制一个连接到所有GND引脚的接地层。 ​击右侧工具栏上的“添加填充区域”图标add_zone_png。 我们将在棋盘周围跟踪一个矩形,因此单击您想要其中一个角的位置。 在出现的对话框中,将默认打击垫连接设置为“热释放”并将“轮廓坡度”设置为仅限H,V和45度,然后单击“确定”。 +
- +
-通过单击旋转中的每个角来跟踪板的轮廓。 通过第二次单击第一个角完成矩形。 右键单击您刚刚跟踪的区域。 单击区域→'​填充或重新填充所有区域'​。 董事会应填写绿色,看起来像这样: +
- +
-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+
- +
-单击顶部工具栏上的执行设计规则检查图标drc_png,运行设计规则检查器。 单击Start DRC。 应该没有错误。 单击List Unconnected列表。 应该没有未连接的项目。 单击“确定”关闭“DRC控制”对话框。 +
- +
-单击文件→保存以保存文件。 要以3D方式欣赏您的电路板,请单击视图→3D查看器。 +
- +
-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+
-===== 2. 生成Gerber文件 =====+
  
 一旦PCB设计完成,就可以为每一层生成Gerber文件,并将它们发给你要打板的PCB制板厂。 一旦PCB设计完成,就可以为每一层生成Gerber文件,并将它们发给你要打板的PCB制板厂。
行 160: 行 77:
 |Top Solder Resist |F.Mask |.GBR |.GTS | |Top Solder Resist |F.Mask |.GBR |.GTS |
 |Edges |Edge.Cuts |.GBR |.GM1| |Edges |Edge.Cuts |.GBR |.GM1|
- 
-**使用GerbView查看Gerber文件** 
  
 要查看所有Gerber文件,可以使用KiCad工程管理器中的//​GerbView//​功能。 在下拉菜单或图层管理器中,选择图层1. 单击**File**(文件)→ **Open Gerber Files**(打开Gerber文件)或单击图标{{:​gerber_file.png|}}。 选择并打开所有生成的Gerber文件。 注意它们如何一个在另一个上面显示。 要查看所有Gerber文件,可以使用KiCad工程管理器中的//​GerbView//​功能。 在下拉菜单或图层管理器中,选择图层1. 单击**File**(文件)→ **Open Gerber Files**(打开Gerber文件)或单击图标{{:​gerber_file.png|}}。 选择并打开所有生成的Gerber文件。 注意它们如何一个在另一个上面显示。
行 169: 行 84:
 使用右侧的图层管理器选择/​取消选择要显示的图层。 在发送到制板厂之前,要仔细检查每一层是否正确。 使用右侧的图层管理器选择/​取消选择要显示的图层。 在发送到制板厂之前,要仔细检查每一层是否正确。
  
-===== 4. 使用第三方工具FreeRouting ​进行自动布线 =====+===== 3. 使用FreeRouting自动布线 =====
 手工布线既快速又有趣,但对于具有大量器件的电路板,您可能希望使用自动布线器。请记住,您应首先手动对关键的信号布线,然后剩余的非关键但比较无聊的信号线可以让机器自动布线。它只会对还没有布线的信号进行自动连接。在这里可以使用的自动布线器是FreeRouting。 手工布线既快速又有趣,但对于具有大量器件的电路板,您可能希望使用自动布线器。请记住,您应首先手动对关键的信号布线,然后剩余的非关键但比较无聊的信号线可以让机器自动布线。它只会对还没有布线的信号进行自动连接。在这里可以使用的自动布线器是FreeRouting。
 {{ :​freerouting.png |}} {{ :​freerouting.png |}}
行 183: 行 98:
  
 如果你对自动布线生成的任何连线不满意,可以删除掉再对其布线。 如果你对自动布线生成的任何连线不满意,可以删除掉再对其布线。
-====== 6. KiCad中的前向标注 - 对已经完成的设计进行修改 ​======+===== 4. KiCad中的前向标注 - 对已经完成的设计进行修改 =====
 完成电路原理图设计、封装分配、电路板布局、布线并生成了Gerber文件,就可以将所需的文件发送给PCB制造商将设计变成实际的电路板了。 完成电路原理图设计、封装分配、电路板布局、布线并生成了Gerber文件,就可以将所需的文件发送给PCB制造商将设计变成实际的电路板了。