Im using the Arduino IDE off OSX Lion, my microcontroller is a Arduino Mega2560.
Kit is essentially the AH3-R with a tiny body, servos however are HS485HB.
I’ve got my construction, and circuitry down, guys!
But unfortunately…
Well before, it was my power supply. Thats all good now, except for an unfortunate measuring problem (My LiPo is a couple of millimeters too big to fit properly in my tiny body).
Anyway, on to CODE!
Im stuck.
Earlier I said I had my programming done. Ehhh… No. I am an idiot.
First off, im not using an ssc-32 or something. Im running the thing off of an Arduino Mega(R2).
I could write it out piece by piece, but… It would be horribly inefficient and long and ugly. And stupid.
I’ve heard about Inverse Kinematics, researched it a bit, and am thoroughly baffled as to how I am supposed to use the arduino’s servo library to control 18 servos using this technique. I got it up and running on Processing, but thats just drawing lines.
So!
How do I make the damn thing to walk? I just need help figuring out how to make legs move in a tripod movement. Omni-Directional would be nice, but at this point I just want help making it move forward in a tripod gait.
Soo… code or help coding please?
Thanks all, and Happy New Year!
The Mad Hatter only has 13 digital pins (2 used up for USB) and 6 analog pin, so there are not enough IO pins to do a 3dof Hex… As for horsepower it has the same chip in it as the Arc32, so could be done.
Chipkit Max32 - I believe could easily do it. Using the SoftPWMServo library, which hooks off of the main system timer. If you look at the readme as part of this library:
IK has been nearly abandoned (I might choose to do it pc side), working off of servo pulses generated by the Mega. So far its a lot of little for loops that are switched by case and given values generated by mouse being dragged across screen. Still in progress, but is this too inefficient?
If you write the servo values in a set of tables for the gait cycles, then you can “step through” the tables to command the servos as you move. The servos would be updated by a timer-driven interrupt. I’ve don this for a 4-servo “Loki” walker (up to 8 servos), it’s a little more work to do 18 servos!
Again, if you had 18-servo interrupt support code, you could almost “drop it into” some of the existing code using IK.
Is there some reason you don’t want to just use the SSC-32? It’s well worth the cost for a project like this. I used one when I wrote my own C code for an 18F4620 PIC. and homemade body.
Oh, I would love to use the ssc32, however this is a project for school and my teacher and I wanted to do without a servo controller. Very unfortunate decision, but It seems that it is teaching me a lot!
Seeing as I had to personally buy the parts for the class… I’d like to continue using 3DOF. Anyway, ran into a new problem. all servos approach mid at once… which isn’t what I tell them to do. Ideas?
anyway in the setup, i run a couple of for loops that tell the servos to attach to pins and then to tell which set of servos to move to middle point of 1500ms. Problem is, instead of moving only the six servos attached directly to the body first, it moves all 18 at once. Ithis was done using two for loops to tell which servos to move. tried w/o the loops, basically wrote out every command for each of 18 servos and had the same problem. delay() does not work, is this a hardware problem?
As Robot Dude mentioned, it is hard to know how to help here without seeing some additional information. I have posted code up in the forum for a few different Arduino based robots. As mentioned in a previous post I have ported the Phoenix code to the Arduino using an SSC-32. I have also ported some biped Brat code to Arduino, which used the Arduino to drive the servos (viewtopic.php?f=48&t=7590&p=77519#p77519). In this thread, I had a modified version of the Servo library that did group moves or timed moves. I have used it for a 6 servo Brat, but have not tried out the servo library for 18 servos, so not sure how well it will work or not.
It is not difficult to convert the phoenix code to drive the servos. Have done that on a couple of different platforms. There are just a few functions that need to be updated to make it work, the main ones are: UpdateServoDriver, CommitServoDriver, FreeServos.
There are issues involved, like is there enough performance to drive the servos and to do the IK calculations…
If you use SoftwareSerial library, it disables interrupts while it inputs our outputs a character which will cause the servos to not be very steady, so you need to avoid this…
But again it is difficult to help more as we have very little to go on.