|
The first step of building the hand pump model is to add a segment which will eventually become the hand wheel driving the pump. Start by opening the HandPump.Main.any file in AnyBody. In the main file you can toggle between different versions of the body model and it can be advantageous to select a light version. This will allow us to get the model up and running without spending a lot of time on reloads. A bit down in the main file you will find the following:
AnyFolder HumanModel={
//This model should be used when playing around with the model in the
//initial modelling phase since leaving the normal muscles out, makes the
//model run much faster. The model uses artificial muscles on each dof. in
//the joints which makes it possible also to run the inverse analysis.
#include "../../../BRep/Aalborg/BodyModels/FullBodyModel/BodyModel_NoMuscles.any"
//This model uses the simple constant force muscles
//#include "../../../BRep/Aalborg/BodyModels/FullBodyModel/BodyModel.any"
//This model uses the simple constant force muscles for shoulder-arm and spine
//but the 3 element hill type model for the legs
//Remember to calibratate the legs before running the inversae anlysis
//This is done by pressing Main.Bike3D.Model.humanModel.CalibrationSequence in the
//operationtree(lower left corner of screen)
//#include "../../../BRep/Aalborg/BodyModels/FullBodyModel/BodyModel_Mus3E.any"
Make sure that the first of the three red lines is active and the two latter are inactive, i.e. they have double slashes in front of them. Then load the model by pressing F7.
Before we add the wheel segment, let us spend just a few moments considering where to place it. The file structure of the application looks like this:

These files are organized according to the principle that the model is divided into three parts: - The model parts concerned with the human body. These are imported from the BRep part of the repository.
- The model parts concerned with the environment. These are the parts that are modeled bottom-up for each new application.
- A section connecting the body parts to the environment.
The wheel we are about to add is not a part of the human body. It logically belongs to the model's environment, and these parts are defined in the Environment.any file. Please open Environment.any:
AnyFolder EnvironmentModel = {
/* **********************************************************
This folder contains the definition of the Environment
- GlobalRefFrame
********************************************************** */
AnyFixedRefFrame GlobalRef = {
#include "drawcoorsystem.any"
};//GlobalRef
};
As you can see, it is extremely simple containing only a global reference frame, which in this model plays the role of a floor to stand on. We shall add a hand wheel to the model, but first we shall define a point on the global reference frame about which the hand wheel will eventually revolve:
AnyFolder EnvironmentModel = {
/* **********************************************************
This folder contains the definition of the Environment
- GlobalRefFrame
********************************************************** */
AnyFixedRefFrame GlobalRef = {
#include "drawcoorsystem.any"
AnyRefNode Hub = {
sRel = {0.4, 1.4, 0.0};
AnyDrawNode drw = {};
};
};//GlobalRef
};
When you reload the model and open a Model View Window you will see that a point has appeared in the form of a little grey ball in front of the chest. The next step is to define the wheel:
Place the cursor just below the definition of GlobalRef. Go to the Class Tab in the left pane Editor Window; unfold the class list and find AnySeg. Right-click the class and insert a class template. You will obtain this:
AnyFixedRefFrame GlobalRef = {
#include "drawcoorsystem.any"
AnyRefNode Hub = {
sRel = {0.4, 1.4, 0.0};
AnyDrawNode drw = {};
};
};//GlobalRef
AnySeg <ObjectName>
{
//r0 = {0, 0, 0};
//rDot0 = {0, 0, 0};
//Axes0 = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
//omega0 = {0, 0, 0};
Mass = 0;
Jii = {0, 0, 0};
//Jij = {0, 0, 0};
//sCoM = {0, 0, 0};
};
We fill in the blanks and add a draw segment:
AnySeg Wheel = {
r0 = .GlobalRef.Hub.sRel;
Mass = 5;
Jii = {0.003, 0.003, 0.3};
AnyDrawSeg drw = {};
};
Notice that we have given the wheel mass properties that causes the draw segment to take on a wheel shape. We shall also add two points to the wheel that can subsequently function as handles:
AnySeg Wheel = {
r0 = .GlobalRef.Hub.sRel;
Mass = 5;
Jii = {0.003, 0.003, 0.3};
AnyRefNode rHandle = {
sRel = {0.2, 0, 0.1};
};
AnyRefNode lHandle = {
sRel = {-0.2, 0, -0.1};
};
AnyDrawSeg drw = {};
};
Next we fix the wheel segment to the hub node by means of a revolute joint (notice that every time a new object is inserted it can be done from the Classes tree):
AnySeg Wheel = {
r0 = .GlobalRef.Hub.sRel;
Mass = 5;
Jii = {0.003, 0.003, 0.3};
AnyRefNode rHandle = {
sRel = {0.2, 0, 0.1};
};
AnyRefNode lHandle = {
sRel = {-0.2, 0, -0.1};
};
AnyDrawSeg drw = {};
};
AnyRevoluteJoint WheelHub = {
AnyRefFrame &Hub = .GlobalRef.Hub;
AnyRefFrame &Wheel = .Wheel;
Axis = z;
};
Finally, let us define a driver to make the wheel rotate:
AnyRevoluteJoint WheelHub = {
AnyRefFrame &Hub = .GlobalRef.Hub;
AnyRefFrame &Wheel = .Wheel;
Axis = z;
};
AnyKinEqSimpleDriver WheelTurn = {
AnyRevoluteJoint &Hub = .WheelHub;
DriverVel = {-pi};
};
The model has now gone from being static to moving and to see it move we must increase the number of time steps in the model. This happens in the study section of the Main file:
AnyBodyStudy Study = {
AnyFolder &Model = .Model;
RecruitmentSolver = MinMaxSimplex;
tEnd = 1.0;
Gravity = {0.0, -9.81, 0.0};
nStep = 10;
MuscleEliminationTol = 1e-7;
}; // End of study
Please reload the model and run the kinematic analysis. You should see the wheel turning half a round.

Here's some emergency help if you are having problems making the model work: HandPump.2.zip contains the three modified files from this lesson.
The next step is to hook the hands up to the handles and get the arms moving in Lesson 3: Kinematics.
|