This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

A strange quetion about SVPWM on 28027

dear friend,

  I have been troubled by this problem for a long time.Your help is very important to me.

  SVPWM codes are as follows,  but I don't  know the sector of the reference vector .According to traditional SVPWM,there are some ways to judge  the sector of any reference voltage vector ,like N=4C+2B+A.Please tell me the way to inplement it by schemes of TI.

static inline void SVGEN_run(SVGEN_Handle handle,const MATH_vec2 *pVab,MATH_vec3 *pT)
{

_iq Vmax,Vmin,Vcom;
_iq Va,Vb,Vc;
_iq Va_tmp = -(pVab->value[0]>>1);
_iq Vb_tmp = _IQmpy(SVGEN_SQRT3_OVER_2,pVab->value[1]);

Va = pVab->value[0]; //alpha
Vb = Va_tmp + Vb_tmp; //-0.5*alpha + sqrt(3)/2 * beta;
Vc = Va_tmp - Vb_tmp; //-0.5*alpha - sqrt(3)/2 * beta;

Vmax=0;
Vmin=0;

// find order Vmin,Vmid,Vmax
if (Va > Vb) 
{
Vmax = Va;
Vmin = Vb;
}
else
{
Vmax = Vb;
Vmin = Va;
}

if (Vc > Vmax)
{
Vmax = Vc;
}
else if (Vc < Vmin)
{
Vmin = Vc;
}

Vcom = _IQmpy(Vmax+Vmin, _IQ(0.5));

// Subtract common-mode term to achieve SV modulation
pT->value[0] = (Va - Vcom);
pT->value[1] = (Vb - Vcom);
pT->value[2] = (Vc - Vcom);

return;
}

Thanks a lot.

li