Interfacing Simulink Models with Simscape Power Systems Specialized Technology
This example shows the interfaces between Simulink® and Simscape™ Power Systems™ Specialized Technology to design a custom synchronous machine model. It also shows an example of a customized Synchronous Machine block
In this example, we use the Synchronous machine blocks as an example to show the interfaces between Simulink and Simscape Power Systems. There are two similar circuits shown in parallel. The top circuit model shows the starting of a a synchronous machine using blocks from the Simscape Power Systems 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 Simscape Power Systems library block while the middle model is a custom-made model built using Simulink. The bottom model is a customized version of the Synchronous Machine block of powerlib, using the power_cutomize function of powergui
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 Simscape Power Systems 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 middle circuit), and observe the three subsystems. The 'Measurement System' in green, contains the voltage measurement blocks which convert the Simscape Power Systems' signals into Simulink signals. The 'Simulink System Model', 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', contains the controlled current source blocks which convert Simulink signals into Simscape Power Systems' signals.
In general, measurement blocks (voltage/current/impedance) serve as an interface between Simscape Power Systems and Simulink, and controlled source blocks (voltage/current) between Simulink and Simscape Power Systems. This is the recommended template for interfacing custom-built blocks in Simulink, with Simscape Power Systems.
Run the example to see that there is no differences between the two circuits.
Figure 2: Results obtained from the Simscape Power Systems 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 Simscape Power Systems. Extending this further, using the recommended template, it is even possible to create any custom block not provided with Simscape Power Systems, in Simulink, and then interface it seamleassly with a Simscape Power Systems circuit.