1 Introduction

Recently, estimation of process model parameters from relay feedback technique has gained considerable attention for controller tuning in process industries. In relay based identification, the system generates sustained oscillations or limit cycle, with relay input. Liu et al. [1] presented a detailed tutorial review on process model identification in the past three decades. Fedele [2] suggested step response test to obtain the first order plus time delay (FOPTD) process model. But relay feedback method is more time efficient as compared to step test [3]. Many authors used describing function approximation (DFA) method to develop the analytical expressions for estimation of process model parameters. Li et al. [4] proposed algorithms for identification of stable and unstable process dynamics by using two relay tests which takes more time as the number of experiments doubled. Shen et al. [5] suggested an input biased relay test to find out two points on the Nyquist curve by applying dual input describing function approach to estimate the process model parameters of stable systems. Marchetti et al. [6] employed ideal relay to identify unstable processes. Lee et al. [7] used relay with hysteresis and DFA method to obtain the process dynamics of stable FOPTD systems. Padhy and Majhi [8] derived analytical expressions based on DFA method to calculate the process model parameters of stable and unstable FOPTD systems employing ideal relay. Bajarangbali and Majhi [9,10,11,12,13] applied DFA approach to identify process dynamics of FOPTD and second order plus time delay (SOPTD) systems, without considering generalized expressions. As in DFA technique the non-linear device relay is approximated by a gain (N) hence, the estimated process model parameters are approximate. So, many identification methods are proposed to obtain accurate process dynamics. Vivek and Chidambaram [14] employed Laplace transform approach for estimation of FOPTD process model parameters using symmetrical relay test. Thyagarajan and Yu [15] proposed shape factor of relay feedback response to estimate unknown process model parameters. Majhi and Atherton [16, 17] and Majhi [18] developed relay based identification algorithms for different types of systems using ideal relay and state-space method. Similarly, Bajarangbali et al. [19], Bajarangbali and Majhi [20, 21] used relay with hysteresis and state space technique for estimation of various process model parameters. These techniques involve extensive calculation and need to solve set of nonlinear equations simultaneously. In literature, system identification methods are available for one or two types of systems in general and few authors have considered the effect of noise. In this paper, a generalized SOPTD system is considered and explicit expressions are derived to estimate the parameters of second order overdamped, underdamped, critically damped, stable and unstable first order and unstable second order systems during offline and online mode of operation. Under noisy environment an ideal relay is subjected to chattering hence, to avoid incorrect relay switching, relay with hysteresis is applied for system identification [1, 7]. Relay with hysteresis reduces the effect of measurement noise and further noise elimination is carried out with the help of a closed loop denoising block consisting of a derivative and an integrator in series feedback. This denoising block is modified from the one considered in [19] where it consists of two derivative blocks and an integrator. Generally, the hysteresis width is selected as twice the standard deviation of noise [3].

2 Proposed Method and Analytical Expressions

A relay in parallel with PID controller is connected to the system in closed loop to generate sustained oscillations during online identification whereas in offline mode the relay test is conducted without controller. The DFA technique is applied to derive explicit expressions for estimation of unknown process model parameters. The generalized transfer function of stable and unstable SOPTD system is given by

$$\begin{aligned} G(s) = \frac{{Ke^{ - \theta s} }}{{m s^2 + n s \pm 1}} \end{aligned}$$
(1)

where K is steady state gain, \(\theta \) is time delay, m and n are system parameters. The nonlinear device relay with hysteresis is approximated by a gain of

$$\begin{aligned} N = \frac{{4h\left( {\sqrt{A^2 - \varepsilon ^2 } - j\varepsilon } \right) }}{{\pi A^2}} \end{aligned}$$
(2)

where h is relay height, A is limit cycle amplitude and \(\varepsilon \) is hysteresis width. The standard form of PID controller in frequency domain is represented as

$$\begin{aligned} G_c (j\omega ) = K_p \left( {1 + \frac{1}{{T_i (j\omega )}} + T_d (j\omega )} \right) \end{aligned}$$
(3)

where \(K_p\) is proportional gain, \(T_i\) integral time constant and \(T_d\) is derivative time constant. Similarly the system represented by eq. (1) can be written as

$$\begin{aligned} G(j\omega ) = \frac{{Ke^{ - j\omega \theta } \alpha \beta }}{{(j\omega \mp \alpha )(j\omega - \beta )}} \end{aligned}$$
(4)

where

$$\begin{aligned} \alpha = \frac{{- 2}}{{n + \sqrt{n ^2 \mp 4m }}}; \quad \beta = \frac{{\mp 2}}{{ n - \sqrt{n ^2 \mp 4m }}} \end{aligned}$$
(5)

In this paper, eq. (1) is realized in the form of six typical transfer function models: overdamped SOPTD (OSOPTD), underdamped SOPTD (UDSOPTD), unstable SOPTD (UNSOPTD), critically damped SOPTD (CSOPTD), stable FOPTD (SFOPTD) and unstable FOPTD (UNFOPTD). The detailed derivation of expressions to estimate unknown process model parameters of these systems are given below. The condition to get sustained oscillations for online identification is

$$\begin{aligned} G(j\omega ) + \frac{1}{{\left( {N + G_c (j\omega )} \right) }} = 0 \end{aligned}$$
(6)

Substituting eqs. (2), (3) and (4) in eq. (6) and further solving we get

$$\begin{aligned} \frac{{Ke^{ - j\omega \theta } \alpha \beta }}{{(j\omega \mp \alpha )(j\omega - \beta )}} + \frac{1}{{\left( {u + jv} \right) }} = 0 \end{aligned}$$
(7)

where

$$\begin{aligned} u = K_p + \frac{{4h\sqrt{A^2 - \varepsilon ^2 } }}{{\pi A^2 }}; \qquad v = \omega K_p T_d - \frac{{K_p }}{{\omega T_i }} - \frac{{4h\varepsilon }}{{\pi A^2 }} \end{aligned}$$
(8)

2.1 Expressions for SOPTD Systems

The transfer function given in eq. (1) can be realized as stable and unstable SOPTD system with the condition \(n ^2 > 4m\) for OSOPTD, UNSOPTD systems and with \(n ^2 < 4m\) for UDSOPTD system. Substituting \(\alpha \) and \(\beta \) given in eq. (5) into eq. (7) and solved further to get

$$\begin{aligned} \frac{{Ke^{ - j\omega \theta } }}{{m\omega ^2 - j\omega n \mp 1}} = \frac{{u - jv}}{{u^2 + v^2 }} \end{aligned}$$
(9)

where \(\omega = 2\pi /T\), T is time period of limit cycle. Equating the magnitude on both sides of eq. (9), the following expression is obtained

$$\begin{aligned} m = \frac{{ \pm 1 + \sqrt{K^2 \left( {u^2 + v^2 } \right) - \left( {\omega n} \right) ^2 } }}{\omega ^2 } \end{aligned}$$
(10)

Similarly, equating the phase angle on both sides of eq. (9) we can write

$$\begin{aligned} n = \frac{{m\omega ^2 \mp 1}}{\omega }\left[ {\tan \left( {\omega \theta - \tan ^{ - 1} \left( {\frac{v}{u}} \right) } \right) } \right] \end{aligned}$$
(11)

Now, utilizing eqs. (10) and (11) the below mentioned explicit expressions are derived

$$\begin{aligned} m = \frac{1}{{\omega ^2 }}\left[ { 1 + K\sqrt{u^2 + v^2 } \cos \left( {\omega \theta - \tan ^{ - 1} \left( {\frac{v}{u}} \right) } \right) } \right] \end{aligned}$$
(12)

for OSOPTD system.

$$\begin{aligned} m = \frac{1}{{\omega ^2 }}\left[ { K\sqrt{u^2 + v^2 } \cos \left( {\omega \theta - \tan ^{ - 1} \left( {\frac{v}{u}} \right) } \right) } -1 \right] \end{aligned}$$
(13)

for UNSOPTD system.

$$\begin{aligned} n = \left[ {\frac{{K\sqrt{u^2 + v^2 } }}{\omega }} \right] \sin \left( {\omega \theta - \tan ^{ - 1} \left( {\frac{v}{u}} \right) } \right) \end{aligned}$$
(14)

for OSOPTD and UNSOPTD systems. Hence, the expressions given in eqs. (12) and (14) are used to estimate the process model parameters (m and n) for OSOPTD system and eqs. (13) and (14) are utilized to obtain the parameters of UNSOPTD system. Similarly, the expressions given in eqs. (12) and (14) are also used to estimate the process model parameters of UDSOPTD system.

Now, a critically damped SOPTD system is represented as

$$\begin{aligned} G(s) = \frac{{Ke^{ - \theta s}}}{{\left( {\sqrt{m } s + 1} \right) ^2 }} \end{aligned}$$
(15)

which is obtained by substituting \(n=2\sqrt{m}\) in eq. (1). Hence, this value of n, is put in eq. (5) to get \(\alpha =\beta =-1/\sqrt{m}\) which are utilized in (7) and reduced to

$$\begin{aligned} \frac{{Ke^{ - j\omega \theta } \left( {u + jv} \right) }}{{\left( {j\omega \sqrt{m} + 1} \right) ^2 }} = - 1 \end{aligned}$$
(16)

Again, equating the magnitude and phase angle on both sides of eq. (16) to obtain

$$\begin{aligned} \sqrt{m}= & {} \frac{1}{\omega }\left[ \cot \left( \left( \omega \theta - \tan ^{- 1} \left( \frac{v}{u} \right) \right) /\,2\right) \right] \end{aligned}$$
(17)
$$\begin{aligned} K= & {} \frac{m\omega ^{2} + 1}{\sqrt{u^2 + v^2 }} \end{aligned}$$
(18)

2.2 Expressions for FOPTD Systems

The following stable and unstable FOPTD system is obtained with \(m=0\) in eq. (1)

$$\begin{aligned} G(s) = \frac{{Ke^{ - \theta s} }}{{ n s \pm 1}} \end{aligned}$$
(19)

Using \(m=0\) in (5), one can get \(\alpha =-1/n\) and \(\beta =\infty \) which are substituted in eq. (7) and solved to obtain

$$\begin{aligned} \frac{{Ke^{ - j\omega \theta } \left( {u + jv} \right) }}{{(j\omega n \pm 1)}} = - 1 \end{aligned}$$
(20)

Considering the magnitude and phase angle on both sides of eq. (20) the following explicit expressions are obtained

$$\begin{aligned} n = \frac{{\sqrt{K^2 \left( {u^2 + v^2 } \right) - 1} }}{\omega } \end{aligned}$$
(21)

for SFOPTD and UNFOPTD.

$$\begin{aligned} \theta = \frac{1}{\omega }\left[ {\pi + \tan ^{ - 1} \left( {\frac{{v - u\omega n}}{{u + v\omega n}}} \right) } \right] \end{aligned}$$
(22)

for SFOPTD.

$$\begin{aligned} \theta = \frac{1}{\omega }\left[ {\tan ^{ - 1} \left( {\frac{{v + u\omega n}}{{u - v\omega n}}} \right) } \right] \end{aligned}$$
(23)

for UNFOPTD.

Here, eqs. (21) and (22) are used to estimate the process model parameters n and \(\theta \) of SFOPTD system and eqs. (21) and (23) are utilized to get the parameters (n and \(\theta \)) of UNFOPTD system. From the above derivations it can be observed that the DFA technique gives expressions for two parameters for a particular system so, estimation of remaining parameters is carried out as explained next. Steady state gain (K) is assumed to be positive and estimated from steady state simulation [3] for all process models except CSOPTD, and process time delay \(\theta \) is estimated from the measurements of \(t_1\) and \(t_0\) [18] as \(\theta \) = \((t_1 - t_0)\), for all models except SFOPTD and UNFOPTD, where \(t_0\) is the relay switching time with reference to limit cycle and \(t_1\) is the time at which instant change occurs in second derivative output of limit cycle. The expressions obtained in Sects. 2.1 and 2.2 are applied for online system identification where the initial controller parameters, \(K_p\) = 0.01 for stable systems and 0.001 for unstable systems, \(T_i\) = 0.5 and \(T_d\) = 0.125 are selected based on many simulation results. Once the process dynamics are identified then suitable model based controller is designed.

2.3 Expressions for Offline System Identification

As mentioned earlier during offline mode of operation, the relay test is conducted in absence of controller. Hence, the expressions derived in Sects. 2.1 and 2.2 are modified with the following changes to identify the process dynamics during offline mode

$$\begin{aligned} u = (4h\sqrt{A^2 - \varepsilon ^2 })/ \pi A^2 ; \quad v = - 4h\varepsilon /\pi A^2 \end{aligned}$$
(24)

The final expressions obtained for different types of systems are given in Table 1 and the procedure to estimate the remaining parameters is as explained in Sect. 2.2.

Table 1 Expressions for offline system identification

3 Simulation Study

The proposed method is validated with simulation results for both online and offline mode of operation. The examples available in literature in the form of transfer function models obtained from processes are considered. To conduct the test under noisy environment, a normally distributed random additive noise with zero mean and certain variance, (0, \(\sigma ^2_n\)), is added at the process output to generate noisy oscillations, the details are given in examples. To estimate the parameters in presence of measurement noise, the noisy process output is passed through the denoising block to obtain the noise free limit cycle output as mentioned earlier. The frequency domain estimation error index (\({\widetilde{E}}\)) for each of the process models is found by applying integral of absolute error (IAE) criterion as

$$\begin{aligned} {\widetilde{E}} = \int _0^{f} {\left| {\frac{{G_{p} (j\omega ) - G(j\omega )}}{{G_{p} (j\omega )}}} \right| } d\omega \end{aligned}$$
(25)

where \(G(j\omega )\) is actual process, \(G_{p} (j\omega )\) is proposed model both in frequency domain and f is phase cross over frequency of the actual process. During online identification the initial controller settings mentioned in Sect. 2.2 are used to generate the sustained oscillations in the following examples. For both offline and online test, same relay settings are used.

Remark: In online identification the PID controller remains in operation during the identification test. Therefore, estimated process model parameters depend on initial or updated controller parameters. The error index (\({\widetilde{E}}\)) for proposed models for online identification can be fine tuned (than offline) by setting desirable controller parameters. Once the process models are identified, then a suitable controller can be designed.

Example 1

Let us consider the following process model [2] for an OSOPTD system

$$\begin{aligned} G(s) = \frac{{e^{ - 4s}}}{{20s^2 + 12s + 1}}. \end{aligned}$$

During online identification the relay with parameters \(h=1\) and \(\varepsilon =0.02\) is applied to the above system to generate limit cycle and its second derivative output as shown in Fig. 1. The measured limit cycle parameters are \(A=0.3599\), \(T=20.1205\) and \(t_0=0.2246\) whereas \(t_1=4.2246\) is measured from second derivative output of limit cycle. The process model parameters \(K=1.0\) and \(\theta =4.0\) are estimated from the procedure explained in Sect. 2.2. Substituting these parameters along with limit cycle parameters in eqs. (12) and (14) and solved to estimate \(m=19.2277\) and \(n=11.0269\) respectively. Similarly for offline identification the limit cycle and its second derivative output parameters measured are \(A=0.353\), \(T=19.9445\), \(t_0=0.2263\) and \(t_1=4.2263\). The process model parameters \(K=1.0\) and \(\theta =4.0\) are obtained using the procedure explained above in this example. The parameters for K, \(\theta \) and other limit cycle parameters are substituted in the corresponding expressions as mentioned in Table 1 for OSOPTD system to estimate \(m=19.2163\) and \(n=11.0831\). Fedele [2] proposed FOPTD model for this system using step input method. The identified process models during online and offline mode of operation, in the form of transfer functions are given in Table 2 along with the model proposed by Fedele [2] and the corresponding estimation error for each process model. Eventhough the model suggested by Fedele [2] has less estimation error but the author has not considered online identification test. To show the efficiency of proposed method under noisy environment, the process dynamics are identified in presence of measurement noise of 0.001 NSR. This noise effect is achieved using a normally distributed random additive noise with zero mean and \(5.1665\times 10^{-5}\) noise variance for online identification. The noisy process output and denoised limit cycle output are as shown in Fig. 2 and the proposed model is given in Table 6 along with estimation error.

Fig. 1
figure 1

Limit cycle and its second derivative output signals

Fig. 2
figure 2

Noisy and denoised outputs

Table 2 Comparison of process models for Example 1

Example 2

In this example an UDSOPTD system [22] is considered with the following transfer function model

$$\begin{aligned} G(s) = \frac{{e^{ - 0.01s}}}{{s^2 + 0.6s + 1}}. \end{aligned}$$

For online identification the relay (\(h=1\) and \(\varepsilon =0.3\)) input to the system generates limit cycle and its second derivative output, with the parameters \(A=0.6274\), \(T=3.774\), \(t_0=0.2791\) and \(t_1=0.2891\). Similar to Example 1, the process model parameters \(K=1.0\) and \(\theta =0.01\) are estimated. These parameters are substituted in eqs. (12) and (14) with limit cycle quantities to estimate \(m=1.0014\) and \(n=0.6066\) respectively. Similarly for offline identification the measured limit cycle and its second derivative parameters are \(A=0.6239\), \(T=3.7766\), \(t_0=0.2809\) and \(t_1=0.2909\). So, \(K=1.0\) and \(\theta =0.01\) are estimated similar to Example 1 and these parameters are utilized with limit cycle quantities in the corresponding expressions for UDSOPTD system mentioned in Table 1 to estimate \(m=1.0017\) and \(n=0.6076\). The proposed models and the model suggested by Lavanya et al. [22] are given in Table 3 along with the respective estimation error. It can be observed that the proposed models have less estimation error than the model suggested by Lavanya et al. [22]. The results are also compared using Nyquist plots as shown in Fig. 3. In presence of measurement noise of 0.01 NSR, the identified model during online mode is given in Table 6.

Table 3 Comparison of process models for Example 2
Fig. 3
figure 3

Nyquist plots for example 2

Example 3

This example illustrates identification of CSOPTD process dynamics for the following system [15]

$$\begin{aligned} G(s) = \frac{{e^{ - 0.01s}}}{{ \left( {2s + 1} \right) ^2}}. \end{aligned}$$

Application of online relay (\(h=1\) and \(\varepsilon =0.1\)) feedback test generates the limit cycle and its second derivative output with the quantities \(A=0.1558\), \(T=4.6557\), \(t_0=0.4877\) and \(t_1=0.4977\). So, the time delay parameter, \(\theta =0.01\) is obtained. Substituting the required parameters in eqs. (17) and (18), the remaining process model parameters are estimated as \(\sqrt{m}=1.9962\) and \(K=1.0084\). Similarly the parameters measured during offline test are \(A=0.1555\), \(T=4.6582\), \(t_0=0.4888\) and \(t_1=0.4988\), so, \(\theta =0.01\). Utilizing these parameters in the expressions mentioned in Table 1 for CSOPTD system, the process model parameters are obtained as \(\sqrt{m}=1.9938\) and \(K=1.0054\). These identified process dynamics are represented in transfer function models in Table  4 along with the model proposed by Thyagarajan and Yu [15]. To illustrate the robust performance of the proposed method, the relative range in % error for system parameter, m (for online identification) against the deviations in limit cycle parameters, A and T in the range of ±10%, is plotted as shown in Fig. 4. for this example. Under noisy environment of 0.1 NSR, the process model parameters are estimated during offline mode and the proposed model is given in Table 6. The noisy and denoised process outputs are as shown in Fig. 5.

Table 4 Comparison of process models for Example 3
Fig. 4
figure 4

Estimation error (%) due to deviations in measurements of A and T for Example 3

Fig. 5
figure 5

Noisy and denoised outputs

Example 4

Estimation of process model parameters of the following UNSOPTD system [14] is explained in this example

$$\begin{aligned} G(s) = \frac{{e^{ - 0.5s}}}{{ s^2 + 1.5s - 1}}. \end{aligned}$$

The online identification is carried out using the relay settings \(h=1\) and \(\varepsilon =0.2\) to generate limit cycle and its second derivative output with the parameters \(A=0.8627\), \(T=13.2162\), \(t_0=0.3631\) and \(t_1=0.8631\). Hence, \(K=1.0\) and \(\theta =0.50\) are obtained as explained in Sect. 2.2. These parameters are utilized in eqs. (13) and (14) to find out the remaining process model parameters \(m=1.3925\) and \(n=1.4195\) respectively. Similarly the limit cycle parameters measured during offline mode are \(A=0.857\), \(T=13.0391\), \(t_0=0.3646\) and \(t_1=0.8646\). Using these quantities with \(K=1.0\) and \(\theta =0.50\) in expressions mentioned in Table 1 for UNSOPTD system, the model parameters are estimated as \(m=1.3797\) and \(n=1.4142\). For this system Vivek and Chidambaram [14] suggested FOPTD model as given in Table 5 along with proposed models. The process model identified in presence of measurement noise of 0.01 NSR, during online mode is mentioned in Table 6.

Table 5 Comparison of process models for Example 4
Table 6 Proposed models in presence of measurement noise

4 Conclusion

A simple DFA technique is used to derive explicit expressions in terms of relay and limit cycle parameters to estimate process model parameters during online and offline mode of operation. Relay with hysteresis is applied to get process information in the form of limit cycle. A second order system with time delay is generalized in terms of six different types of systems and accordingly expressions are derived. Examples are considered in the form of transfer function models and parameters are estimated to show efficacy and robustness of the proposed method. Process dynamics are also identified in presence of measurement noise of different NSR values.