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.

TMS320F280049C: Questions about PID Controller Example in C2000Ware_DigitalPower_SDK(5.04)

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE, PMP23338, TIDA-010062

Tool/software:

We are trying to integrate the PID controller from C2000Ware_DigitalPower_SDK(5.04) at this link and we have a few questions related to this: dev.ti.com/.../node

Questions:

  1. Is the controller set point variable rk = 0.25f just an analogue value or is it normalized? In essence is that say 0.25V?
  2. It looks like yk is the ADC reading converted to it’s regular analogue value which is not normalized. Eg. yk will be equal to 3.3 and not 4096 if Vref in ADC setup is 3.3 for 12-bit. Is that correct?
  3. Same question as 2 for uk.
  4. In an example where my control variable is phase shift would upper and lowerlim still be .05 and .95?
  5. I will run this as a PI and not PID so in this case would I set c1,c2,Kr and Kd = 0.?
  6. Not sure what i10 and i14 do. Do I leave those as is? Same with Umax and Umin.

Thanks in advance

  • The link you sent seems to be broken. What is present at that link?

    Which PID controller is the customer using?

    Thanks,

    Sira

  • Sorry the link didn't get embedded correctly. Here it is again: https://dev.ti.com/tirex/explore/node?node=A__AMe6r5j9.d3mdLDJN5DoEQ__digital_power_c2000ware_sdk_software_package__5C6SEVO__LATEST&placeholder=true

    The PID loop is Example_F28069_PID.c found in the Digital Control Library examples folder of the C2000Ware_DigitalPower_SDK(5.04).

  • Hello,

    Let me answer these questions in order.

    1. The rk value in this case is just an normalized value. In general controller parameter (PI,PID,NLPID, DF...) in DCL is unit agnostic. Long as all the parameters are in the same unit (V, normalized, SI, pu...). 

    2. The yk value is normalized to a range of [0,1] such that value of 4095 will have a value of 1. Or 3.3V if ADC vref is setup to be 3.3V. In this sense, the normalized value of rk=0.25 is equalivent to 0.825V (0.25 * 3.3V).

    3. Subsequently, uk is also outputted as an normalized value for the control effort. In the example Uk is converted again from noralized value to duty cycle. Where range of [-1,1] would be mapped to 0% - 100% of duty cycle.

    4. For phase-shift, it'll be dependent on your chosen unit. Since the example values are normalized, the upper lim and lower lim in this example indicates lower limit of 52.5% and upper limit of 97.5% duty cycle.

    5. Yes, for PI, c1,c2, Kr and Kd doesn't exist. DCL provides DCL_PI functions as well so please use that instead rather than DCL_PID.

    6. i10 and i14 is just an internal register to store the feedback/saturation value. There's no need to tinker with the variable, just need to make sure that they're initalize with the default value (see DCL_resetPID / DCL_resetPI for what those values are or you can just directly invoke them at initalization).

    Please let me know if you have further questions.

    Best,

    Sen Wang

  • Sen Wang thank you for the excellent answers. Our team has the following additional questions:

    But can they clarify the phase shift reply for 4? Why are they talking in duty cycles and not degrees. And how did they come up with 52.5% and 95.5%? I don’t understand that conversion.

     

    Also, another question on the side. Is this code an implementation of Voltage Mode Control? Does TI have an Average Current Mode Control PID example?

  • Yes,

    For reply 4 on phase shift, it's up to you to decide what upper/lower limit should be based on your design, but you probably will need a negative value as the lower limit for phase shift if you need to bring down the phase shift or carefully design your PI parameters so the overshoot is minimal. Just note the upper/lower limit applies directly to the control effort (uk), so really the question boils down to the ranges of an acceptable control effort in your design.

    And on duty cycle, I was elaborating on the DCL PID example we have. Where there's a conversion of output from normalized to duty cycle (Duty = (uk / 2.0f + 0.5f) * (float) EPwm1Regs.TBPRD), and this is how we know 0.05 and 0.95 of lower/upper limit translates to 52.5% and 97.5% of duty cycle.

    The DCL PID example is just a simple example that demonstrates DCL usage, for a real application please refer to any of our reference design solutions in DPSDK. TIDA-010062 (PFC and Half-Bridge LLC) would be a good example as it uses PI for voltage and current loop, as well as a notch filter using DF22.

    Best,

    Sen Wang

  • For an average current mode control example, please refer to TIDA-010062 or PMP23338, PMP23338 can be view as an subset of TIDA-010062 (PFC portion) that has the average current mode control.

    Best,

    Sen Wang