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/TMS320F28027: questions about TMS320F28027: Piccolo HVPSFB(PCMC)

Part Number: TMS320F28027

Tool/software: Code Composer Studio

Dear Ti community

I'm developing PCMC on HVPSFB.

There are questions.

  1. about 2p2z parameters

    In 「HVPSFB-Calculations.xls」

    fz1,fz2,fp1,fp2,Kdc are setted as tuned parameters.

    I think that they mean Kdc(s - fz1)(s - fz2)/((s - fp1)(s - f p2)).

    Then change from  continuous time to discrete time.

    Are these right?

    And , How do you change from  continuous time to discrete time?

  2. about comparater
    Input of comparater -side is setted at DacDrvCnf.

    But I can't find the setting +side in code.

    Where is it setted?


  3. about over current

    When over current,comparater2 is high.

    After that,ePWM1 DCAEVT1 occurs,and ePWM1A/B is low.

    But, ePWM2 's DCAEVT1 is assigned comparater1.

    So I think when over current ,ePWM2 is not low.

    Why ePWM2 is low when over current?

  4. about assembler code
    In 「HVPSFB-DPL-ISR.asm」 line 336,

      LB   EXIT_ISR          ; around 127 cycles including 4 for this branch

    But even if I counted refer to 「TMS320C28x CPU and Instruction Set Reference Guide」,

    it wasn't 127cycle.

    I think,

    「EALLOW」is 4 cycle.

    「B」is 4cycle when through. 7 cycle when jump.

    「LB」is 4 cycle.

    「ADCDRV_4ch」is 14 cycle

    「ADCDRV_1ch」is 5 cycle

    「DACDRV_RAMP」is 9 cycle

    「CNTL_2P2Z」is 36 cycle

    「EDIS」is 4 cycle

    「IRET」is 8 cycle

    Another is 1 cycle.

    Is that wrong?

  • I'm looking into the above question. I will give an update by tommorow US CST time.

    Best,
    Matthew
  • Hi user5277039,

    1. All those parameters are already based on Z domain.
    for example: Kdc(z - fz1)(z - fz2)/((z - fp1)(z - f p2)).

    2. The +side is the current feedback value which comes from the GPIO used as a Comparater/ADC. You can refer to the Analog Subsystem Block Diagram in the TRM of the device to find it out. It is purely based on Analog connection. There is no code settings needed.

    3. I am not sure about this, maybe because once there is no output of EPWM1A/B, the freewheeling current will decrease until zero though EPWM2B or EPWM2A. I will get back to you on this.

    4.You might be right since it is an old comment. I will get back to you on this as well.

    Regards,
    Chen
  • 1.Then  ,Kdc(z - fz1)(z - fz2)/((z - fp1)(z - f p2))=Kdc(z^2-(fz1+fz2)z+fz1*fz2)/(z^2 - (fp1+fp2)z+fp1*fp2)

    =Kdc(1-(fz1+fz2)z^(-1)+fz1*fz2*z^(-2))/(1 - (fp1+fp2)z^(-1)+fp1*fp2*z^(-2)).

    It compare with (b0+b1*z^(-1)+b2*z^(-2))/(1+a1*z^(-1)+a2*z^(-2)),

    b0=Kdc

    b1=-Kdc(fz1+fz2)

    b2=Kdc*fz1*fz2

    a1=-(fp1+fp2)

    a2=fpa*fp2

    But,in excel calculation ,

    Values is diferrence.

  • Hi user5277039,

    I think I didn't explain it correctly last time. Yes, it is changed from s domain to Z domain. Please take a look at two thread below.
    e2e.ti.com/.../428178
    e2e.ti.com/.../53646

    Regards,
    Chen
  • I checked these threads.
    But in the thread,
    the meaning of the following expression is not told


     fs=100000; //100Khz
     fz1=2000;
     fz2=(fs/3.14);
     fp2=(fs/3.14);
     fp1=0;
     Kdc=6000;
     pi=3.14;wz1 = 2*pi*fz1;
     wz2 = 2*pi*fz2;
     wp1 = 0; //Integrator pole at f=0
     wp2 = 2*pi*fp2;
     


     wr = sqrt(wz1*wz2);
     Q = wz1*wz2/((wz1+wz2)*wr);
     
     c2 = Kdc/(wr*wr);
     c1 = Kdc/(Q*wr);
     c0 = Kdc;
     
     d2 = 1/wp2;
     d1 = 1;
     d0 = 0;
     
     den =  4*d2*fs*fs + 2*d1*fs + d0;
     
     B0_I = (4*c2*fs*fs + 2*c1*fs + c0)/den;
     B1_I = (-8*c2*fs*fs           + 2*c0)/den;
     B2_I = (4*c2*fs*fs - 2*c1*fs + c0)/den;
     
     A1_I = ((-8*d2*fs*fs           + 2*d0)/den)*-1.0;
     A2_I = ((4*d2*fs*fs - 2*d1*fs + d0)/den)*-1.0;

    I'd like to know the derivation process above expressions.


    And ,
    Accoding to the 「DiscretePIDcontroller.pdf」 in the thread,
    The derivative term uses s = (z-1)/Tz.
    The integral term uses s=(2*(z-1))/(T*(z+1)).

    Then
    About K(s - fz1)(s - fz2)/(s - fp1)(s - fp2),
    which s is s = (z-1)/Tz or  s=(2*(z-1))/(T*(z+1))?

  • Hi user5277039,

    I am not pretty sure how it exactly was derived in this case. The function might be a little bit different but should be very close to the 2p2z function shown in page 32 (www.ti.com/.../spruhz5a.pdf). Also according to both files, it is calculated based on the s=(2*(z-1))/(T*(z+1)). Basiclly, it is doing the coefficient mapping.

    www.ti.com/.../slua622.pdf page 13
    www.ti.com/.../spruhz5a.pdf page 32

    Regards,
    Chen

  • Thank you for your support.

    I wanted to this doc.