State observer design for a walking in-pipe robot

. In this paper, a state observer design for a walking in-pipe robot is studied. The necessity of using a state observer is related to the fact that sensors have limited accuracy and are prone to producing noise. This is especially problematic for in-pipe walking robots, since they use model-based control and require accurate information of their current state. The paper shows that an iterative state observer based on solving Riccati equation provides significant improvements in the behaviour of the control system. It allows to smooth out the spikes in the control actions requested by controller and to minimize tremor of the robot links. In order to study the behaviour of the observer when different sensors are used, a performance function was introduced. It was shown that the observer allows to improve the performance of the control system for a wide range of sensor parameters. Additionally, it was shown that the introduction of the observer allows to choose higher feedback controller gains, enabling more precise control. Simulations on the full robot model, taking into account mechanical constraints and contact forces showed that the linear observer is capable of improving the behaviour of the control system of the walking robot, if measurements of the reaction forces are provided. The effects that the noise and quantization in the reaction forces measurements have on the behaviour of the state observer is studied.


Introduction
Pipeline inspection robots are complex electromechanical systems that are designed to move inside pipelines while carrying necessary equipment. Popular in-pipe robot designs feature parallel linkages with wheels or tracks [1][2][3][4]. Some other designs include flexible links, pneumatic or Bowden cable activation, serial linkages designs (such as snake-like robots), multimodule designs, etc. [5][6][7]. This diversity and complexity is the result of the diversity and complexity of the tasks posed for this type of robots and reflects the advances in the field of in-pipe robotics.
Currently, in-pipe robot designs have been able to solve a number of mobility tasks, however the problem of navigating pipelines has not been completely solved yet. In part, this is due to the diversity of the mobility tasks the in-pipe robots face. For example, pipelines can have significant changes in diameter, vertical sections, Lshaped and U-shaped turns, Y-shaped and T-shaped junctions and other features that make it difficult to navigate for most of the known robot designs. This motivates the use of more agile robot designs, such as walking in-pipe robots [8][9][10].
All types of in-pipe robots require solving a number of sensor-related challenges. These include estimation of the robot's position and configuration, navigation and mapping. Some of the sensor-related problems are common for all types of multilink robots, and arise due to the fact that real sensors are characterized by quantization, discretization, noise, time lag and other strongly nonlinear behavioural features. Estimating the configuration of walking in-pipe robots is an additionally challenging problem because of their structure, which features multiple serial linkages connected to the floating body (for the terminology see [11]). Since calculating the positions of links at the end of a sequential kinematic chain requires measurements of a number of joint parameters (angles or linear displacements), the nonlinear behaviour of the joint sensors will manifest significantly in these calculations. Incidentally, the contact elements of walking in-pipe robots, whose trajectories need to controlled [12][13][14][15], are located at the ends of sequential kinematic chains and therefore their positions are hard to infer exactly. This motivates the use of special configuration estimation algorithms.
There are a number of methods that can be used for configuration estimation (or state estimation). For linear systems, state observers can be used. In papers [16][17][18] state observers had been used to control DC motors, underwater robots and wheeled mobile robots. This shows that although these methods are developed for linear systems, they can be used for nonlinear mechanical systems as well. This is similar to how linear control methods, such as linear quadratic regulator, can be used to control robots with nonlinear dynamics (see [19][20][21] for examples). In this paper, we look at the use of linear state observer to provide predictions for joint parameters of an in-pipe robot.
The rest of the paper is organized as follows. The section 2 provides description on an in-pipe walking robot which is used in the numerical studies. The section 3 discusses the observer design, and sections 4 and 5 show the work of the observer in simulation.

Walking in-pipe robot description
In this paper, we consider an in-pipe walking robot with nine links. One of the links is called "body" and other links are organized into pairs and are connected to the body in a serial manner. The robot is shown in figure 1. x and 1 y are axes of a local coordinate system, attached to the robot's body and C is the center of mass of the robot's body. In the following sections, we will consider one of the robots legs separately from the rest of the device. Assuming that the robot's body remains stationary, we can introduce a vector of generalized coordinates that describes the configuration of one of the robot's legs: Using this generalized coordinates we can describe robot's dynamics in the following way: where H is the generalized inertia matrix, 0 c is a bias vector and τ is a generalized motor torques (see [22] for terminology, derivations and practical algoriths for generating these equations). These equations can be linearized in the following way: where [ ] The robot is controlled by a computed torque controller (CTC), which is given by the following control law: where * q  is the desired value of the generalized coordinates, * = − e q q is the control error and p K and d K are gain matrices. The use of this controller is discussed in [23] and the tuning of the gain matrices is studied in [24][25].

State observer design
The idea behind a state observer is to predict the actual evolution of the state coordinates of the robot given a model of the robot dynamics and possibly incorrect measurements of the state coordinates. Let us introduce a vector of state coordinate predictions z . We define the observer dynamics as follows: where L is a gain matrix of the observer. In order to find the optimal gain matrix we can define = − e x z , subtract (5) from (3) and simplify to get: where I is an identity matrix. This suggests that the optimal gain matrix L can be computed by solving the Riccati equation, same as it is done in linear quadratic regulator design. Examples of how this is done can be found in [20][21]. The weight matrices that appear in the Riccati equations are chosen to be identity matrices in all experiments shown in this paper. If the mechanical system has explicit mechanical constraints imposed on it, the observer dynamics equation can be modified as follows: where F is the constraint Jacobian taken with respect to the state coordinates x and λ is a vector of Lagrange multipliers that are equivalent to reaction forces. Values of λ can me read from force sensors, and they are subject to measurement errors. Thus, the observer is given by the update law (5) or (7), where the gain matrix is obtained by solving the Riccati equation for the dynamical system (6). For nonlinear system this is done iteratively, by linearizing the system along the path that the system follows in the state space. In order to prevent the erroneous values of sensor measurements from appearing in the dynamics model during linearization, the model can be linearized along its desired (rather than actual) trajectory in the state space. This is what is done in all experiments shown in this paper.

Simulation results
In this section, we study the behaviour of a single leg of the walking in-pipe robot, taking into account the nonlinear effects of the joint sensors. In particular, we model sensor quantization and sensor noise. The sensor model is then given as follows: where x  is the measured value of x , ( mod ) x σ is remainder after division of x by σ and ( , ) r c δ is a random number that has a flat distribution in the interval [ 0.  As we can see, the measured value of joint angle increases by visible increments, and the noise levels are so high that they make it difficult to determine the time when the increments took place. Expression (4) suggests that the nonlinearities in ( ) t ϕ translate to nonlinearities in ( ) t τ . Figure 3 shows the generalized torques ( ) t τ obtained for the case discussed above. This and the following simulations are done with 1000 p = K I and 100 d = K I, where I is a 2-by-2 identity matrix.  Figure 3 shows that the torques change rapidly, possibly faster than is possible for some motor types. This illustrates another reason why state estimation is important, since it is needed to prevent the control system from requesting impossible behaviour from the robot motors.
Let us study how the behaviour of the controller changes when the state observer (5) is introduced. Figure  4 shows the time functions ( ) t τ for this case. As we can see, for this experiment the time functions ( ) t τ requested by the controller are smooth, which suggests that the state observer works well. To make this observation more quantitative, let us introduce a cost function J: where * x is the desired value of x and * u is the value of u found using inverse dynamics and Q and R are weight matrices of the additive quadratic cost J. In the following experiments we use the weights 1 = Q and 0.1 = R . Let us study the cost J as a function of the sensor resolution σ . Figure 5 shows this graph for the case when observer is not used. As we can see, the cost function steadily grows as σ increases (the sensor resolution falls). This can be expected from the shape of the graphs shown in Figure 3. The same dependence for the case when the linear observer is used is shown in Figure 6.  Figure 6 shows that introducing the state observer improves the cost. When the state observer is used, the cost does not exceed 0.05, whereas previously the cost was reaching values of 0.15.
We should note that in all experiments shown here the parameter c was chosen to be equal to zero. Experiments with different values of c, such as 0.01, showed the same results, and thus were omitted from this paper for conciseness.
Let us study how the noise levels affect the performance of the system with and without observer. Figure 7 shows both dependencies.  Figure 7 demonstrates that the cost increases with the noise level when observer is not used, while introducing the observer makes the performance of the system seemingly independent from the noise.
It is well known, that high gain feedback control is more sensitive to sensor noise and measurement inaccuracies, compared with low gain feedback. In order to study this relation we fix the sensor parameters at   and d k worsens the performance of the system. This is an undesirable result, as higher controller gains allow higher motion precision. Fig. 9. Dependence of J on scalar coefficients k p and k d (with linear observer, c=0, δ=0.05, σ =0.05). Figure 9 shows that introducing the linear state observer allows to negate this problem, improving the performance of the system when the controller gains are high. The mean value of J for that surface is 0.011.

Simulations on a full scale robot
In this section, we present simulation results for the full robot model. This model takes into account mechanical constraints and the reaction forces that arise from them. In these experiments LQR-based controller discussed in [26] is used. Figure 10  As we can see, the robot exhibits high frequency oscilations. This reflects the fact that the chosen LQRbased controller was tuned to produce high feedback gains and thus the resulting control law is sensitive to the sensor noise. Figure 11 shows the same time functions obtained for the experimet with the linear state observer (7). The values of λ are quantized and sensor noise is added, same as it is done in (8). The corresponding constants c λ , λ δ and As we can see, the observer improved the behaviour of the robot, removing the tremor. Let us study how the behaviour of the observer depends on the quality of the reaction forces measurements. Figure 12 shows the dependance of J on the sensor resolution λ σ . Fig. 12 Dependence of J on sensor resolution σ (without using the observer, c λ = 0, δ λ =0.01). Figure 12 demonstrates that the performance function does now show dependence on the sensor resolution λ σ in the chosen range. This is an important result, as it encourages the use of the state observer in systems with mechanical constraints, where the sensors measuring reaction forces have low accuracy. We can also observe a significant increase in the values of the cost function. This is related to control errors, characteristic of the chosen controller. This is discussed in paper [14].

Conclusions
In this paper, the topic of state observation for in-pipe walking robots had been studied. These type of robots depend on accurate state information and accurate robot models, which should be derived from the erroneous sensor data, accessible to the robot. This signifies the question of choosing effective state observer. In this paper, an interactive linear state observer had been studied.
Simulations of motion of a single leg of the walking robot have showed that this type of observer significantly improves the behaviour of the control system in the presence of sensor noise and data quantization. It was demonstrated, that the introduction of the state observer allows the use of higher feedback controller gains for the case of a computed torque controller.
Simulations performed on the full robot model showed that the introduction of the state observer allows similar improvements. However, in order to use the state observer on the full robot mode, the information about reaction forces need to be included in the observer design. The observer demonstrated good performance even in the presence of noise and quantization of the reaction forces data.
The following research can be focused on designing a an observer for reaction forces and on using the information of contact points locations in the state observer design. This work is supported by the Presidential grant MK-2577.2017.8.