# Spatial Harmonic PMSM drive using SSN with ultra-stable high-impedance mode (R2017b+)

This demo shows how to use the JMAG Spatial Harmonic PMSM model with TSB-RD in SSN. The model is notably extremely stable in high-impedance mode, Does NOT require any numerical snubbers.

Note that this demo requires eFPGAsim installed, for some shared files. (It does not require a working eFPGAsim license.)

**The topology of the PMSM motor used in this demo (JMAG model 028)**

The theory of the JMAG Spatial Harmonic PMSM (SH-PMSM) model is explained in detail here[1].

The Spatial Harmonic PMSM model is a phase-domain model with tables of differential inductance, total flux, and torque. The model notably includes the cogging torque.

**Spatial Harmonic PMSM working equations**

The SH-PMSM Flux equations are updated according to the values of current amplitude, current angle (atan(Id/Iq), and rotor position. Notably, the flux is integrated along the slope of the differential inductance at each operating point.

**Incremental (or differential) inductance (SH slope) versus steady-state inductance (VDQ slope) at the operating point '0'**

**Example of 3-D flux and torque tables**

## Demonstration

The demonstration model can be driven either by a 3-phase sinusoidal source or by a 2-level inverter (TSB-RD) with 3 kHz PWM.

After initial transients, the model currents stabilize in a steady-state manner, then the source breaker is opened and the current drops to zero, without any oscillations.

The motor is driven at fixed mechanical speed with a reasonable source amplitude and phase (AC or PWM equivalent) to produce currents and torque in this motor (JMAG model 028) specification range. The user can modify these values to modify current and torque.

Other JMAG models can be used and many examples are available at https://www.jmag-international.com/modellibrary. According to the chosen motor Back-EMF and speed, the model sources amplitude and angle must be adjusted to produce reasonable currents and torque.

**References**