Structure Definitions

Note

This version of the function block is obsolete.

You should no longer use this function block.

TYPE ST_ParaControlValue :
STRUCT

  (* general parameters *)
  iMode                   : E_ControlMode;
  iReactionOnFailure    : E_ReactionOnFailure;
  fYTune                : LREAL;
  fYStable              : LREAL;
  dwAlarmSupp           : DWORD;
  tCtrlCycleTime        : TIME;
  tTaskCycleTime        : TIME;

  (* setpoint parameters *)
  fWMin                 : LREAL;
  fWMax                 : LREAL;

  (* start up *)
  fWStartUp             : LREAL;
  tStartUp              : TIME;
  bStartUpRamping       : BOOL;
  fWStartUpVeloPos      : LREAL;
  fWStartUpVeloNeg      : LREAL;
  fWVeloPos             : LREAL;
  fWVeloNeg             : LREAL;

  (* actual value parameters *)
  bFilter               : BOOL;
  tFilter               : TIME;

  (* control value parameters *)
  fYMin                 : LREAL;
  fYMax                 : LREAL;
  fYManual              : LREAL;
  fYOnFailure           : LREAL;
  tPWMCycleTime         : TIME;

  (* controller settings *)
  bEnablePreController  : BOOL;
  bEnableZones          : BOOL;
  bEnableCVFilter       : BOOL;
  iFilterType           : E_FilterType;
  iControllerType       : E_ControllerType;

  (* min max temperatures *)
  TempLow               : LREAL;
  TempLowLow            : LREAL;
  TempHigh              : LREAL;
  TempHighHigh          : LREAL;
  TempAbsoluteHigh      : LREAL;
  TempAbsoluteLow       : LREAL;

  (* internal tuning parameters *)
  fTuneKp               : LREAL := 1.2;
  fTuneTn               : LREAL := 2.0;
  fTuneTv               : LREAL := 0.42;
  fTuneTd               : LREAL := 0.25;
END_STRUCT
END_TYPE

ST_ControllerParameter

Name

Unit

Value range

Description

iMode

none

INT

Controller operation mode (1 = heating, 2 = cooling, 3 = heating & cooling) (see below)

iReactionOnFailure

none

INT

Parameterizable reaction to errors (see below)

fYTune

none

LREAL

Control value during the self-tuning (normally 100%)

fYStable

none

LREAL

Control value during the settling phase (normally 0%)

dwAlarmSupp

none

DWORD

Masks out the alarms (see below)

tCtrlCycleTime

s

TIME

Controller's sampling time. In the course of the sampling time the controller re-calculates the control value.

tTaskCycleTime

s

TIME

Task cycle time. The FB is called with this time interval.

fWMin

K

LREAL

Minimum setpoint

fWMax

K

LREAL

Maximum setpoint

fWVeloPos

K/s

LREAL

Rate of rise (of ramp)

fWVeloNeg

K/s

LREAL

Rate of fall (of ramp).

fWStartUp

K

LREAL

Setpoint at start-up

tStartUp

s

TIME

Time with the fWStartUp setpoint

bStartUpRamping

none

[TRUE,FALSE]

Switches on ramping during the start-up phase.

fWStartUpVeloPos

K/s

LREAL

Rate of rise (of ramp) during the start-up phase

fWStartUpVeloNeg

K/s

LREAL

Rate of fall (of ramp) during the start-up phase

fYMin

none

LREAL

Minimum value of the control value

fYMax

none

LREAL

Maximum value of the control value

fYManual

none

LREAL

Control value in manual operation

fYOnFailure

none

LREAL

Control value in case of error (parameterizable)

tPWMCycleTime

s

TIME

Cycle time of the PWM signal

tFilter

s

TIME

Time constant of the actual value filter (first order P-T1 filter)

bFilter

none

[TRUE,FALSE]

The actual value filter is actuated if TRUE.

bEnablePreController

none

[TRUE,FALSE]

Switches pre-controller on.

bEnableZones

none

[TRUE,FALSE]

Switches open loop characteristic on until close to setpoint.

bEnableCVFilter

none

[TRUE,FALSE]

Switches on control value filter following the main controller.

iFilterType

none

ENUM

Selection of a filter type for the control value filter following the main controller (see below).

iControllerType

none

ENUM

Selection of a control algorithm (see below).

TempLow

K

LREAL

Relative lower temperature limit in the first band

TempLowLow

K

LREAL

Relative lower temperature limit in the second band

TempHigh

K

LREAL

Relative upper temperature limit in the first band

TempHighHigh

K

LREAL

Relative upper temperature limit in the second band

TempAbsoluteHigh

K

LREAL

Absolute upper temperature limit

TempAbsoluteLow

K

LREAL

Absolute lower temperature limit

fTuneKp

none

LREAL

FineTuning parameters for the PID controller (only for advanced users)

fTuneTn

none

LREAL

FineTuning parameters for the PID controller (only for advanced users)

fTuneTv

none

LREAL

FineTuning parameters for the PID controller (only for advanced users)

fTuneTd

none

LREAL

FineTuning parameters for the PID controller (only for advanced users)

ST_ParaController

TYPE ST_ParaController :
STRUCT
  (* Main Controller parameter set *)
  KpMain    : LREAL;
  TnMain    : LREAL;
  TvMain    : LREAL;
  TdMain    : LREAL;
  (* Pre Controller parameter set *)
  KpPre     : LREAL;
  TvPre     : LREAL;
  TdPre     : LREAL;
END_STRUCT
END_TYPE

Name

Unit

Value range

Description

KpMain

none

LREAL

Gain factor for the main controller

TnMain

s

TIME

Integral action time for main controller (I component)

TvMain

s

TIME

Derivative action time for main controller (D component)

TdMain

s

TIME

Damping time for the main controller

KpPre

none

LREAL

Amplification factor for the pre-controller

TvPre

s

TIME

Derivative action time for pre-controller (D component)

TdPre

s

TIME

Damping time for the pre-controller

ENUM: Error codes

Name

Description

TC_ERR_NOERROR

No error

TC_ERR_INVALIDPARAM

Invalid parameter

TC_ERR_NO_INIT

Missing function block initialization.

TC_ERR_NO_INFLECTION_POINT

No inflection was found during self-tuning. No parameters could be determined.

TC_ERR_INVALID_PARAM

Invalid parameter

TC_ERR_INVALID_CYCLETIME

Invalid combination of cycle times (sampling times and PWM cycle times)

TC_ERR_WRONG_TU

A valid value for the Tu parameter could not be found due to faulty or aborted self-tuning.

ENUM: ReactionOnFailure

Name

Description

TC_OnFailureNoFailure

No error

TC_OnFailureStopController

If there is an error (an alarm) the controller will stop.

TC_OnFailureSetManMode

If there is an error (an alarm) the controller will switch to manual operation.

TC_OnFailureSetYMax

If there is an error (an alarm) set the control value to its maximum.

TC_OnFailureSetYMin

If there is an error (an alarm) set the control value to its minimum.

ENUM: ST_ControlMode

Name

Description

CTRLMODE_HEATING

Heating only

CTRLMODE_COOLING

Cooling only

CTRLMODE_HEATING_COOLING

Heating and cooling

ENUM: states

Name

Description

TC_STATE_IDLE

Controller switched off.

TC_STATE_INIT

Controller is being initialized.

TC_STATE_OFF

Controller switched off, was previously switched on.

TC_STATE_TUNE

Controller in tuning / self adjustment state.

TC_STATE_MANUAL_OPERATION

Controller in manual operation.

TC_STATE_CLOSED_LOOP

Controller in automatic operation.

TC_STATE_TUNE_IDLE

Tuning started but not yet running. Waiting for idle.

TC_STATE_TUNE_PULSE

Pulse for determination of dead time.

TC_STATE_TUNE_STEP

Step for determination of dead time and maximum velocity.

TC_STATE_TUNE_READY

Self-tuning complete.

TC_STATE_ERROR

Error (logical error)

ENUM: E_FilterType

Name

Description

E_FilterType_FIRSTORDER

First order filter

E_FilterType_AVERAGE

Mean value filter

ENUM: E_ControllerType

Name

Description

E_ControllerType_PID

Standard PID control algorithm

E_ControllerType_PIDD2

Planned serial PID control algorithm

Bit-masks for alarms

Name

Mask

Description

nAlarmOpen
Thermocouple

2#0000_0000_0000_0000_0000_0000_0000_0001

Hardware: open temperature sensor

nAlarmReverse
Thermocouple

2#0000_0000_0000_0000_0000_0000_0000_0010

Hardware: reverse connected temperature sensor

nAlarmBack
Voltage

2#0000_0000_0000_0000_0000_0000_0000_0100

Hardware: excessive voltage at temperature sensor

nAlarmLeakage
Current

2#0000_0000_0000_0000_0000_0000_0000_1000

Hardware: Measured leakage current.

nAlarmShortCircuit

2#0000_0000_0000_0000_0000_0000_0001_0000

Hardware: Short circuit

nAlarmOpenCircuit

2#0000_0000_0000_0000_0000_0000_0010_0000

Hardware: no current

nAlarmLimitLow

2#0000_0000_0000_0000_0000_0001_0000_0000

Software: fallen below first lower relative temperature.

nAlarmLimitLow
Low

2#0000_0000_0000_0000_0000_0010_0000_0000

Software: fallen below second lower relative temperature.

nAlarmLimitHigh

2#0000_0000_0000_0000_0000_0100_0000_0000

Software: first upper relative temperature exceeded.

nAlarmLimitHigh
High

2#0000_0000_0000_0000_0000_1000_0000_0000

Software: second upper relative temperature exceeded.

nAlarmAbsolute
High

2#0000_0000_0000_0000_0001_0000_0000_0000

Software: upper absolute temperature exceeded.

nAlarmAbsolute
Low

2#0000_0000_0000_0000_0010_0000_0000_0000

Software: fallen below lower absolute temperature.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT 3.1.4016

PC or CX

Tc2_TempController