Redundant constraints on my Exo-HumanBody model

Dear seniors,

I am trying to bind my exoskeleton model to the HumanModel, and after researching many posts on forum, I have achieved some results. Here is my work.
Exo_Human.zip (3.8 MB)

At first, I imported my whole exoskeleton into Anybody, but in the end, I found it a bit difficult. Now my exoskeleton model only retains the both thighs, shanks, and knees. I use AnyCylindricalJoint to connect the exoskeleton kneejoints with the human model kneejoints. Nodes were created on the thighs and shanks of Exo-model and HumanModel, and constraints were implemented using AnyKinEq: the x-axis and z-axis were constrained at the thighs, and the x-axis was constrained at the shanks. Perhaps due to the lack of strict correspondence between the thigh and shank nodes on the exoskeleton and human model, the position of the exoskeleton in the completed kinematic analysis model may be slightly tilted.
kinematics completed
My thigh and shank nodes are determined based on the corresponding kneejoint node position coordinates, but postures of their kneejoints are different, that should be the reason why the thigh and shank nodes cannot be strictly matched. I don't know if my understanding is correct.



The trouble is with my inverse dynamics analysis. Based on what I have seen in other posts, the added constraints need to be balanced by adding reactions. My single leg has a thigh and a shank, introducing 12 degrees of freedom. In the kinematic section above, I added additional 7 constraints for each leg, so theoretically, I should add 7 additional reactions. I added 7 reactions using AnyReacForce for single leg and set the Constraints.Reaction.Type of AnyCylindricalJoint to {Off, Off, Off, Off}.

Unfortunately, after running the inverse dynamics analysis, it showed redundant constraints and displayed "Muscle recruitment solver : solver aborted due to singular KKT matrix
".

This is beyond my ability, and I hope someone can help me solve this problem :smiling_face_with_tear:.

Best Regards
Meng

1 Like

Hi Meng,

Welcome to the AnyScript Forum!

This looks like a really nice model!

I am not sure I understand you correctly, so I will just try to explain the basics:
Your exoskeleton has 2 segments and that means it has 12 degrees of freedom (dof). I suppose there is a revolute joint between these two segments and that adds 5 constraints. In the kinematics, you add a cylindrical joint (4 constraints) and three additional constraints between the thighs and shanks. So here, it looks good, that you have 12 constraints for the 12 dof.

In the inverse dynamics, you still have the 5 reactions from the exo knee joint, and then you add 7 reactions so that your total comes to 12 reactions. This is also good. You switched off the reactions at the cylindrical joint, so you need to add 7 reactions. I suppose you want to add these reactions at the connecting point on the thigh and shank?

I think the problem is that you have added 3 rotational reactions at the thigh and 3 rotational reactions at the shank. This is leading to the warning of redundant reactions since practically you have added reactions twice in the same 3 rotational dofs because there are the reactions from the revolute joint as well between the exo thigh and shank. So, you should try different combination, like some linear reactions and some rotational reactions. Here is an example of what should work: 3 linear reactions at thigh, 3 linear reactions at shank, and 1 reaction along the long axis of the thigh (or shank).

I hope this helps.

Best reagrds,
Dave

Hi Dave,

Thank you very much for your help!

First of all, I apologize for my carelessness. When I opened my file again, I found that I made a mistake when adding a reaction on left thigh of Exo: I placed the name of shank in the position of
thigh :sweat_smile:. As you pointed out, I added repeated reactions. After correcting this error, I attempted to run inverse dynamics analysis, but it still showed redundant reactions. That indicated that there were sindeed errors in my code, rather than just letting others waste time on my carelessness.

I followed your suggestion and modified the added reaction. The inverse dynamics analysis successfully completed! :yum:

I noticed that in the AMMR, there is a folder named 'Plug in gaitSimple', which contains a file called 'FullBody. main'. I added my exoskeleton to the simple gait model and added the same constraints and reactions as before. I ran the analysis on this model without adding external torque, and the entire process went very smoothly. It's not an exaggeration to say that every successful operation of the dynamics fills my heart with excitement.My next step is to study applying external torque to Exo joints in order to reduce muscle activity in gait. I hope my research approach is correct. Sincere thanks again for your help!

Best regards,
Meng

Hi Meng,

I am happy to hear your model is working!

It's really nice that you are also able to add your exo model to the mocap model without hiccups. I will suggest you use the mocap model with ground reaction force prediction. This is because with the standard Plug-in-GaitSimple model, you have the GRF recorded with force plates. This recorded GRF will be applied to your model. However, when you add an exoskeleton model, I expect the GRF to change. But you will only see the recorded GRF in your trial and this may not give you a complete picture. This is why I suggest you use the GRF prediction class template so you are able to see the changes in GRF depending on the exo model.

Best regards,
Dave

Hi Dave,

Thank you for providing guidance on my work!

After reviewing your suggestions, I researched the Fullbody_GRFPrediction model(I will abbreviate it as GRF model). Due to the shared Input folder between GRFPrediction model and Fullbody model, and my exoskeleton as well as binding and constraint related code being stored in this folder, when I opened the file of GRF model, my exoskeleton also appeared in the view. After running the analysis, I found that the results were much beyond my expectations. After repeatedly comparing the inverse dynamics analysis results of the Fullbody model and the GRF model, I found some problems. I would like to ask you the following questions.

  1. MuscleActivity, I believe it is a value between 0 and 1. In the Fullbody model, regardless of whether my exoskeleton is added or not, the MaxMuscleActivity is between 0 and 1. However, for the GRF model, even without making any changes to the model (without adding exoskeleton), the MaxMuscleActivity far exceeds 1. Is this normal? In the face of this situation, I am not sure if I should use the GRF model for simulation experiments.
    image

  2. To apply knee joint assisted torque in Fullbody model, my approach is to check the JointMomentMeasure of KneeFlexion after wearing the exoskeleton (without applying auxiliary torque), export the data, fit the curve using sine functions, and apply it as a function of time to KneeFlexion. Please notice that there is no negative sign before my function. I believe that applying torque in this way can have an assisted effect rather than increasing the burden on the knees, and this approach does indeed reduce the MuscleActivity of many muscles. Do you think my approach is correct?

AnyForce Knee = {
    AnyKinMeasure &knee = Main.HumanModel.BodyModel.Interface.Right.KneeFlexion;
    F = {18.73*sin(10.02*t-0.0564)+16.87*sin(0.7468*t-1.484)+ 7.756*sin(7.484*t-3.084)+ 4.852*sin(14.72*t-2.199)+ 3.288*sin(20.46*t+1.5)+ 1.925*sin(18.38*t-4.61)+ 2.891*sin(27.35*t+0.5108)+ 9.702*sin(1.639*t+5.65)};
    //    F = {0 };
    viewForce = {
      Visible = On;
      ScaleToView = Off;
      AppliedForceColor = {1, 0.1, 0.1}; 
      ForceScale = 0.005;
    }; 

Best regards,
Meng

Dear Meng,

I have ran a default model of Plug-in-gait-Simple/FUllBody_GFRPrediction.main and I do not see the high peaks that you see without the EXO. Here is the result of the MaxMuscleActivity, which is between 0 and 1.

I suggest that:

  1. Investigate where in your trial the picks of MaxMuscleActivity happens.
  2. Find which muscle is actually the one with MaxMuscleActivity.

And try it without the EXO first and then add the EXO and see the differences.
The big peaks in the muscle activity also can happen because of the data. Since you see the high peaks with and without the EXO, then you probably made the EXO model correctly :slight_smile: And maybe you should look at the data more closely.

You can use AnyReacForce on different joints and connections to investigate where you need to have high forces or moments, and susequently find where is the problem in the model, which cause big forces in the muscles :slight_smile:

About your second question, it is a simple and maybe a good way of simulating the EXO without the weights of the EXO and interface connections.

Best regards,
Hamed

Hi Hamed,

Thank you for your suggestion. I checked the CorrectedActivity of most of the muscles in the legs and found that the MaxMuscleActivity does not seem to occur in the legs. Analyzing the default model using Hill muscles, some leg muscles have a peak activity level exceeding 1, but it has not yet reached a level exceeding 10.

The most critical issue is that I analyzed a default file that has not been modified at all, but still encountered such an issue.

I want to know if this issue may be related to the versions of AnyBody and AMMR. I am using versions 7.4 of Anybody and 2.4.3 of AMMR. May I ask which version of AnyBody and AMMR are you using?

Best regards,
Meng

Hi Meng,

I understand the reason for the confusion. When you plot the Max Muscle Activity in AMS 7.4, it also includes the general muscles that are used for simulating GRF and the weak residual forces. The overload actually happens in the weak residual general muscles and not in the physiological muscles. Of course, it is quite confusing for some users to think that a physiological muscle is with activity over 10, but you don't see any muscle being overloaded in the model view

Therefore, in AMS 8.0, we have introduced AnyRecruitedActuator, that is used to simulate recruited force such as GRF and weak residuals. Functionally, recruited actuators work exactly like general muscles, but they can be organized differently and this allows the model to make a distinction between recruited forces simulated by muscles and recruited forces simulated by recruited actuators. This is also useful when you want to work with metabolic and fatigue models. Then you can apply them to muscles only and not recruited actuators. Please see below the plot for MaxRecruitedActuatorActivity, which is similar to MaxMuscleActivity that you saw.

Best regards,
Dave

Dear senior colleagues,

As a novice in this field, after studying some posts on the forum, especially with the help of your posts, I attempted to model a simple 2-segment exoskeleton with twelve degrees of freedom. Following your modeling approach, I added a rotating joint with five constraints between the two segments, and then added an AnyCylindricalJoint (with four constraints) between the legs and the exoskeleton. Utilizing three additional constraints with AnyKinEq, the model now has 12 degrees of freedom and 12 constraints, which should result in deterministic kinematics. After running the kinematic analysis, the model successfully simulates motion. I am truly grateful for your assistance!

Here, I have a few doubts and would like to seek guidance from the experienced members of the forum. I hope to receive your help. Thank you.

  1. I would like to inquire about how you define the position of the exoskeleton model in SolidWorks. How is it that when you import the exoskeleton into AnyBody, the position aligns so well with the human body without requiring major adjustments to the EXO model's r0 and Axes0 to match the position of the human body? Did you consider the relevant dimensions and initial positions of the human body model when initially assembling the exoskeleton in SolidWorks?

  2. Regarding adjusting the exoskeleton model's r0 and Axes0 to match the position of the human body in AnyBody, how can I move the entire exoskeleton model as a whole to match the position of the human body? In my case, the exoskeleton consists of two ends. My understanding is that I need to separately change the r0 and Axes0 within the AnySeg for each end, which seems relatively straightforward. However, there is an issue here. By individually adjusting the r0 and Axes0 of each segment in the exoskeleton, when loading the model into AnyBody, the system does not consider these constraints. At that moment, the system will place them in space according to their defined position attributes. As a result, the exoskeleton model is separated. Only after running the kinematic analysis do the constraints come into effect, and the exoskeleton becomes a whole. If my exoskeleton consists of many rigid bodies, adjusting each AnySeg's r0 and Axes0 to match the human body model becomes extremely complex. Moreover, after these adjustments, when loading the model into AnyBody, the exoskeleton segments may appear as a large and messy pile, resulting in poor visual effects and hindering the creation of constraints to link them with the human body model. If the positioning of the segments during definition is chaotic compared to their final positions, the system may not resolve the constraint conditions correctly, possibly leading to the failure of kinematic analysis. Is there a method to move the entire exoskeleton model as a whole to match the position of the human body, rather than moving the position of the human body to match the exoskeleton?

Best regards,

Ark

Hi Ark,

I also encountered these problems.

  1. Based on my experience using AnyBody, the x,y,z axes of model inherit the properties of itself in SOLIDWORKS. The origin position in the assembly corresponds to (0, 0, 0) in AnyBody. If you don't want to adjust model's r0 and Axes0 in AnyBody, you need to plan the pose of Exo in advance in SOLIDWORKS. The relevant dimensions and initial positions of the human body model need to be considered in advance when assembling the exoskeleton.

  2. Based on my understanding of AnyBody, the various constraints you have set will not work before running the analysis. After running the analysis, AnyBody will start calculating and solving based on constraints. At this point, the various components in your Exo will be connected under constraints and operate like a whole. The initial position you set is only to help the software solve faster. I think if you set enough constraints and are tight enough, even if you place the two components that should have been connected in Exo at the South Pole and North Pole, and run the analysis, they can still be finally connected and work together :grinning:.It seems impossible to move Exo as a whole in AnyBody, perhaps? :thinking: This requires more professional personnel to answer.

Best regards,
Meng

Hi Ark,

I think Meng answered your questions mostly. I will just add my two cents:

  1. This is a real issue and is something we have heard on the forum before. We have noted this and will try to do something about it. It's just hard to say when, amongst all the other activities that are planned.

  2. Meng's explanation about r0 and Axes0 is correct. At load-time, only r0 and Axes0 are used. It's only when the analysis is run that the constraints are solved. There is just one extra point that I can add on how to move the whole exo together when you set r0 and Axes0. You should set r0 and Axes0 of one segment, and the rest of the segments should make use of the r0 and Axes0 values of the first segment, plus translational and rotational offset. Basically, set r0 and Axes0 of the remaining segments as a function of the r0 and Axes0 of the root segment. You can find some inspiration if you look at the code for the human model. This is how all the human model is moved together at load-time when you change the pelvis position and rotation, or change some joint angles through Mannequin.any file. :wink:

Best regards,
Dave

Dear Meng and Dave,

Your insights and guidance have resolved my doubts, and I believe I now understand how to properly adjust the EXO model to match human positions. Thank you very much for your assistance!

Best regards,
Ark