Part Number: TMS320F28379D
Tool/software: Code Composer Studio
Hello,
I am using matlab to generate hrpwm phase-shift code for delfino. I am having trouble with non-integer values of TBPHS. Actual phase-shift goes in the opposite direction for non integer values and a abrupt jump in phase-shift is observed at integer values. Here is an example. The generated C code is also given below.
TBPHS -> Phase-Shift(degree)
150 158.1
150.5 158.8
150.8 159.2
151 156.8
152 155.5
EPwm2Regs.TBPHS.bit.TBPHS = ICN_PFC_Controller_P.twodelta_Value;
/*-- Update TBPHSHR --*/
{
extern int MEP_ScaleFactor;
real_T TBPHSf = ICN_PFC_Controller_P.twodelta_Value;
TBPHSf -= EPwm2Regs.TBPHS.bit.TBPHS;
TBPHSf *=65536;
EPwm2Regs.TBPHS.bit.TBPHSHR = (uint16_T)TBPHSf;
}