# DC Current Controller

Discrete-time DC current PI control with integral anti-windup

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

## Description

The DC Current Controller block implements a discrete-time proportional-integral (PI) DC voltage controller. The block can implement zero cancellation in the feedforward path. To avoid saturation of the integral gain, the block can implement anti-windup gain.

### Equations

The equation that the DC Current Controller block uses to calculate the reference voltage is

${v}_{ref}=\left({K}_{p}+{K}_{i}\frac{{T}_{s}z}{z-1}\right)\left({i}_{ref}-i\right),$

where:

*v*is the reference voltage._{ref}*K*is the proportional gain._{p}*K*is the integral gain._{i}*T*is the sample time._{s}*i*is the reference current._{ref}*i*is the measured current.

The PI control calculation yields a zero in the closed-loop transfer function. To cancel the zero, the block uses this discrete-time zero-cancellation transfer function:

${G}_{ZC}\left(z\right)=\frac{\frac{{T}_{s}{K}_{i}}{{K}_{p}}}{z+\left(\frac{{T}_{s}-\frac{{K}_{p}}{{K}_{i}}}{\frac{{K}_{p}}{{K}_{i}}}\right)}.$

To avoid saturation of the integrator output, the block uses an anti-windup mechanism. The integrator gain is then equal to

${K}_{i}+{K}_{aw}\left({v}_{ref\text{\_}sat}-{v}_{ref\text{\_}unsat}\right),$

where:

*K*is the anti-windup gain._{aw}*v*is the saturated reference voltage signal, which the block calculates as ${v}_{ref\text{\_}sat}=\text{min}\left(\mathrm{max}\left({v}_{ref\text{\_}unsat},{v}_{min}\right),{v}_{max}\right),$_{ref_sat}where:

*v*is the unsaturated reference voltage signal._{ref_unsat}*v*is the lower limit for the output voltage. For positive voltage only, ${v}_{min}=0$. For positive and negative voltage, ${v}_{min}=-{v}_{max}$_{min}*v*is the upper limit for the output voltage._{max}

## Ports

### Input

### Output

## Parameters

## Model Examples

## Extended Capabilities

## Version History

**Introduced in R2018a**