Modelling and control by Anthony Rossiter

# Use of MATLAB with control system analysis and design

This is a brief section on how to use MATLAB to support learning of topics witin the control, systems and modelling theme of engineering programmes. It is not intended to be comprehensive but rather covers the basic skills required for introcuctory modules. It is implicit in several of these chapters that students have core competence in any related mathematical or engineering topics for the engineering context being tackled in the MATLAB code. This chapter contains the topics listed below. Under each topic there are hardcopy (pdf) notes and a video talk through wit live MATLAB demonstrations.

Some historical short courses on generic MATLAB skills (variable types, loops conditionals, function files, etc.) are available at the following website.

## Use of Matlab 1 - solving ODEs

Demonstrates the use of the MATLAB ODE solver through a few case studies and live screen shots from MATLAB.

• A summary of key facts and derivations is given in the pdf file.
• A talk through video is on youtube.
• Readers may find it useful to see a brief overview of how to do plotting in MATLAB and how to plot functions represented by symbolic exprssions (as is the solution of the ODE).

## Use of Matlab 2 - creating transfer functions

Demonstrates how to enter transfer functions into MATLAB. Also illustrates short cut for creating polynomials from roots. Uses live screen shots from MATLAB.

• A summary of key facts and derivations is given in the pdf file.
• A talk through video is on youtube.
• An extra note is provided to illustrate MATLAB notation/convention for representing polynomials and also how to automate factorisation of polynomials.

## Use of Matlab 3 - closed-loop transfer functions

Demonstrates how closed-loop transfer functions can be formed for the various signals in a simple feedback loop. Uses live screen shots from MATLAB.

• A summary of key facts and derivations is given in the pdf file.
• A talk through video is on youtube.

## Use of Matlab 4 - analysing transfer functions

Shows how useful information can be extracted from a transfer function such as the pole and zero positions and steady-state gain. Uses live screen shots from MATLAB.

## Use of Matlab 5 - step responses

Demonstrates simple creation and display of step response information, including how to control the end time and display to meet user needs. Uses live screen shots from MATLAB.

• A summary of key facts and derivations is given in the pdf file.
• A talk through video is on youtube.

## Use of Matlab 6 - closed-loop offsets

Shows how the user can either produce numerical output for defining the offset to a step or produce plots which illustrate this. Uses live screen shots from MATLAB.

• A talk through video is on youtube.

## Use of Matlab 7 - responses for general inputs

Demonstrates the use of lsim.m which allows the user to enter time varying input signals into a transfer function and compute the corresponding output. This could be useful for frequency response and other scenarios. Uses live screen shots from MATLAB.

• A talk through video is on youtube.

## Use of Matlab 8 - offset to ramps

More for completeness this video shows that lsim.m allows the display of ramp following scenarios. Also gives simple code for computing offset, when that is finite. Uses live screen shots from MATLAB.

• A talk through video is on youtube.

## Use of Matlab 9 - trial and error design for offset

It can be useful for students to explore how changes in compensator affect closed-loop behaviour. This video illustrates how one can develop short code snippets that allow efficient iteration or trial and error like processes for such investigations; focusses on offset. Uses live screen shots from MATLAB. .

• Talk through video is on youtube.

## Use of Matlab 10 - trial and error design for closed-loop poles

It can be useful for students to explore how changes in compensator affect closed-loop behaviour. This video illustrates how one can develop short code snippets that allow efficient iteration or trial and error like processes for such investigations; focusses on closed-loop poles. Uses live screen shots from MATLAB.

• Talk through video is on youtube.

## Use of Matlab 11 - trial and error for overall closed-loop analysis

It can be useful for students to explore how changes in compensator affect overall closed-loop behaviour. This video illustrates how one can develop short code snippets that allow efficient iteration or trial and error like processes for such investigations; focusses on how to view numerous attributes at once. Uses live screen shots from MATLAB.

• Talk through video is on youtube.

## Use of Matlab 12 - Making a MATLAB GUI

A brief video demonstrates the making of a MATLAB GUI.  