# On-Board Road Friction Estimation Technique for Autonomous Driving Vehicle-Following Maneuvers
## 5 Design of the Road-Grip Aware Control Modules
### Predictive ACC Design
Finally, additional constraints on the control input are defined for further improving the driving comfort as:  
\[\Delta u_{min}\leq\Delta u(k)\leq\Delta u_{max}. \tag{39}\]  
Given the above definitions, the constrained optimization problem to be on-line solved at each time step can be written as:  
\[\min_{\Delta U} J(y(k),\Delta U)\] (40) subject to \[x(k+1)=Ax(k)+B\Delta u(k)+Ww(k) \tag{41}\] \[y(k)=Cx(k)-Z\] (42) \[J(y(k),\Delta\mathcal{U})=\sum_{i=0}^{H_{p}-1}y_{k+i|k}^{T}Qy_{k+i|k}+\Delta u _{k+i}^{T}R\Delta u_{k+i}, \tag{34}\]0 (43) \[J(y(k),\Delta\mathcal{U})=\sum_{i=0}^{H_{p}-1}y_{k+i|k}^{T}Qy_{k+i|k}+\Delta u _{k+i}^{T}R\Delta u_{k+i}, \tag{34}\]1 (44) \[J(y(k),\Delta\mathcal{U})=\sum_{i=0}^{H_{p}-1}y_{k+i|k}^{T}Qy_{k+i|k}+\Delta u _{k+i}^{T}R\Delta u_{k+i}, \tag{34}\]2 (45) \[J(y(k),\Delta\mathcal{U})=\sum_{i=0}^{H_{p}-1}y_{k+i|k}^{T}Qy_{k+i|k}+\Delta u _{k+i}^{T}R\Delta u_{k+i}, \tag{34}\]3 (46) \[J(y(k),\Delta\mathcal{U})=\sum_{i=0}^{H_{p}-1}y_{k+i|k}^{T}Qy_{k+i|k}+\Delta u _{k+i}^{T}R\Delta u_{k+i}, \tag{34}\]4  
Evaluating the output prediction as \(y_{k+i|k}=CA^{i}x_{k}+\sum_{j=0}^{i-1}CA^{j}Bu_{k+i-1-j}-Z\) and substituting it into Equation (34), it is possible to obtain the cost \(J\) as a function of the only control sequence. Hence, after some algebraic manipulations, the cost in Equation (34) can be recasted in the following compact form:  
\[J(y(k),\Delta\mathcal{U})=\sum_{i=0}^{H_{p}-1}y_{k+i|k}^{T}Qy_{k+i|k}+\Delta u _{k+i}^{T}R\Delta u_{k+i}, \tag{34}\]5  
where \(F=\bar{R}+\bar{D}^{T}\bar{Q}\bar{D}\) and \(\Lambda=2(x(k)^{T}\bar{C}^{T}+W^{T}(k)\bar{E}^{T}-\bar{Z}^{T})\bar{Q}\bar{D}\), being \(\bar{R}=\text{diag}\{R,R,\ldots,R\}\in\mathbb{R}^{H_{L}}\), \(\bar{Q}=\text{diag}\{Q,Q,\ldots,Q\}\in\mathbb{R}^{5H_{p}\times 5H_{p}}\), \(Z=[Z^{T},Z^{T},\ldots,Z^{T}]^{T}\in\mathbb{R}^{4H_{p}\times 1}\), \(W(k)=[w(k)\ w(k)\ldots w(k)]^{T}\in\mathbb{R}^{H_{p}}\), \(\bar{C}=[(CA)^{T}\ (CA^{2})^{T}\ (CA^{2})^{T}\ldots(CA^{H_{p}})^{T}]^{T}\)\[\bar{D}= \begin{bmatrix}CB&0&\dots&0\\ CAB&CB&\dots&0\\ \vdots&\vdots&\ddots&\vdots\\ CA^{H_{p}-1}B&CA^{H_{p}-2}B&\dots&CA^{H_{p}-H_{c}}B\end{bmatrix} , \tag{49}\] \[\bar{E}= \begin{bmatrix}CW&0&\dots&0\\ CAW&CW&\dots&0\\ \vdots&\vdots&\ddots&\vdots\\ CA^{H_{p}-1}W&CA^{H_{p}-2}W&\dots&CA^{H_{p}-H_{c}}W\end{bmatrix} . \tag{50}\]  
The constraints Equations (43)-(47) can be be also recast in a compact matrix form as:  
\[\bar{H}\mathcal{X} \leq\bar{S}, \tag{51}\] \[\Delta\mathcal{U} \leq U_{max},\] (52) \[-\Delta\mathcal{U} \leq-U_{min}, \tag{53}\]  
where \(U_{max}=\Delta u_{max}\cdot 1_{H_{c}\times 1}\), \(U_{min}=\Delta u_{min}\cdot 1_{H_{c}\times 1}\), \(\bar{H}=I_{H_{p}\times H_{p}}\otimes[H-H]^{T}\), \(\bar{S}=1_{H_{p}\times 1}\otimes S\), being \(S=[d_{max}\ v_{max}\ a_{max}\ u_{max}\ -\ d_{min}\ 0\ -a_{min}\ -u_{min}]^{T}\), and  
\[H= \begin{bmatrix}1&0&0&0&0\\ 0&0&1&0&0\\ 0&0&0&1&0\\ 0&0&0&0&1\end{bmatrix} . \tag{54}\]  
Hence, substituting the state prediction \(x_{k+i|k}=A^{i}x_{k}+\sum_{j=0}^{i-1}A^{j}Bu_{k+i-1-j}\) in Equation (51), we obtain:  
\[\bar{H}B\Delta\mathcal{U} \leq\bar{S}-\bar{H}Ax_{k}-\bar{H}\bar{E}W(k), \tag{55}\] \[\Delta\mathcal{U} \leq U_{max},\] (56) \[-\Delta\mathcal{U} \leq-U_{min}. \tag{57}\]  
From Equations (48)-(55) we finally formulate the linearly constrained quadratic optimization problem in a compact form as:  
\[\min_{\Delta\mathcal{U}} J(\Delta\mathcal{U})\] (58) subject to \[G\Delta\mathcal{U}\leq\Gamma \tag{59}\]  
where \(G=[(\bar{H}\bar{B})^{T}\ I_{H_{c}}-I_{H_{c}}]^{T}\) and \(\Gamma=[(\bar{S}-\bar{H}Ax_{k}-\bar{H}\bar{E}W(k))^{T}\ U_{max}^{T}\ U_{min}^{T}]^ {T}\). One last consideration must be made about the feasibility of problem Equation (58). Indeed, due to the fact that \(d_{des}\) depends on the estimated grip ratio, at some point in time the constraint in Equation (43) could be violated, thus leading to the unfeasibility of the problem.