Seth sometimes tells me: Grab the low hanging fruit. When debugging Simulink models, this means looking at the information easily available.
Here are the first three things I usually look at when I see unexpected results in a model.
With those options enabled, I can easily identify that the following state-space system has 2 inputs, 3 outputs and 4 states.
In Simulink, you do not need to specify the data type of each signal. In most cases, you specify the data types of a few sources and the Simulink engine propagates it to other blocks. When a model gives unexpected results, it is always a good idea to display the Port Data Types
For example, how could someone explain that Simulink thinks that 5 is equal to 1? Take a look at this model:
Sample Time Colors and Legend
I have seen too many cases like the following model, where the user designs a position controller to run at 4ms, but forgot to set the sample time of the driver block reading the position of the motor:
Now it's your turn
What are the things you usually look at when debugging a model? Leave a comment here.
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.