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.

CCS/LAUNCHXL-F28379D: Changing the limit values of PID controller

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hello everyone, I'm using the Launchpad F28379D with the DRV8305EVM to control the speed of a 2 phase DC motor. so I'm using the PID example in C2000ware.

:\C2000Ware_1_00_06_00\libraries\control\DCL\c28\examples\F28069_PID

My speed refrence value is 1500 rpm and let's say i'm getting as feedback 1000 rpm. the error would be 500. with Kp=1 and Ki=Kd=0 the output is 500. the values of the output of the PID example is limited between -1 and +1. so I'm gonna always get +1.

So my question is how can I change those limit values of the PID to suit my application ? (I mean how to calculate the new limits values)

hope someone can help.

  • The controller output limits are there for anti-windup.  You can set them freely to whatever makes sense in your application by writing directly to the structure elements during initialization.  For example;

    pid1.Umax = 12.34f;

    pid1.Umin = -5.678f;

    Typically the limits are set to clamp the controller output to the usable range of the block following the controller.  For example, if the PID is used as the outer speed loop controller in an FOC motor drive, it might feed the reference input to a PI controller for the q-axis current loop.  In this case, one would clamp the output to match the range of the Qs output from the Park transform.  

    Alternatively, in a simple PWM duty controlled loop one might scale the inputs and output on a per-unit basis (attached).  I don't know that there are any general rules.

    Regards,

    Richard

    loop scaling example.pdf