Author
Topic: How to generate the tripod gait ? (Read 3538 times)

This is just a solid works design for my hexapod. Its not yet complete. However i am trying to write the program for this hexapod. Let me first explain this figure:

The fig shows the six legs of the hexapod (named 1-6) with 3 servos in each leg (named 1-3) for each leg. Servo one in each leg rotates about a vertical axis (normal to the ground). Servos 2 & 3 rotate about an axis into the page. To make it clearer, servo 1 moves the leg move either forwards or backwards. Servos 2& 3 move the legs upwards or downwards. This is the way i think the servos should work for a tripod gait.

First lets name Legs 1,4&5------>T1 Legs 2,3&6------>T2

To move forward:1)Initially all legs are on the ground.2)Servo2 of T1 rotates, moving the legs of T1 upward.3)Servo1 of T1 rotates, moving the legs of T1 forward.4)Servo1 of T2 rotates, moving the legs of T2 backward, therefore pushing the body forward.5)Servo2 of T1 rotates, moving the legs of T1 downward.6)Servo2 of T2 rotates, moving the legs of T2 upward.7)Servo1 of T2 rotates, moving the legs of T2 forward.8)Servo1 of T1 rotates, moving the legs of T1 backward (push the body forward).9)Servo2 of T2 rotates, moving the legs of T2 downward.

I am not sure but i think this is the way.

Now, when it comes to programming how can i do that. I need to know first what are the &bank used for (In AVR studio) what are the timers for. What does TIMER1COMPAREA mean.

Can i just do it this way i.e. Servo2 of T1 rotates, moving the legs of T1 upward:

For the theory, I think you can find a lot of info on the WebbotLib's pdf file and/or societyofrobots.com itself, otherwise search for it elsewhere, or wait for someone to explain... but I can help you with the programming... (assuming that you've already started using Webbot Library, and it compiles successfully)

Just copy paste this code (replacing the existing webbitlib code you have)... and read all my //comments and change things accordingly:

}// The loopStart parameter has the current clock value in uSTICK_COUNT appInitSoftware(TICK_COUNT loopStart){return 0;}

TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart){

//now instead of 'values' (currently: 0) you can use variables later on...act_setSpeed{&Leg1_servo_1,0};act_setSpeed{&Leg2_servo_1,0};act_setSpeed{&Leg3_servo_1,0};act_setSpeed{&Leg4_servo_1,0};act_setSpeed{&Leg5_servo_1,0};act_setSpeed{&Leg6_servo_1,0};

Thank you Hasan999, but where do you paste this code. In the hardware.h or program-name.c ? Hasan999, did the program work fine for you, no power issues ? Because I am having a problems with Axon II. Its resetting repeatedly and rapidly. I am not sure if the problem is due to software (program i wrote) or due to hardware. Can you please tell me what can cause resetting of AxonII ?

But seriously, first try the 'default' program to see if it compiles sucessully. If it does, when it is 'ON', does the Axon reset then as well?

If it doesn't, copy paste my program (Im assuming you've already changed the ports according to your connections), and compile, run, and see what happens?, if the Axon resets, try including this code 'before' the actSpeed commands:

So basically, you'll be disconnecting all the servos except for the one is bank1. So now compile again, run, and check if servo: 'Leg1_servo_1' is running. If so, then try removing the disconnect command for more banks and see how many servos work, until Axon resets.

Which battery do you use, 6V? _____mAh? .. and is your robot too heavy?

So basically, you'll be disconnecting all the servos except for the one is bank1. So now compile again, run, and check if servo: 'Leg1_servo_1' is running. If so, then try removing the disconnect command for more banks and see how many servos work, until Axon resets.

Which battery do you use, 6V? _____mAh? .. and is your robot too heavy?

I am using a 6V battery with 2300mAh, i am in the process of building the robot. So, what i am doing is just trying to make the program with all servos connected to axon but no body and legs yet (No load on the servos).

So are you saying that maintaining all servos center position might be drawing a lot of current. How can i solve this problem ? If i cant run all servos at one time, then the robot might not be able to hold its position. After that, when i try to make the robot move forward, many servos will be running at the same time, what to do ?

2300mAh is actually not so good for 18 servos... BUT... that is something that you should worry about later...

If you've not built the robot yet, then the servos have no external torque, and your battery can easily handle all at a time, especially when fully charged.

Later on, when you'd build the robot, you might notice, that due to the weight of the robot the servos get extra torque and the battery can't take it [btw, it still might take it when 'fully' charged]...

But, you can simply buy another battery pack, and attach it in parallel, so that you have 6V and (2300+2300) 3600mAh [good enough]...However, do that only when you've built the robot, and you really require more Power.

The other problem you would face is the Servos that would not hold extremely tight...but if your robot is not heavy enough (let me estimate and guess, up to 2kg) would work !...otherwise, if you can imagine, the legs/arm servos will slip due to weight.

2300mAh is actually not so good for 18 servos... BUT... that is something that you should worry about later...

If you've not built the robot yet, then the servos have no external torque, and your battery can easily handle all at a time, especially when fully charged.

Later on, when you'd build the robot, you might notice, that due to the weight of the robot the servos get extra torque and the battery can't take it [btw, it still might take it when 'fully' charged]...

But, you can simply buy another battery pack, and attach it in parallel, so that you have 6V and (2300+2300) 3600mAh [good enough]...However, do that only when you've built the robot, and you really require more Power.

The other problem you would face is the Servos that would not hold extremely tight...but if your robot is not heavy enough (let me estimate and guess, up to 2kg) would work !...otherwise, if you can imagine, the legs/arm servos will slip due to weight.

Good Luck.

Thanks.

My estimate for the robot weight is about 2.5kg. I'd like to know how heavy is your robot and what are the battery specs that you use. How many servos operate at the same time in your hexapod ?

why do you use &bankX command along with the TIMERYCOMPAREZ ? What are they used for ?

}// The loopStart parameter has the current clock value in uSTICK_COUNT appInitSoftware(TICK_COUNT loopStart){return 0;}

TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart){

//now instead of 'values' (currently: 0) you can use variables later on...act_setSpeed{&Leg1_servo_1,0};act_setSpeed{&Leg2_servo_1,0};act_setSpeed{&Leg3_servo_1,0};act_setSpeed{&Leg4_servo_1,0};act_setSpeed{&Leg5_servo_1,0};act_setSpeed{&Leg6_servo_1,0};

My robot is a 4 legged robot having 5 servos in each leg... it weighs the same, around 2.5kg, and after combining 3 different battery packs, I have a combined power of (1600+1600+1400) = 4600mAh

It can actually hold the load/weight and run all the 21 servos "when is it fully charged" for a few seconds (or minutes) depending on the load etc....

Now again, for the software theories, I am lol... but you can search for PWM Timers and threshold etc, to learn more about these stuff.

However, the return 0; means it will delay 0ms before looping. You are correct, servos need to have 20ms between pulses, but that is already taken care of in 'servo.h' file, that has a SERVO DELAY of 20, that means, THAT loop will keep on looping without delay, but will give signals to each servo once their '20ms' is passed.

Nevertheless, I observe a different case when I use more than 1 servo in 1 bank, as I said, 'servos wont be tight' for you: servos in bank 6 to 12. (again, don't change that, I have put those servos there for a good reason). But, maximum number of 16-bit Timers possible are 12, and that's why you can't add more banks. That is the reason, I have been requesting Webbot to update the library to include the feature to use 8-bit Timers as well - that will solve a lot of problems.