This hexapod class is to use with ESP32 dev kit in Arduino framework.
The frame is from 3D printed parts, and the actuators are just RC servo as Futaba A700 and DS3225.
Coordinate frame O is placed on the center body where
The kinematics and foot motion will be thought on leg 1 or leg i frame, and then other legs could get the result by applying the homogenous transformation according to each leg's frame.
Let's see just a single leg kinematics first.
Here we look only just leg i, the coordinate frame of each joint is shown. The joint coordinate frame needs to be place carefully otherwise the DH-parameters would be incorrect. The coxa link has link lenght as
The way to fill up DH-parameters on the table is refered to the text book from ROBOT ANALYSIS The Mechanics of Serial and Parallel Manipulators from LUNG-WEN TSAI.
Then we can create transformation matrices of
For example, when all of
The last column of
I am using analytical method to solve inverse kinematics. The diagram below is showing a posture where
In order to make the hexapod walk, we're using only tripple gait pattern (most common), where three legs are on ground and other three legs are lifting up.
So the foot motion is divided to two phases as stance (line) and swing (curve) phases.
We can think about this as on
In this case, the stance phase is defined by parameter
These points we got are in Y-Z plane, so depends on how far the leg should be strecth, we decide the X data point according to that.
To apply these point to other leg frame, we could think these points are firstly in O-frame (body static frame),
then we can apply a transformation to each leg depends on the rotation and offset distance of each leg frame. In case of robot would be walking forward (
If we rotate these points around itself, then we can have a crab-walking motion where the robot could walk along any direction.
To make the robot turning in-place, we can make up a simple rule of leg motion as following, then leg i, leg k, and leg m would have the same motion, and leg j, leg l, and leg n would have the same motion.
To make the robot walking like car steering, we could imagine the robot is turning with the radius of
Let's keep the leg i path as a guide line, so the stance phase will now not only just a straight line but an arc of circular path. The arc angle is
The microcontroller is ESP32 Dev kit C type. The servo drive is Adafruit 12-channels PWM driver, and we use two of that. To control the robot wirelessly, I am using Futaba radio controller, so on the receiver side we need to parse SBUS data which comes from UART2 port. And the BNO055 IMU for self leveling function.
The servo on joint 1, I used Futaba A700 because I already have a bunch of this servo from other project, so I reuse that. For joint 2 and 3, I use DS3225 a cheap 20kg.cm servo. The servo angle and kinematics angles are different in each joint and each servo, so the table below is showing the correc mapping value of PWM value, servo angle (in degrees) and joint kinematics angle (in degrees).
To operate the robot, the radio channels on Futaba Tx are assigned.