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.

TMS320F28377D: Help with CLA Code for a 2p2z controller

Part Number: TMS320F28377D
Other Parts Discussed in Thread: POWERSUITE, C2000WARE-DIGITALPOWER-SDK, TIDM-02011

Hi,

I am going through some examples from the digital powerSUITE, titled Buck_VMC_F2837xS. 

There seems to be some functions that are called, such as:

CNTL_2P2Z_F_C_VAR_INIT(var1);
CNTL_2P2Z_F_C_COEFF_INIT(coeff1);

Which, unfortunately, are not even defined in that same C code.

I assume that they are some kind of function included within the Driver Lib digital controller library - but there is absolutely zero material, at least that I can find, of what these functions do or the C program that they implement. 

I am finding it very hard to grasp exactly how this code computes the next duty cycle output from the difference equation of a 2p2z controller. 

Is there any reference which shows what these function that are called do, and exactly how best to sample the ADC's and how they are summated/multiplied with the coefficients and passed to the PWM modules?

As I mentioned, if I could see what these functions actually do rather than just calling random functions with no description, it would be much, much easier to form my own code for my own controller. I think TI's effort at creating functions to increase the level of abstraction and make coding "easier" has the opposite effect - which does not help since all of the digital power examples are written in the exact same driverLIb code type. 

Regards,
Joel

  • Joel,

    This example has been updated and is supported in C2000Ware-DIGITALPOWER-SDK. Please take a look at the tidm_dc_dc_buck solution and see if the solution updates are more clear.  For information on the 2p2z controller, please see https://dev.ti.com/tirex/explore/node?node=AH4e9SC7P9whvmewbFSmVA__5C6SEVO__LATEST look under the DF22, Direct Form 2 (Second Order) Compensators, chapter.

    Regards,

    Ozino

  • Hi Ozino,

    This has helped. The functions can be found in the document you gave. Now just to learn how to use them.


    One further question - can the DCL library and all of it's functions be used within the CLA - if so, where is it best to define them? Is it best to define them in the CLA, or the CPU?

    Furthermore, in the example you sent me, I cannot find any code that shows that, following function calls and calculation of new controller parameters, how exactly to actually change the duty cycle, or the frequency of the PWM module according to this result, such as in a resonant or duty cycle controlled converter. It seems that the duty cycle etc is only decided by user input. Is there a reason for this, or am I missing something in the code which shows to use the output of these controllers to modulate the duty/frequency of the switches?

    Thanks,
    Joel

  • Joel, 

    Have you looked at the user's guide for this solution? There should be more information on the APIs for library in use. Please see TIDM-02011 for an example of how to include the DCL library for the CLA. 

    Regards,

    Ozino