Control Tuning Using Simulink Auto Tune Feature

One of the easiest methods to tune a controller is through automatic tuning. This is the principle of control tuning using Simulink auto tune feature. Unlike root locus tuning in Matlab, control tuning using Simulink auto tune feature is very easy to do and can be done in a short duration only. However, you still need to know the plant transfer function in order to proceed to the automatic tuning. For other tuning options, click THIS.

Below is the step by step procedure for control tuning using Simulink auto tune feature.

Step 1: Open Simulink Window

Simulink environment is within Matlab. To open it, open first Matlab then look for the Simulink library and click it.

Figure 1
Matlab R2012B Toolbar

Another method is to type “Simulink” in the command window.

Figure 2

Below window will appear after executing either above procedures.

Figure 3


Step 2: Start a New Model

Under File click New then Model or follow below snapshot.

Figure 4

A new blank model will appear

Figure 5


Step 3: Start Putting Block to the New Model

On Simulink Library Browser, click Continuous then drag and drop a Transfer Fcn and PID Controller block to the new model.

Figure 6

Under Sink drag and drop an Oscilloscope to the model.

Figure 7

Under Sources, drag and drop a Step block into the model.

Figure 8

Under Math Operations, drag and drop a Sum block into the model.

Figure 9

Step 4: Arrange and Connect the Blocks

To move block, left click on the block and hold then move. To rotate a block, right click on it and go to Rotate & Flip section. To connect the blocks, move the cursor on top of the arrow on the block and left click then hold and drag to the other block’s arrow. To delete a connection, left click on the connection then press keyboard delete button.

After arrangement and connections, this must be the look of the new model.

Figure 10

The Step block serves as the reference. The Sum symbol is the error amplifier. The PID block is the controller we are going to design while the Transfer Fcn is the plant transfer function. The scope is use to view the output waveform.


Step 5: Change Block Parameter

Double click the Step block to change parameter. If you will not change the setting , the default will be used. Don’t worry the default is already a good setting.

Double click the Sum block. Under List of signs in the Main tab, replace the right positive sign with a negative sign. A negative sign denotes a negative feedback. Click Apply then OK.

Figure 11

Double click on the Transfer Fnc block and change the numerator and denominator coefficients.              The numerator is the numerator of the plant transfer function while the denominator is the plant transfer function denominator.

The plant transfer function must be structured as below.

Simulink Autotune

In the above transfer function, the numerator coefficient is [1 1] while the denominator is [10 -2 -1]. Take note that each number is separated with a space.

Click Apply then OK.

Figure 13

Your circuit must look like below if you follow above procedures.

Figure 14

Step 6: Control Tuning Using Simulink Auto Tune Feature

Double click the PID Controller block and on below window click on Tune button.

Figure 15

After clicking Tune button the PID Tuner will show.

Figure 16

Start tuning by moving the tuner button in red box in below figure. To move the button, left click and hold. After you get the desired response, tick the automatically update block parameters. Click Apply then OK.

Figure 17

Step 7: Viewing the Controller Gains

After clicking OK, below window will show. The compensator gains are listed under Proportional, Integral and Derivative regions. The compensator formula is also indicated in the upper right of the window. Click OK to close the window.

Figure 18

Step 8: Viewing the Simulation Result

Go to the model and click Run as below snapshot.

Figure 19

Right after; double click on the Scope to view the response on a Step input.

Figure 20

Step 9: Changing Compensator Type

What we used above is PID type compensator. You can choose any type you want. Double click the PID block then under Controller section select the compensator type on the drop down list.

Figure 21

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.