Sensorless Field Oriented Control (FOC) for a Permanent Magnet Synchronous Motor (PMSM) Using a PLL Estimator and Equation-based Flux Weakening (FW)
Introduction
Current industry trends favor Permanent Magnet Synchronous Motors (PMSM) due to their high power density, fast dynamic response, high efficiency, and decreasing manufacturing costs. Microchip Technology Inc. offers a range of 16-bit and 32-bit microcontrollers (MCUs) and reference designs to facilitate efficient motor control development. For further information on 32-bit MCUs for Motor Control Applications, refer to "Architectural Highlights of 32-bit MCUs for Motor Control Applications".
Field Oriented Control (FOC)
For PMSM motors, synchronous operation between the rotor and stator fields is crucial; loss of synchronization leads to motor halt. Field Oriented Control (FOC) is a method that uses one flux (rotor, stator, or air gap) as a reference frame for another flux, decoupling the torque and flux-producing components of the stator current. This simplifies control, similar to DC motors. In this application note, the rotor flux serves as the reference frame for the stator and air gap flux. Several Microchip application notes, such as AN1078 ("Sensorless Field Oriented Control of PMSM Motors using dsPIC30F or dsPIC33F Digital Signal Controllers") and AN908 ("Using the dsPIC30F for Vector Control of an ACIM"), explain FOC principles. This note focuses on the specific implementation details. The control scheme is illustrated in Figure 1 and was tested using the dsPICDEM™ MCLV-2 Development Board (DM330021-2). The control scheme is similar to AN1162 ("Sensorless Field Oriented Control (FOC) of an AC Induction Motor (ACIM)"), with differences in estimator specifics and the motor type (PMSM instead of ACIM).
Hardware Blocks:
- 1. Permanent Magnet Synchronous Motor.
- 2. 3-Phase Bridge - rectifier, inverter and acquisition and protection circuitry.
- 3. Clarke forward transform.
- 4. Park forward and inverse transform.
- 5. Angle and speed estimator.
- 6. Proportional integral controller.
- 7. Flux weakening.
- 8. Space vector modulation.
Surface Mounted PM PMSM Transversal Section
The d-axis current reference (Idref) in PMSM FOC is set to zero. The rotor's magnets produce the rotor flux linkage (ΨPM), unlike ACIMs which require a constant magnetizing current reference for rotor flux. The air gap flux is the sum of the rotor's flux linkage and the armature reaction flux linkage from the stator current. In constant torque mode, the d-axis air gap flux equals ΨPM, with zero armature reaction flux. In constant power operation, the d-axis current (Id) is used for air gap flux weakening to achieve higher speeds.
Sensorless control, which eliminates the need for position or speed sensors, requires a robust speed estimator capable of rejecting perturbations like noise and temperature variations. This is particularly useful for cost-sensitive applications, environments where moving parts are not allowed, or in electrically hostile environments. However, precise control at low speeds might be a consideration for specific applications.
The position and speed estimation relies on the motor's mathematical model. A more accurate model leads to a better estimator performance. PMSM modeling considers topology, with surface-mounted and interior permanent magnet types. This application note focuses on surface-mounted PMSM motors (Figure 2), which offer advantages like low torque ripple and lower cost. The smooth air gap flux in these motors simplifies the mathematical model used for estimation, enabling efficient FOC.
FOC achieves maximum torque per ampere by maintaining the motor's rotor flux linkage 90 degrees behind the armature generated flux linkage.
1. Rotor shaft, 2. Rotor core, 3. Armature (stator), 4. Armature slots with armature windings, 5. Rotor's permanent magnets, 6. Air gap
FOC Phasor Diagram (Base Speed and High-Speed - FW)
Figure 3 shows the phasor diagram at base speed, illustrating the relationship between voltage, current, and flux. Figure 4 depicts the phasor orientation in constant power, Flux Weakening (FW) mode. During FW for Surface Permanent Magnet (SPM) PMSM, mechanical damage and magnet demagnetization can occur if proper precautions are not taken. Magnets can unbind or break if speeds exceed manufacturer specifications. Demagnetization can be caused by exceeding the flux density knee (BD), as shown in Figure 5.
For constant power mode, flux weakening in PMSM is limited by the large air gap, which results in weak armature reaction flux disturbing the rotor's permanent magnets flux linkage. The maximum speed achieved should not exceed double the base speed. Figure 4 illustrates the phasor orientation in constant power, Flux Weakening (FW) mode.
1. Intrinsic characteristic of permanent magnet. 2. Normal characteristic of permanent magnet. Where: H = Field intensity, B = Field induction, BR = Permanent induction value, HC = Coercivity, Hc₁ = Intrinsic coercivity, BD = Flux density knee.
PLL Type Estimator
The estimator used in this application note is adapted from AN1162 for PMSM motor characteristics. It utilizes a PLL structure, based on the principle that the d-component of the Back Electromotive Force (BEMF) is zero at steady state. Figure 6 shows the estimator's block diagram.
The estimated speed (ωRestim) is integrated to obtain the estimated angle (θestim) (Equation 1). The estimated speed is derived from the q-component of the BEMF and the voltage constant (Kφ) (Equation 2). The BEMF q-axis value (Eqf) is corrected using the d-axis BEMF value (Edf) based on its sign, assuming the d-axis BEMF is zero at steady state (Equation 2). The BEMF d-q components are filtered using a first-order filter after Park transform (Equation 3).
Equation 4 represents the stator circuit equations in the fixed stator frame. Terms α and β are obtained from three-phase measurements via Clarke transform. Ls and Rs are per-phase stator inductance and resistance, respectively, for Y-connected stator phases. For Δ-connected motors, equivalent Y values should be used.
Figure 7 illustrates the electrical circuit model for the PLL estimator. Voltages VA, VB, VC are phase voltages, and VAB, VBC, VCA are line voltages. Phase currents are IA, IB, IC.
The voltages Va and Vβ, used in Equation 4, are from the previous FOC cycle calculation, fed to the SVM block and the estimator. Ia and Iβ are Clarke transform results from phase currents. BEMF values Ex and Eβ are transformed to the rotor flux reference frame (Ed and Eq) using Park transform and Equation 3. The angle θestim, used in Park transformation, is calculated in the previous estimator cycle. Filtered Ed and Eq values are used in the estimator's main condition (Ef = 0).
Equation 5 provides the calculation for Kφ, the voltage constant. The speed feedback is filtered using a first-order filter, similar to the BEMF filter (Equation 6). The filter's generic form is y(n) = y(n - 1) + Kfilter * (x(n) – y(n - 1)).
The DC values at the filter output should be noise-free. Filter tuning depends on the rate of change of filtered values (BEMF d-q components and electrical speed) to ensure sufficient bandwidth without losing useful signal. BEMF d-q components can vary slowly during high-speed Flux Weakening or rapidly at low speeds. Speed variation depends on the motor's mechanical constant, load, and ramp-up/down limits.
Tuning and Experimental Results
Algorithm tuning is straightforward for speeds below base speed (maximum torque mode). Motor parameters (Rs, Ls, Kφ) are added to the configuration file. Rs and Ls can be measured using a precision LCR meter. For Y-connected motors, measured values are divided by 2. For Δ-connected motors, measured values are multiplied by 1.5. Dividing Δ-connected motor values by 3 yields their Y-connected equivalents. The voltage constant Kφ is typically provided by manufacturers but can be measured by rotating the rotor at a constant speed and measuring output voltage. A reading at 1000 RPM, multiplied by the square root of 2, gives the Vpeak/KRPM value.
Table 1 lists the tested motor parameters for the Hurst Motor DMB00224C10002.
Motor Type | Hurst Motor DMB00224C10002 | Units |
---|---|---|
Connection type | Y | |
L-L Resistance | 2.1 ± 2 | Ohms |
L-L Inductance - 1 kHz | 1.92 ± 2 | mH |
Voltage constant Kφ | 7.24 | V peak / KRPM |
Ambient temperature | 22.7 | °C |
Phase currents are read from shunts on the dsPICDEM™ MCLV-2 Development Board and scaled for the ADC module. The current scaling factor depends on the differential Op amp gain and the maximum current. For example, a 4.4A peak current and a gain of 75 with a 0.005 Ohm shunt resistor results in 3.3V at the ADC input.
Initial calibration and startup can be performed with load. Open loop ramp parameters (lock time, end acceleration speed, current reference) need tuning. Lock time depends on load inertia and initial torque. End acceleration speed should be high enough for estimator precision. The open loop implementation simplifies closed loop control by using a forced angle instead of the estimated angle. It omits the speed controller and hard-codes the q-axis current reference. A higher initial load requires a higher current reference for torque.
To keep the algorithm in open loop for tuning, enable the `OPEN_LOOP_FUNCTIONING` macro as shown in Example 1.
This is useful for PI controller recalibration, initial transition condition verification (e.g., angle error), current scaling determination, and open loop ramp tuning before activating closed loop.
Equation-Based Flux Weakening
Back-EMF increases linearly with speed. To counteract back-EMF and support the load, applied voltage increases linearly with speed. The maximum DC bus voltage (VBUS) is limited by insulation and motor safe operating zone. In SVPWM, the maximum applicable phase voltage is shown in Equation 7. Beyond base speed, to increase motor speed, the generated back-EMF must be reduced by weakening the rotor magnetic flux, termed Flux Weakening mode.
Equation 8 provides the dynamic d/q-axis voltage equation for the PMSM. For steady state, the derivative terms are negligible, simplifying the equation. Vds and Vqs are steady-state d-axis and q-axis voltages, respectively. ids and iqs are steady-state d-axis and q-axis currents. ω is the target motor electrical speed, Ls is motor phase inductance, and Rs is motor phase resistance.
During flux weakening, the negative d-axis current (-ids) is injected to counteract the rotor magnet flux linkage (ΨPM), as the PMSM's flux linkage is constant. This allows increasing speed without increasing DC bus voltage. Equation 9 calculates the d-axis current (ids) required to keep the applied voltage magnitude on the voltage limit circle (Vmax). The maximum q-axis current is limited to ensure the injected current does not exceed the motor's rated current (Equation 10). Flux weakening reduces torque generating capability.
Equation 11 shows the variation in 1/Kφ during flux weakening. The PLL-based estimator uses back-EMF (BEMF = Kφ * ω) to estimate rotor speed. Below base speed, back-EMF increases linearly with speed. During flux weakening, constant back-EMF is maintained by counteracting rotor flux linkage with negative d-axis current injection. This variation in 1/Kφ becomes more significant for high inductance motors or deep field weakening.
Voltage limitation of the inverter during flux weakening affects achievable d-q current components. The d-component current, responsible for flux weakening, is prioritized over the q-component current (torque component) to achieve higher speeds.
Figure 8 illustrates the dynamic voltage adjustment prioritizing the d-component of voltage.
Estimator performance is highly dependent on motor parameters, particularly temperature affecting rotor resistance and flux constant. High torque operation leads to high Joule losses and increased motor temperature, negatively impacting estimator validity. This application note does not correct for temperature effects. Test results are limited to one minute of continuous operation at room temperature.
Table 2 shows experimental results with load. Phase currents are higher during flux weakening operation compared to normal operation at similar speeds.
Reference Speed (RPM) | Achieved Speed (RPM) | Torque (Nm) | Phase Current (A RMS) |
---|---|---|---|
500 | 500 | 0.1 | 1.280 |
1000 | 1000 | 0.09 | 1.140 |
1500 | 1500 | 0.08 | 1.035 |
2000 | 2001 | 0.07 | 0.943 |
2500 | 2501 | 0.04 | 0.542 |
3000 | 3001 | 0.025 | 0.56 |
3500 | 3504 | 0.029 | 1.06 |
4000 | 3985 | 0.3 | 1.462 |
Note: The experimental test results shown were conducted on the DMB0224C10002 motor.
Architectural Highlights of 32-Bit MCUs for Motor Control Applications
This section highlights features of Microchip's SAME70 and PIC32MK families of MCUs relevant to motor control applications.
SAME70 Family
- CPU: 32-bit ARM® Cortex®-M7 Core - 300 MHz (2.14 DMIPS/MHz), DSP instruction support, Double-precision Floating Point Unit (FPU) - IEEE 754 Compliant, Tightly Coupled Memory (TCM) for high-speed, low-latency access.
- Analog Features: Two 12-bit ADC modules with dual Sample and Hold (S&H), one Analog Comparator, two DAC modules.
- PWM: Up to eight PWM channels with complimentary PWM, dead-time control, two 2-bit gray up/down channels for stepper motor control, independent output override, two programmable event lines for ADC triggers, asynchronous Fault inputs for PWM shutdown. Spread Spectrum Counter reduces acoustic noise/EMI.
- Position Sensing: On-chip Quadrature Decoder (QDEC) for rotor position and speed.
PIC32MK Family
- CPU: 32-bit MIPS32® microAptiv™ MCU core - 120 MHz (198 DMIPS), DSP-enhanced core, Double-precision Floating Point Unit (FPU) - IEEE 754 Compliant.
- Analog Features: Up to six 12-bit ADC channels (one shared), four Op amp modules, five Analog Comparator modules, three DAC modules.
- PWM: Up to 12 PWM pairs with complimentary PWM, dead-time control, Edge-Aligned and symmetric/asymmetric Center-Aligned modes. PWM channels support precise and synchronized ADC triggers. Asynchronous Fault inputs allow fast PWM shutdown.
- Position Sensing: On-chip QEI interfaces with incremental encoders for rotor mechanical position.
Conclusion
This application note presented a method for flux angle and speed estimation for PMSM motors, along with equation-based closed loop flux weakening. It covered theoretical concepts, estimator principles, flux weakening techniques, and tuning directions. The provided support files aid in adapting the solution to various motors. Utilizing Microchip's development hardware can significantly shorten time-to-market.
References
- "Speed Estimators, Flux Weakening and Efficient Use of SPMSM and IPMSM” - Prasad Kulkarni, 2008 MC7, Microchip MASTERs Conference 2016
- AN1292 "Sensorless Field Oriented Control (FOC) for a Permanent Magnet Synchronous Motor (PMSM) Using a PLL Estimator and Field Weakening (FW)”
- AN908 “Using the dsPIC30F for Vector Control of an ACIM”
- AN1078 "Sensorless Field Oriented Control of PMSM Motors using dsPIC30F or dsPIC33F Digital Signal Controllers"
- AN1162 "Sensorless Field Oriented Control (FOC) of an AC Induction Motor (ACIM)”
Appendix A: Source Code
The software supplied by Microchip Technology Incorporated is intended for use solely with Microchip manufactured products. This software is protected by copyright laws. Use in violation of these terms may lead to criminal sanctions and civil liability. The software is provided "AS IS" without warranties. Microchip is not liable for any special, incidental, or consequential damages. All software covered in this application note is available as a MPLAB Harmony application. This application can be found in the MPLAB Harmony installation directory under apps\motor control. The MPLAB Harmony Integrated Software framework can be downloaded from www.microchip.com/mplab/mplab-harmony.
Appendix B: Revision History
Revision A (August 2017): This is the initial released version of this document.
Related Documents
![]() |
Sensorless Field Oriented Control (FOC) for PMSM Motors using PLL Estimator and Field Weakening This application note details a method for flux angle and speed estimation for Permanent Magnet Synchronous Motors (PMSM) using a Phase-Locked Loop (PLL) estimator and Field Weakening (FW). It covers the theoretical principles, implementation details, tuning, and experimental results for sensorless FOC motor control. |
![]() |
Microchip Encoder Interface v4.2 User Guide User guide for Microchip's Encoder Interface v4.2 IP core, detailing its functionality, features, implementation, and usage for generating relative angular position and speed from encoder inputs, essential for motor control applications like FOC. |
![]() |
Libero SoC Design Flow User Guide Comprehensive guide to Microchip's Libero SoC design suite, covering FPGA design flow, tools, constraints management, implementation, and debugging for devices like PolarFire, PolarFire SoC, SmartFusion 2, IGLOO 2, and RTG4. |
![]() |
Microchip dsPIC33CH512MP508 Motor Control DIM: Information Sheet & Pin Mapping Explore the Microchip dsPIC33CH512MP508 Motor Control DIM (EV76L31A). This information sheet details its dual-core DSC capabilities, pin mapping, and development board compatibility for advanced motor control applications. |
![]() |
SmartFusion® 2 and IGLOO® 2 Automotive Grade 2 AC/DC Electrical Characteristics Datasheet Detailed datasheet for Microchip Technology's SmartFusion® 2 and IGLOO® 2 Automotive Grade 2 FPGAs, covering electrical characteristics, operating conditions, power consumption, and timing specifications for high-reliability automotive applications. |
![]() |
Microchip DDR AXI4 Arbiter v2.2 User Guide This user guide provides comprehensive details on the Microchip DDR AXI4 Arbiter IP core (v2.2), covering its introduction, features, implementation in Libero SoC, device utilization, interface signals, and testbench procedures for efficient DDR memory access in video and graphics applications. |
![]() |
PIC64GX1000 64-bit Microprocessor Data Sheet Explore the Microchip PIC64GX1000, a highly power-efficient 64-bit RISC-V MPU for embedded systems. Featuring quad 600 MHz application cores, a monitor core, extensive peripherals including PCIe Gen 2 and HDMI, and advanced security features like Secure Boot and PUF, it empowers developers with robust and efficient embedded compute solutions. |
![]() |
dsPIC33EP32MC204 Drone Propeller Reference Design User's Guide This user's guide provides comprehensive information on the dsPIC33EP32MC204 Drone Propeller Reference Design, a low-cost evaluation platform for drone applications. It details hardware descriptions, interface specifications, pin functions, and electrical characteristics, enabling users to effectively implement and utilize the design for motor control. |