Home > Industry Insights >Gear Motor
TECHNICAL SUPPORT

Product Support

Servo Motor Working Principle and Control Methods

Published 2026-04-03

This article provides a complete technical explanation of how a standardservomotor works and the exact methods to control its position. You will learn the internal closed-loop control system, the role of the Pulse Width Modulation (PWM) signal, and step-by-step instructions for precise angular positioning, from 0 to 180 degrees.

01Core Working Principle: Closed-Loop Position Control

A standardservomotor is not a simple DC motor that runs continuously. It is a complete closed-loop control system consisting of four key internal components:

DC Motor:Generates rotational motion.

Gear Reduction Train:Reduces motor speed while multiplying torque.

Position Sensor (Potentiometer):Connected to the output shaft. Its electrical resistance changes as the shaft rotates, providing real-time feedback on the current angle.

Control Circuit Board:Compares the commanded position (from the input PWM signal) with the actual position (from the potentiometer).

How the Closed Loop Works:

1. The control circuit receives a target position command.

2. It reads the current shaft position from the potentiometer.

3. It calculates the error (target position - current position).

4. It drives the DC motor in the correct direction (forward or reverse) to minimize this error.

5. When the current position equals the target position, the motor stops.

6. This loop runs continuously, holding the shaft at the commanded position even if an external force attempts to move it.

Example from Common Applications:In a robotic arm joint,theservoreceives a command to move to 90 degrees. Even if a light load (e.g., a small tool) is attached, the closed-loop control actively maintains the 90-degree position. If an external force pushes the arm to 92 degrees, the potentiometer detects this change, and the control circuit instantly applies counter-torque to return to 90 degrees.

02The Control Signal: Pulse Width Modulation (PWM)

Servo position is controlled by a specific type of electrical signal:Pulse Width Modulation (PWM). The control signal has three fixed parameters and one variable parameter.

Fixed Parameters (Standard for 99% of hobby and industrial servos):

Signal Period:20 milliseconds (ms). This means a new pulse is sent every 20 ms, corresponding to a frequency of 50 Hz.

Voltage:Typically 4.8V to 6.0V (for standard servos). High-voltage servos may use 7.4V or more, but the signal logic remains 50 Hz PWM.

Pulse Minimum and Maximum:The shortest pulse (usually 0.5 ms to 1.0 ms) and longest pulse (usually 1.5 ms to 2.5 ms) define the full travel range.

Variable Parameter: Pulse Width

The width of the high pulse (in milliseconds) determines the target angle.

Neutral Position (90 degrees):A pulse of exactly1.5 mscommands the servo to rotate to its mid-point.

0 Degrees (One extreme):A pulse of1.0 ms(or sometimes 0.5 ms, depending on the servo's factory calibration) commands the servo to rotate fully to one stop.

180 Degrees (The opposite extreme):A pulse of2.0 ms(or sometimes 2.5 ms) commands the servo to rotate fully to the opposite stop.

Precise Pulse-to-Angle Mapping Formula:

For a standard servo with a 0° to 180° range using a 1.0 ms to 2.0 ms pulse range:

Target Pulse Width (ms) = 1.0 ms + (Desired Angle / 180) * (2.0 ms - 1.0 ms)

Or simplified:Pulse Width (ms) = 1.0 + (Desired Angle / 180)

Example Calculation:

Desired Angle = 45 degrees

Pulse Width = 1.0 + (45/180) = 1.0 + 0.25 =1.25 ms

Important Timing Rule:The pulse is sent every 20 ms. The duration of the low portion of the signal is automatically determined as20 ms - pulse width ms. The control circuit only measures thehigh pulse width. As long as the period remains 20 ms (± a few ms tolerance), the servo will hold its position.

03Step-by-Step Control Method

To accurately position a servo, you must generate a continuous 50 Hz PWM signal with variable pulse width. Here is the exact method using common hardware:

Step 1: Determine Your Servo's Pulse Limits

Never assume a servo uses 1.0 ms to 2.0 ms. Always verify the manufacturer's datasheet. For safety:

1. Start with a 1.5 ms pulse (neutral).

2. Gradually decrease the pulse width by 0.05 ms every 2 seconds until you hear the servo stop or see it reach the physical limit. Record this as the minimum pulse.

控制舵机的程序_舵机原理及控制方法_舵机控制函数

3. Gradually increase the pulse width from 1.5 ms by 0.05 ms every 2 seconds to find the maximum pulse.

Step 2: Generate the PWM Signal

You need a microcontroller (e.g., Arduino, Raspberry Pi Pico, STM32) or a dedicated servo controller module.

Example: Controlling a servo with a standard microcontroller:

Connect power:Servo red wire to +5V, brown/black wire to GND. Use a separate power supply for high-torque servos.

Connect signal:Orange/white/yellow wire to a PWM-capable digital pin.

Write code to output 50 Hz PWM with variable duty cycle.

Step 3: Send the Command Sequence

To move to 0 degrees: Output continuous pulses of 1.0 ms width, every 20 ms.

To move to 90 degrees: Output continuous pulses of 1.5 ms width, every 20 ms.

To move to 180 degrees: Output continuous pulses of 2.0 ms width, every 20 ms.

Step 4: Verify Movement

After sending the new pulse width, the servo will rotate to the new position within its specified transit time (typically 0.1 to 0.3 seconds for 60 degrees). The control circuit will then hold that position.

Example from Common Applications:In a remote-controlled model airplane, the receiver decodes the transmitter's joystick position into a PWM signal. When you move the joystick from center to full left, the receiver changes the pulse from 1.5 ms to 1.0 ms. The servo's control circuit detects this change, drives the motor to move the control surface (e.g., aileron) to the new angle, and holds it there until the joystick moves again.

04Common Problems and Solutions

Problem: Servo jitters or oscillates.

Cause:Noisy power supply or an unstable PWM signal (timing jitter).

Solution:Add a large capacitor (1000 µF or more) across the servo power lines near the servo. Ensure the microcontroller uses a stable clock source.

Problem: Servo does not rotate the full 180 degrees.

Cause:The applied minimum and maximum pulse widths do not match the servo's internal calibration.

Solution:Perform the pulse limit discovery procedure in Step 1. Adjust your code's minimum and maximum pulse constants accordingly.

Problem: Servo overheats or draws high current while stationary.

Cause:The servo is constantly fighting against an external load or its internal potentiometer is misaligned.

Solution:Reduce the mechanical load. If the servo buzzes at the end of travel, reduce the commanded pulse width slightly (e.g., use 1.05 ms instead of 1.0 ms for 0 degrees).

Problem: Servo moves to a position but slowly returns when load is applied.

Cause:Insufficient torque for the application, or the power supply voltage is dropping under load.

Solution:Use a servo with higher torque rating. Use a power supply that can deliver at least 2x the servo's stall current.

05Core Principles Summary and Actionable Recommendations

Core Principles Repeated for Emphasis:

A servo is aclosed-loop position control system, not just a motor.

The control signal is50 Hz PWMwith a fixed 20 ms period.

Thepulse width(1.0 ms to 2.0 ms typical) directly maps to angular position (0° to 180°).

The control circuit continuously compares commanded and actual positions, applying motor torque to eliminate any error.

Actionable Recommendations for Reliable Servo Control:

1. Always verify your servo's pulse range before operation.Use a 1.5 ms neutral pulse as a safe starting point. Never assume a 1.0 ms to 2.0 ms range without testing.

2. Use a dedicated power supply for high-torque servos.Do not power a servo from a microcontroller's 5V pin. A stalled servo can draw 1-3 amperes, which will reset most microcontrollers.

3. Add a 100-1000 µF electrolytic capacitor across the servo's power and ground leads.This stabilizes voltage and eliminates most jitter problems.

4. Send PWM commands continuously.The servo requires a new pulse every 20 ms to maintain its position. If the signal stops, most servos will release torque and become free-moving.

5. For precise applications (e.g., camera gimbals, robotic fingers), calibrate each servo individually.Measure the exact pulse widths for 0°, 90°, and 180° using a potentiometer or angle sensor. Store these calibrated values in your control code.

By applying these principles and methods, you will achieve accurate, repeatable, and reliable servo positioning for any project, from robotic arms to animatronics and CNC machines.

Update Time:2026-04-03

Powering The Future

Contact Kpower's product specialist to recommend suitable motor or gearbox for your product.

Mail to Kpower
Submit Inquiry
+86 0769 8399 3238
 
kpowerMap