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)

Chapter 4. Using the Model

In the earlier chapters we've developed a simple cruise controller model and the controlled car model, and then we've tested and fine-tuned the controller model. All the work has been done in Simulink only.

We couldn't perform our model testing on something other than the car model, because we still lack an interface with an external system, outside Simulink. This external system could be the real car for those lucky ones who have a spare 147 GTA in their garage and all the hardware needed to command its engine control unit, or—more realistically—a car simulation software like the one provided with this book.

In this chapter we'll take a first look at the software and understand how it is exchanging the data.

We'll then learn how to develop custom blocks to communicate with the application and use them with our cruise controller model. Those custom blocks will be developed with the MATLAB scripting language, which has the advantage of having a simple and intuitive...