iQ-F PID controller function block

iQ-F PID controller function block

Tech Tip

1. Function Block

This function block is a iQ-F PID instruction implementation for ease of use with all functionality and parameters as inputs of fb. There is also an added manual mode for setting the exact Manipulated Value with PID turned off. It can be use for easier configuration of PID regulation in iQ-F PLC.

iQ-F PID controller function block 31

2. Settings

To start PID regulation you need to set the parameters described below

      2.1 Basic PID inputs and outputs:

Set Value is value you want to achieve in regulation, Process Value is the actual value of the regulated object and Manipulated Value is the output of the regulator.

iQ-F PID controller function block 32

      2.2 Operation direction:

Forward operation is an operation that increases the output value (MV) when the measured value (PV) becomes larger than the target value (SV). This operation is used when performing cooling control:

iQ-F PID controller function block 33

Backward operation is an operation that increases the output value (MV) when the measured value (PV) becomes smaller than the target value (SV). This operation is used when performing heating control.

iQ-F PID controller function block 34

This option is settable from i_bOperationDirection input. “0” is Forward (cooling) operation and “1” is Backward (heating) operation:

iQ-F PID controller function block 35

      2.3 Modes:

When enabling the function block with i_bEN input you need to select and enable one of the operation modes:

iQ-F PID controller function block 36

            2.3.1 Manual mode

In this mode value written to i_wManualSetValue is set to o_wManipulatedValue.

            2.3.2 Auto mode

In this mode, o_wManipulatedValue is calculated by PID regulator.

      2.4 Sampling time:

To properly use PID regulation you need to set sample frequency. In this function block you set sampling time in miliseconds. Sampling time should be at least as fast as Nyquist rate which is twice as fast as the response rate of the controlling system. But preferably sampling time should be 5 to 10 times faster then system frequency.

iQ-F PID controller function block 37

      2.5 Overshoot Suppression Processing:

This input enables additional processing counteracting overshoot occurrence

iQ-F PID controller function block 38

      2.6 Manipulated Value Settings:

            2.6.1 Limits

To limit manipulated value you need to set upper and lower limit values (ULV, LLV). When you set 1000 in ULV and 0 in LLV it means that Manipulated value will not exceed 1000 nor drop below 0:


            2.6.2 Alarms                     

When you want to know when the Manipulated Value reaches the exact value you need to set the Upper and Lower Limit Alarm:

iQ-F PID controller function block 39

When the Manipulated Value reaches the alarm threshold will be turned on:

iQ-F PID controller function block 40

      2.7 Input filter:

The input filter (α) is a software filter to reduce the fluctuation of the measured value (PV) caused by noise. The effect of noise can be reduced by setting this time constant of the filter according to the control target characteristics and noise level. If the input filter value is too small, the filter effect is small. If the input filter value is too large, the input response is bad. Setting range: 0 to 99 (%).

iQ-F PID controller function block 41

      2.8 Regulation constants:

Before turning PID regulation ON for the first time you need to set some values in registers connected to these inputs. After autotuning they will be overwritten:

iQ-F PID controller function block 42

3. Autotuning:

      3.1 Autotuning parameters:

Before starting autotuning you need to set basic parameters like autotuning method (limit cycle or step response method), hysteresis (in limit cycle method), lower and upper-value limit in autotuning and wait time setting from end of tunning cycle to start PID control

iQ-F PID controller function block 43

      3.2 Autotuning method:

This function block supports two autotuning methods: limit cycle and step response. To select a method you need to use i_bATMethod:


            3.2.1 Limit cycle method:

When in the limit cycle method, changes in the input value in two-position control (in which the output Upper Limit Value (ULV) and output Lower Limit Value (LLV) are switched according to the deviation) are measured, and then constants in the PID control are obtained. 

iQ-F PID controller function block 44

To properly configure lthis method you need to declare four parameters, one of them is histeresis:

iQ-F PID controller function block 45

It says how much Process Value will rise and fall during autotuning. Hysteresis is declared by i_wATSHPV input:

iQ-F PID controller function block 46

Next, you need to set upper and lower limit values for autotuning which limit Manipulated Value during autotuning:

iQ-F PID controller function block 47
iQ-F PID controller function block 48

Last parameter of this method is the wait setting form end of tuning cycle to start of PID control (KW):

iQ-F PID controller function block 49
iQ-F PID controller function block 50

            3.2.2 Step response method:

In the step response method, by giving stepped output from 0 to 100 % to the control system, three constants in the PID control are obtained from the operation characteristics (maximum ramp (R) and dead time (L) and the input value variation. The stepped output may be obtained from 0 to 75% or from 0 to 50 %.

iQ-F PID controller function block 51

      3.3 Starting autotuning

To start the tuning process firstly you need to start standard PID control and then turn on i_bStartAutoTuning input.

iQ-F PID controller function block 52

When autotuning will start, output o_bInAutoTuning will turn on:

iQ-F PID controller function block 53

When autotuning will end, output o_bAutoTuningComplete will turn on:

iQ-F PID controller function block 54

      3.4 Example autotuning results

Example autotuning results using the limit cycle method (red line is Set Value and the white line is Process Value) are presented below:

iQ-F PID controller function block 55

4. Example project

In the attachment, there is an example project for simulating PID regulation of temperature. There’s also included PID_IQF structure for this function block. Temperature is simulated with a second inertia model to create the more realistic environment:

iQ-F PID controller function block 56

Latest news and stories

Dave’s Desk

From Dave's Desk Welcome to...
Read More

Understanding energy use in real-time can lead to greater profits

Understanding energy use in real-time...
Read More

Mitsubishi Electric Partner Meeting in South Africa

Mitsubishi Electric Partner Meeting in...
Read More

Dave’s Desk February 2024

FROM DAVE’S DESK – Energy...
Read More

Discover the Future of Industrial Automation with Adroit Product Suite!

Adroit Technologies is revolutionizing the...
Read More

Dave’s Desk January 2024

Read More

Dave’s Desk August

Dave's Desk I was asked...
Read More

Mitsubishi Electric Partner meeting in Italy

Mitsubishi Electric Partner meeting in...
Read More

How to effectively log your data in Adroit

How to effectively log your...
Read More

The FR-E800 supports the following control Methods

The FR-E800 supports the following...
Read More

Dave’s Desk

From Dave's Desk The recent...
Read More

Adroit at the Africa Automation Technology Fair

Read More

Mitsubishi Electric Factory Automation Robots perform complex operations quickly

Automating the world... How Robots...
Read More

MTR Children Home charity golf day

Together, we can Building a...
Read More

Adroit Solutions in the Agriulture Industry

Adroit Solutions in the Agriculture...
Read More

Adroit SCADA in the Food Industry

Adroit SCADA in the Food...
Read More

Using an inverter to control pump stations

Advantages of using an Inverter...
Read More

Mitsubishi e-Factory

Mitsubishi e-Factory As the world...
Read More

Mitsubishi Electric Robots and MAPS help drive quality control

Mitsubishi Electric Robots and MAPS...
Read More

Adroit SCADA is designed with security and reliability at its core

Since the SmartUI Server is...
Read More

Need the most open, advanced, and scalable industrial SCADA platform on the market? We Are Experts!

Scroll to Top