Skip to the content
2 layers45.3 × 42.7 mmMainPcb, the printed circuit board in 3D

Getting the most out of your hobby servo

Size
45.3 × 42.7 mm
Copper layers
2
Thickness
1.6 mm
Parts
14
Nets
27
Pads
84
Tracks, vias
168, 5
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
13 Apr 2021
Updated
1 Apr 2024

Overview

MainPcb is an open-source printed circuit board by adamb314, from the adamb314/ServoProject repository on GitHub. It is a 2-layer board of 45.3 × 42.7 mm with 14 parts on 27 nets, routed with 168 tracks and 5 vias.

Its parts include 5 connectors, 2 ICs and 1 diode. It belongs with the robots and motor control boards of this library.

README

README.md

ServoProject

by Adam Bäckström

Getting the most out of your hobby servo

Robot

Video demo of project

Demo video

Additional documentation for the project

Theory

Dependencies

Build instructions
Legacy build instructions

Project structure

ArduinoSketch

This folder contains the Arduino project for the Adafruit ItsyBitsy M0 Express boards.

Easiest way to program and configure the servos is through the configurationWizard.py script. Just run python3 ./ArduinoSketch/configurationWizard.py to get started. The script will ask if it should install any missing dependencies.

PLEASE NOTE! Windows users must use MSYS2 due to the the PyGObject package, see https://pygobject.readthedocs.io/en/latest/getting_started.html. After installing MSYS2 run the script with:

text
C:\msys64\mingw64\bin\python.exe ArduinoSketch\configurationWizard.py
Manually compiling the Arduino sketch

When compiling, the active configuration is selected by modifying the #include "*.h" line in the config/config.h file to include the desired config file. The configSelector.py script can be used to simplify the config selecting process by giving a drop-down list with all configs in the config folder.

The folder also holds a Makefile which can be used to compile and transfer the project. One benefit of using the Makefile is that the configSelector script is always executed prior to compiling. To be able to use the Makefile you must first install arduino-cli.

text
Arduino sketch dependencies:
  - Adafruit DotStar `source:` Arduino Library List
  - Eigen `source:` Arduino Library List

ArduinoLibrary/ServoProjectController

Arduino library for communicating with the servos.

View Example Arduino sketch

C++/Library

Holds the C++ library for communicating with the servos.

text
Dependencies:
  - GNU Make >= 4.2.1
  - gcc >= 9.3.0
  - boost >= 1.71.0
C++/Demo

Minimal c++ demo project.

View Example Code

C++/Example6dofRobot

Example 6dof robot project.

View Example Code

To compile run make. This creates the program ./executable with the following options.

text
Allowed options:
  --playPath            play the path defined in createPath()
  --gui                 open jogging gui
  --output arg          data output file
  --simulate            simulate servos
text
Dependencies:
  - Eigen >= 3.4.0
  - gtkmm-3.0 >= 3.24

CadFiles

Holds all .stl and the original Freecad files

PcbDesignes

Holds all KiCad projects for the electronics

Python/Demo

Python demo project.

View Example Code

Python/ServoProjectModules

Holds all python modules for the project.

Communication bus setup for demo projects

ONLY CONNECT THE SERVO TO 3.3V LOGIC!!!!

Robot

PLEASE NOTE! The bus controller needs to have a low latency to get fast communication with the servos. Most standard USB to Serial converters buffer the data and only transfers every 10 ms or so. This becomes a problem since the communication protocol will wait for the response from each servo before moving on to the next, adding huge delays.

To get the best communication speed it is recommended to use an "Adafruit ItsyBitsy M0 Express" (or similar ARM based Arduino) as the USB to Serial converter. Just program the Arduino with the usbToSerial.h configuration in the ArduinoSketch to get started. In usbToSerial.h you can also configure any regular servos you want to control together with the ServoProject modified ones.

How to switch to PWM interface version

ONLY CONNECT THE SERVO TO 3.3V LOGIC!!!!

Using the PWM interface is not recommended due to low resolution and high noise, but it is possible by modifying the configuration file. To enable PWM control replace the getCommunicationHandler() function with the version below.

text
    static std::unique_ptr<Communication> getCommunicationHandler()
    {
        Serial.begin(115200);
        auto com = std::make_unique<Communication>(SerialComOptimizer(&Serial));
        uint8_t pwmPin = 0; // Rx pin, ONLY CONNECT TO 3.3V LOGIC!!!!
        uint8_t controlSpeed = 14;
        uint8_t backlashControlSpeed = 2;
        float scale = 2.0f; // 2 units per us (4096 units == 360 deg)
        float offset = 1024.0f; // move to 1024 units (90 deg) for 1500 us pwm signal
        com->addCommunicationNode(
                std::make_unique<DCServoCommunicationHandlerWithPwmInterface>(1,
                    createDCServo<SetupConfigHolder>(controlSpeed, backlashControlSpeed),
                    pwmPin, scale, offset));
        return com;
    }

License

Open Source License

ServoProject is free software. You can redistribute it and/or modify it under the terms of Creative Commons Attribution 3.0 United States License.

To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/us/

Parts

14
QtyValueFootprintReferences
6Conn_01x01Connector_Wire:SolderWirePad_1x01_Pad1.5mm_Drill1mm3.3v1, GND1, SC, SCK, SI, SO
2Conn_02x02_Odd_EvenConnector_PinHeader_2.54mm:PinHeader_2x02_P2.54mm_VerticalJ1, J4
2Conn_02x05_Odd_EvenConnector_PinHeader_2.54mm:PinHeader_2x05_P2.54mm_VerticalJ3, J5
11N4001Diode_THT:D_DO-34_SOD68_P7.62mm_HorizontalD1
1Conn_01x04Connector_Wire:SolderWirePad_1x04_P3.81mm_Drill1.2mmJ2
1ItsybitsyPackage_DIP:DIP-28_600U1
1TB6612FNGPackage_DIP:DIP-16_600_ELLU2

More from adamb314/ServoProject

4
  • 2 layers36 × 20 mmCombined, the printed circuit board in 3D

    Combined

    adamb314/ServoProject

    Getting the most out of your hobby servo

    24 parts545
  • 2 layers8.4 × 3.6 mmMainPcb, the printed circuit board in 3D

    MainPcb

    adamb314/ServoProject

    Getting the most out of your hobby servo

    12 parts545
  • 2 layers8.1 × 11 mmAs5048aEncoderBoard, the printed circuit board in 3D

    As5048aEncoderBoard

    adamb314/ServoProject

    Getting the most out of your hobby servo

    8 parts545
  • 2 layers9 × 3.6 mmOpticalEncoder, the printed circuit board in 3D

    OpticalEncoder

    adamb314/ServoProject

    Getting the most out of your hobby servo

    6 parts545

Similar boards

  • 2 layers116.8 × 30 mmType d, the printed circuit board in 3D

    Type d

    google/mozc-devices

    Circuit diagrams and firmware source code for Gboard DIY keyboards

    14 parts3kApache-2.0
  • 2 layers32 × 22 mmDiff driver, the printed circuit board in 3D

    Diff driver

    rene-dev/stmbl

    AC Servo Driver for STM32F4

    14 parts990GPL-3.0
  • 2 layers34 × 45 mm2032Charger, the printed circuit board in 3D

    2032Charger

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    14 parts915
  • 2 layers34 × 109.9 mmTdisplay s3, the printed circuit board in 3D

    Tdisplay s3

    landonr/homeThing

    Wifi Smart Home Remotes that run on ESPHome

    14 parts551GPL-3.0
  • 2 layers42.5 × 28.8 mmC5VRX JACK DIY, the printed circuit board in 3D

    C5VRX JACK DIY

    Twotoz/C5VRX

    Ultra-minimal, zero-CPU 5.8 GHz analog FPV video receiver using ESP32-C5 Wi-Fi 6 PHY MODEM_DIAG, BitScrambler WBFM demodulation & resistor DAC CVBS

    14 parts515GPL-3.0
  • 2 layers62 × 24 mmMai button, the printed circuit board in 3D

    Mai button

    whowechina/mai_pico

    Pico controller for Maimai

    14 parts475
  • 2 layers32 × 76 mmTouch kicad template, the printed circuit board in 3D

    Touch kicad template

    BenjaminPoilve/minichord

    A pocket-sized musical instrument

    14 parts470

Questions

How big is the MainPcb PCB?

It measures 45.3 × 42.7 mm and has 2 copper layers, 1.6 mm thick.

What parts does the MainPcb use?

14 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the MainPcb KiCad files?

From the adamb314/ServoProject repository on GitHub, at the commit this page was made from: the board is PcbDesignes/legacy/ServoCoreless/MainPcb/MainPcb.kicad_pcb and its schematic PcbDesignes/combined/combined.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the MainPcb design in my own project?

Its repository states no licence, so its author keeps all rights: ask adamb314 before reusing the design.