This example shows an interior permanent magnet synchronous machine (IPMSM) propelling a simplified axle-drive electric vehicle. A high-voltage battery feeds the IPMSM through a controlled three-phase converter. The IPMSM operates in both motoring and generating modes. The vehicle transmission and differential are implemented using a fixed-ratio gear reduction model. The Vehicle Controller subsystem converts the driver inputs into a relevant torque command. The Drive Controller subsystem controls the torque of the IPMSM. The controller includes a multi-rate PI-based control structure. The rate of the open-loop torque control is slower than the rate of the closed-loop current control. The task scheduling for the controller is implemented as a Stateflow® state machine. The Scopes subsystem contains scopes that allow you to see the simulation results.
The plot below shows the requested and measured torque for the test, as well as the phase currents in the electric drive.