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.
Tool/software: Code Composer Studio
Dear Ti community
I'm developing PCMC on HVPSFB.
There are questions.
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?
about comparater
Input of comparater -side is setted at DacDrvCnf.
But I can't find the setting +side in code.
Where is it setted?
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?
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?
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.
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