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: ILPFCkit question

Part Number: TMS320F28035


Hi,

1. there is code below in "ILPFC_Base-Settings.h". I suppose it's to convert the number to Q24 format, but why we are multiplying 4095, not 4096?
#define VBUS_OVP_THRSHLD ((int32)((435.0/VBUS_MAX_SENSE)*4095*4095))

2.In ILPFC-DPL-ISR.asm, for voltage and current loop control(INCR_BUILD = 3) the software flow can be concluded as:
read ADC result --> PFC ICMD --> CNTL_2P2Z current control --> PWM1 register update --> calculate 1/(Vrms*Vrms)--> calculate average Vbus --> CNTL_2P2Z voltage control --> calculate Vrect.
The sequence seems unreasonable, because we have to first implement CNTL_2P2Z voltage control and get the output, and then we can implement the CNTL_2P2Z current control . And we have to calculate Vrect before CNTL_2P2Z voltage control.

3. For sine analyzer, why don't we set Threshold=0, what's the benefit of such a threshold?
//sine analyzer initialization
sine_mainsV.Vin=0;
sine_mainsV.Iin=0;
sine_mainsV.SampleFreq=_IQ15(10000.0);
sine_mainsV.Threshold=_IQ15(0.1);//(0.015);//(0.02);

  • 1. 12 bit binary number = 111111111111=4095. So for Q24 you have to multiply by 4095*4095

    2. No, once you get the current feedback from ADC you quickly implement the current controller and update the PWM. This will keep the current loop computation & update delay to minimum. Current loop is lot faster than voltage loop and so delay in current loop should be minimized. Voltage loop is slow, has a loop BW of about 10Hz and so it can be delayed by the current loop.

    3. Threshold of zero for the rectified sine wave could be difficult to detect. The wave form may not reach zero. So it is better to use non zero threshold. This does not change the frequency or any other info related to the voltage.

    Shamim
  • Thanks. But I'm not quite sure about the first answer, if you convert a Q0 number to Q8, you will shift left 8, it's equal to multiplying 2^8, not multiplying (2^8-1).