how to use two carriers for epwm1a module.

How to use two carriers for a single epwm module. Two 180 degree phase opposition carriers for a single epwms module in a grid fundamental 50 Hz cycle.

 Accepted Answer

Spoorthy Kannur
Spoorthy Kannur on 23 Oct 2025
Edited: Spoorthy Kannur on 23 Oct 2025
A single ePWM peripheral supports one carrier/compare behaviour per timer period, so you cannot directly have carrier A for 0–90° and carrier B for 90–360° inside the same TBPRD using one ePWM instance.
You may try the following options:
  1. Use the MathWorks Three-phase, Three-level PWM generator block from the “Simscape / Electrical / Control / Pulse Width Modulation” library (recommended for 3-level operation). It’s designed for dual carriers and will generate the correct gating (https://www.mathworks.com/help/sps/ref/pwmgeneratorthreephasethreelevel.html).
  2. Use two ePWM modules (ePWM1 = carrier A, ePWM2 = carrier B) running synchronised TBPRD and multiplex their outputs (either hardware mux or software switch using ePWM output routing) at the 90° boundary. This is reliable and keeps carriers stable.
  3. If you must use only one ePWM, change CMPA/CMPB (or TBPRD) mid-period using a timed interrupt to swap in the second carrier. This is possible but timing-critical and riskier (must use immediate loads, protect against glitches).
For F2806x:
  • If using two ePWMs: keep TBPRD identical and sync the timers (use master/slave sync). Route/steer outputs at the precise phase boundary.
  • If using mid-period updates: use ePWM interrupts and immediate load writes to CMPA/CMPB; carefully test for output glitches and dead-time safety.
If this does not resolve the issue, kindly reach out to MathWorks Technical Support for more help (https://www.mathworks.com/support/contact_us.html?s_tid=hp_ff_s_support).

More Answers (2)

Hi Mandvi,
Could you please clarify the following details:
  1. Are you working with a specific microcontroller or DSP (e.g., TI C2000 series) using MATLAB/Simulink Embedded Coder, or are you simulating the PWM generation entirely within MATLAB/Simulink?
  2. Are you aiming to generate two complementary PWM signals (180-degree phase-shifted) from a single ePWM module for a particular modulation technique (e.g., SPWM, SVM)?
  3. Have you already configured the ePWM module in your model or code? If so, could you share a brief description or screenshot of your current configuration?

4 Comments

Mandvi
Mandvi on 14 Oct 2025
Moved: Torsten on 14 Oct 2025
I am trying to implement two carriers for sinhle epwm module from matlab. I use F28069M TI dsp microcontroller. I generate PWM signal using matlab/simulink environment. The screenshot of thecarrier I want is attached below. Thank you for your response.
Hi Mandvi,
Thanks for the update. You can try the following:
  1. Use ePWM1 as the first carrier.
  2. Use ePWM2 as the second carrier, configured with a phase shift = TBPRD/2 (i.e., 180° shift).
  3. Both can have identical compare logic.
Simulink configuration:
  • Set ePWM2’s Phase Enable = ON
  • Set Phase Offset = half of TBPRD.
  • Keep same carrier frequency.
Hope this helps.
Hi Spoorthy,
This logic is for interleaved carrier. But I do not want interleaved carrier, I want two carriers in a single epwm block. Like for epwm1, for initially 90 degrees, I want carrier one and for the reminaing 90-360 degress, I want carrrier two.

Sign in to comment.

Hi Mandvi,
Two carrier cannot be generated for a specific ePWM module in TI C2000 Processors. You may need to change the modulating wave so that it generates the same waveform as generated by two carriers.
Thanks,
Mukul

Products

Release

R2023a

Asked:

on 15 Sep 2025

Answered:

on 27 Feb 2026 at 5:32

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!