Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

HI, I need to generate level shifted triangular carrier wave signals. This is required in an application which involves 3 level NPC inverter control. Can someone tell me how to configure ePWM of 28335 for this? -tushar

Other Parts Discussed in Thread: TMS320F2810

  the triangles must look like these

  • Hi Tushar,

    the modulation of a NPC converter can be done with one carrier signal on the F28335. While the sine is positive (sin(wt)>0), just use

    EPwm2Regs.CMPA.bit.CMPA=M*sin(i*2*pi/steps)*PRD;

    M is the modulation index, i is the running variable along your fundamental cycle and steps is the total amount of steps to take for a fundamental cycle. PRD is the top value that your carrier signal on the DSP can get before it counts down again.

    If the sine wave becomes negative, i.e. sin(wt)<0, the corresponding switches can be modulated using:

       EPwm6Regs.CMPA.bit.CMPA = M*sin(i*2*pi/steps)*PRD+PRD;

    Note that this is identical to when the sine is positive, but simply shifted by the value PRD. This is equivalent to having two carrier signals as in the figure you posted.

    The code could look similar to this:

    if(sine > 0)
    {
    EPwm6Regs.CMPA.half.CMPA=PRD; EPwm2Regs.CMPA.half.CMPA=M*sin(i*2*pi/steps)*PRD; } else { EPwm2Regs.CMPA.half.CMPA=0; EPwm6Regs.CMPA.half.CMPA = M*sin(i*2*pi/steps)*PRD+PRD; } i++; if(i==steps) { i=0; }

    That'll do the job. Good luck with controlling the NPC inverter!

    cheers,

  • Dear Alexander,

    Thank you for the prompt and crisp reply.

    I will definitely do it the way you have suggested.

    Currently I am using TMS320F2810 controller. I was wondering if the same logic can be implemented on this platform, I need not have to upgrade to 28335 then.

    Can you please confirm if it is possible on F2810. (because it does not have independent control over each PWM)

    Kindly suggest.

    regards

    tushar

  • Hi Tushar,

    the important part to understand is to add a shift of PRD when the sine wave becomes negative. This is because your DSP (to my best knowledge) cannot create two carrier signals on top of each other as shown in the figure of your opening thread.

    This principle is valid irrespective of the system/DSP you use, and should be working fine on the TMS320F2810.

    However, be aware that you are using a fixed point DSP and you cannot simply copy&paste the code I presented (also the code is somewhat incomplete and only shows the principle on how to avoid the need for two carrier signals). You will likely have to use the IQMATH library and hence to adjust the code to your needs.

    I hope it helps to get started.