PWM setting wih DSP F28335

LIN_21249
LIN_21249 Altair Community Member
edited June 12 in Community Q&A

Hi, everyone

I am using the TMS320F28335 control board for the Dynamic Voltage Restorer circuit.

I am using the code generation functions that PSIM provides for F28335 Target.

I need a PWM signal that can vary normally in width, but after programming my DSP, I measured that the signal is abnormal. The duty cycle reaches almost 98% and does not change, which will cause my switch to burn out. How should I adjust my program?

I look forward to your reply.

Thanks,

LIN

Answers

  • Rhonda_20369
    Rhonda_20369 New Altair Community Member
    edited May 21

    Hi, Lin,

    Before you run PSIM generated code on the target DSP, you should run simulation to make sure your control algorithm meets your expectations.

    In your PSIM schematic, there are several control loops. The simulation of your schematic shows that the modulation index at the input of PWM2 jumps from -12V to +12V all the time. This means your PWM pulse is either the widest or the narrowest. It seems that your closed loop system is not stable.

     

    After the control algorithm is checked up, before connecting your TMS320F28335 control board to your power converter, you should have checked whether all the input ports are correctly assigned, and all the output ports behave correctly.

    There is also an issue which can't be checked out by running simulation on computer. That is the interrupt overflow issue.

    In your algorithm all the computations are done with the sampling frequency of 100KHz. This means, on your target DSP chip, all the computation tasks must be finished within 10usec, including the interrupt overhead functions. There could be an interrupt overflow problem. F28335 maybe fast, but probably not that fast.

    You must check this issue before connecting your TMS320F28335 control board to your power converter.

    PSIM has a block called "Interrupt Time". You can use this block to measure whether your interrupt service routine can finish all tasks within its given time.

    There are examples you can follow, although those examples are for other F28 DSPs. But the usage and function are the same in F28335. You can find those examples in "Help >> Index", then type keyword "interrupt time".

     

    Sincerely,

    Rhonda

  • LIN_21249
    LIN_21249 Altair Community Member
    edited May 22

    Hi, Lin,

    Before you run PSIM generated code on the target DSP, you should run simulation to make sure your control algorithm meets your expectations.

    In your PSIM schematic, there are several control loops. The simulation of your schematic shows that the modulation index at the input of PWM2 jumps from -12V to +12V all the time. This means your PWM pulse is either the widest or the narrowest. It seems that your closed loop system is not stable.

     

    After the control algorithm is checked up, before connecting your TMS320F28335 control board to your power converter, you should have checked whether all the input ports are correctly assigned, and all the output ports behave correctly.

    There is also an issue which can't be checked out by running simulation on computer. That is the interrupt overflow issue.

    In your algorithm all the computations are done with the sampling frequency of 100KHz. This means, on your target DSP chip, all the computation tasks must be finished within 10usec, including the interrupt overhead functions. There could be an interrupt overflow problem. F28335 maybe fast, but probably not that fast.

    You must check this issue before connecting your TMS320F28335 control board to your power converter.

    PSIM has a block called "Interrupt Time". You can use this block to measure whether your interrupt service routine can finish all tasks within its given time.

    There are examples you can follow, although those examples are for other F28 DSPs. But the usage and function are the same in F28335. You can find those examples in "Help >> Index", then type keyword "interrupt time".

     

    Sincerely,

    Rhonda

    Hi, Rhonda,

    For the control loop part, how should I modify the PI parameters? Are there any methods or examples for calculating them?

    Regarding the interrupt service routine, I measured the frequency of the square wave to be 87kHz and the pulse width to be 10.89 microseconds, which exceeds 10 microseconds.

    To reduce the ISR time, should I switch to another control method, or can I simply lower the sampling frequency of the PI parameters?

    Thanks for your replies,

    LIN

  • Rhonda_20369
    Rhonda_20369 New Altair Community Member
    edited May 28

    Hi, Lin,

    1. For the control loop part, how should I modify the PI parameters? Are there any methods or examples for calculating them?

    The determination of the PI parameters is a design process which involves theoretical and experimental controller design issues. PSIM has a few video tutorials to illustrate this process.

    Please go to "Help >> Video Tutorials >> Power Supply Design".

     

    2. Regarding the interrupt service routine, I measured the frequency of the square wave to be 87kHz and the pulse width to be 10.89 microseconds, which exceeds 10 microseconds.

    This shows obviously, you have an interrupt time overflow problem in your code.

     

    3. To reduce the ISR time, should I switch to another control method, or can I simply lower the sampling frequency of the PI parameters?

    Yes, you may lower the sampling frequency of the PI controller.

    If you look at the F2833x motor drive examples, you will see that there are 2 sampling frequencies:

     - MotorFreq = 10K for current control loop, and 

     - SpdFreq = 1k for speed control loop.

     

  • LIN_21249
    LIN_21249 Altair Community Member
    edited June 11

    Hi, Lin,

    1. For the control loop part, how should I modify the PI parameters? Are there any methods or examples for calculating them?

    The determination of the PI parameters is a design process which involves theoretical and experimental controller design issues. PSIM has a few video tutorials to illustrate this process.

    Please go to "Help >> Video Tutorials >> Power Supply Design".

     

    2. Regarding the interrupt service routine, I measured the frequency of the square wave to be 87kHz and the pulse width to be 10.89 microseconds, which exceeds 10 microseconds.

    This shows obviously, you have an interrupt time overflow problem in your code.

     

    3. To reduce the ISR time, should I switch to another control method, or can I simply lower the sampling frequency of the PI parameters?

    Yes, you may lower the sampling frequency of the PI controller.

    If you look at the F2833x motor drive examples, you will see that there are 2 sampling frequencies:

     - MotorFreq = 10K for current control loop, and 

     - SpdFreq = 1k for speed control loop.

     

    Hi, Rhonda,

    I have referred to some tutorial videos, but the demonstrated circuits in the videos have only one control loop. However, my circuit is a DVR, which first converts AC to DC and then converts DC back to AC. In this dual-loop architecture, the two loops can affect each other. How should I first use open-loop testing and then use SmartCtrl to obtain the parameters, or are there other methods?

     

    Thanks for your replies,

    LIN

  • Albert_Dunford
    Albert_Dunford
    Altair Employee
    edited June 11
    LIN_21249 said:

    Hi, Rhonda,

    I have referred to some tutorial videos, but the demonstrated circuits in the videos have only one control loop. However, my circuit is a DVR, which first converts AC to DC and then converts DC back to AC. In this dual-loop architecture, the two loops can affect each other. How should I first use open-loop testing and then use SmartCtrl to obtain the parameters, or are there other methods?

     

    Thanks for your replies,

    LIN

    for series connected power converters you need to ensure the input and out impedance make sense across their various load conditions. There are tutorial videos that show how to compute the input and output impedance of a power converter.

     

  • LIN_21249
    LIN_21249 Altair Community Member
    edited June 12

    for series connected power converters you need to ensure the input and out impedance make sense across their various load conditions. There are tutorial videos that show how to compute the input and output impedance of a power converter.

     

    Hi Albert Dunford,

    I have referenced two tutorial videos, ''How to Determine the Input Impedance of a  Buck Converter'' and ''How to Determine the Onput Impedance of a  Buck Converter'', and tried to determine the input impedance and output impedance. Is this reasonable?

    Thanks for your replies,

    LIN

  • LIN_21249
    LIN_21249 Altair Community Member
    edited June 12

    I have tried to follow the video tutorial ''Digital Controller Design with PSIM'' to build my circuit, but I am unsure how to set up the AC SWEEP in the first step.  Also, I am unsure about the parameters of the voltage source and the triangular wave. Do the two loops need to be separated? If I want to obtain the parameters of the first loop first, should the AC probe be placed on the DC link?

  • Albert_Dunford
    Albert_Dunford
    Altair Employee
    edited June 12
    LIN_21249 said:

    I have tried to follow the video tutorial ''Digital Controller Design with PSIM'' to build my circuit, but I am unsure how to set up the AC SWEEP in the first step.  Also, I am unsure about the parameters of the voltage source and the triangular wave. Do the two loops need to be separated? If I want to obtain the parameters of the first loop first, should the AC probe be placed on the DC link?

    perturbation source should be sine

    you might try the AC sweep block, not m-sine

    replace the AC source as a DC source with rms Voltage value

    decouple the two converters and look at them individually

    for control design with AC sweeps it is just like the lab, where you would introduce a perturbation in your open loop reference and then place the probe at your feedback point

    if you have nested loops you would build them inside out where you design the inner loop with a pure open loop system as the plant, then the outer loop with a closed inner loop system as the plant

    For series connected converters you could design them separately and check the input output impedance of them. You could also do one converter and then attach that as the load for the second one and then do the control design for the second one. You will want to check the loop gain transfer function for resonant peaks at higher frequencies this will likely be the source of any problems.

    That being said, because the system works with a DC source I have to guess that there is something wrong with the MPPT system, this is an outer control loop for everything, this needs to be slow enough for the other loops to do their jobs. Check with the panel and a fixed value for the working point on the panel NOT an MPPT system. You could also scale back the bandwidth of the MPPT to give the inner loops a chance.