Block: PILimit



PIC




Inports


In

Control error input



Init

Value which is loaded at initialization function call



max

Maximum output value



min

Minimum output value



Enable

Enable == 0: Deactivation of block; Out set to 0

Enable 0->1: Preload of integral part

Enable == 1: Activation of block






Outports


Out






Mask Parameters


Kp

Proportional Factor



Ki

Integral Factor



ts_fact

Multiplication factor of base sampling time (in integer format)




Description:

PI controller with output limitation:

G(s) = Kp + Ki/s

Each fixed point implementation uses the next higher integer data type for the integral value storage variable.

A rising flank at the Enable inport will preload the integral part with the value present on the Init inport.

Transfer function (zero-order hold discretization method):

                   --1--
G(z)  =   KP + KITsz- 1

Developer note: The fixed point implementation source code of this block is used for block ??.

Implementations:
FiP8 8 Bit Fixed Point Implementation
FiP16 16 Bit Fixed Point Implementation
FiP32 32 Bit Fixed Point Implementation
Float32 32 Bit Floating Point Implementation
Float64 64 Bit Floating Point Implementation

Implementation: FiP8


Name FiP8
ID 3232
Revision 2.0
C filename PILimit_FiP8.c
H filename PILimit_FiP8.h

8 Bit Fixed Point Implementation



Controller Parameters


b0

Integral coefficient



b1

Proportional coefficient



sfrb0

Shift factor for PI coefficient b0



sfrb1

Shift factor for PI coefficient b1



i_old

Integrator value of previous cycle



enable_old

Enable value of previous cycle




Data Structure:

typedef struct { 
     uint16        ID; 
     int8          *In; 
     int8          *Init; 
     int8          *max; 
     int8          *min; 
     int8          *Enable; 
     int8          Out; 
     int8          b0; 
     int8          b1; 
     int8          sfrb0; 
     int8          sfrb1; 
     int16         i_old; 
     int8          enable_old; 
} PILIMIT_FIP8;

Implementation: FiP16


Name FiP16
ID 3233
Revision 2.0
C filename PILimit_FiP16.c
H filename PILimit_FiP16.h

16 Bit Fixed Point Implementation



Controller Parameters


b0

Integrall coefficient



b1

Proportional coefficient



sfrb0

Shift factor for PI coefficient b0



sfrb1

Shift factor for PI coefficient b1



i_old

Integrator value of previous cycle



enable_old

Enable value of previous cycle




Data Structure:

typedef struct { 
     uint16        ID; 
     int16         *In; 
     int16         *Init; 
     int16         *max; 
     int16         *min; 
     int8          *Enable; 
     int16         Out; 
     int16         b0; 
     int16         b1; 
     int8          sfrb0; 
     int8          sfrb1; 
     int32         i_old; 
     int8          enable_old; 
} PILIMIT_FIP16;

Implementation: FiP32


Name FiP32
ID 3234
Revision 2.0
C filename PILimit_FiP32.c
H filename PILimit_FiP32.h

32 Bit Fixed Point Implementation



Controller Parameters


b0

Integrall coefficient



b1

Proportional coefficient



sfrb0

Shift factor for PI coefficient b0



sfrb1

Shift factor for PI coefficient b1



i_old

Integrator value of previous cycle



enable_old

Enable value of previous cycle




Data Structure:

typedef struct { 
     uint16        ID; 
     int32         *In; 
     int32         *Init; 
     int32         *max; 
     int32         *min; 
     int8          *Enable; 
     int32         Out; 
     int32         b0; 
     int32         b1; 
     int8          sfrb0; 
     int8          sfrb1; 
     int64         i_old; 
     int8          enable_old; 
} PILIMIT_FIP32;

Implementation: Float32


Name Float32
ID 3235
Revision 2.0
C filename PILimit_Float32.c
H filename PILimit_Float32.h

32 Bit Floating Point Implementation



Controller Parameters


b0

Integral coefficient



b1

Proportional coefficient



i_old

Integrator value of previous cycle



enable_old

Enable value of previous cycle




Data Structure:

typedef struct { 
     uint16        ID; 
     float32       *In; 
     float32       *Init; 
     float32       *max; 
     float32       *min; 
     int8          *Enable; 
     float32       Out; 
     float32       b0; 
     float32       b1; 
     float32       i_old; 
     int8          enable_old; 
} PILIMIT_FLOAT32;

Implementation: Float64


Name Float64
ID 3236
Revision 2.0
C filename PILimit_Float64.c
H filename PILimit_Float64.h

64 Bit Floating Point Implementation



Controller Parameters


b0

Integral coefficient



b1

Proportional coefficient



i_old

Integrator value of previous cycle



enable_old

Enable value of previous cycle




Data Structure:

typedef struct { 
     uint16        ID; 
     float64       *In; 
     float64       *Init; 
     float64       *max; 
     float64       *min; 
     int8          *Enable; 
     float64       Out; 
     float64       b0; 
     float64       b1; 
     float64       i_old; 
     int8          enable_old; 
} PILIMIT_FLOAT64;