1Inverse KinematicsMike [email protected] State Universitymjb – October 16, 2014Oregon State UniversityComputer Graphicsinversekinematics.pptxInverse KinematicsForward Kinematics solves the problem “if I know the link transformation parameters, where are the links?”.Inverse Kinematics (IK) solves the problem “If I know where I want the links to be (X*,Y*), what link transformation parameters will put them there?” 333(X*,Y*)mjb – October 16, 2014Oregon State UniversityComputer Graphics12Ground11222Inverse Kinematics (IK):Things Need to Move – What Parameters Will Make Them Do That?mjb – October 16, 2014Oregon State UniversityComputer GraphicsRemember the Idea Behind Newton’s Method?“Pick an initial guess of the input parameter and keep refining it until the answer it produces is close enough”dyyxdx1.dxhaveyxdydx2.mjb – October 16, 2014Oregon State UniversityComputer GraphicsNow we just need to do it with more than one input parameterxxx3.3Jacobian MethodOur input parameters (in this case) are the three rotation angles. If (X*, Y*) are where we want the end of the third link to end up, then:*123(, , )Xf*123(, , )YgandIf you have a good guess for , which currently produce an (X*, Y*) that is not quite what you want, then you can refine your values for and try again. The fundamental equations for this are:33*22*11***XXXXXXapprox123(, , )123(, , )mjb – October 16, 2014Oregon State UniversityComputer Graphics32133*22*11***YYYYYYapproxOr, in matrix form:YXYYYXXX3213*2*1*3*2*1*The Jacobian Matrix***3*2*1*YYYXXX321The matrix:2 x 33 x 12 x 1mjb – October 16, 2014Oregon State UniversityComputer Graphics321is called the Jacobian, and is abbreviated as [ J ]:YXJ3214Note that [J] is not a square matrix, so this system of equations cannot be solved for directly. But, if we pre-multiply by the transpose of [ J ], we get:1Solving the EquationsYXJJJTT][][3213 x 1 2 x 1 )2 x 3 )( 3 x 2 ( 3 x 23 x 13 x 33 x 1mjb – October 16, 2014Oregon State UniversityComputer Graphicswhich is solvable because it is 3-equations-3-unknowns.3 x 13 x 33 x 1It is not obvious, but this is the Least Squaresformulation. It will give an optimum (ΔΘ1, ΔΘ2,ΔΘ3) to make (X*,Y*) move closer to the desired values.Differentiate the equations andPick a starting Θ1, Θ2, and Θ31. Compute X*approxand Y*approxfrom2 Compute∆X=X*-X*and∆Y=Y*-Y*Iterating to get a Solution (note similarity to Newton’s Method)123(, , )*123(, , )Xf*123(, , )Yg2. Compute ∆X=X-Xapproxand ∆Y=Y-Yapprox3. If |∆X| and |∆Y| are “small enough”, we’re done 4. Compute: 5. Form the Jacobian [ J ]3*2*1*3*2*1*,,,,, YYYXXXX1mjb – October 16, 2014Oregon State UniversityComputer Graphics6. Solve the system of equations:7. Refine:YXJJJTT][][32111 12 2 23 3 3;; 5The Calculus Product Rule Tells us How toDifferentiate Scalar Variables that have been Multipliedcab()dc d ab da dbbaddd d mjb – October 16, 2014Oregon State UniversityComputer Graphics[][][]([ ][ ]) [ ][] [][][]MTRdTR dRdM dTRTThe Calculus Product Rule Tells us How toDifferentiate Matrices that have been Multipliedcos sin 00 sin cos 00sin cos 00 cos sin 00[]0010 0 000dRddd [][]ddd d 0mjb – October 16, 2014Oregon State UniversityComputer Graphics0010 0 0000001 0 000dd 6Numerical DifferentiationRather then explicitly differentiating an equation, it is often easier to calculate the derivative numerically. This is known as the Central Difference method, where you look both forward and backwards to see how the dependent variable is changing with respect to the independent variable:()()2XX Xvariable is changing with respect to the independent variable:mjb – October 16, 2014Oregon State UniversityComputer GraphicsPick a delta that is small, but not so small that floating point accuracy becomes an issueNumerical DifferentiationIf there are other independent variables, hold them constant:1123 112311(,,)(,,)2XXX mjb – October 16, 2014Oregon State UniversityComputer Graphics7Numerical DifferentiationIn case you ever need it, here is how to compute the second derivative222()2()()XX X Xmjb – October 16, 2014Oregon State UniversityComputer GraphicsAs before, if there are other independent variables, hold them constant:Another IK Approach:Cyclic Coordinate Descent (CCD) MethodThe idea is to change Θ1 so that (X,Y) are as close to (X*,Y*) as possible.Then change Θ2.Then change Θ3.Then change Θ1.123Then change Θ2.Then change Θ3.Then change Θ1.. . .(X*,Y*)mjb – October 16, 2014Oregon State UniversityComputer Graphics1Ground(X,Y)8Changing Θ1Holding Θ2 and Θ3 constant, rotate Θ1 so that the blue lines line up.123(X*,Y*)mjb – October 16, 2014Oregon State UniversityComputer Graphics1Ground(X,Y)Changing Θ1(X*,Y*)mjb – October 16, 2014Oregon State UniversityComputer GraphicsGround(X,Y)9Changing Θ2Holding Θ1 and Θ3 constant, rotate Θ2 so that the blue lines line up.(X*,Y*)mjb – October 16, 2014Oregon State UniversityComputer GraphicsGround(X,Y)Changing Θ2(X*,Y*)mjb – October 16, 2014Oregon State UniversityComputer GraphicsGround(X,Y)10Changing Θ3Holding Θ1 and Θ2 constant, rotate Θ3 so that the
View Full Document