Discrete-time DC current PI control with integral anti-windup
Simscape / Electrical / Control / General Machine Control
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.
The equation that the DC Current Controller block uses to calculate the reference voltage is
vref is the reference voltage.
Kp is the proportional gain.
Ki is the integral gain.
Ts is the sample time.
iref is the reference current.
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:
To avoid saturation of the integrator output, the block uses an anti-windup mechanism. The integrator gain is then equal to
Kaw is the anti-windup gain.
vref_sat is the saturated reference voltage signal, which the block calculates as
vref_unsat is the unsaturated reference voltage signal.
vmin is the lower limit for the output voltage. For positive voltage only, . For positive and negative voltage,
vmax is the upper limit for the output voltage.
iRef— Reference current
Desired output current for the plant.
i— Measured current
Measured current for the plant.
vmax— Maximum DC voltage
Maximum DC output voltage for the plant.
Reset— External reset
External reset signal (rising edge) for the integrator.
vRef— Reference DC voltage
Desired DC output voltage for the plant.
Proportional gain— Controller proportional gain, Kp
1(default) | positive scalar
Proportional gain, Kp, of the controller.
Integral gain— Integral gain, Ki
5(default) | positive scalar
Integral gain, Ki, of the controller.
Anti-windup gain— Anti-windup gain, Kaw
1(default) | positive scalar
Anti-windup gain, Kaw, of the controller.
Voltage limitation— Negative voltage restriction
Positive and negative voltage(default) |
Positive voltage only
Allow for both positive and negative DC voltage output or limit the output to positive DC voltage.
Sample time (-1 for inherited)— Block sample time
-1(default) | positive scalar
Time, in s, between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.
If this block is inside a triggered subsystem, inherit the
sample time by setting this parameter to
-1. If this block is in a
continuous variable-step model, specify the sample time explicitly using a positive
If you set Sample time (-1 for inherited) to
-1 and select the Enable zero
cancellation option, the Discretization sample
time parameter becomes visible.
Discretization sample time— Sample time for discretization
0.001(default) | positive scalar
Time, in s, between consecutive discretizations. Discretization is required for zero cancellation.
This parameter is only visible when both these conditions are met:
Sample time is set to
Enable zero cancellation is selected.
Enable zero cancellation— Feedforward zero cancellation
Option to use zero cancellation on the feedforward path.
If you select the Enable zero cancellation option and set
Sample time (-1 for inherited) to
the Discretization sample time parameter becomes