DIY Servo Controller - The Plan

by Ivan Hamilton 6/24/2008 2:57:00 PM

Accurately controlling the position of rotating elements is the heart of a motion controlled system. Often stepper motors are called upon to complete this task. Although cheap and plentiful at lower power levels, more powerful versions are expensive and difficult to source.

Stepper motors have limitations:

  • Constant-power device (power = angular velocity x torque). As motor speed increases, torque decreases. 
  • More vibration than other motor types, as the discrete step tends to snap the rotor from one position to another.
  • Generally must be over engineered, so that there is no possibility that the motor will lose steps.

Another device is the servo motor. This combines a standard electric motor and position feedback sensor with a controlling circuit. The electric motor can be DC (brushed) or AC (brush-less).

At the hobby level Gecko (US$114) drives appear to be the norm. The Gecko appears to be a analogue unit with gain & dampening trim-pots. A test-point reflecting the error (as voltage) is available to assist in tuning with an oscilloscope.

There are a couple of fundamental components to these servo drives:

  • Actual position conditioning & decoding
  • Desired position conditioning & decoding
  • Error calculation (from actual-desired)
  • Error filtering (PID calculation)
  • PWM generation
  • H-Bridge

Actual position conditioning & decoding
This is the feedback sensor to determine the current position. They are built in to industrial servo motors, and industrial external sensors cost many $100s.
Hobby Option: A low cost optical encoder can be had for US$20, and with a little effort these can be fitted to a standard permanent magnet DC motor. The output from these incremental rotary encoders, is "quadrature" encoded (two output wave forms 90 degrees out of phase). Decode quadrature input with a microcontroller.

Desired position conditioning & decoding
The servo controller must be instructed of the desired position.
Hobby Option: Derived from stepper motors, the defacto standard is STEP & DIRECTION signals. A "step" line is pulsed, and each pulse represents an increment or decrement depending on the state of the "direction" line. Software such as EMC2 & Mach3 can generate these signals.  Decode quadrature input with a microcontroller.

Error calculation (from actual-desired)
Function: From the actual and desired position, an error level must be derived. This can be done via analogue, or digital means.
Hobby Option: Calculate with a microcontroller.

Error filtering (PID calculation)
From the error calculate an output level.
Hobby Option: Calculate with a microcontroller.

PWM generation
From processed error calculate an output level.
Hobby Option: Generate with a microcontroller. This is a logic level PWM signal (or signals) that control the H-bridge.

Produce a high power PWM DC signal.
Hobby Option: The H-bridge needs to match the motor. A simple 100mA unit can be constructed with BC548 NPN and BC558 PNP transistors. At 160A the 16 MOSFET Open Source Motor Controller project is the other extreme. Most setups will lie somewhere in between.

Converts electric power to motion.
Hobby Option: DC Brush motors provide the best performance/price. Genuine high power, low inertia, industrial servo motors cost many $100s. Existing automotive, electric scooter, & general purpose motors can be used quite effectively.

The most variable component is the motor. Different uses will require different motors, and different motors have different drive requirements. A number of DIY controllers, Elm Chan Servo, UHU Servo, Dspic-Servo, were all designed for the specific purposes of their creator, and integrate the H-bridge into the controller PCB. A modular approach, with a separate controller & H-bridge would be much more flexible.

I've created a prototype controller (PCB & firmware), and I'm using an off-the-shelf H-bridge.

This is my plan.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


CNC | Electronics

Powered by BlogEngine.NET
Original theme by Mads Kristensen

About the author

Name of author Ivan Hamilton
"My inner nerd can beat up your inner nerd."

E-mail me Send mail



<<  October 2021  >>

View posts in large calendar

Recent comments





    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2021

    Sign in