Skip to the content
2 layers46.2 × 16.6 mmFlexcircuit, the printed circuit board in 3D

This repository contains the electronics, embedded firmware, host software, and browser players for a network of brushless servo percussion actuators.

Size
46.2 × 16.6 mm
Copper layers
2
Thickness
0.29 mm
Parts
7
Nets
21
Pads
65
Tracks, vias
240, 17
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
6 Apr 2026
Updated
28 Oct 2026

Overview

Flexcircuit is an open-source printed circuit board by earlynerd, from the earlynerd/bl4818-servo-M23 repository on GitHub. It is a 2-layer board of 46.2 × 16.6 mm with 7 parts on 21 nets, routed with 240 tracks and 17 vias.

Its parts include 2 ICs, 1 capacitor, 1 resistor and 1 connector. It belongs with the robots and motor control boards of this library.

README

README.md

BL4818 Brushless Servo Musical Actuator

This repository contains the electronics, embedded firmware, host software, and browser players for a network of brushless servo percussion actuators. The actuators use modified BL4818 motor-controller hardware, a Nuvoton M2003 microcontroller, hall sensing, and an MT6701 absolute encoder to move a mallet with controlled timing and force.

The system is in active use: roughly 35 actuators have been built, and the firmware plus MIDI player/server are working well. The software is much closer to production-ready than the replication documentation, so this repository should currently be treated as a proven project under documentation rather than a turn-key kit.

Watch

check out video of these actuators playing various instruments on my Instagram!

Nine completed actuator bodies and mallets viewed from above

Close-up of an assembled actuator showing RX, TX, and SWD openings

Ten brushless servo actuators installed around a tongue drum

Each self-contained actuator packages the modified BL4818 motor controller, absolute encoder, power/data interface, and mallet mechanism inside the printed shell. RX and TX connectors allow power and serial data to continue through the actuator chain, while the recessed SWD port provides programming access.

System overview

mermaid
flowchart LR
    MIDI["MIDI file or browser player"] --> HTTP["Python MIDI server"]
    HTTP --> IFACE["USB serial / interface hardware"]
    IFACE --> A0["Actuator 0"]
    A0 --> A1["Actuator 1"]
    A1 --> AN["More actuators"]
    AN --> IFACE

The Python server owns the serial port and serves the browser UI. It enumerates the actuator ring, maps MIDI pitches to actuator addresses, schedules strikes, compensates for measured mechanical latency, and can build then deploy APROM updates through the permanent LDROM loaders without releasing the serial port. The updater and synchronized chord scheduler are hardware-validated on the 14-actuator handpan ring. Each actuator closes its own current, velocity, and position loops and runs the homing/strike state machine. The current protocol uses a four-bit address and supports up to 16 actuators per ring.

What is in this repository

  • src/ and include/: M2003 bare-metal firmware.
  • scripts/: ring-bus client, MIDI server, tuning, measurement, and demo tools.
  • player/: browser-based MIDI player, looper, and tongue-drum player.
  • pcb/: KiCad electronics plus current mechanical/fabrication exports.
  • mechanical/: SolidWorks source CAD and STEP exports for the actuator shell, mallet holder, and interface-board reference model.
  • docs/: replication notes, hardware references, debug history, and design notes.
  • protocol.md: byte-level Ring Bus Protocol v2 specification.
  • midi_server_api.md: HTTP API for integrations and custom players.

See Repository map for a guided tour.

Quick software start

The firmware builds on Windows and POSIX hosts, including Raspbian. Its Makefile expects GNU Make and the Arm GNU toolchain in PATH. Initial SWD provisioning still uses the PowerShell/J-Link scripts and is therefore Windows-oriented.

1. Install host dependencies

Install Python 3.10 or newer, then from the repository root run:

powershell
py -m venv .venv
.\.venv\Scripts\Activate.ps1
py -m pip install -r requirements.txt

2. Build the firmware

Install arm-none-eabi-gcc and GNU Make, then run:

powershell
make

The main output is build/m2003-motor.bin. Generate the complete J-Link payload (application, commit manifest, permanent LDROM loader, and read-only CONFIG capture) with:

powershell
powershell -File scripts/build-jlink.ps1

Generation does not contact hardware or change CONFIG. The stable Gen1 ring updater, its recovery evidence, and its completed 14-actuator validation are documented in Ring firmware update. The LDROM loader is now maintenance-only; no further Gen1 loader features are planned.

3. Flash an actuator

Connect the programmer over SWD and run:

powershell
powershell -File scripts/flash-jlink.ps1

For J-Link V9.58 or newer, use the faster native M2003FC1AE flash loader:

powershell
powershell -ExecutionPolicy Bypass -File scripts/flash-jlink.ps1 -NativeFlash

Add -SkipBuild to reuse the generated artifacts, or -GenerateOnly to build them without contacting hardware. Native mode retains the CONFIG preservation, commit-last manifest, and physical verification described below. Omitting -NativeFlash retains the original per-word programming method.

This standard command first records CONFIG0..2, programs and byte-verifies APROM, its manifest, and LDROM, then preserves the existing configuration while selecting LDROM-first boot. It refuses automatic CONFIG changes on a locked or unexpected security configuration. Disconnect motor power while changing wiring or attaching the programmer; a servo actuator can move unexpectedly during bring-up.

4. Start the MIDI player

Connect the interface serial port to a powered actuator ring and run:

powershell
py scripts/ring_midi_server.py -p COM7 --library-dir C:\path\to\midi-library

Open http://localhost:8765/. Enumerate the ring, home the actuators, and assign a MIDI pitch to each slot before playing a file. Use the instrument selector to save and switch named pitch maps and player settings. Profiles are stored locally in instruments.json and are intentionally not committed. An existing mapping.json is imported as the Default profile.

For multiple rings, use one USB adapter per ring (at most 16 actuators each):

powershell
py scripts/ring_midi_server.py --ring jameson=COM29,10 --ring retuned=COM48,10

The player provides a saved-instrument selector for each ring and shared playback controls. See multiple-ring setup for profile persistence and slot routing. The Firmware panel lets you select rings to update and processes them one after another.

For a first hardware check without the browser:

powershell
py scripts/ring_tool.py -p COM7 enumerate
py scripts/ring_tool.py -p COM7 status 0

Run py scripts/ring_tool.py --help for the complete command list.

Documentation

Replication status and safety

The repository does not yet contain enough verified information for a new builder to safely reproduce the complete actuator without assistance. In particular, power-system limits, connector pinouts, a released BOM, mechanical assembly dimensions, and a photographed bring-up procedure still need to be documented. Those gaps are tracked explicitly in Replication status; unknown values are not guessed in the guides.

This project drives a fast moving mechanism at several amps. Use a current- limited supply during bring-up, keep hands and instruments clear of the mallet, provide a physical power disconnect, and test one actuator before assembling a ring.

License

No project-wide license has been selected yet. Until one is added, the source is visible for evaluation but normal open-source reuse permissions have not been granted. A license should be chosen before presenting the repository as a fully replicable open-source project; third-party code under CMSIS/, Library/, and RTT/ retains its own notices and terms.

Parts

7
QtyValueFootprintReferences
2TestPointTestPoint:TestPoint_Pad_D2.0mmTP1, TP2
10.1uFCapacitor_SMD:C_0603_1608MetricC1
110kResistor_SMD:R_0603_1608MetricR1
1CK3866SLMisc:SOIC-16_3.9x9.9mm_P1.27mmU2
1Conn_01x05_PinConnector_JST:JST_PH_B5B-PH-SM4-TB_1x05-1MP_P2.00mm_VerticalJ2
1M2003FC1AEPackage_SO:TSSOP-20_4.4x6.5mm_P0.65mmU1

More from earlynerd/bl4818-servo-M23

1
  • 4 layers46.3 × 37.7 mmInterface, the printed circuit board in 3D

    Interface

    earlynerd/bl4818-servo-M23

    This repository contains the electronics, embedded firmware, host software, and browser players for a network of brushless servo percussion actuators.

    20 parts3

Similar boards

  • 2 layersEncoder, the printed circuit board in 3D

    Encoder

    byrantech/laptop

    anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.

    7 parts4.3kMIT
  • 2 layers40 × 20 mmSensor smd, the printed circuit board in 3D

    Sensor smd

    scottbez1/splitflap

    DIY split-flap display

    7 parts4.2k
  • 2 layers19.8 × 30 mmZ limit, the printed circuit board in 3D

    Z limit

    opulo-inc/lumenpnp

    The LumenPnP is an open source pick and place machine.

    7 parts3.7k
  • 2 layers35.6 × 58.2 mmDisplay Carrier, the printed circuit board in 3D

    Display Carrier

    AxxAxx/AxxSolder

    STM32 Based soldering station for JBC cartridges, 9-24 VDC and USB-PD power

    7 parts1.7kGPL-3.0
  • 2 layers20.3 × 16.3 mmMap MPX, the printed circuit board in 3D

    Map MPX

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    7 parts1.2k
  • 2 layers26 × 44 mmCompact carrier board, the printed circuit board in 3D

    Compact carrier board

    jamro/tiny-engineer

    A small desktop robot that brings an AI coding assistant to life, physically acting out when it reads files, thinks, writes code, and finishes work.

    7 parts1.1k
  • 2 layers26.4 × 53.8 mmAtari pickup, the printed circuit board in 3D

    Atari pickup

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    7 parts1kGPL-3.0
  • 2 layersRj45 breakout, the printed circuit board in 3D

    Rj45 breakout

    rene-dev/stmbl

    AC Servo Driver for STM32F4

    7 parts990GPL-3.0

Questions

How big is the Flexcircuit PCB?

It measures 46.2 × 16.6 mm and has 2 copper layers, 0.29 mm thick.

What parts does the Flexcircuit use?

7 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 Flexcircuit KiCad files?

From the earlynerd/bl4818-servo-M23 repository on GitHub, at the commit this page was made from: the board is pcb/modchip/flexcircuit/flexcircuit.kicad_pcb and its schematic pcb/interface/interface.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Flexcircuit design in my own project?

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