Pulse-Width Modulation (PWM)

Implement algorithms for controlling electrical power using pulse-width modulation (PWM)

Pulse-width modulation (PWM) is a common digital technique to control electrical power to a load using square wave pulses at some determined duty cycle. Proper control of pulse-width modulation ensures efficiency and accuracy in applications such as brushless motor control, solar power inverter control, and voltage regulation. A common challenge with these applications is evaluating the correctness of the control architecture early—before committing to the expense of hardware testing.

PWM Workflow

An efficient process for developing and implementing accurate algorithms for regulating pulse-width modulation involves:

  • Designing and testing PWM control algorithms in a simulation environment
  • Generating ANSI C code for real-time testing and implementation
  • Integrating pulse-width modulation control algorithms into an existing code base

To learn more about how PWM is implemented with Simulink®, see the video Speed Control of a DC Motor Using PWM (7:27).

PWM Support on Arduino, Raspberry Pi, and BeagleBone

Cost-effective hardware like Arduino®, Raspberry Pi™, and BeagleBone supports pulse-width modulation. These boards can provide PWM signals over specified pins so you can easily build PWM controllers such as those used for motors or fans.

To implement PWM controllers on these boards with Simulink, you can download Support Packages for Arduino, Raspberry Pi, or BeagleBone.

Speed Up Digital Control Design of DC-DC Converters with Simulink

Go from basic tasks to more advanced maneuvers by walking through interactive examples and tutorials.

Explore the Power Electronics Control Community

The MathWorks community for students, researchers, and engineers using Simulink to apply power electronics control to Electric Vehicles, Renewable Energy, Battery Systems, Power Conversion, and Motor Control.

Get a Free Trial

30 days of exploration at your fingertips.