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.

Compiler/TMS320F28035: TI controlsuite solar mirco inverter example

Part Number: TMS320F28035
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: TI C/C++ Compiler

Hi TI experts,

I am looking into the code provided by the TI controlsuite solar micro inverter example.

Project name: SolarMicroInv_F2803x. It is about the 3p3z controller. It is Build 2, no grid, resistor load, inverter only.

#define CNTL_3P3Z_IQ_MACRO(v, k)                           \
 /* Calculate error */                           \
 k.Errn = k.Ref - k.Fdbk;                          \
 k.Out = _IQ24mpy(v.Coeff_A3,k.Out3)+_IQ24mpy(v.Coeff_A2,k.Out2) + _IQ24mpy(v.Coeff_A1 , k.Out1)        \
 + _IQ24mpy(v.Coeff_B3 ,k.Errn3)+_IQ24mpy(v.Coeff_B2 ,k.Errn2) + _IQ24mpy(v.Coeff_B1 , k.Errn1) + _IQ24mpy(v.Coeff_B0 , k.Errn); \
                                 \
 /* Update error values */                          \
 k.Errn3 = k.Errn2;                            \
 k.Errn2 = k.Errn1;                            \
 k.Errn1 = k.Errn;                            \
                                 \
 /* Determine new output */                          \
 k.Out = (k.Out < v.Max) ? k.Out : v.Max;                      \
 k.Out = (k.Out > v.IMin) ? k.Out : v.IMin;                      \
                                 \
 /* Store outputs */                            \
 k.Out3 = k.Out2;                            \
 k.Out2 = k.Out1;                            \
 k.Out1 = k.Out;                             \
 /* Saturated output */                           \
 k.Out = ((k.Out > v.Min) ? k.Out : v.Min);

My questions are:

(1) What is IMin? What is it for? What is the difference between IMin and Min? I saw in the main(), Min is initialized to be -0.97. But IMin is not. So I assume IMin is 0. Then it becomes problematic when .out become negative.

 CNTL_3P3Z_IQ_VARS_init(&cntl3p3z_InvI_vars);
 CNTL_3P3Z_IQ_COEFFS_init(&cntl3p3z_InvI_coeff);
 cntl3p3z_InvI_coeff.Coeff_A1 = _IQ24(1.584);
 cntl3p3z_InvI_coeff.Coeff_A2 = _IQ24(-0.6978);
 cntl3p3z_InvI_coeff.Coeff_A3 = _IQ24(0.1137);
 cntl3p3z_InvI_coeff.Coeff_B0 = _IQ24(0.2866);
 cntl3p3z_InvI_coeff.Coeff_B1 = _IQ24(-0.3173);
 cntl3p3z_InvI_coeff.Coeff_B2 = _IQ24(0.3338);
 cntl3p3z_InvI_coeff.Coeff_B3 = _IQ24(-0.2616);
 cntl3p3z_InvI_coeff.Max = _IQ24(0.95);
 cntl3p3z_InvI_coeff.Min = _IQ24(-0.95);

(2) Where is the code for the two initialization functions ( CNTL_3P3Z_IQ_VARS_init(&cntl3p3z_InvI_vars); CNTL_3P3Z_IQ_COEFFS_init(&cntl3p3z_InvI_coeff))? I cannot find anywhere in the project. 

Thank you in advance for your help.

  • 1)Read UG, SolarLib.pdf, see page 119 where it is described what it is.

    C:\ti\controlSUITE\libs\app_libs\solar\v1.2

    2) The source for that is compiled into the Solar Library. The source for the solar library is located at
    C:\ti\controlSUITE\libs\app_libs\solar\v1.2\IQ\source