Viewing Simulation Results | Getting Started with Simulink, Part 3 - MATLAB & Simulink
Video Player is loading.
Current Time 0:00
Duration 6:04
Loaded: 2.72%
Stream Type LIVE
Remaining Time 6:04
 
1x
  • Chapters
  • descriptions off, selected
  • en (Main), selected
    Video length is 6:04

    Viewing Simulation Results | Getting Started with Simulink, Part 3

    From the series: Getting Started with Simulink

    Visualize simulation results using tools such as the Simulation Data Inspector to view and compare signal data from multiple simulations, or the Dashboard Scope to see your results directly in the Simulink® editor.  These tools make it easy to assess the behavior of your system after each simulation run so that you can make changes for improved system performance.

    Published: 23 Oct 2017

    Before getting into making the controller better, I would like to focus on some of the other signal visualization features so that we can have a better view of signals when we are tuning the controller.

    OK.

    So one thing I want to show is the fact that, instead of having a separate block outside of the Simulink model, like the scope block for visualizing signals, I would like to show this other block that we have, which is called Dashboard Scope. It's also similar to Scope block.

    But by bringing that block in within Simulink, it just becomes a part of the canvas. The scope just becomes a part of this canvas. And I can double click that block and connect the signals that I would want to monitor, the plant signal, and the input signal.

    OK, so this way you don't have to-- well, let's see, right? So you press OK. You run the simulation. Right, so this way, you don't have to open up the Scope block in order to see the results. You could see the results directly in the canvas itself, right?

    Exactly.

    So I guess, what I'd say about this is you have the option of what you want to do because some people might look at this and say, whoa, this is great. I always want to see the results directly on the model itself. But you've got to realize that's taking up some real estate on your model.

    Right.

    Yes, for our simple model here, that's fine. But your models are eventually going to get larger. So having the Scope block as a small way to get into it is another way to go. So it really depends on your preference and the type of model that you're working with.

    Yeah, and definitely Scope block does have some other benefits. If I just click the stepping options and Enable stepping back and choose the stepping back here, by number any number of steps-- I'm just choosing 50-- I can pause my Sim-- I can actually ask Simulink to pause my simulation when the time reaches five.

    And that way, basically, first of all, I can run my simulation directly from the Scope block. So if I'm in done with my modeling and I'm in my analysis mode, I can just use my Scope block, which is something you cannot do with the Dashboard block. But can simply run.

    And you see that signal gets paused.

    Oh, yeah.

    Yeah, and in this case, you can use other things like cursor measurements. And that will bring in the cursor measurements that you want to analyze that signal, and so on. It's useful when you are just doing signal analysis and there is an interesting data point that you want to analyze.

    OK.

    But if you are not into analysis, it's still in the design or exploratory mode, you can still use the canvas, use the Dashboard block. It also pauses.

    What if you have a signal-- OK, so you hover on a signal that's not currently being scoped. If you click on it, you could actually see the current value of the signal when you run the simulation then. So like step forward or advance.

    Yeah, I just paused that's my simulation. So I can actually use a Step forward, like you said, and step forward each time step or go back in time. That way you can look at how this value is changing at every event.

    That's nice. Yeah, yeah, so that's great. So that's useful as a debugging tool.

    Right.

    Now, our simulation is only going for 10 seconds.

    Right.

    If it were longer, maybe that would have a few more steps.

    Exactly.

    Actually, we could change that, right? So if we change that to 30 seconds--

    Yes, we can do that.

    --up there.

    Yeah.

    And then press play.

    Right now, we are in the previous simulation, so this value might not effect--

    Oh, yeah, we have to stop it. Yeah, that's true. So if you press Play now--

    It will again pause at five seconds.

    Yeah.

    And if I do a Step forward--

    OK, so maybe if you stop it--

    Right, and--

    Go back into the stepping parameters here. Change the move back and forward to, say, 10.

    Yeah, and that's long.

    Maybe that was too many.

    Bigger steps, yeah.

    All right, now--

    Now, if I run and pause it and do a Step forward--

    There we go.

    Yeah, so it just goes by 10 steps.

    And can you rehighlight the signal because then people can see-- yeah, OK, so the signal is changing each time you go through.

    Yes.

    So nice little debugging--

    Yeah, you can basically visually see and monitor what's going on here.

    Yeah, it's like adding a watch to a variable.

    Yeah.

    If you're familiar with that.

    Yeah.

    OK, great.

    So let me disable that, stop the simulation, maybe move this back to 10 seconds, and run my simulation one last time. OK, let me disable the pause as well.

    Yeah, we don't want the pause--

    The reason I want to do that is I want to get all the data, and then, once I tune my controller, I want to be able to compare between these two. And the way to do that is actually using this badge.

    Yeah, so this badge automatically got added to the signal when you added that Dashboard scope.

    Yes, exactly. So when I double click it, it will open the simulation data inspector. But it would have several runs already showing here because, after I added the Dashboard scope block, I have run my model several times.

    Yeah, so each time you run a simulation, it's storing that data within this simulation data inspector.

    Yeah.

    Related Products

    Up Next:

    View full series (9 Videos)

    View more related videos