Fault Diagnosis for a Class of Robotic Systems with Application to 2-DOF Helicopter

: This paper considers a general approach to fault diagnosis using a generalized Hamiltonian system representation. It can be considered that, in general, nonlinear systems still represent a problem in fault diagnosis because there are results only for a speciﬁc class of them. Therefore, fault diagnosis remains a challenging research area despite the maturity of some of the available results. In this work, a type of nonlinear system that admits a generalized Hamiltonian representation is considered; in practice, there are many systems that have this kind of representation. Thereupon, an approach for fault detection and isolation based on the Hamiltonian representation is proposed. First, following the classic approach, the original system is decoupled in different subsystems so that each subsystem is sensitive to one particular fault. Then, taking advantage of the structure, a simple way to design the residuals is presented. Finally, the proposed scheme is validated at the two-degree of freedom (DOF) helicopter of Quanser R (cid:13) , where the presence of faults in sensors and actuators were considered. The results show the efﬁcacy of the proposed scheme.


Introduction
Most dynamic systems, such as industrial processes, need to operate in a continuous and safe manner; therefore, effective fault diagnosis is key to ensuring that happens. Some of the objectives of fault diagnosis are to detect, identify and localize faults as soon as possible in order to have time to take possible corrective actions. Fault diagnosis has been an area of great interest regarding dynamic systems research. However, despite the maturity of some of the available results reported in the literature, see for example in ref. [1], fault diagnosis remains a challenging research area. The main achievements of fault diagnosis available in the literature are regarding linear systems, for which a complete analysis of fault isolability is available. Simultaneous fault occurrence has also been considered. For nonlinear systems there are also some tools, like the structural analysis, within a fault isolability structural analysis is possible. Some of these challenges are the search of a general approach for nonlinear systems, isolation of faults occurring simultaneously, as well as the fault isolation of different types of faults (sensor, component and actuator faults).
There are many results reported for linear systems, see for example in refs. [1][2][3][4]. As well as some results reported for a class of non-linear systems, as can be seen in refs. [2,[5][6][7]. Model-based fault diagnosis of nonlinear systems has been revised in refs. [2,5,6]. One of the first approaches working with fault diagnosis of nonlinear systems has been considered in ref. [8], where an algebraic decoupling approach was proposed. In ref. [7] a geometric approach is proposed and existence conditions for fault decoupling were given; however, the problem of residual generation was actually not completely solved. A soft computing-based approach has been revised in ref. [9]. Soft computing algorithms offer numerically reliable solutions for the fault diagnosis problem of nonlinear systems. However, these approaches does not take advantage of the system structure when the model is known. Fault estimation in non-linear systems has been proposed in refs. [10][11][12] using a sliding mode approach; nevertheless, it is required that a matching condition is satisfied. Another work is in ref. [13], where a way to fault estimation in a class of nonlinear systems by using a sliding observer approach was proposed.
Other papers, such as [14], use different techniques to detect faults in insulators of high voltage transmission lines through the use of drones to take aerial images, which are analyzed using image processing. Detection, classification, and location of faults in electrical power transmission systems are presented in [15]. To do this, the authors use methods based on artificial intelligence. Application of fault detection techniques to hydraulic systems and manipulator robots are presented in [16,17], respectively. In [18] provides a fault detection method and a fault tolerance control mechanism for a quadrotor to achieve a safe flight even when a single rotor is damaged. This method is also based on observers; however, they do not present experimental results, unlike our work. Other results that only consider the control problem for robotic systems such as those presented in this paper, without considering fault detection, are presented in [19,20]. In general, any control algorithm that guarantees the stabilization of the closed-loop system can be used. In this particular paper, a PD controller is used.
A more classical approach for sensor fault diagnosis using Kalman filtering has been considered in ref. [21]. In ref. [22], actuator fault diagnosis was considered by using a nonlinear adaptive observer. It is worth to note that even when the two methods used in fault diagnosis of sensors and actuators rendered good results, they are purpose-specific. A recent result that takes advantage of knowing the system's structure has been proposed in refs. [23,24], where a Hamiltonian representation is used for fault isolation in a planar vertical take-off and landing (PVTOL) of an aircraft model. This work considers a general approach to fault diagnosis using a generalized Hamiltonian system representation. Sensor and actuator additive faults are analyzed in a whole frame and then decoupling techniques are used to obtain a set of subsystems, so that each subsystem is sensible only for one fault (or to a specific set of coupled faults). Additionally, an approach to residual design is considered. The proposed approach is applied to a case study: a two-degree of freedom (DOF) helicopter, a laboratory model of the brand Quanser R . The scheme is tested by both simulations and by the implementation of a laboratory facility test. Experimental results confirm the obtained results. There are other methods applied to the problem of fault detection, such as the one presented in [25] where the authors use an observed-based fault-detection schema for Takagi-Sugeno (T-S) fuzzy systems, which consists of approximates a non-linear system by convex combinations of locally linearized systems, using fuzzy rules type "if-then". This method is suitable to be applied in processes represented by non-linear models in general. However, it is important to mention that the purpose of the present paper is to provide a novel methodology for fault detection in mechanical systems, which can be characterized using a generalized Hamiltonian structure, with an application to the case of a 2-DOF Quanser Helicopter. It is worth remarking that, even if the class of generalized Hamiltonian systems seems to be a bit restrictive at first glance, we can realize that most mechanical systems can be rewritten in the generalized Hamiltonian form. Besides, a larger class of dynamic systems with twice continuously differentiable right-hand sides and affine control input can be transformed into generalized Hamiltonian systems for a well-suited design of the generalized Hamiltonian function. Therefore, even if a study of systems that can be transformed into generalized Hamiltonian systems is of great interest, such a study is beyond the present paper's scope. This paper is organized as follows: in the next section, preliminaries such as a review of Hamiltonian system representation and some general concepts on fault diagnosis are discussed. In Section 3 the fault isolation based on the Hamiltonian structure is shown. Actually, this proposal represents a more general result that the one presented by in ref. [23], see also in ref. [24]. In Section 4 the study case is presented by means of a model of a two degree of freedom helicopter with its corresponding Hamiltonian representation. Fault modeling, fault decoupling and residual generation are also discussed in this section. Simulations and experimental results, as well as a discussion of the obtained results compared to different cases, are presented in Section 5. Finally, conclusions are provided in Section 6.

Preliminaries
Some well-known results are revised in this section in order to make the paper as thorough as possible.

Generalized Hamiltonian Systems
Consider a non-linear systemẋ where x ∈ R n is the state vector, u ∈ R p and y ∈ R m are the input and output of the system, respectively. f and h are continuous and smooth vector fields. Some non-linear systems can be represented in Generalized Hamiltonian form, described in refs. [26][27][28], which is given by: where G is a constant matrix, J(x) is an interconnection matrix, associated with a simple bi-linear form, that represents the conservative part of the system, S(x) is a symmetric matrix that is not necessarily sign defined. Both matrices should satisfy, for every x, the following conditions: S(x) = S T (x).
H(x) is a function of real values, smooth and positive definite, and can be understood as the generalized energy, defined as where M is a constant matrix, symmetric and positive definite, ∂H(x)/∂x is the gradient of H(x). Finally, F(x) is a vector field that contains the non linear terms of the system.

Non-Linear Observer for Generalized Hamiltonian Systems
A non-linear observer for the generalized Hamiltonian is considered in refs. [24,27]. Considering the linear mapping of the output y given bẏ where C is a constant matrix of an appropriate dimension. Therefore, an observer for the system (7) and (8) is defined by˙x where K is the observer gain,x the estimated state, η the estimated output, in terms ofx, and ∂H(x)/∂x = Mx is the gradient vector. The error of state estimation is defined as e = x −x, while the estimation error of output is whereF(x,x) = F(x) − F(x), and The design conditions are described in the following theorem, see refs. [24,27]: The state x of the nonlinear system (7) and (8) can be estimated by system (9) and (10) if the pair (C, S) is observable or at least detectable and the matrix where ∂x T M is negative definite. In the above conditions e * = 0 is locally exponentially stable.
Proof. See Appendix A.

Fault Diagnosis
Information redundancy is used to determine if a fault occurs in a system. A form of redundancy is achieved by duplicating and tripling measuring elements, actuators and in some cases, components of a system, which is called physical redundancy. Redundancy can also be analytical, when information on the signals being measured is obtained through the use of models and/or output observers.
Generally, the models of a system are used to estimate the value of the output. The difference between the measurement of the output and the estimate is used to construct a signal that ideally depends only on the fault (in case it is present), this signal is called residual, which is close to zero in case there are no faults present in the system. Alternatively, residual can be also defined using the output estimation error of an output observer, see ref. [29] and Figure 1.
Different methods depend on the different types of models that can be obtained. Sometimes, instead of using the model directly, an observer is used (model plus correction factor for the estimation error). In this case, there is an additional degree of freedom in the selection of the observer's gain that can be used to determine the radius of convergence of the estimation error to zero in the absence of failures. The gain of the observer can be used to discriminate between faults, to emphasize the effect of one residual over the others, as can be seen in ref. [29]. The way in which the gain is selected can, in many cases, allow us not only to achieve detection, but also to isolate faults. Thus, in order to achieve the fault diagnosis, it would only be necessary to identify the fault.
A different situation occurs when the model is not initially available. In this case, there is a wide range of proposals in the literature, as can be seen in ref. [4]. In general, model-free schemes operate in two steps: first, a model or a residual generator is estimated by using input and output data that has no failures; second, once this residual generator (or model) is available, it is used to detect and/or isolate the faults. It should be mentioned that these techniques presuppose a model (of the system) in the form of a difference or differential equation.
Note that even though these last methods emphasize that they do not need a system model (at least initially), they eventually end up inferring the model and implementing it. The latter is, however, transparent to the user.

Fault Isolation Based on Hamiltonian Structure
The main idea of this work is to present a general approach to fault detection and isolation based on a Hamiltonian system representation. The results are based on the observation that only additive actuator and sensor faults are being considered.

Fault Decoupling
Fault decoupling using a nonlinear transformation has been considered in ref. [8], see also in ref. [5]. However, as observed in ref. [30], a class of nonlinear systems can be decoupled from some additive faults using a constant state transformation.
Consider the class of generalized Hamiltonian systems described as in (7) and (8) with the additive actuator and sensor fault representation: where E f is a constant matrix with n rows and as much columns as actuator faults. f s is a vector whose elements represent sensor faults.ȳ represent the system output without faults (which is not available). Consider a decoupling transformation T, which does not requires to be a square matrix (i.e., T ∈ n 1 ×n , with n 1 < n): and T should satisfy TE f i = 0, with E f i the i-th column of E f , in order to obtain a subsystem robust to the actuator fault f ai . Note that becauseȳ is not available but y is, the subsystem will be sensible to sensor faults. Note that the Hamiltonian structure is not necessarily preserved after the decoupling transformation, because of the constant transformation, it is always possible to represent the decoupled subsystem with a Hamiltonian structure.
To make the analysis of fault dependencies easier, we filled a table with information about the designed properties of the residual with respect to fault dependency. If a perturbation is present, it needs to be included in the analysis to find out whether it is possible or not to distinguish not only between the faults but also the perturbation. A residual generator for the decoupled subsystems can be designed using the procedure described in 2.1.1. However, following in ref. [29] it is required an output observer instead of a state observer. Taking advantage of structure preservation after state transformation, a residual generator can be designed following the procedure presented in this Section 2.1.1.

Residual Evaluation
After a residual generator is designed. It should be implemented to obtain the signals, called residuals, that will be used to get the information about the faults. Ideally, the residuals are zero if no faults are present and only different from zero when a fault is present. In practical situations, however, the residual will not be zero because of model uncertainty of small perturbations. In order to avoid false alarms a residual evaluation procedure is included. The idea is to use the obtained signals (residuals) as an argument of a function. for simplicity, a memory-less function is used which make the residual positive. In this paper an absolute value function is utilized. The result of the absolute value is compared to a (fix) threshold. An active residual is declared only when the resulting absolute value of the residual is bigger than the threshold. Otherwise the residual is declared as non-active. The analysis of active/non-active residuals brings us the information if a fault is present and in the case which one is.
When a perturbation and a fault are acting on the same channel, that is called a coupled, and there is no way to distinguish between them using this method. Thus, to be able to distinguish between a perturbation and a specific fault it is required that first, the decoupling approach presented in Section 3.1 produces two different subsystems and, then to design a residual generator for each of them.

Study Case
An application example is presented in this section. The system is a laboratory device, a two degree of freedom helicopter of Quanser R .

2-Dof Helicopter
Consider the Quanser R 2-DOF helicopter, a testing prototype that is on a fixed pedestal (that does the pivot function) and has two motors, one front for lift and one rear or tail for yaw, Figure 2. The system model can be written in normal way through following nonlinear second order equation, matrix form: where τ is the input vector, g v (q) is the vector of gravitational pairs, D(q) is the inertial matrix, symmetric and positive definite, N(q,q) models the quadratic effects in velocity generated by centrifugal and Coriolis forces. For the Quanser R system, it is convenient to define the generalized coordinate vector q = [φ, ψ] T , where φ and ψ are the pitch and yaw angles. Consider τ = [U p , U y ] T , and

Hamiltonian Representation
Similar to ref. [28], consider the generalized moment p(t), defined by and the Hamiltonian function where U(q) represents the potential energy of system. Thus, the system (17) can be written aṡ where ∂ ∂q U(q) = g v (q). Equations that represent dynamics of system are the following: It is important to mention that the control law τ = [U p , U y ] T used to stabilize the closed loop control system is a PD type controller that was tuned using the method presented in ref. [31]. Table 1 shows the description of the parameters used in the previous equations. Parameter Description Pitch angular velocity x 4 (ψ) Yaw angular velocity U p Pitch control input Uy Yaw control input m 1 Mass of lift motor m 2 Mass of tail motor 1 1 Length m 1 to center of mass 1 2 Length m 2 to center of mass g Gravity Now, considering the generalized Hamiltonian function with M = I 4×4 , starting of (3), results the generalized Hamiltonian functioṅ where,

Fault Modeling
For this system, four possible faults are considered, one for each sensor and one for each actuator. The faults could be additive or multiplicative, in this paper, we focus on the case of additive faults, which are modeled as exogenous inputs to the system. The faults can be incipient, abrupt or intermittent, depending on the form in which the faults are manifested, see refs. [1][2][3].

Additive Faults Representation
The additive faults are modeled with inputs in the actuators channel f ai , as well as in the output channel f si , with i = 1, 2, 3. This corresponds tȯ where

Sensor Faults
In the case of sensor faults, only one sensor is considered as output. So, a residual is generated through the corresponding observer in the observable part of the system. For this case, the sensor faults, an observer of complete order is considered. The output estimation error will be used as a residual. Thus two residuals are obtained, one for each sensor. Subsystem 1. For the first sensor, we consider the subsystem formed by the following equations, assuming that x 2 is free of fault: For the second subsystem we assume that x 1 is free of fault, the following equations form the second subsystem:ẋ Actuator Faults Similar to the case of sensor faults, we obtained the decoupled subsystems that are sensitive only to one particular fault, in this way, the residual is generated from an observer based on output feedback. Subsystem 3. For the first actuator fault ( f a1 ), the residual occurs in the channel of U p since x 1 is known, and assuming that x 2 is free of fault.
Note that x 4 is not available, it can be obtained from the dynamic of the system as: Subsystem 4. For to appreciate the fault in the second actuator ( f a2 ) is considered the following equations.ẋ Remark 1. Note that for fault decoupling an inspection procedure is used instead of a nonlinear transformation, i.e., for sensor i, the output is selected (omitting all other outputs) as well as all differential equations associated with the states that explicitly appear in the selected output and the ones required to complete the states present in the differential equations selected.

Remark 2.
The subsystem for sensor fault 2 and actuator 2 is the same, so only one will be used.

Residual Design
The observer-based residuals are built following the method presented in Section 3. For the construction of the residual generator sensible to sensor fault 1, we considered the first subsystem:ẋ it leads to its generalized Hamiltonian representation, with In this mode, we have to: The pair (C, S) is detectable agree with the definition 2.1 in ref. [27] since the matrix C λI 3×3 − S is of full rank for any value of λ in Z <0 = {λ ∈ Z : {λ} < 0}. So, the residual is defined from the observer,˙x Note that the residual is designed from a copy of the original subsystem and the correction factor L 1 (y 1 −ŷ 1 ).
For the fault in the second sensor ( f s2 ), and the faults in the two actuators ( f a1 ) and ( f a2 ), the decoupling is similar to the procedure utilized in the fault ( f s1 ). In Table 2, a summary of the sensitivity of each one of the different faults is presented, where √ means that the subsystem is sensitive to the corresponding fault.
In the table we can to see that the subsystem 2 and 4 have the same sensitivity to the faults f s1 , f s2 , f a2 , therefore, one of them does not provide additional information. The four residuals are obtained assuming that only one fault at a time is present, and not all of them simultaneously. A residual is obtained by considering a derivative in time, so obtaining this derivative could be a difficult task in the presence of noise. It is important to notice that the generation of residuals based on observers constitutes a reliable option to reduce noisy effects, by virtue of the inherent filtering characteristic of the observer, see ref. [24].
The considered design allows us to isolate all single faults. However, when more than one simultaneous fault is present, an alarm can be activated, but we cannot know which faults are involved.

Results
Two types of results are provided in this section. First, simulation results are used to verify the designed fault isolation schema. After, an experimental laboratory device is used to implement the designed residuals. Two types of faults are considered, actuator and sensor faults.

Fault Scenaries
Two additive actuator faults and two additive sensor faults are considered. The different considered cases are presented in Table 3.

Simulation Results
The simulation was performed in Simulink to MATLAB R . The parameters shown in Table 4 were obtained from the actual 2-DOF helicopter of Quanser R and those were used to obtain the simulation results shown in Figures 3 and 4. Mass of tail motor 0.232 kg 1 1 Length m 1 to center of mass 0.203 m 1 2 Length m 2 to center of mass 0.203 m g Gravity 9.8 m/s 2 Sensor Fault 1. Figure 3 shows the behavior of the residuals when the fault f s1 is present. When the fault f s1 occurs, all three residuals present sensitivity to the fault; this can be noticed because they are different from zero, indicating they are sensitive to the fault. Actuator Fault 1. Figure 4 shows the behavior of the residuals when the fault f a1 is present. As can be noticed, the residuals r 1 and r 3 respond to this fault because are differ from zero indicating sensitivity to the fault, while the residual r 2 is zero at all times, due its insensitivity to the fault.

Experimental Results
To validate the proposed scheme, a test on a physical real-time helicopter was performed. The experimental platform shown in Figure 5 and its corresponding schematic diagram in Figure 6 which shows the communication and data directly between the devices and the software. First of all, it is necessary to control the system to carry out the detection of faults. Because the 2-DOF system is in a closed loop, is possible to implement a PID control. The experimental platform consists of two motors, a lift motor that causes the pitch motion, and a tail motor, which produces the yaw motion. DC motors with a nominal voltage of 12 volts. The platform parameters are shown in Table 4. The Labview software was used as a programming platform, it contains the control law to stabilize the system and the algorithm to fault diagnosis; the SCB-68A board from National Instrumens R and an Arduino R Mega 2560 board with 56 input/output pins were used as an interface for communication between the physical system and the software. For the power part, a SparkFun R Monster Moto Shield H-bridge was used with a voltage capacity of 16 volts, 30 amps of current and 20 KHz of PWM frequency. The sensing was carried out by two rotary optical encoders, one placed at the base of the platform, which allows the yaw angle to be measured, ψ, and the other placed in the center of the platform which measures pitch angle φ.
The information of the angles and angular velocities of pitch and yaw are obtained through the SCB-68A board, the fault detection and control algorithm processes the information and feeds back the controlled signal to the interface consisting of two devices, the SCB-68A board and the Arduino R Mega 2560, which transforms the signal to PWM; taking the PWM signal as input, the power device supplies the motors with voltage. The data acquired is processed in the Matlab R software to obtain the graphs of the behavior of the residuals.
To produce faults in the physical system, external signals to the system were injected into both sensors and actuators, one at a time. Is important to mention that the produced faults in each of the physical tests, were in a proportion of 50 % with respect to the output.
The threshold of the normalized residual evaluation is presented in each of the cases in which the faults occur. The threshold for sensor failure is ±5 and the threshold for actuators failure is ±10, these values were chosen based on the structure and dynamics of the decoupled equations.  Sensor Fault 2. Figures 9 and 10 show the response of the residuals to the sensor fault f s2 . As can be noticed, in the case when a fault in sensor two exists, the residuals r 2 and r 3 differ from zero, indicating sensitivity to the fault.
Actuator Fault 1. Figures 11 and 12 show the response of the three residuals when the actuator fault f a1 is present. Note that the fault effects on residuals 1 and 3 occur when they are different from zero, due to their sensitivity to the fault.      Actuator Fault 2. Figures 13 and 14 show the response to residual to the actuator fault f a2 . Where the residuals r 1 and r 2 response to this fault. The residuals are different from zero, indicating sensitivity to the fault while the r 3 remains very close to zero indicating insensitivity to the fault.

Discussion
Due to the structure and dynamics of the system under study, a state-coupling is presented; this exposes an important complication for fault detection. The problem is attacked by decoupling each fault, thus ensuring that each residual generated is sensitive to a specific fault. We can observe that when a fault occurs in sensor 1, according to Table 2 of sensitivity of the residuals with respect to the fault, this must be manifested in all the residues. However, we can see in Figure 7, which shows the behavior of the residues sensitive to this fault, which shows the behavior of the residues sensitive to this fault, that the residual 2 presents a tenuous response compared to residual r 1 and r 3 ; this could be confused with the behavior of the residuals of actuator 1 as shown in Figure 11. However, observing the scale of the residuals, it is easy to distinguish when any of the two faults are present, since the residual r 2 in the presence of the fault in sensor 1 shows a greater magnitude, than compared to the r 2 in the presence of the fault on actuator 1 is very small in magnitude that we can say it is zero.
The experimentation data were obtained through the LabView software, and to show the experimentation data, the graphs were performed in the Matlab software. The difference in the time scale between the presented simulation and the experimentation graphs is due to the time it takes to adjust the sensor (encoder). In the simulation graphs, once the algorithm has started, the data begins to be recorded; therefore, the time starts at zero. However, in each new test performed during the experimentation was necessary to establish the zeros of the angles (pitch, yaw), which takes more than a minute; therefore, the time in the graph does not start at zero.

Conclusions
For a wide range of dynamic systems, which admit a Hamiltonian representation, it is possible to apply a systematic fault detection procedure in order to detect and isolate a set of faults. The results are not dependent on a specific controller (in the case of closed-loop controlled system). Further, in order to design fault-specific residuals (residuals sensible to a specific fault or a subset of faults) nonlinear decoupling is used. This decoupling procedure can be also used to look for a decoupling of perturbations too. In order to avoid false alarms, an evaluation function and a threshold is used with the obtained residual. The fault signature matrix, obtained as a result of the decoupling and residual generation will be used to associate a specific fault to the behavior of the residual (active for specific faults and inactive for the rest of faults (or perturbations). The fault isolation results have been tested on a laboratory test facility of a 2-DOF helicopter. An experimental test shows the effectiveness of the proposed approach. Some problems associated with physical implementation have been solved. Non-permanent fault has been used in the experimental setup. Future work includes the search for minimum fault sizes that can be detected (optimize for small faults). The time for detection should be reduced as well as the consideration of additional information in order to isolate structural-coupled faults (or perturbations) as the sign of residuals of patterns in them. Another topic that could be addressed as future work is developing control algorithms that take into account the failure reconfiguration to get a fault-tolerant control system.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A
Proof. Firstly, note that, since the pair (S, C) is assumed to be observable, or at least detectable, there exists a feedback matrix gain K, such that the proper values of [S − KC] are located in the closed left-half of the complex plane.
Then, consider the quadratic form H(e) = 1 2 e T Me, which is positive for any e = 0, given that M is a positive definite symmetric matrix. Besides, note that H(e) is continuous at the origin and that H(0) = 0. Therefore, H(e) qualifies as a candidate Lyapunov function.