Inverse Kinematics with Closed Loop Parallelogram

Typically: "How do I... ", "How can I... " questions
p3jawors
Posts: 17
Joined: 14 Dec 2015, 18:22

Inverse Kinematics with Closed Loop Parallelogram

Post by p3jawors »

*TLDR at bottom*

Hello, I have read through the few posts about closing loops for structures along with any tutorials and still cannot get my inverse kinematics simulation to run. I am trying to simulate a robotic arm in a parallelogram configuration (picture below) and am running into two problems. The first is that the loop does not close or lags behind due to the tip-target relation, and the second is that as the arm tries to follow the dummy target, sometimes it flails around as it tries to find a solution.

There are two versions that I tried to run the simulation on. The first is a more realistic representation of the arm with more complicated shapes and 3DOF (one on the vertical arm segment and one for the horizontal segment, the third being rotational around the base).

Realistic Model
Image

The realistic form follows the target, but the problem is that the parallelogram is not really closed as it just follows the closed loop as a tip-target relation. With the GSC overlap constraint selected it does not follow at all, simply the top portion of the arm moves. The arm also tends to jump around everywhere until it finds a solution that fits (The arm is NOT redundant). I have tried using non-damped, damped, and a combination of the two for the IK groups. Although this did help somewhat, it would be preferable to avoid the flailing all together.

The second version I tried was a simplified form using simpler shapes, and removing the third DOF (rotation about the base). I also removed one of the constraints in this version to make sure I did not over-constrain the model. This version still flails around as it tries to follow the target, and the loop does not close properly (the linked dummies for closing the loop are overlapped prior to running the simulation).

Simplified Model
Image

Simplified Model Broken Loop Simulation
Image

I have tried using a dummy-dummy links, along with the method of linking a spherical joint with a revolute joint mentioned in viewtopic.php?f=9&t=2979 with no luck.

I have also attached images of the scene hierarchy for both models as well. It might be worth noting that the tip-target following works a lot better when the loop is ignored, so I believe the closed loop complicates things

Realistic Model Scene Hierarchy
Image

Simplified Model Scene Hierarchy
Image

TLDR:
So my questions would be...
1. How can I close this loop to be like a regular joint (not a tip-target) that remains closed always?
2. How can I get rid of the flailing as the tip tries to follow the target?

coppelia
Site Admin
Posts: 10364
Joined: 14 Dec 2012, 00:25

Re: Inverse Kinematics with Closed Loop Parallelogram

Post by coppelia »

Hello,

the first question is: do you want to kinematically or dynamically simulate your mechanism?
The second question is: do you want to control the motors of the mechanism (i.e. FK), or the end-effector position (i.e. IK)?

Depending on the answers, the approach is different.

Now as to why your end-effector is not nicely reaching the target (in this case you do things via IK), this could have several reasons. The first thing to try is to use a damped IK resolution method. But oftentimes, it is because your IK group is overconstrained, and you could add a few DoFs to avoid that, too.

If you dynamically want to simulate that mechanism, in FK and also IK, things get a bit more complicated. Have also a look in that case at the demo model Models/robots/non-mobile/uArm.ttm.

Cheers

p3jawors
Posts: 17
Joined: 14 Dec 2015, 18:22

Re: Inverse Kinematics with Closed Loop Parallelogram

Post by p3jawors »

Thank you for the quick reply! The plan is to simulate both the kinematics and dynamics with the thought process being to get the kinematics working first before adding the dynamics. I am focusing on the simplified model as it should tell me what I need to know and will run more smoothly when looking at the dynamics. I was able to get the loop to close well with the tip-target relation by playing around with the constraints. The model does follow the target nicely now; however, this is currently only for 2DOF and I will need to add the rotation (3rd DOF) back in again. As for the control I would like to have control of the motors. I will take a look at the demo you sent.

Thanks again

coppelia
Site Admin
Posts: 10364
Joined: 14 Dec 2012, 00:25

Re: Inverse Kinematics with Closed Loop Parallelogram

Post by coppelia »

The easiest in your case, if you want a dynamically enabled model in the end, would be to create the parallelogram via a dynamic loop closure. Then, simply control in position 4 of the joints:
  • The base joint that is vertical
  • The joint that is attached to the first horizontal bar
  • The joint that is attached at the end of the first horizontal bar
  • The joint that is attached at the end of the vertical bar above the 3rd actuated joint
This does however not correspond to reality, but works best. The other joints should be free (i.e. motor not enabled). Make sure your parallelogram is not overconstrained, so you could add another free prismatic joint on the vertical link above the robot base. And do the loop closure with a spherical joint there too.

Then, you can control your mechansim in FK. For IK, the easiest would be to compute it, since it is a simple mechanism that has an easy solution.

Cheers

p3jawors
Posts: 17
Joined: 14 Dec 2015, 18:22

Re: Inverse Kinematics with Closed Loop Parallelogram

Post by p3jawors »

Just to make sure I'm understanding what you are saying I've added a picture with labels to make sure we are talking about the same thing.

Simplified Arm with Labels
Image

As of now I have the 3DOF working for the kinematics. It follows the tip fine, but still flails around a bit for some solutions. I am hoping that once the dynamics and collision are added it will help with this (I am using damped and undamped IK groups simultaneously).

So in order, I switched the closed loop from a tip-target pair to a dynamics, overlap constraint and moved it to joint 5 (vertical link above robot's base). I left all the joints as IK hybrid joints, except for joint 4 which is in torque control with the motor on. I have also added the spherical joints to links 4 and 5 (you said to close the loop with a spherical joint "there too" so I put it on both - I may have misinterpreted).

When I run the simulation with this configuration (dynamics on) the link arm disconnects from the rest of the robot. I have added the scene hierarchy as well to make sure that I moved the parent links around correctly.

Simplified Arm Hierarchy (Dynamics)
Image

Once again, thank you for the help!

p3jawors
Posts: 17
Joined: 14 Dec 2015, 18:22

Re: Inverse Kinematics with Closed Loop Parallelogram

Post by p3jawors »

I forgot to add the sphere between the spherical joint and prismatic joint in the previous post.

Image

Now the parallelogram stays closed, but the tip does not reach the target when the simulation is run. It goes to the point in the image below and oscillates.

Image

coppelia
Site Admin
Posts: 10364
Joined: 14 Dec 2012, 00:25

Re: Inverse Kinematics with Closed Loop Parallelogram

Post by coppelia »

Please post your scene. Generally, it will not work if you first try to make things move with IK, then switch to dynamics. Best is to forget about IK when dealing with dynamically enabled parallel mechanism. First make it work by controlling the 3 joints.

Cheers

p3jawors
Posts: 17
Joined: 14 Dec 2015, 18:22

Re: Inverse Kinematics with Closed Loop Parallelogram

Post by p3jawors »

I was unable to find a way to post the scene directly into the forum so I've attached a google drive link to it. This file is the version that had the IK working for the 3DOF.

https://drive.google.com/open?id=0B3Ygg ... k1Sa1BDcUE

Now when you say to get it to work with the three joints first, are you talking about the three that correspond to the motors? Also, you say to forget the IK to get the dynamics working for the parallelogram arm...do you mean that I won't be able to have a simulation running both dynamics and IK, or that it is easier to get the dynamics working first?

Thank you again, the help is greatly appreciated.

p3jawors
Posts: 17
Joined: 14 Dec 2015, 18:22

Re: Inverse Kinematics with Closed Loop Parallelogram

Post by p3jawors »

I figured I should post the version with the changes to the dynamic parts mentioned in the previous post.

https://drive.google.com/open?id=0B3Ygg ... EliOEc1TW8

p3jawors
Posts: 17
Joined: 14 Dec 2015, 18:22

Re: Inverse Kinematics with Closed Loop Parallelogram

Post by p3jawors »

As per the email I received (and a simple update to anyone who may be reading through this post) I incorporated an invisible body for the IK elements and a visible dynamic body. After adjusting the inertias and masses the dynamic simulation tends to follow the tip quite well, but the parallelogram does not stay closed. As in the uarm simulation I have the sphere linking the prismatic and spherical joint set up as a dynamic body, but not a respondable one. Would it just be a stability issue that is keeping the parallelogram from staying closed?

Image

p.s. the image above also shows the arm with the joint separated, but it is cut off (at least for me) and may need to be opened in a new tab to see the full image

Post Reply