Book Image

Getting Started with Simulink

By : Luca Zamboni
Book Image

Getting Started with Simulink

By: Luca Zamboni

Overview of this book

Simulink is an engineer's Swiss army knife: instead of spending the day typing out complex formulas, Simulink enables you to both draw and execute them. Block after block, you can develop your ideas without struggling with obscure programming languages and you don't have to wait to debug your algorithm - just launch a simulation! Getting Started with Simulink will give you comprehensive knowledge of Simulink's capabilities. From the humble constant block to the S-function block, you will have a clear understanding of what modelling really means, without feeling that something has been left out. By the time you close the book, you'll be able to further extend your modelling skills without any help. We''ll start with a brief introduction, and immediately start placing the first blocks. Little by little, you'll build a car cruise controller model, followed by the mathematical model of a sports car in order to calibrate it. Then you'll learn how to interface your Simulink model with the external world. This book will give you an easy understanding of the tools Simulink offers you, guiding you through a complex exercise split into the three main phases of Simulink development: modelling, testing, and interfacing.
Table of Contents (11 chapters)

Test with other sources


So far we've learned how to use the Step source block. This is arguably the most important source because it presents clearly the system's transient answer to a stimulus.

But that's about it; it doesn't show the response to a wave, a random signal, or a noise.

A more thorough test with other sources could help us detect problems that were overlooked. For instance, we didn't take into account while testing that the car can show a very different response in lower gears: at 100 km/h, it was running in fourth gear.

Sine Wave

The cruise controller is acting only on the throttle, so we can predict that it will be hard for it to follow decreasing speeds.

Let's try using a Sine Wave block as the target speed source, which was configured as follows:

  • Bias: 100 (km/h)

  • Amplitude: 20 (km/h)

  • Frequency: 0.2 (rad/s)

The simulation result is shown as follows:

Our cruise controller can't use the brakes, so it isn't able to follow the falling side of the wave. But it's able to rise up fast...