A simple closed-loop SPWM frequency and modulation index controller model was developed for this example. It has been compiled into .dll and .so files for execution on both Phar Lap and Linux RT targets, respectively.  The controller model is configured to run on the Real Time CPU and will be executed by the VeriStand Engine.  Data is routed from the CPU simulation (local controller) to the FPGA simulation (eHS, SCIM model) using the VeriStand System Configuration Mappings.

Local Controller File Path: <Public Documents>\National Instruments\<NI VeriStand 20xx>\Examples\OPAL-RT\Power Electronics Add-On\Dual PMSM SH Local Control\Local Controller\VoltPerHertzController

Exploring the Local Controller

InportDefault Value
Dclink0
DesiredSpeedRPM0
ModIndexLookup


00.001
1206
24012
48025
72038
120062
180092
2000100
2400122
3000150


Poles5
RampRate10



Exploring the Mappings to and from the Local Controller

The VeriStand System Configuration Mappings are used to route signals between the local controller and the other model components simulated on the FPGA. 

SourcesDestinations
Controller/User Channels/Grid AmplitudeController/Custom Device/OPAL-RT Power Electronics Module/Circuit Model/Signal Generators/Sinewave Generators/SWG Generator 0/Amplitude
Controller/User Channels/Grid AmplitudeController/Custom Device/OPAL-RT Power Electronics Module/Circuit Model/Signal Generators/Sinewave Generators/SWG Generator 1/Amplitude
Controller/User Channels/Grid AmplitudeController/Custom Device/OPAL-RT Power Electronics Module/Circuit Model/Signal Generators/Sinewave Generators/SWG Generator 2/Amplitude
Controller/Simulation Models/Models/Volts per Hertz Controller/Outports/InverterFrequencyRefController/Custom Device/OPAL-RT Power Electronics Module/Circuit Model/Signal Generators/SPWM Generators/SPWM Frequency Generators/SPWM Frequency Engine 0
Controller/Simulation Models/Models/Volts per Hertz Controller/Outports/ModIndexRef Controller/Custom Device/OPAL-RT Power Electronics Module/Circuit Model/Signal Generators/SPWM Generators/SPWM Carrier/Modulation Index
Controller/Custom Device/OPAL-RT Power Electronics Module/Circuit Model/Measurements/Y04 VdcController/Simulation Models/Models/Volts per Hertz Controller/Inports/Dclink