## 4 Data-Based Model-Free Adaptive Controller  
An adaptive data-driven controller is proposed with a direct control scheme (Figure 4). The adaptive controller depends on the closed-loop system tracking error and the desired trajectory. The upgrade of the weight vector \(\beta(k)\) depends on the model estimator as described in this section. Defining the system's tracking error as  
\[e(k+1)\triangleq r(k+1)-y(k+1), \tag{35}\]  
where \(r(k+1)\) is the desired trajectory, we propose a MiFREN-based adaptive controller as  
\[u(k)=\varphi_{c}^{T}(k)\beta_{c}(k), \tag{36}\]  
where \(\varphi_{c}(k)\) is a multidimensional membership-function vector and \(\beta_{c}(k)\) is the weight vector for the controller. The fundamental difference of the proposed controller is found in the weight vector actualization method. The actualization will be performed with the gradient descent method and a novel cost function: the hyperbolic tangent of the tracking error multiplied by the tracking error. It is worth noticing that this is a model-free adaptive controller, and no further information on the system is required at this point. The actualization method for the weight vector \(\beta_{c}(k)\) will be discussed in more detail in this section. The upgrade law of weight vectors is defined according to the gradient descent method as  
\[\beta_{c}(k+1)=\beta_{c}(k)-\eta\left[\frac{\partial E(k+1)}{ \partial\beta_{c}(k)}\right], \tag{37}\]  
with the cost function  
\[E(k+1)=\tanh\big{(}e(k+1)\big{)}e(k+1). \tag{38}\]  
As was stated for the estimator cost function, this type of function has the advantage of being smooth near the origin, unlike functions with absolute values. The partial derivative needed for the upgrade law (37) is obtained with the chain rule  
\[\frac{\partial E(k+1)}{\partial\beta_{c}(k)} = \left[\frac{\partial E(k+1)}{\partial e(k+1)}\right]\left[\frac{ \partial e(k+1)}{\partial\beta_{c}(k)}\right],\] \[= \Big{[}\text{sech}^{2}\big{(}e(k+1)\big{)}e(k+1)+\tanh\big{(}e(k +1)\big{)}\Big{]}\bigg{[}\frac{\partial e(k+1)}{\partial\beta_{c}(k)}\bigg{]}.\]  
and the partial derivative of the tracking error regarding the weight vector is obtained as  
\[\frac{\partial e(k+1)}{\partial\beta_{c}(k)} = \left[\frac{\partial e(k+1)}{\partial y(k+1)}\right]\bigg{[} \frac{\partial y(k+1)}{\partial u(k)}\bigg{]}\bigg{[}\frac{\partial u(k)}{ \partial\beta_{c}(k)}\bigg{]},\] \[= -\bigg{[}\frac{\partial y(k+1)}{\partial u(k)}\bigg{]}\rho_{c}(k).\]  
The term \(\frac{\partial y(k+1)}{\partial u(k)}\), according to Theorem 1, is estimated as  
\[\frac{\partial y(k+1)}{\partial u(k)} \approx \frac{\partial[f(k)+g(k)u(k)+\epsilon_{h}(k)]}{\partial u(k)} \tag{39}\] \[\approx g(k)\approx\hat{g}(k).\]  
\[u(k)=\varphi_{c}^{T}(k)\beta_{c}(k), \tag{36}\]0 Model-free controller diagram. Then, the partial derivative of the cost function is approximated as  
\[u(k)=\varphi_{c}^{T}(k)\beta_{c}(k), \tag{36}\]1  
Substituting the last equation on the upgrade law (37), we obtain a feasible upgrade law  
\[u(k)=\varphi_{c}^{T}(k)\beta_{c}(k), \tag{36}\]2  
with \(h_{e}(k+1)\triangleq\operatorname{sech}^{2}\big{(}e(k+1)\big{)}e(k+1)+\tanh \big{(}e(k+1)\big{)}\). Per the stability proof for Theorem 2, the upgrade law can also be stated as  
\[u(k)=\varphi_{c}^{T}(k)\beta_{c}(k), \tag{36}\]3  
with \(|\hat{g}(k)|\leq\hat{g}_{min}\ \forall k\geq 0\). Theorem 2: _A class of non-affine non-linear discrete-time systems (1) represented in an affine way (2) is estimated as (8) if the original system (1) follows the assumptions described in Section 2. The tracking error along with the internal signals are convergent with the system estimator according to Theorem 1, the controller (36), and the upgrade law (40) or (41), if parameters are designed following the next conditions:_  
* \(g(k)\approx\hat{g}(k)\)_;_
* \(\operatorname{sign}\{g(k)\}=\operatorname{sign}\{\hat{g}(k)\}\)_;_
* \(|\varepsilon_{h}(k)|<<1\)_;_
* \(0<\eta<\frac{1}{\hat{g}_{max}^{2}||\varphi_{cm}||_{2}^{2}}\leq\frac{1}{\hat{ g}^{2}(k)||\varphi_{c}(k)||_{2}^{2}}\)_._  
Proof.