Robotics portfolioHexapod · 3D simulation · Robot joint · RC plane

Rhett Brewer

I’m 16, and I design, build, and program robots.

Portrait of Rhett Brewer, smiling, in a grey T-shirt.
Drawn by
R. Brewer
Subject
Robots I design, build, and program
Sheets
8
My hexapod from above on a wooden floor: six 3D-printed legs in white, black and blue, servo wires along each leg, and an Android phone mounted in the middle.

About

Rhett Brewer

I’m a 16-year-old student and robotics engineer at Alpha School in Austin, Texas. I build robots from start to finish: I design them in CAD, build them, wire the electronics, program them and train them with reinforcement learning.

Chapter 1: Hexapod

Six legs and a phone for a brain.

I posted it on Reddit.

28 s · loops

On grass, self-balancing.

What’s on it

The hexapod from above on a wooden floor, with four parts labelled: 1, the Android phone in the middle; 2, a servo on a leg; 3, the battery's red power lead; 4, the buck converter, the small screen just below the phone.
From above. Press a number, or a part in the list, to see what it does.
  1. 1Android phone

    The brain. It runs my app and sends every servo command, and I use its gyro for self-balancing. There’s no Raspberry Pi.

  2. 2Servo

    One per joint, three per leg. The femur servos carry the most load, so they are 35 kg; the rest are 25 kg.

  3. 3Battery

    An 11.4 V LiPo that powers the whole robot.

  4. 4Buck converter

    Steps the battery’s voltage down to what the electronics need.

Specification
Servos1812 × 25 kg, 6 × 35 kg
Servo controllerPololu Maestro24 channels
Costunder $500Whole robot; my target was $500
Time to buildabout a yearMostly 3D printed, from an Aecert Robotics design I modified
Drawing
HX-100
Subject
Hexapod
Status
Walking

Build log

  1. On the desk.

    First legs

    The first few legs moving.

  2. On a tether cable.

    First steps

    First steps! It was still wired, and the walking gaits weren’t perfect yet.

  3. On a patio.

    Remote control

    I added remote control, fixed the inverse kinematics and added smoothing, so it starts with small steps and gradually increases its speed and step length.

  4. Frame from the grass video: the hexapod walking toward the camera across a sunny lawn.
    The video is at the top of this chapter.

    Self-balancing

    The latest version. I added self-balancing with full-body rotation.

TOP VIEW · TRIPOD PHONE L1 L2 L3 R1 R2 R3 FRONT LEG TIMING · TRIPOD TEXTBOOK TIMING L1 L2 L3 R1 R2 R3 1 CYCLE FOOT DOWN FOOT UP SERVO SUPPORT POLYGON
Visual gait patterns: tripod, ripple and wave.

How it walks

I wrote the code that makes it walk. It picks a spot for each foot, and inverse kinematics works out the angles for that leg’s three servos.

Five gaits run on top of it:

  1. Tripod
  2. Ripple
  3. Wave
  4. Triple
  5. Spidercustom, spider-style
Drive it in your browser The 3D sim from my old site. It runs my controller’s leg geometry, inverse kinematics and four of the gaits, in the browser only, with no robot connection.

Chapter 2: 3D simulation

My own robot training app, built on MuJoCo.

My simulator maps a building with SLAM, no GPS: the robot draws the map and works out where it is on it at the same time. The map on the left fills in as the robot explores the building on the right.

Drawing
SM-200
Subject
3D simulation
Status
Beta

Mapping a building

Mapping a building in my simulator, sped up 6×. Green is where the robot thinks it is, orange is the truth. The robot dog is a downloaded model.

Training your robot

You upload a robot’s CAD model, and four steps later you get a trained policy. A policy is the learned controller that decides how the robot moves.

Its look is Blender-inspired. Underneath it’s MuJoCo, a Python backend and a React and three.js front end.

YOUR CAD 01 BUILD UPLOAD CAD AI RIGGING WIZARD: JOINTS, MASSES, MATERIALS SERVO MODELS 02 MOVEMENT VISUAL REWARD DESIGNER GAIT TRAINING: TERRAIN CURRICULA, PUSH RECOVERY 03 NAVIGATION & MAPPING SIMULATED CAMERAS, DEPTH AND LIDAR SLAM WITHOUT GPS NAVIGATION MULTI-ROBOT EXPLORATION WITH MAP MERGING 04 TEST BEST TRAINED ROBOT STRESS TEST UPLOAD TO YOUR REAL ROBOT TRAINED POLICY YOUR CAD 01 BUILD UPLOAD CAD AI RIGGING WIZARD: JOINTS, MASSES, MATERIALS SERVO MODELS 02 MOVEMENT VISUAL REWARD DESIGNER GAIT TRAINING: TERRAIN CURRICULA, PUSH RECOVERY 03 NAVIGATION & MAPPING SIMULATED CAMERAS, DEPTH AND LIDAR SLAM WITHOUT GPS NAVIGATION MULTI-ROBOT EXPLORATION WITH MAP MERGING 04 TEST BEST TRAINED ROBOT STRESS TEST UPLOAD TO YOUR REAL ROBOT TRAINED POLICY
The four steps, in order. In Test you see the best version of your trained robot, stress-test it, and then upload it to your real robot.

Learning from cameras

I want a simulated arm to do each task using only its cameras, because a real robot has to find objects with its cameras too.

Results so far, all in sim
TaskTargetResultTrials
Pick and place Camera student70%100%~25
Push Camera student70%81%~25
Sort by color Teacher—95.8%[TRIALS]
Tasks it trains on
  • Reach
  • Pick and place (result in the table)
  • Push (result in the table)
  • Stack
  • Sort by color (result in the table)
  • Open a drawer
Randomized in training
  • Object size
  • Color
  • Position
  • Lighting
  • Camera noise

Tasks in yellow have a result in the table. Reach, stack and the drawer don’t have results yet.

SIM KNOWS WHERE EVERYTHING IS EXACT OBJECT POSITIONS TEACHER POLICY SUCCESSFUL ATTEMPTS BECOME TRAINING EXAMPLES CAMERAS WRIST OVERHEAD STUDENT POLICY CAMERA-ONLY SCHEMATIC · 6-JOINT HOBBY ARM, SO-100/101 CLASS, IN SIM
Teacher and student. Both train in the simulator, and the cameras are simulated too.

The simulator knows exactly where every object is. So I give those positions to a teacher policy, and it learns a task fast. Its successful attempts become training examples for a student policy that only gets the wrist and overhead camera images, the kind of view a real robot would have.

Training a two-armed robot

0:00 / 2:11
OpenArm 2.0 in my simulator. Each task took about 2–3 hours of training. One run, seen from the scene and from the robot’s head and wrist cameras, all four in sync. Press a small view to make it big.

Chapter 3: Robot joint

The shoulder of a cable-driven 6-axis arm I designed for accuracy. Only the shoulder is built so far.

The goal is an arm that goes back to the same spot within 0.5 mm, every time. The budget is about $2,500, mostly printed parts.

Drawing
RJ-300
Subject
Shoulder joint
Rev
C
Exploded CAD view of the cable-driven actuator module: a mounting frame lifted off above, two small blocks beside it, and the assembled housings below with a large curved part on the right.
3D model of the joint.

How the joint is geared

The Mini CIM motor spins fast but with little torque. Three stages slow it down and turn that speed into torque, and each kind of reducer has its own upsides and downsides. A 4:1 belt comes first because belts are fine at high speed, and it moves the turning axis away from the motor. Next is a 16:1 planetary gearbox, a big reduction in a small space. Last is an 8:1 capstan, a rope drive with almost no backlash (the little bit of play between parts).

Schematic
  1. A Mini CIM: fast, low torque
  2. B Belt 4:1: good at high speed, moves the axis away from the motor
  3. C Planetary 16:1: a big reduction in a small space
  4. D Dyneema capstan 8:1: 135 mm sector, 2 mm rope, almost no backlash. The output. The motion goes through a rope, not gears. The rope is pulled tight both ways and never goes slack, so when the drum turns back, the sector turns back right away. It’s Dyneema DM20, which has almost no creep (it doesn’t slowly stretch under load).
The shoulder drive, each stage end on, motor to joint. The gears are simplified and the speeds aren’t to scale. Show backlash zooms into the planetary and exaggerates the gap between its teeth. How the capstan works shows why the rope drive has almost no backlash, and the Dyneema DM20 rope it uses.

Joint testing

Repeatability is how close the arm gets back to the same spot every time it returns. My target is 0.5 mm; the shoulder measured ±0.22 mm.

Repeatability test with a dial indicator under the arm, sped up. The clip’s label reads 2x, then 5x, then 10x. I posted it on Reddit.
Results
TestResult
Repeatability±0.22 mm PassTarget 0.5 mm. Dial indicator, 20 trials. See the test on Reddit.
Shoulder lift10 lb at 16 in5 lb at 8 in
Cost to buildUnder $200

Chapter 4: RC plane

One of my very first projects. I built it in 7th grade, and it's what got me to keep building. It flew in October 2023.

Built
7th grade
Subject
RC airplane
Flown
Oct 2023

9 s · loops

Taking off, October 2023.
An earlier prototype of the plane on a wood floor: a black foam-board main wing over a box fuselage, with two thin wooden sticks running back to a black tail.
An earlier prototype.

Skills

Mechanical
What I can do: I can design and model parts in CAD, from single parts to whole robots.
Where I learned itHexapod, page Robot joint, page
More: Mechanical

I 3D print most of what I design. My hexapod’s frame is mostly printed parts.

Electronics
What I can do: I can do the electronics for my robots: wiring, motor drivers, sensors and power.
Where I learned itRobot joint, page
More: Electronics

The robot joint runs on an ESP32 with a BTS7960 motor driver, an AS5600 encoder on the joint and an ACS758 current sensor for its torque limit.

Controls
What I can do: I can write inverse kinematics code, gyro-adaptive balance, and the control software that runs my robots.
Where I learned itHexapod, page Robot joint, page
More: Controls

I wrote the robot joint’s closed-loop position control and current limit, and my hexapod’s five gaits.

Robot learning
What I can do: I can train robots with reinforcement learning in my own MuJoCo simulator, and train camera-based policies for harder tasks in changing environments.
Where I learned it3D simulation, page
More: Robot learning

In my simulator, an arm that knows where everything is learns a task first. Its successful attempts then train an arm that only uses cameras.

Perception
What I can do: I can give robots simulated cameras, depth and lidar in my simulator, and map a building with SLAM.
Where I learned it3D simulation, page
More: Perception

The camera arms work from a wrist camera and an overhead camera.

Software
What I can do: I can write the software around my robots: Python backends, React and three.js front ends, and Android apps.
Where I learned itHexapod, page 3D simulation, page
More: Software

Python runs my simulator’s backend and React and three.js its front end. My web sim of the hexapod is three.js, and my own Android app runs the real one.

End of the book

Contact

Name
Rhett Brewer
Elsewhere
GitHub
Reddit