# Getting started with PID Controller | Simulink Tutorial

## PID controller Introduction

Proportional Integral Derivative controller (PID controller) is a control loop feedback mechanism (controller) commonly used in industrial control systems. A PID controller continuously calculates an error value e(t) as the difference between the desired set point and a measured process variable and applies a correction based on proportional, integral, and derivative terms (sometimes denoted PI, and D respectively) which give their name to the controller type.

The general representation of PID controller is:

Where Kp, Ki, and Kd, all non-negative, denote the coefficients for the proportional, integral and derivative terms respectively.(Sometimes denoted as P, I and D)

In this model:

• accounts for present values of the error. For example, if the error is large and positive, the control output will also be large and positive.
• accounts for past values of the error. For example, if the current output is not sufficiently strong, the integral of the error will accumulate over time, and the controller will respond by applying a stronger action.
• accounts for possible future trends of the error, based on its current rate of change.

## Model description and simulation

### Main components:

Some of the screenshots of PID controller is shown below with explanation.

The simulation is given for plant/system which uses PID controller to solve the transfer function which represents the plant/system.

Here I’m giving step signal as the input source to check the output characteristics of the plant given as transfer function giving gain as 5 and transfer function as s / (s2+4s+8).The model is simulated and the output characteristics are obtained using the scope.

Here same connections are taken and gain value is changed to 3 and the change in output characteristics is obtained.

In this case, the gain is maintained as 5 but the transfer function is changed to s/(s2+2s+1) and the output characteristics are obtained.

Here the gain is given as 5 and the transfer function is given as s/(s2+2s+4) and the output characteristics are obtained.

## Result:

The graph obtained using PID controller feedback circuit can be used to find the error and applies the correction value using negative feedback and respective Proportional, Integral and Derivative values to maintain the output at desired set point.

The Graph can be used to find stability, response time, settling time and rise time of the given plant/system.

The functionality of PID controller can be understood better if you have prior knowledge about the control system.

### Recommended Posts

##### Test Post

17 Feb 2018 - Tutorial

##### Counters using conditionally executed subsystems | Simulink Tutorial

16 Feb 2018 - Simulink, Tutorial

##### Regulating drum boiler pressure

16 Feb 2018 - Simulink, Tutorial