Skip to main content

Neural Control Personalization

Tutorial Developers: Robert Salati, B.J. Fregly, Rice Computational Neuromechanics Lab, Rice University

Last Updated: 3/10/2026

In this step for the soccer kicking example, you will use the Neural Control Model Personalization (NCP) tool to calibrate a muscle synergy-based neural control model. This NCP run will be different from NCP in the previous tutorials though because we did not run MTP beforehand. Instead of using NCP to fit muscle activations and joint loads, we will only be using it to fit joint loads. Used this way, NCP is similar to OpenSim's Static Optimization tool, but it has a muscle-synergy structure imposed.

This tutorial will use your previously calibrated OpenSim model Kicking_Model_JMP.osim.

The data used for this tutorial are already processed for you and are in the preprocessed folder. This folder includes ground reaction force data in GRFData, inverse dynamics joint loads in IDData, inverse kinematics joint angles in IKData, and muscle analysis moment arms in MAData. NCP will only use the data in IDData and MAData

Setting up an NCP settings file

  1. Activate the NMSM GUI in OpenSim by navigating to Tools>User Plugins, and click rcnlPlugin.dll.
  2. With Walking_Model_jmp.osim selected in the OpenSim GUI, navigate to Tools>Model Personalization>Neural Control Personalization.
  3. Set the Osimx file to Kicking_Model_jmp_gcp.osimx
  4. Set the Data directory to preprocessed
  5. Set the Results directory to NCPResults
  6. Set the Coordinate List to hip_flexion_r knee_angle_r ankle_angle_r
  7. Leave the Activation muscle groups and Normalized fiber length muscle groups empty. This model uses a reduced set of muscles, so these groups don't serve much purpose.
  8. Keep Muscle tendon length initialization disabled.
  9. Keep MTP results directory empty.
  10. Add RightLeg to your Synergy set with 4 synergies.
  11. Save this settings file as NCPSettings.xml
  12. Open NCPSettings.xml in a text editor.
  13. Disable the activation_tracking cost term
  14. Enable the activation_minimization cost term and set the <max_allowable_error> to 0.1
  15. Set the max allowable error for moment_tracking to 2.

Running NCP

Open runNCPTool.m in Matlab and click run.

- Make sure the NMSM Pipeline Project file is open
Runtime

This NCP run will take 329 iterations to finish. These iterations are much faster than JMP and GCP.

Analyzing GCP Results

Plots should be automatically created by the runGCPTool.m script

Questions
  • What were the RMS errors for the joint moments?
  • What muscles were in each synergy?
  • Do you think that the number of synergies used in this run was appropriate? Try running NCP again with 3 or 5 synergies. What changed?