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.

TMS320F280039C:TMS320F280039C

Part Number: TMS320F280039C


Tool/software:

If my PR controller requires a Z-transform, do I need to take the absolute values of a1 and a2 first? Because I looked at the DF22 section in the C2000 Digital Control Library, where a1 and a2 have negative signs, but the ones I calculated myself are already negative.

  • HI,

    Can you let us know what libraries you are using for your Z-transform?

    Regards,

    Ozino

  • Part Number: TMS320F280039C

    Tool/software:

    I accidentally pressed Resolved on the previous one, so I'll reorganize and send it again. Sorry.

    If my PR controller requires a Z-transform, do I need to take the absolute values of a1 and a2 first? Because I looked at the DF22 section in the C2000 Digital Control Library, where a1 and a2 have negative signs, but the ones I calculated myself are already negative.

    I expanded the formula directly, but I am not sure whether a1 and a2 should be positive first. Here is my formula:

        ev = v_ref-v_test;
        uv = b0_v * ev + b1_v * ev1 + b2_v * ev2 - a1_v * uv1 - a2_v * uv2;
        uv2 = uv1;uv1=uv;
        ev2 = ev1; ev1 = ev;
        a1 = (-8 + 2*((Two)^2)) / alpha;
        a2 = (4 - 4*T*wr + (Two)^2) / alpha;

        b0 = (4*Kp + 4*T*wr*(Kp + Kr) + (Kp*(Two)^2)) / alpha;
        b1 = (-8*Kp + 2*Kp*((Two)^2)) / alpha;
        b2 = (4*Kp-4*T*wr*(Kp+Kr)+(Kp*(Two)^2))/alpha;
    Thank you
  • Hello, 

    I have rejoined your 2 threads to continue the conversation here. I will let the owners of the original thread follow up.

    Thanks & Regards,

    Allison

  • Hello,

    I'm not sure if I exactly understand the question (a1,a2 having negative signs). If you meant the negation sign for the a1, a2 coefficients as part of DF22 calculation, that would be irrelvant on how you've dervied the coefficient.

    If your a1/a2 coefficient results are postive then you would pass values in as postive, if negative you would still past in the coefficient as negatives into the DF22 strcture.

    In your case (if I understood correctly, please correct me if I'm mistaken), your derviation came out negative, then you should pass in the a1/a2 values as negatives into the DF22 strcture. 

    FYI, if you wanted to calculate the exact same derivations in the MCU, we also provided a function to do just that for DF22.

    Best,

    Sen Wang

  • If I don't use the df22 method and just expand it directly, should I just take the values of a1 and a2 as the results calculated at that moment?

    Thank you for your reply.

  • Hello,

    I'm sorry, what do you mean by not using df22 method and expands it? The derivations/ expansion of the formula based on two poles-two zeros configuration is the basis of the DF22 strcture. Whichever value you dervied will be feed into the parameter strctures.

    Best,

    Sen Wang