Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add calebzu/pmsm-control-claude-skills-for-matlab --skill foc_ltidgit clone --depth 1 https://github.com/calebzu/pmsm-control-claude-skills-for-matlabWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/calebzu/pmsm-control-claude-skills-for-matlab/foc_ltid)<a href="https://agentmods.dev/skills/calebzu/pmsm-control-claude-skills-for-matlab/foc_ltid"><img src="https://agentmods.dev/badge/skills/calebzu/pmsm-control-claude-skills-for-matlab/foc_ltid/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/calebzu/pmsm-control-claude-skills-for-matlab/foc_ltid"><img src="https://agentmods.dev/badge/skills/calebzu/pmsm-control-claude-skills-for-matlab/foc_ltid.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00298 | $0.04144 |
| Opus 5 | $0.00149 | $0.02072 |
| Sonnet 5 | $0.00060 | $0.00829 |
| Haiku 4.5 | $0.00030 | $0.00414 |
Grade A, and why
motor-foc-ltid-pmsm scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.
motor-foc-ltid-pmsm — PMSM FOC + Load-Torque Estimator + Feed-Forward Builder
Three-phase 2-level voltage-source inverter + PMSM. Field-oriented speed control (outer Symmetric-Optimum speed PI → iq_ref; inner dq current PI ×2 with cross-coupling + back-EMF decoupling feed-forward; id_ref = 0), augmented with a linear load-torque state estimator on the model x = [ω_m; T_L], u = T_e, y = ω_m — seven selectable realizations on one shared structure (pole-placed Luenberger, steady-state KF, steady colored KF, recursive KF, recursive colored KF, correlated-noise KF, continuous Kalman-Bucy). The estimate T̂_L is fed forward into iq_ref (via the torque constant) to cut the load-step speed dip the speed PI alone cannot. v1 baseline supports SPMSM and mild-saliency IPMSM (Lq/Ld < 2, id_ref = 0); strong-saliency MTPA deferred.
Layered on motor-pmsm-base. All base discipline applies (plant build standard, dq conventions, building-blocks SOP, broken-FOC defense, visual 4-check).
⚠️ Estimator validation note
The base FOC plant + dq current PI + speed PI formulas are reused by pointer from the base pmsm_formulas.md §0–§7, §A. The load-torque estimator family (F2–F10: augmented model, observability, Luenberger, recursive/steady/colored/correlated KF, Kalman-Bucy) is documented in formulas/pmsm_foc_ltid_formulas.md, each formula cross-checked against ≥2 independent academic sources (see base/theory_anchor.md).
Validation requirement: a visual review on the MATLAB desktop (motor rotates / iq tracks / iabc AC sinusoidal / Te energy balance) plus the FF-on-vs-FF-off dip-reduction demonstration. Neither can be skipped.
Must-Follow Rules
- Plan first — numbered plan with the input table (below), the design-decision choices (discretization path, KF tuning, plant choice — see the build template's parameter block), and the build-script structure. Get user approval before the first
add_block. - One-click reproducibility — every numeric originates in the model
InitFcn(machine, PI gains, all estimator matrices viac2d/place/dlqe, the augmentedn=3colored model, the F9.a cross-term, the F10 continuous intensities, plus guardedff_enable/est_sel/plant_seldefaults). No external design script may need to run first. See base one-click discipline. - The six structural modules are non-negotiable — (1) plant exposing
ω_m, θ_e, i_abc/i_dq, T_e+T_Linput; (2) outer speed PI (saturation + anti-windup); (3) inner dq current PI ×2 with decoupling/back-EMF FF (id_ref=0); (4) Clarke/Park transforms on a single globalθ_e; (5) load-torque estimator onx=[ω_m;T_L]; (6) feed-forward ofT̂_Lintoiq_refwith an enable. Omitting any one breaks the method. θ_eGotoTagVisibility='global'is MANDATORY in every plant variant — the baseAnti_Park/Plarkconsumeθ_evia an internalFrom "The"; a default'local'Goto is the classic silent failure (FOC degenerates to lab-frame open-loop: motor stalls,iabcDC-locked). A build self-test must assert global visibility on everyTheGoto (look-under-masks). See base/broken_foc_diagnostics.md §F-CRIT 1.- Estimator on the augmented model + observability check — build
x=[ω_m;T_L],u=T_e,y=ω_mwithṪL≈0(random-walk internal model, F2). Assert observabilityrank(O)=2(F3,det≈-1/J≠0) inInitFcn— a rank-deficient model is a build error, not a tuning issue. - All 7 variants on ONE shared structure = coverage, NOT copy — reproduce the variant structure/tuning method from F4–F10; never copy magic Q/R/pole numbers or a selector topology from any source. Realize the recursive KFs inline (
KF_Estimator_EMLatom / inline MATLAB Function) so the model is one-click. The steady-state KF must collapse onto the Luenberger (F7.b) — verify theirT̂_Lstd match as a built-in cross-check. - Feed-forward enable is mandatory —
iq_ref += (T̂_L/Kt)·ff_enable, withff_enabletoggling FF-on vs FF-off. The headline demonstrable effect is FF-on reduces the load-step speed dip and recovery time; FF-off is the baseline. This is the method's reason to exist (see misconception #3). - Speed PI = Symmetric Optimum, not pole-zero-cancellation — a PZC/IMC-tuned speed PI has a disturbance-rejection slow pole fixed by the plant mechanical ratio
−B/J, independent of bandwidth (the Phase-4.5 trap: large inertia → long load-settling no matter the gain). Use Symmetric Optimum (a=4,Teq=1/αc) so rejection is bandwidth-dependent, and verify the evaluation windowT_window ≥ 5·τ_max(τ_max=2·a·Teq). See base Phase-4.5 sanity check. - Reproducible measurement noise (fixed seed) — inject
ω_m,meas = ω_m + nwith a fixed-seedRandom Numberat a sub-tsrate. The sensor noise is the KF's reason to exist; without it a plain observer suffices and the Kalman story is unmotivated. - R2024b estimator sizing recipe + visual 4-check — the
KF_Estimator_EMLatom and the inline persistent/continuous charts (KF6/KF7) need their portSizepinned (DataType=Inherit, chartSampleTime='-1'); R2024b output-size inference fails forpersistent xhat=zeros(size(A,1),1)and continuous-feedback charts. Seebuilding_blocks/foc_ltid_api_notes.md§E.1. Run the base visual 4-check before trusting any metric.
What ships with it
19 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- building_blocks/build_foc_ltid_blocks.m 3.1 KB
- building_blocks/foc_ltid_api_notes.md 13 KB
- building_blocks/foc_ltid_blocks_manifest.md 7.2 KB
- building_blocks/foc_ltid_blocks.slx 89 KB
- formulas/pmsm_foc_ltid_formulas.md 39 KB
- README.md 2.5 KB
- rebuild/build_foc_ltid_run1.m 36 KB
- rebuild/run_phase8_full.m 5.3 KB
- rebuild/run_phase8.m 7.8 KB
- results/g4_1_speed.png 52 KB
- results/g4_2_iq.png 43 KB
- results/g4_3_TLhat.png 38 KB
- results/g4_4_iabc.png 57 KB
- results/g4_5_balance.png 37 KB
- results/g4_full_EQN_dip.png 41 KB
- results/g4_full_SIM_dip.png 41 KB
- results/results_phase8_full.mat 1.5 KB
- results/results_phase8.mat 1244 KB
- scripts/build_template.m 36 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 119 lines · 298 tokens per session scan A 05b93a72394a
motor-foc-ltid-pmsm is a skill published in the GitHub repository calebzu/pmsm-control-claude-skills-for-matlab (13 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 298 tokens to every session and 4,144 once invoked, about $0.0015 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
matlab-simulate-radar-detections
Configure, simulate, debug, and analyze radarDataGenerator within radarScenario. Use for: interactively building radar detection scenarios from datasheets or performance requirements; diagnosing missed detections and configuration errors; interpreting sensor spherical, body, and scenario-frame outputs; deriving…
matlab-model-via
Via modeling: pads, antipads, ground return vias, GRV placement, and signal integrity for high-speed layer transitions. TRIGGER: user asks to model a via, design a via transition, place ground return vias, analyze via performance, or check signal integrity through layer transitions. Invoke BEFORE writing code — only…
matlab-compute-gnss-position
Computes multi-constellation Global Positioning System (GPS) or Global Navigation Satellite System (GNSS) positions from RINEX v3 data using rinexread, gnssmeasurements, receiverposition, and gnssoptions. Filters by constellation, elevation mask, C/N0, and observation code. Reports DOP, scatter RMS, and satellite…
matlab-design-dsphdl-ddc
Use when designing a Digital Down Converter (DDC) using dsphdl System objects. Triggers on requests involving DDC design, frequency down-conversion for FPGA/ASIC, NCO + mixer + decimation filter chains, fractional/non-integer sample rate conversion, or HDL-optimized receiver front-end signal processing.
matlab-build-industrial-hmi
Build industrial-grade SCADA/HMI dashboards in MATLAB following industrial-HMI conventions (ISA-101-aligned): gray-field philosophy, alarms at source, write safeguards, fixed-range trends, drill-down layout. Produces a real App Designer app (.mlapp, or plain-text .m+.xml on R2026b+) by handing serialization to the…
matlab-find-pi-assets
Find and query PI assets using MATLAB's Industrial Communication Toolbox. Two paths: (1) direct PI tag lookup via piclient + tags when user provides a tag name or description (R2022a+), (2) Asset Framework navigation via afclient when user needs element/attribute hierarchy (R2026a+). Use when working with PI AF…