Applying FOC techniques to control PMSM with PWM
Version 1.0.0 (52.6 KB) by
Nguyen Khanh Tran
The speed-control concept of PMSM includes speed and current loops as FOC theory.
The concept here is
- Firstly, measure current Iabc from PMSM and convert to (d,q) frame by Park-Clarke transformation
- The PMSM measured speed goes to speed controller, which will gives output as current Iq_ref
- Id_ref is set to zero because we want to control the speed lower than nominal speed of PMSM. If we want to control speed higher than nominal speed of PMSM, Id_ref is set below zero according to flux decay principle.
- Then, two currents Id and Iq go to PI controller, compares with Id_ref, Iq_ref and export two stator voltages u_sd, u_sq
- Two stator voltages u_sd, u_sq go to inverse Park-Clark transformation, which gives out three phase AC Uabc
- After that, Uabc go to PWM block, generate PWM pulse to 6 valves of IGBTs of the Inverter block.
Some important equations:
Relationship between electric and mechanism
Stator voltages usd, usq in (d,q) frame
Flux equations in (d,q) frame
Electrical moment equation
If isd is set to zero, electrical moment me only depends on isq (because flux p is constant)
Stator currents equations in (d,q) frame
Result simulations with speed, moment, current Isq, current Isd
We can see that the speed is tracked to speed_reference, electrical moment is tracked to load, Isd to set to zero as expectation.
Acknowledgments
- I really appreciate Assoc. Prof. PhD Tien Dung Le and senior Quang Vu Truong - University of Da Nang, University of Science and Technology, Vietnam for supporting me this work.
- "Truyền động điện thông minh" book, Prof. PhD Nguyen Phung Quang, Ha Noi University of Science and Technology.
Cite As
Nguyen Khanh Tran (2025). Applying FOC techniques to control PMSM with PWM (https://uk.mathworks.com/matlabcentral/fileexchange/172865-applying-foc-techniques-to-control-pmsm-with-pwm), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2021b
Compatible with R2021b to R2024b
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0 |
