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.

TMS320F28027: Trying to increase PID response on a load change

Part Number: TMS320F28027
Other Parts Discussed in Thread: UCD3138, CONTROLSUITE, C2000WARE

Hello everyone!

I want to change analog pwm uc... on tms320... I have a buck converter which need to regulate output current (not voltage!), so output capacitor is almost absent. I`m using LEM as a sensor. There is a load frequency of 500 Hz for example (can be changed since 0 till 5 KHz) commutating short circuit and R=5 Ohm.

Earlier there was an analog regulator, and it was faster. Magnitude of current overshoot was less in 3 times at least. I`m trying some way to increase tms320 speed. In a SLUA708 for ucd3138 there is a 2.2 "Firmware Implementation of PI Controller" and looks like there is an opportunity to change gains depending on error. F_pwm=50kHz (T=20us). I wrote some coarse code for trying in
interrupt void cpu_timer2_isr(void) - 5 us since start of a period every cycle:

diff = Adc_Vout1 - Vout_Ref_wInj;

if(diff > 900000)//about 1 A magnitude
{//
  CpuTimer2.InterruptCount++;
  Pgain = 4000;
  Igain = 1;
  CpuTimer2Regs.TCR.bit.TIE = 0;//stop timer2
  if(CpuTimer2.InterruptCount > 5 && flag_trip == 0)//new gain should be not more than 5 times during short cirquit
  {
    Pgain = 2500;//
    Igain = 80;
    CpuTimer2.InterruptCount = 0;
    flag_trip = 1;
  }
}

if(diff <= 900000)//if error less than 1 A, we use small gain
{
  flag_trip = 0;
  Pgain = 2500;
  Igain = 80;
  CpuTimer2.InterruptCount = 0;
}

That works much worse than just 2500 or 4000 because of oscillations. You ask: why don`t you use Pgain = 4000 since the beginning! I`ll say that there are oscillations too. There is a such a dependence: big gain - oscillations and unstable system, small gain - big overshoot. This is ususal and logical.

Can anyone give me some fragment of working source code (I can`t find for ucd3138 PWR026 PFC EVM source code)? Is there any sence in such an approach for tms320?  Would anyone offer some approach for such a load mode? Maybe it`s impossible to get the same result as for analog controller, but  I want to reach it as close as possible.

Will be very appreciate for any help!

  • This technique is sometimes called "gain scheduling". It can be made to work well, and we have implemented it on two C2000 kits: a high voltage inter-leaved boost PFC, and (more recently) a 3-phase Vienna rectifier. Both can be found in controlSUITE. I attach a slide showing control response of the former (boost PFC) kit.  The boost PFC code is written in assembly code and runs on the fixed-point F28035 (similar to your F28027). The Vienna kit is written in C, and runs on the floating-point F28377D.

    There is a new floating-point device (F28004x) which has some nice features for digial power control. An alternative approach you could look at is a true non-linear control law; there is one in the floating-point Digital Control Library (DCL) which you can find in C2000Ware. I attach the relevant pages from the User's Guide for that library. On the 100MHz F280049 with 50kHz switching frequency you would have 2,000 cycles, so this approach may be feasible.

    I hope this helps.

    Regards,

    Richard

    Non Linear Control of Voltage Loop ILPFC.pdf

    Pages from SPRUID3.pdf

  • Thanks a lot anyway! I`ll see this.