MATLAB: How to replicate Bode plot of PSS, psbPSSbode.fig, in shipped example power_PSS

bodegenericplotpowerpower_psspsbpssbode.figSimscapestabilizersystem

How do I replicate Bode plot of PSS, psbPSSbode.fig, in shipped example power_PSS?

Best Answer

In the shipped example, "power_PSS", there is a green colored masked subsystem named, "Show Bode plot of PSS". If you double click this plot it opens a figure with a bode plot containing three sets of data. This is launched by the subsystem's OpenFcn Callback containing:
>> openfig('psbPSSbode.fig');
This figure (.fig) file is shipped with the example, but there is no explanation on how this is created.
These three plots were created to model the dynamics of three Power System Stabilizer blocks within the example.
You can find these blocks from the top level of power_PSS under the following path: power_PSS/Area 1/M1: Turbine & Regulators. In this subsystem there are three colored blocks, MB-PSS (magenta), Delta w PSS (Kundur) (green), and Delta Pa PSS (blue).
The blocks, Delta w PSS (Kundur) (green), and Delta Pa PSS (blue), are both Generic Power System Stabilizer blocks. That are made up of the blocks shown in its documentation here.
You can notice that these blocks in combination make up a transfer function. Therefore, you can create an equivalent transfer function using the tf function for the necessary blocks by matching the input parameters of the Generic Power System Stabilizer block to their corresponding child blocks in the figure above. Then combine the transfer functions.
The final step is to create the bode plot using the bode function.
The MB-PSS (magenta) block is a Multiband Power System Stabilizer. A similar workflow can be applied to this block by creating transfer functions. Just keep in mind it is much more complicated than the previous two.
Related Question