blog

Servo motor

Servo Motor 1

what is a servo motor?

Servo Motor

Definition of Servo Motor

A servo motor is a device capable of rotating to a specific angle or position. Unlike standard DC motors that rotate continuously once energized, a servo motor is a closed-loop control system that adopts the closed-loop feedback control logic of a servo mechanism. It can precisely control angular or linear position, speed, and acceleration. Through the feedback mechanism of the servo mechanism, the output is adjusted to maintain the desired position or motion state according to external commands.

What does "servo" mean?

Origin and Meaning of "Servo"

The term "servo" is a noun in English, derived from the Latin word "servus" (meaning "servant" or "slave"). In technical contexts, it typically refers to a servo system or servo device, with its core meaning being "a device that achieves precise control through a feedback mechanism." It does not specifically refer to a single type of equipment but rather a general term for a class of systems or components that rely on closed-loop feedback to precisely regulate position, speed, force, or other parameters.

What does " Servomechanism " mean?

A servomechanism is an automatic control system that achieves precise regulation of physical quantities (such as position, speed, force, temperature, etc.) through closed-loop feedback control. Its core function is to continuously monitor the output state, compare it with the target command, and real-time correct errors to ensure the system output strictly meets expectations. It can maintain stability even in the presence of external disturbances or load changes. A servomechanism typically consists of an input device, a controller, an actuator, a feedback device, and a load.

 

Working principle of a servomechanism: The input device sends a target command to the controller. The feedback device real-time monitors the current state of the load and transmits the data to the controller. The controller compares the data from the input device and the feedback device, calculates the error between the two sets of data, generates a correction signal based on the calculated error, and then transmits the correction signal to the actuator. The actuator acts according to the correction signal. The above operations are repeated until the error between the feedback signal and the target command is reduced to a reasonable range.

What is a servo motor used for?

Servo motors have a very wide range of applications due to their high-precision positioning capability, fast dynamic response characteristics, and closed-loop feedback control system based on servomechanism. This ability to precisely control the position, speed, or torque of the motor plays a key role in scenarios requiring high motion precision, high stability, and high reliability.

 

For example, in the field of industrial automation, servo motors are widely used in CNC machining, assembly robotic arms, and production line transmission systems to achieve high-precision machining and positioning of workpieces, improving the processing quality of parts and production efficiency. The fast response characteristic of servo motors is particularly suitable for multi-axis synchronous control and high-speed reciprocating motion tasks.
Servo motor automation application

In robotics, servo motors are often used as the core driving device for robot joints, providing precise rotation angles and torque output to facilitate robots in completing various complex tasks, such as precision assembly of various parts, welding of components, and material handling. Their servomechanism can correct errors in real-time and enhance the smoothness of motion.

Servo motor robot application

In the aerospace field, servo motors are used in aircraft control surface control systems, such as servo actuators for rudders, elevators, and flaps, to precisely adjust flight attitudes, enhance flight stability, and improve performance and reliability in extreme environments.

Servo motor applications in aerospace

Among DIY enthusiasts and college student groups, small servo motors like the SG90 micro servo motor, which are affordable and easy to use, are widely applied. They combine one or more micro servo motors with other modules to create more convenient systems, such as an ultrasonic obstacle-avoidance pan-tilt combined with an ultrasonic module.

Servo gimbal

This type of ultrasonic obstacle-avoidance pan-tilt is often used in intelligent obstacle-avoidance car projects. After the ultrasonic module detects an object, it sends the information to the microcontroller for processing. Then the microcontroller controls the servo motor to move, changing the direction of the ultrasonic module. This achieves the effect of detecting multiple directions using only one ultrasonic module, reduces the use of serial ports, and simplifies code writing.

Servo application

Servo motor specifications & Buy servo motor

When buying a servo motor, besides the servo motor price, the most important thing to pay attention to is the servo motor specifications. There are four main categories to note in servo motor specifications:

Category Parameter Name Unit
I. Basic Electrical Parameters Rated Voltage V
Rated Current A
Rated Power W or kW
II. Mechanical Performance Parameters Rated Torque N-m
Peak Torque N-m
Rated Speed rpm
Maximum Speed rpm
III. Control Performance Parameters Resolution pulse/rev or bit
Positioning Accuracy arc-sec or °
Repeatability arc-sec or °
Bandwidth Hz or kHz
IV. Physical & Environmental Parameters Dimensions and Mounting mm
IP Rating IPXX
Operating Temperature Range °C
Weight kg

Below, I will introduce the parameters of several commonly used servo motor models for reference.

SG90
Product Model SG90 MG90S
Dimensions 23x12.2x29mm 22.8x12.2x28.5mm
Weight 9g 12g
Operating Torque 1.6kg·cm (4.8V) 2kg·cm (4.8V)
Response Speed 0.12 sec/60° (4.8V)
0.10 sec/60° (6.0V)
0.11 sec/60° (4.8V)
Operating Temperature -30 to +60°C 0 to 55°C
Dead Band Width 5μs 5μs
Connector Type - JR, FUTABA compatible
Rotation Angle 180° Max 90°
Servo Type Analog Servo Analog Servo
Operating Voltage 3.5V~6V 4.8V
Construction Material Plastic gears Metal copper gears
Accessories Included Three function arms, fixing screws, wire length 25CM Servo wheel, wire length 25CM, accessories for fixing propeller and aluminum sleeve, etc.
Suitable For Fixed-wing aircraft, helicopter KT, glider, small robot, manipulator and other models Fixed-wing aircraft, helicopter KT, light aircraft, small robot, manipulator and other models
Among small servo motors, the SG90 servo motor is definitely a well-known model. As a classic mini servo motor, its application scenarios are extremely wide. The SG90 micro servo motor is not only affordable but also reliable in performance. Most importantly, it is particularly easy to control—even those without much professional background can quickly learn to use it, making it the first choice for beginners.

 

The SG90 servo motor is a frequent presence in electronic teaching videos and DIY projects. Whether it is building a simple robotic arm model, providing steering control for an intelligent car, or making automated toys move, the SG90 micro servo motor can function stably, saving a lot of trouble for beginners and DIY enthusiasts.

 

The MG90S servo motor can be regarded as the metal-reinforced version of the SG90 micro servo motor. It inherits all the advantages of the SG90 servo motor while making several optimizations. The parameters of the two motors are very similar, with core aspects such as operating voltage and control signals being almost the same. Therefore, anyone who can use the SG90 micro servo motor will find it easy to get started with the MG90S servo motor.

 

The MG90S servo motor uses metal components, so its durability and load-bearing capacity are better than those of the SG90 servo motor. It is more suitable for DIY projects that have certain requirements for motor strength. However, both the SG90 micro servo motor and the MG90S servo motor retain the feature of simple operation. They are very convenient for beginners to use in practice and project-making, and have always been popular in teaching and DIY circles.

What is the working principle of a servo motor?

Servo Motor Pinout

The pinout of a servo motor is distinguished by colors. Taking the common SG90 and MG90S servo motors as examples, they generally have three leads of different colors, each with a distinct function, as follows:

Pin Name Common Wire Colors for SG90 and MG90S Function Description
VCC (Power Positive) Red Provides power for the servo motor and is the energy input pin for the motor to operate. Usually needs to be connected to a stable power source, such as a 5V power supply pin on a development board, or an independent 4.8V - 6V DC power supply.
GND (Power Negative / Ground) Brown or Black Acts as the reference ground for the circuit and forms a complete current loop in combination with the power positive.
PWM (Signal Line) Orange, Yellow or White Used to control the rotation angle or speed of the servo motor. By inputting PWM signals with different duty cycles, the control circuit inside the motor will drive the motor to rotate to the corresponding position.

Servo motor connection: VCC can be connected to the 5V pin of Arduino or the 5V pin of Raspberry Pi Pico; if the motor load is large, it is recommended to connect an external 4.8V - 6V DC power supply, and at the same time connect the power ground to the development board ground. GND is directly connected to the GND pin of the controller to ensure consistent ground potential of the entire circuit. PWM (signal line) can be connected to any PWM pin of Arduino (such as pin 9) or any GPIO pin of STM32 (PWM signal needs to be generated through a timer).

Servo motor for arduino

Servo motor construction

The Internal Composition of a Servo Motor
A servo motor is mainly composed of three major parts: mechanical components, electronic control components, and a housing.
 
The core of the mechanical components includes:
  • A Motor Core as the power source;
  • A Gear Train for reducing rotational speed and increasing torque;
  • An Output Shaft responsible for transmitting the motor's rotational motion to external loads.
The electronic control components consist of three parts:
  • A Servo Driver, a Feedback Sensor, and Driver Circuitry.
The housing is used to protect the internal components of the servo motor. Its material is generally plastic, while metal is commonly used in industrial applications.

Servo motor working principle

The servo motor circuit diagram is as shown below. During operation, the microcontroller first sends a PWM signal to the servo motor. Then, the "brain" of the servo motor, the Servo Driver, compares the PWM signal received from the microcontroller with the feedback signal formed by the actual motion state of the motor monitored in real-time by the Feedback Sensor, calculates the error, and finally outputs a drive signal. The Driver Circuitry adjusts the current or voltage input to the motor according to the instructions received from the controller to control the motor's speed, direction, and torque. This forms a feedback system, through which the servo motor continuously corrects its position, speed, and torque.

servo motor circuit diagram

The angle of a servo motor is determined by the duration of the working pulse applied to the control line. A servo motor expects to receive a working pulse every 20 milliseconds. The length of the working pulse determines the angle to which the servo motor rotates. For example, a 1.5-millisecond pulse will make the servo motor rotate to the 90-degree position. When the pulse sent to the servo motor is shorter than 1.5 milliseconds, the servo motor rotates to a position and keeps its output shaft deflected counterclockwise by a certain angle from the neutral point. When the pulse width is longer than 1.5 milliseconds, the situation is reversed.

servo motor Work Pulse
servo motor work pulse

How to use a servo motor with arduino

After the previous learning, I believe everyone has a good understanding of servo motors. Now let's learn a servo motor Arduino project: controlling a servo motor via buttons and a rotary encoder.

Copy of Servo Motor

The signal wire of the servo motor is connected to pin 9. The positive poles of the three LEDs (blue, brown, and green) are connected to pins 6, 5, and 4 respectively. The buttons are connected to pins 2 and 3, and the rotary encoder is connected to pin A0. We will implement the following functions: pressing button 1 will make the continuous rotation servo motor rotate clockwise; pressing button 2 will make the continuous rotation servo motor rotate counterclockwise. When the rotary encoder is twisted, the servo motor will rotate according to the twisted angle.

Servo motor arduino code

				
					#include <Servo.h>
Servo myservo;
int potValue;
int degrees;
void setup() {
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
// Outputs for Debugging LEDs
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
// Outputs for servo
myservo.attach(9);
}
void loop() {
// Outputs for the debugging LEDs
digitalWrite(4, !digitalRead(2));
digitalWrite(5, !digitalRead(3));
analogWrite(6, analogRead(0)/4);
if (!digitalRead(2)) {
myservo.write(0);
} else if (!digitalRead(3)) {
myservo.write(180);
} else {
potValue = analogRead(0); // 0 to 1023
degrees = map(potValue, 0, 1023, 0, 180);
myservo.write(degrees);
}
delay(10);
}

				
			

The demonstration effect is as follows:

servo motor for arduino

Relevant Materials

A video applied to a self-made automatic water dispenser

FAQ

Types of servo motors

Servo motors can be classified by power type into DC servo motors and AC servo motors. In daily life, the ones commonly used are generally DC servo motors. AC servo motors are often used in industrial control scenarios.

What is the main difference between a servo motor and a normal motor?

Feature Servo Motor "Ordinary" Motor (e.g., DC Motor)
Control Method Closed-loop (with feedback) Open-loop (no feedback)
Main Function Precise control of position, speed, and torque Convert electrical energy into continuous rotation
Feedback System Includes encoder or resolver None
Response Very high torque at low speeds, fast acceleration, quick response to command changes Torque is speed-dependent (lower torque at low speeds), slower response
Complexity and Cost More complex system, higher cost Simpler design, lower cost
Operation Mode Moves to commanded position and resists external forces to maintain that position Continuous operation when powered. Speed varies with voltage and load
Typical Applications Robotics, CNC machines, automated manufacturing, remote control models (for steering) Conveyors, fans, pumps, household appliances, power tools

Is a servo motor AC or DC?

Servo motors come in both DC and AC types.

The application of high-torque servo motors

High torque servo motors are primarily used in applications requiring powerful and precise controlled movement under heavy loads, such as in industrial robotics, CNC machinery, and automation equipment.

Servo motor vs stepper moStor

Feature Servo Motor Stepper Motor
Control Principle Closed-loop control: Built-in encoder provides real-time position feedback to the driver, continuously correcting errors. Open-loop control: Infers position by counting pulses, no feedback, assuming the motor always responds correctly.
Torque Characteristics Rated torque and overload torque. Can output 2-3 times the rated value for a short time (instantly) to overcome resistance. Holding torque: Maximum torque when maintaining position. Torque decreases sharply with increasing speed.
Speed and Performance Good high-speed performance: Typically up to 3000-5000 RPM or higher. Extremely fast dynamic response, excellent acceleration/deceleration performance. Good low-speed performance: Significant torque loss at high speeds, prone to step loss. Usually operates below 1000 RPM.
Accuracy High. Accuracy depends on encoder resolution (usually very high). But there is a "drift" issue that requires continuous correction through feedback. High. Accuracy is determined by motor step angle (e.g., 1.8° per step, i.e., 200 steps per revolution). No cumulative error.
Vibration and Noise Runs smoothly with low noise (especially at low speeds). May have vibration and noise at low speeds (but can be improved with micro-stepping drive technology).
Cost Higher. More complex system (requires motor, encoder, advanced driver). Lower. Simpler system (both motor and driver are cheaper).
Complexity System is complex, requires tuning (adjusting gain parameters) to achieve optimal performance. System is simple, plug-and-play, easy to set up and use.
Step Loss Phenomenon Will not lose steps. The encoder detects position deviations and corrects them immediately. May lose steps. If load torque exceeds motor torque, the motor will lose steps, and the system cannot detect it, leading to position errors.
Best Application Scenarios Applications requiring high speed, high dynamic response, and high overload capacity. Applications requiring low cost, simple control, medium-low speed, and high holding torque.

Leave a Reply

Your email address will not be published. Required fields are marked *