How to Set Up Pulse Width Modulation (PWM) Using a DC Motor

How to Set Up Pulse Width Modulation (PWM) Using a DC Motor

This tutorial shows you how to turn the digital output on and off for a 24V DC Motor with an HMI+PLC combo, using Pulse Width Modulation, while displaying on the user-interface.

Software Required

Hardware Required

  • HMC4070A-M – Other HMC2000/HMC4000 models can also be used
  • HMC3-M1212P0200 V2 – Other HMC3 V2 I/O modules can also be used
  • 24 VDC Power Supply (4010-0011)
  • 24V DC Motor – Other DC Motors can be used. This is just an example

HMI + PLC Combo

Wiring and Circuit Design

Digital Output DC Motor Wiring:

Power Supply:
Red Wire 24V- Power Supply to 24V on I/O
Black Wire 0V – Power Supply to 0V on I/O

Digital Output:
Red Wire Y0: 24V to Motor
Black Wire 0V: Ground to Motor

This wiring diagram can also be applied to any HMC3 V2 I/O Modules with Digital Output capabilities.

Software Code

Ladder Diagram

Structured Text

Another type of IEC Language you can use:

User Interface

Sample Project

The project shown above was designed for the specific hardware mentioned at the beginning of the tutorial and is intended to provide you guidance when programming your unit. If you are using models other than the ones specified in this sample project, similar steps can be duplicated within your own project.

Download MAPware sample project

Resources & Documentation

HMC/MAPware-7000 Resources


See our Support Center for a complete list of Quick Start and Installation Guides

Scroll to Top