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/TMS320F28335: TMS320F28335

Part Number: TMS320F28335
Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE

Tool/software: Code Composer Studio

Hi,

I am trying to implement a PI control , Please help me with the following program. when i am trying run the program i dont know whether the program is correct or not .

Please give the feedback on how to make it work.

Thank you.

PrithviController.zip

  • Prithvi,

    The program seems to apply a standard PI controller from controlSUITE which was used in our motor control examples at that time. It should work fine. What issue are you seeing?

    Regards,

    Richard
  • Hi Richard,

    The issue is that, when i multiply my control loop output with the CMPA value to get the controlled PWM for my inverter it is working only after the reference value and the feedback value is also not reading till the reference value and hence i am not getting the controlled PWM for my inverter .

    Please help me with this .

    Thank you.

    Warm regards,

    Prithvi

  • Part Number: TMS320F28335

    Tool/software: Code Composer Studio

    Hi, 

    This is Prithvi , I am attaching a file where i am trying to implement a PI control , but my control loop is not working . Not working in the sense I am not getting a Controlled PWM for inverter , for simulation purpose i have used inbuilt potentiometer as a feedback voltage and i have set reference voltage as 1.5 .

    And Can you please tell me how to convert the IQ values to float or integer ?

    Kindly help me .

    Thank you.

    Warm regards,3250.Controller.zip

    Prithvi 

  • Prithvi,

    The issue is you are mixing data types. The PI controller ises IQ data throughout, yet you are giving it a float and the output is being assigned to a float variable (output1). You need to take care to ensure the data types are consistent.

    Change "voltage5" and "output1" so they are _iq (you do not seem to use output1), then typcast the variables appropriately. Please consult the IQmath quickstart guide in C2000Ware for details. I think the following is correct, but please check.

    Voltage5 = (_iq) (AdcRegs.ADCRESULT4)*_IQ(3.0/65520);//pin A0

    EPwm1Regs.CMPA.half.CMPA = EPwm1Regs.TBPRD * (int) pi1.Out;

    Step through your program while monitoring values in the expressions window in CCS to be sure you are getting the results you expect.

    Also, please do not post duplicate questions to the forum. Your post is tracked so it will not be lost. I will go ahead and close your other post on this matter. Thank you.

    Regards,

    Richard
  • Prithvi,

    Please let us know if this issue is resolved of you are still in difficulty.  Thanks.

    Regards,

    Richard