Commisioning the Controller in Stages

The following steps must be taken:

1. Insert the controller library into the project via the library manager.
2. Program at least one instance of the controller.
3. Create external wiring.

Name

 

Description

eCtrlMode

Connection necessary

Switches the controller to an operation mode (active, passive, tuning).

bSelSetpoint

Connection optional

Selects one of two possible setpoints. FALSE selects the normal setpoint, while TRUE selects the standby setpoint.

fW1

Connection necessary

Setpoint

fW2

Connection optional

Standby setpoint is usually smaller than fW1. fSelSetpoint can be used to switch between fW1 and fW2.

fX

Connection necessary

Actual value, expected as LREAL number. The actual value may first have to be converted to LREAL outside the function block.

fYManual

Connection optional

Control value in manual operation

bOpenThermocouple

Connection optional

The thermocouple is open if TRUE. Must be reported by the hardware (e.g. KL3xxx or EL3xxx).

bReverseThermocouple

Connection optional

TRUE indicates that the thermocouple has been connected with the wrong polarity. Must be indicated by the hardware.

bBackVoltage

Connection optional

TRUE indicates that the input voltage at the thermocouple is too high. Must be indicated by the hardware.

bLeakage

Connection optional

TRUE indicates that leakage current has been detected at the heating element. Must be indicated by the hardware.

bShortCircuit

Connection optional

TRUE indicates that a short circuit has been detected at the heating element. Must be indicated by the hardware.

bOpenCircuit

Connection optional

TRUE indicates that an open circuit has been detected at the heating element. Must be indicated by the hardware.

sControllerParameter

Connection necessary

General parameters (sampling time etc.) are passed to the function block in this structure.

sParaControllerExternal

Connection optional

An external controller parameter set is passed to the function block in this structure.

4. Perform the necessary parameterization of the controller via the structure.

(* parameters *)
sControllerParameter : ST_CTRL_TempCtrlParameter :=
(
(* base *)
tCtrlCycleTime := t#1000ms,
tTaskCycleTime := t#10ms,

fYMin := -100,
fYMax := 100,
tPWMCycleTime := t#100ms ,
fYManual := 20,
bFilter := FALSE,
tFilter := t#100ms,
bDeadband := FALSE,
fEDeadband := 1.0, (* deadband *)
fWMin := 15,
fWMax := 60,
fWStartUp := 20.0,
tStartUp := t#160s,
fWVeloPos := 0.01,
fWVeloNeg := 0.01,
bStartUpRamping := FALSE,
fWStartUpVeloPos := 0.1,
fWStartUpVeloNeg := 0.1,
iMode := eCTRL_ControlMode_HEATING,
dwAlarmSupp := 16#FF_FF_FF_FF,
bSelCtrlParameterSet:= FALSE,

(* tuninig *)
iTuningMode := eCTRL_TuneMode_heating,
fYTuneHeating := 100.0,
fYTuneCooling := -100.0,
fEndTunePercentHeating := 80.0, (* switch to closed loop control when X > 0.8*W *)
fEndTunePercentCooling := -70.0, (* switch to closed loop control when X < 0.2*W *)

iReactionOnFailure := eCTRL_ReactionOnFailure_StopController,
TempLow := -50.0,
TempLowLow := -100.0,
TempHigh := 100.0,
TempHighHigh := 155.0,
TempAbsoluteHigh := 150.0,
TempAbsoluteLow := -95.0,
bEnablePreController := FALSE,
bEnableZones := FALSE,
bEnableCVFilter := FALSE,
iFilterType := eCTRL_FilterType_AVERAGE,
iControllerType := eCTRL_ControllerType_PID
);

Assignment in the code can look like the following in ST:

sControllerParameter.tPWMCycleTime := t#100ms;  
5. Set the controller sampling time, the task cycle time and the PWM cycle time.
6. Parameterization of TwinCAT Scope.
7. Switch off alarms during the commissioning phase.

Information: After initial commissioning, switch all required alarms back on.

8. Start the controller with tuning.
Commisioning the Controller in Stages 1:

Setting the control mode

Once the tuning has been completed successfully, the eCtrlState is set to eCTRL_STATE_TUNED. The controller enters standby mode. Closed-loop operation with the estimated parameters can only be activated by setting the control mode to eCTRL_MODE_ACTIVE.

9. Linking the internal control parameters with the external connections.

The controller parameters determined in the tuning process can be supplied again to the controller as external parameters. This may be necessary if the tuning is only to be carried out once (e.g. only during the initial commissioning).

10. Perform fine-tuning manually.

The control parameters determined in the tuning process are designed to produce fast settling, with about 10% overshoot. If only very little overshoot is permitted, or even none at all, then the following parameters from the ST_ControllerParameter structure can be used to perform fine tuning. These values are guide values.

Behavior

fTuneKp

fTuneTn

fTuneTv

fTuneTd

Fast settling with overshoots of 10%-20%

1.2

2.0

0.42

0.25

Slower settling with low overshoot

1.0

2.5

0.42

0.25

Almost asymptotic settling with extremely small overshoot

0.5

3.0

1.0

0.25

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT 3.1.4016

PC or CX

Tc2_TempController