Our first model – a cruise controller

There aren't many things in the world funnier than a sporty car. That's a fact.

Let's imagine we want to develop a simple cruise control system for such a car. This system will perform the following tasks:

  • Read the target vehicle speed [km/h]
  • Read the current vehicle speed [km/h]
  • Command the throttle with the gas pedal [from 0 (not pressed) to 1 (fully pressed)]

This system will behave like a driver that keeps the car going straight using only the gas pedal to match the desired speed.

Let's get started!

Step 1 – create and save the model

After pointing MATLAB to your preferred working folder (for example, a folder called 1386EN_02 located in your home folder) and opening a new model, click on the Save button, or

Get Getting Started with Simulink now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.