## 2 Presentation of Components and Methodology  
The structure of the analysis and classification system of EEG and EMG signals presented in this paper consists of many elements. The raw EEG signal was recorded with Emotiv EPOC Flex Gel. The acquisition of measurements was performed with the dedicated EmotivPRO software. The EMG signal, in turn, is acquired using the MyoWare Muscle Sensor device, which is connected to the Arduino UNO. This set was in turn synchronized with the Matlab program, in which the measured data was collected and stored.  
Both signals (EEG, EMG) are analyzed by an expert system consisting of artificial intelligence algorithms in the form of a neural network and a classic algorithm for detecting artifacts and stimulating the arm muscles. The form of the discussed system is shown in Figure 1.  
Figure 2 shows the electrode configuration in the Emotiv EPOC Flex Gel headset. Due to the fact that the purpose of the research is to test signals from the area of the motor cortex, it was decided to use only 22 electrodes. The remaining ones were omitted in the EmotivPRO software and thus the EEG signal transmitted to the Matlab environment came from only 22 channels.  
An exemplary form of the conducted research is shown in Figure 3, which shows the moment of EEG and EMG signal measurements by two study participants. The total number of people surveyed was 10. This number of participants surveyed allows us to efficiently assess the effectiveness of the algorithm and, above all, to design it with a specific resistance to fluctuations in measurement values that depend on people.  
The 22 electrodes in the Emotiv EPOC Flex Gel device are named according to the following channel names: Cz-LK, Fz-RK, Fp1-LH, F7-LG, F3-LF, FC1-LC, C3-LA, FC5-LD, FT7-LE, T7-LB, CP5-LQ, CP1-LP, CP2-RP, CP6-RQ, FT8-RE, FC6-RD, C4-RA, T8-RB, FC2-RC, F4-RF, F8-RG and Fp2-RH. The sequence of the mentioned electrodes with the names of the channels in a graphic form is presented in the Figure 2. The remaining 10 electrodes  
Each of the test members took 15 measurements of the repetitive sequences of mental commands contained. The measurement consisted of the following sequences, each lasting a few seconds: neutral state, imagining the arm movement (mental command--moving the mobile robot), blinking the right eye (from now on, any movement command will result in the robot moving to the right), imagining the arm movement, blinking the left eye (from now on, any movement command will result in the movement of the robot to the left), image of the arm movement, blink both eyes (return to the initial state, each next image of the arm movement is to mean the order to move the robot forward), image of the arm movement. Due to this sequence of actions, the signals collected as a result of the measurements lasted about 45 s.  
At the same time as the EEG measurement was taken, the participant in the study had the MyoWare Muscle Sensor device applied to their bicep muscle. This allowed for the efficient collection of the EMG signal, which later gave the possibility of verification regarding pure mental commands without the support of additional muscle movements. Paralyzed people do not have the possibility of such movements, so research into a system that uses only real mental commands based on the image of arm movement is extremely important and worth developing.  
The test participants were also asked to maintain the highest possible level of concentration. Its absence would disrupt the course of the research, and thus incorrect results would be achieved. After collecting an appropriate number of measurements, it was possible to further process and classify them using artificial intelligence and classic algorithms, which is described in detail in Section 5.