# Conceptual Design of BCI for Mobile Robot Control
## 2 Materials and Methods
### Design of BCI Control System  
The design process of BCI control system of the mobile robot (MR) also contains two stages, i.e., conceptual and detailed design phases. The conceptual model of the BCI control system is presented in form (5) of HS coordinator (\(S_{0}^{\ell}\)) briefly described above in Section 2.1 as well as in another work [2]. Aggregated dynamic model \(\omega_{0}^{\ell}\) of the BCI control system (\(S_{0}^{\ell}\)) is built on the relation of the control system inputs \(X_{0t}^{\ell}\), outputs \(Y_{0t}^{\ell}\) and states \(C_{0t}^{\ell}\), presented in the following \((\overline{\rho},\overline{\varphi})_{0}^{\ell}\) form:  
\[ \begin{array}{l}(\overline{\rho},\overline{\varphi})_{0}^{\ell}:\overline{ \rho}_{0}^{\ell}=\left\{\rho_{0t}:C_{0t}\times X_{0t}\to Y_{0t}\&\xi t\in T \right\}^{\ell}\\ \overline{\varphi}_{0}^{\ell}=\left\{\rho_{0}\rho_{0t^{\prime}}:C_{0t}\times X _{0t^{\prime\prime}}\to C_{0t^{\prime\prime}}\&t^{\prime}\in T\&t^{\prime}>t \right\}^{\ell}\end{array}  \tag{10}\]  
Figure 6: (a) cap for EEG of Deymed Diagnostic company; (b) 19 chlorine silver, reference and grounding electrodes; (c) subject (man-operator) being examined. The inputs \(X_{0}\) and outputs \(Y_{0}\) of the coordinator of \(\ell-1\) level are defined on the sets of its coordination signals \(G\) and feedbacks \(W\) as follows:  
\[X_{0}^{\ell-1}=\{G^{\ell},W^{\ell-1}\},\,Y_{0}^{\ell-1}=\{G^{\ell-1},W^{\ell}\}, \tag{11}\]  
As for the control system of Mindsorms mobile robot (Figure 7), it is presented by the internal control unit NXT 2.0 (which consists of ARM7 and AVR microcontrollers) and BCI control PC in the form of the coordinator according to the scheme presented in Figure 1 (Section 2.1). In Figure 7, \(G^{\ell-1}\) are coordination signals from the internal NXT 2.0 control unit of the MR to \({\rm MR}_{o}S_{4}\) actuating systems, i.e., servos and wheels. The MR position measured by MR encoder with 1 degree precision is a feedback \(W^{\ell-1}\) from MR actuating systems \({}_{o}S_{4}\) to NXT 2.0 control unit \({}_{4}S_{0}\); \(W^{\ell}\) is a feedback from MR, i.e., NXT 2.0 control unit, to the BCI PC control system \(S_{0}\) of higher level \(\ell\). \(G^{\ell}\) are the control signals from control PC \(S_{0}\) to mobile robot \({}_{4}S^{\ell-1}\). The NXT 2.0 controller \({}_{4}S_{0}\) is directly connected by its input \(X^{\ell}=(G^{\ell},W^{\ell-1})\) and output \(Y^{\ell}=(G^{\ell-1},W^{\ell})\) with the MR actuating systems and with the higher level \(\ell\) coordinator \(S_{0}\), i.e., BCI PC design and control system, where \((G^{\ell-1},\,W^{\ell-1})\) and \((G^{\ell},\,W^{\ell})\) are lower level \(\ell-1\) and higher level \(\ell\) coordination \(G\) and feedback \(W\) signals respectively. Communication of the BCI PC control system \(S_{0}\) with lower \(\ell-1\) level NXT 2.0 control unit \({}_{4}S_{0}\) of Mindsorms mobile robot is realized on the program level with the help of _RWTH--Mindstorms NXT Toolbox_ integrated in _MATLAB_ environment of the control PC. Control \(G^{\ell}\) and information \(W^{\ell}\) signals are transmitted with 12 Mbit/s speed. The transmission is possible owing to the implementation of Bluetooth 2.0 technology in NXT 2.0 control unit. Concrete values of the BCI PC control system \(S_{0}^{\ell}\) inputs \(X_{0}^{\ell}\), outputs \(Y_{0}^{\ell}\) and states \(C_{0}^{\ell}\) are defined and detailed in the design phase and described below. A concrete model of BCI control system \(S_{0}^{\ell}\) was implemented in the form of finite state machine [14] at the detailed design phase according to its conceptual model. Finite state machine model of BCI control system (CS) was implemented within the frameworks of Matlab program system using Simulink Stateflow module. To implement control algorithms by generating control codes, Matlab, Simulink, and Embedded Coders were used.