Tutorial: Co-Simulating an SPM Motor with Flux 2D
Create an Activate model that supplies a three-phase bridge current into a Flux 2D model of a Surface Mounted Permanent Magnet (SPM) motor, and co-simulate the models.
The co-simulation process includes four basic steps:
- Create a Flux model. For this tutorial, a Flux model of an SPM motor is provided for you.
- Generate the Flux coupling component required for Activate to read in the Flux model data.
- Create an Activate model and include the Flux block for reading in the Flux coupling component.
- Co-simulate the models in Activate.
Files for This Tutorial
SPM_Activate_Regulation.F2STA (the coupling file exported from Flux), SPM_Activate_RegulationF2STA.FLU (the Flux model file), SPM_Regulation_No_load.scm (the Activate model file)
Overview of the Flux SPM Motor
The Flux model is a brushless, AC, Surface Mounted Permanent Magnet motor applicable for electric vehicles.
- Fixed part (stator) including yoke, slots, and windings
- Air gap
- Moveable rotor with embedded magnets
The SPM motor is driven with a three-phase bridge current (the freewheeling diodes are neglected). The constant speed operation of the motor at 1000 rpm with inverter driver is simulated to yield motor torque, speed, position and phase current. The inverter switching scheme is rotor-position dependant.
The inputs for the SPM motor are defined as multi-physical parameters and include:
- I1: Physical quantities: μr, Bs, Br
- I2: Electrical quantities: resistance, voltage, current
- I3: Mechanical quantities: position, speed, resistant force, resistive torque
The outputs for the SPM motor are scalar I/O settings that retrieve values through the sensors, formulas (forces and couples) and parameters (position, speed, acceleration).
Generating the Coupling Component in Flux
Load the Flux model and generate the coupling component with the required inputs, outputs and parameters.
Creating the Activate Model
Create a model to feed a three-phase bridge circuit.
Co-Simulating the Activate and Flux Models
During co-simulation, the Activate model supplies a three-phase bridge current into the Flux model of the SPM motor. The simulation results show the performance of the SPM motor including position, speed and torque.