motor-foc-ltid-pmsm

motor-foc-ltid-pmsm is a skill for Claude Code, Codex from calebzu/pmsm-control-claude-skills-for-matlab. It costs 298 tokens per session (4,144 once invoked), scanned A, original, Apache-2.0.

A Simulink control-design skill for a three-phase permanent-magnet motor, combining field-oriented control with load-torque estimation and feed-forward compensation.

In plain words
What is it for?
Use it to build and compare motor speed-control models for surface or mildly salient permanent-magnet motors, including several Luenberger and Kalman estimator variants.
Why use it?
A speed controller alone can lose speed when the motor load changes; estimating the load helps compensate for that disturbance.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build and compare motor speed-control models for surface or mildly salient permanent-magnet motors, including several Luenberger and Kalman estimator variants.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/calebzu/pmsm-control-claude-skills-for-matlab/foc_ltid
Install

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.

Any agent
npx skills add calebzu/pmsm-control-claude-skills-for-matlab --skill foc_ltid
Clone the repo
git clone --depth 1 https://github.com/calebzu/pmsm-control-claude-skills-for-matlab

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for motor-foc-ltid-pmsm

README.md
[![agentmods](https://agentmods.dev/badge/skills/calebzu/pmsm-control-claude-skills-for-matlab/foc_ltid/github.svg)](https://agentmods.dev/skills/calebzu/pmsm-control-claude-skills-for-matlab/foc_ltid)
Your own site
<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.

agentmods 80×15 button for motor-foc-ltid-pmsm

Your own site · 80×15
<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>
Per session 298 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,144 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 12d ago against content hash 05b93a72394a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

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.

extended/foc_ltid/SKILL.md · 119 lines

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 = ω_mseven 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

  1. 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.
  2. One-click reproducibility — every numeric originates in the model InitFcn (machine, PI gains, all estimator matrices via c2d/place/dlqe, the augmented n=3 colored model, the F9.a cross-term, the F10 continuous intensities, plus guarded ff_enable/est_sel/plant_sel defaults). No external design script may need to run first. See base one-click discipline.
  3. The six structural modules are non-negotiable — (1) plant exposing ω_m, θ_e, i_abc/i_dq, T_e + T_L input; (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 on x=[ω_m;T_L]; (6) feed-forward of T̂_L into iq_ref with an enable. Omitting any one breaks the method.
  4. θ_e Goto TagVisibility='global' is MANDATORY in every plant variant — the base Anti_Park/Plark consume θ_e via an internal From "The"; a default 'local' Goto is the classic silent failure (FOC degenerates to lab-frame open-loop: motor stalls, iabc DC-locked). A build self-test must assert global visibility on every The Goto (look-under-masks). See base/broken_foc_diagnostics.md §F-CRIT 1.
  5. Estimator on the augmented model + observability check — build x=[ω_m;T_L], u=T_e, y=ω_m with ṪL≈0 (random-walk internal model, F2). Assert observability rank(O)=2 (F3, det≈-1/J≠0) in InitFcn — a rank-deficient model is a build error, not a tuning issue.
  6. 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_EML atom / inline MATLAB Function) so the model is one-click. The steady-state KF must collapse onto the Luenberger (F7.b) — verify their T̂_L std match as a built-in cross-check.
  7. Feed-forward enable is mandatoryiq_ref += (T̂_L/Kt)·ff_enable, with ff_enable toggling 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).
  8. 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 window T_window ≥ 5·τ_max (τ_max=2·a·Teq). See base Phase-4.5 sanity check.
  9. Reproducible measurement noise (fixed seed) — inject ω_m,meas = ω_m + n with a fixed-seed Random Number at a sub-ts rate. The sensor noise is the KF's reason to exist; without it a plain observer suffices and the Kalman story is unmotivated.
  10. R2024b estimator sizing recipe + visual 4-check — the KF_Estimator_EML atom and the inline persistent/continuous charts (KF6/KF7) need their port Size pinned (DataType=Inherit, chart SampleTime='-1'); R2024b output-size inference fails for persistent xhat=zeros(size(A,1),1) and continuous-feedback charts. See building_blocks/foc_ltid_api_notes.md §E.1. Run the base visual 4-check before trusting any metric.

Read the full file on GitHub · 119 lines

Changes

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.

  1. 12d ago First seen · 119 lines · 298 tokens per session scan A 05b93a72394a

Subscribe to this mod's changes

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.

Related

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/matlab-agentic-toolkit · 92 tokens

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/matlab-agentic-toolkit · 144 tokens

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/matlab-agentic-toolkit · 140 tokens

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/matlab-agentic-toolkit · 74 tokens

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/matlab-agentic-toolkit · 245 tokens

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…

matlab/matlab-agentic-toolkit · 107 tokens