Adaptive Notch Filter in a Two-Link Flexible Manipulator for the Compensation of Vibration and Gravity-Induced Distortion

: This paper presents a 2-link, 2-DOF ﬂexible manipulator control using an inverse feedfor-ward controller and an adaptive notch ﬁlter with a direct strain feedback controller. In the ﬂexible manipulator, transient and residue vibrations inhibit the full potential of the manipulator. Vibrations caused by abrupt changes in the direction of the links are referred to as transient vibrations, whereas residual vibrations occur when the arm takes too long to settle after engaging in the intended task. The feedforward adaptive notch ﬁlter will reduce transient vibration caused by the manipulator arm beginning and halting suddenly, while the strain feedback will assure the quick decay of leftover vibrations. Maple, Maplesim, and MATLAB tools were used to model the manipulator and create the inverse controller and adaptive notch ﬁlter. The experiments took place in the dSPACE control desk environment. The experimental results of the spectral power of strain resulting from the two strategies are compared. From the results, the adaptive notch ﬁlter control had over an 80% improvement in the reduction in resonant frequencies that contribute to vibration. The results conﬁrmed the feasibility of the approach, characterized by very minimal transient vibrations and a quick settling of the end effector.


Introduction
Robots have gained popularity in the 21st century as a means of supplementing and improving quality of life. To date, robots are applied in at least all aspects of human life ranging from space and marine exploration, industrial process automation, transportation, health and wellness, and agriculture, amongst others. Based on the locomotion structure, robots can be broadly categorized as mobile robots (wheeled/legged robots, humanoids, etc.), armed/manipulator robots (robot arm, gantry, etc.), flying robots (remote/autonomous aerial vehicles), underwater robots, or a hybridization generated by combining these areas [1][2][3][4][5]. Each of the categories has constraints and design considerations that are unique to the application. In this paper, we focus on robot arms and review the challenges associated with them.
In a robot arm, one of the design considerations is the tip position tracking. Increasing the structural rigidity will yield a better tracking of the tip position. On the other hand, this will inevitably increase the weight and required materials which leads to increased energy usage during operations and costs. Furthermore, the rigidity and bulkiness of the robot arm bottlenecks the operational speeds of the robot [1,6]. In summary, energy consumption, material and design costs, operation speed, and control schemes, amongst others, are some of the researched themes in robots.
In the paper, to verify the performance in a variable tip load, we propose using an adaptive notch filter for vibration suppression. To speed up and stabilize the filter in the convergence process, we design an adaptive notch filter based on the simplified lattice algorithm (SLA) as well as the removal of stationary distortion due to the self-weight of the links. We compare the vibration suppression performance of feedforward (FF) control using an adaptive notch filter and DSFB control in a 2-link, 2-DOF flexible arm to verify the effectiveness of suppression. The proposed scheme performed better than the conventional (DSFB) scheme. The improvement was attributed to the adaptation and the self-weight error correction algorithm. The proposed controller was shown to be effective for vibration control and trajectory tracking in situations with variable loads.
The remainder of the paper is laid out as follows. Section 2 introduces the 2-link, 2-DOF flexible manipulator, experiment setup, and adaptive filter design. Section 3 presents and discusses the findings, followed by a conclusion in Section 4. Figure 1a shows the physical manipulator in use with two links and three degrees of freedom that may be manipulated. The entire connection of boards and signaling is illustrated in Figure 1b. A dSPACE 1103 controller (signal processing) board was used to perform analog-to-digital conversion (ADC) and digital-to-analog conversion (DAC) to support device driving and communication. The motors were driven by a DC motor servo driver which was connected to a dSPACE signal processing board. The motors were equipped with an optical encoder with an output of 1000 pulses/rev. The optical encoders fed back the angles to the servo drive amplifier and into the dSPACE board. Harmonic drives were used to lower the speed of the joints by a factor of 100. Joint 1 rotated perpendicular to the ground (twisting), while joints 2 and 3 rotated in a bending direction. The overall specifications of the model are shown in Table 1.  Cast iron cylinders were mounted on the opposite ends of the motor connected to joint 2 and 3. This was carried out to counterbalance motion effects. A weight of 100 g was attached at the tip of the second link of the manipulator which made the link easily deformed during operation. In this case, the joints were considered to be rigid while the links were flexible. Strain gauges were installed at the root of each connection for feedback. The measurement of strain was performed by converting the output strain into electrical resistance and conditioning the output using a bridge circuit before amplification. The amplifiers in use were DPM713B and DPM913B strain amplifiers from Kyowa Electric Co. Ltd. The amplified signal was sampled at 0.02 s and digitized with an ADC by the dSPACE™ DSP board for further processing as shown in Figure 1b.

Physical Model Experiment
In the operations of the manipulator for validation and system identification, an actual robot operation was performed, and the data were logged for further analysis. In this case, the manipulator started with a vertical posture at t = 0. A 20 s rectangular pulse input was applied to move the manipulator's tip. During the first 10 s, joints 1, 2, and 3 were fed with the desired angle of 20 degrees which moved link 1 and link 2 with 20 degrees, respectively. Link 1 had rotatory motion perpendicular to the ground, so the tip position was unaffected. The latter half was supplied with 0 degrees which restored the manipulator to the original position. The manipulator inputs were as shown in Figure 2. For the purposes of comparison, the input pattern shown was maintained.

Linear and Nonlinear Model
One of the prerequisites for controller design is the knowledge of the plant. Thus, the accurate modelling of the plant is indispensable. Mathematical modelling involving the application of Lagrangian or the Euler-Newtonian formulation has been proposed [22,23]. These methods are tedious and prone to errors with a growing number of links and joints. An alternative is the use of system identification and symbolic modelling.
Symbolic modelling involves the use of computer applications to model the plant. A mathematical representation of the plant is acquired as state space or in differential algebraic equations. In the research, we utilized Maplesim to simulate the actual plant presented in Figure 1. Figure 3 shows the virtual model developed in the Maplesim environment. This involves assembling various blocks and components that best fit the actual manipulator, i.e., flexible beams, joints, rigid bodies, actuators, and motors, amongst others. The physical parameters of these blocks are iteratively changed until there is an agreement between the simulation and the physical model. where ij denotes the armature current to the servomotor driving joint (j = 1,2,3) and θj and j are the angle and velocity of joint (j = 1,2,3), respectively, whereas (w11; w12) and (w21; w22) and their time derivatives ( 11; 12) and ( 21; 22) denote the flexure variable for links 1 and 2, respectively. In the system identification, the objective was to formulate the state space model of the manipulator via experimentation. We used MATLAB's System Identification Toolbox to perform system identification using the canonical variate analysis approach with the input and output data generated by the experiment. The input was the displacement of every joint as recorded by the encoder module while the output was the tip trajectory as Maplesim software is good at modeling but not at the analysis and synthesis of the controller. For this reason, after successfully running the model in Maplesim, the Matlab/Simulink block was extracted and exported to Matlab. The extraction of the model involves Maplesim's inbuilt function generator. In the paper, the resulting model had states as in Table 2 below:   . w 22 ) denote the flexure variable for links 1 and 2, respectively.
In the system identification, the objective was to formulate the state space model of the manipulator via experimentation. We used MATLAB's System Identification Toolbox to perform system identification using the canonical variate analysis approach with the input and output data generated by the experiment. The input was the displacement of every joint as recorded by the encoder module while the output was the tip trajectory as recorded by the OptiTrack camera system. The state space model was employed since the system contained many inputs and outputs. In this case, the number of states was chosen as ten. The equation of the state of the identification system is represented by Equation (1) as the direct transfer term D was set to 0.
x, y, and u are given as: The x, y, and z coordinates of the tip trajectory are shown by y 1 , y 2 , y 3 which indicate the x, y, z, and the displacements of the input angles to joint 1, joint 2, and joint 3 are indicated by u 1 , u 2 , u 3 , respectively. To obtain Equation (2), we first differentiated the lower expression of Equation (1). Equation (3) was thereby obtained by substituting (1) into (2). . .
We introduced the relative degree n of the output matrix C, where CA l B = 0, ∀l < r − 1, and differentiated Equation (3) repeatedly for r times. Assuming that CA r B = 0, we obtained The further transformation of (4) was performed to obtain (5) which is the input vector u.
In addition, from (5) From these, the inverse state space system can be expressed as follows.
.x =Âx +By (r) u =Ĉ xˆ+Dy (r) (8) where: andx is the state variable, u is the output variable, and y (r) is the input variable of the inverse state space model depicted in Figure 4 below.
We introduced the relative degree n of the output matrix C, where CA l B = 0, ∀ 1, and differentiated Equation (3) repeatedly for r times. Assuming that CA B 0, we ob- The further transformation of (4) was performed to obtain (5) which is the input vector u.
Substituting (5) into (1), we obtained = + = + In addition, from (5) = + From these, the inverse state space system can be expressed as follows. where: and is the state variable, u is the output variable, and is the input variable of the inverse state space model depicted in Figure 4 below. The theory of passivity control of a multilink flexible manipulator was developed by Shimizu and M. Sasaki [24]. The strain detected at the flexible link's root is multiplied by a constant gain k in this control method, and the resulting signal is utilized to change the control law as shown in Figure 7. The authors in [25] showed that the approach may The theory of passivity control of a multilink flexible manipulator was developed by Shimizu and M. Sasaki [24]. The strain detected at the flexible link's root is multiplied by a constant gain k in this control method, and the resulting signal is utilized to change the control law as shown in Figure 7. The authors in [25] showed that the approach may dampen link vibrations to a satisfactory degree. They further proved that the resultant closed loop is asymptotically stable using an analytical approach.
The identified model and the nonlinear model derived through Maplesim were utilized to validate the agreement of the modeling with the experiment data. The validation results are presented in Figures 4 and 5 below. Figure 5a-c shows the validation of the joint angles while Figure 6a-c shows the validation of the strain information in the nonlinear, linearized model as well as the actual experiment results. From these, we note the agreement of the data and can, thus, deduce that the linear model captures the dynamics of the actual manipulator accurately.   We utilized the linear model to develop the inverse model in Matlab. Inverse control systems are very popular in diverse fields, especially for system analysis; [1,2] are examples of articles on inversion-based system analysis in railway monitoring. From a literature review, inversion can be broadly categorized as right and left inverse [15]. The left inverse is where the plant is connected in series with the inverse at the output stage, while the right inversion is connected such that the inverse model provides the necessary input to the plant. The left inversion seeks to reproduce the input to the plant and is popular in fault detection, while right inverse reproduces the necessary input to the plant for the We utilized the linear model to develop the inverse model in Matlab. Inverse control systems are very popular in diverse fields, especially for system analysis; [1,2] are examples of articles on inversion-based system analysis in railway monitoring. From a literature review, inversion can be broadly categorized as right and left inverse [15]. The left inverse is where the plant is connected in series with the inverse at the output stage, while the right inversion is connected such that the inverse model provides the necessary input to the plant. The left inversion seeks to reproduce the input to the plant and is popular in fault detection, while right inverse reproduces the necessary input to the plant for the desired plant output. To this end, this paper utilized the right inversion model as a feedforward control scheme. The derivation and further details of the inversion can be found in our previous research in [26,27].
Vibration 2023, 6 295 The inverse system was configured as shown in Figure 7. In the figure, the intended joint angles are sent into the inverse feedforward controller, whose output is fed to the plant to recreate the correct angle. This might result in extremely high and unsafe operational speeds. To avoid this, low-pass filters are used to feed appropriate angles into the inverse feedforward controller. Vibrations are reduced even more by monitoring link vibrations and transmitting them back as shown.
Vibration 2023, 6, FOR PEER REVIEW 10 desired plant output. To this end, this paper utilized the right inversion model as a feedforward control scheme. The derivation and further details of the inversion can be found in our previous research in [26,27].
The inverse system was configured as shown in Figure 7. In the figure, the intended joint angles are sent into the inverse feedforward controller, whose output is fed to the plant to recreate the correct angle. This might result in extremely high and unsafe operational speeds. To avoid this, low-pass filters are used to feed appropriate angles into the inverse feedforward controller. Vibrations are reduced even more by monitoring link vibrations and transmitting them back as shown. Furthermore, as the objective of this study was a reduction in vibration, we designed filters to adapt the controller in real time. Adaptive notch filters are used in applications that automatically detect and remove unknown sine waves superimposed on broadband signals. In this paper, this wide-band signal was regarded as steady distortion, and an unknown sine wave was regarded as a vibration component; the signal from which the vibration component was removed was subtracted from the original signal to realize the steady-state distortion removal. For stability and speed, in this paper, we opted to utilize the simplified lattice algorithm (SLA) as described below.
In the SLA, better convergence than the gradient approach may be accomplished by implementing an adaptive notch filter with a normalized grid type and employing the structure's state variables in an adaptive algorithm. Furthermore, the filter stability is always ensured since the peak gain is normalized.
The setup for the notch filter controller model showing the design of a second-order IIR adaptive notch filter based on the SLA proposed by P.A. Regalia, discussed in [28], is shown in Figure 8. The output of the filter is described by the relation below.

=
1 + 2 1 + 2sinθ n z + z 1 + sinθ n 1 + sinθ z + sinθ z (13) From Equation (13) above, and determine the notch frequency and notch bandwidth, respectively. In this case, are the notch and sampling frequency, respectively, and B is the notch width. From the above, we can express as Equations (10) and (11) below. Note that 0 < B < π/2. Furthermore, as the objective of this study was a reduction in vibration, we designed filters to adapt the controller in real time. Adaptive notch filters are used in applications that automatically detect and remove unknown sine waves superimposed on broadband signals. In this paper, this wide-band signal was regarded as steady distortion, and an unknown sine wave was regarded as a vibration component; the signal from which the vibration component was removed was subtracted from the original signal to realize the steady-state distortion removal. For stability and speed, in this paper, we opted to utilize the simplified lattice algorithm (SLA) as described below.
In the SLA, better convergence than the gradient approach may be accomplished by implementing an adaptive notch filter with a normalized grid type and employing the structure's state variables in an adaptive algorithm. Furthermore, the filter stability is always ensured since the peak gain is normalized.
The setup for the notch filter controller model showing the design of a second-order IIR adaptive notch filter based on the SLA proposed by P.A. Regalia, discussed in [28], is shown in Figure 8. The output of the filter is described by the relation below.
From Equation (13) above, θ 1 and θ 2 determine the notch frequency and notch bandwidth, respectively. In this case, f N and f s are the notch and sampling frequency, respectively, and B is the notch width. From the above, we can express θ as Equations (10) and (11) below. Note that 0 < B < π/2.
Equation (14) represents the bandwidth of the system, and as such, smaller values of B will have a corresponding narrow notch width. In this work, a constant B of 0.1 was adopted.
From Equation (11) above, the SLA updates coefficients to determine the unknown frequency (notch frequency, f N ) using Equation (12) as follows.
where µ(n) is the adaptation step size, u 1 (n) is the state variable of the filter, and e(n) is the output error. The filtered regressor signal is given by Equation (13) as follows.
From Equation (11) above, the SLA updates coefficients to determine the unknown frequency (notch frequency, fN) using Equation (12) as follows.
where μ(n) is the adaptation step size, u1(n) is the state variable of the filter, and e(n) is the output error. The filtered regressor signal is given by Equation (13) as follows.
= z cosθ cosθ 1 + sinθ n 1 + sinθ z + sinθ z From Equation (12), if the bandwidth is held constant, and the gradient / is not a recursive minimization of the output error but it is a globally stable unbiased parameter identifier in the case of single or multiple sinusoids when the bandwidth is narrow.
is defined in Equation (14) where is the "forgetting factor" and k is the step size in consideration. The values of and are determined by trial and error, and for experiments in this paper, both were taken to be equal to 1.0. From Equation (12), if the bandwidth is held constant, and the gradient ∂E e 2 (n) /∂θ 1 is not a recursive minimization of the output error but it is a globally stable unbiased parameter identifier in the case of single or multiple sinusoids when the bandwidth is narrow. µ(n) is defined in Equation (14) where λ is the "forgetting factor" and k is the step size in consideration. The values of µ 0 and λ are determined by trial and error, and for experiments in this paper, both were taken to be equal to 1.0.
The vibration's resonance frequency, which is taken to be the notch frequency f N above, is determined from strain data. Thus, the input to the notch filter e(n) is the strain feedback data resulting from manipulator movement. We designed the system shown in Figure 9 in Simulink to perform adaptive filtering with the Maplesim-generated model as the plant.
The vibration's resonance frequency, which is taken to be the notch frequency fN above, is determined from strain data. Thus, the input to the notch filter e(n) is the strain feedback data resulting from manipulator movement. We designed the system shown in Figure 9 in Simulink to perform adaptive filtering with the Maplesim-generated model as the plant. The input strain is passed through the two stages of the adaptive notch filter for the FF controller and steady-state distortion correction, labeled as 1 and 2 in Figure 9. The developed notch-filtering model was exported to the dSPACE workspace to compare with the inverse model in Section 2.1 through experimentation.

Verification of Control Using the Designed Controller
The two designed systems were exported to the actual manipulator for the verification of performance. The model obtained from the system identification and inversion in Section 2.1, herein referred to as the inverse model, and the Maplesim-simulated model, the notch filter, were exported from Simulink to the dSPACE DSP board as the controllers. The joint angle control law similar to Figure 2 was adopted. Data were recorded for both cases in dSPACE and exported to Matlab to compare the controllers. The results are described in Section 3.

Experimental Results and Discussion
The experiments presented in this paper involved moving the three joints to +20°, such that the manipulator swept about a 3D space for 10 s and returned the manipulator to its initial vertical posture for 10 more seconds. Figure 10 shows the joint angles for joints 1, 2, and 3. The input strain is passed through the two stages of the adaptive notch filter for the FF controller and steady-state distortion correction, labeled as 1 and 2 in Figure 9. The developed notch-filtering model was exported to the dSPACE workspace to compare with the inverse model in Section 2.1 through experimentation.

Verification of Control Using the Designed Controller
The two designed systems were exported to the actual manipulator for the verification of performance. The model obtained from the system identification and inversion in Section 2.1, herein referred to as the inverse model, and the Maplesim-simulated model, the notch filter, were exported from Simulink to the dSPACE DSP board as the controllers. The joint angle control law similar to Figure 2 was adopted. Data were recorded for both cases in dSPACE and exported to Matlab to compare the controllers. The results are described in Section 3.

Experimental Results and Discussion
The experiments presented in this paper involved moving the three joints to +20 • , such that the manipulator swept about a 3D space for 10 s and returned the manipulator to its initial vertical posture for 10 more seconds. Figure 10 shows the joint angles for joints 1, 2, and 3.
From the figure, it can be seen that the joints' angles traced similar trajectories for both the filtered inverse controller and the notch filter feedforward controller in terms of the rise time and steady-state response. Figure 10 shows the link strain for torsion for link 1 and link 2. From the strain data, vibration suppression can be confirmed in both methods. Particularly, the notch filter control was able to suppress the vibration of the first movement within 2 s which was similar to the inverse system. In the second movement at 10 s, the performance of the notch filter was confirmed with the inverse system reporting residual vibration up to 20 s. Vibration 2023, 6, FOR PEER REVIEW 13 From the figure, it can be seen that the joints' angles traced similar trajectories for both the filtered inverse controller and the notch filter feedforward controller in terms of the rise time and steady-state response. Figure 10 shows the link strain for torsion for link 1 and link 2. From the strain data, vibration suppression can be confirmed in both methods. Particularly, the notch filter control was able to suppress the vibration of the first movement within 2 s which was similar to the inverse system. In the second movement at 10 s, the performance of the notch filter was confirmed with the inverse system reporting residual vibration up to 20 s.

Angle (degree)
Angle (degree) Angle (degree) From the figure, it can be seen that the performance of the notch filter feedforward controller was superior to that of the filtered inverse controller in terms of amplitudes and the settling time. This was due to the adaptive nature of the notch filter employed in this work relative to the fixed nature of the filtered inverse controller. For torsion, severe strain can be seen in the period from 10 to 20 s. This was due to the coupling of torsional strain from link 2 to link 1 while the manipulator was in its vertical posture. Figure 11 shows the comparison of link vibration spectral densities between the filtered inverse controller and the adaptive notch filter controller. The blue line shows the results of the two-degrees-of-freedom control system with a filtered inverse controller, whereas Vibration 2023, 6 299 the red line shows the results of the control system with an adaptive notch filter. The notch filter control cut the resonant frequency components by over 80% as compared to the inverse controller. From Figure 12, it can be seen that the adaptive notch filter controller had superior performance to the filtered inverse controller. The superiority of the adaptive filter stems from its ability to adapt to the vibration frequencies and act accordingly to attenuate these frequencies from being fed back to the manipulator. On the other hand, the effectiveness of the fixed filtered inverse controller in removing residual vibration frequencies from the control law was poor. There still remained 3 Hz residue vibrations in the inverse controlled system. The individual controllers dampened different frequency ranges, with the hybrid performing better than the individual controllers.

Conclusions
This paper presented a comparative study of two types of two-degrees-of-freedom controller comprising a filtered inverse controller and an adaptive notch controller in the feedforward path, both augmented with a direct strain feedback controller. From the results of the link strain in the torsional and transverse senses, the performance of the twodegrees-of-freedom controller comprising of the adaptive notch controller and direct strain feedback controller was superior to the controller involving the filtered inverse control. This is attributed to the fact that with the adaptive notch filter, it was possible to adaptively filter out link vibration in the control law, a feature that was missing in the filtered inverse controller with two degrees of freedom. From the results of the FFT spectrum of strain, the proposed control had an improvement of over 80% in reducing the strain power of the resonant frequency.
In addition, it can be seen that although the two-degrees-of-freedom controller involved feedforward controllers, the joint angles settled to the desired joint angles for both controllers. Further research will be conducted to verify the performance of the system in varying loads and speeds.

Data Availability Statement:
No new data were created or analyzed in this study. Data sharing is not applicable to this article.