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
#############################################
interrupt void epwm1_timer_isr(void)
{
EPwm1_Count++;
Vo = AdcRegs.ADCRESULT0 >>4;
Vin = (AdcRegs.ADCRESULT1 >>4);
IL = AdcRegs.ADCRESULT2 >>4;
'/###########Buck mode
if(.......... )
{
........
{
EPwm1Regs.AQCSFRC.bit.CSFA = 2;
EPwm1Regs.AQCSFRC.bit.CSFB = 1;
}
else if (..........)
{'''''''''''''''
DELAY_US(2L);
EPwm1Regs.AQCSFRC.bit.CSFA = 1;
EPwm1Regs.AQCSFRC.bit.CSFB = 2;
DELAY_US(2L);
}
else
#################################################
I used the DELAY() function and set 2L in (). then I used oscilloscope to check it which is approximate 5.6mS.
I found the formula that is "((A * 1000)/16.67 -9)/5", this number must be 0.316uS.
Is the setting wrong??
Hello Elizabeth,
I'm appreciated your support,and I have checked this setup that was 6.67L.
for(;;) //IDLE loop
{
if (IL < 500 && Boost == 1) //Boost mode ,IL < -3 OCP
{
DELAY_US(1); // 36uS ,
EPwm1Regs.AQCSFRC.bit.CSFA = 2; //HG on
EPwm1Regs.AQCSFRC.bit.CSFB = 1; //LG off
DELAY_US(1); // 38.4uS
}
}
DELAY_US(1) equal to 36uS~38.4uS on oscilloscope, I think it that is ADC&ePWM limitation of bandwidth.
my DSP2833x_Examples.h. as below
// TI File $Revision: /main/9 $
// Checkin $Date: July 2, 2008 14:31:12 $
//###########################################################################
//
// FILE: DSP2833x_Examples.h
//
// TITLE: DSP2833x Device Definitions.
//
//###########################################################################
// $TI Release: DSP2833x/DSP2823x C/C++ Header Files V1.31 $
// $Release Date: August 4, 2009 $
//###########################################################################
#ifndef DSP2833x_EXAMPLES_H
#define DSP2833x_EXAMPLES_H
#ifdef __cplusplus
extern "C" {
#endif
-----------------------------------------------------------------------------*/
#define CPU_RATE 6.667L // for a 150MHz CPU clock speed (SYSCLKOUT)
//#define CPU_RATE 7.143L // for a 140MHz CPU clock speed (SYSCLKOUT)
//#define CPU_RATE 8.333L // for a 120MHz CPU clock speed (SYSCLKOUT)
//#define CPU_RATE 10.000L // for a 100MHz CPU clock speed (SYSCLKOUT)
//#define CPU_RATE 13.330L // for a 75MHz CPU clock speed (SYSCLKOUT)
//#define CPU_RATE 20.000L // for a 50MHz CPU clock speed (SYSCLKOUT)
//#define CPU_RATE 33.333L // for a 30MHz CPU clock speed (SYSCLKOUT)
//#define CPU_RATE 41.667L // for a 24MHz CPU clock speed (SYSCLKOUT)
//#define CPU_RATE 50.000L // for a 20MHz CPU clock speed (SYSCLKOUT)
//#define CPU_RATE 66.667L // for a 15MHz CPU clock speed (SYSCLKOUT)
//#define CPU_RATE 100.000L // for a 10MHz CPU clock speed (SYSCLKOUT)
-----------------------------------------------------------------------------*/
#if DSP28_28332 // DSP28_28332 device only
#define CPU_FRQ_100MHZ 1 // 100 Mhz CPU Freq (20 MHz input freq)
#define CPU_FRQ_150MHZ 0
#else
#define CPU_FRQ_100MHZ 0 // DSP28_28335||DSP28_28334
#define CPU_FRQ_150MHZ 1 // 150 MHz CPU Freq (30 MHz input freq) by DEFAULT
#endif
// DO NOT MODIFY THIS LINE.
#define DELAY_US(A) DSP28x_usDelay(((((long double) A * 1000.0L) / (long double)CPU_RATE) - 9.0L) / 5.0L)
#ifdef __cplusplus
}
#endif /* extern "C" */
#endif // end of DSP2833x_EXAMPLES_H definition
//===========================================================================
// End of file.
//===========================================================================
and I have other question is how to using FIR or IIR filter to realize second order filter. I searched TI and google website .I can't reach it
Dear Elizabeth,
Thanks,
I got it , so F28335 is unable to using FIR
and I would like to using ADC to detect the inductor current for zero current detection and over current protection in real-time (cycle by cycle on switching frequency 100kHz ).
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).
I using ePWM1A and ePWM1B for high and low side MOSFET, and using AdcRegs.ADCRESULT2 to detect the 100kHz inductor current
Hello Elizabeth,
Sorry, I will start 2 topics that are inductor current functionality and FIR .
but the DELAY_US implement "interrupt void epwm1_timer_isr(void)" is incorrect timer . however it is not suitable to implement on ZCD or OCP .
Thanks.
If you are looking for a second order implementation you could take the DF22 compensator from the Digital Control Library in C2000Ware, here:
C:\ti\c2000\C2000Ware_1_00_03_00\libraries\control\DCL\c28
Those are floating point C28x functions you can just add to your F28335 project.
Regards,
Richard