Democratize Robotics For Everyone

GitHub: OpenServoCore/open-servo-core

Overview

This project aims to transform cheap MG90S-class servos into fully networked smart actuators by adding:

  • real sensor feedback
  • cascade control loops (current → velocity → position)
  • a DYNAMIXEL-style serial protocol
  • a bare-metal Rust firmware stack

Rather than relying on expensive commercial smart servos, this platform provides a low-cost, open, and hackable alternative. It gives students, hobbyists, and resource-limited builders the tools to explore:

  • motor current and voltage sensing
  • system identification and model building
  • PID tuning and control theory
  • Kalman filtering and state estimation
  • bus protocols and multi-servo networking

To ground it in numbers:

  • A small 4-legged robot with 12 smart servos built from commercial DYNAMIXEL-style actuators can easily cost $300–$400+ just in servos.
  • The same robot built on this platform, using MG90S clones from AliExpress (≈ $2.50 each) plus a custom smart-servo board in the $2–$4 range per joint, brings the per-actuator cost down to roughly $4.50–$6.50.
  • For 12 joints, that’s on the order of $55–$80 in actuators instead of several hundred dollars — making it an accessible option for students, hobbyists, and resource-limited builders.

By upgrading a $2–$3 servo into a capable, addressable actuator, this project works toward democratizing robotics for everyone, especially builders who can’t casually sink a few hundred dollars into “just the servos.”


Spec

High-level target spec for the v0.x platform:

Mechanical / Base Servo

  • Base mechanism: MG90S / MG90D-class micro servos
  • Metal gears preferred (survivability during experiments)
  • No mechanical modifications beyond swapping the control board

Electronics

  • MCU: small ARM or RISC-V (STM32 / CH32V-class)
  • Motor driver: H-bridge (DRV8xxx class)
  • Feedback options:
    • stock potentiometer
    • onboard current sensor
    • future: internal reflective IR encoder for position detection
  • Current sensing: shunt + amplifier, or integrated sense inside the motor driver
  • Communications bus:
    • Phase 1: half-duplex UART, DYNAMIXEL-style (TTL)
    • Future: RS-485 and/or CAN-FD variants

Firmware / Control

  • Language: Rust — bare-metal, PAC-level drivers
  • Control structure: cascade control
    • outer loop: position
    • middle loop: velocity
    • inner loop: current/torque (where hardware allows)
  • Features:
    • addressable servos on a shared bus
    • register read/write (pos, vel, temp, voltage, etc.)
    • basic homing / calibration
    • soft limits and error reporting

Protocol

  • Packet-based, inspired by DYNAMIXEL 2.0:
    • header → ID → length → instruction → params → checksum
    • instructions: PING, READ, WRITE, SYNC_WRITE, BULK_READ
  • “Backwards-inspired,” not backwards-compatible
  • Designed so a PC, microcontroller, or SBC can control many servos over one UART

Architecture

The Smart Servo project is organized into mechanical, hardware, firmware, protocol, and tooling layers. Only components inside the servo belong to the core architecture. External sensors and rigs for system identification live under Tooling & Measurement Rigs.

1. Mechanical & Enclosure Layer

Current

  • Stock MG90S / MG90D housing and gear train
  • Standard spline and servo horn

Planned

  • Modular housings for:
    • easier access to the control board
    • cleaner cable routing in multi-servo systems
    • mounting points for integrated sensors
  • 3D-printed internal brackets for future sensing modules

This layer governs physical constraints, gear clearance, and mechanical integration.

2. Hardware Layer (Servo Electronics)

The smart control board replaces the stock PCB and becomes the electrical core of the servo:

  • MCU: STM32 / CH32V-class
  • H-bridge: DRV8xxx or similar
  • Feedback: stock rotary potentiometer
  • Current sensing: low-side shunt or integrated sense amplifier
  • Communications: half-duplex UART (DYNAMIXEL-style), future RS-485 / CAN-FD
  • Power conditioning: 5–8.4V regulators

This board handles motor actuation, sensing, comms, and safety.

3. Feedback & Sensing Layer

Current

  • Rotary potentiometer (primary feedback)
  • External sensors (like the reflective IR rig) used only for system ID and testing — not part of the servo hardware

Future / Nice-to-Have

  • Internal reflective IR encoder (ultra-compact)
    • flex PCB with dual IR elements positioned directly under the gearbox
    • signal conditioning moved to main control board due to space constraints
    • requires extremely tight spacing, custom internal bracket, redesigned bottom housing
    • intended for higher-resolution position feedback and backlash compensation without changing the gear train

This section tracks how feedback could evolve as the design matures.

4. Firmware Layer (Rust)

  • Modular Rust firmware
  • PAC-level drivers for UART, PWM, ADC, timers, GPIO
  • Cascade control:
    • current → velocity → position
  • Servo state machine: idle, moving, homing, error
  • Safety: overcurrent, overtemp, runaway detection
  • Config storage in flash / EEPROM
  • Periodic telemetry

5. Protocol & Bus Layer

A DYNAMIXEL-inspired packet system:

  • Packet: header → ID → length → instruction → params → checksum
  • Commands:
    • PING, READ, WRITE
    • BULK_READ, SYNC_WRITE
    • BROADCAST ops
  • Register map:
    • Identity: model, version, ID
    • Config: limits, gains, offsets
    • Runtime: pos, vel, current, voltage, temperature, status
  • Multi-servo daisy chaining on one UART line

Tooling & Measurement Rigs

These components are not part of the servo, but are essential for system identification, calibration, and performance development.

Current Tools

  • Reflective IR Sensor PCB A standalone board using the ITR1204 as a reflective sensor, producing analog signals. Used for:
    • capturing motor speed / motion for system identification
    • experimenting with reflective sensing for future encoder ideas

Planned Tools

  • System ID rig for DC motor characterization
  • Servo fixture for system ID and firmware loading
  • Automated sweep-motion capture + analysis tool
  • External optical encoder prototypes

Future Integrated Tools

  • Internal flex-PCB reflective encoder (if space allows)
  • Hybrid optical + magnetic sensing experiments

These tools support iterative refinement of firmware, control algorithms, and hardware design without prematurely modifying the servo internals.


Acknowledgements

This project was partly inspired by Adam B’s ServoProject and his excellent YouTube breakdown of how to transform a cheap hobby servo into a high-performance actuator using a pair of custom analog encoders and cascaded control loops.

Adam’s design centers around:

  • a custom 3D-printed housing
  • a clever analog “quad-ish” reflective encoder with paired IR sensors
  • system identification to characterize each servo
  • auto-generation of tuned C code based on that model
  • cascaded current/velocity/position control
  • and a simple multi-servo serial bus

His approach achieves impressive accuracy and performance for a hacked SG90 servo. The communication link can support multiple servos, but it isn’t meant to be a general-purpose actuator protocol — servo IDs, firmware constants, and control parameters are hard-coded and generated per device during system identification.

My goals are different but inspired by the same spirit. Instead of pushing for maximum accuracy, this project focuses on:

  • simplicity and repeatability
  • low mechanical skill requirements
  • a drop-in control board for MG90S/MG90D servos
  • a unified, DYNAMIXEL-style bus protocol
  • easy modding
  • standardization
  • and keeping costs extremely low so high school students and hobbyists can build multi-servo robots without financial barriers

Where Adam’s project explores the upper limits of what a hacked servo can do, this project aims to make a similar upgrade path accessible, standardized, and affordable, so anyone can build real robots.

Huge credit to him for showing what’s possible.