How to program coordinated leg movement for a 6-legged robot?

I’m building a hexapod robot with an ESP32, MG90S servos, and a PCA9685 servo driver. The chassis is fully assembled, all the mechanical mounting is done, power is stable (6 V UBEC), and every single servo works perfectly when tested individually. Now I’m completely stuck on the software side — getting all 18 servos to move in a coordinated way. I’d really appreciate help with:

  • A clean basic gait (tripod or ripple — whichever is easier to start with)

  • How to properly drive and synchronize all 18 servos through the PCA9685 without jitter or timing issues

  • A minimal but working example that can at least:

    * Put the robot in a stable standing/home position

    * Lift and move the legs in the correct sequence

    * Walk forward smoothly (even slowly is fine)

I can share leg dimensions, servo orientations/mounting directions, photos, or even a short video of the current state if that helps.

2 Likes