Build the complete closed-loop system

So far we've got two models: a simple cruise controller and a beautiful car. Until now, they've been treated separately in an open loop. Remembering what we learned in the previous chapter, we're going to place the required blocks and connect them in a closed loop.

Let's open both the models and copy them to a new model named cruise_control_sim.slx. If their workspaces aren't loaded automatically, load them by dragging them from their folders to the MATLAB's Command Window and save the new workspace as cruise_control_sim.mat. It's suggested to have the new workspace loaded automatically via the PreLoadFcn model callback as we have learned in the previous chapter.

In order to see what's happening inside the engine, ...

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.