AP05_4.vp 1 Introduction Autonomous Underwater Vehicles (AUVs) are submers- ible robots that operate independently without human intervention [1, 2, 3]. These vehicles have a multitude of uses including maintenance, diver support, pipeline inspection and geological surveying. As many of these tasks require the AUV to operate in close proximity to obstacles and hazards, it is imperative that their motion is accurately controlled. This requires that the particular control system designs must be robust and reliable [1, 2, 3]. Automatic control of this type would enable the AUV to hold its position or manoeuvre ac- curately with minimal adverse influence from the external disturbances present in the hostile subsea environment e.g. ocean currents. The performance of any controller relies on accurate feed- back from sensors [4]. Unfortunately, this aspect is not always present within a system due to system failures. There are two possible methods that can be implemented to deal with the sensor faults that are dealt with in this paper. The first is to have redundancy built into the system by having multiple sen- sors for each state to be measured. This incurs the problems of added costs, weight and reduced battery life, none of which are desirable in an AUV. The second method is to reconstruct the output of the faulty sensor from the responses of the remaining good sensors. This is achieved by using an ob- server to estimate what the faulty signal should actually be reading and then replacing the faulty signal with this estimate of the true value. It is this second method that is presented in this paper. The control method that will be used is nonlinear Sliding Mode Control. This control structure has been used in nu- merous papers where it has been shown to be robust and reliable for submersible vehicle control [1, 2, 3]. The advan- tage of Sliding Mode control over linear control structures is that there is an extra nonlinear switching term that is able to overcome the matched unmodelled dynamics present in the system. The reconfiguration method that is used in this paper makes use of a nonlinear Sliding Mode Observer (SMO) [4, 5, 6]. The theory and design of SMOs for reconfiguration is given by Edwards and Spurgeon [5] and Utkin and Guldner [6], and this is furthered by McGookin [4] who looks into their use in submarine control reconfiguration. This paper contin- ues that research by looking into their use in AUVs. This paper is split into 5 sections. The first looks at the type of AUV model used in this paper. The second describes the control structure used for the AUV. The third gives an overview of SMOs and how they are designed for re- configuration. The fourth section gives results of the SMOs reconfiguring the system against faults injected into the sys- tem before the final section gives the conclusions. 2 System model The simulations used in this paper make use of a nonlin- ear 6 degrees of freedom (DOF) model to give as accurate a representation of the real system as possible. A diagram of the AUV model used is shown in Fig. 1, annotated with the main 18 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 45 No. 4/2005 Czech Technical University in Prague Implementation of Sliding Mode Observer Based Reconfiguration in an Autonomous Underwater Vehicle A. J. Mitchell, E. W. McGookin, D. J. Murray-Smith This paper looks at the implementation of a Sliding Mode Observer (SMO) based Reconfiguration algorithm to deal with sensor faults within the context of navigation controllers for Autonomous Underwater Vehicle (AUV). In this paper the reconfigurability aspects are con- sidered for the heading controller. Simulation responses are used to illustrate that the Sliding Mode Observer is able to give state information to the controller when there is a fault in the AUV’s sensor package. Comparisons are made between the Sliding Mode Controller with and without reconfigurability for a number of different sensor failures, e.g. bias errors in or the complete loss of the heading data, and the robust- ness of the Sliding Mode Observer is investigated through the introduction of disturbances into the system. Keywords: autonomous underwater vehicles, sliding-mode control, fault tolerance, reconfiguration, sliding mode observers, environmental disturbances. XE YE ZE OE u v w p q r XB YBZB OB�r n �s Z . X . Y . � . � . � . Fig. 1: Graphical representation of AUV showing reference frames axes and state variables. It is based on the NPS AUV II given in [1, 2]. In Fig. 1 it can be seen that the AUV has vertical and hori- zontal control surfaces at both the bow and stern. For the work in this paper only the stern control surfaces are used to con- trol the AUV and the bow surfaces are set to their trim values of 0°. The control surfaces are limited to �20°, the thrusters �1500RPM and all the actuator signals are passed through a first order filter to limit the actuator rates [1,2]. The state space form of the nonlinear equations of motion is given below [2]. � �� � ( ) ( ) ( ) (� � � � � � � � � � � � �� � � � � � � � M C D J M g1 10 0 � �) ( ) 0 0 � � � � � � � � � M B u 1 (1) where � �� � u v w p q r T, � �� � X Y Z � � � T, � �u � � �r s n T, B(�) is the nonlinear input matrix, C(�) is the matrix of Coriolis and Centripetal terms, D(�) is the damping matrix, g(�) is the vector of gravitational and buoyancy forces and moments, J(�) is the Euler transformation matrix, and M is the mass and inertia matrix. These equations can be re- presented by the simplified nonlinear state space form shown below. � ( ) ( )x A x x B x u� � , (2) where x � [� �]T. This can then be linearised to give the fol- lowing standard state equation: �x Ax Bu� � . (3) Here A is the system matrix and B is the input matrix. 2.1 Disturbances To test the controllers and reconfiguration in a realistic simulation environment, ocean current disturbances have been modelled. Ocean currents are the turbulent flows within bodies of water [2, 7]. For an AUV working near the seabed and in close proximity to objects, the ocean-currents would be highly turbulent, as the objects shed vortices into the stream. To model the sea currents it is required to know the veloc- ity of the current flow, Vc, angle of attack, �c, and sideslip an- gle, �c, of the current in the Earth-fixed reference frame. For this paper �c is set to a predefined values of 0° and then Vc, and �c are varied randomly. Fig. 2 shows graphically the rela- tionship between the sea current’s velocity and the Earth fixed axes. The three terms are then converted into velocities in the Earth-fixed reference frame using the following equations: u VEc c c c� cos cos� � , (4) v VEc c c c� cos sin� � , (5) w VEc c c� sin � . (6) These can then be changed using Euler transforms to give the velocities in the body-fixed reference frame uc, vc, wc. These values are then used to create the vector � ��c c c cu v w� 0 0 0 Tthat is added by the principle of super- position to the AUV model by altering the simulations equa- tions as shown below. � � � �r c� , (7) � �M C D g B u� ( )� � � � �� � �( ) ( )r r r+ , (8) � ( )� � �� J . (9) 3 Controller design 3.1 Decoupled controller design Since most manoeuvres preformed by AUVs can be bro- ken down into 3 basic manoeuvres [1, 2, 7], i.e. change in speed, change in direction and change in depth, the lower level of control will be made up of 3 decoupled controllers. For each of these controllers a submodel of the AUV dynamics is generated by reducing the full 6 DOF model to smaller ones that are based on the dominant states for each ma- noeuvre [1, 2, 7]. This process of isolating specific dynamics is called decoupling. For this paper only the heading submodel is considered and this is made up of the yaw rate, r, and the heading angle, �. The sway velocity, v, can also be used in the heading submodel, but this is found to reduce the disturbance rejection abilities of the controller and so is omitted in this study. The control actuator that is used for altering the head- ing is the rudder at the stern, �r. 3.2 Sliding mode control The sliding mode controllers used here is SIMS (Single Input Multiple State) [1, 2, 7]. Sliding Mode controllers are made up of two parts, the Equivalent term, ueq, and the Switching term, usw [1, 2, 7]. The Equivalent term is a lin- ear controller that is optimised around a specific operating condition. The Switching term is the nonlinear part of the controller and works by giving the extra control action re- quired to drive the system back to the operating condition for which the Equivalent term is valid. The Equivalent term used in this study is of the state feedback gain controller form [1, 2, 3, 7, 8]: ueq T� k x, (10) where k is the feedback gain calculated using robust pole placement techniques, [1, 2, 8], and x is the sub-system state vector. In this project all pole placement has been carried out using the place command in MATLAB that uses an iterative method to place the poles [8]. The switching term is calculated from the equation for the sliding surface, given in [1, 2] as: �( )x � h xT � (11) with �x being the state tracking error. This equation can then be expanded to give the following equation, [1, 2, 3, 7]. � �u fsw T T d T� ( ) � �( ) sgn( )h b h x h x1 � (12) © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ 19 Czech Technical University in Prague Acta Polytechnica Vol. 45 No. 4/2005 X E vEc uEc V c wEc �c �c Y E ZE Fig. 2: Diagram showing disturbance in Earth-fixed reference frame Here h is the right eigenvector of Ac � A b k T, with A and b being the system and input matrices defined previously and �( )f x is an estimation of the nonlinearities in the system, which for this paper is set to zero. As the above equation uses the signum function, sgn(�), which has only three outputs, 1, 0 and 1, this leads to chat- tering when the system is on the sliding surface [1, 2, 3, 7]. To get around this problem the sgn(�) term is replaced by the hyperbolic tangent function tanh(�/�) where � is the bound- ary layer size, [1, 2, 3, 7]. This gives the response a much smoother transition across the sliding surface while still giving the full control effort outside the boundary layer. Bringing the two terms together and making the aforementioned changes gives the full control structure that is used in this paper and is shown below. � �u x� � k h B h xT T T d( ) � tanh( )1 � � . (13) 3.3 Guidance The second method of guidance that has been imple- mented is a simple Line-of-Sight (LOS) waypoint following guidance [2]. Instead of having a fixed list of course and time data as its input, this guidance has a list of waypoints, depths and approach velocities. The guidance then calculates the di- rection that the AUV should take in order to head towards the waypoint. The AUV continues towards the waypoint until it enters a “Sphere of Acceptance” around the waypoint at which point the guidance moves on to the next waypoint. A graphical representation of the AUV heading towards a waypoint is given in Fig. 3. The equations to calculate the desired values that the con- trollers require are given below, [1, 7]. V Vwd � (14) �d � � � �� � � �� tan 1 Y Y X X w c w c (15) Z Zwd � (16) 4 Reconfiguration A Sliding Mode Observer based reconfiguration method is used in this study. This utilises a sliding mode observer to follow the system, and when a fault is detected the output of the SMO is then substituted into the system in place of the faulty signal [4, 5, 6]. Again, as with the control struc- ture, submodels are used to split the full system into smaller decoupled systems. The submodel used for the heading ob- server is, however, different from that used in the controller design in that it has the sway velocity, v, included in it to make it a three state system. The extra state is used to give a better performance of the observer as it allows the observer to oper- ate with two faultless states when estimating the heading. The equations for a SMO in the case of an LTI system are shown below [4, 5]. � � � � �x y A x y b u Ns s s s s s 0 � � � � � � � � � � � v , (17) where A s and bs are the subsystem’s system matrix and input distribution vector respectively, �xs is the estimated un- flawed subsystem states [ ]v r T, ys is the subvector of the system output, [�], �y s is the observers output [�], us is the input to the subsystem [�r], N is the sliding mode gains and v0 is the switching term. The switching term gives the observer the extra action to overcome the nonlinearities and matched unmodelled dynamics present in the system. When fault free, the switching term v0 is defined as the sign of the difference between the actual system output and observer output [4]. The switching term is defined as [4, 5]: v y y0 � sgn( � )so s . (18) Here yso is the output of the actual system that is equivalent to the output of the observer, i.e. for the heading submodel yso would be the heading angle, �. The problem, however, is that when there is a fault in this signal the observer would follow the faulty signal. To get around this problem the switching term is altered so that it uses a comparable signal that is un- flawed. For the heading observer the yaw rate, r, is used to replace the faulty � for its switching term as this is approxi- 20 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 45 No. 4/2005 Czech Technical University in Prague North Z � u Sphere of Acceptance Waypoint ( Xw,Yw,Zw,Vw) Xc,Yc,Zc Fig. 3: Diagram showing AUV heading towards waypoint Reconfiguration Logic AUV SM Heading Observer SM Heading Controller �d + - � v, r, ��r ^^ � � or � v, r, � Fig. 4: Diagram of control structure for the heading submodel including reconfiguration logic mately the derivative of the heading angle [4]. To reduce chat- tering effect [4, 5] soft switching in the form of a hyperbolic tangent function with a boundary layer �0 thick replaces the signum function in the switching terms. The switching terms are then written as: v r x 0 0 h sh1,2 h � tanh � � . (19) A diagram of the complete control structure for the recon- figurable heading controller is shown in Fig. 4. 5 Results To get the following results a zigzag pattern of waypoints is laid out for the AUV to follow. This allows the AUV to perform both right and left turns and should highlight any asymmetry in its handling characteristics. The two faults that the recon- figuration is tested for are a complete failure of the heading sensor where the heading output is 0° and for a bias of 10° added into the heading sensor. Both of these faults are simu- lated to happen after 115 seconds and the fault are detected 3 seconds after that. All of the simulations have been carried out using the full 6-DOF model at a depth of 40 m and with the AUV travelling at 1.7 m/s. The first graph, Fig. 5, shows how the AUV acts if there is a complete failure in the heading sensor when no reconfigura- tion is present in the system. From this it can be seen that the AUV loses the ability to follow the desired heading completely with the model of the AUV breaking down just after 200 s has elapsed. This break down in the model is the result of the speed controller trying to compensate for the cross coupling that becomes noticeable when the actuators are at full deflec- tion. Fig. 6 gives a view looking down on the path that the AUV takes, starting in the top right of the graph and travel- ling towards the waypoints that are denoted as circles with a radius the size of the sphere of acceptance. From this it can be seen that the failure in the heading sensor, which happens just after the AUV has passed through the first waypoint, causes it to lose direction and snake from side to side before the simu- lation becomes unstable and the AUV appears to shoot off into infinity. Figs. 7 and 8 show the response of the AUV when a bias error is added to the heading sensor without reconfiguration. In the Yaw angle response in Fig. 7 it can be seen that the AUV continues to follow accurately the value that is given by the sensor. The large spike in the rudder actuation is caused by the controller suddenly being presented with a 10° error in the heading angle and trying to correct for that. The problem caused by this bias error in the sensor is noticeable in Fig. 8, where the AUV misses the next waypoint. This is caused by the error bias being large enough that the AUV is being directed on a course that misses the sphere of acceptance around the waypoint. Fig. 9 shows the heading and rudder responses when the SMO based reconfiguration is implemented in the system. From the yaw response it can be seen that there is a small devi- ation from the commanded heading immediately after the fault but this is quickly brought under control. Also of note from this graph is the accuracy of the SMO in estimating the heading angle, after the fault has been detected the output from the sensor is overwritten with the data from the observer. © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ 21 Czech Technical University in Prague Acta Polytechnica Vol. 45 No. 4/2005 Fig. 5: Heading angle and rudder usage responses with complete failure of the heading sensor Fig. 6: XY position plot showing movement of AUV when head- ing sensor fails completely Fig. 7: Heading angle and rudder usage responses with bias fault in the heading sensor It can be seen in the graph that the actual and observed (the sensed line after the fault) heading angles lie on top of one another. In the rudder response it can be seen that there is a very large spike in the required value around the time of the fault. This is caused by the sudden step of 150° appears in the error signal sent to the controller when the sensed heading suddenly becomes 0°. In the actual AUV these large spikes would cause undue stress and wear on the actuators, reducing their lifespan and possibly even damaging them directly. From Fig. 10 it can be seen that even though there is a fault in the heading sensor the AUV is still able to reach the next waypoint and then head in the direction of the waypoint after that. This would suggest that even with this complete heading sensor failure the AUV would be able to complete its mission. The heading and rudder responses for a 10° bias failure when reconfiguration is present are given in Fig. 11. From these it can be seen that the SMO is able to accurately recon- struct the faulty signal and is again able to follow the actual response very closely. As with the complete failure case, the ac- tuator response around the time of the fault is characterised by large spikes as the step response inputs of the fault and then the reconfiguration cause the controller to react violently in an attempt to follow its input signal. From the view looking down on the AUV in Fig. 12 it can be seen that the AUV is again able to continue on its mission even with one signal being faulty. The ocean current based disturbances were then added to the system to test how well the observer would be able to cope in a more realistic environment. For this paper the currents were set to vary between 0 and 0.1 m/s, with a constant �c of 0° and varying �c. 22 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 45 No. 4/2005 Czech Technical University in Prague Fig. 8: XY position plot showing movement of AUV when head- ing sensor has 10° bias error Fig. 9: Heading angle and rudder usage responses with complete failure of the heading sensor with reconfiguration present Fig. 10: XY position plot showing movement of AUV when head- ing sensor fails completely with reconfiguration present Fig. 11: Heading angle and rudder usage responses with bias fault in the heading sensor with reconfiguration present Fig. 12: XY position plot showing movement of AUV when head- ing sensor has 10° bias error with reconfiguration present From Fig. 13 it can be seen that there is no visible degrada- tion in the ability of the SMO to follow the actual heading when there is a complete failure of the sensor with the distur- bances in the system. The view in Fig. 14 shows that the AUV is also able to continue on its mission with a failed heading sensor as it is still able to direct itself with accuracy towards the desired waypoints. In Fig. 15 the yaw response again shows that the intro- duction of disturbances when a bias error fault occurs in the heading sensor also has very little impact. The response is again very similar to Fig. 11 where no disturbance is present. In Fig. 16 it can be noted that again, the AUV is able to con- tinue on its mission as the reconfiguration is able to overcome the effects of the failure and guide the AUV to the next waypoint. 6 Conclusions In conclusion it can be seen that the Sliding Mode Observ- ers perform well as a method of reconfiguration. Without any reconfiguration it can be seen that the AUV is unable to con- tinue on its mission when either a complete failure or a bias error occurs in the heading sensor. With the SMO based re- configuration the AUV is able to accurately track its desired heading and continue with its mission. Even when distur- bances are introduced into the system the SMOs are able to accurately estimate the heading of the AUV. One problem, rooted in the high gain nature of the Sliding Mode control- lers, is the large spikes in the actuator signals when the faults first appear and are then dealt with. A possible solution to this would be to place a filter either on the input or the output of the controller to reduce the stress that this would inflict on the actuators although this would degrade the recovery perfor- mance of the system. References [1] Healey, A. J., Lienard, D.: “Multivariable Sliding Mode Control for Autonomous Diving and Steering of Un- manned Underwater Vehicles.” IEEE Journal of Oceanic Engineering, Vol. 18 (1993), No. 3, p. 327–339. [2] Fossen, T. I.: Guidance and Control of Ocean Vehicles. Chichester (England): John Wiley and Sons Ltd, 1994. © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ 23 Czech Technical University in Prague Acta Polytechnica Vol. 45 No. 4/2005 Fig. 13: Heading angle and rudder usage responses with com- plete failure of the heading sensor with reconfiguration and disturbances present Fig. 14: XY position plot showing movement of AUV when head- ing sensor fails completely with reconfiguration and dis- turbances present Fig. 15: Heading angle and rudder usage responses with bias fault in the heading sensor with reconfiguration and dis- turbances present Fig. 16: XY position plot showing movement of AUV when head- ing sensor has 10° bias error with reconfiguration and disturbances present [3] Mitchell, A., McGookin, E., Murray-Smith, D.: “Comparison of Control Methods for Autonomous Underwater Vehicles.” Proceedings of the 1st IFAC Workshop on Guidance and Control of Underwater Vehicles (GCUV2003), Newport, Wales, 2003, p. 41–46. [4] McGookin, E. W.: “Fault Tolerant Sliding Mode Con- trol for Submarine Manoeuvring.” Proceedings of the 1st IFAC Workshop on Guidance and Control of Under- water Vehicles (GCUV2003), Newport, Wales, 2003, p. 119–124. [5] Edwards, C., Spurgeon, S. K.: Sliding Mode Control: The- ory and Applications. London (England): Taylor & Francis Ltd, 1998. [6] Utkin, V., Guldner, J., Shi, J.: Sliding Mode Control in Elec- tromechanical Systems. London (England): Taylor & Fran- cis Ltd, 1999. [7] McGookin, E. W.: “Sliding Mode Control of a Subma- rine.” M.Eng thesis, Glasgow University, Scotland, 1993. [8] Kautsky, J., Nichols, N. K., Van Doorens, P.: “Robust Pole Assignment in Linear State Feedback.” International Journal of Control, Vol. 41 (1985), No. 5, p. 1129–1155. Alasdair J. Mitchell phone: +44 141 330 6137 fax: +44 141 330 6004 e-mail: a.mitchell@elec.gla.ac.uk Euan W. McGookin David J. Murray-Smith Centre for Systems and Control Department of Electronics and Electrical Engineering University of Glasgow, Glasgow, G12 8LT, UK 24 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 45 No. 4/2005 Czech Technical University in Prague