Blog

Turn Any DC Motor Into a Servo - Hackster.io

Please ensure that JavaScript is enabled in your browser to view this page.

DC motors are extremely useful for driving wheels and other equipment when precise positioning isn’t needed. Standard hobby servos can hit a specific position, but typically can’t turn a full 360 degrees, limiting their applications. In this project, Dejan Nedelkovski of How To Mechatronics shows how to convert a standard geared DC motor into a precisely positioned servo. Planetary Gear Motor

Turn Any DC Motor Into a Servo - Hackster.io

The heart of this build is a custom control board based on the ATmega328P-AU microcontroller. This sends PWM signals to a DRV8871 chip that drives the motor, and it receives position feedback via an AS5600 magnetic encoder over I2C.

The device can take input from a standard RC receiver, potentiometer, or via serial, and it uses the encoder feedback to ensure it arrives at the correct position. The servo’s center point can be dynamically set via an input button, and it's capable of 360 degree and continuous rotation as needed.

Mechanically, the device features a 3:1 gearbox and mounts the encoder magnet on the reduced final output shaft. The custom PCB positions the encoder chip by itself on the bottom to interface with the magnet. Other board components are attached to the top in a 40x40mm board form factor.

PID control is employed to keep the device from oscillating out of control, which may need to be tuned depending on the motor selected. More information, including build files and parts used, is available in the project's write-up.

Turn Any DC Motor Into a Servo - Hackster.io

Motor Dc Mini Hackster.io, an Avnet Community © 2023