## 3 Design of Control System
### Mpc
#### 3.1.3 Design of Constraints  
QP is a typical mathematical optimization problem. The reference trajectory tracked by the omni-directional wheel chassis was quicker and smoother by adding linear or non-linear constraints. Hence, the motion performance of the omni-directional wheel chassis was improved. The linear constraints were:  
\[U_{\text{min}}\leq\Gamma\Delta U(k)+U(k-1)\leq U_{\text{max}} \tag{18}\]\[\text{where }\Gamma\ =\ \left[\begin{array}{ccc}1&0&0\\ \vdots&\ddots&0\\ 1&\cdots&1\end{array}\right]_{\text{N}_{\text{c}}\times\text{N}_{\text{c}}} \otimes\text{I}_{m}\ =\ \left[\begin{array}{ccc}\text{I}_{m}&0_{m}&0_{m}\\ \vdots&\ddots&0_{m}\\ \text{I}_{m}&\cdots&\text{I}_{m}\end{array}\right]\ (\otimes\text{ is Kronecker product}),\] \[U_{\text{min}}\ =\ \left[u_{\text{min}},u_{\text{min}},\cdots,u_{ \text{min}}\right]_{\text{1}\times\text{N}_{\text{c}}}\text{T},\ U_{\text{max}}\ =\ \left[u_{\text{max}},u_{\text{max}},\cdots,u_{\text{max}}\right]_{\text{1} \times\text{N}_{\text{c}}}\text{T},\ U(k-1)=\left[u(k-1),u(k-1),\cdots,u(k-1) \right]_{\text{1}\times\text{N}_{\text{c}}}\text{T}.\]  
Equation (17) could be rewritten as:  
\[J(k)=\left[\begin{array}{cc}\Delta U(k)^{\text{T}}&\varepsilon\end{array} \right]H(k)\left[\begin{array}{c}\Delta U(k)^{\text{T}}\\ \varepsilon\end{array}\right]+G(k)\left[\begin{array}{c}\Delta U(k)^{\text{T }}\\ \varepsilon\end{array}\right]+P(k) \tag{19}\]  
where \(E(k)=\psi(k)-Y_{ref}(k)\), \(H(k)=\left[\begin{array}{cc}\Theta(k)^{\text{T}}Q\Theta(k)&0\\ 0&\rho\end{array}\right]\), \(G(k)=\left[\begin{array}{cc}2E(k)^{\text{T}}Q\Theta(k)&0\end{array}\right]\), \(P(k)=E(k)^{\text{T}}QE(k)\).  
Equation (20) is:  
\[\left\{\begin{array}{cc}\left[\begin{array}{cc}\Gamma(k)&0\\ -\Gamma(k)&0\end{array}\right]\left[\begin{array}{c}\Delta U(k)\\ \varepsilon\end{array}\right]\leq\left[\begin{array}{c}U_{\text{min}}-U(k-1) \\ U_{\text{max}}-U(k-1)\end{array}\right]\\ \left[\begin{array}{c}\Delta U_{\text{min}}\\ 0\end{array}\right]\leq\left[\begin{array}{c}\Delta U_{\text{max}}\\ \varepsilon\end{array}\right]\leq\left[\begin{array}{c}\Delta U_{\text{max}} \\ M\end{array}\right]\end{array}\right. \tag{20}\]  
Therefore, the quadratic programming problem is:  
\[\left\{\begin{array}{c}\min(k)\rightarrow(J(k)=\left[\begin{array}{cc} \Delta U(k)^{\text{T}}&\varepsilon\end{array}\right]H(k)\left[\begin{array}{ c}\Delta U(k)^{\text{T}}\\ \varepsilon\end{array}\right]+G(k)\left[\begin{array}{c}\Delta U(k)^{\text{T }}\\ \varepsilon\end{array}\right]+P(k))\\ S.T\rightarrow\left\{\begin{array}{cc}\left[\begin{array}{cc}\Gamma(k)&0 \\ -\Gamma(k)&0\end{array}\right]\left[\begin{array}{c}\Delta U(k)\\ \varepsilon\end{array}\right]\leq\left[\begin{array}{c}U_{\text{min}}-U(k-1) \\ U_{\text{max}}-U(k-1)\end{array}\right]\\ \left[\begin{array}{c}\Delta U_{\text{min}}\\ 0\end{array}\right]\leq\left[\begin{array}{c}\Delta U(k)\\ \varepsilon\end{array}\right]\leq\left[\begin{array}{c}\Delta U_{\text{max}} \\ M\end{array}\right]\end{array}\right. \tag{21}\]  
\(\varepsilon\) is used as an independent variable, and is computed by Equation (21). A series of optimally controlled increments \(\Delta U(k)^{*}\) could be calculated in the control horizon by optimizing Equation (21) in each control cycle.  
\[\Delta U(k)^{*}=\left[\begin{array}{cc}\Delta u(k)^{*}&\Delta u(k+1)^{*}& \cdots&\Delta u(k+N_{c}-1)^{*}\end{array}\right]^{\text{T}} \tag{22}\]  
\[u(k)=u(k-1)+\Delta u(k)^{*} \tag{23}\]  
The first element acted as the actual controlled increment of \(\Delta U(k)^{*}\) in Equations (22) and (23).