Prescribing Control files for individual Actuators in Matlab

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Casey Harn
Posts: 1
Joined: Sun Jan 19, 2014 9:13 pm

Prescribing Control files for individual Actuators in Matlab

Post by Casey Harn » Sun Mar 02, 2014 7:40 pm

I would like to assign two .xml control files, one to each muscle in the tug-of-war model for a forward dynamic simulation. I am using Matlab and currently I can add one controller for both muscles but then Matlab crashes when the forward simulation runs.

myPrescribedControllerMuscleA = PrescribedController();
PrescribedController('competitor1_controls.sto',1);
myPrescribedControllerMuscleA.setName('CaseyBmuscle');
myPrescribedControllerMuscleA.setActuators(model.updActuators());

model.addController(myPrescribedControllerMuscleA);
model.disownAllComponents();
model.print('tug_of_war_muscles_controller4.osim');


and the printed osim file look like this:

<ControllerSet name="Controllers">
<objects>
<PrescribedController name="CaseyBmuscle">
<!--The list of model actuators that this controller will control.The keyword ALL indicates the controller will controll all the acuators in the model-->
<actuator_list>muscle1 muscle2</actuator_list>
</PrescribedController>
</objects>
<groups />
</ControllerSet>

When I remove the underlined line above matlab doesn't crash when the simulation runs but the printed osim file doesn't seem to fully assign the controller, see below


<!--Controllers in the model.-->
<ControllerSet name="Controllers">
<objects>
<PrescribedController name="CaseyBmuscle">
<!--All properties of this object have their default values.-->
</PrescribedController>
</objects>
<groups />
</ControllerSet>

Does any one have advice on how I could do this successfully and run the forward tool without crashing Matlab?

Thanks in advance!

User avatar
Brian Umberger
Posts: 48
Joined: Tue Aug 28, 2007 2:03 pm

Re: Prescribing Control files for individual Actuators in Ma

Post by Brian Umberger » Thu Mar 06, 2014 7:36 am

Hi Casey,

I'm not positive, but I think if you want to use two different controls files you may need to add two different controllers to the model, one controlling muscle1 and another controlling muscle2. Can anyone confirm this?

Cheers,
Brian

POST REPLY