Install
$ agentstack add skill-calebzu-pmsm-control-claude-skills-for-matlab-motor-smc-pmsm ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
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 = AntiPark + SVPWM library blocks. v1 baseline supports SPMSM and mild-saliency IPMSM (Lq/Ld 0 in v1 baseline** — K1 > 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 [controllaw.md](references/controllaw.md) and [critconditions.md §C-CRIT](references/crit_conditions.md).
Goto_The TagVisibility='global'MANDATORY — AntiPark's internalFrom "The"requires the parent'sGoto_Theto publish globally; default'local'is silent failure mode (FOC degenerates to lab-frame open-loop). See base/[brokenfocdiagnostics.md](../motor-pmsm-base/references/brokenfocdiagnostics.md) §F-CRIT 1 + [critconditions.md §G-CRIT](references/crit_conditions.md).- FF Mux input is
ω_e(NOTθ_e) — Cross-decoupling FF formulas need electrical angular velocity, not position. Use a dedicatedGain_Pn_omegablock independent ofGain_Pn(which provides θe forGoto_The). See [ffdecoupling.md](references/ffdecoupling.md) and [critconditions.md §H-CRIT](references/crit_conditions.md). - Add 4 Scopes for human inspection —
Scope_wm_RPM/Scope_iq/Scope_s/Scope_Te. See [critconditions.md §F-CRIT](references/critconditions.md). 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. - Solver =
ode3+ZeroCrossControl='DisableAll'— STA'sSignblock is discontinuous. Variable-step or ZC ON causes step explosion. See [critconditions.md §E-CRIT](references/critconditions.md). - SVPWM sector=7 startup workaround — At t=0 transient,
Vα=Vβ=0makes the SVPWM library'sSector_Caculateoutput sector=7 (invalid). Apply local-instance workaround on the library block. See [svpwmworkaround.md](references/svpwmworkaround.md).
Build Flow
| Phase | Action | Reference | |---|---|---| | 0 | Validate inputs + sanity grid | base/[prebuildgrid.md](../motor-pmsm-base/references/prebuildgrid.md) | | 1 | Plant layer (powergui, DC, UB, PMSM, TL Step, BusSelector with internal dq) | (this skill) | | 2 | θe calc + Goto_The TagVisibility='global' (G-CRIT) | [critconditions.md](references/critconditions.md) | | 3 | Outer Speed SMC (PD sliding + STA + Saturationiq) | [controllaw.md](references/controllaw.md) | | 4 | Inner Current PI ×2 (PZC, with LimitOutput + AW clamping) | [controllaw.md](references/controllaw.md) | | 4.5 | Cross-decoupling Feedforward (Gain_Pn_omega independent block) | [ffdecoupling.md](references/ffdecoupling.md) | | 5 | Modulation (AntiPark + SVPWM library + Universal Bridge) | [svpwmworkaround.md](references/svpwmworkaround.md) | | 6 | Logger (14 channels, 4 SMC-specific) | [critconditions.md §F-CRIT](references/critconditions.md) | | 7 | 4 Scopes (wmRPM / iq / s / Te) | [critconditions.md §F-CRIT](references/critconditions.md) | | 8 | Solver (Fixed-step ode3 + ZC OFF) | [critconditions.md §E-CRIT](references/critconditions.md) | | 9 | InitFcn injection | [critconditions.md §D-CRIT](references/critconditions.md) | | 10 | Layout cleanup + self-tests | [acceptancecriteria.md](references/acceptancecriteria.md) |
Required User Inputs (25)
Ask user before starting. Defaults in [parameterdefaults.md](references/parameterdefaults.md).
| Group | Parameters | |---|---| | Machine (6) | Pn, Rs, Ld, Lq (mild-saliency Lq/Ld 0 (v1 baseline, default 0.008) | | Power stage (1) | Vdc (default ≥ 1.5·√3·ω_e_max·ψ_f, i.e. Vdc/√3 ≥ 1.5× peak phase BEMF ω_e_max·ψ_f) | | Control (3) | iq_max, T_max (default 1.5·Pn·ψf·iq_max), TL_max always asked (Lyapunov bound input) | | SMC design (4) | lambda_pd_settling (default 10 ms), Tf_deriv (default Tsc), K1_sta (auto), K2_sta (auto) | | Current PI (1) | omega_c_inner (default 2000 rad/s, ≈ 5× SMC bandwidth) | | Sampling (3) | Tsc (default 50 μs), step_size (default 1 μs; step_size ≤ Tsc/50), ramp_time (default 0.5 s) | | Mode** (1) | motor_type (default 'SPMSM'; 'IPMSM-mild' for Lq/Ld Ld, Lq/Ld < 2 | id_ref = 0 workable | | IPMSM strong | Lq/Ld ≥ 2 | MTPA mid-loop required (out of v1 scope) |
Topology does not change — same blocks, same wiring, same sliding surface, same STA, same CRIT conditions.
Out-of-scope sub-types: SynRM (ψ_f ≈ 0), IM, BLDC trapezoidal — different prediction equations.
Sibling Skills
- [motor-pmsm-base](../motor-pmsm-base/SKILL.md) — base infrastructure
- [motor-fcs-mpc](../motor-fcs-mpc/SKILL.md) — FCS-MPC alternative
- [motor-dtc-pmsm](../motor-dtc-pmsm/SKILL.md) — DTC alternative
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: calebzu
- Source: calebzu/pmsm-control-claude-skills-for-matlab
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.