This example shows the interfaces between Simulink® and SimPowerSystems™ to design a custom synchronous machine model.
|On this page…|
In this example, we use the Synchronous machine blocks as an example to show the interfaces between Simulink® and SimPowerSystems™. There are two similar circuits shown in parallel. The top circuit model shows the starting of a a synchronous machine using blocks from the SimPowerSystems library. The circuit below it is identical in all respects, but for a custom-built model of the Synchronous machine.
Figure 1: Starting of the synchronous motor. The top model is modeled using SimPowerSystems library block while the lower model is a custom-made model bulit using Simulink.
Click to look under the mask of the official Synchronous machine block,and find the core functionality of the block modeled in the 'Source' and the 'SM_mechanics' subsystems. It is important to note that these subsystems are built up from either Simulink elements or basic SimPowerSystems blocks. Users may need to change this representation to add their own functionality to the block, and meet their custom needs.
Now look under the mask of the custom-built Synchronous machine block (in the bottom circuit), and observe the three subsystems. The 'Measurement System' in green, contains the voltage measurement blocks which convert the SimPowerSystems' signals into Simulink signals. The 'Simulink System Model' in yellow, contains the core functionality of the Synchronous machine block, comprising the 'Source' and the 'SM_mechanics' subsystems, borrowed from the standard shipped block. It is here that users may customize and manipulate the extracted Simulink signals to any degree. Lastly, the 'Current Injection System' in blue, contains the controlled current source blocks which convert Simulink signals into SimPowerSystems' signals.
In general, measurement blocks (voltage/current/impedance) serve as an interface between SimPowerSystems and Simulink, and controlled source blocks (voltage/current) between Simulink and SimPowerSystems. This is the recommended template for interfacing custom-built blocks in Simulink, with SimPowerSystems.
Run the example to see that there is no differences between the two circuits.
Figure 2: Results obtained from the SimPowerSystems model.
Figure 3: Results obtained from the custom-made Simulink model.
This model presents a model of the Synchronous machine block, but users may just as well employ and edit any standard block in SimPowerSystems. Extending this further, using the recommended template, it is even possible to create any custom block not provided with SimPowerSystems, in Simulink, and then interface it seamleassly with a SimPowerSystems circuit.