I am working on arm26 model, to which I added a coordinate actuator at the elbow joint. I would like to perform forward simulations by controlling the actuator with torque values provided externally. In particular, my goal is to compute torque values with a Simulink model and to provide them to the actuator.
So far I managed to do something similar in a Matlab cycle, by manually setting the model controls at each iteration:
Code: Select all
for time = 0:duration/dt
mymodel.setControls(state, controls);
manager = Manager(mymodel);
state.setTime(time*dt);
manager.initialize(state);
state = manager.integrate(time*dt+dt);
end
Could you please explain to me whether following this approach will invalidate my results? And if yes, why?
Do you have alternative suggestions to do this? I know the traditional way of doing something similar would be by using controllers. However, I am not sure how to provide external torque values to them.
Thank you all!
Elena