Phase-Locked Loop Parameter Tuning (锁相环参数整定)

v1.0.0

锁相环(PLL)PI 控制器参数计算工具。用于电力电子/新能源领域的锁相环设计与调试。支持两种计算方向:(1) 根据目标带宽和阻尼比正向计算 PI 参数(KPLLp/KPLLi);(2) 根据已知 PI 标幺值参数反推闭环带宽和阻尼比。当用户提到"锁相环"、"PLL"、"PLL带宽"、"PI参数"、"KPLLp"...

0· 127·0 current·0 all-time
byZhenbin Huang@ncepuee

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for ncepuee/pll-designer.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Phase-Locked Loop Parameter Tuning (锁相环参数整定)" (ncepuee/pll-designer) from ClawHub.
Skill page: https://clawhub.ai/ncepuee/pll-designer
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Canonical install target

openclaw skills install ncepuee/pll-designer

ClawHub CLI

Package manager switcher

npx clawhub@latest install pll-designer
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name, description, formulas and the two provided calculation scripts all align with a PLL PI-parameter tuning tool. However, SKILL.md and the examples assume running MATLAB functions (get_pll_pi_parameters.m / calc_pll_bandwidth.m) while the registry metadata declares no required binaries. Also the included script files are packaged as .txt rather than .m, which is an implementation/packaging inconsistency that should be clarified.
Instruction Scope
Runtime instructions are narrowly scoped to electrical parameter collection and numeric computation; they explicitly require asking the user for Unom/f_BW_target/KPLLp_pu/KPLLi_pu before computing. There is no instruction to read arbitrary system files, access environment variables, or transmit data externally. Minor inconsistency: SKILL.md references .m scripts that are present only as .txt files in the package.
Install Mechanism
No install spec is provided (instruction-only), so nothing will be automatically downloaded or written to disk by the platform. This is the lowest-risk install model.
Credentials
The skill declares no required environment variables, credentials, or config paths and the instructions do not request secrets or unrelated credentials. This is proportionate to the described computation task.
Persistence & Privilege
The skill is not always-enabled and uses default invocation behavior. It does not request persistent system privileges or attempt to modify other skills or system-wide configuration.
Assessment
This skill appears to do exactly what it claims: compute PLL PI parameters and/or infer bandwidth using the provided formulas and MATLAB scripts. Before installing or running it, note two practical items: (1) SKILL.md expects MATLAB to be available to run .m functions, but the registry lists no required binary — ensure you have MATLAB (or a compatible interpreter) if you intend to run the functions. (2) The packaged scripts are .txt files rather than .m; verify the files' contents and rename/convert them to .m if you will run them. There is no indication of network calls, secret access, or data exfiltration. Also confirm units/assumptions (Unom, f0, zeta) match your system and validate outputs with your engineering practice before deploying in control hardware.

Like a lobster shell, security has layers — review code before you run it.

latestvk974xc3bxenr66t5nyp65jzxvn845fqq
127downloads
0stars
1versions
Updated 3w ago
v1.0.0
MIT-0

PLL 带宽计算工具

基于二阶系统理论的锁相环 PI 控制器参数设计与分析工具。

系统模型说明

本工具基于以下 SRF-PLL(同步旋转坐标系锁相环)线性化模型:

  • 开环传递函数:G(s) = U_mag * (Kp*s + Ki) / s^2
  • 闭环特征方程:s^2 + U_mag*Kp*s + U_mag*Ki = 0
  • 自然角频率:wn = sqrt(U_mag * Ki)
  • 阻尼比:zeta = U_mag*Kp / (2*wn)
  • 带宽扩展系数:C = sqrt(1 + 2*zeta^2 + sqrt(2 + 4*zeta^2 + 4*zeta^4))
  • 闭环带宽:f_BW = wn * C / (2*pi)

其中 U_mag = Unom/sqrt(3)*sqrt(2) 为相电压峰值(前馈解耦项)。

标幺值换算

物理值与标幺值的换算关系(基准值 = 额定角频率 / 相电压峰值):

KPLLp_pu = KPLLp * U_mag / w0
KPLLi_pu = KPLLi * U_mag / w0

其中 w0 = 2*pi*f0

⚠️ 交互规则(必须遵守)

在执行任何计算之前,若用户未明确提供以下参数,必须主动询问,不得使用默认值静默计算:

  1. Unom(线电压有效值,V) — 必问,不同电压等级结果差异显著

    • 常见值:690V(风电变流器)、380V(工业低压)、10kV/35kV(中压)等
    • 询问示例:"请问您的系统线电压有效值是多少 V?(如 690V、380V 等)"
  2. f_BW_target(目标带宽,Hz) — 正向设计时必问(若未提供)

  3. KPLLp_pu / KPLLi_pu — 反向分析时必问(若未提供)

以下参数有合理默认值,用户未提供时可直接使用,但需在结果中注明

  • f0 = 50 Hz(电网频率,中国/欧洲标准)
  • zeta = 0.707(最优阻尼比)

使用方式

方向一:正向设计(目标带宽 → PI 参数)

用户提供目标带宽,可选提供电压、频率、阻尼比,计算 PI 参数。

调用 MATLAB 函数:

[KPLLp_pu, KPLLi_pu, KPLLp, KPLLi] = get_pll_pi_parameters(f_BW_target)
[KPLLp_pu, KPLLi_pu, KPLLp, KPLLi] = get_pll_pi_parameters(f_BW_target, Unom, f0, zeta)

典型示例:

% 目标带宽 20Hz,默认 690V/50Hz/zeta=0.707
[Kp_pu, Ki_pu, Kp, Ki] = get_pll_pi_parameters(20)

% 自定义参数
[Kp_pu, Ki_pu, Kp, Ki] = get_pll_pi_parameters(30, 380, 50, 0.707)

方向二:反向分析(PI 参数 → 带宽/阻尼比)

用户提供已知的 PI 标幺值参数,反推带宽和阻尼比。

调用 MATLAB 函数:

[f_BW, zeta, wn, KPLLp, KPLLi] = calc_pll_bandwidth(KPLLp_pu, KPLLi_pu)
[f_BW, zeta, wn, KPLLp, KPLLi] = calc_pll_bandwidth(KPLLp_pu, KPLLi_pu, Unom, f0)

典型示例:

% 已知标幺值参数,默认 690V/50Hz
[f_BW, zeta, wn, Kp, Ki] = calc_pll_bandwidth(0.05, 0.8)

MATLAB 脚本文件

  • scripts/get_pll_pi_parameters.m — 正向设计函数
  • scripts/calc_pll_bandwidth.m — 反向分析函数

默认参数

参数默认值说明
Unom690 V电网线电压有效值(风电变流器典型值)
f050 Hz电网额定基波频率
zeta0.707阻尼比(临界阻尼,最优响应)

直接计算(无需 MATLAB)

当用户只需要数值结果时,可直接用以下公式计算,无需运行 MATLAB:

正向(已知 f_BW_target, zeta):

  1. C = sqrt(1 + 2*zeta^2 + sqrt(2 + 4*zeta^2 + 4*zeta^4))
  2. wn = 2*pi*f_BW_target / C
  3. U_mag = Unom/sqrt(3)*sqrt(2)
  4. KPLLp = 2*zeta*wn / U_mag
  5. KPLLi = wn^2 / U_mag
  6. KPLLp_pu = KPLLp * U_mag / (2*pi*f0)
  7. KPLLi_pu = KPLLi * U_mag / (2*pi*f0)

反向(已知 KPLLp_pu, KPLLi_pu):

  1. U_mag = Unom/sqrt(3)*sqrt(2), w0 = 2*pi*f0
  2. KPLLp = KPLLp_pu * w0 / U_mag
  3. KPLLi = KPLLi_pu * w0 / U_mag
  4. wn = sqrt(U_mag * KPLLi)
  5. zeta = U_mag*KPLLp / (2*wn)
  6. C = sqrt(1 + 2*zeta^2 + sqrt(2 + 4*zeta^2 + 4*zeta^4))
  7. f_BW = wn*C / (2*pi)

Comments

Loading comments...