## Table of Contents

A PID controller, standing for Proportional-Integral-Derivative controller, is a fundamental control loop feedback mechanism widely used in industrial control systems. A PID controller continuously calculates an error value as the difference between a desired setpoint and a measured process variable, and applies a correction based on proportional, integral, and derivative terms, hence the name.

## Proportional Control (P)

### Concept

The proportional term produces an output value that is proportional to the current error value. The proportional response can be adjusted by multiplying the error by a constant known as the proportional gain (πΎπ*K**p*β).

### Equation

π’(π‘)=πΎππ(π‘)*u*(*t*)=*K**p*β*e*(*t*)

where:

- π’(π‘)
*u*(*t*) is the control output. - πΎπ
*K**p*β is the proportional gain. - π(π‘)
*e*(*t*) is the error at time π‘*t*.

### Example

Consider a simple home heating system where you set a desired temperature (setpoint). If the room temperature (process variable) is below the setpoint, the heater turns on. The further the temperature is from the setpoint, the more power the heater provides.

### Limitation

Proportional control alone can lead to a steady-state error because the system might not reach the exact setpoint due to the absence of corrective action when the error is small.

## Proportional-Integral Control (PI)

### Concept

The integral term addresses the accumulated past errors. The integral response is proportional to both the magnitude of the error and the duration of the error. This means the controller can eliminate the residual steady-state error that occurs with pure proportional control.

### Equation

π’(π‘)=πΎππ(π‘)+πΎπβ«0π‘π(π)βππ*u*(*t*)=*K**p*β*e*(*t*)+*K**i*ββ«0*t*β*e*(*Ο*)*d**Ο*

where:

- πΎπ is the integral gain.

### Example

Returning to the heating system, if the room is consistently cooler than the setpoint, the integral term increases over time, ensuring the heater stays on longer or at a higher power level until the setpoint is reached.

### Limitation

While the integral term helps eliminate steady-state error, it can lead to a situation called “integral windup,” where the controller accumulates a significant error during large disturbances or when the actuator is saturated, leading to overshoot and instability.

## Proportional-Integral-Derivative Control (PID)

### Concept

The derivative term predicts system behavior and thus improves the stability and response of the controller. It provides a control output based on the rate of change of the error, which helps to dampen the system’s response and reduce overshoot and oscillations.

### Equation

π’(π‘)=πΎππ(π‘)+πΎπβ«0π‘π(π)βππ+πΎπππ(π‘)ππ‘*u*(*t*)=*K**p*β*e*(*t*)+*K**i*ββ«0*t*β*e*(*Ο*)*d**Ο*+*K**d*β*d**t**d**e*(*t*)β

where:

- πΎπ is the derivative gain.

### Example

In the heating system example, if the room temperature starts to approach the setpoint too quickly, the derivative term will decrease the heater’s power output, preventing overshooting the desired temperature.

### Combining Terms

Each term in the PID controller serves a unique purpose:

**Proportional:**Corrects present error.**Integral:**Corrects past errors.**Derivative:**Predicts future errors.

This combination allows for more precise and stable control of a process.

## Tuning PID Controllers

### Methods

**Ziegler-Nichols Method:**This empirical method involves setting the integral and derivative gains to zero, increasing the proportional gain until the system oscillates, and then applying specific rules to set πΎπ*K**p*β, πΎπ*K**i*β, and πΎπ*K**d*β.**Software Tools:**Modern control systems often use software tools to auto-tune PID parameters based on the system’s response.

### Practical Example

Consider a cruise control system in a car. The setpoint is the desired speed. The process variable is the actual speed. The controller adjusts the throttle position to minimize the difference between the setpoint and the actual speed.

**Proportional Control:**Provides immediate throttle adjustments based on the speed error.**Integral Control:**Adjusts for any persistent difference in speed over time, ensuring the car reaches and maintains the set speed.**Derivative Control:**Smooths the throttle adjustments, reducing the risk of overshooting the target speed.

## Conclusion

PID controllers are vital in various engineering applications due to their robustness and effectiveness in providing stable and precise control. Understanding and tuning each termβproportional, integral, and derivativeβare crucial for optimizing system performance. By integrating these control strategies, engineers can achieve desired outcomes in complex systems, from industrial processes to everyday applications like home heating and automotive systems.