Control constraints for CMC

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Ilse Forschelen
Posts: 1
Joined: Thu Mar 16, 2023 12:44 am

Control constraints for CMC

Post by Ilse Forschelen » Mon Oct 02, 2023 11:46 pm

Hi OpenSim team,

For my master's thesis, I'm working with the ARMS lab hand-wrist model. The end goal of my project is to investigate the changes in wrist kinematics after implantation with a new wrist implant. Therefore, I adjusted the ARMS lab model with this new implant. Next, I want to see if the same muscle activations/excitations still result in the same motion. As I don't have any muscle activation data I want to use the kinematic data provided with the ARMS lab model. My setup is thus to perform a CMC first on the ARMS lab model to determine the muscle activations. Next, I want to perform a Forward dynamics simulation on both the ARMS lab model and my model to see if the motion is the same.

Currently, I have the CMC working pretty well. However, the resulting muscle activation of one muscle (OPP) is at certain times seemingly random:
OPP original.png
OPP original.png (52.88 KiB) Viewed 347 times
'
I tried to make a control constraint to ensure the muscle wouldn't be activated before t=4.3 and after t=7.2.
After some trial and error, the best I could come up with resulted in the following:
OPP constrained.png
OPP constrained.png (55.99 KiB) Viewed 347 times
.
I used the following code in the control constraint file:

Code: Select all

			<ControlLinear name="OPP.excitation">
				<is_model_control> true </is_model_control>
				<min_nodes>
					`<ControlLinearNode>
						<t>1</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>4.2</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>4.35</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>4.5</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>4.8</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>4.9</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>5</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>5.1</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>5.1</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>5.3</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>5.4</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>5.5</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.2</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.4</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.5</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.6</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.7</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.8</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.9</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>7</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>7.1</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>8.999</t>
						<value>0.02</value>
					</ControlLinearNode>
				</min_nodes>
				<max_nodes>
					<ControlLinearNode>
						<t>1</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>4.2</t>
						<value>0.02</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>4.35</t>
						<value>0.1</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>4.5</t>
						<value>0.2</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>4.6</t>
						<value>0.25</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>4.7</t>
						<value>0.31</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>4.8</t>
						<value>0.42</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>4.9</t>
						<value>0.53</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>5</t>
						<value>0.64</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>5.1</t>
						<value>0.72</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>5.2</t>
						<value>0.75</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>5.3</t>
						<value>0.8</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>5.4</t>
						<value>0.82</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>5.5</t>
						<value>0.84</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6</t>
						<value>0.86</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.2</t>
						<value>0.84</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.4</t>
						<value>0.76</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.5</t>
						<value>0.7</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.6</t>
						<value>0.6</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.7</t>
						<value>0.45</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.8</t>
						<value>0.27</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>6.9</t>
						<value>0.18</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>7</t>
						<value>0.08</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>7.1</t>
						<value>0.06</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>8.999</t>
						<value>0.02</value>
					</ControlLinearNode>
				</max_nodes>
				<kp>     100.00000000 </kp>
				<kv>      20.00000000 </kv>
			</ControlLinear>
If someone could help me with this, it would be much appreciated! :)
Kind regards,
Ilse

Tags:

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: Control constraints for CMC

Post by Thomas Uchida » Tue Oct 03, 2023 7:05 am

You could try adjusting the "CMC look-ahead window" (the property is called cmc_time_window). Here's the description from the setup file:

Code: Select all

<!--Time window over which the desired actuator forces are achieved.
    Muscles forces cannot change instantaneously, so a finite time window
    must be allowed. The recommended time window for RRA is about 0.001
    sec, and for CMC is about 0.010 sec.-->
<cmc_time_window> 0.01000000 </cmc_time_window>

POST REPLY