LabVIEW Electric Motor Simulation Toolkit API Reference

Part 2: Testing the Control Algorithms (Electric Motor Simulation Toolkit)

  • Updated2023-02-21
  • 3 minute(s) read

Before simulating an electric motor, you must test your control algorithms on a host computer without connecting to any targets. Testing the control algorithms on host computers saves the workload of simulation on FPGA targets.

This toolkit provides built-in examples to help you get familiar with testing the control algorithms. In this example, your control algorithms are written in a closed-loop control system with the LabVIEW VIs and functions. With the help of this example, you can learn how the control algorithms work with the simulator VI.

Complete the following steps to test the control algorithms in the closed-loop example.

  1. Open the PMSM FEA Model Closed Loop VI in the labview\examples\Electric Motor Simulation\PMSM\PMSM FEA Model Closed Loop directory.
    Open example  Find related examples
  2. Run the example VI.
  3. Observe the results returned from the Rotor Velocity [RPM] indicator. The blue wave is the velocity setpoint that you specified, while the red wave is the velocity of the motor. You can see that the motor speed is gradually getting closer to the velocity setpoint.
  4. On the Motor tab, change the Velocity Setpoint [RPM] to 1500.
  5. Observe the changes of Rotor Velocity [RPM]. The velocity setpoint is 1,500 and the motor speed is very close to 1,500.
  6. Change the Velocity Setpoint [RPM] to a negative value and observe the changes of the motor speed.
  7. Change the Load Torque [Nm]. The motor adjusts the speed to keep approaching the velocity setpoint.
  8. Click the Inverter tab. Set the Inverter Type to Advanced. Choose a Fault Type. Observe the results returned from the indicators.
  9. Click the Temperature tab. Change the Coil Temperature [K] and the Magnet Temperature [K].
  10. Click Stop to stop the example.

Open the block diagram of the PMSM FEA Model Closed Loop VI to view how the control algorithms work with the simulator VI. You can modify the control algorithms in this example to meet your application requirements. You also can replace the control algorithm with your new electric control unit (ECU) control algorithms and test if the control algorithms work with the simulator.

Part 1: Testing the FEA Model Part 3: Simulating a PMSM on an FPGA Target

Log in to get a better experience