--%> --%>

IPM Motor with vector control in Simulink

Motors and generators with MagNet

The vector control of an Interior Permanent Magnet (IPM) Brushless DC motor involves running both Simulink and MagNet transient solvers simultaneously.

Co-simulations allow the strengths of two separate simulators to be combined, in this case the powerful system-level simulation of Simulink with the dynamic electrical machine analysis of MagNet. A continuous data exchange between the two keeps the shared quantities (voltages and currents) synchronized.

IPM motor with vector control in Simulink

METHODS and RESULTS

SIMULINK MODEL

The Simulink model, which implements the closed loop vector control of the motor speed, is shown on the left. The element which couples to MagNet is the red component with the MagNet logo.

View larger image

MESH used for MAGNET'S PART of the CO-SIMULATION

The link component is designed to allow MagNet to take advantage of symmetry, by allowing the currents and/or voltages to be scaled in the transfer between Simulink and MagNet. In this case the four windings of each phase are connected in a series-parallel configuration, so the current and the voltage are both scaled by a factor of two in the Simulink component. Shown here is the mesh used by MagNet for its part of the simulation. At each time step, as the rotor changes position, the air gap is remeshed, which allows motional effects to be modeled quickly and accurately.

View larger image

COMMANDED SPEED vs ACTUAL SPEED

Using vector control, a feedback loop monitors the motor speed and varies the motor torque to maintain a desired speed. The graph here shows the commanded speed (1800 rpm, shown in green) and the actual speed (shown in blue). The transient simulation starts in Simulink, which invokes MagNet transparently to jointly run its electromagnetic simulation. While both simulations are running they are constantly passing data back and forth to synchronize the voltages and currents.

View larger image

ACTUAL SPEED ERROR

The goal of motor control is to have the motor rotating at a precise speed. By modifying the proportional and integral gain values of the speed control loop, the response time of the IPM Motor as well as the maximum actual speed reached can be modified depending on the design constraints. Shown here is the relative error of the actual speed. It can be seen that the motor reaches a steady-state tolerance of 1% in less than 75ms.

View larger image

VECTOR VOLTAGES COMMANDED by the FEEDBACK CIRCUIT

This graph shows the vector voltages commanded by the feedback circuit. The system blocks in the lower left quadrant of the circuit implement an approximate inverse model of the motor, which means that the speed feedback need only generate small corrections to these voltages.

View larger image

PHASE VOLTAGES COMMANDED by the CONTROLLER

The graph shows the phase voltages commanded by the controller, which are obtained from the vector voltages by a DQ to ABC transformation. The element which performs this transformation is a user defined S-Function which implements the mathematical operations.

View larger image

PHASE CURRENTS

MagNet also takes the mechanical loads on the motion component into account, as well as velocity effects such as back emf. The resulting phase currents shown here are calculated by performing a finite element analysis, and are returned to Simulink.

View larger image

VECTOR CURRENTS

This graph shows the actual vector currents. A limiter component in the feedback loop keeps the commanded current magnitude under 10 Amps. These currents are obtained from the phase currents using a user-defined ABC to DQ transformation element.

View larger image

MAGNETIC TORQUE on the ROTOR

The previous graphs were generated by "Scope" blocks, which is just one of the many ways of extracting data from Simulink. Once the simulation is complete, MagNet's post-processor can be invoked to plot the magnetic quantities, such as flux linkage and torque, as well as fields, such as flux density and current density. The magnetic torque on the rotor is plotted here.

View larger image

DATA EXCHANGE between SIMULINK and MAGNET

The link which orchestrates the data exchange between Simulink and MagNet is designed to allow different time steps in each application while both are running a transient simulation. In this example MagNet is running with a time step of only 0.2 ms, while Simulink is using a finer time step (1microsecond).