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.
Robotics & mechatronics · Research project
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

01 / Integration
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.
Each group follows hip → thigh → knee. Calibration offsets follow the installed servo and horn, rather than the socket number.
02 / Attitude estimation
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.
Installed axes:
+X rear · +Y right · +Z up
Average 250 samples after entering the stance. Record pitch/roll targets and gyro biases, including the mounting offset.
Integrate angular rate using the measured time between control updates.
Compare acceleration magnitude with gravity and compare the accelerometer angles with the gyro prediction.
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
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.
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.
Rear: +pitch ± roll
Front: −pitch ± roll
Left thighs/knees use 90° + c / 90° − c; right joints mirror those signs. Hips hold their calibrated center.
25° base compression · ±20° correction
60°/s maximum correction slew rate
Apply channel offsets, constrain joint commands, and retain fractional angles until pulse conversion.
04 / Physical testing
Physical tests demonstrated correction in pitch, roll, and combined diagonal tilt, with recovery as the support surface returned toward level.
These are qualitative hardware observations. Angle/frequency logs, repetition counts, and measured settling times are not yet available.
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.
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.
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 record05 / Next development
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.