Y_YA_TemperatureControl
This function block contains an autotuning and temperature control solution. This block automatically maintains process temperature to within a few percent of a desired temperature.
Parameters:
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
| VAR_IN_OUT | ||||
| V | TC_Parameters | Yt_YA_TempControlStruct | Structure containing the parameters for operating the Temperature Control function. | |
|
VAR_INPUT
|
||||
| B | Enable | BOOL | The function will continue to execute every scan while Enable is held high and there are no errors. | FALSE |
| V | Mode | INT | 0: Normal operation. The function block looks for a previously stored DeviceName file and runs. If the file is not found, then an Autotuning process starts. Upon successful autotuning, the system runs normally. 1:Force autotuning before running, even if the DeviceName file already exists. | INT#0 |
| V | DeviceName | STRING | The name of the device being controlled. This will be used when writing the the TC_Parameters to a file on the controller flash file system. | N/A |
| V | TargetTemperature | LREAL | The target temperature value. | LREAL#0.0 |
| V | ActualTemperature | LREAL | The current temperature value. | LREAL#0.0 |
| V | MinTemperature | LREAL | Minimum allowable temperature. An Error will be generated if the ActualTemperature goes below this value and the ControlOuptut will be set to zero. If unconnected or set to zero, an operating value of -200.0 will be assumed. | LREAL#-200.0 |
| V | MaxTemperature | LREAL | Maximum allowable temperature. An Error will be generated if the ActualTemperature exceeds this value and the ControlOuptut will be set to zero. If unconnected or set to zero, an operating value of 400.0 will be assumed. | LREAL#400.0 |
| V | RewritePrms | BOOL | Rewrites the TC_Prameters to the DeviceName file to update any changes made manually after the autotuning process. | FALSE |
| VAR_OUTPUT | ||||
| B | Valid | BOOL | Indicates that the function is operating normally and the outputs of the function are valid. This block does not set the Valid output until autotuning has been completed. | |
| B | Busy | BOOL | Set high upon the rising edge of the Execute input, and reset when Done, CommandAborted, or Error is true. In the case of a function block with an Enable input, a Busy output indicates the function is operating, but not ready to provide Valid information. (No Error) | |
| V | ControlOutput | LREAL | Output value from the PID control block. The range of values will be governed by the PID parameters, especially the upper and lower limit. | |
| B | Autotuning | BOOL | Indicates if the function is performing autotuning. | |
| B | Error | BOOL | Set high if an error has occurred during the execution of the function block. This output is cleared when 'Execute' or 'Enable' goes low. | |
| B | ErrorID | UINT | If Error is true, this output provides the Error ID. This output is reset when 'Execute' or 'Enable' goes low. | |
Note:
- The block automatically achieves 90-95% of the 'most ideal' performance.
- The TC_Parameter values can be further adjusted manually if better performance is desired.
- If loading autotuning parameters from a file. the DeviceName must be the same as the filename on the controller.
- DeviceName cannot be left empty.
- RewritePrms must be toggled for every new write. When toggled, it will write whatever data is in the TC_Parameters into the file as long as tuning has been completed.
- Note that it is possible for the user to write garbage data to the file, which can result in errors when that file is read.
- If TC_Parameters.ResponseType is left at 0, an operating value of 2 (medium response) is assumed.
- It is recommended to add a moving average filter on the ActualTemperature input to reduce noise and result in more accurately calculated PID parameters.
- If the heater can only be controlled by turning it fully on or fully off, then it would be appropriate to place a PWM function block attached to the ControlOutput with a duty cycle of 100.
Error Description
See the
Function Block ErrorID List