So these might be some very basic questions because I'm still getting familiar with the MATLAB-OpenSim API (and OpenSim as a whole), but I can't seem to find anything online so here goes:
I am trying to optimize the torque profile generated by a motor that I added to a model. I have added a motor to my model (added to my OSIM file as shown below). I also wrote code that generates a torque profile based on a set of parameters. My end goal is to optimize that torque profile to minimize an output from a specific tool (joint loading, metabolic cost, whatever I'm interested in). I'll probably end up using FMINCON or something similar to minimize the output of the tools I'm looking at.
How do I access the controller for a specific motor from the API (ie. what methods can I use)?
I saw that you can easily adjust the optimal force of a coordinate actuator and the force over time is then calculated by CMC, but how do I set the force produced over time myself? Is there a way that I can provide a set torque profile that is the same length as one of my simulations and use that to drive the motor?
Any suggestions or resources that you might have are much appreciated! Thank you!!
Driving CoordinateActuator/motor using a set torque profile from the API in MATLAB
- AUDE LEFRANC
- Posts: 16
- Joined: Wed Sep 18, 2019 12:47 pm
Driving CoordinateActuator/motor using a set torque profile from the API in MATLAB
- Attachments
-
- model.JPG (53.28 KiB) Viewed 548 times
Tags:
- Carmichael Ong
- Posts: 401
- Joined: Fri Feb 24, 2012 11:50 am
Re: Driving CoordinateActuator/motor using a set torque profile from the API in MATLAB
In OpenSim, there's a clear distinction between an Actuator and a Controller, but this can be confusing because of the "optimal_force" property for actuators. The final generalized force value produced by an actuator is (control signal)*(optimal force). One way to get a certain control signal over time would be through using a PrescribedController.
https://simtk.org/api_docs/opensim/api_ ... oller.html
https://simtk.org/api_docs/opensim/api_ ... oller.html