Skip to the content
4 layers50 × 42.9 mmTwo axis balancing power, the printed circuit board in 3D

A robot that balances in pitch and roll. The two axes use different hardware: pitch runs a brushless motor through a VESC over CAN, roll runs a brushed motor through an H-bridge on a custom power board.

Size
50 × 42.9 mm
Copper layers
4
Thickness
1.6 mm
Parts
42
Nets
27
Pads
117
Tracks, vias
163, 111
Pours
74
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
31 May 2026
Updated
23 Oct 2026

Overview

Two axis balancing power is an open-source printed circuit board by BenjaminMeyerEE, from the BenjaminMeyerEE/Two-Axis_Balancing_Robot repository on GitHub. It is a 4-layer board of 50 × 42.9 mm with 42 parts on 27 nets, routed with 163 tracks and 111 vias.

It is built around the LM393, RPL-1.0-R and AO3401A. Its parts include 13 resistors, 6 capacitors, 3 ICs, 3 connectors and 2 diodes.

Main components

3

README

README.md

Two-Axis Balancing Robot

A robot that balances in pitch and roll. The two axes use different hardware: pitch runs a brushless motor through a VESC over CAN, roll runs a brushed motor through an H-bridge on a custom power board. Both close around an STM32G474 and an ICM-42688-P IMU on a custom carrier board. Two custom 4-layer boards, designed in KiCad.

Electrical architecture

Specifications

ParameterValue
AxesPitch and roll, separate drive hardware
ControllerSTM32G474RET6 (Nucleo-G474RE on the carrier board)
IMUICM-42688-P over SPI, both interrupt lines broken out
Pitch driveBrushless motor via VESC, commanded over CAN
Pitch feedbackTLE5012 magnetic encoder, SPI to the VESC
Roll driveBrushed motor via TB6612FNG dual H-bridge
Roll feedbackQuadrature encoder into the carrier board
Battery3S LiPo, 11.1 V nominal
Carrier board101.6 × 92.9 mm, 4-layer
Power board50.0 × 42.9 mm, 4-layer

Status

Both custom PCBs are designed and the electrical architecture is laid out. Mechanical design is partly finished.

I simulated the pitch axis in Simulink first, and that's what pushed me away from PID and toward LQR. Wheel position and tilt are coupled through the dynamics, so tuning them as separate loops meant the two kept fighting each other. Full state feedback made more sense than trying to manage that interaction by hand.

What I'm working on now is the model itself: deriving the equations of motion with Lagrangian mechanics, linearizing about the upright equilibrium, and designing a discrete-time LQR with Bryson's rule setting the cost weights. That work is all in MATLAB.

Repository layout

PathContents
hardware/two_axis_balancing_carrier/Carrier board KiCad project
hardware/two_axis_balancing_power/Power board KiCad project
docs/Architecture diagram, board renders, layer plots

Hardware

Both boards are 4-layer. Every copper layer below is plotted from the top and unmirrored, so features line up between layers.

Carrier board

101.6 × 92.9 mm. Holds the Nucleo-G474RE and everything the control loop reads.

Carrier boardCarrier board, top

The ICM-42688-P is on SPI (CS, SCLK, SDI, SDO) with INT1 and INT2 brought out, so the loop can run off data-ready rather than polling. An SN65HVD230 with 120 Ω termination puts the board on the CAN bus to the VESC. A MIC5219-3.3 makes the 3.3 V rail from the 5 V coming off the power board.

Roll encoder channels come in here on ENC_A / ENC_B. Motor commands (AIN1, AIN2, PWMA, STBY) and the battery signals go back to the power board over a 2×5 IDC ribbon. There are 13 test points, and the SPI, UART, encoder and rail pads are all labelled on the silkscreen for bring-up.

F.CuIn1.Cu
F.CuIn1.Cu
In2.CuB.Cu
In2.CuB.Cu

Power board

50.0 × 42.9 mm. Takes the battery in and handles everything that touches VBAT.

Power boardPower board, top

Battery comes in on an XT60, behind a 3 A fuse, an AO3401A P-channel MOSFET for reverse polarity, and a 10 V zener. An RPL-1.0-R module makes the 5 V rail and reports Buck_PG back to the MCU. A TB6612FNG dual H-bridge drives the roll motor on MOTOR_P / MOTOR_N.

Battery monitoring is done on this board rather than in firmware. A divider gives BAT_LEV, an LM393 compares it against BAT_REF, and BAT_LOW goes back to the carrier board. The MCU sees both the raw level and a latched low flag.

F.CuIn1.Cu
F.CuIn1.Cu
In2.CuB.Cu
In2.CuB.Cu

Connectors

BoardRefConnectorCarries
PowerJ1XT603S battery in
PowerJ3JST XH, 2-pinRoll motor out (MOTOR_P / MOTOR_N)
PowerJ2IDC 2×5To the carrier board
CarrierJ5IDC 2×5To the power board
CarrierJ2JST XH, 4-pinRoll encoder (ENC_A, ENC_B, 5 V, GND)
CarrierJ1JST GH, 3-pinCAN to the VESC (CANH, CANL, GND)

The 2×5 ribbon is the only link between the two boards. It carries the 5 V rail and ground, the four TB6612FNG control lines (AIN1, AIN2, PWMA, STBY) and the two battery monitoring signals (BAT_LEV, BAT_LOW). VBAT never reaches the carrier board, which only ever sees 5 V.

Parts

42
QtyValueFootprintReferences
9TestPointTestPoint:TestPoint_Pad_2.0x2.0mmTP1, TP2, TP3, TP4, TP5, TP6, TP7, TP8, TP9
410kRResistor_SMD:R_0603_1608MetricR1, R4, R5, R12
2100kRResistor_SMD:R_0603_1608MetricR7, R10
2100nFCapacitor_SMD:C_0603_1608MetricC2, C6
2220kRResistor_SMD:R_0603_1608MetricR3, R11
110VDiode_SMD:D_SOD-123D1
110uFCapacitor_SMD:C_0603_1608MetricC5
115kRResistor_SMD:R_0603_1608MetricR13
11613kRResistor_SMD:R_0603_1608MetricR8
120uFCapacitor_SMD:C_1812_4532MetricC3
122uFCapacitor_SMD:C_0805_2012MetricC4
13AFuse:Fuse_1812_4532MetricF1
1470RResistor_SMD:R_0603_1608MetricR9
1470uF470uF SMD:PCAP_10x10-ELECT_NCAC1
147kRResistor_SMD:R_0603_1608MetricR2
15.9kRResistor_SMD:R_0603_1608MetricR6
1AO3401APackage_TO_SOT_SMD:SOT-23Q1
1Conn_01x02Connector_AMASS:AMASS_XT60-M_1x02_P7.20mm_VerticalJ1
1Conn_01x02Connector_JST:JST_XH_S2B-XH-A_1x02_P2.50mm_HorizontalJ3
1Conn_02x05Connector_IDC:IDC-Header_2x05_P2.54mm_VerticalJ2
1LEDLED_SMD:LED_0603_1608MetricD2
1LM393Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU2
1RPL-1.0-RRCL-1:11L-LGA-M_RPL-1_RCPU1
1TB6612FNGPackage_SO:SSOP-24_5.3x8.2mm_P0.65mmU3

The 38 most common of 42 parts.

More from BenjaminMeyerEE/Two-Axis_Balancing_Robot

2
  • 4 layers50 × 50 mmTwo axis balancing carrier mcu version, the printed circuit board in 3D

    Two axis balancing carrier mcu version

    BenjaminMeyerEE/Two-Axis_Balancing_Robot

    A robot that balances in pitch and roll. The two axes use different hardware: pitch runs a brushless motor through a VESC over CAN, roll runs a brushed motor through an H-bridge on a custom power board.

    58 parts1
  • 4 layers101.6 × 92.9 mmTwo axis balancing carrier, the printed circuit board in 3D

    Two axis balancing carrier

    BenjaminMeyerEE/Two-Axis_Balancing_Robot

    A robot that balances in pitch and roll. The two axes use different hardware: pitch runs a brushless motor through a VESC over CAN, roll runs a brushed motor through an H-bridge on a custom power board.

    31 parts1

Similar boards

  • 4 layers72.4 × 44.4 mmBtmdpcb v04 eval, the printed circuit board in 3D

    Btmdpcb v04 eval

    17o2/bluetooth-minidisc

    Adding built-in bluetooth connectivity to a 20-year-old Mindisc player

    115 parts45
  • 4 layers189.4 × 59.1 mmFlippyDriver, the printed circuit board in 3D

    FlippyDriver

    NietoSkunk/FlippyDriver

    Driver board for Luminator MAX3000 Flip Dot Panels

    344 parts10MIT
  • 2 layers37 × 70.9 mmOpendiag, the printed circuit board in 3D

    Opendiag

    maximus64/opendiag-hardware

    OpenDIAG - Open Source OBD2 Interface (Hardware)

    148 parts5CERN-OHL-S-2.0
  • 4 layers90 × 90 mmNode prototype, the printed circuit board in 3D

    Node prototype

    tweedegolf/spaeter

    TDOA location detection device

    187 parts3
  • 4 layers39 × 67.3 mmNeptune, the printed circuit board in 3D

    Neptune

    jackbrad1ey/water_jet_tvc

    A water-propelled thrust vector control (TVC) testbed vehicle aiming to decrease the cost and time factors associated with developing TVC control algorithms

    69 parts1
  • 4 layers68.1 × 75 mmHomefire, the printed circuit board in 3D

    Homefire

    JhanqueliX/Smart-light-socket-for-fire-prevention

    117 parts1
  • 2 layers140 × 218 mmHelio-485, the printed circuit board in 3D

    Helio-485

    GrizJW/helio-485

    Helio-485 KiCad board: ESP32-C5, 2S 18650, solar input, 3.3 V, 12 V 2 A, RS-485 Modbus.

    106 parts
  • 4 layers28 × 52 mmNeptune, the printed circuit board in 3D

    Neptune

    jackbrad1ey/neptune_v2

    The second iteration of my Neptune flight computer, developed for testing simple thrust vector control systems

    77 partsMIT

Questions

How big is the Two axis balancing power PCB?

It measures 50 × 42.9 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Two axis balancing power use?

42 parts, built around the LM393, RPL-1.0-R and AO3401A. 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 Two axis balancing power KiCad files?

From the BenjaminMeyerEE/Two-Axis_Balancing_Robot repository on GitHub, at the commit this page was made from: the board is hardware/two_axis_balancing_power/two_axis_balancing_power.kicad_pcb and its schematic hardware/two_axis_balancing_carrier/two_axis_balancing_carrier.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Two axis balancing power design in my own project?

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