Being new to AnyBody, I am trying to program a simple squat model for validation of the experiments we are running on our Oxford Knee rig. Therefore, I thought the “Demo.SliderCrank2D” would do the job. Though, I needed/wanted to modify the model on two points:
- instead of using all types of joints, I assumed the model should do the job when only considering joints of the type “AnyRevoluteJoint”. However, this overconstrains my model (21 constraints - 18 DOF).
Though, I assumed some contraints would be overlapping (e.g. with respect to the out of plane motion, x in this case). Can anyone please explain why this is not the case and AnyBody fails to solve the initial kinematics in this case?
As an alternative, I replaced (on a trial and error base) some of the “AnyRevoluteJoint” 's by a spherical joint and a CylindricalJoint. Theoretically this balances my DOF with the constraints, the model also converges: I get a solution. Though, I don’t really understand why… The combination of the spherical joint (Knee) and cylindrical joint (Ball) to my opinion allows the Coupler segment to move out of the YZ-plane (which for some reason however does not happen, but I don’t see any theoretical constraint to this).
- To improve the comparability between my experiments and simulations, I would have liked to replace the rotational driver on the shaft by a linear driver on the slider. By doing so, the kinematic analysis however fails. This time, I can understand why this happens as I assume the system has at least two valid solutions for every position of the slider (‘Knee’ could move towards either the positive or the negative z-axis).
Therefore, I was wondering if someone could tell me if it is possible to apply additional boundary conditions to this movement (e.g. specifying a range for the knee angle, 0 - 180° for instance)?
Thanks for your comments!
Matthias
Dear Matthias,
- You already had the setting for kinematically over-determinate solver as you did:
AnyMechStudy MechStudy = {
AnyFolder& Model = Main.SliderCrank;
[b]
InitialConditions.SolverType = KinSolOverDeterminate;
Kinematics.SolverType = KinSolOverDeterminate;[/b]
Gravity = {0,0,-1}*9.81;
};
But if you want to make this concept working, some of the constraints in your model should be defined as ‘soft’ constraints.
If all the constraints are defined as ‘hard’ constraints, then number of DOFs(degrees of freedom ) should be as same as the number of constraints in your model always.
Regarding the movement of the coupler segments in your model:
//---------------------------------
AnySphericalJoint Knee = {
//Axis = x;
AnyRefNode &CrankNode = Main.SliderCrank.Segs.Crank.Tip;
AnyRefNode &CouplerNode = Main.SliderCrank.Segs.Coupler.CrankNode;
};
//---------------------------------
AnyCylindricalJoint Ball = {
// I believe this should be a Spherical Joint though it refuses if this joint is set this way
Axis = x;
AnyRefNode &CouplerNode = Main.SliderCrank.Segs.Coupler.SliderNode;
AnyRefNode &SliderNode = Main.SliderCrank.Segs.Slider.SliderNode;
};
Coupler has relatively 3 DOFs w.r.t. the crank segment due to the spherical joint. And the coupler segment is connected to the Slider segment using cylindrical joint.
Cylidrical joint means that the rotational axes of those two segments should be always parallel. So the x axes of the ‘Couplder.SliderNode’ and the ‘Slider.SliderNode’ should be parallel.
Because of this spherical joint and the cylidrical joint, this Couplder segment should stay in the YZ-plane.
-
Regarding your second question, AnyBody tries to find the solution of the kinematics from the r0 and Axes0 values of all segments. But when I looked your model, the segments are aligned linearly.
So if you want to drive your model using the linear driver, then AnyBody may not know which solution it has to take as you pointed out(‘Knee’ could move towards either the positive or the negative z-axis).
If you can search the keywords ‘kinematics bifurcation’ in google, then you may be able to find some related articles.
If you can try to change either ‘r0’ or ‘Axes0’ value of the Coupler segment then you may be able to use the linear driver instead.
-
Regarding the boundary condition of a joint, we are developing the concept of the range of the motion of any kind of kinematic measures. If that will be implemented and released in future, then you can use that.
By the way, I tried to modify you model into several different versions. For your interests.
I hope this answer may be helpful to you.
Best regards,
Moonki
Dear Moonki
Thanks for your reply, your suggestions appeared really helpfull to me. Unfortunately, as I got through the kinematic analysis, I encountered new errors…
For the squatting motion, we experimentally apply a load from the ankle to the hip (named “AnkleLoad” in the script). This load is essentially balanced by applying a force to the quadriceps. I tried to model this by creating two sites where the quadriceps muscle is attached: one on the femur (crank, named “Q_forceApplied”) and one on the tibia (coupler, named “Tuberositas”). Additionally, I set the driver in passive mode (Reaction.Type = {Off}). Unfortunately, the inverse dynamics analysis no longer run in this case, I get an error stating that the model is kinetically indeterminate. Does anyone has a suggestion here?
In an attempt to solve this issue, I tried to attach flexion/extension muscles to every joint (in the second script, V02). However, still I got the same error message so I really don’t see the issue here… I got one active driver, I tried to replace this driver by one active muscle but it seems not to be that straightforward…
thanks in advance for any suggestion!
Best,
Matthias
Does anyone have a suggestion on these errors?
thanks,
Matthias
Hi Matthias,
sorry for taking so long. This demo model uses a AnyMechStudy which requires a certain configuration of constraints and forces (You can read more about that in the reference manual.). If you switch to the AnyBodyStudy it will run. Basically, just replace AnyMechStudy with AnyBodyStudy.