Servo Motor Controller or Servo Motor Driver

💡
Key learnings:
  • Servo Motor Controller Definition: A servo motor controller (or servo motor driver) is defined as a circuit used to control the position of a servo motor.
  • Servo Motor Driver Circuit: The servo motor driver circuit includes a micro-controller, power supply, potentiometer, and connectors, ensuring precise motor control.
  • Micro-controller Role: The micro-controller generates PWM pulses at specific intervals to control the servo motor’s position accurately.
  • Power Supply: Servo motors need a stable power supply between 4.8V to 6V, with higher current ratings for multiple motors.
  • Program Algorithm: The program algorithm involves initializing ports, reading ADC for position, programming PWM registers, and managing pulse width with a timer.
A servo motor controller is a circuit that is used to control the position of a servo motor. It is also called as a servo motor driver. A servo motor controller consists of a controller, the servo motor and the power supply unit.

A servo motor driver can control a single servo or a group of servo motors. It sends a timed pulse to each motor so the shaft holds a commanded angle. An RC airplane is one case that uses several servos on one receiver or microcontroller.

Circuit parts

  1. A micro-controller
  2. A power supply unit

Miscellaneous Components

  1. A potentiometer
  2. Connectors and wires

Micro-controller

A servo motor is driven by a voltage pulse at a regular interval. Timing matters: a pulse of a set width must repeat every frame. For a typical hobby servo that width is about 0.5 ms to 2.2 ms, not 0 ms, and the frame is about 50 Hz (20 ms). Some receivers also accept 60 Hz. The controller needs a timer fine enough to set that width. Several motors at once also need a clock that can keep every frame on time. An 8051 such as AT89S51 or P89V51RD2 can bit-bang one servo. Several servos are easier on a PIC18F or an ATmega that has hardware PWM. The chip choice still follows the project, not a fixed brand rule.

Power Supply

The power supply must cover the number of motors and their stall current. Classic analog hobby servos use 4.8 V to 6 V, often 5 V. High-voltage packs go higher; over-voltage can still burn the electronics. Idle current is small. Loaded or stalled current is much larger. A small servo can stall near 1 A; larger units draw more.

For one small servo, an LM317 voltage regulator with a heat sink can work if it can supply the stall current. Several servos need a supply rated for the sum of those stalls, such as an SMPS or a dedicated BEC.
Block diagram of the interconnections in a servo motor driver
servo motor controller

Controlling Servo Motor

The hobby servo connector has three terminals.

  1. Position signal(PWM Pulses)
  2. Vcc (From Power Supply)
  3. Ground

servo motor connector
Shaft angle follows the pulse width. Many 180-degree hobby servos treat about 0.5 ms as one end and about 2.2 ms as the other; others use 1 ms to 2 ms. Repeat the pulse every 20 ms (50 Hz). Check the datasheet before you drive the ends of travel.

The figure below is that pulse train. You can build it with the microcontroller’s PWM hardware or with a timer in software. A hardware PWM block is easier to keep stable on a servo motor. Different pulse widths mean writing different values to the PWM registers.
The commanded angle can come from a potentiometer into an ADC. An accelerometer is one other sensor that can supply a target angle.
PWM pulses for Servo Motor

Program Algorithm

The steps below control one servo from a potentiometer on an analogue pin.

  1. Initialize the port pins for input/output.
  2. Read the ADC for desired servo position.
  3. Program the PWM registers for the desired value.
    When the PWM channel starts, the pin goes high (logic 1) and then low (logic 0) after the pulse width. Then wait about 19 ms so the whole frame is near 20 ms, and wait until that timer overflows
  4. Go to step 2

PWM modes differ by microcontroller family. Keep the loop tight enough that the pulse width stays stable.
More than one servo needs either that many PWM channels or a carefully timed software sequence. Each motor still needs a pulse about every 20 ms. If a frame is missed, that servo can droop or twitch.
Note :
If you lay out a board for the servo motor controller, make the motor-current tracks wide enough and run ERC and DRC. A continuous-rotation servo does not use the same pulse-to-angle map as a 180-degree servo. Read that motor’s datasheet.
The servo electronics do not tolerate a high or collapsing supply. Size the supply to the stall current and check it before you connect the motor. Use a heat sink on the regulator when the drop and current make it hot.

Want To Learn Faster? 🎓
Get electrical articles delivered to your inbox every week.
No credit card required—it’s 100% free.

About Electrical4U

Electrical4U is dedicated to the teaching and sharing of all things related to electrical and electronics engineering.

Leave a Comment