# Motor Foc Ltid Pmsm

> PMSM FOC + Load-Torque Estimator + Feed-Forward Builder. Build a field-oriented speed controller for a three-phase voltage-source-inverter-driven PMSM (SPMSM / mild-saliency IPMSM via parameterization) in Simulink, augmented with a linear load-torque state estimator (Luenberger + Kalman-filter family, 7 selectable variants on one shared structure) whose estimate is fed forward into the q-axis cur…

- **Type:** Skill
- **Install:** `agentstack add skill-calebzu-pmsm-control-claude-skills-for-matlab-foc-ltid`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [calebzu](https://agentstack.voostack.com/s/calebzu)
- **Installs:** 0
- **Category:** [Productivity](https://agentstack.voostack.com/c/productivity)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [calebzu](https://github.com/calebzu)
- **Source:** https://github.com/calebzu/pmsm-control-claude-skills-for-matlab/tree/main/extended/foc_ltid

## Install

```sh
agentstack add skill-calebzu-pmsm-control-claude-skills-for-matlab-foc-ltid
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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  **F9.b colored variants use case B** (shape the *measurement* noise, keep `T_L` as state 2): the shared atom hardcodes `est_load=xhat(2)`, so the shaping state must be appended (case A would relocate `T_L`). Both placements are valid F9.b.

## Triggers / Skip

| ✅ Use | ❌ Skip |
|---|---|
| Build / port / extend an FOC speed loop with load-torque estimation + feed-forward | FCS-MPC, DTC, SMC, sensorless/position estimation, scalar V/Hz, BLDC trapezoidal |
| Luenberger / Kalman-family load-torque observer + FF disturbance rejection | Induction-motor FOC, SynRM (`ψ_f≈0`), strong-saliency IPMSM MTPA, weak-field |
| Demonstrating FF-on vs FF-off speed-dip reduction at a load step | Pure theory (observability proofs, KF derivation), paper writing |
| Generalizing the method to a new PMSM machine parameter set | MATLAB perf tuning, unit tests |

## Generalization Across Sub-Types

| Sub-type | 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 is invariant: same six modules, same estimator structure, same FF path, same CRIT conditions. The **plant** can be swapped between the equation-linear baseline (clean mechanical dynamics for the estimator study) and the Simscape switched plant (realism; survives PWM ripple) via `plant_sel` with no controller change — the estimator/FF layer is plant-agnostic.

## Shareable assets (by pointer — do not duplicate)

- `../../shared/formulas/pmsm_formulas.md` — base PMSM physics §0–§7 + speed-PI §A (signed).
- `formulas/pmsm_foc_ltid_formulas.md` — method formulas **F1** (dq current-PI IMC + decoupling), **F2** (augmented state model), **F3** (observability), **F4/F5** (Luenberger), **F6** (recursive KF), **F7** (steady-state KF ↔ Luenberger equivalence), **F8** (feed-forward law), **F9.a/F9.b/F10** (correlated / colored / continuous).
- `../../shared/building_blocks/pmsm_blocks.slx` (+ manifest) — base atoms (Clarke/Park/Anti_Park transforms, Simscape PMSM/Universal_Bridge/SVPWM/sources/powergui).
- `building_blocks/foc_ltid_blocks.slx` (+ manifest) — the `KF_Estimator_EML` atom (generic discrete KF recursion; matrices via input ports, zero numerics).
- `building_blocks/foc_ltid_api_notes.md` — R2024b platform facts (§A.1 Fcn-no-mod/rem; §E.1 KF sizing recipe).

## Sibling Skills

- [motor-pmsm-base](../../.claude/skills/motor-pmsm-base/SKILL.md) — base infrastructure
- [motor-fcs-mpc](../../.claude/skills/motor-fcs-mpc/SKILL.md) — FCS-MPC current control
- [motor-dtc-pmsm](../../.claude/skills/motor-dtc-pmsm/SKILL.md) — Direct Torque Control
- [motor-smc-pmsm](../../.claude/skills/motor-smc-pmsm/SKILL.md) — Sliding Mode Control speed loop

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [calebzu](https://github.com/calebzu)
- **Source:** [calebzu/pmsm-control-claude-skills-for-matlab](https://github.com/calebzu/pmsm-control-claude-skills-for-matlab)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-calebzu-pmsm-control-claude-skills-for-matlab-foc-ltid
- Seller: https://agentstack.voostack.com/s/calebzu
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
