cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Feed Forward Algorithm Implementation

RDunw.1
Associate

I have been looking into using feed forward for a project that requires a relatively high speed (~1300Hz electrical). I am trying to match a MATLAB simulation feed forward algorithm with the ST implementation but have some confusion.

Taking the q-axis feed forward term as an example:

   wtemp1 = (((int32_t)(hSpeed_dpp) * Iqdref.d) / (int32_t)32768);
   wtemp2 = (wtemp1 * pHandle->wConstant_1D) / (int32_t)(hAvBusVoltage_d);
   wtemp2 *= (int32_t)2;
 
   wtemp2 = wtemp1 + wtemp2 + pHandle->VqdAvPIout.q;
   SATURATION_TO_S16(wtemp2);
   pHandle->Vqdff.q = (int16_t)(wtemp2);

Without the pHandle->VqdAvPIout.q term it makes complete sense to me, it is generating a feed forward term from two parts:

  1. Decoupling of the q and d axis
  2. Compensating for the actual Vbus voltage (i.e. if vbus is lower than nominal, the output needs to be higher to get the same effective voltage on the motor)

For the discussion, let's call this part (i.e. [wtemp1 + wtemp2] in the above code):

Vq,ff,comp = Vcomp * Vq,ff

where:

Vq,ff = the pure feed forward term for decoupling d and q axis

Vcomp = a compensation factor for Vbus (if Vbus = Vnominal this would simple be equal to one)

If we take a look at the point where the feed forward term is applied, it is simply:

wtemp = (int32_t)(Vqd.q) + pHandle->Vqdff.q;
SATURATION_TO_S16(wtemp)
lVqd.q = (int16_t)wtemp;

Which means the end result is, effectively:

Vq = Vq,pid + Vq,pid,avg + Vq,ff,comp

where:

Vq,pid = instantaneous q-axis current controller output

Vq,pid,avg = filtered q-axis current controller output (pHandle->VqdAvPIout.q)

From my understanding, the result should instead be:

Vq = Vcomp * (Vq,pid + Vq,ff) = Vcomp * Vq,pid + Vq,ff,comp

i.e. we first apply the decoupling term to the PID output, then compensate the whole thing bases on Vbus.

My hypothesis as to why Vcomp isn't applied in this last equation is that this requires a division and since this part occurs in the high frequency loop it is undesirable. However, I can't figure out why the Vq,pid,avg term is added, it seems to effectively "double" the Vq term and I don't know what I'm missing in order to understand it.

Thanks in advance!

0 REPLIES 0