how to use two carriers for epwm1a module.

49 views (last 30 days)
Mandvi
Mandvi on 15 Sep 2025
Edited: Spoorthy Kannur about 19 hours ago
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.

Answers (2)

Spoorthy Kannur
Spoorthy Kannur on 14 Oct 2025 at 9:33
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
Spoorthy Kannur
Spoorthy Kannur on 15 Oct 2025 at 6:32
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.
Mandvi
Mandvi on 15 Oct 2025 at 7:22
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.


Spoorthy Kannur
Spoorthy Kannur 25 minutes ago
Edited: Spoorthy Kannur 23 minutes ago
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).

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!