← 返回 Skills 市场
Magnetic Circuit Calculator
作者
yongjie666888
· GitHub ↗
· v1.2.0
· MIT-0
165
总下载
0
收藏
1
当前安装
3
版本数
在 OpenClaw 中安装
/install magnetic-circuit-calculator
功能描述
电机磁路计算助手 | 基于等效磁路法计算气隙磁通、磁密分布、永磁体工作点、漏磁系数。适用于电机设计初期快速估算和Maxwell仿真对比验证。
使用说明 (SKILL.md)
电机磁路计算助手
基于等效磁路法(Magnetic Equivalent Circuit, MEC),对永磁电机进行快速磁路计算,输出气隙磁通、磁密、永磁体工作点等关键参数。
适用场景
- 电机设计初期快速估算(替代耗时 FEA)
- Maxwell 静磁场仿真前的参数预验证
- 极槽配合方案比选
- 漏磁系数快速评估
- 设计方案合理性判断
计算输入参数
| 参数 | 符号 | 单位 | 示例 |
|---|---|---|---|
| 极数 | 2p | - | 8 |
| 槽数 | Q | - | 36 |
| 相数 | m | - | 3 |
| 铁心长度 | L | mm | 60 |
| 气隙长度 | δ | mm | 0.5 |
| 定子内径 | Di | mm | 54 |
| 永磁体厚度 | hm | mm | 3 |
| 永磁体剩磁 | Br | T | 1.25 |
| 永磁体矫顽力 | Hc | kA/m | 955 |
| 永磁体宽度 | bm | mm | 沿弧长 |
| 轭部磁路长度 | lc | mm | 视结构而定 |
核心计算模块
1. 极距计算
极距 τ = π × Di / (2p)
示例:Di=54mm, 2p=8 → τ = π×54/8 ≈ 21.2mm
2. 每极每相槽数
q = Q / (2p × m)
分数槽:q = Q/(2p×m) = a/b(最简分数)
3. 气隙磁通密度(估算)
方法A:经验公式
Bg = σ × (Br × Am × Hc) / (δ × Ae)
其中:
σ = 漏磁系数(1.1~1.4),初次估算取 1.2
Am = 永磁体截面积 = bm × L(mm²)
Ae = 气隙截面积 = τ × L(mm²)
δ = 气隙长度(mm)
方法B:磁动势法(更精确)
F_total = F_pm - F_gap - F_core
F_pm = Hc × hm(永磁体提供的磁动势)
F_gap = Bg/μ0 × δ(气隙所需磁动势)
F_core = H_cu × lc(轭部铁损磁动势)
迭代求解:Bg = μ0 × (F_pm - F_core) / δ
4. 永磁体工作点(开路)
工作点坐标:(Bm, Hm)
Bm = Φm / Am = σ × Bg × (Ae/Am)
Hm = (Hc × hm - F_core) / hm
退磁曲线位置:Hm 应位于第二象限
判断标准:
Bm/Br > 0.6 → 工作点合理
Bm/Br \x3C 0.5 → 存在退磁风险
5. 漏磁系数 σ
σ = Φm / Φg = (Φg + Φσ) / Φg
典型值:
表贴式 PMSM:σ = 1.10 ~ 1.25
内嵌式 PMSM:σ = 1.20 ~ 1.40
磁阻电机:σ = 1.30 ~ 1.60
6. 反电动势常数 Ke
Ke = (4.44 × f × Nph × Kw × Φg) / n_s
或:
Ke = (2 × π × Nph × Kw × Φg) / 60
其中:
Nph = 每相串联匝数
Kw = 绕组系数
Φg = 每极气隙磁通(Wb)
f = 频率(Hz)
7. 同步电抗(估算)
Xd = 2 × f × μ0 × (Nph)² × τ × L / (δ × π × p)
Xq ≈ Xd(隐极机)
Xq > Xd(凸极机,表贴式差距小,内嵌式差距大)
计算输出格式
===== 磁路计算结果 =====
【基本参数】
极距 τ = XX mm
每极每相槽数 q = XX
绕组系数 Kw = XX
【气隙磁场】
气隙磁密 Bg = XX T
每极气隙磁通 Φg = XX mWb
【永磁体工作点】
永磁体截面积 Am = XX mm²
气隙截面积 Ae = XX mm²
漏磁系数 σ = XX
工作点 Bm/Br = XX%
工作点 Bm = XX T,Hm = XX kA/m
【性能估算】
反电动势常数 Ke = XX V/(rad/s)
转矩常数 Kt = XX Nm/A
【结论】
工作点状态:[正常/偏低/有退磁风险]
建议:[继续优化/调整hm/更换磁钢牌号]
典型设计案例
案例:8极36槽表贴式 PMSM
输入参数
极数 2p = 8
槽数 Q = 36
铁心长度 L = 60mm
气隙长度 δ = 0.5mm
定子内径 Di = 54mm
永磁体厚度 hm = 3mm(N42SH,Br=1.25T)
永磁体宽度 bm = 17mm(弧长)
计算过程
τ = π×54/8 = 21.2mm
q = 36/(8×3) = 1.5(分数槽)
Ae = 21.2×60 = 1272mm²
Am = 17×60 = 1020mm²
Ae/Am = 0.802
假设 σ=1.2:
Bg = 1.2 × 1.25 × 1020 / (0.5 × 1272) = 0.76T
开路校验(忽略铁心压降):
Bm = 0.76 × 1.2 × 0.802 = 0.73T
Bm/Br = 58.4% → 偏低,建议增加 hm 至 4mm 重新计算
设计问题诊断
| 现象 | 原因 | 调整方向 |
|---|---|---|
| Bg 偏低 | hm 太小、Br 不足 | 增加 hm 或选更高 Br 牌号 |
| Bg 过高 | hm 太大 | 可能导致磁钢浪费,适当减小 |
| Bm/Br \x3C 50% | 存在退磁风险 | 增加 hm、减小气隙、换高矫顽力牌号 |
| σ 过大 | 漏磁严重 | 优化磁钢布局、增加隔磁桥宽度 |
| Ke 偏低 | 匝数不够、磁通偏低 | 增加匝数或提高 Bg |
参考资源
scripts/mec_calculator.py- 磁路计算脚本(基础版)scripts/mec_calculator_v2.py- 磁路计算脚本 v2(增强版,支持迭代求解、永磁体库、hm扫描、极槽方案对比)references/steel_pm_materials.md- 硅钢片和永磁体牌号参数库(快速查阅)
快速使用
# 交互模式(引导输入参数)
python scripts/mec_calculator_v2.py
# 命令行模式(直接计算)
python scripts/mec_calculator_v2.py --poles 8 --Q 36 --L 60 --delta 0.5 --Di 54 --hm 3
# 永磁体厚度扫描分析
python scripts/mec_calculator_v2.py --poles 8 --Q 36 --sweep_hm
# 极槽配合方案对比
python scripts/mec_calculator_v2.py --poles 8 --L 60 --compare_slots
注意:计算基于线性磁路假设(忽略铁心饱和),结果为初估参考。高精度设计请用 Maxwell 静磁场仿真验证。
注意事项
- 本计算基于线性磁路假设,忽略铁心饱和,适合初步估算
- 高精度结果需用 Maxwell 静磁场仿真验证
- 内嵌式电机需考虑 d/q 轴磁路不对称
- 分数槽集中绕组漏磁系数通常较大
安全使用建议
This skill appears coherent and local-only: it provides Python scripts that compute magnetic-circuit metrics and save optional plot PNGs. Before running: (1) inspect the complete mec_calculator_v2.py file (the provided listing was truncated) to ensure there are no unexpected network, subprocess, or file-exfiltration calls in the unseen portion; (2) run in an isolated environment or VM if you downloaded the package from an untrusted source; (3) install needed Python packages (numpy, matplotlib) in a virtualenv; (4) validate outputs against a known case or reference (the SKILL.md provides example inputs) before using results for critical design decisions; (5) if you need higher confidence, request the full untruncated source for a complete audit.
功能分析
Type: OpenClaw Skill
Name: magnetic-circuit-calculator
Version: 1.2.0
The skill bundle is a legitimate engineering tool for motor magnetic circuit calculations using the Equivalent Magnetic Circuit (MEC) method. The Python scripts (mec_calculator.py and mec_calculator_v2.py) perform mathematical modeling, iterative solving, and parameter sweeps, with the latter optionally generating a local plot file (hm_sweep_analysis.png) using matplotlib. There is no evidence of data exfiltration, network activity, obfuscation, or malicious prompt injection; all functionality is strictly aligned with the stated purpose of motor design estimation.
能力评估
Purpose & Capability
Name/description, SKILL.md, and the two Python scripts consistently implement magnetic equivalent-circuit calculations and related analyses (hm sweep, slot comparison). Required capabilities are limited to local numeric computation and optional plotting.
Instruction Scope
SKILL.md instructs running the included Python scripts and describes command-line/interactive usage — it does not request reading unrelated files, env vars, or contacting external endpoints. Note: SKILL.md does not declare Python dependencies (numpy/matplotlib) that the v2 script imports; the script degrades gracefully if plotting libs are missing but users should be aware of dependency needs.
Install Mechanism
No install spec provided (instruction-only). No downloads or external install steps are invoked by the skill metadata.
Credentials
No required environment variables, no credentials, and no config-path access are declared or used in the visible code.
Persistence & Privilege
Skill does not request permanent presence (always=false) and does not modify other skills or system agent settings in the visible materials.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install magnetic-circuit-calculator - 安装完成后,直接呼叫该 Skill 的名称或使用
/magnetic-circuit-calculator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.0
v1.2: 新增永磁体/硅钢片详细参数库,补充真实选型案例,更新SKILL.md结构
v1.1.0
新增v2版本计算器,支持迭代求解、hm扫描、永磁体库
v1.0.0
首个版本:基于等效磁路法计算气隙磁通、磁密、永磁体工作点
元数据
常见问题
Magnetic Circuit Calculator 是什么?
电机磁路计算助手 | 基于等效磁路法计算气隙磁通、磁密分布、永磁体工作点、漏磁系数。适用于电机设计初期快速估算和Maxwell仿真对比验证。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 165 次。
如何安装 Magnetic Circuit Calculator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install magnetic-circuit-calculator」即可一键安装,无需额外配置。
Magnetic Circuit Calculator 是免费的吗?
是的,Magnetic Circuit Calculator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Magnetic Circuit Calculator 支持哪些平台?
Magnetic Circuit Calculator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Magnetic Circuit Calculator?
由 yongjie666888(@yongjie666888)开发并维护,当前版本 v1.2.0。
推荐 Skills