Field-Oriented Control: Current Loop Fundamentals and PI Tuning

Series: Field-Oriented Control

Field-Oriented Control: Current Loop Fundamentals and PI Tuning

Introduction

If you’re commissioning a servo drive or implementing Field-Oriented Control (FOC) for a permanent magnet synchronous motor (PMSM), understanding the current loop is critical. The current loop is the innermost—and fastest—control loop in a cascaded drive architecture. Poor current loop tuning leads to torque ripple, acoustic noise, and instability that cascades into velocity and position loops.

This post is for motor controls engineers implementing FOC on PMSMs, brushless DC motors, or induction motors. We’ll cover the theory behind d-q frame transformations, derive the PI controller transfer function, and walk through practical tuning steps with real-world parameter examples.

By the end, you’ll know how to select current loop bandwidth, tune PI gains, and validate stability using both simulation and scope measurements.

Theory

What is Field-Oriented Control?

Field-Oriented Control (FOC), also called vector control, decouples torque and flux control in AC motors by transforming three-phase currents into a rotating reference frame aligned with the rotor flux. This makes AC motor control behave like DC motor control, where armature current directly controls torque.

Clarke and Park Transforms

The Clarke transform converts three-phase currents (ia,ib,ic)(i_a, i_b, i_c) into a stationary two-phase frame (α,β)(\alpha, \beta):

[iαiβ]=23[1121203232][iaibic]\begin{bmatrix} i_\alpha \\ i_\beta \end{bmatrix} = \frac{2}{3} \begin{bmatrix} 1 & -\frac{1}{2} & -\frac{1}{2} \\ 0 & \frac{\sqrt{3}}{2} & -\frac{\sqrt{3}}{2} \end{bmatrix} \begin{bmatrix} i_a \\ i_b \\ i_c \end{bmatrix}

The Park transform rotates (α,β)(\alpha, \beta) into a synchronous frame (d,q)(d, q) aligned with the rotor position θe\theta_e:

[idiq]=[cosθesinθesinθecosθe][iαiβ]\begin{bmatrix} i_d \\ i_q \end{bmatrix} = \begin{bmatrix} \cos\theta_e & \sin\theta_e \\ -\sin\theta_e & \cos\theta_e \end{bmatrix} \begin{bmatrix} i_\alpha \\ i_\beta \end{bmatrix}

In this frame:

  • idi_d controls flux (kept at zero for surface PMSMs)
  • iqi_q controls torque: Te=32pλmiqT_e = \frac{3}{2} p \lambda_m i_q

Key Tradeoffs

  • Higher bandwidth: Faster response, but increases noise sensitivity and requires higher PWM frequency
  • Lower bandwidth: More filtering, but slower tracking and potential instability with mechanical resonances
  • Rule of thumb: Current loop bandwidth ωcl110ωPWM\omega_{cl} \approx \frac{1}{10} \omega_{PWM}

Math

Motor Voltage Equations in d-q Frame

For a PMSM, the voltage equations in the d-q frame are:

Vd=Rsid+LddiddtωeLqiqV_d = R_s i_d + L_d \frac{di_d}{dt} - \omega_e L_q i_q Vq=Rsiq+Lqdiqdt+ωe(Ldid+λm)V_q = R_s i_q + L_q \frac{di_q}{dt} + \omega_e (L_d i_d + \lambda_m)

where:

  • RsR_s: stator resistance
  • Ld,LqL_d, L_q: d-q axis inductances
  • ωe\omega_e: electrical angular velocity
  • λm\lambda_m: permanent magnet flux linkage

PI Controller Transfer Function

The PI controller for the q-axis current loop is:

C(s)=Kp+Kis=Kps+KisC(s) = K_p + \frac{K_i}{s} = \frac{K_p s + K_i}{s}

The open-loop plant (motor electrical dynamics, neglecting cross-coupling and back-EMF for simplicity) is:

G(s)=1Lqs+RsG(s) = \frac{1}{L_q s + R_s}

The closed-loop transfer function is:

H(s)=C(s)G(s)1+C(s)G(s)=Kps+KiLqs2+(Rs+Kp)s+KiH(s) = \frac{C(s) G(s)}{1 + C(s) G(s)} = \frac{K_p s + K_i}{L_q s^2 + (R_s + K_p) s + K_i}

PI Gain Calculation

For a desired current loop bandwidth ωcl\omega_{cl} and damping ratio ζ=0.707\zeta = 0.707 (critically damped):

Kp=2ζωclLqRsK_p = 2 \zeta \omega_{cl} L_q - R_s Ki=ωcl2LqK_i = \omega_{cl}^2 L_q

Example: For a motor with Lq=5 mHL_q = 5 \text{ mH}, Rs=1ΩR_s = 1 \Omega, and target ωcl=1000 rad/s\omega_{cl} = 1000 \text{ rad/s}:

Kp=2×0.707×1000×0.0051=6.07V/AK_p = 2 \times 0.707 \times 1000 \times 0.005 - 1 = 6.07 \, \text{V/A} Ki=10002×0.005=5000V/(A\cdotps)K_i = 1000^2 \times 0.005 = 5000 \, \text{V/(A·s)}

Flow Diagrams

graph TD
    A[Speed Reference] --> B[Speed PI Controller]
    B --> C[Torque Reference]
    C --> D[iq* Reference]
    D --> E[Current PI q-axis]
    E --> F[Vq* Voltage]
    F --> G[Inverse Park Transform]
    G --> H[Space Vector PWM]
    H --> I[3-Phase Inverter]
    I --> J[PMSM Motor]
    J --> K[Position Encoder]
    K --> L[Park Transform]
    L --> M[id, iq Feedback]
    M --> E
    K --> G
    
    style D fill:#e1f5ff
    style E fill:#ffe1e1
    style J fill:#e1ffe1

This diagram shows the cascaded control structure with the current loop (PI q-axis) as the innermost loop. The d-axis current reference is typically set to zero for surface PMSMs.

Real Scenario Use

Commissioning a 2.2 kW PMSM Servo Drive

Motor Parameters:

  • Rated power: 2.2 kW
  • Rated speed: 3000 RPM
  • Pole pairs: 4
  • Stator resistance Rs=1.2ΩR_s = 1.2 \Omega
  • q-axis inductance Lq=6 mHL_q = 6 \text{ mH}
  • Back-EMF constant: 50 V/kRPM

Drive Setup:

  • PWM frequency: 10 kHz
  • Current measurement: Hall-effect sensors, 10-bit ADC
  • Target current loop bandwidth: ωcl=1000 rad/s\omega_{cl} = 1000 \text{ rad/s} (159 Hz)

Step 1: Calculate PI Gains

Using the formulas above:

Kp=2×0.707×1000×0.0061.2=7.28V/AK_p = 2 \times 0.707 \times 1000 \times 0.006 - 1.2 = 7.28 \, \text{V/A} Ki=10002×0.006=6000V/(A\cdotps)K_i = 1000^2 \times 0.006 = 6000 \, \text{V/(A·s)}

Step 2: Implement Decoupling

Add feed-forward decoupling terms to compensate for cross-coupling:

Vd=VdPIωeLqiqV_d^* = V_d^{PI} - \omega_e L_q i_q Vq=VqPI+ωe(Ldid+λm)V_q^* = V_q^{PI} + \omega_e (L_d i_d + \lambda_m)

Step 3: Verify on Scope

  1. Set motor in current control mode with iq=5 Ai_q^* = 5 \text{ A} step
  2. Measure iqi_q response with current probe or ADC readback
  3. Check:
    • Rise time tr2.2ωcl=2.2 mst_r \approx \frac{2.2}{\omega_{cl}} = 2.2 \text{ ms}
    • Overshoot <10%< 10\%
    • No oscillations

Step 4: Adjust if Necessary

  • Too much overshoot: Reduce KpK_p by 10-20%
  • Sluggish response: Increase ωcl\omega_{cl} (ensure ωcl<0.1ωPWM\omega_{cl} < 0.1 \omega_{PWM})
  • High-frequency noise: Add low-pass filter on current feedback or reduce bandwidth

References

  1. IEC 61800-7-201:2015 — Adjustable speed electrical power drive systems, Part 7-201: Generic interface and use of profiles for power drive systems
  2. Texas Instruments Application Note SPRABQ2 — “Field Oriented Control of 3-Phase AC Motors”
  3. Bose, B. K. (2002). Modern Power Electronics and AC Drives. Prentice Hall. Chapter 6: Vector Control of AC Drives.
  4. Leonhard, W. (2001). Control of Electrical Drives (3rd ed.). Springer. Chapter 9: Field-Oriented Control.
  5. Infineon Application Note AP32370 — “PMSM FOC with Hall Sensors for Motor Control Applications”

Videos

Summary + Key Takeaways

  • FOC decouples torque and flux by transforming AC currents into a rotating d-q frame
  • Clarke transform converts 3-phase to 2-phase stationary frame; Park transform rotates to rotor frame
  • Current loop bandwidth should be ~1/10 of PWM frequency to avoid aliasing
  • PI gains are calculated based on motor inductance, resistance, and target bandwidth
  • Use damping ratio ζ=0.707\zeta = 0.707 for critically damped response with minimal overshoot
  • Always implement decoupling feed-forward to cancel cross-coupling between d-q axes
  • Validate on scope: Check rise time, overshoot <10%, no oscillations

Glossary

  • d-q frame: A rotating reference frame aligned with the rotor flux, simplifying AC motor control to DC-like quantities
  • Clarke transform: Converts three-phase currents to stationary two-phase (α,β)(\alpha, \beta) frame
  • Park transform: Rotates stationary frame to synchronous frame aligned with rotor position
  • Bandwidth: Frequency at which closed-loop response drops to -3 dB (70.7% of DC gain)
  • Cross-coupling: Interaction between d-axis and q-axis voltages due to motor back-EMF and inductance
  • Decoupling: Feed-forward compensation to cancel cross-coupling effects
  • PWM: Pulse Width Modulation, switching technique to generate variable voltage for motor phases

FAQ

Q: What’s the difference between FOC and V/Hz control?
A: V/Hz is open-loop scalar control that adjusts voltage proportionally with frequency to maintain constant flux in the motor. It’s simple, robust, and widely used for applications like pumps and fans where dynamic performance isn’t critical. However, it provides poor torque control at low speeds and cannot respond quickly to load changes. FOC (Field-Oriented Control) is closed-loop vector control that independently controls torque-producing current (q-axis) and flux-producing current (d-axis) by transforming three-phase currents into a rotating d-q reference frame. This allows precise, fast torque response similar to DC motor control, with better efficiency, dynamic performance, and torque capability across the entire speed range including zero speed.

Q: Why is the d-axis current set to zero for surface PMSMs?
A: Surface-mounted permanent magnet synchronous motors (SPMSMs) have magnets glued to the rotor surface, which means the d-axis and q-axis inductances are equal (Ld=Lq)(L_d = L_q) due to the uniform air gap. This is called non-salient pole construction. With no magnetic saliency, there’s no reluctance torque benefit from d-axis current, and any d-axis current would only create additional copper losses without contributing to torque production. Setting id=0i_d = 0 maximizes efficiency by dedicating all available current to q-axis (torque production) and simplifies the control structure. For interior PMSMs with saliency (Ld<Lq)(L_d < L_q), negative d-axis current can be strategically used for field weakening at high speeds or to exploit reluctance torque.

Q: How do I know if my current loop is stable?
A: Stability can be verified through multiple complementary methods. In the frequency domain, analyze the open-loop Bode plot and verify that phase margin is >45° (ideally 60°) and gain margin is >6 dB at the gain crossover frequency. In the time domain, perform a step response test by commanding a current step (e.g., 10-20% of rated current) and verify that overshoot is <10%, settling time is <5 ms, and there’s no sustained oscillation or ringing. Also monitor the current waveform for high-frequency noise amplification near the PWM frequency, which indicates insufficient phase margin and potential instability. Most modern drives have built-in current scope functions or parameter monitoring that allows you to capture and analyze the step response directly from the drive interface.

Q: Can I use the same PI gains for d-axis and q-axis?
A: Yes, if the motor has equal d-axis and q-axis inductances (Ld=Lq)(L_d = L_q), which is typical for surface-mounted permanent magnet motors and squirrel-cage induction motors. In this case, the current loop dynamics are identical for both axes and can share the same PI gains, simplifying implementation and reducing tuning effort. However, for interior permanent magnet motors with magnetic saliency (LdLq)(L_d \neq L_q), you should calculate and use separate gains optimized for each axis inductance to achieve the same bandwidth and phase margin. The proportional gain is Kp=αωcLK_p = \alpha \omega_c L, so if Ld=0.5LqL_d = 0.5 L_q, then KpdK_{pd} will be half of KpqK_{pq}. Using the same gains on a salient motor may result in different bandwidths and phase margins for each axis, potentially causing instability or poor performance.

Q: What happens if current loop bandwidth is too high?
A: Setting the bandwidth too high (approaching or exceeding 1/10 of the PWM frequency) causes several serious problems. First, you’ll see significant noise amplification from high-frequency sources like switching ripple, sensor noise, and quantization effects, which can cause erratic motor behavior and acoustic noise. Second, you may encounter PWM aliasing artifacts where the control loop responds to harmonics that are aliased by the discrete-time sampling, leading to instability or torque ripple. Third, the phase lag from computational delays (typically 1-2 PWM periods) becomes significant relative to the loop period, reducing phase margin and potentially causing instability. As a general rule, keep current loop bandwidth to 1/10 of the PWM frequency or lower, and always verify stability margins with a step response test before pushing bandwidth higher.