motor-smc-pmsm — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited motor-smc-pmsm (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
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.
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):
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.
set_param(mdl, 'InitFcn', ...). See crit_conditions.md §D-CRIT.s = 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.iq_ref output BEFORE feeding to current PI, limits ±iq_max. See crit_conditions.md §B-CRIT.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 control_law.md and crit_conditions.md §C-CRIT.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.Gain_Pn_omega block independent of Gain_Pn (which provides θ_e for Goto_The). See ff_decoupling.md and crit_conditions.md §H-CRIT.Scope_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.Sign block is discontinuous. Variable-step or ZC ON causes step explosion. See crit_conditions.md §E-CRIT.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.| Phase | Action | Reference |
|---|---|---|
| 0 | Validate inputs + sanity grid | base/pre_build_grid.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) | crit_conditions.md |
| 3 | Outer Speed SMC (PD sliding + STA + Saturation_iq) | control_law.md |
| 4 | Inner Current PI ×2 (PZC, with LimitOutput + AW clamping) | control_law.md |
| 4.5 | Cross-decoupling Feedforward (Gain_Pn_omega independent block) | ff_decoupling.md |
| 5 | Modulation (Anti_Park + SVPWM library + Universal Bridge) | svpwm_workaround.md |
| 6 | Logger (14 channels, 4 SMC-specific) | crit_conditions.md §F-CRIT |
| 7 | 4 Scopes (wm_RPM / iq / s / Te) | crit_conditions.md §F-CRIT |
| 8 | Solver (Fixed-step ode3 + ZC OFF) | crit_conditions.md §E-CRIT |
| 9 | InitFcn injection | crit_conditions.md §D-CRIT |
| 10 | Layout cleanup + self-tests | acceptance_criteria.md |
Ask user before starting. Defaults in parameter_defaults.md.
| Group | Parameters |
|---|---|
| Machine (6) | Pn, Rs, Ld, Lq (mild-saliency Lq/Ld < 2 v1; strong saliency deferred), psi_f, J, `B > 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 < 2) |
| Solver (1) | solver (default 'ode3') |
| Scenario (4) | omega_ref_rpm, sim_time, TL_step_t, TL_after |
| ✅ Use | ❌ Skip |
|---|---|
| Build / port / extend SMC speed-loop simulation in Simulink | FCS-MPC, FOC, DTC, sensorless, scalar V/Hz, BLDC trapezoidal |
| Super-twisting / PD-type sliding / boundary layer SMC | Observer-based / adaptive / disturbance-observer / neural-network / fuzzy SMC |
| Robust speed control on PMSM | Strong-saliency IPMSM MTPA mid-loop, weak-field |
| Generalizing SMC to a new PMSM machine parameter set | Pure theory questions, paper writing, MATLAB perf, unit tests |
| Sub-type | Parameter constraint | Strategy |
|---|---|---|
| SPMSM | Ld ≈ Lq | id_ref = 0 |
| IPMSM mild | Lq > 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.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.