目录
了保证电源稳定性,一些电源厂家提出了对电源环路阻抗的要求,而常规仿真非常耗时,其实大多情况下可以采用近似公式进行估算,如果余量较小再进行常规严格的仿真。
R=ρL/W/h,即电阻正比于长度,反比于宽度和厚度。
数据准备
电阻率
温度/℃ | 电阻率/(Ω/mm) |
---|---|
0 | 16.5 |
10 | 17.2 |
20 | 17.8 |
30 | 18.5 |
40 | 19.2 |
50 | 20 |
60 | 20.6 |
铜厚
厚度信息可以PCB层叠中得到,以此建立层数与厚度的对应关系表。
thick_layer_pair = {
"L1":0.025,
"L2":0.02,
"L3":0.02,
"L4":0.025
}
PCB数据
从PCB文件中导出IPC-D-356格式数据。
IPC-D-356数据分析
网络别名
IPC-D-356定义超过14个字符的网络名(net)需要使用别名,在"P IMAGE PANEL"分段中,以“NNNAME”为行首。
net走线信息
以“333”为行首的信息记录了网络所连接器件引脚及其位置信息,line[4:18]为网络名称,位置坐标分别以X,Y开始,公制单位下为微米。
以“378”为行首的信息记录了走线所在层,走线宽度以及路径上各点的位置坐标,以“078”为行首的信息为上一行的继续。
编程实现自动化
- 首先,建立表格列出所需计算电阻的网络,及其起始器件引脚和结束器件引脚,csv为文本文件处理方便,建议以csv文件提供;
Net Name Start Part Start PIN End Part End PIN Info Net1 U01 1 C10 1 Net2 U01 3 C05 2 - 导入IPC-D-356数据,获取net-name变换对;
net_name_pair = { "IPC001":"VREG_S1A_S2A_S3A_APC1", "IPC002":"VREG_S1E_S2E_S3E_MODEM" }
- 以net-name和IPC-D-356行首3字符为依据,获取各net所连接引脚信息和连线信息;
def get_position(pin_s,pcb_data): position = ["",""] pin = pin_s[0] + " -" + pin_s[1] for line in pcb_data: if pin in line: x = line.split("X")[1].split("Y")[0] y = line.split("Y")[1].split("CD")[0].split("OW")[0] position[0] = str(int(x)) position[1] = str(int(y)) return position def wires(pcb_data): wires = {} for line in pcb_data: if line[:3] == "378": wire = line.split()[3:] width = int(line.split()[2][2:]) if width not in wires.keys(): wires[width] = [] points = [] for point in wire: if "*" in point: points = points + point.split("*") elif point.count("X") > 1: points.append("X" + point.split("X")[1]) wires[width].append(points) points = ["X" + point.split("X")[2]] else: points.append(point) wires[width].append(points) elif line[:3] == "078": wire = line.split()[1:] points = [] for point in wire: if "*" in point: points = points + point.split("*") elif point.count("X") > 1: points.append("X" + point.split("X")[1]) wires[width].append(points) points = ["X" + point.split("X")[2]] else: points.append(point) wires[width][-1] = wires[width][-1] + points return wires
- 依据连线信息,整理point-point线段,计算出L/W/h,并汇总成有权重的无向图;
def graph(wires): graph = {} for width in wires.keys(): for wire in wires[width]: for i in range(len(wire)-2): point = wire[i] point1 = wire[i+1] if point not in graph.keys(): graph[point] = [] pos_point = [int(point.split("Y")[0][1:]),int(point.split("Y")[1])] pos_point1 = [int(point1.split("Y")[0][1:]),int(point1.split("Y")[1])] length_by_width = ((pos_point[0] - pos_point1[0]) ** 2 + (pos_point[1] - pos_point1[1]) ** 2) ** 0.5 / width graph[point].append([point1,length_by_width]) return graph
- 依据现有的最短路径算法,计算起始器件引脚和结束器件引脚最小L/W/h加权;
- 根据电阻率等信息,将网络与估算电阻值列表输出,注意单位的换算
网络名 电阻率(Ω/mm) L/W/h(mm) 电阻(mΩ) Net1 1.78e-8 1.5e-6 26.7 Net2 1.78e-8 1.9e-6 33.82