Skip to the content
4 layers65.1 × 32.6 mmMain Control, the printed circuit board in 3D

Custom robot based on the Reginleif from 86: Eighty-Six from Asato Asato

Size
65.1 × 32.6 mm
Copper layers
4
Thickness
1.6 mm
Parts
62
Nets
91
Pads
313
Tracks, vias
466, 113
Pours
3
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
16 Sep 2026
Updated
2 Oct 2026

Overview

Main Control is an open-source printed circuit board by julien-martinez2, from the julien-martinez2/Reginleif repository on GitHub, published under the MIT licence. It is a 4-layer board of 65.1 × 32.6 mm with 62 parts on 91 nets, routed with 466 tracks and 113 vias.

It is built around the THVD1406DRL, AP63203WU and AP63205WU, with the BNO086, TPS259824ONRGET and EG1215AA among its other parts. Its parts include 25 capacitors, 11 resistors, 11 ICs, 8 connectors and 2 inductors. It belongs with the STM32 boards of this library.

Main components

6

README

README.md

🕷️ Reginleif — Autonomous Quadruped Walking Robot

Platform Language [blocked] Hardware [blocked] Bus [blocked] License

A custom-engineered, distributed quadruped combat walker inspired by the XM2 Reginleif and M1A4 Juggernaut from the acclaimed light novel & anime series 86 - Eighty Six.


📖 Table of Contents


💡 Motivation & Inspiration

The goal of this project is to take the agility, distinctive gait mechanics, and rugged aesthetic of the XM2 Reginleif from 86 - Eighty Six and bring it into physical reality.

Building a multi-jointed legged walker from scratch serves as an end-to-end engineering challenge across multiple disciplines:

  1. Developing Real-Time Embedded Skills: Mastering bare-metal ARM Cortex-M control, deterministic task scheduling, multi-bus SPI synchronization, and DMA streaming.
  2. Custom PCB & Power Electronics: Designing compact 4-layer PCBs, handling thermal dissipation, power distribution for 16 simultaneous DC gearmotors, and integrated eFuse circuit protection.
  3. Complex Kinematics & Robotics: Solving 3D inverse kinematics, gait generation, and closed-loop position control with mechanical backlash compensation.

Open Source Philosophy: Advanced quadruped robotics often relies on expensive off-the-shelf smart actuators or proprietary platforms. By documenting every schematic, trade-off, calculation, and line of code, this repository aims to serve as a practical, open reference for robotics students, engineers, and hobbyists building their own legged systems.


🏛️ System Architecture

Functional Architecture

The robot employs a hierarchical distributed architecture, offloading high-frequency motor control to dedicated microcontrollers while centralizing planning, telemetry, and stabilization:

text
                      ┌────────────────────────────────────────┐
                      │        High-Level Intelligence         │
                      │     Raspberry Pi (Vision, Autonomy)    │
                      └──────────────────┬─────────────────────┘
                                         │ SPI / UART
                                         ▼
                      ┌────────────────────────────────────────┐
                      │    Central Master MCU ("Sun Board")    │
                      │  • IMU Body Stabilization (BNO086)     │
                      │  • Power Distribution & Battery Monitor│
                      │  • Master Gait Coordinator             │
                      └──────────────────┬─────────────────────┘
                                         │
          ┌──────────────────────────────┼──────────────────────────────┐
          │ RS-485 Differential Bus      │ (Master-Slave Protocol)      │
          ▼                              ▼                              ▼
 ┌──────────────────┐           ┌──────────────────┐           ┌──────────────────┐
 │  Planet Board 1  │           │  Planet Board 2  │           │ Planet Boards 3-4│
 │ (STM32G031)      │           │ (STM32G031)      │           │  (STM32G031)     │
 │ 4x N20 Motors    │           │ 4x N20 Motors    │           │ 4x N20 Motors    │
 └──────────────────┘           └──────────────────┘           └──────────────────┘
          │                     SPI Bus  │ (Master-Slave Protocol)      │
          ▼                              ▼                              ▼
 ┌──────────────────┐           ┌──────────────────┐           ┌──────────────────┐

Technical & Electrical Architecture

text
                              [ 3S LiPo Battery (11.1V - 12.6V) ]
                                              │
                                              ▼
                                 [ TPS259827 15A eFuse ]
                                (UVLO Cutoff at 10.83V)
                                              │
                  ┌───────────────────────────┼───────────────────────────┐
                  │ VM (12V) Motor Power      │                           │
                  ▼                           ▼                           ▼
        ┌───────────────────┐       ┌───────────────────┐       ┌──────────────────────┐
        │ AP63205 (5V Buck) │       │ AP63203 (3.3V)    │       │ TPS22919 Load SW     │
        │ -> Raspberry Pi   │       │ -> Sun Board MCU  │       │ -> Planet Board VDD  │
        └───────────────────┘       └───────────────────┘       └─────────┬────────────┘
                                                                          │
                                  ┌───────────────────────────────────────┘
                                  │ 5-Pin JST-PA Harness (12V, 3.3V, GND, RS485_A/B)
                                  ▼
         ┌─────────────────────────────────────────────────────────────────┐
         │                     MODULAR PLANET BOARD (x4)                   │
         │                                                                 │
         │   [ THVD1406 RS-485 ] <── UART DMA ──> [ STM32G031 MCU ]        │
         │                                              │                  │
         │              ┌───────────────────────────────┴────────┐         │
         │              ▼ (SPI1 Bus)                             ▼ (SPI2)  │

🛠️ Hardware & Key Components

Sun Board

  • Master Processing: STM32G031 / Raspberry Pi pairing for autonomous operation, telemetry streaming, and wireless communication.
  • Power & Circuit Protection:
    • TPS259827 15A eFuse: Ultra-fast short-circuit protection and hardware programmable undervoltage lockout (V_UVLO = 10.83 V), preventing 3S LiPo over-discharge).
    • AP63205 & AP63203: High-efficiency synchronous buck converters generating 5 V (logic/SBC) and 3.3 V (peripherals).
    • TPS22919 Load Switches: Independent hardware-level logic power isolation and current limiting for each peripheral board.
  • Inertial Measurement: BNO086 9-axis sensor fusion IMU over SPI for real-time body attitude stabilization.

Planet Boards

  • Dedicated MCU: STM32G031G8U6 (ARM Cortex-M0+ running at 16 MHz, 4-layer compact layout with solid internal ground planes).
  • Motor Driver: DRV8908 automotive-grade 8 half-bridge driver, providing 4 fully independent bi-directional motor channels with individual hardware current limiting and fault telemetry.
  • Bus Transceiver: THVD1406DR RS-485 transceiver with auto-direction sensing, eliminating the need for half-duplex DE/RE switching overhead.
  • Connectors: JST-PA (power and differential communication) and JST-ZH (motor and sensor interconnects).

Moon Boards

  • Angle Sensor: MA730 is a magnetic angle sensor, which is placed next to the shaft of the motor on which a magnet is put.
  • Connectors: JST-ZH (same as the motors).

Dual-Encoder Sensing Strategy

Miniature worm gearboxes provide high stall torque and self-locking capabilities, but introduce mechanical backlash. To solve this, a dual-encoder feedback architecture is implemented:

Sensor TypePart & InterfaceResolutionPlacementRole in Control Loop
Incremental Magnetic Encoder2-Phase Hall (EXTI)2x Quadrature (~2107 counts/rev on motor shaft)Motor Tail ShaftHigh-frequency velocity estimation and instantaneous PID rate control.
Absolute Magnetic EncoderMA730GQ-Z (SPI1)14-bit (16,384 counts/rev)Output Joint Shaft (with Diametric Ring Magnets)Absolute angle calibration (10 Hz) to eliminate gearbox play, backlash, and drift.

💻 Firmware Architecture

NVIC Preemptive Priority Hierarchy

The Cortex-M0+ interrupt controller is prioritized to guarantee that critical hardware signals and high-speed encoder transitions are never delayed by slower math computations:

text
Priority 0 (Highest) ──► SysTick & EXTI Lines (PA0, PB1, PB3, PC14, PA2 nFAULT)
│
Priority 1             ──► USART1 Communication & DMA Channels
│
Priority 2             ──► TIM2 (DRV8908 SPI Updates) & TIM3 (MagAlpha SPI Reads)
│
Priority 3 (Lowest)    ──► TIM1 (Software Inverse Kinematics & PID Loops)
  • Zero-Jitter Pulse Counting: Encoders run at Priority 0 so wheel pulses are captured without dropped ticks during motor acceleration.
  • Fault Handling: The open-drain nFAULT pin on PA2 triggers an immediate shutdown sequence on overcurrent or thermal warnings.
  • Safe Preemption: Heavy inverse kinematics floating-point calculations (Priority 3) safely yield execution whenever a peripheral event occurs.

Real-Time Timer Scheduling

TimerExecution FrequencyPeriodTask Description
EXTI LinesAsynchronous< 1 µsHardware edge-triggered incremental encoder decoding (Motors 1–4).
TIM310 Hz100 msSPI1 sequential polling of the 4 joint-level MA730 absolute encoders.
TIM250 Hz20 msSPI2 multi-channel register write updating DRV8908 motor PWM/directions.
TIM120 Hz - 50 Hz20 - 50 msInverse kinematics trajectory solving, PID position/velocity loop execution.

Zero-CPU UART DMA with IDLE Line Detection

Communication between the central master board and the leg modules uses DMA combined with hardware IDLE line detection (HAL_UARTEx_ReceiveToIdle_DMA):

cpp
// Non-blocking packet reception
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size) {
    if (huart->Instance == USART1) {
        // Validate header and packet checksum
        if (Size >= 11 && rx_buffer[0] == 0xAA && rx_buffer[1] == 0x55) {
            ParseMasterCommand(rx_buffer, Size);
        }
        // Immediately re-arm DMA reception for the next packet
        HAL_UARTEx_ReceiveToIdle_DMA(&huart1, rx_buffer, RX_BUFFER_SIZE);
    }
}
  • Zero CPU overhead while bytes are on the wire.
  • The MCU triggers a single interrupt only after an entire variable-length packet is delivered and the bus goes idle.

📂 Project Documentation & CAD Assets

All schematics, BOMs, mechanical studies, and test records are available in the repository:

  • Hardware Schematics & KiCad Layouts: 4-layer Leg Board, Satellite Angle Sensor PCBs, and Central Carrier Board.
  • Mechanical CAD: 3D printed joint housings, worm gearbox mounts, and chassis brackets.

🗺️ Roadmap & Deliverables

  • Functional specification and torque/power feasibility study
  • 4-layer Leg Board PCB design and component assembly (KiCad)
  • Mechanical Design and 3D-printing (FreeCAD)
  • Bare-metal firmware setup (CubeMX, SPI1/SPI2, multi-channel EXTI, UART DMA)
  • MA730 absolute magnetic sensor driver (magalpha.cpp)
  • DRV8908 8 half-bridge motor controller driver (drv8908.cpp)
  • 3D Inverse Kinematics math library and body orientation matrix
  • Dynamic walking gait generation (Crawl, Trot, and Creep gaits)
  • Central Sun Board assembly & BNO086 IMU stabilization loop
  • Auxiliary subsystems: Tilt-axis turret mechanism and deployable anchor system

👤 Author & Community

Designed and engineered with passion by Julien Martinez (@julien-martinez2).

If you are working on custom quadruped walkers, legged robotics, or distributed motor controllers, feel free to open an issue, start a discussion, or contribute!


📄 License

This project is distributed under the MIT License. See LICENSE for more details.

Parts

62
QtyValueFootprintReferences
100.1uFCapacitor_SMD:C_0603_1608MetricC1, C2, C3, C7, C8, C9, C10, C12, C16, C25
51uFCapacitor_SMD:C_0402_1005MetricC20, C21, C22, C23, C24
5TPS22919DCKRTPS22919DCKR:SOT65P210X110-6NU7, U8, U9, U10, U11
422uFCapacitor_SMD:C_0805_2012MetricC13, C14, C17, C18
4MountingHoleMountingHole:MountingHole_2.2mm_M2H1, H2, H3, H4
310kRResistor_SMD:R_0603_1608MetricR6, R8, R9
2100kRResistor_SMD:R_0402_1005MetricR3, R10
2100uFCapacitor_Tantalum_SMD:CP_EIA-7343-43_Kemet-XC4, C5
210uFCapacitor_SMD:C_0603_1608MetricC11, C15
2WE-MAPI_4030WE-MAPI_4030:WE-MAPI_4030L1, L2
1100RResistor_SMD:R_0402_1005MetricR4
1113kRResistor_SMD:R_0402_1005MetricR2
1120RResistor_SMD:R_0402_1005MetricR7
11MRResistor_SMD:R_0402_1005MetricR1
120uFResistor_SMD:R_0805_2012MetricC19
133kRResistor_SMD:R_0402_1005MetricR11
16.8nFCapacitor_SMD:C_0402_1005MetricC6
1806RResistor_SMD:R_0402_1005MetricR5
1AP63203WUPackage_TO_SOT_SMD:TSOT-23-6U5
1AP63205WUPackage_TO_SOT_SMD:TSOT-23-6U6
1Alim ConnectorConnector_Wire:SolderWire-0.75sqmm_1x02_P4.8mm_D1.25mm_OD2.3mm_ReliefJ8
1BNO086BNO086:IC_BNO086U4
1Conn_02x20_Odd_EvenConnector_PinHeader_2.54mm:PinHeader_2x20_P2.54mm_Vertical_SMDJ7
1EG1215AAEG1215AA:SW_EG1215AAS1
1Gun_AnchorsSM05B_PASS:SM05B_PASSJ6
1LegFLSM05B_PASS:SM05B_PASSJ3
1LegFRSM05B_PASS:SM05B_PASSJ4
1LegRLSM05B_PASS:SM05B_PASSJ2
1LegRRSM05B_PASS:SM05B_PASSJ5
1STM32G031G8UxPackage_DFN_QFN:QFN-28_4x4mm_P0.5mmU1
1SWD Pin HeaderM20-7910442R:HARWIN_M20-7910442RJ1
1THVD1406DRPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU3
1TPS259824ONRGETTPS259824ONRGET:IC_TPS259824ONRGETU2

More from julien-martinez2/Reginleif

2
  • 4 layers48.6 × 16.3 mmLeg Control, the printed circuit board in 3D

    Leg Control

    julien-martinez2/Reginleif

    Custom robot based on the Reginleif from 86: Eighty-Six from Asato Asato

    21 partsMIT
  • 4 layers13.6 × 12.4 mmAngle Sensors, the printed circuit board in 3D

    Angle Sensors

    julien-martinez2/Reginleif

    Custom robot based on the Reginleif from 86: Eighty-Six from Asato Asato

    3 partsMIT

Similar boards

  • 4 layers92.5 × 101.6 mmVCU, the printed circuit board in 3D

    VCU

    formulaslug/fs-4-schematics

    Electrical Design Repository for fs-4 schematics and PCBs

    225 parts7
  • 2 layers63.5 × 69.3 mmTurtlePico Leatherback, the printed circuit board in 3D

    TurtlePico Leatherback

    Jin-Neuron/Turtle-Pico

    The development board making electronics work easier and more widely

    127 parts1
  • 2 layers64.6 × 36.9 mmNavien latest, the printed circuit board in 3D

    Navien latest

    htumanyan/navien

    Navien water heater wire protocol for communication with NaviLink and other attached devices

    30 parts65
  • 4 layers80 × 80 mmPICO RS485, the printed circuit board in 3D

    PICO RS485

    mortens-lab/PICO_RS485

    Raspberry Pi Pico with RS485 interface and sensors

    61 parts6
  • 4 layers95 × 75 mmPico IoT thingy, the printed circuit board in 3D

    Pico IoT thingy

    mhered/KiCAD_udemy_course

    My notes on the course "PCB design with KiCAD - updated for KiCAD 9" by Dr Peter Dalmaris in Udemy

    61 parts2
  • 4 layers80 × 80 mmPICO iot, the printed circuit board in 3D

    PICO iot

    Ayan-nova/Design-of-a-Raspberry-PICO-Iot-Device-on-4-Layer-PCB-Design-With-Sensor-And-More

    Design a Raspberry Pi Pico W-based Industrial IoT Gateway and Edge Controller using Kicad software.

    60 parts1
  • 2 layers36 × 72 mmHCP Bridge, the printed circuit board in 3D

    HCP Bridge

    JonasE99/HCP-Bridge

    🚧 WIP – not yet manufactured or tested. KiCad PCB (one per door) connecting Hörmann series 4 garage door operators (ProMatic/SupraMatic, BUS/RJ12) to Loxone via ESP32-S3 and Wi-Fi.

    53 parts1

Questions

How big is the Main Control PCB?

It measures 65.1 × 32.6 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Main Control use?

62 parts, built around the THVD1406DRL, AP63203WU, AP63205WU and BNO086. 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 Main Control KiCad files?

From the julien-martinez2/Reginleif repository on GitHub, at the commit this page was made from: the board is 2.1-Sun Board/V1/Main_Control.kicad_pcb and its schematic 2.1-Sun Board/V1/Main_Control.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Main Control design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).