Part 3: Simulating a PMSM on an FPGA Target (Electric Motor Simulation Toolkit)
- Updated2023-02-21
- 3 minute(s) read
In this part, you can verify whether the algorithm can perform correctly with the hardware-in-the-loop (HIL) solution. Before getting your solution equipped with the real I/O modules, you need to test your algorithm with a simpler solution on an FPGA target.
Complete the following steps to simulate a permanent magnet synchronous motor (PMSM) on an FPGA target.
- Open PMSM FEA Model Control Simulation.lvproj in the labview\examples\Electric Motor Simulation\PMSM\PMSM FEA Model Control Simulation directory:
Open example
Find related examples - In the Project Explorer window, right-click the RT PXI Target and select Properties from the shortcut menu to open the Real-Time PXI Properties dialog box.
- In the IP Address/DNS Name field, enter the IP address for the real-time target.
- In the Project Explorer window, right-click the FPGA Target and select Properties from the shortcut menu to open the FPGA Target Properties dialog box.
- In the Resource field, specify the FPGA target hardware.
- In the Project Explorer window, navigate to RT PXI Target»FPGA Target»Build Specifications»PMSM FEA Model Simulator. Right-click the build specification and select Build from the shortcut menu.
- Compile the FPGA code.
- In the Project Explorer window, right-click the PMSM FEA Model Controller VI and select Deploy from the shortcut menu to deploy the VI to the real-time target.
- Open the PMSM FEA Model Controller Simulation VI.
- On the front panel, enter the name of the real-time target in Machine Alias.
- Run the PMSM FEA Model Control Simulation VI.
- On the front panel of the PMSM FEA Model Controller VI, click Enable Control. The real-time controller supplies control signals to the simulated motor and the motor starts running at a fixed velocity.
- Adjust the Velocity Setpoint [RPM] and Load Torque [Nm] on the Motor tab. Verify if the output of motor speed is still approaching the value of the velocity setpoint.
- Click the Inverter tab. Set the Inverter Type to Advanced. Choose a Fault Type. Observe the results returned from the indicators.
- Click the Temperature tab. Change the Coil Temperature [K] and the Magnet Temperature [K].
- Click Stop to stop the control.
Related Information
Using the Project Explorer Window
FPGA Target Properties Dialog Box
Part 2: Testing the Control Algorithms |
Part 4: Composing a Real HIL System |

