The math for determining the desired angle is the same. Stepper motor, unlike servos, don't know a position, but are good at determining distance traveled. To use stepper motors, you have to keep track of its position. This often includes an alignment procedure, often using an end stop switch. Once you know the angle of your stepper motor, you can apply the angle from the inverse kinematics equation.
Hi, I tried applying the formulas to my quadruped robot setup using my robot's limb lengths but the values for the angles I get from the formulas seem to be off. I suspect it has to do with each servo's orientation and offset from center as well as where the origin point is considered to be for each leg. Are you using any specific origin, orientation for your mini? My robot's body is using MG90s servos, so not the most reliable ones, but they do work well enough if I use them in a forward kinematics scenario I developed. Now that I'm trying to make it more configurable and basically parametrized, i.e. specify the height at which the legs to go and keep it like so during the walk cycle, the IK approach seems to be the way to go as I my current forward kinematics is a interpolation between known stances, which are supposed to be stable positions defined by sets of servo angles, 12 for each "frame". I'd like to reach a position where specifying a variable value for the Y or X axis will move both femur and tibia servos accordingly, I'm not yet aiming for hip servo adjustment as I want to get it working in the XY plane first.
The origin point that I use is the shoulder joint where it connects to the chassis. This is convenient as it allows all legs to use the same equation. These equations will just calculate the angle of the for the joints. Depending on how you mounted your servos, you may need to apply and offset angle or invert the angle to match rotation direction of your servo. Hope this helps. I may need to do a more complete video in the future that includes using an origin from the center of mass and how to apply the equations angles to your servos.
@@AdvancedHobbyLab thanks for the response. I think we're using the same origin system, I had to offset and change direction for some of the servos in my robot's legs as the servos are mounted to fit the 3d-printed legs, which btw are those of the OpenCat project I found and which of course does not quite work for my servos; apparently MG90S servos made and sold in factories in Shenzhen aren't the same as MG90S servos made and sold by factories in Honk Kong. But anyways, I digress :) . So after some guesstimating the offset and orientation of various servos I got the legs to move along both the X and Y axis based on input value but I noticed that there is a rather limited range for each of the axis that I can specify, I was expecting that, but still it seems that the full 0 to 180 deg for the servo does not quite cover the fully extent or retracted position of the leg, especially on the tibia or the foot end of the leg which seems to stop at one of the ends of the range (either 0 or 180 deg) without becoming fully aligned with the femur, the next up section. It could be that the "center" set to the middle of the servo's range, e.g. 90 deg, isn't such a good choice but without encoders to properly know where the servo is relative to the joints, it will have to do.
@@AdvancedHobbyLab Hey, I think that's okay from what I've seen so far. I'll take a closer look later. I just have 1 question, what do you mean by "keyframe" what does that mean? And how did you determine the shoulder offset? Do you have any others social? Can i send you my concept of robot dog? Otherwise, great job, thank you so much.
I use keyframe animation to animate the walking cycle. Each keyframe defines the x, y, z position of the foot. In my work, I don't use a shoulder offset. The x, y, z position of the feet are relative to their own shoulder. You can connect with me on facebook: facebook.com/profile.php?id=61552517657914. I'd love to see what your working on.
Thank you for watching! I don't plan to share any code yet. This video just discusses the inverse kinematics math. I'm working on a video to discuss the walking gait algorithm and how to apply the inverse kinematic equations which might be more helpful if you're working on your own SpotMicro build.
@@AdvancedHobbyLab the only thing holding me back from programming my spot micro, is that i don't know how to translate all this inverse kinematics stuff into arduino code. I have my spot ready for 4 years now. But no-one will share their code. I know how to implement walking gaits (since i have experience with that). So all i need is the code with the IK where i can input the foot positions. Nothing more.
I hope I can help. I do have plans to post the code, I just need to clean it up first. However, my code was written for Raspberry Pi in Python and will need to be translated for arduino. I hope that won't be too difficult.
Thank you for your interest. I'm a little hesitant to share my code as I think you get more out of the video by coding it yourself. If you have any questions about the math, let me know and I'll try to help.
@@AdvancedHobbyLab How do you enter the xyz inputs in your demo for example to move the leg up and down or forward backward? And then for the leg step? Thank you
For these demos, the xyz values where hard coded values that I iterated between in a for loop. The trick to achieving smooth transitions and controlling the speed between two foot locations is with interpolation. You have to divide the path between two points into smaller segments and use the inverse kinematic equations to calculate the servo angles for each segment. I'm working on another video about walking gaits. I hope that will help explain this topic.
@@AdvancedHobbyLaband what are the xyz coordinates values for the demos? I want to try exactly the same values, be able to i could compare your movement and my movement
I found small step sizes where the most stable. I only moved the feet 20mm off the ground and a maximum of 20mm on the x axis for forward movement. Quick steps also helps with balance. It takes a step about 2 to 3 times a second.