Hi,
I am using KV58F to control my BLDC motors. It works fine for normal running.
But, it will cause the problem if there is fault conditions(FAULT0~~FAULT3) happen...
The problem, is that the PWM channel does not disable completely. It will cause over-current because there are no dead-time control in output.
It works fine with MCF56F8367 DSP that I used for our earlier controller.
Here are the some code related PWM protection:
//-----*****Set up Protection of PWM0&1 based on Fault0~~Fault3*****-----
// Fault3---D_Q
// Fault2---PL_LIMIT
// Fault1---AZ_LIMIT
// Fault0---EL_AZ
INETVU_PWM0_BASEADDR->SM[0].DISMAP[0] = PWM_DISMAP_DIS0A(0x09) | PWM_DISMAP_DIS0B(0x09); // Channel 0---Protection on FALUT3(D_Q)&FAULT0(EL_AZ)
INETVU_PWM0_BASEADDR->SM[1].DISMAP[0] = PWM_DISMAP_DIS0A(0x09) | PWM_DISMAP_DIS0B(0x09); // Channel 1---Protection on FALUT3(D_Q)&FAULT0(EL_AZ)
INETVU_PWM0_BASEADDR->SM[2].DISMAP[0] = PWM_DISMAP_DIS0A(0x09) | PWM_DISMAP_DIS0B(0x09); // Channel 2---Protection on FALUT3(D_Q)&FAULT1(AZ_LIMIT)&FAULT0(EL_AZ)
INETVU_PWM1_BASEADDR->SM[0].DISMAP[0] = PWM_DISMAP_DIS0A(0x0B) | PWM_DISMAP_DIS0B(0x0B); // Channel 0---Protection on FALUT3(D_Q)&FAULT1(AZ_LIMIT)&FAULT0(EL_AZ)
INETVU_PWM1_BASEADDR->SM[1].DISMAP[0] = PWM_DISMAP_DIS0A(0x0B) | PWM_DISMAP_DIS0B(0x0B); // Channel 1---Protection on FALUT3(D_Q)&FAULT2(PL_LIMIT)&FAULT0(EL_AZ)
INETVU_PWM1_BASEADDR->SM[2].DISMAP[0] = PWM_DISMAP_DIS0A(0x0B) | PWM_DISMAP_DIS0B(0x0B); // Channel 2---Protection on FALUT3(D_Q)&FAULT2(PL_LIMIT)&FAULT0(EL_AZ)
// Fault 0/1/2/3 active in logic level one, automatic clearing
INETVU_PWM0_BASEADDR->FCTRL = PWM_FCTRL_FLVL(0x0F);
INETVU_PWM0_BASEADDR->FCTRL |= PWM_FCTRL_FAUTO(0x0F);
INETVU_PWM1_BASEADDR->FCTRL = PWM_FCTRL_FLVL(0x0F);
INETVU_PWM1_BASEADDR->FCTRL |= PWM_FCTRL_FAUTO(0x0F);
// PWMs are re-enabled at PWM full cycle
INETVU_PWM0_BASEADDR->FSTS |= PWM_FSTS_FFULL(0x0F);
INETVU_PWM1_BASEADDR->FSTS |= PWM_FSTS_FFULL(0x0F);
// PWM Fault filter - 20 Fast periph. clocks sample rate, 7 agreeing samples to activate
INETVU_PWM0_BASEADDR->FFILT = (PWM_FFILT_FILT_PER(20) | PWM_FFILT_FILT_CNT(7));
INETVU_PWM1_BASEADDR->FFILT = (PWM_FFILT_FILT_PER(20) | PWM_FFILT_FILT_CNT(7));
// Software Controlled Output Register---For unipolar PWM control
INETVU_PWM0_BASEADDR->SWCOUT = 0x0000;
INETVU_PWM1_BASEADDR->SWCOUT = 0x0000;
Can anyone help to find out why the protection does not work properly?
Thanks,
Christie