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.

CCS/TMS320F28335: three phase pll

Part Number: TMS320F28335
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: Code Composer Studio

i designed a three phase pll 

like this

valpha= ((0.6667*va1)-0.3333*(vb1-vc1));
vbeta= (1.154*(vb1-vc1));

vd= (valpha*cos(theta))+(vbeta*sin(theta));
vq= -(valpha*sin(theta))+(vbeta*cos(theta));

error1= vqref-vq;
w=(Kp*error1)+((Ki)*(error1-pre_error));
pre_error = error1;
error2=wff+w;
f=error2/(6.28);
theta = theta0+((Kp1+Ki1)*error2)-((Ki1)*(pre_error2));
pre_error2 = error2;

if(theta<=0)
{
theta=0;
}
if(theta>=6.28)
{
theta=0;
}

theta0=theta;

is there any wrong in it?

because it's not getting synchronized..

  • As part of what we can support we are not allowed to debug customer code,

    We have three phase PLL modules in controlSUITE

    www.ti.com/.../sprabt4a.pdf

    have a look and compare to find your issues with the code.
  • i gone through the pdf and i wrote code according to it ,
    but in that ylf0, ylf1 is not giving correct values
    the ylf0 is to get nearly -0.001 to 0.002 in between
    but it is giving always -49.99999 or -50.00111
    first i assigned
    float vq0=0.0
    float ylf1 =0.0
    the vq values i get is -0.00001 like that by manual calculation it to get very less but it getting very big difference
    please say any mistake in program?
    ylf0=(ylf1 + ((332.9173046*vq) + (-325.9950237*vq0)));
    ylf1=ylf0;
    vq0=vq;

    // ylf0=(ylf0>(50.0))?(50.0):ylf0;
    //---------------------------------//
    // VCO //
    //---------------------------------//
    fo=fn + ylf0;

    theta=theta0 + ((fo*delta_T)*(6.28));
    if(theta > 6.28)
    {
    theta=theta - (6.28);
    }

    theta0=theta;
  • Hi Raj,

    If your manual calculation and the calculation from your code doesn't match, you might try setting a breakpoint at the beginning of the ISR (assuming it is safe to do so) and then single-step through each line, comparing your manual calculations to the code results via the expressions window.  

    If you can't stop the ISR you could instead detect that the ISR has reached some fixed iteration, then copy the input and output values to memory where you can then examine them outside of the critical control loop.  

  • before testing anything on the controller, I typically recommend simulating it precisely. 

    That is with the same ISR frequency etc in MATLAB, please see the script here http://www.ti.com/lit/an/sprabt4a/sprabt4a.pdf

    Once it works fine in simulation, 

    There are a few issues that typically you can run into with the PLL module with three phase

    1. A sequence of input not being correct, you can try changing the sequence of the input to identify this issue. 

    2. Also if the PLL is running without having a AC input then the loop filter can saturate and may need a reset. 

    -Manish  

  • I hope the above resolved your issue. If not please start a new thread. I'll go ahead and close this one as there has been no reply for more than 2 weeks.