National High-Tech Enterprise IEC 61000 EMC · IEC 60730 Class B · RoHS ISO 9001 certified Jinhua, Zhejiang · around 200 staff · 25 in R&D
TECHNICAL NOTE 07 / 22

FOC Motor Control - Loop Tuning Overview

Sailike R&DFOC technical notes 中文原文

In a permanent magnet synchronous motor (PMSM) vector control system, the current loop, the speed loop, the position loop and the phase-locked loop (PLL) inside the position-sensorless observer form a multistage cascaded control structure. The PI parameter design of each loop directly affects the dynamic response, the steady-state accuracy and the stability of the system. This chapter describes a continuous-domain PI parameter design method based on per-unit normalisation, discretises it to suit digital control, and gives the engineering steps of loop tuning.

a. Loop cascade structure and bandwidth constraints

In a cascaded control structure the inner loop must respond faster than the outer loop to preserve stability. The typical bandwidth constraints are:

  • Current loop bandwidth fcc : the highest, typically fPWM/10~fPWM/5 .
  • Speed loop bandwidth fsc : about 1/5~1/10 of the current loop bandwidth.
  • Position loop bandwidth fpc : about 1/5~1/10 of the speed loop bandwidth.
  • PLL bandwidth fPLL : typically 1.5~5 times the speed loop bandwidth, to smooth the observed speed ripple.

Design proceeds from the inner loop outward: the current loop first, then the speed loop, and the position loop last. The PLL observer is designed independently but must match the speed loop bandwidth.

b. Per-unit system

Per-unit normalisation converts every physical quantity into a dimensionless relative value, simplifies the control parameters and decouples the design from the specific hardware. The base values are chosen as:

  • Voltage base Ub=Udc/3 (maximum phase voltage in the SVPWM linear modulation range)
  • Current base Ib=Irated (rated current peak)
  • Angular frequency base ωb=2πfrated (rated electrical angular speed)
  • Flux linkage base ψb=Ub/ωb
  • Inductance base Lb=ψb/Ib=Ub/(ωbIb)
  • Resistance base Rb=Ub/Ib
  • Time base tb=1/ωb

After normalisation the motor equations keep the same form as the physical equations, with the parameters ψpm,pu=1 (when normalised at the rated operating point), Rpu=R/Rb and Lpu=L/Lb . The PI gains also become dimensionless, which eases porting across platforms.

c. Current loop parameter design

c.1 Continuous-domain model

In the dq reference frame the current loop plant is:

{ud=Rid+Lddiddt−ωLqiquq=Riq+Lqdiqdt+ω(Ldid+ψpm)

With the back-EMF cross-coupling cancelled by feedforward, the d,q -axis current loop can be treated as a first-order system:

Gi(s)=1R+sL

Using pole-zero cancellation, the PI controller is set as:

Ci(s)=Kp,i+Ki,is=Kp,i1+sτisτi

Setting τi=L/R to cancel the plant pole gives:

Kp,i=Lτc,Ki,i=Rτc

where τc is the desired current loop time constant. The current loop closed-loop bandwidth is fcc=1/(2πτc) .

c.2 Per-unit form

In per-unit form, Rpu=R/Rb , Lpu=L/Lb and the normalised time tpu=ωbt . The per-unit PI controller is:

Ci,pu(spu)=Kp,i,pu+Ki,i,puspu

where spu=s/ωb . Substituting Lpu=Lωb/Rb and Rpu=R/Rb gives:

Kp,i,pu=Lpuωbτc=Lpu2πfcc/ωb=Lpuλcc,Ki,i,pu=Rpuωbτc=Rpuλcc

where λcc=fcc/fb is the normalised bandwidth.

c.3 Discretisation

The continuous PI controller is discretised with the backward Euler method (or the trapezoidal method):

u(k)=Kpe(k)+Ki∑i=0ke(i)Ts

In the per-unit system the normalised sampling period is Ts,pu=ωbTs . The discretised recursion is:

u(k)=u(k−1)+Kp[e(k)−e(k−1)]+KiTse(k)

where Kp and Ki are the discrete-domain gains (identical to the continuous-domain ones). In a fixed-point implementation they must be scaled to the Q format.

d. Speed loop parameter design

d.1 Continuous-domain model

The speed loop plant is the mechanical equation:

Jdωmdt=Te−TL−Bωm

The electromagnetic torque is Te=1.5pψpmiq (field weakening neglected). With the current loop reduced to a first-order lag Gcc(s)=1/(1+τcs) , the speed loop open-loop transfer function is:

Gsc(s)=Kp,s1+sτssτs·KtJs·11+τcs

where Kt=1.5pψpm is the torque constant. With symmetrical optimum design and τs=4τc selected, the speed loop proportional and integral gains are:

Kp,s=J4Ktτc,Ki,s=J16Ktτc2

The speed loop bandwidth is fsc≈1/(8πτc) .

d.2 Per-unit form

In the per-unit mechanical equation the normalised moment of inertia is Jpu=J/(Ibψb/ωb2) and the normalised torque is Te,pu=iq,pu (when ψpm,pu=1 ). The per-unit speed loop PI gains are:

Kp,s,pu=Jpu4λcc,Ki,s,pu=Jpu16λcc2

where λcc=ωbτc .

e. Position loop parameter design

The position loop plant is the closed-loop speed loop, usually simplified to an integrator plus a small lag. The position loop PI controller is normally designed as:

Cp(s)=Kp,p+Ki,ps

The bandwidth fpc is far below the speed loop bandwidth. A convenient design sets the position loop open-loop crossover frequency to fpc=0.1fsc , which gives:

Kp,p=2πfpc,Ki,p=(2πfpc)2/10

(in physical units; the per-unit version is scaled accordingly).

f. Observer PLL loop parameter design

In position-sensorless control a phase-locked loop is normally used to extract the rotor angle and speed from the observed back EMF or flux linkage. The PLL closed-loop transfer function is:

GPLL(s)=Kp,PLLs+Ki,PLLs2+Kp,PLLs+Ki,PLL

Designed as a standard second-order system:

Kp,PLL=2ζωn,Ki,PLL=ωn2

where ωn is the PLL natural frequency and ζ is the damping ratio (usually 0.707 ). The PLL bandwidth is fPLL=ωn/(2π) .

The PLL bandwidth should match the speed loop bandwidth, usually fPLL=(1.5~2)fsc , so that the observed speed stays smooth while still tracking the speed loop command dynamically.

g. Tuning procedure

  1. Hardware and sampling configuration: fix the PWM frequency fPWM , choose the sampling scheme (single or double sampling) and determine the control period Ts .
  2. Current loop tuning:
  • Measure or obtain the motor parameters R,Ld,Lq .
  • Calculate the desired current loop bandwidth fcc=(1/10~1/5)fPWM .
  • Calculate Kp,i=2πfccL and Ki,i=2πfccR .
  • Discretise the gains, write them into the code, run a step response test and trim the gains until the overshoot is acceptable.
  1. Speed loop tuning:
  • Identify the moment of inertia J (offline identification is acceptable).
  • Using the equivalent current loop time constant τc=1/(2πfcc) , calculate Kp,s=J/(4Ktτc) and Ki,s=J/(16Ktτc2) .
  • Trim the gains during actual operation while watching the speed response; a moderate increase of Kp,s improves the dynamics but risks oscillation.
  1. Position loop tuning:
  • Set the position loop bandwidth to about 1/10 of the speed loop bandwidth.
  • Calculate Kp,p=2πfpc and Ki,p=(2πfpc)2/10 .
  • Test the position step response and adjust until the overshoot is zero or slight.
  1. PLL observer tuning:
  • Set fPLL=(1.5~2)fsc from the speed loop bandwidth.
  • Calculate ωn=2πfPLL ; with ζ=0.707 this gives Kp,PLL=2ζωn and Ki,PLL=ωn2 .
  • After discretisation, verify the angle tracking accuracy in sensorless mode.

h. Discretisation and fixed-point implementation

h.1 Discretisation methods

The common discretisation methods are:

  • Backward Euler: ∫edt≈∑e(k)Ts ; simple to implement and suited to fixed point.
  • Trapezoidal (Tustin): ∫edt≈Ts2∑[e(k)+e(k−1)] ; more accurate but slightly heavier computationally.

Both reduce to the same recursion:

u(k)=u(k−1)+Kp[e(k)−e(k−1)]+KiTse(k)

h.2 Per-unit values and Q format

The continuous-domain value Kp,Ki is converted to a per-unit value first and then to fixed point. With the Q15 format:

Kp,Q15=round(Kp,pu×215)
Ki,Q15=round(Ki,pu×215)

The sampling period Ts is likewise converted to the per-unit value Ts,pu=ωbTs and expressed in the same Q format. In the discrete iteration:

uQ15(k)=uQ15(k−1)+Kp,Q15·ΔeQ15+QMul(Ki,Q15,e(k),15)·Ts,pu

where QMul is the fixed-point multiply macro; overflow protection is required.

i. Conclusion

Multiloop PI parameter design is a core engineering skill in motor control. The inside-out order, per-unit normalisation that unifies the parameter scale, frequency-domain design of the continuous-domain gains, and the subsequent discretisation by the backward Euler method and conversion to fixed point together yield efficient and reliable digital control. The current loop parameters follow directly from the motor inductance and resistance; the speed loop parameters depend on the moment of inertia and the current loop bandwidth; the position loop bandwidth is far below the speed loop; and the PLL observer bandwidth matches the speed loop. Actual tuning still needs step response tests for fine adjustment, so that the system stays stable over the full operating range.

Compiled with AI assistance and reviewed by a human.