MATLAB Answers

0

Is there a way to create a video of a multibody simulation which includes frame-by-frame readouts of certain parameters?

Asked by Kevin Gilliam on 7 Jun 2018
Latest activity Answered by Steve Miller on 1 Apr 2019
I have a multibody simulation, and I need to find some way to create a video just like the one you can export from Mechanics Explorer, except with a couple of readouts which display the value of certain parameters, frame-by-frame.
I'm pretty sure there is no way to add a numerical readout to a video in mechanics explorer directly, so here are the things I have attempted to figure out so far (unsuccessfully):
  • I could try to create separate video of my readouts, like from the dashboard blocks, which I could then just combine with the mechanics explorer video using other software. Is there a way to get a video file of the dashboard blocks from a simulation? I don't think a desktop recorder would work, since I need frame-by-frame values of the simulation.
  • I also suspect that I could use the 3D animation library somehow (no experience with it thus far)... It looks like I would have to rebuild the machine in the Virtual World file and connect it, which seems like a pain... So looking for any other options before I try to figure that out.
Any other suggestions?
Thanks!

  0 Comments

Sign in to comment.

1 Answer

Answer by Steve Miller on 1 Apr 2019

Hi,
To get a video that shows scope/dashboard block results synchronized with the Simscape Multibody animation, your best bet is to get everything on the screen as you want it, configure the simulation so that everything goes the same speed (i.e. the Mechanics Explorer animation doesn't go "real time" while your simulation goes 10x faster than real time) and record it all at once.
To get everything to run at a synchronous speed...
  1. You can set the maximum step size quite small.
  2. Starting in R2018a, you can use Simulink Pacinghttps://www.mathworks.com/help/releases/R2018a/simulink/ug/simulation-pacing.html
  3. There are various tools on the File Exchange for making Simulink models go at a fixed pace.https://www.mathworks.com/matlabcentral/fileexchange/29107-real-time-pacer-for-simulink
--Steve

  0 Comments

Sign in to comment.