Published 2026-04-07
This article provides a complete, practical guide to controlling a standardservomotor using a programmable logic controller (PLC). It covers the fundamental working principle ofservomotors, the exact PLC hardware and output requirements, wiring diagrams, step-by-step programming logic (including PWM setup), a real-world industrial case study, and troubleshooting tips. No brand names are mentioned; all examples are based on common, generic industrial scenarios. By following this guide, you will be able to integrate aservomotor into your PLC-controlled system with confidence.
A standard position servo motor (not a servodrive+encoder system) is controlled by aPulse Width Modulation (PWM) signal. The servo’s internal electronics interpret the width of the pulse to determine the target angle.
Signal period: 20 ms (50 Hz) – fixed.
Pulse width range: 0.5 ms to 2.5 ms.
0.5 ms → 0 degrees (or minimum angle)
1.5 ms → 90 degrees (midpoint)
2.5 ms → 180 degrees (or maximum angle)
The PLC must generate this precise PWM signal on a digital output.Crucially, most PLC digital outputs are 24 V DC, while servo signal inputs expect 3.3 V or 5 V DC. Therefore, a voltage level converter or a simple resistive divider is required to avoid damaging the servo.
Not all PLCs can directly generate a PWM signal. You need:
Atransistor output (sourcing)PLC model. Relay outputs cannot produce the high-speed switching required for PWM.
At least onehigh-speed outputor aPWM-capable output(often labeled as Q0.0, Q0.1, or similar).
Programming software that supports PWM or pulse train output (PTO) instructions.
If your PLC lacks built-in PWM capability, you can use anexternal PWM generator modulecontrolled by the PLC via analog or digital signals. However, using a native PWM output is strongly preferred for precision and reliability.
PLC with transistor output (e.g., 24 V DC output)
Servo motor (standard 3-wire type: power, ground, signal)
External 5 V DC power supply for the servo (do not use the PLC’s 24 V supply)
Voltage level shifter (5 V to 24 V, or a resistor divider: 2.2 kΩ and 1 kΩ)
1. Servo power (red wire)→ External 5 V DC positive terminal.
2. Servo ground (brown or black wire)→ External 5 V DC groundandPLC common ground (0 V). This ensures a common reference.
3. Servo signal (orange or yellow wire)→ Output of the level converter (5 V side).
4. PLC digital output (e.g., Q0.0)→ Input of the level converter (24 V side).
> Example using resistor divider (no IC):
> Connect PLC output → 2.2 kΩ resistor → Servo signal pin. Connect a 1 kΩ resistor from servo signal pin to ground (0 V). This divides 24 V to approx. 5 V. Verify with a multimeter before connecting the servo.
Let’s say you need the servo to move to 90° (mid position). Pulse width required = 1.5 ms.
Most PLCs use a PWM instruction with parameters:
Cycle time (period) = 20 ms (fixed)
Pulse width = calculated from angle:
Pulse width (ms) = 0.5 + (angle/180) × 2.0
Example: 90° → 0.5 + (90/180)2.0 = 0.5 + 1.0 = 1.5 ms.
Generic ladder logic example (using a PWM block):
// Assume angle value stored in D100 (0-180)
// Compute pulse width in microseconds
MOV D100 D102 // angle
MUL D102 K20 // angle 20 (because 2.0ms = 2000us, but scaling simplified)
ADD D102 K500 // + 500us → pulse width in microseconds
MOV D102 PWM_PULSE_WIDTH
MOV K20000 PWM_PERIOD // 20000us = 20ms
// Execute PWM instruction on output Q0.0
PWM Q0.0 PWM_PERIOD PWM_PULSE_WIDTH
Important: Most PLCs require the PWM output to be configured in system registers. Consult your PLC manual for the exact memory addresses.
![]()
Before connecting to the servo, use an oscilloscope or a logic analyzer to verify:
Period = 20 ms (±1%)
Pulse width matches your target angle within ±20 μs
Scenario: A small manufacturing plant uses a PLC to control a conveyor belt. Parts of different sizes need to be diverted into two bins. A standard servo motor rotates a flap gate (0° = left bin, 90° = center, 180° = right bin).
System components (generic):
PLC with one transistor output (PWM capable)
One servo motor (5 V logic, 6 V power)
Photoelectric sensor to detect part size
5 V power supply and resistor divider (2.2kΩ + 1kΩ)
PLC program logic:
1. Sensor detects part → PLC reads size from analog or barcode.
2. If size
3. If size 50-80 mm → angle = 90° (1.5 ms) → center bin.
4. If size > 80 mm → angle = 180° (2.5 ms) → right bin.
5. PLC updates PWM pulse width in real time.
6. A 0.5-second delay allows the gate to move before the part arrives.
Result: The system ran continuously for 8 months with zero servo failures. The key success factors were:
Proper voltage level matching (24V→5V)
Stable external 5V power (not from PLC)
PWM period held exactly at 20 ms
Do not power the servo from the PLC’s 24 V supply. Servo motors can draw peak currents >1 A, which may damage the PLC. Use a dedicated 5 V regulator (e.g., 7805) or a separate power supply.
Always connect grounds together – PLC 0V and servo power supply 0V must be common.
Protect the PLC output – A series 220 Ω resistor on the PLC output side limits current if the level converter fails short.
Test with a low-cost servo first before deploying to production.
Core conclusion: Successfully controlling a servo motor with a PLC requires three non-negotiable elements:
1. A PWM signal with a fixed 20 ms period and precisely variable pulse width.
2. Voltage level conversion from 24 V (PLC output) to 5 V (servo input).
3. A common ground between the servo power supply and the PLC.
Actionable recommendations for your project:
Step 1: Verify that your PLC has a transistor output with PWM capability. If not, purchase an inexpensive PWM generator module (standalone) and control it with a standard digital output.
Step 2: Build a simple resistor divider (2.2kΩ + 1kΩ) on a breadboard and test with a multimeter to confirm output is ~5V when PLC output is ON.
Step 3: Write a small test program that cycles the servo between 0°, 90°, and 180° with 2-second pauses.
Step 4: Use an oscilloscope (or a $20 logic analyzer) to verify the PWM signal before connecting the servo.
Step 5: Once confirmed, integrate into your full automation sequence, always adding a 0.3–0.5 second dwell time after each angle change to allow mechanical settling.
By following this guide, you will achieve reliable, repeatable servo control using standard industrial PLCs – without relying on any specific brand or proprietary module.
Update Time:2026-04-07
Contact Kpower's product specialist to recommend suitable motor or gearbox for your product.