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.

library file or own code for PI Controller? Which one is faster?

Other Parts Discussed in Thread: CONTROLSUITE, MOTORWARE

Hello Guys,

I am using TMS32F28027 MCU. I have to implement a PI Controller as part of my program. I looked up in motor control library files and found a pi.h file.

Are these header files made available to be user friendly or to increase performance?

 

  • Hello Prakash,

    A little of both.  With library blocks like this there's always a balance between efficiency and ease-of-use.  The C macro approach has the advantage that there is no function calling overhead so the cycle count is pretty low, but the code is read-able, and being open source users can modify it if they wish.   

    There are other solutions too.  I believe MotorWare has its' own version of the PI controller, and there is one in the new Digital Controller Library in controlSUITE in which the controller is coded in assembly.  Relatively speaking, each has strengths and draw-backs.

    Regards,

    Richard

  • Hi Prakash,

    Yes, the TI library for PI controller is very efficient but I prefer using my own equations (more controllable and rookie programmer friendly).

    Regards,
    Gautam