analyze-power-nets

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Analyze Power Nets

分析电源网络

When this skill is invoked, perform a full AI-powered analysis of the PCB to identify power nets and recommend track widths.
调用此技能时,将对PCB进行全AI驱动的分析,以识别电源网络并推荐走线宽度。

Step 1: Load and Extract Components

步骤1:加载并提取元件

python
from analyze_power_paths import (
    analyze_pcb, get_components_needing_analysis, classify_component,
    trace_power_paths, get_power_net_recommendations, format_analysis_report,
    ComponentRole
)

components, pcb_data = analyze_pcb("path/to/file.kicad_pcb")
unknown = get_components_needing_analysis(components)
python
from analyze_power_paths import (
    analyze_pcb, get_components_needing_analysis, classify_component,
    trace_power_paths, get_power_net_recommendations, format_analysis_report,
    ComponentRole
)

components, pcb_data = analyze_pcb("path/to/file.kicad_pcb")
unknown = get_components_needing_analysis(components)

Step 2: Auto-Classify Obvious Components

步骤2:自动分类明显元件

These are already handled automatically - no AI needed:
PrefixRoleReason
R (resistor)SHUNTPull-ups, voltage dividers
C (capacitor)SHUNTDecoupling caps
L (inductor)PASS_THROUGHSeries filter element
FB (ferrite bead)PASS_THROUGHSeries filter element
F (fuse)PASS_THROUGHSeries protection
LEDCURRENT_SINKConsumes current
SW (switch)PASS_THROUGHPower switching
这些元件会自动处理,无需AI参与:
前缀角色原因
R(电阻)SHUNT上拉电阻、分压器
C(电容)SHUNT去耦电容
L(电感)PASS_THROUGH串联滤波元件
FB(磁珠)PASS_THROUGH串联滤波元件
F(保险丝)PASS_THROUGH串联保护元件
LEDCURRENT_SINK消耗电流
SW(开关)PASS_THROUGH电源开关

Step 3: AI Analysis for Unknown Components

步骤3:未知元件的AI分析

For each component in the
unknown
list, you MUST:
对于
unknown
列表中的每个元件,你必须:

3a. Identify What It Is

3a. 识别元件类型

Use WebSearch to look up the component:
WebSearch: "<part_value> <footprint_hint> datasheet"
Examples:
  • "DB9 connector pinout"
    - Is it signal or power?
  • "1N4004 diode datasheet"
    - Rectifier vs signal diode
  • "3906 transistor datasheet"
    - Power switch or signal amp?
  • "LT1129 regulator datasheet"
    - Voltage regulator specs
  • "MCF5213 power consumption"
    - IC current requirements
使用WebSearch查询元件:
WebSearch: "<元件值> <封装提示> datasheet"
示例:
  • "DB9 connector pinout"
    - 是信号连接器还是电源连接器?
  • "1N4004 diode datasheet"
    - 整流二极管还是信号二极管?
  • "3906 transistor datasheet"
    - 电源开关还是信号放大器?
  • "LT1129 regulator datasheet"
    - 稳压器规格参数
  • "MCF5213 power consumption"
    - IC电流需求

3b. Determine Its Role

3b. 确定元件角色

Based on the datasheet/search results, classify as:
RoleCriteria
POWER_SOURCESupplies current to the board: power jacks, battery connectors, regulator outputs, USB power inputs
CURRENT_SINKConsumes significant current: ICs, MCUs, CPLDs, FPGAs, motor drivers, high-power LEDs
PASS_THROUGHCurrent flows through it: power switches, transistors used as switches, protection diodes in series
SHUNTBranches off the power path: ESD protection diodes, TVS diodes, signal connectors
根据datasheet/搜索结果,将元件分类为:
角色判断标准
POWER_SOURCE为电路板供电:电源插孔、电池连接器、稳压器输出、USB电源输入
CURRENT_SINK消耗大量电流:IC、MCU、CPLD、FPGA、电机驱动器、大功率LED
PASS_THROUGH电流流经该元件:电源开关、用作开关的晶体管、电源路径中的串联保护二极管
SHUNT从电源路径分支:ESD保护二极管、TVS二极管、信号连接器

3c. Estimate Current Rating

3c. 估算电流额定值

From the datasheet, find:
  • For ICs: Total supply current (ICC, IDD)
  • For regulators: Maximum output current
  • For connectors: Expected load current
从datasheet中查找:
  • 对于IC:总电源电流(ICC、IDD)
  • 对于稳压器:最大输出电流
  • 对于连接器:预期负载电流

3d. Apply Classification

3d. 应用分类

python
classify_component(components, 'J201', ComponentRole.POWER_SOURCE,
                   current_rating_ma=1000,
                   notes="DC barrel jack - main power input")
python
classify_component(components, 'J201', ComponentRole.POWER_SOURCE,
                   current_rating_ma=1000,
                   notes="DC barrel jack - main power input")

Step 4: Key Components to Analyze

步骤4:重点分析的元件类型

Focus AI analysis on these component types:
将AI分析集中在以下元件类型:

Power Input Connectors (J*, P*, TB*, CN*)

电源输入连接器(J*, P*, TB*, CN*)

  • Question: Is this a power input or signal connector?
  • Look for: Connection to power nets, barrel jack footprints, terminal blocks
  • Classify as: POWER_SOURCE if it brings power onto the board
  • 问题:这是电源输入连接器还是信号连接器?
  • 查找要点:与电源网络的连接、桶形插孔封装、接线端子
  • 分类为:如果是向电路板供电,则为POWER_SOURCE

Diodes (D* followed by digit)

二极管(D*后跟数字)

  • Question: Protection diode, rectifier, or LED?
  • Look for: Part number (1N4004 = rectifier, BAT54 = Schottky, LED = LED)
  • Classify as:
    • SHUNT if reverse protection (cathode to power, anode to GND)
    • PASS_THROUGH if series rectifier in power path
    • CURRENT_SINK if LED
  • 问题:保护二极管、整流二极管还是LED?
  • 查找要点:元件型号(1N4004=整流二极管,BAT54=肖特基二极管,LED=发光二极管)
  • 分类为
    • 若为反向保护(阴极接电源,阳极接地)则为SHUNT
    • 若为电源路径中的串联整流二极管则为PASS_THROUGH
    • 若为LED则为CURRENT_SINK

Transistors (Q*)

晶体管(Q*)

  • Question: Power switch or signal amplifier?
  • Look for: Connections to power nets, gate/base drive signals
  • Classify as: PASS_THROUGH if switching power, SHUNT if signal
  • 问题:电源开关还是信号放大器?
  • 查找要点:与电源网络的连接、栅极/基极驱动信号
  • 分类为:若用于开关电源则为PASS_THROUGH,若用于信号则为SHUNT

ICs (U*)

IC(U*)

  • Question: How much current does it consume?
  • Look for: ICC/IDD in datasheet, number of I/O pins
  • Classify as: CURRENT_SINK with appropriate current rating
  • Note: Regulators are auto-detected by power_out pins
  • 问题:它消耗多少电流?
  • 查找要点:datasheet中的ICC/IDD参数、I/O引脚数量
  • 分类为:带有相应电流额定值的CURRENT_SINK
  • 注意:稳压器会通过power_out引脚自动检测

Voltage Regulators (VR*, or U* with regulator part number)

电压稳压器(VR*,或带有稳压器型号的U*)

  • Question: What is the maximum output current?
  • Look for: Output current spec in datasheet
  • Classify as: POWER_SOURCE with max output current
  • 问题:最大输出电流是多少?
  • 查找要点:datasheet中的输出电流规格
  • 分类为:带有最大输出电流的POWER_SOURCE

Step 5: Trace Power Paths

步骤5:追踪电源路径

After classifying all components:
python
paths = trace_power_paths(pcb_data, components)
recommendations = get_power_net_recommendations(pcb_data, components, paths)
完成所有元件分类后:
python
paths = trace_power_paths(pcb_data, components)
recommendations = get_power_net_recommendations(pcb_data, components, paths)

Step 6: Generate Report

步骤6:生成报告

python
print(format_analysis_report(pcb_data, components, paths, recommendations))
Provide the user with:
  1. Summary of component classifications
  2. Traced power paths showing current flow
  3. Recommended power nets and track widths
  4. Ready-to-use
    --power-nets
    command line arguments
python
print(format_analysis_report(pcb_data, components, paths, recommendations))
向用户提供:
  1. 元件分类摘要
  2. 显示电流流向的已追踪电源路径
  3. 推荐的电源网络和走线宽度
  4. 可直接使用的
    --power-nets
    命令行参数

Example Analysis Session

示例分析会话

When analyzing a board like kit-dev-coldfire-xilinx_5213:
  1. J201 (JACK_2P): WebSearch "DC barrel jack 2.1mm" → POWER_SOURCE, 1000mA
  2. TB201 (CONN_2): Terminal block on same net as J201 → POWER_SOURCE, 1000mA
  3. D201 (1N4004): WebSearch "1N4004 datasheet" → Rectifier, but connected cathode-to-power → SHUNT (reverse protection)
  4. Q101 (3906): WebSearch "2N3906 PNP transistor" → Emitter on +3.3V → PASS_THROUGH (power switch)
  5. U102 (MCF5213): WebSearch "MCF5213 power consumption" → CURRENT_SINK, 200mA
  6. U301 (XCR3256): WebSearch "XCR3256 CPLD power" → CURRENT_SINK, 150mA
分析kit-dev-coldfire-xilinx_5213这类电路板时:
  1. J201 (JACK_2P):WebSearch "DC barrel jack 2.1mm" → POWER_SOURCE,1000mA
  2. TB201 (CONN_2):与J201同网络的接线端子 → POWER_SOURCE,1000mA
  3. D201 (1N4004):WebSearch "1N4004 datasheet" → 整流二极管,但阴极接电源 → SHUNT(反向保护)
  4. Q101 (3906):WebSearch "2N3906 PNP transistor" → 发射极接+3.3V → PASS_THROUGH(电源开关)
  5. U102 (MCF5213):WebSearch "MCF5213 power consumption" → CURRENT_SINK,200mA
  6. U301 (XCR3256):WebSearch "XCR3256 CPLD power" → CURRENT_SINK,150mA

Output Format

输出格式

undefined
undefined

Power Net Analysis for board.kicad_pcb

Power Net Analysis for board.kicad_pcb

AI-Classified Components

AI-Classified Components

RefValueRoleCurrentNotes
J201JACK_2PPOWER_SOURCE1000mADC power input
U102MCF5213CURRENT_SINK200mAColdFire MCU
RefValueRoleCurrentNotes
J201JACK_2PPOWER_SOURCE1000mADC power input
U102MCF5213CURRENT_SINK200mAColdFire MCU

Power Paths Traced

Power Paths Traced

TB201 (power input) → SW_ONOFF201 → F201 → VR201 → +3.3V → U102 (MCU)
TB201 (power input) → SW_ONOFF201 → F201 → VR201 → +3.3V → U102 (MCU)

Recommended Power Nets

Recommended Power Nets

NetWidthReason
Net-(TB201-P1)0.5mmPower input path
Net-(F201-Pad1)0.5mmAfter fuse
+3.3V0.5mmMain rail, 500mA total
/VDDPLL0.3mmPLL supply, 10mA
NetWidthReason
Net-(TB201-P1)0.5mmPower input path
Net-(F201-Pad1)0.5mmAfter fuse
+3.3V0.5mmMain rail, 500mA total
/VDDPLL0.3mmPLL supply, 10mA

Routing Command

Routing Command

--power-nets "GND" "+3.3V" "/VDDPLL" "/VCCA" "Net-(TB201-P1)" --power-nets-widths 0.5 0.5 0.3 0.3 0.5
undefined
--power-nets "GND" "+3.3V" "/VDDPLL" "/VCCA" "Net-(TB201-P1)" --power-nets-widths 0.5 0.5 0.3 0.3 0.5
undefined

Important Notes

重要说明

  1. Do not rely on component reference prefixes for ICs, connectors, or transistors - always look up the actual part
  2. Check net connections - a connector on a power net is likely a power connector
  3. Trace upstream - if a component feeds into a known power net, its input is also a power net
  4. Ground nets are always power nets - include GND, GNDA, AGND, VSS, etc.
  1. 不要依赖元件参考前缀来判断IC、连接器或晶体管的类型——务必查询实际元件型号
  2. 检查网络连接——连接到电源网络的连接器很可能是电源连接器
  3. 向上游追踪——如果一个元件连接到已知的电源网络,那么它的输入也是电源网络
  4. 地网络始终属于电源网络——包括GND、GNDA、AGND、VSS等