How to connect AC voltage block to 2 level PWM generator block in simulink

3 views (last 30 days)
Hello. Kindly advise me as to how I can connect a AC voltage block to the PWM generator block (use AC block as the external modulating signal) and get PWM pulses.
Should I use any other block in middle? thanks

Answers (1)

Charu
Charu on 17 Jun 2025
Hello Gene,
From your question I get that you want to connect an AC voltage block to the PWN generator block.
There are two ways to implement PWM modulation using an AC signal — either in Simulink or in Simscape:
  1. Simulink Approach (Control-Domain): Use a Sine Wave block (from Simulink > Sources) to generate an AC-like signal. This signal is then scaled and biased (usually using Gain = 0.5 and Bias = 0.5) to shift it into the [0, 1] range, which is required for the PWM Generator (Voltage-Controlled) block. This method is best for control logic, fast simulations, and when you only need to generate PWM signals — not simulate real electrical behavior.
  2. Simscape Approach (Physical-Domain): If you're working in Simscape and want to use a real AC Voltage Source (from Simscape > Electrical), measure the voltage using a Voltage Sensor, convert it to a Simulink signal using a PS-Simulink Converter block, and then feed that into the PWM generator after scaling. This method is more suitable for simulating physical electrical systems and actual power flow.
Here is a sample Simulink model for the same:
Hope this helps!

Communities

More Answers in the  Power Electronics Control

Community Treasure Hunt

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

Start Hunting!