motor-smc-pmsm

motor-smc-pmsm is a skill for Claude Code from calebzu/pmsm-control-claude-skills-for-matlab. It costs 257 tokens per session (2,640 once invoked), scanned A, original, Apache-2.0.

A Simulink builder for controlling the speed of a permanent-magnet synchronous motor (PMSM) with sliding-mode control, plus a proportional-integral current controller and space-vector PWM.

In plain words
What is it for?
Use it to build a three-phase PMSM drive with a super-twisting sliding-mode speed loop, two-axis current control, feedforward compensation, and inverter modulation.
Why use it?
It provides a specified outer speed-control method while handling current regulation, motor coupling, and inverter switching inside the simulation.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to build a three-phase PMSM drive with a super-twisting sliding-mode speed loop, two-axis current control, feedforward compensation, and inverter modulation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/calebzu/pmsm-control-claude-skills-for-matlab/motor-smc-pmsm
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 motor-smc-pmsm
Clone the repo
git clone --depth 1 https://github.com/calebzu/pmsm-control-claude-skills-for-matlab

Made for: Claude Code.

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-smc-pmsm

README.md
[![agentmods](https://agentmods.dev/badge/skills/calebzu/pmsm-control-claude-skills-for-matlab/motor-smc-pmsm/github.svg)](https://agentmods.dev/skills/calebzu/pmsm-control-claude-skills-for-matlab/motor-smc-pmsm)
Your own site
<a href="https://agentmods.dev/skills/calebzu/pmsm-control-claude-skills-for-matlab/motor-smc-pmsm"><img src="https://agentmods.dev/badge/skills/calebzu/pmsm-control-claude-skills-for-matlab/motor-smc-pmsm/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-smc-pmsm

Your own site · 80×15
<a href="https://agentmods.dev/skills/calebzu/pmsm-control-claude-skills-for-matlab/motor-smc-pmsm"><img src="https://agentmods.dev/badge/skills/calebzu/pmsm-control-claude-skills-for-matlab/motor-smc-pmsm.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 257 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,640 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.00257 $0.02640
Opus 5 $0.00129 $0.01320
Sonnet 5 $0.00051 $0.00528
Haiku 4.5 $0.00026 $0.00264

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

Security

Grade A, and why

motor-smc-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.

.claude/skills/motor-smc-pmsm/SKILL.md · 95 lines

How it starts

The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.

motor-smc-pmsm — PMSM Sliding Mode Control Speed-Loop Builder

Three-phase 2-level voltage-source inverter + PMSM. Outer-loop = PD-type sliding surface + Super-Twisting Algorithm (STA) providing iq_ref (continuous through s=0, second-order SMC). Inner-loop = dq current PI ×2 with cross-decoupling feedforward (PZC for RL plant + BEMF compensation). Modulation = Anti_Park + SVPWM library blocks. v1 baseline supports SPMSM and mild-saliency IPMSM (Lq/Ld < 2); strong-saliency IPMSM MTPA mid-loop deferred.

Layered on motor-pmsm-base. All base discipline applies.

⚠️ Signing Authority Note (SMC-specific)

Most users may lack independent SMC domain expertise. When the user declares this gap, switch to AI-self-audit mode (see base/theory_anchor.md):

  • §A/§B (PI / DTC) formulas: user-signed
  • §C (SMC) formulas: AI-self-audited with verifiable sources (≥ 2 independent cross-check + ≥ 1 link openable + ≥ 1 PDF cached)

Fail-safe replacement for user formula sign-off: a Phase 8 G4 user visual review on MATLAB desktop (4 Scopes + abc currents AC sinusoidal verification). G4 cannot be skipped.

Must-Follow Rules

  1. Plan first — Numbered plan with 25-input table, design-decision choices (design_decisions.md), build-script structure. Get user approval.
  2. One-click reproducibility — Inject all parameters via set_param(mdl, 'InitFcn', ...). See crit_conditions.md §D-CRIT.
  3. PD-type sliding + STA architectures = e + λ·de/dt (Filtered Derivative s/(Tf·s+1)) + STA reaching law u = K1·|s|^0.5·sgn(s) + K2·∫sgn(s). Do NOT use PI-type sliding (integrator wind-up voids Lyapunov proof) or classic sgn / boundary-layer sat (chattering). See control_law.md.
  4. iq_ref Saturation is mandatory — Saturation block at iq_ref output BEFORE feeding to current PI, limits ±iq_max. See crit_conditions.md §B-CRIT.
  5. Lyapunov STA gains auto-computed; B > 0 in v1 baselineK1 > 1.5·√M, K2 > 1.1·M where M = (TL_max + B·ω_max)/J. Build script asserts both. Plant friction B > 0 is the v1 baseline assumption (validated envelope; not a theoretical requirement — STA convergence is damping-independent). See control_law.md and crit_conditions.md §C-CRIT.
  6. Goto_The TagVisibility='global' MANDATORY — Anti_Park's internal From "The" requires the parent's Goto_The to publish globally; default 'local' is silent failure mode (FOC degenerates to lab-frame open-loop). See base/broken_foc_diagnostics.md §F-CRIT 1 + crit_conditions.md §G-CRIT.
  7. FF Mux input is ω_e (NOT θ_e) — Cross-decoupling FF formulas need electrical angular velocity, not position. Use a dedicated Gain_Pn_omega block independent of Gain_Pn (which provides θ_e for Goto_The). See ff_decoupling.md and crit_conditions.md §H-CRIT.
  8. Add 4 Scopes for human inspectionScope_wm_RPM / Scope_iq / Scope_s / Scope_Te. See crit_conditions.md §F-CRIT. Visual 4-check (motor rotates / iq tracks / abc AC sinusoidal NOT DC-locked / Te energy balance) is mandatory pre-condition for trusting any numerical metric.
  9. Solver = ode3 + ZeroCrossControl='DisableAll' — STA's Sign block is discontinuous. Variable-step or ZC ON causes step explosion. See crit_conditions.md §E-CRIT.
  10. SVPWM sector=7 startup workaround — At t=0 transient, Vα=Vβ=0 makes the SVPWM library's Sector_Caculate output sector=7 (invalid). Apply local-instance workaround on the library block. See svpwm_workaround.md.

Read the full file on GitHub · 95 lines

Files

What ships with it

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

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 · 95 lines · 257 tokens per session scan A 55876d6616da

Subscribe to this mod's changes

motor-smc-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 257 tokens to every session and 2,640 once invoked, about $0.0013 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-analyze-em

S-parameters, insertion loss, fields, currents, mesh control, and solver selection for RF PCB performance validation. TRIGGER: user asks to compute S-parameters, analyze insertion/return loss, extract fields or currents, compare MoM vs FEM, or control mesh for any RF PCB component. Invoke BEFORE writing sparameters()…

matlab/matlab-agentic-toolkit · 143 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-plan-robot-motion

Plan manipulator motion and generate trajectories in MATLAB. Use when the task involves moving a robot arm between configurations or poses — whether the user says "trajectory," "motion," "path," "move from A to B," or "plan." This skill applies regardless of whether the user explicitly mentions collisions or…

matlab/matlab-agentic-toolkit · 219 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-generate-gnss-waveform

Generate GNSS baseband waveforms (GPS, Galileo, NavIC) with physically realistic or user-specified channel impairments using the Satellite Communications Toolbox. Use when generating GPS L1 C/A, L1C, L2C, L5, Galileo E1, E1C, E5a, E5b, E5, or NavIC L5, S, L1 signals. Covers gpsWaveformGenerator…

matlab/matlab-agentic-toolkit · 175 tokens