Ground Embedded KO Subscribe

Notes / Motor Control

Servo motor: a motor with position feedback built in

A hobby servo takes its angle from the PWM pulse width; an industrial servo moves precisely with an encoder and three nested control loops.

GROUND EMBEDDED · NOTEMotor Control 04Servo motorsNSABC

Hobby RC servo

1.0 ms (0°)1.5 ms (90°)2.0 ms (180°)
An RC servo takes its angle from the width of a pulse that arrives every 20 ms. 1 ms is one end and 2 ms the other. The gap between pulses is drawn shortened.

A DC motor + gears + potentiometer (position sensor) + control circuit in one package. Send a 50 Hz (20 ms period) pulse on the signal wire and the pulse width sets the target angle.

Pulse width Angle (typical)
1.0 ms 0°
1.5 ms 90° (centre)
2.0 ms 180°

On an STM32 timer, set PSC for 1 MHz, ARR = 19999 and CCR = 1000 to 2000. The range differs slightly by product, so check the end points to avoid mechanical collisions.

Continuous-rotation servo

A servo modified by removing the position feedback, so it stops at 1.5 ms and turns in either direction for shorter or longer pulses.

RoadmapSee where this note sits in Motor Control→

Industrial servo

An AC servo (PMSM) + high-resolution encoder + servo drive. Inside the drive, three loops run (current → speed → position), and the upper controller gives the target position as a pulse train or over EtherCAT. In the end it is a product containing the FOC and cascade control from this site's roadmap.

How to choose

Need Choice
Simple angle, low cost RC servo
Accurate position, no lost steps Encoder + servo
Low-cost precise feed, low speed Stepper motor
FREE PDFGet the 3 free ebooksIf you want to keep reading this topic as one book: BLDC motor control, serial communication and sensors at book length. PDFs are in Korean.Get them free →