front DIY Servo Motor
Authors: A. Aleksić, V. Tešić, J. Bajić 
2019 03 29 172747 

This project illustrates implementation of a custom servo motor, a motor that allows precise control of angular position based on gived reference (control) signal. This project is done by authors as a student project within the course of Sensors and actuators. Article entitled "Servos" posted by Norbert Heinz is used as reference [1]. Block diagram of implemented servo motor is shown below. Motor consists of control logic (regulator), motor driver, DC motor, mechanical reductor and rotary position sensor. Based on given reference signal (desired position) and measured position, via motor driver, control logic or regulator drives DC motor. Next, DC motor, via mechanical reductor, rotates position sensor to match given reference signal.

Simple potentiometer is used as rotary position sensorMotor driver is H-bridge, implemented using complementary N-channel (IRF540N) and P-channel (IRF9540N) MOSFET transistors. MOSFET transistor are switched via totem-pole stage implemented using PN2222A transitors. 4N25 optocouplers are used for bridge isolation from control logicRegulator is implemented as simple ON/OFF regulator using OPA2340PA rail-to-rail dual operational amplifier. Operational amplifiers are used as voltage comparators within regulator. Regulator has two outputs (OUT1 and OUT2) which are directly connected to H-bridge inputs. Servo motor is implemented in such way that reference or control signal can be either analog (voltage) or digital (PWM). Analog or digital mode of operation can be selected via board jumper. If analog mode is used, reference signal is directly passed to regulator for comparison with analog signal from position potentiometer. On the other hand, if digital mode is used, digital reference signal in form of PWM is first converted to analog and then passed to regulator for comparison. Conversion is achieved using low pass RC filter (average value extraction) and OPA2340PA amplifier stage. In demo video below PWM signal is generated using Servo tester. Required PWM signal corresponds to typical PWM signal used with popular RC hobby servo motor. Simulation of PWM to analog circuit made using MicroCap is provided below.  

Two servo models are provided below. Model V1 is simpler, parametic model, designed using OpenSCAD. It is design fror gearmotors (such as this or this) and it can be easily adapted for different DC motors. Motor is coupled to sensing potentiometer via simple 3D printed spur gears (gear ration can be adjusted in OpenSCAD).

Model V2 is a bit more complex, but also more powerful. This servo motor is implemented using DC motor and planetary reductor extracted from an old cordless drill. Via 3D printed gears DC motor is coupled with planetary reductor upon which output shaft is located. Rotary position sensor (potentiometer) is coupled with planetary reductor on the output side also using 3D printed gears. Such design enables high torque servo motor.

[1] Norbert Heinz, “Servos”.


 - Servo motor schematic: pdf
Servo motor PCB: zip
 - V1 3D printed parts: zip
 - V1 OpenSCAD model on thingiverse: link
 - V2 3D printed parts: zip
 - V2 Fusion 360 modellink
 - PWM to analog circuit simulation: zip
 - Demo video on youtube: video



  • driver_sch_1driver_sch_1
  • driver_pcb2driver_pcb2
  • driver_pcb1driver_pcb1
  • IMG_1IMG_1
  • driver_sch_2driver_sch_2
  • IMG_2IMG_2
  • IMG_3IMG_3
  • IMG_4IMG_4
  • IMG_5IMG_5
  • IMG_7IMG_7
  • IMG_6IMG_6
  • IMG_9IMG_9
  • IMG_8IMG_8
  • IMG_10IMG_10
  • IMG_11IMG_11
  • model_V1_4model_V1_4
  • IMG_12IMG_12
  • model_V1_3model_V1_3
  • model_V1_2model_V1_2
  • model_V1_1model_V1_1
  • model_V2_5model_V2_5
  • model_V2_6model_V2_6
  • model_V2_4model_V2_4
  • model_V2_2model_V2_2
  • model_V2_1model_V2_1
  • model_V2_3model_V2_3


Joomla Extensions
© - Faculty of Technical Sciences, Novi Sad, 2016