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.

edbsnb6cbee27b41ef73fd6905f94ea211e05dbc54d6c8b224a029f836c16dac982edab739297afbca05ccbb4fec657dcaae65745c84a68010e2fe148f3cee0667c01?inline=true

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.

edbsnb6cbee27b41ef73fd6905f94ea211e05e5588a522368ccfc6ef8c2fcb7acbb9e95c9209297f4b306da43661c062919ac1c7a1db03fe5206962fce9c0939f62f3?inline=true

      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:

edbsnb6cbee27b41ef73fd6905f94ea211e05051906a388e86f5756037ef8fa0da3f17d51d7f6a04817a1e6fdd64cb109825105c828ca4614921abcc38c8a74f8f8f3?inline=true

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.

edbsnb6cbee27b41ef73fd6905f94ea211e05c095f5dcb00ab92a50f1b852c52aec666b274a846166b564c30ebfdc8665b056f1f48b5dc06d677beeae1f8f60e09405?inline=true

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

edbsnb6cbee27b41ef73fd6905f94ea211e05354b2f9b055dc27345f9f9c4d60d3802069714447efcf103af34970e950d6c42a377095a7498740ed8bc9113b66599bc?inline=true

      2.3 Modes:

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

edbsnb6cbee27b41ef73fd6905f94ea211e05fc5c5de1d5b2897f5269debcb5625e173bb2228c8928e12cd72e0ff2305548b21a96f0bd47a0caba691022703b18cd67?inline=true

            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.

edbsnc520e9c92012018a64d16065677f417829d4738f2a7cc2dc3d3a3f1a084f4699be8ae33ccbb659a99bb28567a58cf10581159cbd29f9caae301de9babe68db45?inline=true

      2.5 Overshoot Suppression Processing:

This input enables additional processing counteracting overshoot occurrence

edbsnc520e9c92012018a64d16065677f4178127f97ecea627302425a74c2d9da2a7722ed7109b91f1c540f27ee3ee3c6a887c7088c747711bc7992746634b4c298cb?inline=true
edbsnc520e9c92012018a64d16065677f41785ee4661b21ee5cb8e2158e9e2f837c33007fd2284c3525b434f42079923294c68b6d56977d13b2c55cfe9f43bf2c980e?inline=true

      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:

edbsnc520e9c92012018a64d16065677f4178a4a4896c033adcaf3ee1e2344fc96f8028e77622f7b9be663c5e8290ffc35614b446ecd6c4b5d3a932e555d8114c7f5d?inline=trueedbsnc520e9c92012018a64d16065677f4178321d671a3712ae574f179dc817481e2784a22b0b396e1a962bac8383edc5a9ab6b55cdd744bc80a41444ca35a30afdec?inline=true            

            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:

edbsnc520e9c92012018a64d16065677f4178c2c71a16acb73393e947100cb2a0d739bf63471e887ab35244f0883df945e3bd2701a6f897a378df73d9da7a70d85234?inline=true

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

edbsnc520e9c92012018a64d16065677f4178cb8b0b9066797896c973c0139929557a5378d07824984423237d37499399ef3ec81d56ef6ed3b6c029943e3a26a6bc49?inline=true

      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 (%).

edbsnc520e9c92012018a64d16065677f41782845b63eb8ae0bcd54bad08ee05c6797a5d49992e9ac97f466badda9b3578637b67a1658c9eebbb02a28e53bf4ac770b?inline=true

      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:

edbsnc520e9c92012018a64d16065677f4178b31852d3528d70ef4fc9424695b0178ec5ebbda4b54c45875b476a45411496798717fa33319111cdd7aedaf701bfeb16?inline=true

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

edbsnc520e9c92012018a64d16065677f41781760d5b0d0cb1d94431d43fe01cabee0b842661dd2dd43aa29f307b93345ff6a2217a2e7651d09f17b23e1b30f0a0b5b?inline=true

      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:

edbsnc74d29d95eb40bf73763897adfb7712dd5d384a69883c4db94a4bed2f8086f15a94978b66a26ac6cf9e101e30f811e15a225b6d1feb9526ec4ff2b607b1970a3?inline=true

            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. 

edbsnc74d29d95eb40bf73763897adfb7712dd332bb436034e75604fc8351e7d0382408590dbb0733f983c9ebcc1191b5464ef0ccdbfc9bfe66546dc76e34d64dd8f4?inline=true

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

edbsnc74d29d95eb40bf73763897adfb7712dc0a65585c6ee5b3a2caa341823c70ec6abb8e9d1605af27b69ac94df0e60f793a46d9120010aea6838c75b1599c4ead6?inline=true

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

edbsnc74d29d95eb40bf73763897adfb7712de1b01d4581ff148ebdf370b8f2ce87d2875d933ad8c90eff7677eef043864c40eac70e0184401be469a52c9ef2bbc452?inline=true

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

edbsnc74d29d95eb40bf73763897adfb7712da5d567ae2bd93e1a00f3cff0e3664e6915fd8005c59689e645c0bc86a87f260513fc97a9f94a71dd71071d2c495dea75?inline=true
edbsnc74d29d95eb40bf73763897adfb7712dc16f1db3c20e1ab0f545270fae0490b8b22081224e598a550e3fb2ecd473d237652a817cb420741c1f643c20d68f72ec?inline=true

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

edbsnc74d29d95eb40bf73763897adfb7712d0ced4800fa31b2ccf82cf391ba85d28ee5e14a498c6dec3d3baaf030e69700ba19fb8a0e2b1648b764e3da08833b9b6d?inline=true
edbsnc74d29d95eb40bf73763897adfb7712db269db32b5a6c94944c724e8f2b4e9fd030117aee66bd1f22cd36946ba8170c66102848f87af77d8b1239cba28131ae1?inline=true

            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 %.

edbsnc74d29d95eb40bf73763897adfb7712d4415bd55b26dba5e7b4801ddbbf6eae0a76e414e42327fb5671d16d12cc0ca78aa5e8b56979303c592614a5812ea9a71?inline=true

      3.3 Starting autotuning

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

edbsnc74d29d95eb40bf73763897adfb7712d2e858a1c0156c7f15182ef102dfc65d50a0e6c4562e61cf1d42b73747c18d1e5a2266da09441c60cbecd0ab0b29e1c4d?inline=true

When autotuning will start, output o_bInAutoTuning will turn on:

edbsnc74d29d95eb40bf73763897adfb7712d7132e9f6179a4b5b1217988e11011164afadc597dc3ab883e2831d96205569ffc2c4220ed9bb0e489f9be19838b0c25f?inline=true

When autotuning will end, output o_bAutoTuningComplete will turn on:

edbsnc74d29d95eb40bf73763897adfb7712d0f630300266da148b83228b7fa97f6c3c7166afd6431b2cb90d307d93fc92ef8758e0db0ba7a52b975f58d8ebd1f79cd?inline=true

      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:

edbsnc74d29d95eb40bf73763897adfb7712dbbde13d56c4a1e68423f16ad44852a49ca0d9eff8f35bc818f15fa89618fba2eeaf4e9dfd523e8ee9cd54b71001df9d0?inline=true

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:

edbsnc74d29d95eb40bf73763897adfb7712db109daa2ecfb83aa43bd888ed93f8609970d9d907805cb7725dda9a37c9f0b2f8eec06b91ce3dca3a747c1ce77cbf646?inline=true

Latest news and stories

The IIoT Revolution: Driving Efficiency and Connectivity with Adroit Technologies and Mitsubishi Electric Factory Automation

The IIoT Revolution: Driving Efficiency...
Read More

Generating an HL file in Adtech Licensing Utility v. 10.0.0.47 and above

Generating an HL file in...
Read More

iQ-F – Conversion between a single STRING and an array of WORD values

iQ-F - Conversion between a...
Read More

Inv – FR-A800 – Master Slave Synchronization – Changing rotation direction

Inv - FR-A800 - Master-Slave...
Read More

The Adroit Team Takes on Padel: A Fun Match with a Competitive Edge

The Adroit Team Takes on...
Read More

Adroit Technologies announces Management changes as of 1st August 2024

Adroit Technologies announces Management changes...
Read More

Mitsubishi Electric Low Voltage Switchgear Workshop

Low Voltage Switchgear Workshop Powering...
Read More

Congratulations to Our Newly Certified Engineers at Adroit Technologies!

Congratulations to Our Newly Certified...
Read More

Adroit SCADA and Mitsubishi Electric Factory Automation Training

Master the Future of Automation...
Read More

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

FROM DAVE’S DESK – ENERGY,...
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

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

Scroll to Top