Specifications
32
Lesson 4: Definition of movement
Here's an AnyScript file to start on if you have not completed the previous lesson: demo.lesson4.any
.
If you have completed the three previous lessons, you should have a model with an upper arm grounded at
the shoulder joint and connected to a forearm by the elbow. What we want to do now is to make the arm
move.
How can an arm with no muscles move? Well, in reality it cannot, but in what we are about to do here, the
movement comes first, and the muscle forces afterwards. This technique is known as inverse dynamics. We
shall get to the muscles in the next lesson and stick to the movement in this one.
Our mechanism has two degrees of freedom because it can rotate at the shoulder and at the elbow. This
means that we have to specify two drivers. The natural way is to drive the shoulder and elbow rotations
directly and this is in fact what we shall do. But we could also choose any other two measures as long as
they uniquely determine the position of all the segments in the mechanism. If you were building this model
for some ergonomic investigation, you might want to drive the end point of the forearm where the wrist
should be located in x and y coordinates to simulate the operation of some handles or controls. And this
would be just as valid a model because the end point position uniquely determines the elbow and shoulder
rotations.
For now, let's make a new folder and define two drivers:
}; // Jnts folder
AnyFolder Drivers = {
//---------------------------------
AnyKinEqSimpleDriver ShoulderMotion = {
AnyRevoluteJoint &Jnt = ..Jnts.Shoulder;
DriverPos = {-100*pi/180};
DriverVel = {30*pi/180};
}; // Shoulder driver
//---------------------------------
AnyKinEqSimpleDriver ElbowMotion = {
AnyRevoluteJoint &Jnt = ..Jnts.Elbow;
DriverPos = {90*pi/180};
DriverVel = {45*pi/180};
}; // Elbow driver
}; // Driver folder
This is much like what we have seen before. The folder contains two objects: ShoulderMotion and
ElbowMotion. Each of these are of type AnyKinEqSimpleDriver. A driver is really nothing but a mathematical
function of time. The AnyKinEqSimpleDriver is a particularly simple type that starts at some position at time
= 0 and increases or decreases at constant velocity from there. These two drivers are attached to joints,
and therefore they drive joint rotations, but the same driver type could be used to drive any other degree of
freedom as well, for instance the Cartesian position of a point.
The lines










