Simscape Multibody: external force and motion inputs, reaction torque sensing.

Hello everyone!
I'm using simscape multibody and I'm studying a simple 2-links multibody system.
The frame (1st link) is connected to the 2nd one through a revolute joint coupling.
I'd like to apply:
  • a vertical external force (Fext) at the end of the 2nd link
  • vary the angle-joint position (theta) from 45° to 60° (therefore, apply a vector, as the angle input, to the joint in Simscape)
The purpose of this study is to sense the Reaction torque (T) at the joint that balances the Fext so that the system stays sill (for every configuration of theta).
How can I do it using Simscape multibody's blocks?
Thank you very much in advance :)

 Accepted Answer

Hi ALESSIA,
You can use the External Force and Torque block to provide Fext. Set the resolution frame to world so that you can set it on whatever axis "down" is. For the revolute joint, under Actuation you can set Torque to "Automatically Computed" and Motion to "Provided by Input" to specify the joint angle.
If you're looking at multiple static positions (i.e. not changing during simulation) you can just run multiple simulations varying theta.

4 Comments

Hi Dallas, thank you very much for your answer, really appreciated.
What if I wanted to run multiple static problems (as you said at the end of your kind answer) but by varying the value of theta a lot? Like with a 1 degree step, from 45 to 110 [°].
Is there an automatic way to let Simscape do that instead of changing manually the theta value (since it would mean chainging it many many times)?
Thank you :)
I would make theta a MATLAB variable and then you could script running the model over the range you want e.g.
mdl = 'my_model_name';
theta = 45:110
for idx = 1:length(theta)
simIn(idx) = Simulink.SimulationInput(mdl);
simIn(idx) = setVariable(simIn(idx),'theta',theta(idx));
end
simOut = sim(simIn);
Simulation input objects are nice since you can easily go to running in parallel if you have the parallel computing toolbox by changing sim() to parsim().
You could also do this interactively with the Multiple Simulation Panel.
Also look into using Fast Restart to speed up the process.
Hello again @Dallas Perkins. Thank you for all these useful informations.
I have another (and hopefully also last) question for you.
I managed to simulate multiple static simulations by varying theta with the script you suggested. However, I wasn't able to get the Torque output for each specified cofiguration. A better explanation of what I'd like to obtain, down here:
When I simulated just one case scenario (thus one value of theta), I gathered the Torque value from the "sensing actuator torque" output of the revolute-joint block, and then visualized it using a simscape scope block.
How can I plot the different torque values (of a specific time instant) for each theta value?
I've read that "res = get(simOut,name)" could be used but I wasn't able to understand the name of a revolute-joint output, and, specify a specific time value.
Thank you
I would send the torque output into a PS-Simulink converter and then log that signal in Simulink. Then after you simulate the model the data will be stored in out.logsout if you have the default logging configuration.

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!