Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Motor PID Tuner

БесплатноБез исполняемых скриптовНе проверен

电机控制PID/PI参数计算与调参诊断工具。当用户需要计算电机FOC电流环/速度环/位置环PI参数、PID调参、电机控制参数整定、PID参数不知道怎么定、电机转起来抖动/震荡/嗡嗡响排查、电机响应慢/超调大、电机控制入门、Ziegler-Nichols调参、电机参数辨识、PID代码生成、调参故障诊断(震荡/超调/稳态…

liujycodeот liujycode179 установок в других каталогах

Об этом скилле

Motor PID Tuner 1.1.0

Update: new "30-second start" — a tested command path from the built-in motor preset library to one-shot three-loop calculation, so new users no longer need to digest the 29-mode table.

Update: report_gen.py --format html is live — a single-file HTML tuning report (embedded SVG step-response curves, three-loop parameter cards, protection thresholds, color-coded validation), ready to share or archive.

Update: all fallback error messages localized with self-service troubleshooting hints (python main.py <mode> --help); frontmatter version aligned across the suite.

Update: fixed a misleading warning in validate mode when parameters are incomplete; added positional-loop discrete-domain Kd note.

When to Use It

  • Motor parameters in hand, no idea how to start PID: give Rs/Ls/J/Kt and the desired bandwidth, get all three FOC loops (current/speed/position) as PI/PID in continuous, discrete and Q-format — no formula digging.
  • Oscillation / overshoot / steady-state error while tuning: describe the symptom, get a diagnosis and countermeasures (which way to move Kp/Ki, whether anti-windup is needed).
  • Need a tuning report to share: --format html generates a visual report in one shot — parameters + curves + protection thresholds + advice on one page.
  • Pre-production protection and validation: overcurrent/overvoltage/overtemperature/stall thresholds, parameter sanity checks, temperature sensitivity.

Computes FOC three-loop (current/speed/position) PI/PID gains from motor physics and desired bandwidth. 29 work modes in main.py plus a standalone report generator (report_gen.py), covering the full flow from gain calculation to code generation, production protection to sensorless startup.

Invocation: python main.py --mode <mode> [args...] — mode names are current/speed/position etc. (not current_loop). Reports use the separate script python report_gen.py.

30-Second Start

Not sure where parameters come from? Use the built-in preset library, then compute in one shot (all commands tested):

# 1) List 10 built-in common motor presets (2207/2804/5010/6354/8318 etc.)
python main.py --mode preset

# 2) Get one motor's full parameters (psi_f / J auto-derived)
python main.py --mode preset --preset-name 2207-1500KV

# 3) All three loops at once: feed the parameters in (--bw is the current-loop bandwidth;
#    speed/position loops auto-scale at 10:1:0.1)
python main.py --mode all --rs 0.052 --ls 0.0000085 --j 0.001 --kt 0.0065 --psi-f 0.00061905 --pole-pairs 7 --bw 1000 --vbus 12 --imax 20

Step 3 outputs: three-loop Kp/Ki/Kd (continuous + discrete), bandwidth-ratio check, Q-format C macros, feedforward coefficients. Current loop only is even simpler: python main.py --mode current --rs 0.052 --ls 0.0000085 --bw 1000 — three args.

Workflow

1. Identify the user need

Typical asks: "compute current-loop PI" / "how to tune the speed loop" / "position PD"; "Rs=0.5 Ls=2mH, 1kHz bandwidth"; "motor keeps oscillating" / "overshoot too big"; "Ziegler-Nichols"; "generate PID / STM32 / full FOC code"; "Q-format fixed point, MCSDK style"; "feedforward" / "cross-coupling decoupling"; "simulate step response"; "Rs +30% with temperature — impact?"; "forward Euler vs Tustin"; "field weakening"; "sensorless observer gains (SMO)"; "PWM 20kHz — what bandwidth"; "export MATLAB"; "SVPWM code"; "anti-windup" / "integrator runaway"; "dead-time compensation"; "multi-rate loops"; "phase/gain margin, Bode"; "sanity check my parameters"; "overcurrent/stall/I2t protection"; "temperature compensation"; "I/F start, HFI, zero-speed"; "GD32/TI C2000 adaptation"; "reverse-compute bandwidth from Kp/Ki"; "walk me through the inputs".

2. Interactive guidance

When the user is unsure which parameters are needed, use --mode interactive --target <loop> to get the required-parameter list, then ask one by one. Friendlier than demanding everything at once.

3. Collect parameters

Gather what the need dictates; ask for missing critical parameters. Also available: --mode preset (motor library), --mode suggest-bw --pwm-freq <kHz> (auto bandwidth advice).

⚠️ CLI argument mapping (read before calling): symbols below (Rs/Ls/J/Kt...) are physics notation; actual main.py CLI args are all lowercase. Never pass uppercase notation as CLI args:

Symbol CLI arg Unit
Rs --rs ohm
Ls --ls H (convert mH to H)
J --j kg*m^2
B --b Nms/rad
Kt --kt N*m/A
bandwidth --bw Hz
bus voltage --vbus V
max current --imax A
flux psi_f --psi-f Wb
pole pairs --pole-pairs pairs
sample period --ts s
damping --zeta -

all-mode bandwidth scaling: with --mode all, --bw is the current-loop bandwidth; speed loop auto-scales to 1/10 and position loop to 1/100 (built-in 10:1:0.1 ratio; override via `--speed-rati

Полный SKILL.md на ClawHub

Установить Motor PID Tuner в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Motor PID Tuner?

电机控制PID/PI参数计算与调参诊断工具。当用户需要计算电机FOC电流环/速度环/位置环PI参数、PID调参、电机控制参数整定、PID参数不知道怎么定、电机转起来抖动/震荡/嗡嗡响排查、电机响应慢/超调大、电机控制入门、Ziegler-Nichols调参、电机参数辨识、PID代码生成、调参故障诊断(震荡/超调/稳态误差)、阶跃响应仿真、参数灵敏度分析、离散化方法对比、弱磁控制参数、观测器增益计算、电机参数库查询、带宽自动建议、MATLAB导出、SVPWM代码生成、多平台适配(STM32/GD32/C2000)、参数反算、抗积分饱和(anti-windup)、死区补偿、多采样率控制、稳定性裕度分析(相位裕度/幅值裕度)、参数合理性校验、故障保护阈值(过流/过压/过温/堵转/I2t)、温度补偿(Rs/磁链温漂)、无感启动策略(I/F开环/高频注入)时使用。覆盖PMSM/BLDC/有刷直流电机的PI/PID控制器设计。

Как установить скилл Motor PID Tuner?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Motor PID Tuner запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Motor PID Tuner с