Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Newbie robot walking

Status
Not open for further replies.

SwingeyP

Member
I have a 6 legged robot I am developing. I am using servos 2dof at the moment. Can anyone tell me why my servos are moving faster in one direction than the other with this simple code?

At present its just moving each leg up and down.
 

Attachments

  • paul.bas
    6.1 KB · Views: 411
Can you post a picture of one of the legs?

Are the servo's lifting a load when they slow down?

**broken link removed**
 
Hi. I have posted a link to facebook I hope thats ok. Its just a lot easier to transfer video from the iphone. The first thing I have realised is that the legs on the left need the routine reversing (Servos are the opposite way around) but I still can't fathom why the speed is so different up and down.

Welcome to Facebook | Facebook
 
Last edited:
Looks like your program isn't forcing the servo to the down position it's just letting the motor float down, the only reason the leg goes down is because gravity is pulling it. You should be sending the servo's position signals every 20ms minimum, most servo's will respond better and provide more torque if you send the position signals every 10-15ms, but not much faster than that or they start to tweak out because of the way the pulse stretchers that create the actual motor pulses work. So called 'digital' servos that are on the market now do just this. They don't use the older style analog pulse stretchers so they have much better control of the motor. overdriving the servos as I described can get you a lot more performance out of standard servos.
 
Last edited:
Ok. Thanks for that. - I have been trying to find the 'sequence' for making the robot walk with little success. The legs are arranged as:

4 1
5 2
6 3

Can anyone help me with a gait sequence please. I juts want to know the sequence like ...

1 up forward down back
2 up forward down back
3 up forward down back

this would obviously not be very good.

Can anyone help please?

Regards - Paul
 
Think of it as two triangles, three legs on the ground at any time. 1 5 and 3 and 4 2 and 6. Lift one set up at a time move it forward/back set it down, then repeat with the other set. That's the simplest gait.
 
I was really trying to get to the ripple gait. This look smuch better with 6 legs.

I can see a sequence in the attached pic. However is the sequence for each leg up, forward, down, back?

for example in the attached pic

(1) L3 up,forward,down,back
(2) R1 up,forward,down,back
(3) L2 up,forward,down,back
(4) R3 up,forward,down,back
(5) L1 up,forward,down,back
(6) R2 up,forward,down,back

This all makes sense but it seems that one leg is always having to drag the others. Is this right?

Regards - Paul
 

Attachments

  • walking gaits.gif
    walking gaits.gif
    4.7 KB · Views: 287
Ok how do I send a pulse to the servo before the previous pulse has completed in pic basic?

start:
ServoOut leg1servo1, 10

ServoOut leg2servo1, 10


I want to send pulses as per the diagram in my previous post.

Regards - Paul
 

Attachments

  • scopepic.gif
    scopepic.gif
    11 KB · Views: 285
Last edited:
You can't, not in picbasic at least. You also can't just send a single position pulse and expect the servo to keep it, the position signals have to be repeated 20 times a second. With 6 servos and sending the pulses in sequence as you have to with the basic code you'll be wasting about 70% of the processing resources of the chip as it will spend the bulk majority of it's time in a delay loop for each pulse. The project you havein mind is above the complexity that is possible using a basic language. You need a multi channel software PWM that is interrupt driven from a timer and more routines for the software phase timing of the position the legs need to be in for a proper walking motion.
 
Last edited:
Thanks for the info. I can't believe how hard it is to find quality information on hexapod gaits. Surely someon eout there has written a ripple gait for the pic microcontroller.
 
hey this is something where I might actually be able to help, being more on the mechanical side than the electronic!
First I should mention that this typically requires more than 6 legs to look like a wave and to be smooth, otherwise it will just look like a shaky version one-tripod-at-a-time approach that Sceadwian described. The more obvious part is that the wave step is achieved like a wave, each leg cycles through the same pattern at an offset from the ones adjacent to it, the pattern loops so that the one at one end is equally out of phase with the one at the other. So if you have 20 legs to a side, you would want each one to be 1/20 further ahead in its step cycle than the one behind it, if you have a whole lot of legs you could also double or triple this cycle up, you just need the phase difference between each leg to be a division of the total number of legs. Here's the key part: the legs on the ground have to move backwards at about the same speed (unless your robot retracts ahead of where it is stepping, like a centipede does by buckling upward at that point, or like a caterpillar does by squishing that part in a little). Only a small portion of the cycle should be a step, most of it should be the relatively slow back push.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top