Using Computed Muscle Control

  1. Load the Upper Extremity Model.  The model (arm26.osim) can be found in the Models folder in the directory where you installed OpenSim. 
  2. Open Computed Muscle Control Tool. To open the tool, select Compute Muscle Control… from the Tools menu.
  3. Specify Filtered Input Motion. Browse to the inverse kinematics directory and select the Desired kinematics file
    (e.g. ..\InverseKinematics\arm26_InverseKinematics.mot), check the Filter kinematics option, and enter a cutoff frequency of 6 Hz.
  4. Specify Tracking Tasks. Browse to select the tasks file (e.g., arm26_ComputedMuscleControl_Tasks.xml) specifying the joint coordinates for CMC to track and their relative weightings as well as the Kp and Kv gains on the errors.
  5. Specify Actuator Constraints. Browse to select the constraints file (e.g., arm26_ComputedMuscleControl_ControlConstraints.xml) specifying the maximum (or minimum) value used to constrain the allowed values of the actuator controls.
  6. Specify Time Range. The time range for the forward simulation is specified and these should be set from 0 to 1 sec to correspond to the interval upon which the motion was found from inverse kinematics.
  7. Set CMC look-ahead window. A time window of 0.01 is generally sufficient for muscle activations to change enough to produce the desired accelerations.
  8. Specify Output Directory. Set the output Directory (e.g., ..\ComputedMuscleControl\Results), so that you are able to compare the results of a CMC simulation with Forward Dynamics simulations using Nonphysiological and Physiological controls generated earlier by Static Optimization.
  9. Specify Additional Model Actuators. Under the Actuators and External Loads tab, set the actuator settings to Append (rather than replace) and edit the Additional force set files field by adding an actuator set file (e.g., arm26_Reserve_Actuators.xml) containing reserve torques.
  10. Save Settings. Use the Settings > button to save your settings to a setup file (e.g., arm26_Setup_ComputedMuscleControl.xml).
  11. Run CMC Tool. You will see the model begin to move as muscles contract and accelerate the model. When the simulation has completed by reaching the end of the specified time range, the specified output directory will be populated by states files (e.g., arm26_states_degrees.mot) and the corresponding motion file (e.g., arm26_states) will be associated with the model in the GUI.

Changing the Desired Kinematics

  1. Create New Desired Kinematics. Edit the original Desired kinematics file (e.g., ..\InverseKinematics\arm26_InverseKinematics.mot) by specifying different shoulder elevation angle versus time (e.g., copy and paste elbow flexion values to shoulder elevation). Save the new file (e.g., arm26_SpecifiedShoulder.mot)
  2. Specify New Input Motion. Browse and select the newly created Desired kinematics file (e.g., arm26_SpecifiedShoulder.mot), check the Filter kinematics option, and enter a cutoff frequency of 6 Hz.
  3. Run CMC Tool. You will see the model begin to move to match the new kinematics.

Changing the Tracking Tasks

  1. Change Tracking Weight. Edit the tasks file (e.g., arm26_ComputedMuscleControl_Tasks.xml) or use the Property Editor to reduce the r_shoulder_elev weight from 1.0 to 0.0.
  2. Specify New Tracking Tasks. Browse and select the new tasks file (e.g., arm26_ComputedMuscleControl_Tasks.xml) or save new task from the Property Editor.
  3. Run CMC Tool. You will see the model begin to move while tracking the elbow flexion well but not the shoulder elevation.

Changing the Actuator Constraints

  1. Change Actuator Constraint. Edit the constraints file (e.g., arm26_ControlConstraints.xml) or use the Excitation Editor to limit BIClong control to a maximum of 0.05.
  2. Specify Actuator Constraints. Browse and select the new constraints file (e.g., arm26_ControlConstraints.xml) or save new constraint from the Excitation Editor.
  3. Run CMC Tool. You will see the model begin to move by using other actuators in lieu of BIClong.

Changing the CMC Look-Ahead Window

  1. Change CMC Look-Ahead Window. Set the look-ahead time to 0.5 rather than 0.01.
  2. Run CMC Tool. You will see the model begin to move, but the control will be too coarse to allow for good tracking.

 

Return to the list of Examples and Tutorials