At its core, a servo motor is a closed-loop electromechanical actuator. Unlike a standard brushed DC motor that spins freely when voltage is applied, or a stepper motor that moves in discrete open-loop increments, a servo continuously measures its own output shaft position and corrects errors in real time. This closed-loop feedback is what allows a servo to hold a precise angle under varying loads or track a complex velocity profile without losing steps.
Whether you are building a 6-DOF robotic arm with an ESP32 or spec'ing an industrial pick-and-place machine, understanding the internal feedback loop, the torque curves, and the driver requirements is critical. Below is a practical breakdown of how servo motors work, how they compare to alternatives, and how to size them for your specific load profile.
The Anatomy of a Servo: Wiring, Terminals, and Feedback
To understand how a servo works, you have to look at the three components packed inside the housing: the drive motor (usually brushed DC or coreless), the reduction gearbox, and the feedback sensor. In hobby servos, this sensor is a potentiometer. In industrial servos, it is an optical or magnetic encoder.
Hobby Servo Wiring (SG90, MG996R, DS3218)
Standard RC hobby servos use a 3-wire interface. The control circuit inside the servo expects a 50Hz PWM (Pulse Width Modulation) signal where the pulse width dictates the target angle (typically 1ms for 0°, 1.5ms for 90°, and 2ms for 180°).
- Brown or Black: Ground (GND). Must be shared with your microcontroller's ground.
- Red: Power (VCC). Nominally 4.8V to 6.0V.
- Orange, Yellow, or White: PWM Signal. Connect to a hardware PWM-capable GPIO pin.
Industrial AC Servo Terminals (e.g., Yaskawa Sigma-7, Delta ASDA)
Industrial servos separate the power, feedback, and control planes to handle high voltages and noise. You will typically find:
- Power (U, V, W): 3-phase AC output from the dedicated servo drive.
- Encoder: A multi-pin connector carrying absolute serial data or quadrature A/B/Z signals, plus 5V power for the encoder IC.
- Control I/O: Opto-isolated pins for Pulse/Direction, enable, and alarm outputs.
Servo vs. Stepper vs. DC: Which Motor Fits Your Load Profile?
A common mistake in embedded design is treating steppers and servos as interchangeable. They are not. Steppers excel at static holding and low-speed open-loop positioning, but their torque drops off a cliff at higher RPMs. Servos maintain torque across their rated speed range and can briefly output 300% of their rated torque to overcome inertia. Use the table below to match your mechanical load to the right actuator.
| Motor Type | Torque Curve Profile | Control Feedback | Typical Cost (USD) | Best Load Profile |
|---|---|---|---|---|
| Hobby Servo (MG996R) | High stall torque, drops at speed | Closed-loop (Potentiometer) | $8 - $15 | Low-speed robotic joints, RC steering, camera gimbals |
| Industrial AC Servo (Yaskawa) | Flat torque to rated speed, 300% peak | Closed-loop (Absolute Encoder) | $600 - $1,500+ | High-speed CNC, pick-and-place, dynamic conveyor tracking |
| NEMA 17/23 Stepper | High holding torque, severe drop-off >500 RPM | Open-loop (Step/Dir) | $12 - $40 | 3D printers, low-speed linear actuators, static positioning |
| Brushed DC Motor | Linear torque-speed curve | None (Open-loop) | $3 - $10 | Wheels, fans, continuous rotation where position doesn't matter |
If your application requires rapid acceleration, high-speed traversal, and recovery from unexpected mechanical binding, the industrial AC servo is the only viable choice. If you are building a slow-moving robotic arm on a workbench, the hobby servo is vastly more cost-effective and easier to drive via microcontroller.
Sizing Rule of Thumb and Worked Load Example
The most frequent cause of servo failure in DIY and prototyping is undersizing. Hobby servo manufacturers advertise "stall torque" (the absolute maximum torque the motor can produce before it stops moving). You should never design a system that operates at stall torque.
The Sizing Rule of Thumb: Calculate your maximum continuous dynamic torque requirement, then apply a 2.5x to 3x safety factor to account for acceleration inertia, mechanical friction, and voltage sag. Select a servo whose rated continuous torque (usually about 40-50% of its advertised stall torque) meets this factored number.
Worked Example: Robotic Arm Forearm Joint
Let's size a servo for a robotic forearm that needs to lift a 500g (0.5 kg) payload. The distance from the servo shaft (the fulcrum) to the center of mass of the payload is 20 cm (0.2 meters).
- Calculate Force: F = mass × gravity = 0.5 kg × 9.81 m/s² = 4.9 Newtons.
- Calculate Static Torque: Torque = Force × Distance = 4.9 N × 0.2 m = 0.98 N·m (roughly 10 kg·cm).
- Apply Safety Factor: 0.98 N·m × 2.5 = 2.45 N·m (25 kg·cm) required dynamic capacity.
If you look at the spec sheet for the popular TowerPro MG996R, it advertises 13 kg·cm of stall torque. Its continuous safe working torque is closer to 6 kg·cm. It will fail to lift this load smoothly and will overheat. Instead, you need a larger actuator like the DS3218 (25 kg·cm stall, ~12 kg·cm continuous) or a NEMA 17 stepper paired with a 10:1 planetary gearbox to multiply the torque while reducing the speed.
Drivers, Controllers, and Failure Signatures
Knowing how a servo works mechanically is only half the battle; you must also drive it correctly and recognize when the closed-loop system is failing.
What Driver or Controller Does It Demand?
For hobby servos, the internal PCB contains the H-bridge motor driver and the PID (Proportional-Integral-Derivative) error-correction loop. Your microcontroller only needs to supply a 50Hz PWM signal. On an Arduino Uno, the standard Servo library handles the hardware timers automatically. On an ESP32, you should use the ledc (LED Control) peripheral API to generate the 50Hz PWM, as the ESP32's hardware architecture handles timers differently than the ATmega328P.
If you are driving more than 4 hobby servos, offload the PWM generation to an I2C driver like the PCA9685. This 16-channel board frees up your microcontroller's timers and provides a dedicated power rail for the servos.
For industrial servos, the motor contains no drive electronics. You must pair it with a dedicated servo amplifier (drive) that matches the motor's voltage, continuous current, and encoder protocol. The microcontroller or PLC then communicates with the drive via industrial protocols like EtherCAT, CANopen, or simple Pulse/Direction lines.
Reading Failure Signatures
Because servos are closed-loop systems, they exhibit specific physical symptoms when the control loop breaks down or the mechanical limits are exceeded:
- Humming and Jitter: If the servo vibrates or hums while holding a position, you likely have power supply ripple, a ground loop between the microcontroller and the servo power supply, or a worn-out internal potentiometer (the physical wiper is bouncing across dead-band carbon tracks).
- Overheating: Servos draw maximum current when they are stalled or holding a heavy static load against gravity. If a hobby servo casing is too hot to touch, the internal H-bridge is dissipating massive heat. Solution: Add a mechanical brake or counter-spring to assist the holding torque, or switch to a stepper motor which is inherently designed for static holding.
- Stall and Hunting (Overshoot): If the servo moves to a target angle, overshoots, reverses, and oscillates before settling, the internal PID tuning is fighting mechanical backlash in the gearbox, or the load inertia is too high for the motor's braking capacity. In industrial drives, this requires lowering the derivative (D) gain or adding a mechanical damper.
By matching the torque curve to your load profile, sizing with a strict safety factor, and isolating your power rails, you can build embedded motion systems that operate reliably without burning out drivers or stripping plastic gears.






