Documentation Home Page Power Electronics Add-On for NI VeriStand Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

Machine Sensors Example Configuration

Expand each of the sections below to explore the parameters configured in the Machine Sensors example. The information on this page can also be used to validate project settings or to re-create the example in a new VeriStand project.

Example Directory

<Public Documents>\National Instruments\<NI VeriStand 20xx>\Examples\OPAL-RT\Power Electronics Add-On\Machine Sensors

Project Path

<Machine Sensors>\Project\<NI PXIe-XXXX>\Machine Sensors.nivsprj

Opening the Example

  1. To avoid modifying the original example, make a local copy of the Example Directory shown above.

  2. Open VeriStand and Browse to the copied directory, then continue browsing to the Project Path and select the VeriStand Project (.nivsprj) file.

  3. Click Configure... to open the System Definition file.

  4. See the following sections on this page to explore the parameters configured in the Configuration Tree of the System Definition file.

Hardware Configuration

  1. In the Configuration Tree, expand Controller >> Custom Devices and click the Power Electronics Add-On custom device to open its configuration page.

  2. The Hardware Configuration selected in the Configuration dropdown depends on the FPGA card targeted by the project. Note that this example could be re-created using any Hardware Configuration that contains a Resolver, Encoder, or Hall Effect Sensor.

NI FPGA Card

Hardware Configuration

NI FPGA Card

Hardware Configuration

NI PXIe-7868R

eHSx32_Dual_PMSM_VDQ_IO_32DO_7868R

NI PXIe-7891

eHSx64_Quad_PMSM_VDQ_IO_7891

Machine Sensors HW Config.png

 

Circuit Model

Because no Circuit Model is required for this example, it uses a placeholder circuit consisting of one Source, one Switch, and one Measurement.

  1. In the Configuration Tree, expand Power Electronics Add-On and click Circuit Model.

  2. The Circuit Model File Path points to the currently loaded Circuit Model. Open the file in Simulink to observe the circuit.

  3. (optional) Click Reload to trigger a model update in the System Definition.

  4. (optional) Click the Refresh button to see additional model information.

Circuit Model File Path: <Machine Sensors>\Circuit Model\PlaceholderCircuit.slx

Sources

The Sources page maps signals to each source of the circuit model. In this example, the Source mapping configuration does not affect the results of the simulation because the circuit is simply a placeholder.

  1. In the Configuration Tree, expand Circuit Model and click Sources. This page is populated with a list of sources from the circuit model.

  2. The mappings are configured as shown below; any Group and Element can be mapped to Source.

 

Switches

The Switches page maps signals to each switch of the circuit model. In this example, the switch mapping configuration does not affect the results of the simulation because the circuit is simply a placeholder.

  1. In the configuration tree, expand Circuit Model and click Switches. This page is populated with a list of switches from the circuit model.

  2. The mappings are configured as shown below; any Group and Element can be mapped to a switch.

 

Machine Models

In this example, we manually rotate the machine models so that their respective Resolver, Encoder, and Hall-Effect Sensors generate output signals. Because we are interested only in the mechanical rotation of the machine, we can leave the Input Mapping Configuration and the electrical Machine Configuration parameters unconfigured. Each machine model is set to Speed Controlled Mode to allow its speed to be commanded via the User-Defined Speed channel.

  1. In the Configuration Tree, expand Circuit Model >> PMSM BLDC X >> Mechanical Model and click the Mechanical Model Mode channel.

  2. For all machine models, the Default Value of the channel is set to 0 for Speed Controlled Mode.

Sensors

The PXIe-7868R version of this example uses both its available PMSM BLDC models, while the PXIe-7891 version uses three of its four models. The table below shows which PMSM BLDC model is used to simulate each type of sensor. Follow the steps in the Resolver, Quadrature Encoder, and Hall Effect Sensor sections below to understand how the sensor parameters are configured.

 

PXIe-7868R

PXIe-7891

 

PXIe-7868R

PXIe-7891

Resolver

PMSM BLDC 1

PMSM BLDC 1

Quadrature Encoder

PMSM BLDC 1

PMSM BLDC 2

Hall Effect Sensor

PMSM BLDC 2

PMSM BLDC 3

 

Resolver

See the Resolver documentation for a full description of the model and its parameters.

  1. In the Configuration Tree, expand PMSM BLDC X and click Resolver.

  2. The Angle Conditioning and Gain Configuration parameters do not need to be modified because they are available as VeriStand channels and can be modified during the simulation.

  3. In this example, the Internal Carrier parameters are configured as shown below.

  4. (optional) Modify the Excitation Frequency and Initial Carrier Angle to observe their impacts on the Resolver output signals. They are not editable during the simulation.

Internal Carrier

Internal Carrier

Initial Carrier Angle (deg)

0

Excitation Frequency (Hz)

10

Enable Internal Carrier

TRUE

Force Initial Angle

FALSE

Enable Resolver Parameters as Channels

TRUE

Quadrature Encoder

See the Encoder documentation for a full description of the model and its parameters.

  1. In the Configuration Tree, expand PMSM BLDC X and click Encoder.

  2. Set the Encoder Mode to Quadrature Encoder to view the Encoder parameters.

  3. In this example, the encoder Configuration parameters are configured as shown below.

  4. (optional) Modify these parameter values to observe their effects on the Quadrature Encoder output signals. They are not editable during the simulation.

Configuration

Configuration

Encoder Mode

Quadrature Encoder

Number of Pole Pairs

1

Angle Offset (deg)

0

Number of Pulses/Revolution

10

Rotation Type

A Leads B

Polarity

Active High

Hall Effect Sensor

The Hall Effect Sensor is a mode of the Encoder model. Note that it is not available for the IM SM machine model.

  1. In the Configuration Tree, expand PMSM BLDC X and click Encoder.

  2. Set the Encoder Mode to Hall Effect to view the Hall Effect Sensor parameters.

  3. In this example, the Hall Effect Sensor Configuration parameters are configured as shown below.

  4. (optional) Modify these parameter values to observe their effects on the Quadrature Encoder output signals. They are not editable during the simulation.

Configuration

Configuration

Encoder Mode

Hall Effect

Number of Pole Pairs

1

Speed Sign

Clockwise

Position A (deg)

0

Position B (deg)

120

Position C (deg)

-120

 

Waveform Channels

Waveform Channels allow signals to be streamed from the FPGA at a rate faster than that of the CPU execution.

  1. In the Configuration Tree, expand Circuit Model and click Waveforms.

  2. The signals in the example are mapped to the Waveform channels as shown below. The data from these channels will be streamed at the Sample Rate (S/s) specified at the bottom of the page.

 

 

 

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter