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.

TMS320F28062F: Changed SVM range issue

Part Number: TMS320F28062F
Other Parts Discussed in Thread: MOTORWARE

Hello e2e team,

we have our own inverter working with the previous release of motorware, before the SVM range was changed. But it seems that this previous release does not work well with Lab11a, It seems that this lab has dependency of this SVM changes. Because when I migrated from working with CTRL module object to No CTRL Object structures as LAB11 specified, My motor start spinning in the wrong way, it always use the Maximum Motor Current and it goes to the Maximum speed but in reverse.

What I ve notices are these changes:

//*********//

HALL_WrtiePwmData first saturate to 1.0

pwmData_sat = _IQsat(pPwmData->Tabc.value[0],_IQ(1.0),_IQ(-1.0));
pwmData_sat_dc = _IQmpy(pwmData_sat + _IQ(1.0), _IQ(0.5));

and in new versions to 0.5

pwmData_neg = _IQmpy( pPwmData->Tabc.value[0],_IQ(-1.0));
pwmData_sat = _IQsat(pwmData_neg,_IQ(0.5),_IQ(-0.5));
pwmData_sat_dc = pwmData_sat + _IQ(0.5);

//******//

//*********//

for SVGEN_run previously 

_iq Vmax,Vmin,Vcom;
_iq Va,Vb,Vc;
// _iq maxModulation = SVGEN_getMaxModulation(handle);
// _iq maxModulationNeg = -maxModulation;
_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; //_IQmpy(SVGEN_SQRT3_OVER_2, Vb_tmp); //-0.5*alpha + sqrt(3)/2 * beta;
Vc = Va_tmp - Vb_tmp; //_IQmpy(SVGEN_SQRT3_OVER_2, Vb_tmp); //-0.5*alpha - sqrt(3)/2 * beta;

// // Clipping
// Va=_IQsat(Va, SVGEN_4_OVER_3, -SVGEN_4_OVER_3);
// Vb=_IQsat(Vb, SVGEN_4_OVER_3, -SVGEN_4_OVER_3);
// Vc=_IQsat(Vc, SVGEN_4_OVER_3, -SVGEN_4_OVER_3);

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 = (Vmax+Vmin)>>1; //0.5*(Vmax+Vmin)

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

return;

and in new version

_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;

//******//

//*********//

for User.h before

 #define USER_MAX_VS_MAG_PU        (1.0)

recent files

#define USER_MAX_VS_MAG_PU        (0.5)

//*****//

Which implementation should I used to run properly new labs, Lab11(a/e)?

Is anything else that I need to consider to modify?

  • That depends on the version of motorWare. The 15th and subsequent versions use "#define USER_MAX_VS_MAG_PU        (0.5)". You must set the variables to less than 0.5 as the commented text in user.h if you are using these versions. Please download and use the latest version as the following link.

    http://www.ti.com/tool/motorware

  • Hello 

    when I used the recent files:

    hal.h

    pwmData_neg = _IQmpy( pPwmData->Tabc.value[0],_IQ(-1.0));
    pwmData_sat = _IQsat(pwmData_neg,_IQ(0.5),_IQ(-0.5));
    pwmData_sat_dc = pwmData_sat + _IQ(0.5);

    svgen.h

    _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;

    and user.h

     #define USER_MAX_VS_MAG_PU        (0.5)

    the lab11a does not work. but when I used the new HALL_WritePwmData, USER_MAX_VS_MAG_PU (0.5) and the previous implementation of the SVGEN_run, the lab works but the motors spins in reverse.

    My second question is: which is the difference of these lines

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

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

  • The code for SVGEN is related to PWM drive module, the final PWM output is the same, but the calculation process is different as you mentioned above. You can't mix the files between two versions, you may just use the latest motorWare version18, or keep your original version without changing the PWM and SVGEN function since the FAST algorithm is the same in different versions.