Controller Blocks
Proportional-integral controllers. The variants differ in where the limits apply and whether they follow the IEEE formulation.
Proportional-Integral (PI) controller.
Syntax
& pictlname of variable x_kname of variable x_jdata name, parameter name or math expression for K_idata name, parameter name or math expression for K_pInternal States
Discrete Variables
None.
Equations
Initialization
pictllim
Section titled “pictllim”Proportional-Integral (PI) controller with non-windup limit on the integral term.
Syntax
& pictllimname of variable x_kname of variable x_jdata name, parameter name or math expression for K_idata name, parameter name or math expression for K_pdata name, parameter name or math expression for x_i^mindata name, parameter name or math expression for x_i^maxInternal States
Discrete Variables
Equations
Discrete Transitions
if z = 0: if x_i > x_i^max: z ← 1 else if x_i < x_i^min: z ← -1else if z = 1: if K_i * x_k < 0: z ← 0else if z = -1: if K_i * x_k > 0: z ← 0Initialization
if K_i * x_k > 0: z ← 1; x_i ← x_i^maxelse if K_i * x_k < 0: z ← -1; x_i ← x_i^minelse: z ← 0; x_i ← x_jpictl2lim
Section titled “pictl2lim”Proportional-Integral (PI) controller with non-windup limit on the integral term and limit on the proportional term.
Syntax
& pictl2limname of variable x_kname of variable x_jdata name, parameter name or math expression for K_idata name, parameter name or math expression for K_pdata name, parameter name or math expression for x_i^mindata name, parameter name or math expression for x_i^maxdata name, parameter name or math expression for x_p^mindata name, parameter name or math expression for x_p^maxInternal States
and
Discrete Variables
and
Equations
Discrete Transitions
# Proportional limiter (z_1):if z_1 = 0: if x_p > x_p^max: z_1 ← 1 else if x_p < x_p^min: z_1 ← -1else if z_1 = 1: if K_p * x_k < x_p^max: z_1 ← 0else if z_1 = -1: if K_p * x_k > x_p^min: z_1 ← 0
# Integral limiter (z_2):if z_2 = 0: if x_i > x_i^max: z_2 ← 1 else if x_i < x_i^min: z_2 ← -1else if z_2 = 1: if K_i * x_k < 0: z_2 ← 0else if z_2 = -1: if K_i * x_k > 0: z_2 ← 0Initialization
Initialization of :
Initialization of and discrete variables:
if K_p * x_k > x_p^max: z_1 ← 1else if K_p * x_k < x_p^min: z_1 ← -1else: z_1 ← 0
if K_i * x_k > 0: z_2 ← 1; x_i ← x_i^maxelse if K_i * x_k < 0: z_2 ← -1; x_i ← x_i^minelse: z_2 ← 0; x_i ← x_j - x_ppictlieee
Section titled “pictlieee”Proportional-Integral (PI) controller with non-windup limit on the integral term, compliant with IEEE standards.
This PI controller implements the non-windup integrator specified in:
- IEEE Std 421.5-1992, IEEE Std 421.5-2005, and IEEE Std 421.5-2016 (excitation system models for power system stability studies).
The IEEE standard specifies that the integrator state is frozen as soon as reaches its lower or upper limit. To avoid limit cycles when the integrator is released, a second “open-loop” integrator tracks what would be if unconstrained. The lower integrator is re-activated only when re-enters .
Syntax
& pictlieeename of variable x_kname of variable x_jdata name, parameter name or math expression for K_idata name, parameter name or math expression for K_pdata name, parameter name or math expression for x_j^mindata name, parameter name or math expression for x_j^maxInternal States
and
Discrete Variables
Equations
Discrete Transitions
The tests marked (*) use (the open-loop integrator) to decide when the active integrator can be released.
if z = 0: if x_j > x_j^max: z ← 2 else if x_j < x_j^min: z ← -2else if z = 2: if K_p*x_k + x_1 < x_j^max: z ← 1else if z = 1: if K_p*x_k + x_1 > x_j^max: z ← 2 else if K_p*x_k + x_2 < x_j^max: z ← 0 (*)else if z = -2: if K_p*x_k + x_1 > x_j^min: z ← -1else if z = -1: if K_p*x_k + x_1 < x_j^min: z ← -2 else if K_p*x_k + x_2 > x_j^min: z ← 0 (*)Initialization
if x_j >= x_j^max: z ← 2; x_1 ← x_j^max - K_p*x_k; x_2 ← x_1else if x_j <= x_j^min: z ← -2; x_1 ← x_j^min - K_p*x_k; x_2 ← x_1else: z ← 0; x_1 ← x_j; x_2 ← x_1See Also
Section titled “See Also”- Block Index, all CODEGEN blocks by category
- CODEGEN Model Examples, complete models built from these blocks
- User-Defined Models, the DSL file format