Robotics & mechatronics · Research project

SpotMicro.
Pitch and roll
stabilization.

I integrated the robot’s electronics and developed a controller that adjusts all four legs to correct pitch, roll, and combined diagonal tilt.

Hardware-tested leveling proof of concept

SpotMicro's twelve-servo chassis, exposed wiring, and integrated control electronics
01 / Physical hardware12 joints · 4 legs
Controller
Teensy 4.0
Feedback
MPU6050 accelerometer + gyro
Control loop
50 Hz nominal
Current milestone
Pitch + roll leveling

01 / Integration

Make each joint predictable before closing the loop.

The starting point was a Nova SM3-derived quadruped. My work focused on electrical integration, servo calibration, sensor orientation, and developing and testing the leveling controller.

A rewiring change moved two leg groups to different driver channels. I reordered the calibration offsets with the physical servos, then used a sequential movement test to confirm each joint before running coordinated motion.

The robot uses eight 20 kg-class hip/thigh servos, four 35 kg-class knee servos, and separate regulated logic and servo rails from a 3S LiPo. The PCA9685 drives the servos at 60 Hz.

Current channel map

Four groups of three joints.

Rear left
0 · 1 · 2
Rear right
3 · 4 · 5
Front left
6 · 7 · 8
Front right
9 · 10 · 11

Each group follows hip → thigh → knee. Calibration offsets follow the installed servo and horn, rather than the socket number.

Bring-up sequence

Check identity, direction, then response.

  1. InspectCheck power rails, common ground, and wiring with power off.
  2. ExerciseTest channels 0–11 individually: 90° → 102° → 78° → 90°.
  3. CalibrateApply per-servo offsets and confirm mirrored left/right motion.
  4. MeasureVerify the IMU’s axes before enabling pitch and roll correction.

02 / Attitude estimation

Separate tilt from the robot’s own motion.

Accelerometer-only control reacted to vibration and sudden movement. The current controller combines short-term gyro motion with an accelerometer reference, reducing that reference’s influence when the readings disagree.

MPU6050 → Teensy 4.0

Adaptive complementary filter

Installed axes:
+X rear · +Y right · +Z up

  1. 01

    Calibrate at rest

    Average 250 samples after entering the stance. Record pitch/roll targets and gyro biases, including the mounting offset.

  2. 02

    Predict with the gyro

    Integrate angular rate using the measured time between control updates.

  3. 03

    Check accelerometer trust

    Compare acceleration magnitude with gravity and compare the accelerometer angles with the gyro prediction.

  4. 04

    Correct the estimate

    Blend the filtered accelerometer reference with a nominal weight of 0.035 × trust. Filter the resulting control error.

Implementation: estimation and controller architecture ↗

03 / Four-leg control

Two axis commands.
Four coordinated corrections.

Pitch and roll each use proportional correction plus gyro-rate feedback. A four-corner mixer combines them, then scales the corrections together when a diagonal would exceed the available travel.

When one side of the board rises, the robot shortens the legs on that side and extends the opposite legs. Enable JavaScript to try the interactive illustration.

Axis feedback

PD correction

Pitch: Kp 2.2 · Kd 0.06
Roll: Kp 1.8 · Kd 0.06

Deadbands reduce small corrections: 0.40° for angle error and 1.20°/s for angular rate.

Geometry

Mirrored joints

Rear: +pitch ± roll
Front: −pitch ± roll

Left thighs/knees use 90° + c / 90° − c; right joints mirror those signs. Hips hold their calibrated center.

Motion bounds

Limit and smooth

25° base compression · ±20° correction
60°/s maximum correction slew rate

Apply channel offsets, constrain joint commands, and retain fractional angles until pulse conversion.

Read the current v3 controller

04 / Physical testing

What worked, and where it stopped.

Physical tests demonstrated correction in pitch, roll, and combined diagonal tilt, with recovery as the support surface returned toward level.

Demonstrated

Two-axis leveling

  • Pitch correction in both directions
  • Roll correction in both directions
  • Combined diagonal correction
  • Recovery toward the calibrated stance

These are qualitative hardware observations. Angle/frequency logs, repetition counts, and measured settling times are not yet available.

Observed limitation

High-frequency shaking

During a progressively faster table-shaking test, the robot overreacted and tipped over even though the tilt amplitude was modest.

The controller reduces accelerometer trust during disturbances, but it does not yet recognize sustained vibration or latch a fall state. A safe disturbance-frequency limit has not been measured.

35° is a software threshold, not a demonstrated incline capability.

Above that deviation from the startup target, desired corrections return toward the base crouch with slew limiting. Servos remain powered, and correction can resume when the estimate returns within the threshold.

Development archive

The earlier pitch-control test.

This recording documents the original v1 pitch milestone. The current v3 controller adds roll, diagonal mixing, and adaptive fusion; a matching v3 recording is not yet in the repository.

Read the test record
Archive / v1 pitch-only controller. Not a recording of v3.

05 / Next development

From body leveling to controlled foot placement.

The next stage is to measure the leg geometry, establish single-leg inverse kinematics, and build a slow crawl gait. Quantitative disturbance logging and explicit vibration/fall handling are also needed.

This work uses a Nova SM3-derived platform. My contribution covers electromechanical integration, calibration, control development, and physical testing; the mechanical platform and upstream reference firmware are credited in the repository.

Hencken burner thermal analysis

Next project