A two-wheeled robot that balances by itself, built to learn how a Segway or a hoverboard works. It is designed to stand up from its stand, hold its place when pushed and drive over Wi-Fi, with a Windows app that tunes it, simulates it and carries the theory course.
In development
Level: Intermediate
Version: 0.1.0
Design v0.1.0: simulated and checked in CAD; the first unit is not built yet
TW-01 two-wheeled balancing robot with white armor and yellow mech livery
The experience
Run BalanceStudio in SIMULATOR mode first: the robot stands up from its stand, you drive it with WASD, push it, switch PID ↔ LQR and move the battery, all on a copy of the robot's own control code. Then print the frame, the wheels with TPU tyres and the armor plates, mount two NEMA 17 steppers back to back and stack the M5Stack CoreS3 on its driver. Press START and the robot is designed to lift itself off its ±15° stand, balance at 400 Hz and hold its position when pushed; join its Wi-Fi access point and drive it from the keyboard, a joystick or a gamepad. Every gain is live, the charts show each controller term, and the LEARN tab holds the ten-chapter course, offline.
What makes it special
Stands up by itself
It rests at ±15° on a front or back stand. On START a burst under the lean lifts it, then the balance controller takes over.
Two controllers, live
A cascaded PID (position, speed, tilt) and an LQR state feedback, switchable on the fly. The default PID gains are the LQR law in cascade form.
PC-free control loop
The 400 Hz loop runs on the CoreS3. Wi-Fi carries references, parameters and telemetry; if the link drops, the robot stops and holds its position.
Simulator with real code
BalanceStudio simulates the nonlinear robot, with stands, falls and IMU noise, on a line-by-line copy of the robot's C++ control code.
Move the battery
The battery drawer has three heights. The centre of mass moves, yet the unstable pole barely does (5.97 → 5.93 rad/s, CAD model). Find out why.
Course inside the app
The LEARN tab renders the ten theory chapters and the guides with equations and diagrams, offline.
What you will learn
Modelling the robot with Lagrange
IMU sensing and the complementary filter
PID on the tilt loop, anti-windup, delay and noise
Cascade control and lean back to brake
State space, LQR and choosing Q and R
Stepper drive: microstepping, torque and step loss
Differential drive, steering and odometry
Wireless telemetry and how a hoverboard does it
Three ways to get it
Be the first to build the Two-Wheeled Robot
This kit is still in development. Leave your contact and we will write to you when it is released.
DIY: files and software
The whole build is yours: print the parts, buy the components, build the electronics and assemble the machine.
You do
Print, source the components, build the boards, assemble
Print files of every part (STL, STEP and 3MF)
Electronics design: wiring, schematics and the list of components
Firmware and software, including the app when the kit has one
Price on request: it depends on the option. In the DIY option the filament, the electronics and the hardware are yours to source (this page lists them); in the kit option, only the filament.
Included with every option
The files, the manual and the software come with every option, the ready-to-use machine too.
Print files
STL files for every printed part, TPU tyres included
Two-colour 3MF armor plates with the yellow mech livery
STEP files of the assembly and of each part
Firmware for the M5Stack CoreS3
Assembly manual
Build guide with every part, fastener and step
Bill of materials and wiring diagram
Tuning guide and lab experiments
Drive study: why steppers move the wheels
Safety notes and first power-up checklist
App
BalanceStudio Windows
Finds the robot over Wi-Fi and drives it with the keyboard, an on-screen joystick or a gamepad
Live charts of tilt, speed, position, command and controller terms
Parameter editor and LQR designer with the battery position
Simulator running a copy of the robot's control code