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.

TMS320F280049C: PR CONTROLLLER IMPLEMENTATION WITH DCL

Part Number: TMS320F280049C


I am trying to implement the example code of  grid connected inverter. here they have used DCL library for the implementation of PR controller. In the user guide of DCL library the transfer function is shown as below in the figure.

But when i transformed the code back to the transfer function form i got the transfer function as shown in figure(hand written)

 so how is this done ?

  • Hi,

    Please see below:

    The DCL DF22 formula is as below, where v7 is the control output u, and ek is the error e.

        v7 = (ek * p->b0) + p->x1;

        p->x1 = (ek * p->b1) + p->x2 - (v7 * p->a1);

        p->x2 = (ek * p->b2) - (v7 * p->a2);

    We can get equivalent difference function as

    After Z transformation, we can get

    Han

  • Dear Han 

    Thank you very much for your quick response. Please see below The transfer function for the resonant controller is given as G(s).

     

    Sorry for my over-writing. Hope I am able to make my  point clear.

  • Hi Abhinav,

    I did not get what you are trying to ask. Can you please clarify what you want to achieve and what question do you have about the DCL library? Thanks.

    Han

  • Hi Han

    My question is not about the DCL Library but it is rather about the use of DCL library.

    In the example code (gridconnectedlclFltr) they have implemented the  PR controller using the DCL library. As the DCL library does not calculate the  coefficients  so they have calculated it in their code as shown in my second figure. But when I try to calculate the coefficients,  I got the different value of coefficients as shown in my last reply. (although coefficients are same but interchanged).

    So I am asking how they have calculated the coefficients?

    Thanks

    Abhinav

  • Hi Kumar,

    In general, design a PI compensator first and set this as a baseline.

    If you need to boost the gain at the specific frequency, add resonant filter and multiply by gain that gives you the target gain and add another resonant filter if needed.

    This is general way to design a PI+R compensator and depending on the bandwdith (or Q value) coefficiecnt can be different. 

    So I would suggest you to start from PI and plot the frequency response in Matlab and add resonant filter with appropriate gain. Once you get the desired frequency response, convert S-domain equation to difference equation and calculate the coefficients.

    If the resonant frequency is too close to the cutoff frequency of PI compensator, it significantly impacts the phase margin. So you need to avoid this or add lead/lag compensator similar to  gridconnectedlclFltr.

    Best,

    John