Main Content

Interfacing Simulink Models with Simscape Electrical Specialized Power Systems

This example shows the interfaces between Simulink® and Simscape™ Electrical™ Specialized Power Systems to design a custom synchronous machine model. It also shows an example of a customized Synchronous Machine block

Introduction

In this example, we use the Synchronous machine blocks as an example to show the interfaces between Simulink and Simscape Electrical Specialized 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 Specialized 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 Specialized Power Systems library blocks 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_customize function of powergui.

Description

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 Specialized 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 Specialized 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 Specialized Power Systems' signals.

In general, measurement blocks (voltage/current/impedance) serve as an interface between Simscape Electrical Specialized Power Systems and Simulink, and controlled source blocks (voltage/current) between Simulink and Simscape Electrical Specialized Power Systems. This is the recommended template for interfacing custom-built blocks in Simulink, with Simscape Electrical Specialized Power Systems.

Simulation

Run the example to see that there is no differences between the two circuits.

Figure 2: Results obtained from the Specialized Power Systems model.

Figure 3: Results obtained from the custom-made Simulink model.

Conclusion

This model presents a model of the Synchronous machine block, but users may just as well employ and edit any standard block in Specialized Power Systems. Extending this further, using the recommended template, it is even possible to create any custom block not provided with Specialized Power Systems, in Simulink, and then interface it seamlessly with a Simscape Electrical Specialized Power Systems circuit.