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.
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?
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.
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.
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.
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.
Try posing this question at lynxmotion.com, in the Atom/Pro forum section. This uses Studio, a BASIC from an outfit called BasicMicro(.com), and they do hexapod and bipedal stuff all the time.
Take care.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.