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/CONTROLSUITE: ILPFC

Part Number: CONTROLSUITE

Tool/software: Code Composer Studio

Hello there,

I just wanted to know about implementation of 2p2z compensator. In 2p2z header file, two minimum values are taken for saturation. One of them is said to be internal minimum. Why these two definitions are required, why can't we work on just a single value?

Thanks and Regards,

Akshay 

  • Hi Akshay,

    Can you please point out which part of the code are you talking about? with a picture or some code? Thanks.

    Regards,

    Chen

  • Hello Chen,

    code is as below:

    #define CNTL_2P2Z_IQ_C(v, k) \
    /* Calculate error */ \
    k.Errn = k.Ref - k.Fdbk; \
    k.OutPresat = _IQ24mpy(v.Coeff_A2,k.Out2) + _IQ24mpy(v.Coeff_A1 , k.Out1) + _IQ24mpy(v.Coeff_B2 ,k.Errn2) \
    + _IQ24mpy(v.Coeff_B1 , k.Errn1) + _IQ24mpy(v.Coeff_B0 , k.Errn); \
    \
    /* Update error values */ \
    k.Errn2 = k.Errn1; \
    k.Errn1 = k.Errn; \
    \
    /* Determine new output */ \
    k.Out = k.OutPresat; \
    k.Out = (k.Out < v.Max) ? k.Out : v.Max; \
    k.Out = (k.Out > v.IMin) ? k.Out : v.IMin; \
    \
    /* Store outputs */ \
    k.Out2 = k.Out1; \
    k.Out1 = k.Out; \
    /* Saturated output */ \
    k.Out = ((k.Out > v.Min) ? k.Out : v.Min);

    Here, output is saturated two times. first for IMin and second for Min, Why it is satuated to internal minimum ( IMin ) ?

    Thanks and Regards,

    Akshay

  • Hi, Akshay,

    Please take a look at page 19 of DPLib.pdf in ti\controlSUITE\libs\app_libs\digital_power\f2803x_v3.5\Doc. Hope this helps.

    Regards,

    Chen