- Double-click on the "Controlled PWM Voltage" block to open its parameters.
- In the block parameters window, find the "Simulation mode" setting.
- Change the "Simulation mode" from "Averaged" to "PWM".
Pulse width modulation using simscape blocks
19 次查看(过去 30 天)
显示 更早的评论
I am trying to model DC motor control by PWM. I tried to model the PWM with in built simscape blocks. When I connect scopes across the H bridge, it is the same as the input constant DC voltage.
I have attached the picture of the model and the plot.
I used part of the exact same model from the example ('simscapeelectrical/PWMControlledDCMotorExample')
What is the problem here?
0 个评论
回答(1 个)
Deep
2024-7-19
Hi Krishna,
I understand you are seeing a straight line upon measuring through the “Voltage Sensor” block instead of the expected square wave of a PWM signal.
This is because the simulation mode of the “Controlled PWM Voltage” block in the mentioned example model is set to “Averaged”. When set to “Averaged”, the output signal is the average of the PWM signal, which appears as a straight line.
Here are the steps to switch to the PWM signal:
After making this change, you should see the expected square wave of the Pulse Width Modulation signal when you attach a “Voltage Sensor”.
For more detailed information about the simulation modes of the "Controlled PWM Voltage" block, you can refer to the following documentation:
Hope this helps!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!