- 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
20 ビュー (過去 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!