# Fuzzy Friction Modeling for Adaptive Control of Mechatronic Systems

Jacek Kabziński

► To cite this version:

Jacek Kabziński. Fuzzy Friction Modeling for Adaptive Control of Mechatronic Systems. 8th International Conference on Artificial Intelligence Applications and Innovations (AIAI), Sep 2012, Halkidiki, Greece. pp.185-195, 10.1007/978-3-642-33409-2_20. http-01521389

HAL Id: hal-01521389

https://inria.hal.science/hal-01521389

Submitted on 11 May 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Fuzzy friction modeling for adaptive control of mechatronic systems

Jacek Kabziński,

Institute of Automatic Control, Technical University of Lodz

jacek.kabzinski@p.lodz.pl

**Abstract.** We discuss several fuzzy models to approximate friction and other disturbances in mechatronic systems, especially linear and rotary electrical drives. Some methods of experimental identification of disturbance forces are presented. We consider several fuzzy models to compromise between model accuracy and complexity. Fuzzy model is used in an adaptive control loop. Several adaptive control algorithms are discussed and the influence of fuzzy model accuracy on the system performance is investigated.

**Keywords:** fuzzy modeling, adaptive control, motion control, friction compensation.

## 1 Introduction

It is well recognized that the presence of friction often destructs a performance of a precision motion control systems, especially servo drives realizing tracking tasks. The friction phenomenon is rather complicated and not yet completely understood, so existing friction models are also far from universality and accuracy. In this contribution we propose to connect fuzzy modeling with adaptive control. This approach allows to connect the simplicity of static friction models with the accuracy offered by adaptation to changing conditions, such as a lubricant temperature for example. As the experimental information about friction is usually corrupted and inaccurate we believe that using a flexible fuzzy model connected with adaptation of its parameters is an effective approach.

We consider the motion dynamics given by

$$ \frac{dx}{dt} = v \quad m \frac{dv}{dt} = F_e - F_{\text{friction}} - F_{\text{ext}}. \qquad (1) $$

where *m* is a forcer mass, *F*<sub>e</sub> is a thrust force, *F*<sub>ext</sub> is external force, load (usually constant or slow-varying) and *F*<sub>friction</sub> represents all kinds of friction forces. The mover speed is *v* and position *x*. Although equation (1) is written according to linear motion convention, it may be also used for rotational movement description if we read *m* as a moment of inertia and consider torques instead of forces.

In this paper we shortly present the basic friction models and discuss the problem of experimental acquisition of the friction force data. We propose a TSK fuzzy
model-based friction estimation structure that can be used for real-time nonlinear friction identification. We introduce a procedure to automatically decide the fuzzy model rules and starting parameters according to the desired modeling accuracy. Finally we apply friction fuzzy model in adaptive backstepping control assuring the position tracking stability without exact knowledge of all plant parameters, including the control gain coefficient. The presented contribution may be placed among many other concerning fuzzy adaptive control in presence of friction [1,2,3], but it develops a new and simpler (than for example in [1]) fuzzy model construction procedure and investigates new adaptive control approach.

## 2 Friction Models

Several models where proposed for friction forces. An excellent review is provided in [4]. As we claim that an approximated model should be connected with adaptive control approach, we mention only basic ideas here. Usually it is assumed that friction forces are speed dependent and are roughly described by the formula

$$F_{\text{friction}} = [f_c + (f_s - f_c)g(v)]\text{sign}(v) + Bv, \quad g(v) = e^{-\left(\frac{|v|}{v_s}\right)^\delta} \quad (2)$$

where $f_s$ is the level of static friction, $f_c$ is the minimum level of Coulomb friction $v_s$ is the lubricant parameter (so called Stribeck velocity), $B$ - viscous friction parameter and $\delta$ is an even constant. The function $g(v)$ describing a characteristic of the Stribeck curve is only one of possibilities – several other are reported [4]. All parameters of this model are unknown and should be determined by empirical experiments, and still the model accuracy is doubtful. The simplified version of (2) takes into account only Coulomb and viscous friction:

$$F_{\text{friction}} = f_c \text{sign}(v) + Bv. \quad (3)$$

So called LuGre [1] dynamic friction model is supposed to capture most of the real friction behaviour, like Stribeck effect, hysteresis, spring-like characteristics, varying brake-away force. It is based on ‘elastic bristles’ model of contact surfaces. The average deflection $z$ of the bristles is given by

$$\dot{z}(t) = v - \frac{|v|z}{g(v)}. \quad (4)$$

where $g(v)$ is a positive function. To describe Stribeck effect $g(v)$ is usually chosen as

$$g(v) = \frac{1}{\sigma} \left[ f_c + (f_s - f_c) e^{-\left(\frac{|v|}{v_s}\right)^\delta} \right]. \quad (5)$$

Friction force is given by
$$F_{\text{friction}} = \sigma z + \tau \dot{z} + Bv. \qquad (6)$$

where $\sigma$ is the equivalent stiffness coefficient and $\tau$ is the equivalent damping coefficient of bristles. Several other models (more complicated, with bigger number of parameters and more difficult to identify) of friction forces are reported in literature [2,3]. As it follows from the above discussion friction and ripple forces are of very complicated nature, difficult to analyse and to model. In this paper we suggest modelling the sum of ripple and friction forces by a fuzzy inference system.

### 3 Acquisition of the Data for Friction Modeling

It is necessary to conduct some experiments to collect the data for the fuzzy model training.

One of possibilities is so called constant speed test. If we are able to produce a constant speed movement, it means that all the forces are balanced. If we are can measure or estimate the external force, calculate the thrust force (from measurement of motor currents for example), we are able to estimate the friction force.

Sporadically it is possible to apply a constant external force (from another drive, or from a gravitational load), while the thrust force is zero. In this case we may try to tune the friction model parameters by curve fitting comparing measured position history with numerical solution of equation (1).

Both above methods are theoretically straightforward but difficult to implement in practice. Another possibility is to use a simple observer described by:

$$\begin{aligned} m_0 \frac{d}{dt} v_{est} &= F_0 - F_{\text{fric est}} - K(v_{est} - v) \\ \frac{d}{dt} F_{\text{fric est}} &= \Gamma(v_{est} - v) \end{aligned} \qquad (7)$$

where $K$ and $\Gamma$ are design parameters, $m_0 = m + \Delta m$ and $F_0 = F_e - F_{ext} + \Delta F$ are observer parameters assumed instead of real $m$ and $F_e - F_{ext}$. If we denote the errors $e_v = v_{est} - v$, $e_F = F_{\text{fric est}} - F_{\text{friction}}$ and we measure $v + \Delta v$ instead of $v$ and assuming $F_{\text{friction}} \neq \text{const}$ we get

$$\begin{bmatrix} m + \Delta m & 0 \\ 0 & 1 \end{bmatrix} \frac{d}{dt} \begin{bmatrix} e_v(t) \\ e_F(t) \end{bmatrix} = \begin{bmatrix} -K & -1 \\ \Gamma & 0 \end{bmatrix} \begin{bmatrix} e_v(t) \\ e_F(t) \end{bmatrix} + \begin{bmatrix} \Delta F - \Delta m \frac{dv}{dt} + K \Delta v \\ \frac{dF_{\text{friction}}}{dt} \end{bmatrix}. \qquad (8)$$

As we see error dynamics is described by a linear system with disturbances. The eigenvalues $s_1, s_2$ of this system are connected with design parameters:
$$ \frac{\Gamma}{m + \Delta m} = s_1 s_2, \quad \frac{K}{m + \Delta m} = -(s_1 + s_2). \qquad (9) $$

and so we may choose values of $s_1, s_2$ to obtain desired observer dynamics. We may tune observer parameters $m_0$ and $F_0$ to minimize $e_v = v_{est} - v$, as we know $v_{est}$

and measure $v$. Equation (7) allows also to estimate the influence of $\frac{dF_{friction}}{dt}$ and

$\Delta v$ on the estimation error and to plan measurements properly. Special care must be taken to minimize $\Delta v$, as it is multiplied by $K$ in (7) and its influence cannot be decreased by increasing $K$.

As we conclude from the above discussion the obtained triples (position - velocity - estimated friction), denoted by

$$ (x_k = x_{1,k}, v_k = x_{2,k}) \rightarrow f_k \quad k \in \{1, \dots, m\}. \qquad (10) $$

will be corrupted by estimation method error and subject to estimation/measurement noise and outliers. We will develop special procedure to extract fuzzy rules to construct Takagi-Sugeno-Kang fuzzy model. Figure 1 presents about 300 triples of the data collected from an exemplary linear permanent magnet motor.

<figure><img src="image_2.png" /><figcaption>Fig. 1. Friction modelling data.</figcaption></figure>

<figure><img src="image_3.png" /><figcaption>Fig. 2. SIFM action curves for the data from fig. 1: + position, · speed.</figcaption></figure>

## 4 Fuzzy Model Construction

The proposed method of fuzzy friction modelling is based on One-dimensional Linear Local Prototypes (1dLLP) approach proposed in [5]. First we have to recognize if position is an irrelevant input or not. We consider two single-input fuzzy models (SIFM) described below:

* input - $x_i$ ($i=1$ – position, $i=2$ – velocity), output - $c_i$,

* input linguistic categories: $x_i \text{ IS } x_{i,k} \quad k \in \{1, \dots, m\}$,

* membership functions:
$$ \varphi_{i,k}(x) = \frac{1}{1 + \left(\frac{x - x_{i,k}}{a}\right)^{2b}}, \qquad (11) $$

• rules:

$$ \begin{gathered} \text{IF } x_i \text{ IS } x_{i,k} \text{ THEN } c_i = c_{i,k} = p_{i,k}x_i + q_{i,k} \\ p_{i,k} = \frac{f_k}{x_{i,k}}, \quad q_{i,k} = 0 \quad \text{if } x_{i,k} \neq 0 \qquad . \qquad (12) \\ p_{i,k} = 0, \quad q_{i,k} = f_k \quad \text{if } x_{i,k} = 0 \quad k \in \{1, \dots, m\}. \end{gathered} $$

The action curve given by the output $c_i$ of this system for the input data - $x_{i,k}$ generalises information coded by $x_{i,k} \to f_k, i=1,2$ and the degree of this generalisation depends on membership function parameter $a$. Recommendations for the choice of $a$ and $b$ are given in [5]. The shape of each action curve is robust to outliers in the measured data and to the measurement noise. If the $i$-th input is inessential the curve generated by corresponding SIFM will be flat, if it is meaningful the curve will cover significant part of the range of $\{f_k, k \in \{1, \dots, m\}\}$. Fig. 2 depicts action curves for position and speed for the data presented in fig. 1. Its visible that in this case position was the irrelevant input for friction modelling.

Selection of membership functions for each input is based on piece-wise linear approximation of action curves derived above. Uniform or mean-square approach are both applicable. As the result of piece-wise linear approximation for the $i$-th significant input we obtain $m_i$ linear local prototypes (LLP) defined on intervals

$$ I_{i,j} = (x_{\min i,j}, x_{\max i,j}) \quad j \in \{1,2,\dots,m_i\} \qquad (13) $$

by linear polynomials

$$ P_{i,j}(x_i) = p_{1,i,j}x_i + p_{0,i,j}, \quad x_i \in (x_{\min i,j}, x_{\max i,j}) \quad j \in \{1,2,\dots,m_i\} \qquad (14) $$

for each interval. The design parameter $\delta$, which defines the approximation accuracy, governs the number of linear local prototypes. For each $j$ we construct a bell-shaped functions $\mu_{i,j}(x)$ spanned over $I_{i,j}$ and centred at the middle point of $I_{i,j}$. The choice of the third parameter $b_{i,j}$ is arbitrary – usually $1.5 < b_{i,j} < 2$ gives good results. The rules for the proposed TSK fuzzy model will be:

$$ \text{IF } x_i \text{ IS } \mu_{i,j} \text{ THEN } c_i = c_{i,j} = p_{1,i,j}x_i + p_{0,i,j}, \quad j \in \{1,2,\dots,m_i\}, \qquad (15) $$

where starting values of parameters are taken from piecewise linear approximation results (14). The model will be trained by any suitable algorithm, we may choose a neural representation of the fuzzy system – ANFIS [6] and the appropriate training algorithm. Fig. 3 presents linear local prototypes obtained by linear mean-square approximation of the curve from fig.2 with $\delta=0.005$ – in this case two “sticks” were
enough. Smaller $\delta$ will impose bigger number of LLPs and so bigger number of rules.

<figure><img src="image_4.png" /><figcaption>Fig. 3. SIFM action curve for speed (solid) and piecewise linear approximation (dotted) by two LLP.</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>Fig. 4. Final fuzzy friction model (solid) and the data (++).</figcaption></figure>

In this paper we concentrate on the case when the friction is velocity-dependent and it was possible to eliminate the position as the inessential input (although the procedure of final rule selection and model construction if both inputs are important is possible as presented in [5]). So starting from this point we model friction by m velocity-dependent rules

$$IF \ v \ IS \ \mu_j \ THEN \ F_j = p_{1,j}v + p_{0,j} \ , \quad j \in \{1,2,...,m\}, \quad (16)$$

with generalised bell-shaped functions $\mu_j = \mu_j(v;a_j,b_j,c_j)$ and the output of the fuzzy model calculated as:

$$F_{mdl}(v) = \frac{\sum_{j=1}^{m} \mu_j(v) F_j(v)}{\alpha(v)} = \theta^T \zeta(v), \quad \alpha(v) := \sum_{j=1}^{m} \mu_j(v), \quad (17)$$

where

$$\theta^T = [p_{1,1}, p_{0,1}, \dots, p_{1,m}, p_{0,m}]^T, \quad \zeta(v) = \frac{1}{\alpha(v)} \begin{bmatrix} \mu_1(v)v \\ \mu_1(v) \\ \vdots \\ \mu_m(v)v \\ \mu_m(v) \end{bmatrix}. \quad (18)$$
## 5 Adaptive Control with a Fuzzy Friction Model

Several adaptive control techniques may be proposed for motion control of systems with friction, depending on details of the model description and the chosen method to prove the stability. In this contribution we describe adaptive backstepping position tracking. We also assume that the thrust force is proportional to the control variable (the motor current)

$$F_e(t) = \varphi \cdot i(t), \qquad (19)$$

and coefficient $\varphi$ is not known exactly. As the external disturbance $F_{ext}$ may be compensated exactly the same way as the friction, we assume that $F_{ext} = 0$ in equation (1). Let us denote the desired smooth position trajectory by $x_d$, actual position by $x$ and the tracking error by $e_1 = x_d - x$. The velocity will be ‘virtual control’ for position tracking. If we choose the desired velocity $v_d$ according to

$$v_d = \dot{x}_d + k_1 \cdot e_1, \qquad (20)$$

where $k_1 > 0$ is a design parameter, we will be able to describe the tracking error dynamics as

$$\dot{e}_1 = \dot{x}_d - \dot{x}_d - k_1 \cdot e_1 + e_2 = -k_1 \cdot e_1 + e_2, \qquad (21)$$

$$e_2 = v_d - v = \dot{x}_d + k_1 \cdot e_1 - v \qquad (22)$$

$$m_o \cdot \dot{e}_2 = m_o \cdot \dot{v}_d - m_o \cdot \dot{v} = m_o \cdot \dot{v}_d - i - \frac{1}{\varphi} F_{\text{friction}}, \quad m_o = \frac{m}{\varphi}, \qquad (23)$$

$$\dot{v}_d = \ddot{x}_d + k_1 \cdot (-k_1 \cdot e_1 + e_2), \qquad (24)$$

The control variable $i$ has to compensate function

$$D = m_o \cdot \dot{v}_d - \frac{1}{\varphi} F_{\text{friction}}, \qquad (25)$$

and to assure fast tracking. We will use a model $\hat{D}$ for $D$, incorporating the fuzzy friction model (17,18). The general structure of $\hat{D}$ will be given by

$$\hat{D} = \hat{A}^T \xi, \qquad (26)$$

where $\hat{A}^T$ is a vector of adaptive parameters and $\xi$ is known. We have several possibilities to choose the number of adaptive parameters, for example:
$$1 \text{ adaptive parameter: } \hat{\mathbf{A}}^T = \hat{a}, \quad \xi = \left[ m_{oN} \cdot \dot{v}_d + \frac{1}{\varphi_N} F_{mdl} \right] \qquad (27)$$

where $m_{oN}, \varphi_N$ are nominal values of $m_o, \varphi$,

$$2 \text{ adaptive parameters: } \hat{\mathbf{A}}^T = [\hat{m}_o, \hat{k}] \quad \xi = \left[ \frac{\dot{v}_d}{\varphi_N} F_{mdl} \right], \qquad (28)$$

$$2m+1 \text{ adaptive parameters: } \hat{\mathbf{A}}^T = [\hat{m}_o, \hat{\mathcal{G}}^T] \quad \xi = \left[ \frac{\dot{v}_d}{\varphi_N} \zeta \right], \qquad (29)$$

In (27) $\hat{a}$ is responsible for general model correction, in (28) $\hat{m}_o$ is supposed to adapt the changing inertia and $\hat{k}$ corrects $\frac{1}{\varphi_N} F_{mdl}$ to the actual value of $\frac{1}{\varphi} F_{friction}$, while in (29) $\hat{\mathcal{G}}^T$ corresponds to $\frac{1}{\varphi} \theta^T = \frac{1}{\varphi} [p_{1,1}, p_{0,1}, \dots, p_{1,m}, p_{0,m}]$, so corrects each fuzzy consequents' parameter separately.

Without loss of generality we may assume existence of “the best” adaptive parameters $\mathbf{A}^{*T}$ such that the model $D^* = \mathbf{A}^{*T}\xi$ gives bounded estimation error $\varepsilon = F - F^*$, $|\varepsilon| < \varepsilon_{max} < \infty$ and denote $\tilde{\mathbf{A}} = \mathbf{A}^* - \hat{\mathbf{A}}$.

If we choose the control law according to

$$i = \hat{D} + k_2 \cdot e_2 + e_1 \qquad (30)$$

we get the tracking error dynamics

$$m_o \cdot \dot{e}_2 = \varepsilon + \tilde{\mathbf{A}}^T \xi - k_2 \cdot e_2 - e_1. \qquad (31)$$

To investigate the tracking stability we propose Lyapunov function

$$V = \frac{1}{2} (e_1^2 + m_o \cdot e_2^2 + \tilde{\mathbf{A}}^T \Gamma^{-1} \tilde{\mathbf{A}}). \qquad (32)$$

with positive definite symmetric matrix $\Gamma$. Taking any of the adaptation laws

$$\dot{\tilde{\mathbf{A}}} = e_2 \Gamma \xi, \text{ or } \dot{\tilde{\mathbf{A}}} = e_2 \Gamma \xi - \delta \Gamma \mathbf{A}, \text{ or } \dot{\tilde{\mathbf{A}}} = e_2 \Gamma \xi - \delta \sqrt{e_1^2 + e_2^2} \Gamma \mathbf{A}. \qquad (33a,b,c)$$
with small positive $\delta$, we are able to prove that the system derivative of (32) is negative outside a certain, bounded set, and so $e_1, e_2$ are uniformly ultimately bounded. For example with adaptation performed according to (33a) we get

$$ \dot{V} = -k_1 \cdot e_1^2 + -k_2 \cdot e_2^2 + e_2 \cdot \varepsilon \le -k_1 e_1^2 - \left(k_2 - \frac{1}{2}\right) e_2^2 + \frac{1}{2} \varepsilon^2 \quad (34) $$

and is negative outside

$$ e_1^2 + e_2^2 > \frac{1}{k} \varepsilon_{\max}^2, \qquad k = \min\left(k_1, k_2 - \frac{1}{2}\right) \quad (35) $$

Several experiments with various adaptive controllers were conducted with the linear motor investigated in the previous sections, with fuzzy model presented in fig. 4 and adaptive laws (33a,b,c). All controllers perform correctly. More accurate fuzzy model results in smaller control signals. In fig. 5-7 we illustrate the performance of adaptive backstepping controller (28) with two adaptive parameters and adaptation law (33c).

The system was to track sinusoidal position trajectory $x_d(t) = 0.4\sin(0.8t + \frac{\pi}{4})$ with initial condition $x(0)=0$. Starting values of $m_0$ and $k_i$ were subject to about 20% error. Adaptation was blocked while the current saturation (the saturation level was 1A) was active. As we notice the tracking accuracy is very high - it is limited by the encoder performance only. The adaptive gains are bounded and approach the desired values. The control input is bounded.

<figure><img src="image_6.png" /><figcaption>Fig. 5. The tracking error history.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Fig. 6. The tracking error history – an enlarged part of fig.5.</figcaption></figure>
<figure><img src="image_8.png" /><figcaption>Fig. 7. Adaptive gains.</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Fig. 8. Motor current.</figcaption></figure>

## 5 Conclusions

The proposed approach, connecting fuzzy modeling and adaptive control, may be used for any motion control problem with friction or other disturbances. The fuzzy model is robust against measurement noise and isolated outliers in the modeling data. On-line gain adaptation by the adaptive laws allows to use a static friction model and to obtain good control performance. The proposed procedure based on linear local prototypes allows to build a fuzzy model as simple as possible. The same approach may be used if friction is function of position and speed. Some other concepts of fuzzy models – for example TSK models with nonlinear consequences were also applied by the author with promising results.

## References

1. Wang, Y., Wang, D., Chai, T.: Extraction and Adaptation of Fuzzy Rules for Friction Modeling and Control Compensation. IEEE TRANSACTIONS ON FUZZY SYSTEMS, VOL. 19, pp. 682-693 (2011)

2. Wang, Y., Wang, D., Chai, T.: Modeling and control compensation of nonlinear friction using adaptive fuzzy systems, Mechanical Systems and Signal Processing 23, pp. 2445–2457 (2009)

3. Lin, L., Lai, J.: Stable Adaptive Fuzzy Control with TSK Fuzzy Friction Estimation for Linear Drive Systems, Journal of Intelligent and Robotic Systems 38: pp. 237–253, (2003).

4. Wojewoda, J., Stefanski, A., Wiercigroch, M., Kapitaniak, T.: Hysteretic effects of dry friction: modelling and experimental studies. Phil. Trans. R. Soc. A 366, pp. 747–765 (2008)

5. Kabziński, J.: One-Dimensional Linear Local Prototypes for Effective Selection of Neuro-Fuzzy Sugeno Model Initial Structure, IFIP WG 12.5 International Conference "Artificial Intelligence Applications and Innovations. Larnaca, Cyprus Springer, IFIP Series Berlin, pp. 62 - 69 (2010)

6. Jang JR.: ANFIS: Adaptive-network-based fuzzy inference system. IEEE Trans. Syst. Man Cybern. 23, pp. 665 – 684 (1993)