# Adaptive Cooperative Control of Multiple Urban Rail Trains with Position Output Constraints
## 3 Control Law Design
### Adaptive Cooperative Control Design of Multiple Trains with POC  
For the MTCC system with POC and uncertain parameters, the distributed adaptive cooperative control algorithm based on the data of neighboring trains is designed as follows:  
\[u_{i}(t)=u_{i,1}(t)+u_{i,2}(t)+u_{i,3}(t),\ i=1,2,\cdots,n \tag{5}\]  
\[u_{i,1}(t)=\hat{f}_{i}+\hat{a}_{i,1}x_{i,2}+\hat{a}_{i,2}x_{i,2}^{2}+\hat{x}_ {i,2d}-\beta_{i}\widetilde{x}_{i,2}-\alpha_{i}\frac{\widetilde{x}_{i,1}}{k_{i }^{2}-\widetilde{x}_{i,1}^{2}} \tag{6}\]  
Figure 1: The diagram of multiple urban rail trains motion. where \(\hat{f}_{i}=-\lambda_{i,1}\vec{x}_{i,2}(t)\), \(\hat{a}_{i,1}=-\lambda_{i,2}\vec{x}_{i,2}(t)x_{i,2}(t)\), and \(\hat{a}_{i,2}=-\lambda_{i,3}\vec{x}_{i,2}(t)x_{i,2}^{2}(t)\) are the parameter control laws, \(\lambda_{i}\in\{\lambda_{i,1},\lambda_{i,2},\lambda_{i,3}\}\) is the positive design parameter, \(x_{i,2d}\) is the desired speed output value, and \(\alpha_{i}>0\) and \(\beta_{i}>0\) are designed control gains. Equation (6) is the position output constrained adaptive control part, which is used to identify the unknown parameters of the train model, compensate the desired speed, limit the position output, enable the train to accurately track the desired speed and distance curve, and achieve the first term of the control objective. \(u_{i,2}(t)\) is used to maintain the safe separation distance between each train and neighboring trains, and the specific design is as follows:  
\[u_{i,2}(t)=-d_{i}\sum_{j\in N_{i}}a_{ij}\
abla_{x_{i,1}}U_{i,j} \tag{7}\]  
where \(d_{i}>0\) is the control parameter. Artificial potential field function \(U_{i,j}(x_{i,j})\) is introduced according to Definition 1. \[U_{i,j}(x_{i,j})=\frac{1}{\left\|x_{i,j}\right\|^{2}-l_{1}^{2}}+\frac{1}{l_{2} ^{2}-\left\|x_{i,j}\right\|^{2}},\;l_{1}<\left\|x_{i,j}\right\|<l_{2} \tag{8}\]  
where \(x_{i,j}=x_{i,1}-x_{j,1},l_{1}\) is the minimum safe separation distance between two neighboring trains, and \(l_{2}\) is the maximum allowable separation distance between two neighboring trains. Equation (8) can ensure that the separation distance between two neighboring trains is kept within the preset safety range of \((l_{1},l_{2})\), and the rear-end collision of two neighboring trains can be avoided. **Remark 1**. : \(u_{i,2}\) _is the negative gradient of the artificial potential field function \(U_{i,j}(x_{i,j})\), and \(u_{i,2}\) acts on the MTCC system to bring down \(U_{i,j}(x_{i,j})\). When \(x_{i,j}=\sqrt{\frac{l_{1}^{2}+l_{2}^{2}}{2}}\), the gradient information of \(U_{i,j}(x_{i,j})\) is equal to zero, at this time \(u_{i,2}=0\), that is, the stable separation distance between two neighboring trains is \(x_{i,j}=\sqrt{\frac{l_{1}^{2}+l_{2}^{2}}{2}}\)._  
\(u_{i,3}(t)\) requires the speed of each train to be consistent, and the specific design is as follows:  
\[u_{i,3}(t)=h_{i}\sum_{j\in N_{i}}a_{ij}\big{(}x_{j,2}(t)-x_{i,2}(t)\big{)} \tag{9}\]  
where \(h_{i}>0\) is the control parameter. Define position tracking error \(\vec{x}_{i,1}(t)=x_{i,1}(t)-x_{i,2d}t\) and speed tracking error \(\vec{x}_{i,2}(t)=x_{i,2}(t)-x_{i,2d}\), by applying \(u_{i}(t)\) to each train \(i\), Equation (4) can be rewritten as the following multiple trains error dynamics system. \[\left\{ \begin{array}{rl}\dot{\vec{x}}_{i,1}(t)=&\vec{x}_{i,2}(t)\\ \dot{\vec{x}}_{i,2}(t)=&\widetilde{f}_{i}+\vec{a}_{i,1}x_{i,2}(t)+\vec{a}_{i,2 }x_{i,2}^{2}(t)-\beta_{i}\vec{x}_{i,2}(t)-\alpha_{i}\frac{\vec{x}_{i,1}(t)}{| \vec{x}_{i}^{2}-\vec{x}_{i,1}^{2}(t)}\\ &-d_{i}\sum\limits_{j\in N_{i}}a_{ij}\
abla_{\vec{x}_{i,1}}\widetilde{U}_{i,j }+h_{i}\sum\limits_{j\in N_{i}}a_{ij}\big{(}\vec{x}_{j,2}(t)-\vec{x}_{i,2}(t) \big{)}\end{array} \right. \tag{10}\]  
where \(\widetilde{f}_{i}=\hat{f}_{i}-f_{i}\), \(\vec{a}_{i,1}=\hat{a}_{i,1}-a_{i,1}\) and \(\vec{a}_{i,2}=\hat{a}_{i,2}-a_{i,2}\) are the estimated error values, respectively, \(\widetilde{U}_{i,j}=U_{i,j}(\vec{x}_{i,j})\). **Theorem 1**.