Field Oriented Control of PMSM Drive With PI Control
Field Oriented Control of PMSM Drive With PI Control
𝐈𝐧𝐭𝐫𝐨𝐝𝐮𝐜𝐭𝐢𝐨𝐧
Field Oriented Control, commonly called FOC, is a widely used control technique for achieving accurate speed control of a Permanent Magnet Synchronous Motor (PMSM).

In this MATLAB/Simulink implementation, the PMSM drive is controlled using:
Field Oriented Control
PI-based speed controller
dq-to-abc current transformation
Hysteresis current control
Three-phase voltage source inverter
Rotor position and speed feedback
Stator current feedback
The main objective is to make the actual PMSM speed accurately follow the applied reference speed while maintaining stable electromagnetic torque and stator current.
𝐒𝐲𝐬𝐭𝐞𝐦 𝐎𝐯𝐞𝐫𝐯𝐢𝐞𝐰
The complete PMSM drive contains several interconnected control and power stages.
Component | Function |
DC Source | Supplies DC power to the inverter |
Three-Phase Inverter | Converts DC voltage into controlled three-phase AC |
PMSM | Converts electrical energy into mechanical rotation |
Speed Measurement | Measures the actual rotor speed |
Rotor Angle Measurement | Provides rotor position information |
PI Controller | Generates the reference q-axis current |
dq-to-abc Transformation | Produces three-phase reference currents |
Current Measurement | Measures actual PMSM stator currents |
Hysteresis Controller | Generates inverter switching signals |
Switching Logic | Produces the required six gate pulses |
The inverter directly supplies the PMSM according to the switching signals generated by the current controller.
𝐅𝐢𝐞𝐥𝐝 𝐎𝐫𝐢𝐞𝐧𝐭𝐞𝐝 𝐂𝐨𝐧𝐭𝐫𝐨𝐥 𝐂𝐨𝐧𝐜𝐞𝐩𝐭
FOC controls the PMSM using two current components:
d-axis current, Id
q-axis current, Iq
For the implemented speed-control system:
Control Variable | Setting / Function |
Id reference | 0 |
Iq reference | Generated by the PI speed controller |
Main controlled quantity | PMSM rotor speed |
Current control method | Hysteresis current control |
The q-axis current mainly controls motor torque, while the d-axis reference is maintained at zero in this implementation.
This makes the control structure simple and suitable for understanding PMSM speed regulation.
𝐖𝐨𝐫𝐤𝐢𝐧𝐠 𝐏𝐫𝐨𝐜𝐞𝐬𝐬
The control operation can be understood through the following sequence:
The PMSM rotor speed is measured.
The measured speed is compared with the reference speed.
The difference produces a speed error.
The speed error is processed by the PI controller.
The PI controller generates the Iq reference.
The Id reference is maintained at zero.
Id and Iq references are supplied to the dq-to-abc transformation.
The transformation generates Ia*, Ib*, and Ic* reference currents.
These reference currents are compared with actual PMSM stator currents.
The resulting current errors are processed by the hysteresis current controller.
Switching logic generates the required inverter gate pulses.
The inverter regulates the voltage and current supplied to the PMSM.
The actual motor speed follows the required reference speed.
𝐂𝐨𝐧𝐭𝐫𝐨𝐥 𝐒𝐭𝐫𝐚𝐭𝐞𝐠𝐲
𝐒𝐩𝐞𝐞𝐝 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
The actual PMSM speed is continuously compared with the commanded reference speed.
The resulting speed error is sent to the PI speed controller.
The PI controller determines how much torque-producing current is required and generates the required Iq reference.
𝐝-𝐀𝐱𝐢𝐬 𝐂𝐮𝐫𝐫𝐞𝐧𝐭
The d-axis reference current is fixed at:
Parameter | Value |
Id reference | 0 |
This configuration is commonly used for basic PMSM field-oriented speed control.
𝐑𝐞𝐟𝐞𝐫𝐞𝐧𝐜𝐞 𝐂𝐮𝐫𝐫𝐞𝐧𝐭 𝐆𝐞𝐧𝐞𝐫𝐚𝐭𝐢𝐨𝐧
The Id and Iq references are converted into three-phase current references:
Ia reference
Ib reference
Ic reference
These reference currents become the commands for the inner current-control loop.
𝐑𝐨𝐭𝐨𝐫 𝐀𝐧𝐠𝐥𝐞 𝐅𝐞𝐞𝐝𝐛𝐚𝐜𝐤
The mechanical rotor angle is measured from the PMSM.
It is converted into the required electrical angle using the motor pole information.
This electrical angle is then used for the dq-to-abc transformation.
𝐇𝐲𝐬𝐭𝐞𝐫𝐞𝐬𝐢𝐬 𝐂𝐮𝐫𝐫𝐞𝐧𝐭 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
The three-phase reference currents are compared with the measured stator currents.
The hysteresis controller produces switching commands that force the actual current to follow the reference current.
The complementary switching signals are then arranged to generate the required six inverter gate pulses.
𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐏𝐚𝐫𝐚𝐦𝐞𝐭𝐞𝐫𝐬
The simulation uses a changing speed command and load condition to verify dynamic performance.
Parameter | Initial Condition | Changed Condition |
Reference speed | 100 rad/s | 125 rad/s |
Speed change time | — | 0.05 s |
Load torque | 6 N·m | 3 N·m |
Id reference | 0 | 0 |
The reference speed changes from 100 rad/s to 125 rad/s at 0.05 s.
This allows the controller's tracking capability to be observed clearly.
𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐮𝐥𝐭𝐬
𝐒𝐩𝐞𝐞𝐝 𝐑𝐞𝐬𝐩𝐨𝐧𝐬𝐞
At startup, the motor accelerates toward the initial reference speed of 100 rad/s.
According to the demonstrated simulation:
The PMSM approaches the first speed command in approximately 0.02 s.
The motor then operates close to 100 rad/s.
At 0.05 s, the command changes to 125 rad/s.
The actual PMSM speed increases accordingly.
The new operating speed is reached at approximately 0.06 s.
This demonstrates the tracking action of the PI-based FOC controller.
𝐒𝐭𝐚𝐭𝐨𝐫 𝐂𝐮𝐫𝐫𝐞𝐧𝐭
The stator current shows a larger magnitude during motor startup because additional torque is required for acceleration.
Once the reference speed is reached:
Current settles into a steady operating pattern.
A temporary increase appears when the speed reference changes.
Current settles again after the new speed is established.
𝐈𝐧𝐯𝐞𝐫𝐭𝐞𝐫 𝐎𝐮𝐭𝐩𝐮𝐭
The inverter output changes according to the motor operating condition.
During:
startup,
speed acceleration,
load variation,
and speed-command changes,
the inverter switching pattern adjusts to provide the required PMSM voltage and current.
𝐄𝐥𝐞𝐜𝐭𝐫𝐨𝐦𝐚𝐠𝐧𝐞𝐭𝐢𝐜 𝐓𝐨𝐫𝐪𝐮𝐞
The electromagnetic torque response shows different operating stages.
Operating Stage | Torque Behaviour |
Motor startup | High starting torque |
Speed settling | Torque reduces toward steady value |
Speed command change | Temporary torque disturbance |
New steady operation | Torque settles again |
The transient torque during acceleration is expected because the motor requires additional torque to change speed.
𝐆𝐚𝐭𝐞 𝐏𝐮𝐥𝐬𝐞𝐬
The switching logic generates six gate signals for controlling the three-phase inverter.
These pulses continuously change according to:
reference current,
measured current,
current error,
rotor position,
and motor operating condition.
𝐊𝐞𝐲 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐬
Field Oriented Control of PMSM
PI-based speed regulation
Separate Id and Iq current commands
Id reference maintained at zero
dq-to-abc current transformation
Rotor-angle-based transformation
Three-phase current reference generation
Actual stator-current feedback
Hysteresis current controller
Six inverter switching pulses
Variable reference-speed testing
Variable load-torque testing
Speed, current, torque, voltage, and pulse monitoring
MATLAB/Simulink implementation
𝐀𝐝𝐯𝐚𝐧𝐭𝐚𝐠𝐞𝐬 𝐨𝐟 𝐅𝐎𝐂 𝐟𝐨𝐫 𝐏𝐌𝐒𝐌
FOC provides several useful benefits for PMSM drive control:
Fast speed response
Accurate speed tracking
Effective torque regulation
Good dynamic performance
Independent treatment of flux and torque-related current components
Suitable operation during changing speed commands
Good response under load variations
Convenient implementation using MATLAB/Simulink
𝐀𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧𝐬
Field Oriented Control of PMSM drives is useful in many motor-drive systems, including:
Electric vehicle traction drives
Industrial servo drives
Robotics and automation
CNC machines
Electric pumps
Compressors
High-performance motor drives
Renewable-energy auxiliary drives
Automated manufacturing systems
Research and teaching laboratories
𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠 𝐎𝐮𝐭𝐜𝐨𝐦𝐞𝐬
By studying this MATLAB model, learners can understand:
PMSM speed-control fundamentals
Field Oriented Control architecture
Speed-error generation
PI speed-controller operation
Id and Iq current references
Rotor-angle utilization
dq-to-abc transformation
Three-phase current reference generation
Hysteresis current regulation
VSI switching-pulse generation
PMSM speed and torque response
Dynamic behaviour during speed-command changes
𝐂𝐨𝐧𝐜𝐥𝐮𝐬𝐢𝐨𝐧
The Field Oriented Control of PMSM Drive With PI Control demonstrates a complete closed-loop speed-control system in MATLAB/Simulink.
The PI controller generates the required torque-producing current command, while the dq-to-abc transformation converts the current references into three-phase commands. The hysteresis current controller then generates the switching signals required by the voltage source inverter.
The simulated PMSM successfully follows a reference-speed transition from 100 rad/s to 125 rad/s, while the corresponding stator-current, electromagnetic-torque, inverter-output, and gate-pulse responses illustrate the dynamic behaviour of the complete drive.
This model provides a clear and practical platform for students, researchers, and engineers who want to understand PMSM field-oriented speed control and its MATLAB/Simulink implementation.



Comments