Controlling an Electric Motor (Electric Motor Simulation Toolkit)
- Updated2023-02-21
- 4 minute(s) read
After choosing a simulation model and obtaining the necessary motor parameters, you can add a control terminal to the simulator. The control terminal, or the controller, contains control algorithms which manipulate all the calculations related to the simulator.
For hardware-in-the-loop (HIL) simulation, the controller and simulator work in a closed-loop system.
Closed-Loop Control System
Closed-loop control systems are systems with feedback. Feedback is a process in which the output signal of a dynamic system is passed, or fed back, to the input to regulate the next output. In a closed-loop control system, the controller gets speed feedback from the electric motor and keeps the motor running at a velocity approximately equal to the velocity setpoint.
The following figure shows a closed-loop system that consists of a controller and an electric motor.

In the electric motor simulation, the motor is usually not a real electric motor, but a simulated motor. If you use the Electric Motor Simulation Toolkit, replace the simulated motor with a simulator VI. The toolkit provides the following VIs for simulating electric motors.
- ACIM Constant Parameter Model VI
- PMSM Constant Parameter Model VI
- PMSM Variable Parameter Model VI
- PMSM FEA Model VI
- SRM Linear Model VI
- SRM FEA Model VI
The following process describes how a controller controls the motor velocity in a closed-loop system.
- The controller sends a control message through the inverter to the motor.
- The motor speeds up or down based on the control message.
- The motor returns the motor state to a device which estimates the velocity on the basis of the motor state. If you simulate on a host computer, use the Motor Speed and Rotor Position VI to estimate the rotor velocity.
- The device returns the velocity back to the velocity setpoint.
- If the rotor velocity does not reach the velocity setpoint, the controller sends a new message to update the motor velocity.
The speed control algorithm ensures that the rotor velocity approaches the velocity setpoint. In other words, the electric motor is eventually running at the velocity that is approximately equal to the velocity setpoint.
Related Examples
This toolkit provides the following closed-loop examples for controlling a simulated motor on the host computer.
- ACIM Constant Parameter Model Closed Loop VI in the labview\examples\Electric Motor Simulation\ACIM\ACIM Constant Parameter Model Closed Loop directory:
Open example
Find related examples - 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 - PMSM Variable Parameter Model Closed Loop VI in the labview\examples\Electric Motor Simulation\PMSM\PMSM Variable Parameter Model Closed Loop directory:
Open example
Find related examples - PMSM Constant Parameter Model Closed Loop VI in the labview\examples\Electric Motor Simulation\PMSM\PMSM Constant Parameter Model Closed Loop directory:
Open example
Find related examples - SRM FEA Model Closed Loop Control VI in the labview\examples\Electric Motor Simulation\SRM\SRM FEA Model Closed Loop Control directory:
Open example
Find related examples - SRM Linear Model Closed Loop Control VI in the labview\examples\Electric Motor Simulation\SRM\SRM Linear Model Closed Loop Control directory:
Open example
Find related examples