# Discrete PI Controller

Discrete-time PI controller with external anti-windup input

**Library:**Simscape / Electrical / Control / General Control

## Description

The Discrete PI Controller block implements discrete PI control with external anti-windup input.

This diagram is the equivalent circuit for the controller with external anti-windup input.

### Equations

The Discrete PI Controller block calculates the control signal using the backward Euler discretization method:

$u(k)=\left[{K}_{p}+\left({K}_{i}+du(k){K}_{aw}\right)\frac{{T}_{s}z}{z-1}\right]\text{e}(\text{k}),$

where

*u*is the control signal.*K*is the proportional gain coefficient._{p}*K*is the integral gain coefficient._{i}*K*is the anti-windup gain coefficient._{aw}*T*is the sampling period._{s}*e*is the error signal.

To prevent excessive overshoot, the block can use back calculation to implement an
external anti-windup mechanism. It inputs *du(k)*, the difference
between the saturated control signal,
*u ^{sat}(k)*, and the calculated
unsaturated control signal,

*u(k)*. It then multiplies the difference by the anti-windup coefficient and adds the amplified signal from the integral gain.

## Ports

### Input

### Output

## Parameters

## References

[1] Åström, K. and T. Hägglund. *Advanced PID Control.*
Research Triangle Park, NC: ISA, 2005.

## Extended Capabilities

**Introduced in R2017b**