PWM Generator in Simulink MATLAB
Introduction to Sinusoidal PWM Generation in MATLAB Simulink
To start with the MATLAB simulation of a Sinusoidal PWM Generator in MATLAB Simulink, follow these steps:
Open Simulink: Open a blank model in Simulink.
Simulink Library Browser: Click on the Simulink Library Browser.
Repeating Sequence: Use the Repeating Sequence block for generating a sinusoidal waveform.
Creating Sinusoidal and Triangular Waveforms
Sinusoidal Waveform:
Frequency: Set the sinusoidal waveform frequency, for example, 2π.
Time Interval: Consider the frequency is set towards, for demonstration, and create the waveform.
Triangular Waveform:
Initial Values: Start from 0, then it goes to 1, and then to -1.
Time Frame: Set the time frame for the triangular wave, such as 0.0 to 0.04 seconds.
Frequency Calculation: The frequency is calculated as 1 divided by 0.04, resulting in 25 Hz.
Generating Sinusoidal PWM
Relational Operator: Use the Relational Operator block (comparator) to compare the sinusoidal waveform with the triangular waveform.
Configuration:
Set the relational operator to "greater than or equal to".
Connect the sinusoidal and triangular waveforms to the relational operator.
Scope: Use the Scope block to measure the input and output waveforms. Configure the scope to have two input ports to display the waveforms.
Model Configuration and Simulation
Model Configuration:
Set the maximum step size to a small value, such as 0.01.
Simulation Time: Set the simulation time to observe two cycles of the waveforms.
Scope Layout: Adjust the scope layout to display the waveforms clearly.
Simulation Results
The sinusoidal waveform is compared with the triangular waveform, generating the PWM signal.
Observe the pulse width variation as the sinusoidal waveform crosses the triangular waveform.
Generating PWM Pulses for H-Bridge Inverter
Sinusoidal Waveform with Phase Shift:
Use the same relational operator and triangular wave.
Introduce a 180-degree phase shift to generate four pulses for the H-Bridge inverter.
Connection:
Connect the sinusoidal waveform and its phase-shifted version to the relational operator.
Use NOT gates to invert the signals if necessary.
PWM for DC-DC Converter
Triangular Waveform:
Set the amplitude to 0 and 1, creating an unipolar triangular wave.
Constant Block:
Use a Constant block to set the duty cycle (e.g., 0.5 for 50% duty cycle).
Scope:
Measure the output to observe the PWM signal based on the duty cycle.
Adjusting Duty Cycle
Changing the duty cycle (e.g., 0.9 for 90% on-time and 0.1 for 10% off-time) affects the pulse width.
Conclusion
This basic PWM generator in MATLAB Simulink demonstrates how to generate PWM signals for various applications such as H-Bridge inverters and DC-DC converters.
Comentarios