PMSM with Thermal Model
This example shows a nonlinear model of a PMSM with thermal dependency. The PMSM behavior is defined by tabulated nonlinear flux linkage data. Motor losses are turned into heat in the stator winding and rotor thermal ports.
Model

Thermal Model Subsystem

Simulation Results from Simscape Logging
The plot below shows motor speed and winding currents as the control system attempts to track a reference signal. A load torque is applied to the shaft, and the effect on the system is shown in the winding currents.

The plot below shows motor speed, torque, and temperature of motor components. The thermal model of the motor models heat transfer between the three windings and the rotor.

Results from Real-Time Simulation
This example has been tested on these platforms:
Speedgoat™ Performance real-time target machine with an Intel® 3.5 GHz i7 multi-core CPU and 4 GB RAM.
dSPACE® SCALEXIO LabBox with Intel® Core XEON E3-1275v3 at 3.5GHz and 4 GB RAM.
You can run this model in real time with a step size of 50 microseconds by using the Simscape local solver. For small sample rates, a task overrun might occur during the initial task execution due to a cold cache. To avoid this overrun, if the selected platform supports these options, relax the start-up behavior by specifying a limited number of task overruns or increasing the sample time of periodic tasks during the start-up phase of the real-time application.