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:
- 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.
- 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!