Tool/software: Code Composer Studio
before I use DELAY_US function for Over current protection (OCP) . To avoid the inductor current that reach OCP will turn high side driver off then the current will be ongoing lower. once lower than OCP , the Epwm will immediately turns high side driver on. I afraid of this system will be unstable, because the Epwm will still turn on-off-on-off.
Now I using over current window during I_OCP*100% to I_OCP*90% ,but It still can't turn off immediately ,reaction must be 20~30uS .
even if I put it on "void main(void)" or " interrupt void adc_timer_isr(void)".
Zero current detection (ZCD) , if the inductor current is going negative ,the low side MOSFET must be turns off immediately (< 1uS)
Over current protection (OCP) , if the inductor current is going too much,the high side MOSFET must be turns off immediately (< 1uS).
BTW I have studied the "C2000 Digital Power BoosterPack" that said "In this project the two PWM outputs are driven low immediately on a comparator event to protect the power stage."
I don't know how many "driven low immediately" time.
###################################################################################
if(IL < 2048) //IL < 0 , ZCD
{
EPwm1Regs.AQCSFRC.bit.CSFA = 2; //HG on
EPwm1Regs.AQCSFRC.bit.CSFB = 1; //LG off
OCP=0;
}
else if(IL > 4095) //IL > 3 ,OCP
{
EPwm1Regs.AQCSFRC.bit.CSFA = 1; //HG off
EPwm1Regs.AQCSFRC.bit.CSFB = 2; //LG on
OCP=1;
}
else if(IL > 3891 && OCP==1) //IL > 2.7 , OCP window
{
EPwm1Regs.AQCSFRC.bit.CSFA = 1; //HG off
EPwm1Regs.AQCSFRC.bit.CSFB = 2; //LG on
}
else //IL >0 A and IL < 3A , feedback ---error amp
{
OCP=0;
EPwm1Regs.AQCSFRC.bit.CSFA = 0;
EPwm1Regs.AQCSFRC.bit.CSFB = 0;
Vbo_err = Vbu_cmd - Vo; // cmd 400
PWM1_Duty = Vbo_cmpa1 + (Vbo_err-Vbo_err1)*1 + (Vbo_err+Vbo_err1)*1;
Vbo_err1=Vbo_err;
Vbo_cmpa1=PWM1_Duty;
if( PWM1_Duty > PWM1_Period ) //limit duty
{
PWM1_Duty = 0.9*PWM1_Period;
}
if( PWM1_Duty < 1 )
{
PWM1_Duty = 0;
}
EPwm1Regs.CMPA.half.CMPA =PWM1_Duty;
EPwm1Regs.CMPB =PWM1_Duty;
}
#############################################################################