V M e c h . c o m
V i r t u a l   M e c h a n i s m s
Fighting immechanacy on the Web

Site Map


  1. Introduction
  2. Java3D Models
    1. Sun's HelloUniverse
    2. Simple Crank
    3. Crank Rocker
    4. Drag Link
    5. Four Bar Linkage Beta
  3. Papers (in progress)
    1. Machines in Java3D
    2. Inverse Kinematics on the Scene Graph
    3. Simulations on the Web
    4. 'Time' in Java3D
  4. Appendices

A.     Installing the Java2 Plug-in and Java3D

B.     Security and Java applets

  1. References
  2. About VMech.com

3.2 Inverse Kinematics on the Scene Graph


Contents


3.2.1 Introduction

Acyclic (non-looping) trees, sometimes called 'scene graphs,' have become a commonplace object in the computer representation of 3D scenes because their structure reflects the connectivity of many of the things we want to make models of. The 'tree' part makes it easy to describe, for instance, the branching way that the crank of an automobile engine nests into the crankcase root, and the way that the connecting rod connects to the crank, and the piston to the connecting rod. However, the 'acyclic' part means that there is nothing inherent in the object structure of the acyclic tree that helps describe the way that the piston fits back into the cylinder (a part of the crankcase.) As far as the acyclic tree is concerned, the connecting rod and the piston can flap in the wind.

This paper describes an approach to closing the loop - the design and use of a Java Constraint class that encapsulates those portions of the machine state and the methods required to solve inverse kinematics on the scene graph.

3.2.2 Terminology

  • kinematics - the branch of mechanics that studies the motion of a body or a system of bodies without consideration given to its mass or the forces acting on it. [Ref just about any dictionary]

    Computer scientists, game designers and robotics researchers have adopted the term inverse kinematics to describe what they do when they specify ways to adjust the joints between the mating parts to meet some position requirement on a part out at the end of a chain - to ensure that the piston fits into the cylinder, for example. 'Kinematics' because they are studying the way parts move, and 'inverse' because the process tends to works backward up the tree from the position requirement to the root.

    Among mechanical engineers, this has been called just kinematics for centuries. On the one hand, open or unconstrained motion just didn't have enough practical interest to occupy an machine designer and didn't need its own word, but on the other, real kinematics ('kinematics with constraints' or now 'inverse kinematics') was thought to be a field appropriate for royalty, mathematicians, and philosophers. Because I am an old mechanical engineer, I will refer to the study as plain old kinematics.
  • mechanism - an assembly of bodies linked together in a chain. [Ref 5.1.1].
  • kinematic chain - a mechanism [Ref 5.1.1]
  • degree of freedom (DOF) or mobility - the number of independent parameters required to completely specify the configuration or state of a mechanism or the position of a part in space. [Ref 5.1.1]
  • constraint - a limitation on the degrees of freedom of a mechanism or part.

    In a particularly revolting development, some computer scientists have co-opted this term to describe a non-linear limit to the travel of a joint. True, such nonlinearities are 'limitations,' but use of the term in that context confounds the important discussion of the effect of constraints on degrees of freedom.
  • independent variable - a mechanism state variable. The number of independent variables for a mechanism is equal to the degrees of freedom.
  • dependent variable - a parameter that is determined by the state of the mechanism.
  • determinate - describes a mechanism configuration in which the number of constraint equations equals the number of dependent variables.

3.2.3 Scope

The Board of Directors of VMech.com is interested in developing methods for building high-fidelity computer simulations of physical processes. As an initial step toward that goal the VMechanic is exploring the strengths and limitations of Java3D for building models of mechanical systems. So he's interested in developing methods capable of solving kinematic constraints with arbitrarily small error. In the general case, the Board will want to be able to use the results as a basis for detailed technical studies, so looking good on the screen isn't good enough.

To begin, the focus is on mechanisms with low degrees of freedom.

Similarly, the scope will be limited to determinate systems, that is systems for which the number of constraints exactly equals the number of dependent variables.

Many classical mechanisms fit into this scope - four-bar linkages are determinate mechanisms with a single degree of freedom, reciprocating steam engines with a throttle valve lever are determinate with two degrees of freedom, and a reciprocating automobile engine with hundreds of parts (but with conventional valve train and electronic ignition) is determinate with a single degree of freedom.

3.2.4 The Scene Graph

rotating lever
- sketch
- scene graph
one DOF, one independent var angle 'a'
no constraints, no dependent variable
=> determinate

simple crank
- sketch
- scene graph
one DOF, one independent var: angle 'a'
one constraint (y=0 at C), one dependent variable: angle 'b'
=> determinate

four-bar linkage
- sketch
- scene graph
one DOF, one independent var, angle 'a'
two constraints: displacements x,y at D
two independent variables angles 'b' and 'c'
=> determinate

3.2.5 Closing The Loop - Designing The Constraint Class

functional requirements for the Constraint class
method for measuring the location of a point in a given reference frame

subclass Node

  1. add members
    1. Node MatingPart
  2. override, add methods
    1. get the Transform3D of the Mating Part with respect to this's reference frame
    2. sub-gets (individual displacements, rotations)
    3. accessors, mutators

3.2.6 Solving the Constraint - Behaviors

Using the Behavior class to control a machine

subclass Interpolator

  1. add members
    1. Alpha
    2. Collection? of Constraint object references
    3. Collection? of dependent TransformGroup object references
  2. override methods
    1. initialize()
    2. processStimulus()
      1. set independent variables with a call to super.processStimulus()
      2. solve for dependent variables
      3. set dependent TransformGroups

Candidate approaches to solving for dependent variables (step 2.b.ii above)

  1. closed form solution
    1. poll Constraint objects to get current positions set by 2.b.i
    2. solve trig or 2nd order algebraic equations for dependent variables
  2. lookup table
    1. poll Constraint objects to get current positions set by 2.b.i
    2. use prepared lookup table (with or without interpolation) to get dependent variables
  3. learning lookup table
    1. use closed form solution and log solutions on a lookup table until it's dense enough, then
    2. use lookup table (with or without interpolation) to get dependent variables
  4. Newton-Raphson [Ref 5.3.1, page 379]
    1. set initial guess at dependent variables
    2. poll Constraint objects for position errors
    3. while (norm of constraint errors too large) {
      1. step through dependent TransformGroups, incrementing each in turn, poll Constraint objects for changes in position errors
      2. formulate the Jacobian
      3. invert it
      4. solve for changes to dependent variables to drive errors to zero
      5. set dependent Transforms
      6. poll Constraint objects for position errors}

note: this use of the while loop leaves the dependent Transforms set at the required solution, so step 2.b.iii above is not required for the Newton-Raphson method.

3.2.7 Results

Conclusions

Last revision
October 17, 2000
email the
VirtualMechanic

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. VMech.com and Brock Engineering are independent of Sun Microsystems, Inc.
Except as noted, all other material © Fred Klingener 2000. All rights reserved.