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.

TMS320F28035: Coefficients in 3p3z

Part Number: TMS320F28035
Other Parts Discussed in Thread: SFRA

I am using the SFRA with Compensation Designer matlab script to tune the 3p3z compensator. I have problem with correctly calculate the b0,b1,b2 coefficients.

In the SFRA document there is formula:

,where according to the Solar Lib document:

and to calculate nominator coefficients I should use only the part, that are with the z-1, z-2 etc... ? For example for b0:

and for b1

etc...

or multiply by the following part, that is:

I try both ways and I don't receive the correct values.

I do it at first with values generated from the Compensation Designer, to check is, the formula correctly.

I want to to adopt SFRA data into matlab script then do the tunning in Matlab with the sisotool, and then receive the Compensation transfer function, then multiply it by generated transfer function of initial model and by solver calculate the pole and zeros frequency.

I have correctly values from calculating the denominator coefficients (a1,a2...)

  • The older version of the compensation designer used Kdc in dB

    below is the full script


    s=tf('s');

    Fs=200000;

    gain = 80;
    gain_mul=10^(gain/20.0);

    z0=2*pi*25000 ;%Fs/pi;
    z1=2*pi*2000;
    z2=2*pi*1000;
    p1=2*pi*100;
    p2=2*pi*5000;
    G=gain_mul*((p1*p2)/(z1*z0*z2))*((s+z1)*(s+z0)*(s+z2))/(s*(s+p1)*(s+p2));
    bode(G);
    hold on;

    %%
    Ts=1/Fs;

    B=[((z0+2*Fs)*(z1+2*Fs)*(z2+2*Fs))/(2*Fs*(p1+2*Fs)*(p2+2*Fs)) ...
    ,((2*Fs+z0)*(2*Fs+z1)*(z2-2*Fs)+(2*Fs+z0)*(z1-2*Fs)*(2*Fs+z2)+(z0-2*Fs)*(2*Fs+z1)*(2*Fs+z2))/(2*Fs*(p1+2*Fs)*(p2+2*Fs))...
    ,((2*Fs+z0)*(z1-2*Fs)*(z2-2*Fs)+(z0-2*Fs)*(2*Fs+z1)*(z2-2*Fs)+(z0-2*Fs)*(z1-2*Fs)*(2*Fs+z2))/(2*Fs*(p1+2*Fs)*(p2+2*Fs)) ...
    ,((z0-2*Fs)*(z1-2*Fs)*(z2-2*Fs))/(2*Fs*(p1+2*Fs)*(p2+2*Fs))];
    B=B.*((gain_mul*p1*p2)/(z1*z0*z2));

    A=[1 ...
    ,((p2-2*Fs)*(2*Fs+p1)-4*Fs*(2*Fs+p2))/((p1+2*Fs)*(p2+2*Fs)) ...
    ,(-4*Fs*(p2-2*Fs)-(p1-2*Fs)*(2*Fs+p2))/((p1+2*Fs)*(p2+2*Fs)) ...
    ,(-(p1-2*Fs)*(p2-2*Fs))/((p1+2*Fs)*(p2+2*Fs))];


    temp2 = 1/((p1+2*Fs)*(p2+2*Fs));
    A1= ( (p2 - 2 * Fs) * (p1 + 2 * Fs) - 4 * Fs * (p2 + 2 * Fs) ) * temp2;

    G_d=tf(B,A,Ts);
    bode(G_d);