Advertisement

Manual
TC3 Temperature Controller
TwinCAT 3
Version:
Date:
Order No.:
1.1
2015-08-18
TF4110

Advertisement

Table of Contents
loading

Summary of Contents for Beckhoff TwinCAT 3

  • Page 1 Manual TC3 Temperature Controller TwinCAT 3 Version: Date: 2015-08-18 Order No.: TF4110...
  • Page 3: Table Of Contents

    Table of contents Table of contents 1 Foreword .............................. 4 Notes on the documentation...................... 4 Safety instructions .......................... 5 2 Product description........................... 6 3 Installation.............................. 7 System requirements........................ 7 Installation............................ 7 Licensing............................ 10 4 Configuration ............................ 15 Block Diagram .......................... 15 Generating the Set Value .......................  15 Generating the Control Value ......................
  • Page 4: Foreword

    EP0851348, US6167425 with corresponding applications or registrations in various other countries. ® EtherCAT is registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany Copyright © Beckhoff Automation GmbH & Co. KG, Germany. The reproduction, distribution and utilization of this document as well as the communication of its contents to others without express authorization are prohibited.
  • Page 5: Safety Instructions

    All the components are supplied in particular hardware and software configurations appropriate for the application. Modifications to hardware or software configurations other than those described in the documentation are not permitted, and nullify the liability of Beckhoff Automation GmbH & Co. KG. Personnel qualification This description is only intended for trained specialists in control, automation and drive engineering who are familiar with the applicable national standards.
  • Page 6: Product Description

    Product description Product description The TwinCAT temperature controller is a universally applicable PLC function block for monitoring and controlling a wide variety of temperature-dependent processes. The controller can be operated in following modes: • automatic (closed loop) and • manual (open loop) The control value can be accessed in digital or analogue form.
  • Page 7: Installation

    • Please note: For testing purposes, a 7-Day trial license may be used, as described in our licensing [} 10] article Installation Description of the installation procedure of a TwinCAT 3 Function for Windows-based operating Systems. 1. Double-click the downloaded setup file "TFxxxx". Please note: Under Windows 32-bit/64-bit, please start the installation with "Run as Administrator" by right-clicking the setup file and selecting the corresponding option in the context menu.
  • Page 8 Installation 2. Click on "Next" and accept the license Agreement. 3. Enter your user information in the specified area. Version: 1.1 TC3 Temperature Controller...
  • Page 9 Installation 4. To install the full product, including all sub-components, please choose "Complete" as the Setup Type.Alternatively you can also install each component seperately by choosing "Custom". 5. Click on "Install"after pressing the "Next" to start the Installation. The TwinCAT system has to be stopped before proceeding with installation TC3 Temperature Controller Version: 1.1...
  • Page 10: Licensing

    After a successful installation the TC 3Function needs to be licensed [} 10]. Licensing The TwinCAT 3 functions are available both as a full and as a 7-Day trial version. Both license types can be activated via TwinCAT XAE.For more information about TwinCAT 3 licensing, please consult the TwinCAT 3 Help System.The following document describes both licensing scenarios for a TwinCAT 3 function on...
  • Page 11 5. Optional: If you would like to add a license for a remote device, you first need to connect to the remote device via TwinCAT XAE toolbar 6. Switch to the tab "Order Information" and click the button "Activate 7 Days Trial License..."to activate a test version 7. Please restart TwinCAT 3 afterwards. TC3 Temperature Controller Version: 1.1...
  • Page 12 13. Navigate to the "Order Information" tab The fields "System-ID" and "HW Platform" cannot be changed and just describe the platform for the licensing process in general a TwinCAT 3 license is always bound to these two identifiers: the "System-ID" uniquely identifies your system.
  • Page 13 14. Optionally, you may also enter an own order number and description for your convenience 15. enter the "Beckhoff License ID" and click on "Generate License Request File...". If you are not aware of your "Beckhoff License ID" please contact your local sales representative.
  • Page 14 Installation 20. Select the received "Licnse response file" and click on "Open" 21. The "License Response File" will be imported and all included licenses will be activated. If there have been any trial licenses, these will be removed accordingly. 22. Please restart TwinCAT to activate licenses.. NOTE! The license file will be automatically copied to "..\TwinCAT\3.1\Target\License"...
  • Page 15: Configuration

    Configuration Configuration Block Diagram The TwinCAT Temperature Controller consists of a number of function blocks. The following function blocks are involved: • Self-tuning algorithm (FB_Selftuner) • Control algorithm (FB_ControlAlgorithm) • Set value generator (FB_SetpointConditioner) • Control value generator (FB_ControlValueConditioner) • Alarming (FB_Alarming) These function blocks in turn call a number of other subsidiary function blocks.
  • Page 16 Configuration The set values are restricted to their limits. In order to permit "heater baking", a soft start can be parameterised. In this case, the temperature is first ramped up from ambient to a low set value (fWStartUp). This temperature is them maintained for a period of time (tStartUp), and only after that has elapsed does the ramp up to the actual set value begin.
  • Page 17: Generating The Control Value

    Configuration Generating the Control Value The control value (CV) calculated by the controller is first limited to fall within a valid range. The values of the limits are passed to the controller block in the control value structure. The control value is made available in three different ways.
  • Page 18 Configuration • Perform the required external connection. Name Beschreibung eCtrlMode Connection necessary Switches controller to different operating modes (active, passive, tuning) bSelSetpoint Connection optional Selects one of two possible set values. FALSE selects the normal set value, while TRUE selects the standby set value. Connection necessary Set value.
  • Page 19 Configuration 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,...
  • Page 20 0.25 overshoots of 10%-20% Slower settling with 0.42 0.25 low overshoot Almost asymptotic 0.25 settling with extremely small overshoot Requirements Development environment target platform PLC libraries to include TwinCAT 3.1.4006 PC or CX (x86) Tc2_TempController Version: 1.1 TC3 Temperature Controller...
  • Page 21: Plc Libraries

    PLC libraries PLC libraries Function Block 5.1.1 FB_CTRL_TempController The temperature controller block FB_CTRL_TempController has a variety of inputs and outputs that are described below. All the controller's parameters are passed to it via structures. The structures and enums are defined here [} 33]. Function Block VAR_INPUT   eCtrlMode               : E_CTRL_MODE;...
  • Page 22 PLC libraries Interface Table 1: Inputs Name Unit Range Description eControlMode E_CTRL_MODE Switches modes. bSelSetpoint [TRUE,FALSE] Selects one of two possible set values. FALSE selects the normal set value, while TRUE selects the standby set value. °C LREAL Setpoint °C LREAL Standby set value, generally smaller than fW1.
  • Page 23: Structure Definitions

    PLC libraries Requirements Development environment target platform PLC libraries to include TwinCAT 3.1.4006 PC or CX (x86) Tc2_TempController 5.1.2 Structure definitions ST_ControllerParameter TYPE ST_CTRL_TempCtrlParameter: STRUCT   (* general parameters *)   iMode                     : E_CTRL_ControlMode;   iReactionOnFailure        : E_CTRL_ReactionOnFailure;   bSelCtrlParameterSet      : BOOL;   dwAlarmSupp               : DWORD;   tCtrlCycleTime            : TIME;   tTaskCycleTime            : TIME;...
  • Page 24 PLC libraries   (* controller settings *)   bEnablePreController      : BOOL;   bEnableZones              : BOOL;   bEnableCVFilter           : BOOL;   iFilterType               : E_CTRL_FilterType;   iControllerType           : E_CTRL_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;...
  • Page 25 PLC libraries Table 3: Description TC3 Temperature Controller Version: 1.1...
  • Page 26 PLC libraries Name Unit Range Description General Parameters iMode none Controller operating mode (1 = heating, 2 = cooling, 3 = heating & cooling) (see below) iReactionOnFailure none Parameterisable reaction to errors (see below) bSelCtrlParameterS none BOOL TRUE = external parameter set, FALSE = internal parameter set (from tuning) dwAlarmSupp none...
  • Page 27 PLC libraries Name Unit Range Description tPWMCycleTime TIME Cycle time of the PWM signal. tPWMMinOffTime TIME PWM: minimal off time tPWMMinOnTime TIME PWM: minimal on time tPWMWaitingTime TIME PWM: waiting time before switching vorm heating to cooling and vice versa fYThresholdOff (L)REAL 3-Step: Off threshold...
  • Page 28 PLC libraries Table 4: Description Name Unit Range Description KpHeat none (L)REAL Heating: Amplification factor for the main controller. TnHeat TIME Heating: Integral-action time for main controller (I component). TvHeat TIME Heating: Derivative action time for main controller (D component). TdHeat TIME Heating: Damping time for the main controller.
  • Page 29 PLC libraries Table 8: ENUM: E_CTRL_STATE_TUNING Name Description eCTRL_STATE_TUNING_INIT Tuning: Initialisation eCTRL_STATE_TUNING_IDLE Tuning: wainting for a stable actual value eCTRL_STATE_TUNING_PULSE Tuning: not yet realized eCTRL_STATE_TUNING_STEP Tuning: Tuning with step reponse eCTRL_STATE_TUNING_READY Tuning: Calculation of parameters eCTRL_STATE_TUNING_ERROR Tuning: Error while tuning. Table 9: ENUM: E_CTRL_TuneMode Name Description eCTRL_TuneMode_HEATING...
  • Page 30: Old:fb_Tempcontroller

    000_0000_0000 absolute temperature Requirements Development environment target platform PLC libraries to include TwinCAT 3.1.4006 PC or CX (x86) Tc2_TempController 5.1.3 old:FB_TempController The temperature controller block FB_TempController has a variety of inputs and outputs that are described below. All the controller's parameters are passed to it via structures. The structures and enums are defined here [} 33].
  • Page 31 PLC libraries Interface VAR_INPUT   bOn                       : BOOL;   bInit                     : BOOL;   bTune                     : BOOL;   bManual                   : BOOL;   bSelSetpoint              : BOOL;   bSelCtrlParameterSe       : BOOL;   bEnableSoftStart          : BOOL;   bEnableRamping            : BOOL;   fW1                       : LREAL;   fW2                       : LREAL;   fX                        : LREAL;   bOpenThermocouple         : BOOL;   bReverseThermocouple      : BOOL;   bBackVoltage              : BOOL;   bLeakage                  : BOOL;   bShortCircuit             : BOOL;   bOpenCircuit              : BOOL;   sParaControllerExternal   : ST_ParaController;   sLogData                  : ST_LogData := (bLog := FALSE, strLogFileName :='', strLogString := '' );...
  • Page 32 PLC libraries Table 12: Inputs Name Unit Value range Description [TRUE,FALSE] TRUE switches the controller on. bInit [TRUE,FALSE] Initialisation flag, which must be active (TRUE) for precisely the first cycle in which the controller is called. bTune [TRUE,FALSE] A rising edge switches the self-tuning on. If it is switched to FALSE during the self-tuning process then the self- tuning is aborted and the controller continues operation using the old parameters (if they are still present).
  • Page 33: Old:structure Definitions

    If bError is TRUE, then iErrorId provides an error code (see ENUM ...) Requirements Development environment target platform PLC libraries to include TwinCAT 3.1.4006 PC or CX (x86) Tc2_TempController 5.1.4 old:Structure Definitions TYPE ST_ParaControlValue : STRUCT   (* general parameters *)   iMode                   : E_ControlMode;...
  • Page 34 PLC libraries   (* 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;...
  • Page 35 PLC libraries ST_ControllerParameter Table 14: Description Name Unit Value range Description iMode none Controller operating mode (1 = heating, 2 = cooling, 3 = heating & cooling) (see below) iReactionOnFail none Parameterisable reaction to errors (see below) fYTune none LREAL Control value during the self-tuning (normally 100%) fYStable none LREAL...
  • Page 36 PLC libraries Description 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 Table 15: Description Name Unit Value range Description KpMain...
  • Page 37 PLC libraries Table 18: ENUM: ST_ControlMode Name Description CTRLMODE_HEATING Heating only. CTRLMODE_COOLING Cooling only. CTRLMODE_HEATING_COOLING Heating and cooling. Table 19: ENUM: states Name Description TC_STATE_IDLE Controller switched off. TC_STATE_INIT Controller is being initialised. TC_STATE_OFF Controller switched off, was previously switched on. TC_STATE_TUNE Controller in tuning / self adjustment state.
  • Page 38 Software: fallen below lower 00_0000_0000 absolute temperature Requirements Development environment target platform PLC libraries to include TwinCAT 3.1.4006 PC or CX (x86) Tc2_TempController 5.1.5 FB_CTRL_TempController_DistComp This temperature controller function block adds disturbance compensation to the FB_CTRL_TempController function blocks. The structure is illustrated here.
  • Page 39 PLC libraries Function Block Interface VAR_INPUT   eCtrlMode                     : E_CTRL_MODE;   bSelSetpoint                  : BOOL;   fW1                           : LREAL;   fW2                           : LREAL;   fX                            : LREAL;   fYManual                      : LREAL;   bOpenThermocouple             : BOOL;   bReverseThermocouple          : BOOL;   bBackVoltage                  : BOOL;   bLeakage                      : BOOL;   bShortCircuit                 : BOOL;   bOpenCircuit                  : BOOL;   fD                            : LREAL;   bCompensateDisturbance        : BOOL;   stParaControllerExternal      : ST_CTRL_ParaController; END_VAR VAR_IN_OUT   sControllerParameter          : ST_CTRL_TempCtrlParameter;   sCompensatorParameter         : ST_CTRL_DistCompParameter; END_VAR VAR_OUTPUT   fYAnalog                      : LREAL;   bYPWMPos                      : BOOL;   bYPWMPos                      : BOOL;   bYPWMNeg                      : BOOL;   bYDigPos                      : BOOL;   bYDigNeg                      : BOOL;   dwAlarm                       : DWORD;   fMaxOverShoot                 : LREAL;   tStartUpTime                  : TIME;   eCtrlState                    : E_CTRL_STATE;   sParaControllerInternal       : ST_CTRL_ParaController;   bError                        : BOOL;   eErrorId                      : E_CTRL_ErrorCodes; END_VAR TC3 Temperature Controller Version: 1.1...
  • Page 40 PLC libraries Inputs Name Unit Range Description eControlMode E_CTRL_MODE Switches mode bSelSetpoint [True, False] Selects one of the two possible setpoints; True selects the standby setpoint °C LREAL Setpoint °C LREAL Standby setpoint (generally smaller than fW1, bSelSetpoint is used to switch between fW1 and fW2) °C...
  • Page 41: Structure Definitions (St_Ctrl_Distcompparameter)

    [True, False] An error occursed, if true eErrorId Structure Error code of the current error Requirements Development environment target platform PLC libraries to include TwinCAT 3.1.4006 PC or CX (x86) Tc2_TempController 5.1.6 Structure Definitions (ST_CTRL_DistCompParameter) ST_CTRL_DistCompParameter TYPE ST_CTRL_DistCompParameters STRUCT   fKd    : LREAL := 0;   tT1    : TIME  := T#0MS;...
  • Page 42: Global Constants

    To compare the existing version to a required version the function F_CmpLibVersion (defined in Tc2_System library) is offered. Hint: All other possibilities known from TwinCAT2 libraries to query a library version are obsolete! Requirements Development environment target platform PLC libraries to include TwinCAT 3.1.4006 PC or CX (x86) Tc2_TempController Version: 1.1 TC3 Temperature Controller...
  • Page 43: Sample

    For practical use, you may need one of two implementation. You can also use TwinCAT ScopeView to monitor variables such as temperature setpoint, acutal temperature or controller output. Requirements Development environment target platform PLC libraries to include TwinCAT 3.1.4006 PC or CX (x86) Tc2_TempController TC3 Temperature Controller Version: 1.1...
  • Page 44: Appendix

    To minimise oscillation of the control value, it is optionally possible to follow the main controller with a filter. P-T1 and moving average filters are available for this purpose. Requirements Development environment target platform PLC libraries to include TwinCAT 3.1.4006 PC or CX (x86) Tc2_TempController Version: 1.1 TC3 Temperature Controller...
  • Page 45: Alarming

    • Leakage current Requirements Development environment target platform PLC libraries to include TwinCAT 3.1.4006 PC or CX (x86) Tc2_TempController Self-tuning The self-tuning algorithm is based on the classic inflectional tangents method. This method was first developed by Ziegler and Nichols. It is assumed that a linear P-T1 loop with a delay time is being examined.
  • Page 46: Disturbance Compensation

    Requirements Development environment target platform PLC libraries to include TwinCAT 3.1.4006 PC or CX (x86) Tc2_TempController Disturbance Compensation Disturbance Compensation A disturbance signal has significant effect on the quality of the controller and eventually on the controlled process.

This manual is also suitable for:

Tc3

Table of Contents