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.

DPLib CNTL_2P2Z_Drv

Other Parts Discussed in Thread: TMS320F28069, CONTROLSUITE

HI,

I am working on TMS320F28069, it has 32-bit floating point CPU.

I need to use CNTL_2P2Z.asm of DPLib . How can we calculate values of coefficients( b2,b1,b0,a2,a1 ) which are used in the CNTL_2P2Z.asm.   

Thanks & Regards

Prashanth K

  • Hi Prashanth!

    Refer please to the your old thread http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/281234.aspx. There is a some offer...Have you the floating point DPLIb for F2806x already? My proposition about using MatLab still stands.

    Regards,

    Igor 

  • Hi Igor Gorbachev,

    I am newer to matlab, i don,t know about how to use matlab.

    I found co-efficient values of 2-pole 2-zero control system in the example project, search path for this project is controlSUITE/development_kits/HV_SOLAR_DC_AC_v1.1/SolarHv_DCAC_PiccoloB_Rev_02.

    Are co-efficient values fixed for all applications? 

    some part of the code is given below: 

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

    /*  File name : SolarHv_DCAC-main.c

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

    //Voltage loop
    CNTL_2P2Z_CoefStruct1.b2 = _IQ26(-0.3682);
    CNTL_2P2Z_CoefStruct1.b1 = _IQ26(0.01121);
    CNTL_2P2Z_CoefStruct1.b0 = _IQ26(0.3794);
    CNTL_2P2Z_CoefStruct1.a2= _IQ26(-0.869);
    CNTL_2P2Z_CoefStruct1.a1= _IQ26(1.869);
    CNTL_2P2Z_CoefStruct1.max = _IQ24(0.0); //4A
    CNTL_2P2Z_CoefStruct1.min = _IQ24(-0.4);

    //Current loop for 52e-6 sample time
    CNTL_2P2Z_CoefStruct2.b2 = _IQ26(-0.3938);
    CNTL_2P2Z_CoefStruct2.b1 = _IQ26(0.1314);
    CNTL_2P2Z_CoefStruct2.b0 = _IQ26(0.5253);
    CNTL_2P2Z_CoefStruct2.a2= _IQ26(-0.01);
    CNTL_2P2Z_CoefStruct2.a1= _IQ26(1.01);
    CNTL_2P2Z_CoefStruct2.max = _IQ24(0.4);
    CNTL_2P2Z_CoefStruct2.min = _IQ24(-0.4); //400

    //Notch filter for 60Hz system, sample rate 416e-6s
    CNTL_2P2Z_CoefStruct3.b2 = _IQ26(0.9);
    CNTL_2P2Z_CoefStruct3.b1 = _IQ26(-1.712);
    CNTL_2P2Z_CoefStruct3.b0 = _IQ26(0.9);
    CNTL_2P2Z_CoefStruct3.a2= _IQ26(-0.8);
    CNTL_2P2Z_CoefStruct3.a1= _IQ26(1.712);
    CNTL_2P2Z_CoefStruct3.max = _IQ24(0.99); // rad
    CNTL_2P2Z_CoefStruct3.min = _IQ24(-0.99); // rad

    //PLL controller , sample rate 416e-6
    CNTL_2P2Z_CoefStruct4.b2 = _IQ26(-0.01723);
    CNTL_2P2Z_CoefStruct4.b1 = _IQ26(0.0004355);
    CNTL_2P2Z_CoefStruct4.b0 = _IQ26(0.01767);
    CNTL_2P2Z_CoefStruct4.a2= _IQ26(-0.864);
    CNTL_2P2Z_CoefStruct4.a1= _IQ26(1.864);
    CNTL_2P2Z_CoefStruct4.max = _IQ24(0.5); // 50Hz
    CNTL_2P2Z_CoefStruct4.min = _IQ24(-0.5); // -50Hz

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

    Thanks & Regards

    Prashanth K

  • Hi Prashanth!

    Well you can take coefficients also from ti\controlSUITE\libs\app_libs\digital_power\f28M35x_v1.1\Doc\DPLibFlt.pdf (Chapter 5 p.19):

    // Initialize the Controller Coefficients
    CNTL_2P2Z_CoefStruct1.b2 = 0.05;
    CNTL_2P2Z_CoefStruct1.b1 = -0.20;
    CNTL_2P2Z_CoefStruct1.b0 = 0.20;
    CNTL_2P2Z_CoefStruct1.a2 = 0.0;
    CNTL_2P2Z_CoefStruct1.a1 = 1.0;
    CNTL_2P2Z_CoefStruct1.max =0.7;
    CNTL_2P2Z_CoefStruct1.i_min =-0.9;
    CNTL_2P2Z_CoefStruct1.min =0.0;

    But the fact that your coefficients will define your transfer function ultimately. You need understand what form of transfer fonction you want to get for frequency and phase areas. If you know poles and zeros of your transfer function then you can calculate coeficients with MatLab application. I do not see any other better way. http://www.mathworks.com/products/matlab/

    Regards,

    Igor