This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Mass Estimation in Manipulation Tasks of Domestic Service Robots using Fault Reconstruction Techniques

Marco Negrete    Jesús Savage    José Avendaño
Abstract

Manipulation is a key capability in domestic service robots, as can be seen in the rulebooks of last Robocup@Home editions. Currently, object recognition is performed based mostly on visual information. Some robots use also 3D information such as point clouds or laser scans but, to the knowledge of authors, robots don’t use physical properties to improve object recognition. Estimation of an object’s weight during a manipulation task is something new in the @Home league and such ability can improve performance of domestic service robots. In this work we propose to estimate the weight of the grasped object using Sliding Mode Observers. If we consider the manipulator without load as the nominal system and object’s weight as a fault signal, we can estimate such weight by an appropriate filtering of the output error injection term of the sliding mode observer. To implement our proposal we used MATLAB and Simulink Robotics System Toolbox, ROS Toolbox and Simscape. To improve computation time we exported all algorithms to standalone ROS nodes from Simulink models. Tests were performed using two platforms: Justina’s left manipulator (a robot developed at Biorobotics Laboratory, UNAM) and Neuronics Katana manipulators. We present results in simulation and discuss the performance of the proposed system and the possible sources of error. Finally we present our conclusions and state the future work.

1 Introduction

Consider the following serving-drinks-test scenario in the Robocup@Home league: a robot is asked to bring beverages and to do so, the robot performs the following common steps: it navigates to the bar, recognizes the beverages (usually cans or tetra packs), calculate the inverse kinematics of its manipulator, grasps the object and returns to the user’s location. This is a common situation in @Home tasks, nevertheless, what happens if there are empty cans or tetra packs in the bar? As it is commonly implemented in @Home league, robots are unable to distinguish between empty and full cans, since they commonly rely only in visual information of the beverage containers (see, for example, description papers of last edition winner teams [10, 7, 12]).

1.1 Objectives and goals

The project we propose consists in applying model-based fault reconstruction techniques [3] to estimate the weight of the object being carried by the robot. If we consider the manipulator without load as the nominal system, and the weight of the object as an external perturbation causing a faulty behavior, we can apply fault reconstruction techniques to estimate such perturbation, i.e., to estimate object’s weight. There are several approaches for model-based fault reconstruction. Residual generation is a common technique where an observer is designed to be sensitive to fault signals. On the other hand, Sliding Mode Observers (SMO) are dynamic estimators designed to be robust against fault signals [9]. SMOs also provide the ability to reconstruct the fault signal by filtering the so called output error injection term [1]. With the estimation of the manipulated object mass, we expect to improve the manipulation performance in domestic service robots.

1.2 Description of the document

This technical report is organized as follows: In section 2 we briefly introduce the concept of Sliding Mode Observers (SMO) and we describe the robot Justina’s manipulator, the platform we chose to test our proposal. In section 3 we explain the theoretical part of our proposal while section 4 is dedicated to describe the implementation using a model-based design approach in MATLAB and Simulink. Section 5 describe our results and also, the cases where the proposal can fail. In section 6 we show the reusability of our proposal by replicating some results using a simulated Katana manipulator. Finally in section 7 we state our conclusions and sketch the future work.

2 Background

2.1 Sliding Mode Observers

Sliding mode observers are disticontinuos observers that have the properties of finite time convergence and accurate tracking of the measured states once the sliding surface is reached. These type of observers can be used to reconstruct faults or disturbance signals through an appropiate filtering of the so-called injection output error. Interested readers can find further information about Sliding Mode Observers in [9, 2, 4].

Fault detection and isolation, from the control theory approach, is commonly achieved by the implementation of residual generators. A common way to design such residual generators is through observers that are sensitive to the fault signals. Nevertheless, SMOs inherit the properties of Sliding Modes theory, i.e., SMOs are designed to be robust against disturbances and fault signals and to accurately track the system states. As previously explained, the discontinuos term of the SMO will contain information about the fault signal wich can be reconstructed by obtaining the equivalent output error injection.

2.2 Robot Justina’s manipulator

Justina is a domestic service robot built at the Biorobotics Laboratory of the National Autonomous University of Mexico and developed under the ViRBot architecture [8]. This robot and its predecessors have been participating in the Robocup@Home league [11] since 2006 performing several tasks such as cleaning a table, serving drinks, and several other tasks that humans ask for.

Among other actuators, Justina has two 7-DOF manipulators built with Dynamixel servomotors. Such servomotors allow the user to control them in several forms: by setting a goal position, setting a goal movement speed or setting a desired current which will produce a torque. This latter option is used in this project. Also, these motors provide position sensing with a resolution of less than a tenth of degree. Figure 1(a) shows robot Justina and its sensors and actuators.

Refer to caption
(a) Sensors and actuators.
Refer to caption
(b) The left manipulator representation for simulation purposes.
Figure 1: The domestic service robot Justina.

To describe the kinematic chain and some physical properties of the manipulator, we use an URDF file. We already had an URDF describing the whole robot kinematic chain, nevertheless, for this project it was necessary only one of the mainpulators. We chose the left arm and extracted the corresponding tags to a new file. This file was used as a starting point for modeling and simulation purposes. Figure 1(b) shows the left arm of robot Justina as represented in the URDF.

3 Mass estimation with Sliding Mode Observers

3.1 Dynamic Model

From the Langrangian of the manipulator, a dynamic model of the following form can be obtained:

M(q)q¨+C(q,q˙)q˙+Bq˙+G(q)+Δ(q,q˙,u)=uM(q)\ddot{q}+C(q,\dot{q})\dot{q}+B\dot{q}+G(q)+\Delta(q,\dot{q},u)=u (1)

where q7q\in\mathbb{R}^{7} are the joint angles, M(q)7×7M(q)\in\mathbb{R}^{7\times 7} is the inertia matrix, C(q,q˙)7×7C(q,\dot{q})\in\mathbb{R}^{7\times 7} is the Matrix of Coriollis forces, Bq˙7B\dot{q}\in\mathbb{R}^{7} is the vector of friction forces, G(q)7G(q)\in\mathbb{R}^{7} is the vector of gravitational forces, uu is the input torque, considered as control signal, and Δ(q,q˙,u)\Delta(q,\dot{q},u) is a vector containing all errors due to uncertanties, disturbances and fault signals.

To design a SMO it is necessary to write the model in variable states form. Let x1=[q1q2q3q4q5q6q7]Tx_{1}=[q_{1}\;q_{2}\;q_{3}\;q_{4}\;q_{5}\;q_{6}\;q_{7}]^{T} and x2=[q˙1q˙2q˙3q˙4q˙5q˙6q˙7]Tx_{2}=[\dot{q}_{1}\;\dot{q}_{2}\;\dot{q}_{3}\;\dot{q}_{4}\;\dot{q}_{5}\;\dot{q}_{6}\;\dot{q}_{7}]^{T} be the state variables. Then (1) can be written as:

x˙1\displaystyle\dot{x}_{1} =\displaystyle= x2\displaystyle x_{2} (2)
x˙2\displaystyle\dot{x}_{2} =\displaystyle= M1(q)(C(q,q˙)q˙+Bq˙+G(q)+Δ(q,q˙,u)u)\displaystyle-M^{-1}(q)\left(C(q,\dot{q})\dot{q}+B\dot{q}+G(q)+\Delta(q,\dot{q},u)-u\right) (3)

Equation (3) can also be written in the form:

x˙2=f(x1,x2,u)+ϕ(x1,x2,u)\dot{x}_{2}=f(x_{1},x_{2},u)+\phi(x_{1},x_{2},u)

where f(x1,x2,u)=M1(q)(C(q,q˙)q˙+Bq˙+G(q)u)7f(x_{1},x_{2},u)=-M^{-1}(q)\left(C(q,\dot{q})\dot{q}+B\dot{q}+G(q)-u\right)\in\mathbb{R}^{7} is the nominal part and ϕ(x1,x2,u)7\phi(x_{1},x_{2},u)\in\mathbb{R}^{7} contains all terms related to uncertainties, disturbances and fault signals. If the system is correctly identified, and assuming we have no other disturbances than the object being carried, then ϕ(x1,x2,u)\phi(x_{1},x_{2},u) corresponds only to the fault signals, which, in this work, will be caused by the weight of the object being manipulated.

Thus, if we reconstruct the signal ϕ\phi we will be able to estimate the mass of the manipulated object.

3.2 Observer for Disturbance Reconstruction

If a SMO is used to estimate the joint speeds, the unknown term ϕ(x1,x2,u)\phi(x_{1},x_{2},u) in (2)-(3) can be reconstructed by an appropriate filtering of the output error injection term. We used the observer proposed by [9]:

x^˙1\displaystyle\dot{\hat{x}}_{1} =\displaystyle= x^2+z1\displaystyle\hat{x}_{2}+z_{1} (4)
x^˙2\displaystyle\dot{\hat{x}}_{2} =\displaystyle= f(x1,x^2,u)+z2\displaystyle f(x_{1},\hat{x}_{2},u)+z_{2} (5)

where z1z_{1} and z2z_{2} are the output error injection terms calculated as

z1=[z11z17]=[λ|q1q^1|1/2sign(q1q^1)λ|q7q^7|1/2sign(q7q^7)]z_{1}=\left[\begin{tabular}[]{c}$z_{11}$\\ $\vdots$\\ $z_{17}$\end{tabular}\right]=\left[\begin{tabular}[]{c}$\lambda|q_{1}-\hat{q}_{1}|^{1/2}sign(q_{1}-\hat{q}_{1})$\\ $\vdots$\\ $\lambda|q_{7}-\hat{q}_{7}|^{1/2}sign(q_{7}-\hat{q}_{7})$\end{tabular}\right]
z2=[z21z27]=[αsign(q1q^1)αsign(q7q^7)]z_{2}=\left[\begin{tabular}[]{c}$z_{21}$\\ $\vdots$\\ $z_{27}$\end{tabular}\right]=\left[\begin{tabular}[]{c}$\alpha sign(q_{1}-\hat{q}_{1})$\\ $\vdots$\\ $\alpha sign(q_{7}-\hat{q}_{7})$\end{tabular}\right]

In this observer, the sliding surface is given by σ=x2x^2\sigma=x_{2}-\hat{x}_{2}. When the sliding mode is reached, it holds that:

σ=σ˙=x˙2x^˙2=f(x1,x2,u)+ϕ(x1,x2,u)f(x1,x^2,u)z2eq=0\sigma=\dot{\sigma}=\dot{x}_{2}-\dot{\hat{x}}_{2}=f(x_{1},x_{2},u)+\phi(x_{1},x_{2},u)-f(x_{1},\hat{x}_{2},u)-z_{2_{eq}}=0

Since, x2=x^2x_{2}=\hat{x}_{2}, then

z2eq=[z21eqz27eq]=ϕ(x1,x2,u)=[ϕ1(q1,,q7,q˙1,,q˙7,u1,,u7)ϕ7(q1,,q7,q˙1,,q˙7,u1,,u7)]z_{2_{eq}}=\left[\begin{tabular}[]{c}$z_{21_{eq}}$\\ $\vdots$\\ $z_{27_{eq}}$\end{tabular}\right]=\phi(x_{1},x_{2},u)=\left[\begin{tabular}[]{c}$\phi_{1}(q_{1},\dots,q_{7},\dot{q}_{1},\dots,\dot{q}_{7},u_{1},\dots,u_{7})$\\ $\vdots$\\ $\phi_{7}(q_{1},\dots,q_{7},\dot{q}_{1},\dots,\dot{q}_{7},u_{1},\dots,u_{7})$\end{tabular}\right] (6)

where z2eqz_{2_{eq}} is the equivalent output error injection which can be obtained by an appropriate low-pass filtering of z2z_{2}.

Noisy and low sampling frequency rates can cause chattering effects on the estimated states. To mitigate this effect on mass estimation, the output error injection will be low-pass filtered. However, if estimated states are used for a closed-loop control, then actuator signals will have high frequency components that will result in hardware damage. Thus, as it will be later discussed, the SMO is used to estimate the fault signal but, to implement a closed-loop control, an Extended Kalman Filter is used instead.

3.3 Mass estimation

The term ϕ(x1,x2,u)\phi(x_{1},x_{2},u) in equation (3) is a function of input torque, joint positions and joint speeds. The mass of the object could be calculated in any point of the state space, nevertheless, calculations are much simpler if such estimation is made only when the manipulator is in a constant position. If q˙=q¨=0\dot{q}=\ddot{q}=0, then ϕ(x1,x2,u)=ϕ(q)\phi(x_{1},x_{2},u)=\phi(q) depends only on the gravitational torques caused by the weight of the object being carried. From (3) we can see that disturbance ϕ\phi is a signal of acceleration, not a torque signal. Let τo=[τo1,,τo7]T\tau_{o}=[\tau_{o}1,\dots,\tau_{o}7]^{T} be the torque exerted by the manipulated object with mass mom_{o} and weight wo=mogw_{o}=m_{o}g on each joint. Vector τo\tau_{o} can be obtained by multiplying signal ϕ\phi by the inertia matrix M(q)M(q). Thus, from equation (6):

τo=M(q)ϕ(q)=M(q)z2eq\tau_{o}=M(q)\phi(q)=M(q)z_{2_{e}q} (7)

Figure 2(a) shows torques τo\tau_{o} on the different joints. Torques are zero where the weight force is applied along the axis of rotation. In figure 2(a) this is the case for joints O3O_{3}, O5O_{5} and O7O_{7}.

Refer to caption
(a) Torques τo\tau_{o} on each joint.
Refer to caption
(b) Calculation of mom_{o} from τ6\tau_{6}.
Figure 2: Variables and frames to calculate mom_{o}.

Torques τo\tau_{o} are caused by the weight of the object being carried and thus they can be obtained in a form similar to term G(q)G(q) in model (1). The mass mom_{o} can be estimated from any component of τo\tau_{o}, nevertheless, due to the kinematic configuration, it is much easier if we use torque on joint O6O_{6}.

Consider the figure 2(b). The frame O6O_{6}, attached to joint 6, is the frame O0O_{0} translated and rotated. To represent the rotation we used the Roll-Pitch-Yaw angles (ρ,θ,ψ)(\rho,\theta,\psi). As it can be seen, the weight wo=mogw_{o}=m_{o}g causes the torque τ6=mogl4sinθ\tau_{6}=-m_{o}gl_{4}\sin\theta and the mass of the manipulated object can thus be calculated as:

mo=τ6gl4sinθm_{o}=-\frac{\tau_{6}}{gl_{4}\sin\theta} (8)

where θ\theta is the pitch angle of frame O6O_{6} w.r.t. O0O_{0}, gg is the gravity acceleration, τ6\tau_{6} is the disturbance torque calculated according to (7) and l4l_{4} is the distance from joint O6O_{6} to the center of mass of the manipulated object. As it will be latter explained, errors in the estimation of l4l_{4} will cause proportional errors in the estimation of mom_{o}.

Note that when θ=0\theta=0 it is not possible to estimate mom_{o} because θ=0\theta=0 means that the manipulated object is “hanging” from the joint and its weight is not exerting any torque on the joint. There are two possible ways to overcome this situation: use another disturbance τi\tau_{i} or moving the manipulator to a useful position. The second option is more feasible since the relation between wow_{o} and τi\tau_{i} becomes more complex in the rest of the joints.

3.4 Extended Kalman Filter

Sliding Mode Observer have the great advantage of being robust against disturbances, nevertheless, due to the discontinuos ouput error injection, they can have high frequency components in the estimated states. SMOs are useful for fault reconstruction but, due to the noise and low frequency sampling rate, it is better to use an Extended Kalman Filter (EKF) as part of the closed-loop control strategy.

From (2)-(3), we have the state transition model for the noisy system:

x˙1\displaystyle\dot{x}_{1} =\displaystyle= x2+ν1\displaystyle x_{2}+\nu_{1} (9)
x˙2\displaystyle\dot{x}_{2} =\displaystyle= f(x1,x2,u)+ϕ(x1,x2,u)+ν2\displaystyle f(x_{1},x_{2},u)+\phi(x_{1},x_{2},u)+\nu_{2} (10)

where ν14\nu\in\mathbb{R}^{1}4 is a vector of noise signals without temporal correlation, zero mean and covariance matrix Q14×14Q\in\mathbb{R}^{14\times 14}. Remember that system state variables are the seven joint positions and seven joint speeds.

In this work, since we are measuring the joint positions, our observation model is:

z=h(x,u)+ω=[q1,,q7]T+ωz=h(x,u)+\omega=[q_{1},\dots,q_{7}]^{T}+\omega (11)

where ω7\omega\in\mathbb{R}^{7} is Gaussian noise without temporal correlation, zero mean and covariance matrix R7×7R\in\mathbb{R}^{7\times 7}.

Chosing between the continuous or discrete version of the EKF depends on the frequency sampling. In this work we achieved a sampling of 250 Hz, which is much faster than the system dynamics, but too slow for a SMO. Also, since Simulink provide tools for continuos controls, we chose the continuos version of the EKF:

x^˙1\displaystyle\dot{\hat{x}}_{1} =\displaystyle= x^2+K1y1\displaystyle\hat{x}_{2}+K_{1}y_{1} (12)
x^˙2\displaystyle\dot{\hat{x}}_{2} =\displaystyle= f(x^1,x^2,u)+K2y2\displaystyle f(\hat{x}_{1},\hat{x}_{2},u)+K_{2}y_{2} (13)
P˙\displaystyle\dot{P} =\displaystyle= FP+PFTKRKT+Q\displaystyle FP+PF^{T}-KRK^{T}+Q (14)

where y=zx^1y=z-\hat{x}_{1} is the error between the estimated and measured outputs, FF is the Jacobian of the state transition model and KK is the Kalman Gain calculated as:

K=PHTR1K=PH^{T}R^{-1}

with H7×14H\in\mathbb{R}^{7\times 14}, the Jacobian of the observation model, which, in this case, is the constant matrix:

H=[0I7]H=\left[0\quad I_{7}\right]

Note that in (13) we are using only the nominal part of the system and thus, if ϕ0\phi\neq 0 (i.e., if an object is being manipulated), the estimated states will not converge to the real states. Since estimated states are used for position control, such estimation error will cause a steady state error in the controller. This is in principle undesirable, nevertheless, we can tolerate this error since the main goal of this work is the estimation of the mass, not the performance of the controller. Calculations to estimate mom_{o} are made under the assumption that the manipulator is in a constant position, thus, driving the manipulator to a constant qfq_{f}, although slightly different from the desired qgq_{g}, is a good enough performance for the control-observation loop.

3.5 Position control

As stated before, equations for estimating mom_{o} are derived under the assumption that the manipulator is in a constant configuration. We implemented a PD+Gravity controller using the EKF estimated states:

u=G(q^)+Kp(qdq^)+Kd(q˙dq˙^)u=G(\hat{q})+K_{p}(q_{d}-\hat{q})+K_{d}(\dot{q}_{d}-\hat{\dot{q}}) (15)

where q^\hat{q} and q˙^\hat{\dot{q}} are the EKF estimated positions and speeds, respectively; G(q^)G(\hat{q}) is the vector of gravity torques of the nominal part of the model (no noise and no fault signals) and

As explained in the previous section, when the manipulator takes an object, the estimated states do not converge to the real ones and then the controller shows an steady state error. Nevertheless, this is tolerable since the goal of the proposed system is not the control performance but the observer performance for the mass estimation.

To improve control performance, a trajectory is planned using a 5th degree polynomial. This type of trajectory allows to set initial and final position, speed and acceleration, which is ideal for the manipulation tasks. It is important to note that since the trajectories are calculated in joint space, the cartesian movement of the end effector doesn not result in a straight line. Although algorithms to plan movement task for manipulators are out of the scope of this research, we used this approach to simplify the tuning of the control constants for experimentation.

4 Simulink implementation

Refer to caption
Figure 3: The resulting model after importing URDF

Implementation of control and observer was made in Simulink mainly using the Robotics Systems Toolbox, Simscape and ROS Toolbox. We followed the suggested steps in [5, 6]. To reproduce this proposal in other robots, we recommend to read first such tutorials. In the following subsection we roughly describe this implementation.

Simulator

Most of the tests were performed first in simulation. To such purpose, we used the smimport function of Simscape Multibody to generate the corresponding rigid body tree. Figure 3 shows the resulting block diagram. As it can be seen, simulation of robot dynamics is separated from control and observation. Communication between manipulator and controller and observer is made via ROS topics in order to keep them transparent to the hardware. This way, switching between real and simulated manipulator is easy.

Quantization and noise

To achieve a simulation more similar to the conditions of the real manipulator, we added a quantization for input torque and position measurements. Dynamixel motors can read position with 12 bit resolution for 360 degrees and can set torque with 10 bit resolution. Torque resolution is not constant since it depends on motor model and battery level. The implemented simulation adds this quantization effect. An example of such quantization is shown in figure 4. Also, noise was added to joint measurements. We added a noise equivalent to ±2\pm 2 bits.

Refer to caption
(a) Continuos joint positions
Refer to caption
(b) Quantized joint position
Refer to caption
(c) Continuos input torque
Refer to caption
(d) Quantized input torque
Figure 4: Position and torque quantization

Observation and control

The Sliding Mode Observer is a copy of the system plus an output error injection term, with the form:

x^˙1\displaystyle\dot{\hat{x}}_{1} =\displaystyle= x^2+z1\displaystyle\hat{x}_{2}+z_{1} (16)
x^˙2\displaystyle\dot{\hat{x}}_{2} =\displaystyle= M1(q)(C(q,q^˙)q^˙+Bq^˙+G(q)u)+z2\displaystyle-M^{-1}(q)\left(C(q,\dot{\hat{q}})\dot{\hat{q}}+B\dot{\hat{q}}+G(q)-u\right)+z_{2} (17)

The nominal part can be derived from the lagrangian, nevertheless, the analytic form is too complex due to the number of DOF. Instead, we used the numeric solution provided by the Inverse Dynamics block from the Simulink Robotics System Toolbox library, as shown in figure 5(a). Also, from equation (7), it is necessary to compute the inertia matrix M(q)M(q) to obtain the perturbing torques ϕ\phi. Similar to the observer, instead of obtaining the algebraic expression of M(q)M(q), we used the numeric calculation provided by the Robotics System Toolbox, as shown in figure 5(b).

Refer to caption
(a) Forward Dynamics block for SMO
Refer to caption
(b) Mass Matrix block in mass estimation
Refer to caption
(c) Forward Dynamics block for EKF
Refer to caption
(d) Gravity block for PD+Control
Figure 5: Implementation using Simulink Blocks

Similar to the SMO, the EKF is a copy of the system plus an output error injection term, but in this case, such term is not discontinuous, but it is a linear gain of the error, with such linear gain calculated to minimize noise effect. As shown in figure 5(c), the forward dynamics term in equations (12)-(13) is calculated using the corresponding Robotics System Toolbox block. Figure 6 shows the block diagram of the full system as implement in Simulink.

Refer to caption
Figure 6: Block diagram of the full system implemented in Simulink

A ROS node for each task

To ease implementation with the real manipulator and integration with the rest of the subsystems, we separated every task in different ROS nodes: arm dynamics simulation, control, SMO and EKF. Signals are shared via topics and ROS parameters are used for all tuning constants. Figure 7 shows the connections between the different nodes and the ROS topics they communicate through.

Refer to caption
Figure 7: Graph diagram of ROS-nodes communications

5 Simulation results

5.1 Description of the experiment

Mass estimation was tested moving the manipulator to several positions commonly used for grasping objects. Figure 8 shows these predefined positions. It is worth to note that mass estimation will work in any configuration as long as wrist pitch θ\theta (see equation (8)) is different from zero. In a real application, it is better to estimate the mass only when |θ|>θT|\theta|>\theta_{T} where θT\theta_{T} is a threshold large enough to avoid large errors due to the division by a very small value of θ\theta. In this work, we used θT=0.2\theta_{T}=0.2.

Frequency sampling was set to 250 Hz. This value is the frequency achieved with the real manipulator. Dynamixel servomotors were configured to 1 Mbps of baudrate and we have nine motors in the manipulator: seven motors for the seven degrees of freedom, and two more for the manipulator. Considering the total number of bytes to be sent and received, the required time is in the order of 1 ms, nevertheless, smallest configurable USB latency in Ubuntu is 1 ms, which needs to be added to the time for sending and receiving RS485 data. 4 ms was chosen as approximately twice the time required to send torques and read positions from all motors. This frequency was set both for tests with real and simulated manipulator.

Refer to caption
Figure 8: Positions used for testing masss estimation

Experiment for mass estimation was made simulating an object with mass m=0.25m=0.25 located at the center of the gripper. We used the constants shown in table 1, where I14I_{14} and I7I_{7} represent identity matrices of orders 14 and 7 respectively. To filter the output error injection term of the SMO we used a 4th degree Butterworth Low-Pass filter with cutoff frequency of 1 Hz.

SMO EKF Control Mass Est
λ=6.0\lambda=6.0 Q=0.003I14Q=0.003I_{14} Kp=2.5K_{p}=2.5 l4=0.21l_{4}=0.21
α=4.2\alpha=4.2 R=0.001I7R=0.001I_{7} Kd=0.5K_{d}=0.5
Table 1: Constants for control and observation

5.2 Mass estimation

Figure 9 shows the results for the estimation and filtering of the angular position while moving the arm to one of the predefined positions. As it can be observed, the measured position is noisy and does not converge to the desired position, nevertheless, this is an expected behavior. As explained before, the objective of this work is the mass estimation of the manipulated object, not the performance of the controller. In the presence of the fault signal (an object in the end effector), the controller shows steady state error. Comparing the estimated positions between the SMO and the EKF, we can see that the SMO-estimated positions perfectly track the measured positions, since in general, SMOs are designed to be robust against faults and disturbances, nevertheless, SMO-estimated positions show the problem of chattering. Instead, EKF-estimated positions show an steady-state error but do not show chattering nor noise, making them more suitable for implementing the PD+ control.

Refer to caption
Refer to caption
Refer to caption
Refer to caption
Refer to caption
Refer to caption
Refer to caption
Figure 9: Comparison of measured, goal and estimated positions.

Figure 10 shows the results for the estimation of the angular speeds. Although in the real manipulator we don’t have a measurement of the joint speed, we included the simulated speed for testing purposes. As it can be seen, current speed does not converge to the desired one. Same as the angular position, this error is due to the simplicity of the controller. Similar to the positions, the SMO-estimated speeds are nearer to the current speeds but with the problem of big chattering. Instead, the EKF-estimated speeds show a big error but without noise, which makes them better to be used in the controller.

Refer to caption
Refer to caption
Refer to caption
Refer to caption
Refer to caption
Refer to caption
Refer to caption
Figure 10: Comparison of simulated, goal and estimated joint speeds.

Finally, figure 11 shows the resulting estimated mass. As explained in section 3.3, in this work we make the mass estimation only when the manipulator is in a constant position. Ideally, estimations should be made only when q˙=0\dot{q}=0, nevertheless, this is a hard condition. Instead, we set estimated mass to zero if q˙>0.5\|\dot{q}\|>0.5, that is why in figure 11 the estimation is equal to zero for the first few seconds. As soon as the arm stops, the estimated value converges to 0.25 kg, the actual mass of the object.

Refer to caption
Figure 11: Mass estimation results.

5.3 Sources of estimation errors

There are two possible causes of errors in the estimation: uncertanties in the physical parameters (link masses and inertia, joint frictions, etc) and the position of the object along the gripper. In this work it is assumed that the system is correctly identified, nevertheless, sometimes this assumption could not be held, specially in complex systems such as the 7-DOF manipulator. In order to analyze the effect of parameter uncertainties in the estimation, we ran simulations with wrong parameter values. That is, the term f(x1,x^2,u)f(x_{1},\hat{x}_{2},u) in (16)-(17) is calculated with the wrong parameters but measurements qq come from the system simulated with the correct values. Figure 12(a) shows the estimation results using link masses and inertia with values 20% smaller than the nominal ones. As it can be seen, the system overestimates the mass value. The torque exerted on each joint is caused by the link mass and the manipulated object. If such link mass is smaller, then the exerted torque will be attributed to the manipulated object. The contrary effect happens when the physical parameters are overestimated, as shown in figure 12(b).

Refer to caption
(a) Undervalued 20%
Refer to caption
(b) Overvalued 20%
Refer to caption
(c) Correct values
Figure 12: Effect of parameter uncertanties
Refer to caption
Refer to caption
(a) l4=0.21l_{4}=0.21 m
Refer to caption
Refer to caption
(b) l4=0.18l_{4}=0.18 m
Refer to caption
Refer to caption
(c) l4=0.24l_{4}=0.24 m
Figure 13: Effect of object position along gripper in mass estimation

According to equation (8), we need to know the distance l4l_{4} for a correct mass estimation. This distance depends on the object position along the gripper. We always assume that the object is gripped in the center of the end effector, nevertheless, there could be a small error in this assumption. The error in the estimated mass will be proportional to the error in the estimation of l4l_{4}. Figure 13 shows the estimated values for three different values of l4l_{4}. As it can be seen, the greater the distance l4l_{4}, the greater is the torque exerted on the joint with the same object mass and a greater value of mass is estimated. At this stage of the project, we don’t have a way to determine the position of the object along the gripper, nevertheless, for the goal application of this project, the errors in estimation are tolerable.

6 Reusability

To reproduce the results presented in this work, the following rough steps should be followed:

  1. 1.

    Get the URDF file of the manipulator and import it using the Simulink Robotics Toolbox. If the full robot URDF is available, the manipulator part should be isolated in order to make calculation faster.

  2. 2.

    Identify the joint with the following features:

    • The joint must have an axis of rotation perpendicular (or nearly perpendicular) to the gravity vector.

    • The joint should be the nearest one to the end effector with the previous feature.

    And get the distance from the previous joint to the center of the end effector.

  3. 3.

    Implement SMO and use equation (8) to estimate object mass.

To illustrate these steps, we will reproduce the results using the description of Katana Manipulator (https://wiki.ros.org/katana_driver).

Get and import the URDF

We imported the URDF from the GitHub Katana repository. Most robot descriptions are given using xacro formats, but the ROS Xacro package can be used to get the corresponding URDF, since Robotics System Toolbox and Simscape can only import URDF files. We used Simscape to import the URDF and we added the corresponding ROS publisher and subscriber for measured joint positions and torques respectively. Figure 14 shows the manipulator as imported by Simscape, with ROS publishers and subscribers and the system as displayed in the Mechanics Explorer.

Refer to caption
(a) Imported Simscape Multibody model.
Refer to caption
(b) Manipulator with the corresponding publishers and subscribers.
Refer to caption
(c) Manipulator as shown in the Mechanics Explorer.
Figure 14: Importing Katana URDF to Simulink

Chosing the correct joint to estimate mass

In this work we used the wrist pitch of our manipulator to estimate object mass. Using the observer (16)-(17), we reconstructed the fault signals ϕ(x1,x2,u)\phi(x_{1},x_{2},u), after that, using equation (7) we get the torques exerted on each joint. Finally, using torque on joint 6 (wrist pitch) and equation (8), we get the estimated mass of the manipulated object. The joint of the wrist pitch fulfills the two features previously mentioned: it is the nearest joint to the end effector whose rotation axis is perpendicular to the gravity vector.

In the case of the Katana manipulator, the joint with these features is katana_motor4_lift_link and thus, the fault torque associated to this joint will be used in equation (8). Figure 15 shows the equivalent variables in the Katana Manipulator for mass estimation. Angle θ\theta can be calculated using the Euler Angles of the rotation from katana_base_frame to katana_motor4_lift_link. Robotics System Toolbox provides the needed blocks to calculate this angle. Distance l4l_{4} can be obtained from URDF or by directly measuring it.

Refer to caption
Figure 15: Katana equivalent variables for mass estimation

SMO implementation and mass estimation

Once we identified the ideal joint for mass estimation, we imported the URDF file to get a Rigid Body Tree using the importrobot function of the Robotics System Toolbox. We implemented the SMO and mass estimator using the Forward Dynamics and Mass Matrix block as shown in figure 5(b) (see explanation in section 4). We simulated an object with a mass of 200 g. To simplify simulations, we did not implement a control but we used only a constant torque applied to the joints. Figure 16 shows the resulting estimation.

Refer to caption
Figure 16: Mass estimation results with the Katana Manipulator

All files and instructions necessary to reproduce the results presented in this work can be found in
https://github.com/RobotJustina/RCF-MathWorks-2020-14/.

7 Conclusions

In this work we presented a method for estimating the mass of the object being manipulated in a domestic service robot. The estimation is based on model based fault reconstruction techniques using sliding mode observer. The implementation of model-based algorithms could be very complicated in complex systems such as the 7 DOF manipulator used in this proposal; nevertheless, the use of Simulink, Robotics System Toolbox, Simscape and ROS Toolbox, which provide numerical solutions to the system dynamics, allowed the implementation of such model-based techniques. We presented simulation results where we show the effectiveness of our proposal. Also, we discussed the cases where this approach can lead to a wrong estimation. To show the possible reusability of our proposal, we replicated some of the results in a simulated Katana manipulator.

Further tests should be made for an implementation in the real manipulator. For example, in this work we assumed that only linear friction is present in the motor, nevertheless, Dynamixel motors present also non linear frictions, which must be modeled and identified for a correct performance. Also, better controllers can be implemented to reach faster the steady state. A shorter settle time will result in a faster mass estimation.

As a future work, different techniques can be implemented. Another model-based option is the use of the implemented Extended Kalman Filter. As shown in section 5, the EKF estimated speeds have a steady state error due to the fault signal. This estimated speeds can also be used to estimate the manipulated object mass. On the other hand, model-free techniques can also be implemented, such as neural networks. Input torques and measured positions can be taken as input data to train a NN whose output is the estimated mass.

Finally, this proposal will be integrated with the rest of subsystems of our domestic service robot in the context of the Robocup@Home tests.

References

  • [1] H. Alwi, C. Edwards, and C. P. Tan. Fault detection and fault-tolerant control using sliding modes. Springer Science & Business Media, 2011.
  • [2] J. Davila, L. Fridman, and A. Levant. Second-order sliding-mode observer for mechanical systems. IEEE transactions on automatic control, 50(11):1785–1789, 2005.
  • [3] S. X. Ding. Model-based fault diagnosis techniques: design schemes, algorithms, and tools. Springer Science & Business Media, 2013.
  • [4] L. Fridman, A. Levant, et al. Higher order sliding modes. Sliding mode control in engineering, 11:53–102, 2002.
  • [5] MathWorks-Students-Competitions-Team. Designing robot manipulator algorithms (https://github.com/mathworks-robotics/designing-robot-manipulator-algorithms). GitHub. Retrieved April 6, 2020., 2020.
  • [6] MathWorks-Students-Competitions-Team. Trajectory planning for robot manipulators (https://github.com/mathworks-robotics/trajectory-planning-robot-manipulators). GitHub. Retrieved April 6, 2020., 2020.
  • [7] R. Memmesheimer, I. Mykhalchyshyna, N. Wettengel, T. Evers, L. Buchhold, P. Schmidt, N. Schmidt, I. Germann, M. Mints, G. Rettler, C. Korbach, R. Bartsch, I. Kuhlmann, T. Weiland, and D. Paulus. Robocup 2019 - homer@unikoblenz. https://github.com/RoboCupAtHome/AtHomeCommunityWiki/wiki/
    files/tdp/2019-opl-homeratunikoblenz.pdf, 2019.
  • [8] J. Savage, A. LLarena, G. Carrera, S. Cuellar, D. Esparza, Y. Minami, and U. Peñuelas. Virbot: a system for the operation of mobile robots. In RoboCup 2007: Robot Soccer World Cup XI, pages 512–519. Springer, 2008.
  • [9] Y. Shtessel, C. Edwards, L. Fridman, and A. Levant. Sliding mode control and observation. Springer, 2014.
  • [10] M. Van Der Burgh, J. Lunenburg, L. van Beek, J. Geijsberts, L. Janssen, S. Aleksandrov, K. Dang, van Rooy H., A. Hofkamp, D. van Dinther, A. Aggarwal, and M. van de Molengraft. Tech united eindhoven @home 2019 team description paper. https://github.com/RoboCupAtHome/AtHomeCommunityWiki/wiki/
    files/tdp/2019-dspl-techunited_eindhoven.pdf, 2019.
  • [11] S. Wachsmuth, D. Holz, M. Rudinac, and J. Ruiz-del Solar. Robocup@ home-benchmarking domestic service robots. In AAAI, pages 4328–4329, 2015.
  • [12] M. Williams, B. Johnston, S. Pfeiffer, J. Vitale, J. Clark, L. Kang, D. Ebrahimian, S. Leong, R. Billingsley, M. Tonkin, S. Herse, S. Alam, S. Gudi, and S. Ojha. Uts unleashed! 2019 robocup@home social spl. https://github.com/RoboCupAtHome/AtHomeCommunityWiki/wiki/
    files/tdp/2019-sspl-uts_unleashed_.pdf, 2019.