Page 1 of 1

Insanely huge residuals and joint torque

Posted: Tue Oct 03, 2023 8:13 am
by emklinkman
Hi,

I recently used AddBiomechanics to scale and run IK/ID on a custom lower body model based on Rajagopal 2015, used with experimental data collected during walking, fast walking, and incline walking under two conditions: 1.) no exoskeleton and 2.) exoskeleton. My IK/ID results look good for the no-exo condition, and my IK results look good for the exo condition, but my ID results produced massive (x10^4) joint torque values and equally as large (10^2 - 10^4) residual values.

I went back through my marker trajectories and GRF data and couldn't find anything out of the ordinary that would explain this discrepancy. I used .trc + GRF .mot files to run the initial AddBiomechanics analysis and tried using a C3D instead, but the global axes did not automatically convert the lab coordinate system (Z-up) to OpenSim coordinates (Y-up), and the joint torques were equally as gigantic as before.

I'm wondering if anyone: a.) has experienced this issue before, b.) might have an idea where the error is originating from, and/or c.) has suggestions for things to try to resolve the issue. You can email me at emilykk@umich.edu if you'd like to have a more in-depth conversation.

Thank you!

Emily

Re: Insanely huge residuals and joint torque

Posted: Mon Oct 09, 2023 9:58 am
by nbianco
Hi Emily,

Thanks for your post. I have a few basic questions to get started.

1) Does the model with the exo have modified mass properties to model the exo mass? This doesn't explain why the residuals and joint torques are so large, but would be helpful to know.

2) What do the GRFs look like when visualized against the model motion in the OpenSim GUI? Even if the forces look reasonable, if the COPs deviate away from the foot suddenly, that could lead to large residuals and joint torques.

Best,
Nick

Re: Insanely huge residuals and joint torque

Posted: Thu Oct 26, 2023 9:14 am
by emklinkman
Hi Nick,

Thanks for your response. I've answered your questions below.

1.) Yes, the model does have modified mass properties to model the exo mass. The mass of the exo is about 1kg and it is worn on the shank bilaterally.

Code: Select all

<Body name="r_exo">
					<!--The geometry used to display the axes of this Frame.-->
					<FrameGeometry name="r_frame_geometry">
						<!--Path to a Component that satisfies the Socket 'frame' of type Frame.-->
						<socket_frame>..</socket_frame>
						<!--Scale factors in X, Y, Z directions respectively.-->
						<scale_factors>0.20000000000000001 0.20000000000000001 		0.20000000000000001</scale_factors>
					</FrameGeometry>
					<!--List of geometry attached to this Frame. Note, the geometry are treated as fixed to the frame and they share the transform of the frame when visualized-->
					<!--Set of wrap objects fixed to this body that GeometryPaths can wrap over.This property used to be a member of Body but was moved up with the introduction of Frames.-->
					<WrapObjectSet name="wrapobjectset">
						<objects />
						<groups />
					</WrapObjectSet>
					<!--The mass of the body (kg)-->
					<mass>1.065</mass>
					<!--The location (Vec3) of the mass center in the body frame.-->
					<mass_center>0.00093 0.15089 -0.02525</mass_center>
					<!--The elements of the inertia tensor (Vec6) as [Ixx Iyy Izz Ixy Ixz Iyz] measured about the mass_center and not the body origin.-->
					<inertia>0.035432 0.002314 0.034689 0.000483 -0.000318 -0.005102</inertia>
				</Body>
2.) The GRFs look to be applied at the correct location (calcaneus) at all times in the AddBiomechanics visualizer. I've loaded the GRFs to the IK results in the OpenSim GUI but can't figure out how to get them to show while the model is in motion. Any suggestions?

I ran IK and ID calculations through a MATLAB pipeline and the joint torque values are lower, but still 2-3x anticipated normalized joint torque values.

Thanks,
Emily

Re: Insanely huge residuals and joint torque

Posted: Fri Oct 27, 2023 9:45 am
by nbianco
Hi Emily,

Thanks for the info. In OpenSim, you can highlight both the motion and GRFs, then right-click and select "Sync. Motions" to visualize them together.

Nothing so far is suggesting to me where the issue is coming from. How different do the GRFs look between the exo and no-exo cases? Have you tried uploading the model without the exo along with the exo data to see if you get similarly large residuals?

-Nick

Re: Insanely huge residuals and joint torque

Posted: Wed Nov 01, 2023 10:48 am
by emklinkman
Hi Nick,

Thanks for the tip. I was able to visualize the GRFs with the motions and it appears that the forces are being applied at the proper location and not suddenly deviating away from the foot.

GRFs look nearly identical between exo and no-exo conditions; the exo is only ~1kg so similar GRFs is what I would expect.

I did upload and process the exo data with the non-exo model on AddBiomechanics both with (1) .trc + .mot and (2) .c3d files; residuals are still high (~150N) across both. I am still waiting for the exo model + exo data .c3d data to process on AddBiomechanics (has been queued on SLURM cluster since Monday) to compare it with no-exo model + exo data.

Re: Insanely huge residuals and joint torque

Posted: Wed Nov 01, 2023 3:34 pm
by nbianco
residuals are still high (~150N) across both
Residual forces around ~150 N are definitely high, but perhaps not excessively large, especially for vertical forces. Are the joint torques still in the ~10^4 range?

I'm still not quite sure where the problem is here. One thing to try: only run AddBiomechanics through the scaling and inverse kinematics steps, and then use the results to run inverse dynamics in the OpenSim GUI. If the residuals are still high, there might be some artifact in the data causing the issue. If not, maybe there is something funny happening in the dynamics fitting step in AddBiomechanics. Could you also upload a plot of the residuals?

Regarding SLURM: we recently pushed some bug fixes related to jobs being infinitely queued on SLURM. You might need to click "Force Reprocess" to get your processing job back in the correct queue.

-Nick

Re: Insanely huge residuals and joint torque

Posted: Thu Nov 09, 2023 2:32 pm
by emklinkman
I've been waiting for my data to reprocess on AddBiomechanics for over a week now. I've force-reprocessed and also created a new subject and re-uploaded data. They're stuck in "Queued on SLURM cluster", so I don't know if the torques are still in the 10^4 range. I will reply again if they do end up processing. The joint torques from the MATLAB code are not in the 10^4 range, but peak values are still about 3-4x bodyweight (100s of Nm), which is about 3-4x what you would expect according to the literature.

I will also upload a plot of the residuals once my data reprocess on AddBiomechanics.

Thanks!

Re: Insanely huge residuals and joint torque

Posted: Tue Nov 14, 2023 11:00 am
by nbianco
Hi Emily,

Apologies, there is a bug in the processing server causing some jobs to get lost (it's happening to me too). We are investigating the issue now.

Best,
Nick

Re: Insanely huge residuals and joint torque

Posted: Mon Nov 20, 2023 8:09 am
by emklinkman
Hi Nick,

Thanks for the update. Hopefully you can solve the issue.

Cheers,
Emily

Re: Insanely huge residuals and joint torque

Posted: Mon Nov 20, 2023 11:15 am
by nbianco
Hi Emily,

We recently pushed a fix for the queueing issue. Try reprocessing your trials and see if it works for you.

Best,
Nick