## 2 Control Strategies
### Sliding Mode Lateral Stability Control
#### 2.2.3 Effort Application: Low-Level Layer
Moreover, the allocation problem is formulated to consider different steering angles of left and right front tires, \(\delta_{l}\) and \(\delta_{r}\), respectively. This is because the simulation environment makes available these values, so it is possible to consider a component that ensures a higher knowledge of vehicle dynamics. Therefore, the correcting yaw moment imposed on the torque allocator is the one described by (47). \[M_{yaw}=-\frac{t_{f}}{2}[F_{xfl}cos(\delta_{fl})-F_{xfr}cos(\delta_{fr})]-\frac {t_{r}}{2}(F_{xrl}-F_{xrr}) \tag{47}\]  
The problem formulation is given by (48), where: \(\Delta Tq=Tq-Tq^{*}\) is the vector of the difference between wheel torque demanded by the driver \(Tq_{k}\) and the ESP torque command \(Tq_{k}^{*}\) (with \(k\in\{1,2,3,4\}\) for front left, front right, rear left and rear right wheel); \(R_{wf}\) and \(R_{wr}\) are the front and rear wheel radius, respectively. Driver torques are established by the EBD, which observes the brake and throttle pedal travels, modifying these values according to longitudinal load transfer. The two rows composing (48) actually reduce the overall control solutions to \(\infty^{2}\). One DoF is removed by imposing the application of \(M_{\text{yaw}}\), ensuring the desired lateral behavior of the vehicle (first row); the second row corresponds to the need for demanding wheel torques in agreement with the driver's purpose, which removes another DoF. A Moore-Penrose pseudo-inverse methodology is adopted to select the optimal solution among all those available. The TV technique is applied to solve (49), with \(L^{+}\) the pseudo-inverse matrix of \(L\). \[L\cdot\Delta Tq= \begin{bmatrix}-\frac{t_{l}}{2R_{wf}}&\frac{t_{l}}{2R_{wf}}&- \frac{t_{l}}{2R_{wr}}&\frac{t_{r}}{2R_{wr}}\\ 1&1&1&1\\ \Delta Tq_{4}\end{bmatrix}\begin{bmatrix}\Delta Tq_{1}\\ \Delta Tq_{2}\\ \Delta Tq_{3}\\ \Delta Tq_{4}\end{bmatrix}  \tag{48}\]  
\[\Delta Tq=L^{+}\cdot \begin{bmatrix}M_{\text{zz}}\\ 0\end{bmatrix}  \tag{49}\]This solution minimizes norm 2 of the functional cost (50). \[||J_{\Delta Tq}||_{2}=\sqrt{\sum_{k=1}^{4}(Tq_{k}-Tq_{k}^{*})^{2}} \tag{50}\]  
The allocation process must also respect the actuator's constraints. Indeed, (50) is solved in 4 sequential \(k\)-steps to be compared with the upper and lower torque limit of the reference wheel. In each step, the \(k\)-th element of \(Tq^{*}\) is checked with respect to the constraints of the tire motor and brake. If these are exceeded, the value is saturated to the limit, and the solution is recalculated in the following \((k+1)\)-step, excluding from the system the row related to the \(k\)-th wheel, as defined in (51). A maximum limit of 1000 Nm for each wheel is imposed. After this stage, a single optimal solution is found, removing the last 2 DoF. \[M_{\text{yaw(k+1)}}=M_{\text{yaw(k)}}-L(k,1)\cdot\Delta Tq(k) \tag{51}\]  
It is important to point out that the longitudinal stability task, i.e., front/rear axle longitudinal effort distribution, anti-slip and anti-spin regulations, the burden on dedicated controllers (EBD, ABS, and TCS), which are already implemented in the vehicle model.