Landing model

Hello:

I am working on the environment portion of a model. My aim is to build a landing platform of length of 150cm, height 40cm, and depth of 50cm. Then connect the body model to the landing platform. From here get the body model to jump off the platform. The body model is okay for now. The enviroment file I need help on.

First I have tried to create a node, segment and subsequently a joint to represent the platform (similar to FEA) but presently cannot get it the body model to sit perfectly on the landing platform. The platform need to sit on the ground and is 30cm from the forceplate. Can you help me fix this?

What I have tried is to use a box and then scale it. This is not accurate and moreover fails to help me properly locate the feet on the platform? I also played with Jii but really this had no effect. Jii seems to work well only in creating body segments.

So one way I believe to solve this perhaps is to create my own geometry in Autocad, convert this stl file to anysurf and problem solved. However given I do not have Autocad is there another way.

Do I need to connect the feet of the body model to the landing platform before I drive it? How do I do this?

My model is attached. I am using the GaitFullBody1.main.any file.
Your help is greatly appreciated.

I have now created the stl files of the landing platform in cad program and on numerous attempts to convert these stl files to anysurf or to use the geometry causes the program to crash.

Using the AnySurfFile and AnySurfSTL class causes error below:

ERROR(SYS1) : Memory Allocation Error - Model is likely too large or has too many timesteps : Unknown error.

Using AnyDrawSTL causes the model to load but when one aims to go to model view the program crashes.

Any ideas to address this problem would be greatly appreciated. I am using version 4.2 of AMS.

Hi Farouk

I have looked at your model and can see that you have no force data available when the subject is standing on the platform?

I would recommend you to simply ignore the platform and preform the analysis from the moment he left the ground. This would make it possible to run the model like any other gait model having residual forces acting on the pelvis which would also ensure he will be in balance when in the air.

If you really want to the have force acting from the platform in the beginning then disappearing while in the air it is a more complicated setup you will need, and the only gain would be that you could simulated the first few milliseconds before the subject leaves the platform.

In this case you would need conditional contact definitions between the foot and the plate but you will also need to alter the reactions on the pelvis because these would take up too much force because you are not calculating reactions instead of imposing measured ones, so it is not a straightforward model to make this shift.

Best regards
Søren

Hi Farouk,

How large is this .stl file?

Please also note that the stl file must be exported in ascii format to work.

Best regards
Søren

Soren:

Thanks for the response. The stl files are all under 1KB. I will endeavor to retry tommorow to export in ascii format and see if this does the trick. Many thanks

Soren:

Greatly appreciate your response and guidance. I will endeavor to do as you have suggested and simply ignore the platform and attempt to run the analysis.
As it stands from the model I submitted initially there were bugs in marker definition and labelling, as well as model positioning that has now been corrected. However, I still cannot run successfully motion and parameter optimization. Perhaps your suggestion will do the trick. Will be in touch.

Hi Farouk

If the analysis fails in the first frame it might be the initial position you would need to alter a bit to get the body closer to the markers.

If it fails in the parameter optimization it is related to the optimization settings…

Best regards
Søren

Soren:

Thanks for the help. I still cannot get the model to run. The problem is in the initial condition. My view is the model markers (red) is close enough to the mocap marker (blue). On this note I had to manually move some body markers to get it close to the mocap markers given it was far away. This was the case for long body segments such as the tibia and the femur where markers can be placed many ways during motion capture. Is this the standard practice.

Secondly the c3d file has many medial joint markers which I excluded in model building. I am not sure if this is the source of my problem.

Can you look at this and let me know what the problem is. As mention I believe the model markers (red) are close to the mocap markers (blue). Also note that I have completely removed the landing platform. The GaitFullBody1.main.any is being used.

Many thanks

Hi Farouk,

I have looked at your model and found some issues…

The following markers are has been used but has no data except zero…
C7, Rear, Fore,RFin

There might be more of these i stopped checking … If you are trying to drive the model using a marker position which is at 0,0,0 then the model will obviously not solve the kinematics.

Please go through all your applied markers and ensure that they all contain valid positions.

It can be done in this way

In the modelsetup file set the setting
ConstructChartOnOff=On;

this will display the marker trajectories…

Please notice that you have a red box in 0,0,0 and if you hold the mouse over it it will give you the marker name…

You need to get rid of all makers ending up at 0,0,0.

If this does not help please try to simplify the model by removing the arms in the bodypartsetup2.any file and removing the arm markers in the Modelsetup.any file.

Best regards
Søren

Soren:

Many thanks for the guidance. The initial condition problem and marker problems are solved based on your suggestions, but now I get errors with motion optimisation portion which you have said has to do with optimisation settings. Really unsure what to change with these settings. Here is the error:

Failed to resolve kinematic constraints. Newton relaxation too small. (final kin. error = 2.587523E-005)
Constraint no. 196 above error tolerance 0.000001, error = 0.000002.
Constraint no. 197 above error tolerance 0.000001, error = 0.000011.
Constraint no. 198 above error tolerance 0.000001, error = 0.000006.
Constraint no. 201 above error tolerance 0.000001, error = 0.000001.
Constraint no. 203 above error tolerance 0.000001, error = 0.000001.
Constraint no. 204 above error tolerance 0.000001, error = 0.000001.
Constraint no. 224 above error tolerance 0.000001, error = 0.000010.
Constraint no. 225 above error tolerance 0.000001, error = 0.000006.
Constraint no. 226 above error tolerance 0.000001, error = 0.000026.
Constraint no. 232 above error tolerance 0.000001, error = 0.000002.
Constraint no. 233 above error tolerance 0.000001, error = 0.000002.
Constraint no. 234 above error tolerance 0.000001, error = 0.000002.
Constraint no. 236 above error tolerance 0.000001, error = 0.000001.
[SIZE=2]ERROR(OBJ.MCH.KIN3)[/SIZE] : [SIZE=2]C:/P…s/A…y/A…2/u…y/A…2/A…n/M…s/G…y/GaitFullBody1.main.any[/SIZE] : [SIZE=2]MotionOptimization.InitialConditions[/SIZE] : Kinematic analysis failed in time step 0

The relax parameter is set at 1 I think. Not sure if this is the culprit. Can you help me in moving forward. The updated model is attached. Many thanks, Nicholas

Hi Nicholas,

I have modified the ModelSetup.any file a bit.

The following markers was allowed to move in the y direction during the optimization
RANK, RKNE and RLEL (similarly for left)

At the same time the segment lengths such as upperarm, thigh and shanks was free to change lengths.

This approach will not work since the problem becomes unconstrained the upperarm length can be basically any length it want since it can both change the upperarm length and move the RLEL maker in the y direction. To resolve this i have switched off the y direction for the optimization for these markers.

These changes made the optimization run, though i did not wait for it to converge…

It is a nice model, please consider adding it to the gallery forum once you are done with it :wink:

Best regards
Søren

Soren:

Thanks for your help here. Forgive the delay. I believe you forgot to attach the modifications you made. Please send. Many thanks

Sorry for the previous post Soren. I belive you were perhaps directing me to make the suggested changes and then rerun the simulation. I have done that and the program is still running even after 90 minutes!

Question: Apart from removing body parts and certain muscles is there anything that can be done to reduce compuational time.
Will it help the program if I input the anthrometrics I measured in the lab for each subject? If so how do I go about this. There are certain anthropometrics measuremnts I always take in the lab just for safe keeping! Shoud I assume adding more markers will not assist in reducing computational time. In the C3D file provided there are at least 6 markers that were measure but excluded in the analysis.

On a different matter, in the environment autodetection folder what is the purpose of the command Vertical Direction=“Y”

Hi Nicholas,

No problem, i was trying to guide you :wink:

It should not take 90 min to run the motion optimization this is not a good sign.

I have made a few more modification to the modelsetup.any file

Please see attachment :wink:

I have tried to make the optimization settings for the various markers resemble those in the GaitFullBody model.

The model seem to converge now in six iterations this can be see viewing Main.stidues.parameyersidentification.output.parameteroptimization.abssumkkterror

On my pc this is less than 10 min.

One more thing… the model has 829 timesteps which is a lot… to reduce the calculation time for the kinematic optimization i have divided this number by 11 in the KinematicStudyForParameterIdentification study so the definition of nstep looks like this:

nStep=floor(Main.ModelSetup.nStep/11); //run this analysis with a reduced step number be carefull it can be too low!

Last thing change was that i added two drivers for the wrist… the markers you have there are not useful for driving the hand motion since they are located in the wrist joint, so you need to make the wrist driven by something else.

So in the ExtraDrivers file i added

AnyKinEqSimpleDriver WristDriverRight ={
AnyKinMeasureOrg &ref1 =…HumanModel.BodyModel.Interface.Right.WristFlexion;
AnyKinMeasureOrg &ref2 =…HumanModel.BodyModel.Interface.Right.WristAbduction;
DriverPos=pi/180*{.JntPos.Right.WristFlexion,.JntPos.Right.WristAbduction};
DriverVel=pi/180*{.JntVel.Right.WristFlexion,.JntVel.Right.WristAbduction};
};
AnyKinEqSimpleDriver WristDriverLeft ={
AnyKinMeasureOrg &ref1 =…HumanModel.BodyModel.Interface.Left.WristFlexion;
AnyKinMeasureOrg &ref2 =…HumanModel.BodyModel.Interface.Left.WristAbduction;
DriverPos=pi/180*{.JntPos.Left.WristFlexion,.JntPos.Left.WristAbduction};
DriverVel=pi/180*{.JntVel.Left.WristFlexion,.JntVel.Left.WristAbduction};
};

Best regards
Søren

Soren:

Thanks for your help. I implemented all your changes except the one changing the number of iterations from 820 to 820/11. The program converges in no more than 7 iterations in all cases which take ~ 12 mins on my computer.

Thus far the motion and parameter optimization scheme works, however I still have some questions and concerns:

[ul]
[li]For RKNE and LKNE markers why leave optZ= “On”;. This marker will never change position in this direction unless it falls off.[/li][li]As a note I will add RFIN and LFIN to all future mocap studies, if I do this I assume I will need to delete your suggested codes to drive the hands in ExtraDrivers.any file?[/li][li]Under MotionAndParameterOptimization > Studies> KinematicStudyForParameterIdentication why is inverse dynamics tab present here. If I try to run this operation I get the following error:[/li][/ul]Inverse dynamic analysis…
ERROR(OBJ.MCH.MUS4) : C:/P…s/A…y/A…2/u…y/A…2/A…n/M…s/G…y/GaitFullBody1.main.any : MotionOptimization.InverseDynamics : Muscle recruitment solver : solver aborted due to singular KKT matrix
4. Under MotionAndParameterOptimization > Studies> ParameterIdentification>optimization I also get the following errors, why

  1. Optimization (Operation: Main.Studies.ParameterIdentification.Optimization):
    ERROR(OBJ.DES4) : C:/P…s/A…y/A…2/u…y/A…2/A…n/M…s/G…y/ModelSetup.any : PelvisWidth : Design variable bounds must be specified : This design variable is missing proper bounds
    ERROR(OBJ.DES4) : C:/P…s/A…y/A…2/u…y/A…2/A…n/M…s/G…y/ModelSetup.any : ThighLengths : Design variable bounds must be specified : This design variable is missing proper bounds
    ERROR(OBJ.DES4) : C:/P…s/A…y/A…2/u…y/A…2/A…n/M…s/G…y/ModelSetup.any : ShankLengths : Design variable bounds must be specified : This design variable is missing proper bounds
    ERROR(OBJ.DES4) : C:/P…s/A…y/A…2/u…y/A…2/A…n/M…s/G…y/ModelSetup.any : FootLengths : Design variable bounds must be specified : This design variable is missing proper bounds
    ERROR(OBJ.DES4) : C:/P…s/A…y/A…2/u…y/A…2/A…n/M…s/G…y/ModelSetup.any : TrunkHeight : Design variable bounds must be specified : This design variable is missing proper bounds
    ERROR(OBJ.DES4) : C:/P…s/A…y/A…2/u…y/A…2/A…n/M…s/G…y/ModelSetup.any : UpperArmLength : Design variable bounds must be specified : This design variable is missing proper bounds
    ERROR(OBJ.DES4) : C:/P…s/A…y/A…2/u…y/A…2/A…n/M…s/G…y/ModelSetup.any : LowerArmLength : Design variable bounds must be specified : This design variable is missing proper bounds
    ERROR(OBJ.DES4) : C:/P…s/A…y/A…2/u…y/A…2/A…n/M…s/G…y/GaitFullBody1.main.any : ParameterIdentification.Optimization : Design variable bounds must be specified : This operation requires design variable bounds to be specified
    [ul]
    [li]In the environmentAutoDetection File VerticalDirection =“Z”, [/li][/ul]Is this correct?

[ul]
[li]I was able to get the inverse dynamics sequence to work, however this operation took ~ 37 minutes to complete. Is it advisable to reduce nSteps here? In addition, all the studies under InverseDynamicsStudy take quite a bit of time as well. For this model is this normal? For example Kinematics takes 18 minutes, Inverse Dynamics 28 minutes.[/li][/ul]7. Why do I get continuously get this error after working with the model and AMS software for some time. To fix this problem I restart the program.

Loading Main : “C:\Program Files\AnyBody Technology\AnyBody.4.2\untouched repository\AMMRV1.2\Application\MyModels\GaitFullBody\GaitFullBody1.main.any”
Scanning…
Parsing…
Constructing model tree…
Linking identifiers…
Evaluating constants…
Configuring model…
Evaluating model…
ERROR(SYS1) : Memory Allocation Error - Model is likely too large or has too many timesteps : Unknown error

  1. Given I am working with Mocap data would I be better off getting AMS Version 4.2.1 which is more robust and capable of handling marker occulsions and gaps in data?

Many thanks for your help here. Again please forgive the long response.

Kind regards Soren

Hi Nicholas,

The fact that the lateral direction is optimized for the knee markers is because due to soft tissue thickness we don’t know exactly how far the marker is from the bone. But the optimization will take care of that.

That’s right, if you add the RFIN and LFIN markers (together with the RWRA, RWRB, LWRA, LWRB) then you can remove the extra wrist drivers.

The KinematicStudyForParameterIdentication is an AnyBodyStudy, and this always contains both kinematic and inverse dynamic study. However in this case we are just inetrested by the kinematic (thus the name of the study). The inverse should not be runned in this particular study.

The operation that should be runned is ParameterOptimization. This one will know the parameters to be optimized and their bounds.
However it is better to run directly the RunMotionAndParameterOptimizationSequence.

This is correct. If you look at the global reference frame of your model you will see that Z is the vertical direction for the environment.

It is quite normal that the simulation take a long time given the number of steps (829) and that it is a full body model. Of course you can reduce the number of steps you you want to gain time, but at some point you will also loose accuracy if you reduce too much. I guess you can safely reduce it to half anyway.

This is definitly the memory filling up after several analyses. It can happens with such big models. There is not much to do now more than close the program and open it again as you already do to clean the memory. But this matter should be improved in the next releases.

Sure, version 4.2.1 definitly offers more capabilities regarding c3d data handling, like masking automatically the markers when they drop, as well as custom weight functions, etc. I would recommand to use it.

Best regards, Sylvain.

Sylvain:

Thanks for your help and recommendations. I will now work on validating the model. I find the webcast and tutorials take about model validation but they do not provide any guidance of how to actually validate the model using software outputs and experimental findings. Do you have any suggestions on how I can go about this for exisiting model. The C3D file includes EMG data. How to peice together the EMG data from experiment (via c3d file) with model muscle activation via model?

Again thanks for your help thus far.

Hi Nicholas,

You can compare the EMG data of one muscle with activity of the same muscle outputed by AnyBody. Remenber that EMG and muscle activity are not really the same thing, so comparing the magnitude would not make sens for example. What you can compare is the timing of the activation, so the muscle in Anybody should have a significant activity at the same time the EMG shows significant values.

Best regards, Sylvain.

Sylvain:
It has been a while but I have return to the modeling work. Much improvements have been made from hard work but now I am stuck and need your guidance. The joint reaction forces and moments at the ankle, knee and hip yield unrealistic values.

I believe this is because the COP upon impact moves outside of the foot in an erractic way. If you look at the simulation it moves in the negative y direction. I have tried to correct this problem so that I can get realistic joint reaction forces but found the results to be the same don’t matter what I change.

One of the things I have also tried and yielded errors but suspect it will not change the joint reaction forces is to use a different muscle recruitment criteria. I have implemented the Minmaxstrict but got the following error.


.0) InverseDynamics (Operation: Main.Studies.InverseDynamicStudy.InverseDynamics):
.0.0) PreOperation (Operation: Main.Studies.InverseDynamicStudy.InverseDynamics.PreOperation):
.0.0) InitialConditions (Operation: Main.Studies.InverseDynamicStudy.InitialConditions):
.0.0) …Design variables have been updated.
.0.1) …Load time positions have been re-established.
.0.2) …Kinematic analysis completed. The kinematic constraints have been resolved.
.0.3) …Initial conditions are fully updated.
.0) Inverse dynamic analysis…
ERROR(OBJ.MCH.MUS4) : C:/P…s/A…y/A…2/u…y/A…2/A…n/M…s/G…g/GaitFullBody1.main.any : InverseDynamicStudy.InverseDynamics : Muscle recruitment solver : maximum number of setbacks occurred.

If you can help me get the joint reaction forces to realist levels I would be grateful. The main file used is GaitFullBody.main.any. Model is attached. Grateful for any help. Nicholas

I have tried now many different ways to improve the attached file so that the joint reaction forces and moments at the ankle knee and hip within the model works. As well the COP calculated makes sense with hand calculations and other software being used. THus far I have had no success. The file updated is attached.

Any ideas how to resolve this problem greatly appreciated.

Thanks, Nicholas