I am going to build an Arduino Quadruped Robot. As usual, I will share my source code and show as many pictures as possible, to help those of you who are also building Quadruped robots. The way I do things might not be the best ways, and I am sure you can come up with better solutions, please let me know if you do!
This robot is actually the first robot I wanted to build, but I failed miserably. you can check this out and this. After building a working Arduino Hexapod robot, I feel confident that I can pull it off this time! I recycled the parts from the arduino hexapod robot, and build a body with styrene sheets, so there is no new parts.
I made an excel spreadsheet to simulate the movements of a quadruped robot. It shows detailed inverse kinematics calculations, and it might help those who are having problem understanding IK to visualize the complex computations, also it’s a great help to debug your code.
Basically copied most of the codes from my last Hexapod robot. All I did was to remove the variables related to the middle legs, and modifed the preset variable values to work in the Quadruped Robot, and it actually worked!
But the movements are quite Awkward, a lot of work need to be done about Inverse Kinamatics.
Quadruped Robot Leg Calibration (Servo Angle Offsets) – Update 03/04/2013
I just didn’t like the body, i thought it was too big! So I spent an evening re-measured, and cut it down from 16cm to 12cm (leg to leg distance).
I have also created a very simple Servo Offset calibration program.
As you might know, due to the fact that no servo is perfect, they might tilt to the right a little more than the left, or the other way round. (It could be also caused by the servo brackets) You might want to give it an offset to correct this. It’s very handy when you have a lot of servos like Hexapod/Quadruped Robts have.
Circled steps are the leg-lifting steps, and the gait cycle starts at step one where leg starts to be lifted.
I copied most of the code on how to generate gait sequence from my previous hexapod robot, you can check out the source code. Here is the source code for the gait I have written:
Before we start, we call this function to initialize the variables for the Gait:
1
voidGaitSelect (){
2
3
//begining of the step cycle for each leg (with reference to the first leg)
4
GaitLegNr[LR] = 1;
5
GaitLegNr[LF] = 6;
6
GaitLegNr[RR] = 11;
7
GaitLegNr[RF] = 16;
8
9
NrLiftedPos = 5; // number of steps that the leg is in the air
10
TLDivFactor = 15; // number of steps that the leg is on the ground
11
StepsInGait = 20; // total steps
12
}
For a complete Gait cycle (e.g. from step 1 to step 20), we will go through loop() function 20 times, each time we call GaitCalculate(), and then increment ‘GaitStep’ variable.
1
coor GaitCalculate (){
2
//Calculate Gait positions
3
4
for(intLegIndex = 0; LegIndex < 4; LegIndex++){
5
6
if(GaitStep == GaitLegNr[LegIndex]) {
7
GaitPos[LegIndex].Y = -LegLiftHeight/2;
8
}
9
elseif(GaitStep == GaitLegNr[LegIndex]+1) {
10
GaitPos[LegIndex].Z = 0;
11
GaitPos[LegIndex].Y = -LegLiftHeight;
12
}
13
elseif(GaitStep == GaitLegNr[LegIndex]+2) {
14
GaitPos[LegIndex].Z = WalkLength/2;
15
GaitPos[LegIndex].Y = -LegLiftHeight/2;
16
}
17
elseif(GaitStep == GaitLegNr[LegIndex]+3) {
18
GaitPos[LegIndex].Y = 0;
19
}
20
else{
21
// move body forward
22
GaitPos[LegIndex].Z -= WalkLength/TLDivFactor;
23
24
}
25
26
}
27
28
//Advance to the next step
29
if(++GaitStep > StepsInGait)
30
GaitStep = 1;
31
32
}
This is by no mean the best implementation, but it might give you an idea how to start doing gaits if you still have no clue.
I will keep working on Gait, make it more stable, faster, smoother and maybe come up with some more gait style as well, before I publish my full working code.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.