How to empirically tune DQ current PI controllers in BLDC/PMSM motor for vector control?
Tune kpq  
  Tune kpd   
  Tune kiq   
  Tune kiq  # typo... expecting to see kid
  


Why do you feel the need to tune D and Q separately? D-component is non-torque producing current which manifests itself in the ABC reference frame as a phase shift. Why is this important? well it depends on whether you intentionally require D-component or not...

If for instance you wanted field weakening then yes you would want to control the D-component however this isn't the case here as you have a fixed D-current demand of 0, the standard method.  In doing so the displacement power factor is minimized. 

Why state this... well the four listed steps is implying independent tuning steps for D and Q which opens the possibility of different frequency response between the D control and the Q control.  Think for a minute what this will result in?  if the D-control had a bandwidth a 10th of the Q-control, there would be a lag in controlling the D-component to zero resulting in unwanted D voltage/current for a longer period of time during and after acceleration resulting in a sluggish performance, inefficiency and possibly stability considerations. 

Traditionally the Q and the D share the same control parameters ( note: not always the case as there are benefits in limiting the D-demand).

So if it can be accepted that \$K_{pq} \equiv K_{pd}\$ and \$K_{iq} \equiv K_{id}\$ how to tune?  there are a couple of empirical methods (Ziegle-Nichols, Cohen-Coon) and these are useful if you do not know the plant, but you should. in this instance the plant is the line-line resistance and inductance of your machine (at rated current)

The plant transfer function is thus

\$\frac{I(s)}{V(s)} = \frac{1}{Ls + R} \$  which is of the form: \$ \frac{K_{dc}}{\tau s + 1}\$

\$K_{dc} = \frac{1}{R}\$
\$ \tau = \frac{L}{R}\$

Consider the classic close loop block diagram



where in this instance H = -1 and G = P*G (plant time Gain)

The canonical form of a feedback control system is thus: \$ \frac{G}{1+G}\$

A PI controller has a transfer function equal to

\$C(s) = K_p + \frac{K_i}{s} = \frac{K_p\cdot s + K_i}{s}\$

\$P(s) = \frac{K_{dc}}{\tau s + 1}\$

Thus: \$G(s) = C(s)\cdot P(s) = \frac{K_p\cdot s + K_i}{s} \cdot \frac{K_{dc}}{\tau s + 1}\$ 

The the feedback control system is:

\$\frac{Y(s)}{X(s)} = \frac{G(s)}{1 + G(s)} = \frac{K_{dc}\cdot K_p\cdot s  + K_{dc}\cdot K_i}{\tau \cdot s (1+K_{dc}\cdot K_p)\cdot s + K_{dc}\cdot K_i}\$ 

This can be rearranged into one of the many standard forms: 

\$ \frac{ \frac{K_p}{K_i}\cdot s + 1} { \frac{\tau}{K_{dc} \cdot K_i}\cdot s^2 
 + \frac{1 + K_{dc}\cdot K_p}{K_{dc}\cdot K_i} \cdot s + 1} \$ 

With a desired damping factor and a target resonance frequency, Ki and Kp can be determined to match your known plant.