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: CLA Management and Controller reset

Part Number: TMS320F28035

Hi,

I am developing a power application thanks to the DPlib on a Piccolo F28035. I am having trouble to manage correctly the CLA.

I have several control modes implemented in several tasks, using the 2P2Z controller macro from the DPLib. There is one memory space reserved for each control loop (internal buffer : _CNTL_2P2Z_CLA_DBUFF:n: located in the CLA data RAM). The application must not run 2 control loops at the same time but can change it's control loop after a stop/start-up sequence.

Data contained in the internal buffer should be reset before starting the task for the first time (and when restarting the task after a stop sequence) to insure that the 2P2Z output is 0 (which is the duty cycle for PWM module).

My question is : is there a way to reset easily the internal buffer or shall I use a specific task to reset the 2P2Z memory ?

Thanks in advance

  • Hi Pablo,
    There isn't a really better way than just manually zeroing the elements in the variables structure. There's a C macro in the header file which you can use (CNTL_2P2Z_CLA_C_VAR_INIT). You could use a separate task to do that, and obviously the Ref and Fdbk elements would have to be re-loaded before you re-started the controller.
    You could do something like locating all the variable structures in contiguous memory then write a routine to clear all of them together, but this structure is so small it's not going to be much faster than clearing the elements individually.
    Regards,
    Richard
  • Thanks Richard, that's what I thought !