General Simulink Debugging Advice

1 view (last 30 days)
najusten
najusten on 19 May 2019
Answered: Jonas on 28 May 2019
Hello everyone,
I am currently working on a Simulink model containing various feedback loops that connect three different models (subsystems). I have gone through the model extensively and debugged everything which came up, but the results are still incorrect, and not what I would expect.
I have run all three models in isolation and the results are correct, it is when they are coupled that problems come up. Now in the past, when I have been debugging slightly simpler models, I have essentially hand calculated an timestep of the model myself where possible, to compare the results, or backtracked unexpected results through a series of scopes, thereby gradually getting to the fault in the model.
My trouble here, is that I know that the problem arises where the subsystems are coupled, however I am unable to narrow it down any further than that because the feedback loops connect the subsystems in various places.
I am not too experienced in Simulink, and this is the most advanced project I have attempted, so I was just looking for some input on how others go about getting their codes to run, and finding any sources of error? I'm open to any advice; I've combed through the model more times than I care to admit, and am looking for advice on different strategies that might work better in this case.
Thanks for your help everyone!
  1 Comment
Santosh Gnanasekaran
Santosh Gnanasekaran on 23 May 2019
Model 1 Model 2 Model 3
a. Check the values that are received at model 1 out put and the same is taken in to model 2.
Because there can be a issue in round off these numbers.
Check the same from Model 2 to Model 3
b. If youtr using the fixed point implementation have a look at the scaling part at the interfaces.

Sign in to comment.

Answers (1)

Jonas
Jonas on 28 May 2019
Go to 'Display' and check things like Sampling times, Execution order, Port Data Types, Signal Dimensions. A lot of these aspects can vary when combining subsystems which seem to work separately.

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!