Hi All,
I’ve an old EH3R for which I’d like to fabricate a new body/frame and I wondered how hard it would be to adjust the existing code to accommodate some structural changes like;
A reduction in body diameter.
-Is that a simple variable? (he asked hopefully) if so where could I find it?
2)A change in leg geometry to be more like the hexapods of Micromagic Systems with the “ankle” servo normally above the knee servo
-if things were designed such that the location of the floor contact points stay the same in relation to the attachment point on the body or the center of the body, could I simply set the servo centers where they looked good? (within reason)
In the code there are a ton of variables for leg information. Lengths of every part of the leg and some angles too I think. I don’t remember there being anything about body diameter, but I dont think it will matter.
Check out the bas file on the lynxmotion site. It has all the information you want w/ comments.
Its located in the full EH3R tutorial page. Demo and Template programs.
The body diameter should have no effect, other then the possibility of legs running into one another. I know what you mean, I’m making a body to take my 'Bot boards, and the 10.5" diameter of the servo shaft ring circle is HUGE!
Each foot position is moved by its own IK calculation, basically a few “Cosine Law” calculations. They only reference the “Hip H servo center”; there is no mention to the body.
The distances for each foot to be moved are “rotated around” the body, to give them the proper X and Z distances (floor plane). Now if you change the angular positions of the legs relative to the body, THEN you’d have to change this calculation.
“Ankle servo above the knee”? Guess I haven’t seen a detailed “schematic” of a Micromagic leg. I’ll have to look at the pix more closely when I get to my other computer. But I seem to remember a similar looking leg. Hip Horizontal, Hip Vertical, and a KNEE. Do you have a drawing of the leg you’d like to use? I’d be curious to see it. Basically two triangles describe the angles and distance to be moved involved for each leg. The calculations would have to be redone to calculate the new “triangles” correctly.
The angles for the knee and hip vertical servos would be calculated differently (mentioned above), and would fall into a different “range” of servo motion. You’d determine the angular limits (min/max) that each servo could be moved, and enter that into the constant definitions (#defines) of the program. Similarly, the min/max servo positions would be determined and entered. But again, the CALCS are different!
Sorry for the wrong terminology re leg parts. I guess I meant that the knee servo is above the hip servos. What I'm getting at is that I like the more organic looking arrangement where, from the hip, the middle section of leg rises above the body of the bot rather than sticking straight out. If I understand you correctly though, that means that I'll have to go back to school to figure out the math or build a leg and send it to someone who understands :wink:.
Just to make sure I understood what you said;
A) body diameter can be shrunk w/o too much trouble.
B) the legs have separate IK calculations and that these calculations only deal with raising and lowering the individual legs but the horizontal rotation at the hip is not addressed by these calculations, nor is the movement of the legs in concert.
I’ll keep digesting what you’ve said for a while though, I’m just a props guy trying to figure all this out, no engineering or programming background, so I appreciate your collective patience, thanks.
I think you can probably position the body lower, as in the 'bots you mention. That would be “ride height”! Probably even skew the joints a little to accentuate this. Get the Tibia and Femur lengths worked out for the leg you want, it might be that it just “plugs in” to the generated program.
BODY, OK,
Legs, Not quite!
I probably didn’t state that too clearly. The Hip Horizontal comes into the calculations as well; it supplies the forward movement component. You’re moving two leg segments (Tibia and Femur) to “point” the foot at a new position (described by adding a resolved joystick vector) to the current position of the foot. There are 6 different vectors, as each leg points a different direction!
Each “pass” through the body of the code, there is a loop in which the IK for EACH leg is calculated. The IK calcs can be divided into HipH, HipV and Knee.
You can probably just study the code, the calcs are in there! Atom BASIC uses INTEGER calculations the sin/cos/acos trig functions, so there is some scaling going on. Luis and I have spent considerable time on these calculations!
Thanks Alan, I’ve bookmarked that thread to spend some time with, it looks like just what I need.
I’m pretty exited about this rebuild, I just found out my friend has a cnc plasma-cutter in his garage… can you believe that!