Online Identification of a Two-Mass System in Frequency Domain using a Kalman Filter

Some of the most widely recognized online parameter estimation techniques used in different servomechanism are the extended Kalman filter (EKF) and recursive least squares (RLS) methods. Without loss of generality, these methods are based on a prior knowledge of the model structure of the system to be identified, and thus, they can be regarded as parametric identification methods. This paper proposes an on-line non-parametric frequency response identification routine that is based on a fixed-coefficient Kalman filter, which is configured to perform like a Fourier transform. The approach exploits the knowledge of the excitation signal by updating the Kalman filter gains with the known time-varying frequency of chirp signal. The experimental results demonstrate the effectiveness of the proposed online identification method to estimate a non-parametric model of the closed loop controlled servomechanism in a selected band of frequencies.


Introduction
System identification techniques for the diagnostics and condition monitoring of a mechanical system are key tools to enhance the reliability of electrical drives.An adequate system identification technique is of great importance in the process of acquiring a mathematical model that sufficiently represents the essential system dynamics.In terms of how the collected input output data are transformed into a mathematical model, the methods proposed for identification of mechanical systems can be broadly speaking divided into two main categories: parametric identification (Ljung, 2010) and non-parametric identification techniques (Heath, 2001).Moreover, the identification can be performed in offline or in online mode by time-or frequency-domain observations.Different time-domain methods based on a least squares criterion are commonly used in off-line identification of mechanical systems in open-loop (Nevaranta et al., 2014) or closed-loop control (Saarakkala and Hinkkanen, 2015).Similarly, for online identification purposes, some of these methods have been successfully applied to online parameter estimation by considering their recursive form (Nevaranta et al., 2015a).One of the most widely recognized tools for estimating parameters of the mechanical system online is the extended Kalman filter (EKF) method (Schutte et al., 1997), (Perdomo et al., 2013).Basically this technique is an extension of the recursive least squares parameter (RLS) estimation method, which is also widely used for online identification in different applications.Broadly speaking, these methods can be regarded as parametric identification techniques, because they are usually based on fixed, a priori determined, structure of mathematical relation, and thus, the parameters of structure are fitted to the data.In the case of non-parametric identification, typically no (or few) assumptions are made with respect to the model structure.The wellestablished non-parametric frequency-domain identification methods (Heath, 2001), (Villwock and Pacas, 2008), (Schoukens et al., 2012) are non-recursive, and based on the availability of the whole data record required to perform the necessary calculations.This implies that the identification must, in practice, be performed using offline or batch data processing.
Despite the theoretical development of offline frequency-domain identification methods, there are only a few studies available on the issues related to the use of non-parametric techniques for online identification purposes.In (Barkley and Santi, 2009) a non-parametric cross-correlation identification method is proposed for loop transfer function identification in closed loop.The method provides accurate frequency response estimates, but it requires a large amount of data processing and memory storage space.In (LaMaire et al., 1987) a less time-consuming identification method has been presented that applies sliding window to calculate Discrete Fourier Transformation (DFT) to fit parametric model for identification for control purposes, but in practice, the method is not stable (Duda, 2010).In addition, frequency-domain approaches that are based on adaptive neural networks have been proposed for adaptive control (Kurita et al., 1999), (Yen, 1997).Furthermore, in (Holzel and Morelli, 2011) a real-time equation error method based on a finite Fourier transform in the frequency domain has been suggested for linear model identification.Another method has been introduced in (Olivier, 1994), where a Fourier-Laguerre series is proposed for the open-loop identification of a linear system.However, these methods can be regarded as parametric identification methods as they require initial selection of the model complexity.
Motivated by the features of the Kalman-filter-based short-time DFT identification routines proposed in (Parker and Bitmead, 1987), (Nevaranta et al., 2015b) for frequency response identification of open-loop and closed-loop systems using a multi-sine excitation signal, the objective of this paper is to study the same routine in the case of a swept chirp excitation signal.In particular, the main idea of using the Kalman filter for estimating time-varying signals in a complex form is considered, but here the knowledge of the time-varying frequency of the excitation signal is used to update Kalman gains.This provides an opportunity to use a simple state space realization for tracking a selected band of frequencies of a swept excitation signal in-stead of large block-diagonal form (Jenssen and Zarrop, 1994) for a selected set of frequencies of a multi-sine signal.It is worth pointing out that in recent studies by (Goubej, 2015), (Goubej et al., 2013), (Kshirsagar et al., 2016) a similar type of identification routines has been considered, but in practice, the method in (Goubej, 2015) is different as considered in this paper, because in (Goubej, 2015) the block-diagonal form is used to estimate harmonic content of the swept excitation signal.Moreover, (Kshirsagar et al., 2016) considers Least Mean Squares (LMS) based adaptive filter structure, and the persistent excitation signal is superposed to the position reference of the closed-loop system, whereas in this paper, the swept excitation is added to the output of closed-loop controller and a Kalman filter is used.
The method proposed in this paper can be regarded as an online frequency response estimation routine that is based on an instantaneous estimation of the system response.The performance of the proposed method is verified by an experimental closed-loop controlled servomechanism, and the obtained online identification results are compared with the corresponding offline post-processed spectral transfer function estimates.While the main focus of this paper is on the non-parametric online identification, the closed-loop system diagnostic options with the proposed method are also discussed in brief.The diagnostics is based on the identified open-loop system model that is used to calculate the loop transfer function with the known controller.
The contents of the paper are organized as follows.Section 2 discusses the problem statement and the tracking of the chirp signal with the Kalman filter.Section 3, the mechanical system under study is introduced and the proposed non-parametric identification method is studied by simulations.Section 4 shows experimental identification results, and the system monitoring opportunities of the proposed method are discussed in short.Section 5 concludes the paper.

Problem Statement
In general, different systems can be identified either in open loop or closed loop by considering transfer function estimates that are formed by the ratios of autoand cross-spectral estimates.This type of frequencydomain identification is a well-established and common approach for different systems under very general excitation conditions (Heath, 2001).In the open-loop case, the spectral transfer function estimate can be formed by taking the ratio of the cross-spectral estimate between input and output Ŝuy (e jω ) with the auto-spectral estimate of the input Ŝuu (e jω ); thus, the frequency re-sponse estimate becomes Ĝ(e jω ) = Ŝuy (e jω ) Ŝuu (e jω ) (1) The spectral estimates can be obtained in different ways (Villwock and Pacas, 2008), but in general, Eq. ( 1) gives a good approximation of the real system G(e jω ) based on the assumption that the measurement noise n(k) and the input are uncorrelated, meaning that S un (e jω ) = 0.This type of frequency response estimator Eq. ( 1) has been successfully used in the identification of a closed-loop controlled system by setting the controller bandwidth relatively low (Beineke et al., 1998) (Villwock and Pacas, 2008).However, when noise is affecting the system input u(k), the method can give poor frequency response estimations if a separate noise model estimation is not included in the estimation routine.
In this paper, the closed-loop system shown in Figure 1 is considered, where G(z) is the unknown linear transfer function of the system to be identified, and C(z) is the known linear transfer function of the controller.The closed-loop controlled system is considered a stable linear time-invariant (LTI) system, which is excited by a known excitation signal r u (k), and an unknown noise signal n(k) affects the system output y(k).The measured output y(k) can be expressed as where u(k) is the measured input of the system.The closed-loop system can be expressed, without a reference signal r(k), as follows where S(z) is the sensitivity transfer function By using the following notation G cl (z)=G(z)S(z) and considering the relation between y(k) and r u (k) in Eq. ( 3), the open-loop transfer function can be expressed as Thus, the open-loop transfer function can be indirectly solved from the closed-loop spectral transfer function estimate that is formed from the crossspectral estimate between output and excitation signals Ŝyr u (e jω ) and auto-spectral estimate of the excitation signal Ŝr u r u (e jω ) Figure 1: Closed-loop controlled system.The swept excitation signal is superposed to the controller output.
Ĝcl (e jω ) = Ŝyr u (e jω ) Ŝr u r u (e jω ) (6) The main advantage of the indirect identification method is that the open-loop model Ĝ(e jω ) can be correctly estimated even without estimating any noise model (Heath, 2001).The frequency-domain identification schemes Eq. (1) and Eq. ( 6) are well established and commonly applied to the identification of different systems.The primary disadvantage of the frequency domain analysis includes the required calculation of a discrete Fourier transform of the measured data, which is often performed offline.Basically, in the case of offline data processing, the computation time do not impose any limitations, since all the input-output data are collected prior to analysis.These calculations are not usually desirable features for online estimation procedures that deals with real-time updates when new data is available during the operation.Therefore, the issue of computational requirements for estimation becomes important.For online identification purposes, the monitoring of the mechanical system at a selected set or band of frequencies is a desirable feature.When the behaviour of these frequencies has to be tracked in real time, it is worth considering a non-parametric identification algorithm that provides benefits in the terms of computational efficiency and real-time performance.This paper proposes a Kalman-filter-based frequency domain identification method that is synchronized to the instantaneous frequency of the chirp excitation signal.

Time-Frequency Representation of
Signals using a Kalman Filter short-time DFT can be obtained by considering the following simplified state-space representation where x(k) is the state vector, Φ(k) is the state transition matrix, and H(k) is the measurement matrix.v(k) and w(k) are the measurement and model error vectors.The following Kalman filter solution can be written for the state estimation problem where K(k) is the Kalman gain vector where R(k) is the measurement error covariance matrix, and P -(k) is the state prediction covariance defined as where Q(k) is the model error covariance matrix, and estimation error covariance P(k) is updated as The following state vector is required to estimate a nth frequency component ω n where x real (k) and x imag (k) are the real and imaginary components of the signal that can be estimated by considering the following transition matrix where T s is the sample time.Furthermore, the amplitude of the tracked frequency can be directly calculated at any time instant k from the estimated state variables as follows It is worth noticing that the first and second element of the state vector Eq. ( 12) consist of a frequency component and its derivative.Thus, the output z(k) of the signal model Eq. ( 7) is formed from the real part of the signal components by using measurement matrix H(k) = [1 0].Moreover, as the covariance matrix is updated Eq. ( 11), the optimal Kalman gain K(k) has a time-varying nature.As proposed in (Bitmead et al., 1986), fixing the covariance matrix at P(k) = αI and choosing R 1x1 = r gives the steady-state values of the Kalman gain vector This expression gives a filter expression that is a fixed-coefficient state observer with predetermined stability characteristics (Kamwa et al., 2014), and the states can be straightforwardly estimated by using Eq. ( 8).Furthermore, this form provides a simple tuning rule for the gain: the gain depends only on the ratio r/α as the matrices Φ(k) and H(k) are known.Thus, the choice of α directly influences the tracking and error covariance; for instance, a small value yields slow tracking and a small error covariance.Setting λ = r/α gives the opportunity to use only one design parameter in the Kalman gain.

Chirp Excitation Signal
As discussed in (Jenssen and Zarrop, 1994) and (Nevaranta et al., 2015b), in the case of a multi-sine excitation signal the state-space realization Eq. ( 12)and Eq. ( 13) can be modified so that more than one frequency component can be estimated at the same time by using the block-diagonal representation.However, this modification increases the computational burden, and the estimator is slightly slower as more states are estimated simultaneously at the same time instant k.When considering the chirp excitation signal, it can be expressed as sinusoid so that the frequency is time varying The time-varying frequency f(t) can be expressed as where f 0 is the starting frequency of the chirp, and m is the rate of frequency increase over duration T Hence, the frequency is linearly swept from the starting frequency f 0 to the desired end frequency f 1 .When considering the transition matrix Eq. ( 13) for tracking a single frequency component, the Kalman gain Eq. ( 15) is fixed.In the case of chirp, the swept sinusoid can be tracked with proposed fixed Kalman gain filter by updating Eq. ( 13) with the known time-varying frequency Eq. ( 17).In this case, the Kalman gains behave sinusoidal as a function of frequency, because the transition matrix Φ(k) is frequency dependent.Thus, depending of the frequency of the sinusoid to be tracked, the fixed Kalman gains are different.As a conclusion, depending on the Kalman filter configuration used, for instance Eq. ( 9) or Eq. ( 15), the frequency to be tracked must be considered in the Kalman gain update routine.In practice, the frequency of the swept sinusoid can also be estimated as proposed in (Bittanti and Savaresi, 2000) and the time-varying Kalman gain is updated with the estimated state instead of a priori known value.

Monitoring and Identification of a Mechanical System
From the viewpoint of system identification, the signal component representation with Kalman filter provides an opportunity to recursively estimate Fourier components of the signals depicted in Figure 1 in the form Ŷ(e jω ,k), Û(e jω ,k) and Ru (e jω ,k).Thus, by writing the frequency response description the non-parametric system model Ĝ(e jω ,k) can be online identified in a phasor form from the corresponding states x real (k) and x imag (k) of the estimated signals.
This allows to estimate the frequency response by a magnitude and phase as The magnitude Eq. ( 20) is generally expressed in dB as 20 • log 10 | Ĝ(e jω , k)|.As a conclusion, the proposed method can be used to estimate frequency responses as Bode or Nyquist (polar) plots on a sample-by-sample basis.It should be noted, that the sample-by-sample recursive calculations are basic properties or options of other well-known online frequency domain identification methods, such as Sliding-DFT (Nevaranta et al., 2016) or Fourier transform regression (Holzel and Morelli, 2011).However, these methods are based on the utilization of a moving window to store predefined amount of samples, whereas the method proposed in this paper, the frequency response is processed online from the current values of the measured input-output signals by synchronizing the Kalman filter to the instantaneous frequency of the excitation signal.In other words, the frequency response estimate is obtained from the instantaneous states.However, the main drawback is the rapid changes in the excitation signal that can introduce transients to the system which can distorts the frequency response measurement, as the proposed Kalman filter method assumes a steady state response to a constant frequency harmonic signal from its definition (Goubej, 2015).Thus, a longer duration of the identification experiment is essential in order to obtain reliable results, and hence, a slow frequency sweeping is required.
In order to show the feasibility of the method, in this paper, the online-estimated frequency responses are analysed and validated by comparing the obtained magnitude and phase with the reference model.Moreover, the time-frequency presentation of signals with Kalman filter yields a non-parametric model in the form of G(jω) in the selected band of frequencies, thereby leading to an option to directly use this result with the known controller C(jω) to calculate loop transfer function L(jω) = C(jω)•G(jω).Thus the result is also analysed with the Nyquist plot, and opportunities for loop-diagnostics purposes are discussed.

Two-Mass-System
In this paper, an experimental mechanical system with different mechanical configurations is considered to experimentally verify the identification method.The parameters presented in Table 1 are regarded as the reference system values for the experimental coupled belt drive system under study.First, the proposed identification method is studied by simulations by considering a closed-loop controlled two-mass system depicted in Figure 2 with both reference system A and B parameters from Table 1.The dynamics of the mechanical system in Figure 2 can be described by the following set of equations: Equations ( 22) and ( 23) are the elementary dynamic equations for rotation, where J 1 = J 11 + J 12 and J 2 Nip roller 2 Nip roller 1 Figure 2: Coupled belt system consisting of nip rollers coupled by a flexible belt.A belt tensioner is used to set the tension in the system.The inertia ratio of the system can be adjusted by removing the upper rollers.
= J 21 + J 22 represents the total moment of inertias of the nip rollers 1 and 2, Ω 1 and Ω 2 are the angular velocities of the rollers, T is the torque, T fr is the frictional torque component, r is the roller radius, and F represents the tension force.The dynamics of the coupling is expressed by Eq. ( 24), where K is the spring constant, and D is the damping constant of the belt material.A more detailed discussion on the mechanical system considered in this paper can be found in (Nevaranta et al., 2015b).
The identification experiments are carried out so that the nip roller 2 is treated as a driven one, and the nip roller 1 is used as a load to set the tension of the belt.The angular velocity Ω 2 of the nip roller 2 is controlled with a PI-controller, whereas the nip roller 1 is controlled by a torque controller.Thus, the system is operated at the desired constant nonzero velocity, and the identification is carried out so that the excitation signal is added to the torque reference signal of nip roller 2 after the system has been stabilized to the desired velocity.The signals used in the identification are the torque input u(k) = T 2 and angular velocity y(k) = Ω 2 .

Frequency Response Estimation
The identification tests are performed so that a constant velocity profile 10 rad/s is used, and persistent excitation is superposed to the torque reference.A chirp signal is considered as an excitation signal, which is swept from 35 to 1.5 Hz during 17 s and the amplitude is chosen as 1 Nm.The controller C(z) of the system is a low-bandwidth PI-controller with a proportional gain K p = 10 1/s and integration time T i = 0.1 s.The feedback delay of 4 ms is considered in the simulations and assumed to be known in the estimation routine, and the Kalman filter tuning parameter is set λ = 8.In the simulations, white noise, zero mean, with a standard deviation 0.1 is added to the output signal y(k).A direct identification method Eqs. ( 19)-( 21) is considered, where input u(k) and output y(k) signals are used in the identification process.Obviously, the inherent problem of direct identification schemes arises as a result of correlation between the input and output signals used in the identification experiment, but as the low bandwidth controller is considered the direct identification is applicable for frequency response estimation (Villwock and Pacas, 2008).It is also remarked that, in practical applications several noise and disturbances sources can be found which influences the frequency response estimation.In this paper, the proposed identification method is further validated with an experimental test setup when disturbance sources such as field-bus delays, encoder noise, torque control of the frequency converters and friction influences to the estimation.
In Figure 3 a)-b) the directly online estimated frequency responses are shown for both reference systems A and B when noise is affecting the system output and also in the noise-free case.Moreover, in Figure 3  c)-e) the signals used in the identification experiment are evaluated by the residual (k) = z(k) − H(k)x, and the Figure 3 f) shows the frequency contents of the swept excitation signal.It can be seen that the online estimated frequency response is in a satisfactory agreement with the reference systems.Especially when noise-free case is considered, the online-estimated results agree well with the reference systems, and only a small difference can be seen in the low-frequency band.For the noisy cases, the identified magnitude and phase responses are in a good correspondence with reference models, and the characteristics of the twomass system are evident.It is pointed out that the noise included in the simulation is chosen so that it over-emphasizes disturbance in the anti-resonance region.Even assuming measurement disturbances, the resonance and anti-resonance frequencies are clearly visible from the online estimated frequency responses.Moreover, when evaluating the tracking properties of the proposed Kalman filter it can be noticed in Figure 3 c) that a good estimation accuracy is obtained as the residual between the excitation signal and estimation is low.In the noise-free case in Figure 3 d)-e),  The duration of the sweep and the selection of the Kalman gain is directly related to the tradeoff of the filter tracking and error properties.It is evident that the duration of the identification experiment related to the selection of the Kalman filter tuning parameter has an influence to the accuracy of the frequency response estimation.In Figure 4 the directly identified frequency responses are shown in the case of reference system A when the Kalman filter tuning parameter λ, the excitation signal amplitude A and duration T of the identification experiment (length of sweep) is var-ied.Figure 4 clearly shows that the accuracy of the estimated frequency response depends on the length of sweep chosen for the excitation signal, and obviously, the excitation signal amplitude should be chosen be as large as possible in order to achieve a good signal-tonoise ratio.Especially, it can be noticed in Figure 4 that when the sweep is fast, T = 5s, the identified responses deviates from the reference system even though the tuning parameter is varied.Moreover, this shows the the main disadvantage of the proposed identification method as a slow sweeping is required for precise measurement in order to reduce errors and obtain accurate results, which prolongs the duration of the experiment.The proposed method for online frequency response estimation is further validated and discussed in the case of experimental results in Section 4.

Loop-transfer Function
When considering classical robustness margins or performance indicators, the controller design usually involves determination of parameters such as modulus M m , gain G m and phase P m margins and cross-over frequency ω c .In practical applications, it is usually desirable to determine the frequencies at which a given closed-loop system achieves a certain magnitude or phase.In particular, methods such as relay-experiment (de Arruda and Barros, 2003) can be regarded as a kind of frequency domain identification for control methods that utilizes only a few points of the frequency response of the loop transfer function to design, for instance, PID controllers.Similarly, the desired open-loop dynamics can be online shaped by considering for instance an adaptive structure (Balchen and Lie, 1987).The open-loop transfer function G(jω) can be estimated with the proposed method on a sample-bysample basis, which makes it possible to use the proposed method to calculate the loop transfer function in a real-time by using the known controller C(jω) to obtain L(jω).As the online identification method estimates instantaneous non-parametric model frequencyby-frequency, it also allows to determine rough estimates of M m , P m and ω c during the identification experiment by considering different distances in the Nyquist plot.In this paper, the regions inside the unit circle of the Nyquist plot are determined as regions I, II, III and IV.Region I is located in the plane defined by the negative imaginary and real axes, and thus, this region determines the behaviour at low frequencies.
If the sweep starts exciting low frequencies, and thus at first, the critical frequency ω c can be determined by calculating the distance of Nyquist curve to the origin frequency-by-frequency as follows and finding the frequency at which the curve intersects the unit circle, thus |L(jω c )| = 1.After the estimated Nyquist curve has intersected the unit circle and the curve lies in the region I, the modulus and the phase margin can be roughly determined by estimating the distance of the curve to the critical point (-1,0j) by By using the first value of this distance metric, d 2 (ω c ), the phase margin can be obtained as The modulus margin can be estimated by finding the minimum distance of the curve in region I to the critical point, thus M m = min ω |1 + L(jω)|.Moreover, as the system under study is a controlled two-mass system, the estimation routine can be further extended to obtain mechanical parameters in region II, which is located in the plane defined by the negative imaginary and positive real axes.By considering the distance

Ref. system LA(j!)
On-line est.(noise included) L(j!) Figure 5: Frequency-by-frequency online-estimated Nyquist curves compared with the reference curve in the case of noise-free system and when the noise is affecting the system output.Equations ( 25)-( 27) are used to determine controller performance parameters M m , P m and ω c in region I.Moreover, the system parameters ω ares and ω res in region II are determined by calculating the corresponding distances Eqs. ( 25)-( 26).The critical point (-1, j•0) is indicated by a red cross.
metrics Eqs. ( 25)-( 26) the anti-resonance ω ares and resonance ω res frequencies can be determined in region II similarly as the margins.Hence, the anti-resonance frequency can be estimated in region II by finding the minimum distance to the origin d 3 (ω ares ) = min ω |L(jω)| calculating the distance of the curve similarly as in Eq. ( 25).Correspondingly, the resonance frequency can be estimated by finding the maximum distance of the curve to the critical point similarly as in Eq. ( 26).
In the Figure 5 the sample-by-sample onlineestimated Nyquist curve is shown with the distance metrics Eqs. ( 26)-( 25) that are used to calculate controller performance-and system-related parameters in the case of reference system A. The closed-loop controller has been designed so that P m = 63.5 • and f c = 2.7 Hz. Evidently, in the noise-free case the online-identified Nyquist curve is in a good correspondence with the reference loop transfer function, although small discrepancies can be noticed.The behaviour of the low frequencies is similar with the results in the Figure 3, which further shows that the largest estimation error is in the low frequency band, as expected.It is clear that this is partially due to the start of the chirp excitation, which causes a transient that can also be noticed from the Figure 3 at t = 5 s after the initialization.Naturally, the duration of the sweep and the selection of the Kalman gain have an effect on the frequency response estimation.For this purpose, the known limitation of Kalman filter is the tracking and error tradeoff based on the choice of the Kalman filter tuning parameter λ.Thus, choosing a value of the tuning parameter λ for the Kalman filter is a case-specific compromise, similarly as reported in (Kshirsagar et al., 2016).
In this paper, the rough control performance estimates in region I are only considered for illustrative purposes and to further demonstrate the possibilities of the identification method.It can be seen that the online estimated controller-behaviour-related parameters are close to the actual ones; nevertheless, it is pointed out that especially an erroneous estimate of the crosspoint f c directly influences to the estimate of P m as can be noticed in the noisy case.It is clear that the emphasized estimation error in the low-frequency region influences these estimates.When considering the distances in region II, the estimated system parameters f ares and f res correspond well with the ones of reference model A illustrated in Table 1 in the case of both simulations.The estimation of these values are further discussed in Section 4.
For actual performance monitoring purposes, it could be more preferable to use a separate soft controller to perform the identification experiments in order to analyse the desired controller performance in region I.In practice, the proposed online distance metrics can be used for diagnostics purposes for instance by considering a predetermined safety limits in region I.Moreover, the loop-transfer function could be estimated directly from the closed-loop experiment (Barkley and Santi, 2009), (Bhardwaj et al., 2016).These issues will be considered in the future research, and thus not further discussed in this work, where the main focus is to analyse and validate the feasibility of the proposed method for frequency response estimation.
programmable logic controller (PLC) is used for data acquisition and to implement the excitation signals, PI controller, and references.It is pointed out that now the experimental system includes a belt-tensioner, which, in practice, changes the system dynamics over to a three-mass-system.However, in this paper, the frequency region around the dominant resonance frequency is considered in the online identification, which usually sufficiently reflects dominant behaviour of the real system.The tests are performed so that the same PI-controller parameters are considered as in the simulations, and also the chirp excitation signal is kept same, thus swept from 35 Hz to 1.5 Hz during s 17 s interval.In addition, to further verify the online identification method, the system dynamics of the experimental test setup is varied by changing the belt material and the inertia ratio of the system from 1 to 0.56.The results in Figure 8 have been obtained by using an experimentally chosen Kalman filter tuning parameter λ = 8.
Moreover, in order to validate the rough online estimates of the anti-resonance f ares and resonance f res the experimental system is offline identified by considering the open-loop identification method proposed in (Villwock and Pacas, 2008).A PRBS is used to excite the system, and the experimental frequency response estimate G e (jω) is obtained by Welch method.Then, the calculation of the mechanical parameters of the analytical frequency response function G model (jω) of the reference two-mass system is accomplished on the basis of the M frequency response data points, and the best fit is iteratively searched by minimizing the error function where G e (jω i ) are the experimental frequency response data and G model (jω i , ϑ) is the analytical model function with the parameter vector ϑ = [J 1 , J 2 , K, D].In the parameter estimation, the reference model pa- rameters of Table 1 are used in the initialization, thus in the first iteration.
The offline identification experiments are carried out so that the PRBS is generated by a seventeen-cell shift register with values 2.1 Nm and -2.1 Nm (the rated torque being 11.55 Nm).The sampling of the data acquisition is set to 2 ms.In Figure 7, the onlineestimated frequency responses are compared with the offline post-processed ones for both system configurations: a) reference system A and b) reference system B, respectively.Moreover, the offline post-processed frequency responses are compared to the ones calculated by using the identified parameters Eq. ( 28).
The characteristics of the three-mass-system are clearly visible in the offline frequency responses, and when the mechanical configuration is changed over from reference system A to B, the change of the first resonance is evident.This change can also be seen in the online-estimated frequency response results.The obtained results clearly show a similar behaviour, and the dynamics of two-mass system are seen in the onlineestimated amplitude and phase responses in the selected band of frequencies.Again, it is worth remarking that the offline post-processed frequency response is estimated applying the whole data of the identification experiment using the PRBS excitation signal, and correspondingly, the online ones are obtained on a sample-by-sample basis from the swept excitation; and thus, these results are not directly comparable.Nevertheless, the offline-and online estimated frequency responses are in a good agreement, which clearly indicates that the proposed identification method yields accurate results.
With the results of the parameter-fitting for the corresponding mechanical parameters, the resonance and the anti-resonance frequencies of the two-mass system approximation can be calculated.In Table 2, the estimated mechanical parameters for the both experimental system configurations are shown.The system change can also be seen in the estimated parameters, and especially, the effect of the change in the inertia ratio as the resonance and anti-resonance of the system changes.It should be noted that a two-mass-system parameter-fitting is considered for the offline identified frequency responses that have three-mass system characteristics, and thus, the mechanical parameter estimation results cannot be directly compared to the initial assumption of the system dynamics.However, the offline-estimated resonances fres and anti-resonances fares are used as benchmark values to validate online estimated ones.
In Figure 8, the frequency-by-frequency onlineestimated Nyquist curves are compared with the offline post-processed ones, and the proposed online distance metrics are used to calculate the controller performance and system parameters.Evidently, the offline-and online-identified Nyquist curves are in a good correspondence although small discrepancies can be noticed.Moreover, the system change can be clearly noticed as the size of the resonance loop changes.It should be noted, that the distance metrics in region I are problematic as the largest estimation error is expected in the low frequency region, and the estimated values can be only used as rough estimates of the controller performance during the identification experiment.Again, it is pointed out that these values are considered for illustrative purposes only in order to further demonstrate the prospects of the proposed identification method.
When focusing on the online-estimated resonance and anti-resonance values in Figure 8, it can be noticed that these values are close to the offline-estimated ones shown in Table 2, thus indicating that instantaneous estimates give reasonable results.
In Figure 8 it is clear that, the duration of the sweep and the selection of the Kalman gain has an effect on the frequency response estimation.In order to further validate the online-estimated results, the experimental system configuration B is identified using three different experimental data sets, and the proposed distance metrics are tested by varying the Kalman filter tuning parameter.In Figure 9, the estimated values obtained from the identification experiments are shown as a function α.It can be seen that similar values of f res and f ares can be estimated by using different values in the Kalman filter gain.Obviously, this result also depends on the amplitude chosen for the excitation signal, which is related to the signal-to-noise ratio, but it clearly shows instantaneous values can be used to obtain reasonable estimates.This can be also noticed from the minimum distance estimation to critical point.Thus, these results indicate that the proposed online identification method can be used for diagnostics purposes for instance by considering different fault classifiers and/or combination rules.Moreover, the results show the problem of the low-frequency region identification as a larger deviation in the estimated P m and f c parameters can be noticed.These values do not explic-  itly describe controller-performance-related behaviour.However, as shown in (Ferretti et al., 2003), a rough estimate of f c can be obtained similarly during the commissioning state of a PID-controlled two-mass system by using a chirp excitation signal, and successfully used for controller design validation.

Supporting results and discussion
The main objective of this paper is to propose a nonparametric online frequency response estimation method that is suitable for tracking of a selected band of frequencies, with a specific objective to identify a predefined frequency band around the first resonance frequency of the system.Figure 7 shows that the offline-identified frequency response clearly indicates a three-mass system dynamics.
To further validate this observation, in Figure 10, the experimental system configuration A is also identified with a chirp excitation signal, which is swept from 100 Hz to 1.5 Hz (during 17 s) and compared with the results shown in Figure 7 a).When the frequency band of the chirp excitation signal is extended, the dynamics of three-mass system is clearly noticeable in the online-estimated frequency response.This result further indicates the feasibility of the proposed identification approach, but also shows that the Kalman filter tuning parameter should be preferably chosen differently for different frequency regions.This issue is also considered in the future research.(Heath, 2001), and thus, can be applied accordingly to determine the openloop frequency response from closed-loop experiments.Furthermore, in the case of indirect identification, the proposed method gives more design freedom in the parametrization of Kalman filter as the excitation signal used in the identification is known in advance.
In this paper, the experimental results clearly validate the proposed methodology and effectiveness of using online Kalman filters for frequency response analysis.The known limitation of the Kalman filter is its convergence time and tracking tradeoff with respect on the choice of tuning parameters.This limitation requires the frequency sweep to be slow.However, usually in the case of chirp-excitation-based identification, the duration of the sweep must be designed long in order to reduce errors and obtain accurate results ( Östring et al., 2001).A second drawback can be found when considering identification of systems with nonlinear dynamics.The chirp signal can have a dis- turbing effect, because a number of other spectral lines are also excited with the frequency lines of interest.Despite these limitations, the chirp-excitation-based offline identification is widely applied for instance to the identification of the flexibilities of nonlinear industrial robot manipulators ( Östring et al., 2003), (Saupe and Knoblach, 2015).

Conclusions
This paper presented an online non-parametric approach that is based on a time-frequency presentation of signals in order to estimate a frequency response of a closed-loop controlled servomechanism in a computationally efficient manner.The method is based on a fixed-coefficient non-parametric Kalman filter, which is updated with the known frequency of the chirp excitation signal.The results from the simulations and experimental tests show that the approach can be used to achieve reasonable estimates of the frequency responses in real time on a sample-by-sample basis.The online estimated frequency responses during operation were compared with the corresponding frequency responses obtained by off-line identification using the whole data of the identification experiment collected prior to the estimation.The results show acceptable agreement, thus indicating that the proposed method is suitable for the online frequency-domain nonparametric identification of a mechanical system.Moreover, it was experimentally validated that the method is feasible to detect system changes for diagnostics purposes.
As the deterioration of mechanical parts over time or other unexpected changes in the system dynam-ics may lead to the degradation of the control performance or cause unexpected interruptions, it is important to detect the system changes as proactive maintenance before they lead to performance degradation.The future work will focus on the performance assessment and diagnostics opportunities of the identification method and the option to diagnose mechanical faults e.g.changes in the resonances resulting from deterioration.

Figure 3 :
Figure 3: Online directly estimated open loop frequency responses for reference systems A and B a) in the case of a noise-free system and b) when noise is affecting the system output.The tracking properties of the Kalman filter are evaluated with residuals of the signals used in the identification: c) Residual of the excitation signal and estimation.d) Residual of the input signal and estimation.e) Residual of the output signal and estimation.f) Frequency contents of the excitation signal

Figure 4 :
Figure 4: Online identified open loop frequency responses when the Kalman filter tuning parameter λ and amplitude A of the excitation signal and duration T of the identification experiment is varied.The red solid line represents the reference system A.

Figure 6 :
Figure 6: Electromechanical system used for experimental verification.

Figure 8 :
Figure 7: Online-estimated frequency responses Eqs.(20)-(21) compared with the offline post-processed frequency response Eq.(1) by using signals u(k) and y(k) in the identification.a) Experimental system configuration correspond to reference system A and b) reference system B, respectively.

Figure 9 :
Figure 9: Estimated system and performance parameters as a function of the Kalman filter tuning parameter α (r = 1).Data sets 1-2 include chirp with f 0 = 35 Hz to f 0 = 1.5 Hz and a data set 3 f 0 = 50 Hz to f 0 = 1.5 Hz during 17 s.
Figure 10: Online-estimated frequency responses compared with the offline post-processed frequency response.The Kalman filter tuning parameter is set λ = 8.

Figure 11 :
Figure11: Indirectly estimated online frequency response compared to the offline postprocessed frequency response Eq.(6) by using the signals r u (k) and y(k) and known controller G(z) in the identification.The directly online-estimated frequency response is also shown.

Table 1 :
Parameters of reference systems

Table 2 :
Offline-estimated parameters for different system configurations