PIDGS – PID controller with gain scheduling

Block SymbolLicensing group: ADVANCED
PIC

Function Description
The functionality of the PIDGS block is completely equivalent to the PIDU block. The only difference is that the PIDGS block has a at most six sets of basic PID controller parameters and allow bumpless switching of these sets by the ip (parameter set index) or vp inputs. In the latter case it is necessary to set GSCF = on and provide an array of threshold values thsha. The following rules define the active parameter set: the set 0 is active for vp < thrsha(0), the set 1 for thrsha(1) < vp < thrsha(2) etc. till the set 5 for thrsha(5) < vp. The index of the active parameter set is available at the kp output.

Inputs

dv

Feedforward control variable

double

sp

Setpoint variable

double

pv

Process variable

double

tv

Tracking variable

double

hv

Manual value

double

MAN

Manual or automatic mode

bool

off ..

Automatic mode

on ...

Manual mode

IH

Integrator hold

bool

off ..

Integration enabled

on ...

Integration disabled

ip

Parameter set index   0  5

long

vp

Switching analog signal

double

Outputs

mv

Manipulated variable (controller output)

double

dmv

Controller velocity output (difference)

double

de

Deviation error

double

SAT

Saturation flag

bool

off ..

The controller implements a linear control law

on ...

The controller output is saturated

kp

Active parameter set index

long

Parameters

hilim

Upper limit of the controller output  1.0

double

lolim

Lower limit of the controller output  -1.0

double

dz

Dead zone

double

icotype

Controller output type  1

long

1 ....

Analog output

2 ....

Pulse width modulation (PWM)

3 ....

Step controller unit with position feedback (SCU)

4 ....

Step controller unit without position feedback (SCUV)

npars

Number of controller parameter sets  6

long

GSCF

Switch parameters by analog signal vp

bool

off ..

Index-based switching

on ...

Analog signal based switching

hys

Hysteresis for controller parameters switching

double

irtypea

Vector of controller types (control laws)  [6 6 6 6 6 6]

byte

1 ....

D

2 ....

I

3 ....

ID

4 ....

P

5 ....

PD

6 ....

PI

7 ....

PID

RACTA

Vector of reverse action flags  [0 0 0 0 0 0]

bool

0 ....

Higher mv higher pv

1 ....

Higher mv lower pv

ka

Vector of controller gains K  [1.0 1.0 1.0 1.0 1.0 1.0]

double

tia

Vector of integral time constants Ti  [4.0 4.0 4.0 4.0 4.0 4.0]

double

tda

Vector of derivative time constants Td  [1.0 1.0 1.0 1.0 1.0 1.0]

double

nda

Vector of derivative filtering parameters N  [10.0 10.0 10.0 10.0 10.0 10.0]

double

ba

Setpoint weighting factors – proportional part  [1.0 1.0 1.0 1.0 1.0 1.0]

double

ca

Setpoint weighting factors – derivative part  [0.0 0.0 0.0 0.0 0.0 0.0]

double

tta

Vector of tracking time constants. No meaning for controllers without integrator.  [1.0 1.0 1.0 1.0 1.0 1.0]

double

thrsha

Vector of thresholds for switching the parameters  [0.1 0.2 0.3 0.4 0.5 0]

double