Programming 2 more Joints

How do you use inverse kinematics to accurately sycnhronize/coordinate two or more joints on an arm, any code example will be a great aid to me thank you. The main reason for this questions is that this game make require 2 joints for more accurate movement of game pieces.

1 Like

The answer to this will depend very heavily how these joints are arranged, but for two to three parallel joints (parallel axes of rotation), the inverse kinematics are relatively easily solved. For the sort of setup shown below, \theta_1, \theta_2, and \theta_3 can be determined from the relative position and rotation of the “end effector” with the orange axes. If there are only two joints, the same can be accomplished, but without rotation control.


If this is the sort of mechanism you have, let me know and I can go into details.

This is a very complicated controls problem if you want to make it very smooth, however you can achieve some pretty good stuff if you put a large enough gear ratio each joint and simply run Motion Magic on each joint if you are using falcons. You can calculate how many ticks you need to drive to by calculating the conversion factor between ticks and degrees. Then you can use an inverse kinematics function to solve for the angles. I found a video on YouTube that solves it for a two jointed arm but I don’t have access to the video now to share, sorry

1 Like

this is exactly what the intended design is suppost to be (joints parallel to the rotation axis) except its two joints with some grappler mechanism at the end. and that entire assembly is on a turret.

Fair warning—I’m not very familiar with the current FRC libraries, so my help will probably be limited to the inverse kinematics theory problem. I’ll also assume that your mechanism is built well enough to power itself, hold up under competition, etc. These are not trivial.

That said, since you only have two joints after the turret, you won’t be able to control your mechanism entirely within the plane. You need to decide whether you’d rather have total control over the rotation of the mechanism, or the position. See the figures below, where orange is the positional range of motion, and green is the rotational range of motion.

For applications to this year’s game, I think the former makes more sense, especially since that last degree of freedom can be added by using the drivetrain.

1 Like

Two resources I tossed at my team the other day:

Inverse Kinematics for a 2-Joint Robot Arm Using Geometry | Robot Academy

1 Like

If what you are looking at is a 2 joint arm (shoulder/elbow) then look up inverse kinematics of 2 joint planer robot. There are many videos that explain it. It can be done with just geometry and trig.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.