Cross-Platform Implementation of an SSVEP-Based BCI for the Control of a 6-DOF Robotic Arm

Robotics has been successfully applied in the design of collaborative robots for assistance to people with motor disabilities. However, man-machine interaction is difficult for those who suffer severe motor disabilities. The aim of this study was to test the feasibility of a low-cost robotic arm control system with an EEG-based brain-computer interface (BCI). The BCI system relays on the Steady State Visually Evoked Potentials (SSVEP) paradigm. A cross-platform application was obtained in C++. This C++ platform, together with the open-source software Openvibe was used to control a Stäubli robot arm model TX60. Communication between Openvibe and the robot was carried out through the Virtual Reality Peripheral Network (VRPN) protocol. EEG signals were acquired with the 8-channel Enobio amplifier from Neuroelectrics. For the processing of the EEG signals, Common Spatial Pattern (CSP) filters and a Linear Discriminant Analysis classifier (LDA) were used. Five healthy subjects tried the BCI. This work allowed the communication and integration of a well-known BCI development platform such as Openvibe with the specific control software of a robot arm such as Stäubli TX60 using the VRPN protocol. It can be concluded from this study that it is possible to control the robotic arm with an SSVEP-based BCI with a reduced number of dry electrodes to facilitate the use of the system.


Introduction
Robotics has been successfully applied to help people with disabilities perform different tasks. Many individuals suffer motor limitations as a consequence of strokes, traumas, muscular dystrophies, cerebral palsies, or various neurodegenerative diseases such as amyotrophic lateral sclerosis (ALS). For these patients, daily activities such as reaching and moving objects can be an important problem. Assistance or collaborative robots have been developed to help subjects with motor limitations in performing daily tasks and to allow them a greater degree of autonomy. However, the handling of these robots through buttons or joysticks remains an obstacle for many users affected by motor dysfunctions.
Brain-computer interfaces (BCIs) are an interesting alternative for robot control by people with severe motor limitations. BCIs are non-muscular communication and control systems that a person can use to communicate his intention and act on the environment from measurements of brain activity [1][2][3][4][5][6][7][8]. The term was introduced by Jacques Vidal in 1973 [9] and in 1999 the definition of a BCI system was formalized during the first international meeting on BCI technology [8].
BCIs include sensors that record brain activity and software that processes this information in order to interact with the environment by means of actuators. In the majority of implementations, non-invasive BCIs based on the acquisition of EEG signals are used [10].
The SSVEP BCI control system proposed in this work is composed of two main subsystems: The SSVEP processing system and the robot system. EEG signals are wirelessly transmitted from the EEG Enobio amplifier. The EEG signal is then processed to obtain the control signal for the robotic arm. The SSVEP BCI communicates with the robotic arm via a TCP/IP communications protocol. The robotic arm is a six-axis industrial manipulator model TX60 from Stäubli [109]. It is a light-duty robot arm with a maximum load of 9 kg in certain positions. The robot arm weighs 3.5 kg, and its maximum reach is 670 mm ( Figure 1).
As previously stated, among the different software platforms available for the acquisition, processing, and classification of EEG signals [76,[110][111][112], Openvibe has been selected [97,98,113]. This software was developed by INRIA [113] in order to design, test, and use brain-computer interfaces. Its programming is based on block diagrams and allows the EEG signals to be acquired, filtered, conditioned, classified, and visualized. Openvibe is compiled in C++, so it allows quick and easy integration of the communication library with the robot. Figure 2 shows the architecture of the SSVEP BCI control system. The different modules are explained in the following sections. As previously stated, among the different software platforms available for the acquisition, processing, and classification of EEG signals [76,[110][111][112], Openvibe has been selected [97,98,113]. This software was developed by INRIA [113] in order to design, test, and use brain-computer interfaces. Its programming is based on block diagrams and allows the EEG signals to be acquired, filtered, conditioned, classified, and visualized. Openvibe is compiled in C++, so it allows quick and easy integration of the communication library with the robot. Figure 2 shows the architecture of the SSVEP BCI control system. The different modules are explained in the following sections.

Stimulus Generation
Stimulus generation for the elicitation of the SSVEP can be based on light-emitting diodes LEDs [114] or monitors [46,51,101,103,108,115]. In this study, intermittent visual stimuli are presented on the computer screen.  As previously stated, among the different software platforms available for the acquisition, processing, and classification of EEG signals [76,[110][111][112], Openvibe has been selected [97,98,113]. This software was developed by INRIA [113] in order to design, test, and use brain-computer interfaces. Its programming is based on block diagrams and allows the EEG signals to be acquired, filtered, conditioned, classified, and visualized. Openvibe is compiled in C++, so it allows quick and easy integration of the communication library with the robot. Figure 2 shows the architecture of the SSVEP BCI control system. The different modules are explained in the following sections.

Stimulus Generation
Stimulus generation for the elicitation of the SSVEP can be based on light-emitting diodes LEDs [114] or monitors [46,51,101,103,108,115]. In this study, intermittent visual stimuli are presented on the computer screen.

Stimulus Generation
Stimulus generation for the elicitation of the SSVEP can be based on light-emitting diodes LEDs [114] or monitors [46,51,101,103,108,115]. In this study, intermittent visual stimuli are presented on the computer screen.
The stimulus type is a white square with a black background [115][116][117]. The size of the stimulus and the location of the stimuli on the screen is configured in Openvibe. Frequencies used are 12, 15, and 20 Hz [114]. These frequencies are multiples (1/5, 1/4, 1/3) of the update rate from a 60 Hz LCD screen ( Figure 3).
Sensors 2022, 22,5000 The stimulus type is a white square with a black background [115][116][117]. Th the stimulus and the location of the stimuli on the screen is configured in Openv quencies used are 12, 15, and 20 Hz [114]. These frequencies are multiples (1/5, 1/4 the update rate from a 60 Hz LCD screen ( Figure 3).
The experimental procedure to train the BCI spatial filters and classifier has arranged in 8 runs. Every run has four trials. Every trial has a length of 12 s and of three sections: (1) stimulus presentation (arrow positioning), (2) visualization and (3) rest period and stimulus change.
The duration of the stimulus is set to 7 s, the duration between stimuli or time of trials is set to 4 s, and the delay of the stimulus is 1 s (Figure 3). The sti shown in sequence, and each stimulus is repeated eight times ( Figure 4).   The experimental procedure to train the BCI spatial filters and classifier has 32 trials arranged in 8 runs. Every run has four trials. Every trial has a length of 12 s and consists of three sections: (1) stimulus presentation (arrow positioning), (2) visualization period, and (3) rest period and stimulus change.
The duration of the stimulus is set to 7 s, the duration between stimuli or interval time of trials is set to 4 s, and the delay of the stimulus is 1 s (Figure 3). The stimuli are shown in sequence, and each stimulus is repeated eight times ( Figure 4). and (3) rest period and stimulus change.
The duration of the stimulus is set to 7 s, the duration between stim time of trials is set to 4 s, and the delay of the stimulus is 1 s (Figure 3). T shown in sequence, and each stimulus is repeated eight times ( Figure 4).  Subjects observed on an LCD screen the three stimuli placed on the t left parts of the computer screen. The center square has the same color as t ground. The execution begins with the positioning of the arrow in one of th and then the stimuli begin to oscillate at 20 Hz (upper box), 15 Hz (left bo (right box). Simultaneously, the subject must focus on the stimulus for 7 s. T uli stop flashing, and the arrow is repositioned on one of the other stimuli. is random in each run ( Figure 5).

Signal Acquisition
Several factors have been taken into account when selecting hardware components for the EEG-based BCI. Given the interest in a compact and po for BCI control, Enobio digital amplifier from Neuroelectrics [118] was selec the EEG signals. The Enobio amplifier was developed for BCI research. It w its wireless technology and dry electrodes that facilitate the experimental s Subjects observed on an LCD screen the three stimuli placed on the top, right, and left parts of the computer screen. The center square has the same color as the black background. The execution begins with the positioning of the arrow in one of the four stimuli, and then the stimuli begin to oscillate at 20 Hz (upper box), 15 Hz (left box), and 12 Hz (right box). Simultaneously, the subject must focus on the stimulus for 7 s. Then, the stimuli stop flashing, and the arrow is repositioned on one of the other stimuli. The sequence is random in each run ( Figure 5).
The duration of the stimulus is set to 7 s, the duration between stimuli or time of trials is set to 4 s, and the delay of the stimulus is 1 s (Figure 3). The sti shown in sequence, and each stimulus is repeated eight times ( Figure 4).  Subjects observed on an LCD screen the three stimuli placed on the top, ri left parts of the computer screen. The center square has the same color as the bla ground. The execution begins with the positioning of the arrow in one of the four and then the stimuli begin to oscillate at 20 Hz (upper box), 15 Hz (left box), an (right box). Simultaneously, the subject must focus on the stimulus for 7 s. Then, t uli stop flashing, and the arrow is repositioned on one of the other stimuli. The s is random in each run ( Figure 5).

Signal Acquisition
Several factors have been taken into account when selecting hardware and s components for the EEG-based BCI. Given the interest in a compact and portable for BCI control, Enobio digital amplifier from Neuroelectrics [118] was selected to the EEG signals. The Enobio amplifier was developed for BCI research. It was ch its wireless technology and dry electrodes that facilitate the experimental setup.

Signal Acquisition
Several factors have been taken into account when selecting hardware and software components for the EEG-based BCI. Given the interest in a compact and portable solution for BCI control, Enobio digital amplifier from Neuroelectrics [118] was selected to acquire the EEG signals. The Enobio amplifier was developed for BCI research. It was chosen for its wireless technology and dry electrodes that facilitate the experimental setup.
The EEG signal was acquired through channels O1, O2, Oz, PO3, PO4, Pz, Cz, and Fz around the occipital area according to the standard 10-20 electrode location system ( Figure 6). Ground and reference electrodes were placed in the subject's earlobe. The EEG signal was recorded using a sampling rate of 500 Hz and band-pass filtered between 2 and 100 Hz with an activated notch filter at 50 Hz. The sampled and amplified EEG signal is then sent to the computer via Bluetooth. The EEG signal was acquired through channels O1, O2, Oz, PO3, PO4, Pz, Cz, and Fz around the occipital area according to the standard 10-20 electrode location system (Figure 6). Ground and reference electrodes were placed in the subject's earlobe. The EEG signal was recorded using a sampling rate of 500 Hz and band-pass filtered between 2 and 100 Hz with an activated notch filter at 50 Hz. The sampled and amplified EEG signal is then sent to the computer via Bluetooth.

Signal Processing
The EEG signal is sent from Enobio to Openvibe through the Openvibe Acquisition Server module [113]. The EEG signal is processed in a five-step process: preprocessing, feature extraction, classification, command translation, and feedback to the BCI user. Its programming is based on block diagrams and allows the signals to be acquired, filtered, conditioned, classified, and visualized ( Figure 7). Considering that the cognitive activity of interest in this study is in the range of 0.2-40 Hz, a fourth-order Butterworth band-pass filter between 6-40 Hz was applied to the EEG signal. According to [119], the SSVEP paradigm is less sensible to artifacts, due to its high signal-to-noise ratio (SNR) and robustness, than other typical BCI paradigms [120] said that SSVEP are little affected by muscular artifacts such as blinking and facial muscles' EMG. As one of the objectives of this work was to research into practical applications of BCI systems in non-clinical settings, SSVEP was selected because of its high signal-tonoise ratio (SNR). Nevertheless, appropriate processing and filtering of artifacts must be conducted in every BCI system.
For feature extraction, we use a spatial approach [121]. A common spatial patterns (CSP) filter selects the best characteristics from the EEG signal. The CSP algorithm produces spatial filters that maximize the variance of bandpass-filtered EEG signals from one class while minimizing their variance for the other class [122][123][124][125][126].

Signal Processing
The EEG signal is sent from Enobio to Openvibe through the Openvibe Acquisition Server module [113]. The EEG signal is processed in a five-step process: preprocessing, feature extraction, classification, command translation, and feedback to the BCI user. Its programming is based on block diagrams and allows the signals to be acquired, filtered, conditioned, classified, and visualized ( Figure 7). around the occipital area according to the standard 10-20 electrode location system (Figure 6). Ground and reference electrodes were placed in the subject's earlobe. The EEG signal was recorded using a sampling rate of 500 Hz and band-pass filtered between 2 and 100 Hz with an activated notch filter at 50 Hz. The sampled and amplified EEG signal is then sent to the computer via Bluetooth.

Signal Processing
The EEG signal is sent from Enobio to Openvibe through the Openvibe Acquisition Server module [113]. The EEG signal is processed in a five-step process: preprocessing, feature extraction, classification, command translation, and feedback to the BCI user. Its programming is based on block diagrams and allows the signals to be acquired, filtered, conditioned, classified, and visualized ( Figure 7). Considering that the cognitive activity of interest in this study is in the range of 0.2-40 Hz, a fourth-order Butterworth band-pass filter between 6-40 Hz was applied to the EEG signal. According to [119], the SSVEP paradigm is less sensible to artifacts, due to its high signal-to-noise ratio (SNR) and robustness, than other typical BCI paradigms [120] said that SSVEP are little affected by muscular artifacts such as blinking and facial muscles' EMG. As one of the objectives of this work was to research into practical applications of BCI systems in non-clinical settings, SSVEP was selected because of its high signal-tonoise ratio (SNR). Nevertheless, appropriate processing and filtering of artifacts must be conducted in every BCI system.
For feature extraction, we use a spatial approach [121]. A common spatial patterns (CSP) filter selects the best characteristics from the EEG signal. The CSP algorithm produces spatial filters that maximize the variance of bandpass-filtered EEG signals from one class while minimizing their variance for the other class [122][123][124][125][126]. Considering that the cognitive activity of interest in this study is in the range of 0.2-40 Hz, a fourth-order Butterworth band-pass filter between 6-40 Hz was applied to the EEG signal. According to [119], the SSVEP paradigm is less sensible to artifacts, due to its high signal-to-noise ratio (SNR) and robustness, than other typical BCI paradigms [120] said that SSVEP are little affected by muscular artifacts such as blinking and facial muscles' EMG. As one of the objectives of this work was to research into practical applications of BCI systems in non-clinical settings, SSVEP was selected because of its high signal-to-noise ratio (SNR). Nevertheless, appropriate processing and filtering of artifacts must be conducted in every BCI system.
For feature extraction, we use a spatial approach [121]. A common spatial patterns (CSP) filter selects the best characteristics from the EEG signal. The CSP algorithm produces spatial filters that maximize the variance of bandpass-filtered EEG signals from one class while minimizing their variance for the other class [122][123][124][125][126].
The power spectrum was extracted in the considered frequency bands, respectively 19.75-20.25 Hz for 20 Hz flashing frequency, 14.75-15.25 Hz for 15 Hz flashing frequency and 11.75-12.25 Hz for 12 Hz flashing frequency. For single-trial data (7 s length), a 0.1-s sliding window was applied to extract the signal features. The window length was 0.5 s. A logarithmic mapping is applied to the power average, as it assists in the improvement of the classification performance [127].
In order to classify the features extracted, a linear discriminant analysis (LDA) classifier was used. The aim of LDA is to adjust a hyperplane that can separate the data representing the different classes [67,128]. This classifier is popular and efficient for BCI. For each condition, the training set was used to select the features and to train the LDA classifier on these features. Then, the trained LDA classifier was used to classify the features extracted from the test set [129][130][131].
Cross-validation was used in this study to validate the LDA classifier. The idea was to repeatedly divide the set of trials in a BCI timeline into two non-overlapping sets, one used for training and the other for testing. Cross-validation is typically used in Openvibe in a range from 4 to 10 partitions. In this case a 10-fold cross-validation method was used. The LDA classifier was trained on 90% of the feature vectors and tested on 10%, 10 times.

GUI for Robotic Arm Control
To control the robotic arm, six degrees of freedom are available in position (linear control) and orientation (angular control). The graphical user interface (GUI) designed for the control of the robot arm is shown in Figure 8. Both in the upper left corner of the application screen and on the coordinate axes in the center, the user can visualize the active degree of freedom to control.
The power spectrum was extracted in the considered frequency bands, respectively 19. 75-20.25 Hz for 20 Hz flashing frequency, 14.75-15.25 Hz for 15 Hz flashing frequency and 11.75-12.25 Hz for 12 Hz flashing frequency. For single-trial data (7 s length), a 0.1-s sliding window was applied to extract the signal features. The window length was 0.5 s. A logarithmic mapping is applied to the power average, as it assists in the improvement of the classification performance [127].
In order to classify the features extracted, a linear discriminant analysis (LDA) classifier was used. The aim of LDA is to adjust a hyperplane that can separate the data representing the different classes [67,128]. This classifier is popular and efficient for BCI. For each condition, the training set was used to select the features and to train the LDA classifier on these features. Then, the trained LDA classifier was used to classify the features extracted from the test set [129][130][131].
Cross-validation was used in this study to validate the LDA classifier. The idea was to repeatedly divide the set of trials in a BCI timeline into two non-overlapping sets, one used for training and the other for testing. Cross-validation is typically used in Openvibe in a range from 4 to 10 partitions. In this case a 10-fold cross-validation method was used. The LDA classifier was trained on 90% of the feature vectors and tested on 10%, 10 times.

GUI for Robotic Arm Control
To control the robotic arm, six degrees of freedom are available in position (linear control) and orientation (angular control). The graphical user interface (GUI) designed for the control of the robot arm is shown in Figure 8. Both in the upper left corner of the application screen and on the coordinate axes in the center, the user can visualize the active degree of freedom to control. The GUI shows the three visual stimuli used to elicit the SSVEP. Stimulus 1 allows changing the degree of freedom. It is oscillating at 20 Hz, and when the subject selects this stimulus, in case of having the position selected, it will alternate between the three main axes (X, Y, and Z) while, in case of having the orientation selected, it would alternate between the three main angles (alpha, beta, and gamma). Stimulus 2, whose frequency is 15 Hz, increases the position and angle negatively, while stimulus 3, programmed at a frequency of 12 Hz, increases them positively.
The increases are related to the selected precision and the degree of freedom to control, this magnitude being millimeters in the case of linear movement or degrees in the case of angular movement. The subject can vary the millimeters or degrees of movement of the robot with the precision indicator located in the upper left corner of the GUI. The GUI shows the three visual stimuli used to elicit the SSVEP. Stimulus 1 allows changing the degree of freedom. It is oscillating at 20 Hz, and when the subject selects this stimulus, in case of having the position selected, it will alternate between the three main axes (X, Y, and Z) while, in case of having the orientation selected, it would alternate between the three main angles (alpha, beta, and gamma). Stimulus 2, whose frequency is 15 Hz, increases the position and angle negatively, while stimulus 3, programmed at a frequency of 12 Hz, increases them positively.
The increases are related to the selected precision and the degree of freedom to control, this magnitude being millimeters in the case of linear movement or degrees in the case of angular movement. The subject can vary the millimeters or degrees of movement of the robot with the precision indicator located in the upper left corner of the GUI. Figure 9 shows the block diagram for the robot arm control. Openvibe Acquisition Server acquires the EEG signal from Enobio. Openvibe Designer is used for the treatment of the received signal and the classification of the subject's intention. Through the virtual reality peripherals network (VRPN), the application designed in Openvibe is connected with an external application in Visual Studio. The VRPN protocol has two servers, Analog VRPN Server and Button VRPN Server. The analog server is capable of receiving a connection from an analog client and sending analog signals. The Button VRPN Server is simply a digital server that, receiving the connection from a digital client, can send logical signals similar to the mechanism of a button. In the study, digital servers (Button VRPN Server) have been used to carry out actions ( Table 1). The protocol used is TCP/IP, which guarantees the order and reception of the data sent, and also allows communication to start and end in a controlled manner.

Robot Communication Module
of the received signal and the classification of the subject's intention. Through the virtual reality peripherals network (VRPN), the application designed in Openvibe is connected with an external application in Visual Studio. The VRPN protocol has two servers, Analog VRPN Server and Button VRPN Server. The analog server is capable of receiving a connection from an analog client and sending analog signals. The Button VRPN Server is simply a digital server that, receiving the connection from a digital client, can send logical signals similar to the mechanism of a button. In the study, digital servers (Button VRPN Server) have been used to carry out actions ( Table 1). The protocol used is TCP/IP, which guarantees the order and reception of the data sent, and also allows communication to start and end in a controlled manner.  In Visual Studio, a program has been developed that receives the output of the classifier in Openvibe Designer and elaborates the control action to act on the robot through a series of events. This program sends the robot the modification of the position or orientation according to the precision and wishes of the subject.
In addition, keyboard-configured security controls have been implemented that allow the experimenter to directly control the execution of the program. Figure 10 summarizes the selected set of keys and their use. The application is launched with the Space key. Once started, the robot is disabled for safety. The programmer can enable or disable the robot's movements using the appropriate keys. It should be noted that disabling the robot does not cut communication, so it is a useful tool for debugging the response obtained.  In Visual Studio, a program has been developed that receives the output of the classifier in Openvibe Designer and elaborates the control action to act on the robot through a series of events. This program sends the robot the modification of the position or orientation according to the precision and wishes of the subject.
In addition, keyboard-configured security controls have been implemented that allow the experimenter to directly control the execution of the program. Figure 10 summarizes the selected set of keys and their use. The application is launched with the Space key. Once started, the robot is disabled for safety. The programmer can enable or disable the robot's movements using the appropriate keys. It should be noted that disabling the robot does not cut communication, so it is a useful tool for debugging the response obtained. The J and K keys allow the opening and closing of a small pneumatic solenoid valve. Thanks to this external drive, the robot can be equipped with a claw to carry out pick and place or similar tasks. With the arrows, it is possible to navigate through the menu. The user can select whether to control the position or orientation of the robot, as well as the precision (millimeters or degrees of freedom). Nine final positions have been programmed for the robot so that they maintain the same height level and vary their position on the plane. In this way, objects can be reached with greater speed in the programmed tasks. Finally, the Enter key returns the robot to its initial position.
Concurrent programming has been used to guarantee the correct operation of the The J and K keys allow the opening and closing of a small pneumatic solenoid valve. Thanks to this external drive, the robot can be equipped with a claw to carry out pick and place or similar tasks. With the arrows, it is possible to navigate through the menu. The user can select whether to control the position or orientation of the robot, as well as the precision (millimeters or degrees of freedom). Nine final positions have been programmed for the robot so that they maintain the same height level and vary their position on the plane. In this way, objects can be reached with greater speed in the programmed tasks. Finally, the Enter key returns the robot to its initial position.
Concurrent programming has been used to guarantee the correct operation of the program. The robot needs to be constantly communicating, so it must always have an active server. Furthermore, the application must guarantee that the stimuli maintain the same blinking frequency to avoid false positives and even erroneous control actions. Finally, the screen is continually refreshing itself, and there are a number of external events coming from the keyboard that must be attended to, and actions are taken accordingly. For this reason, the main application runs sequentially and has three execution threads ( Figure 11): -Server thread, in charge of making, maintaining, and recovering the connection with the robot.
-Monitor thread, in charge of refreshing the screen every time there is a modification in it.
-Event thread, responsible for managing all events external to the application and coming from the keyboard.
The J and K keys allow the opening and closing of a small pneumatic solenoid valve. Thanks to this external drive, the robot can be equipped with a claw to carry out pick and place or similar tasks. With the arrows, it is possible to navigate through the menu. The user can select whether to control the position or orientation of the robot, as well as the precision (millimeters or degrees of freedom). Nine final positions have been programmed for the robot so that they maintain the same height level and vary their position on the plane. In this way, objects can be reached with greater speed in the programmed tasks. Finally, the Enter key returns the robot to its initial position.
Concurrent programming has been used to guarantee the correct operation of the program. The robot needs to be constantly communicating, so it must always have an active server. Furthermore, the application must guarantee that the stimuli maintain the same blinking frequency to avoid false positives and even erroneous control actions. Finally, the screen is continually refreshing itself, and there are a number of external events coming from the keyboard that must be attended to, and actions are taken accordingly. For this reason, the main application runs sequentially and has three execution threads ( Figure 11

Subjects
A total of 5 healthy volunteers (3 males and two females; aged 19-30 years) with normal or corrected to normal vision participated in this study. The participants were students from the Universitat Politècnica de València. None of them had previous experience with BCIs. A medical history of epilepsy or the intake of psychoactive drugs were exclusion criteria for this experiment, and none of the participants was rejected for these causes.
Informed consent was obtained from all individual participants included in the study. Subjects were informed about the experimental procedure. Subjects were sitting in Figure 11. Program execution threads.

Subjects
A total of 5 healthy volunteers (3 males and two females; aged 19-30 years) with normal or corrected to normal vision participated in this study. The participants were students from the Universitat Politècnica de València. None of them had previous experience with BCIs. A medical history of epilepsy or the intake of psychoactive drugs were exclusion criteria for this experiment, and none of the participants was rejected for these causes.
Informed consent was obtained from all individual participants included in the study. Subjects were informed about the experimental procedure. Subjects were sitting in front of an LCD screen. They were instructed to focus their attention on the stimulus indicated on the computer screen. They were also instructed to avoid muscle and eye movements and to have a comfortable and relaxed position throughout the experiment.

Experimental Procedure
The experimental procedure has followed the recommendations established in [132]. The experimental subjects have to guide the robot arm to eight positions in a 360 • range according to the sequence of numbers shown in Figure 12. The rotation of the extreme joint of the robot has been controlled, corresponding to the degree of freedom 6 of Figure 1b. The movement is visualized in the Stäubli simulation environment ( Figure 13) and carried out by the 6th articulation of the robot arm. The subjects must rotate this robot arm articulation to the angular positions indicated by a series of circular targets that appear sequentially. To do this, the 12 Hz visual stimulus allows for clockwise rotation and the 15 Hz visual stimulus for counter-clockwise rotation. Once the required rotation is reached, the target is confirmed with the activation of the triangular stimulus that oscillates with a frequency of 20 Hz.
Given that targets are distributed every 45 • , Table 2 reflects the optimal theoretical movement sequence of the task. The triangular stimulus is initially aimed at the first target, so no turn is necessary. In order to achieve the second objective, a counter-clockwise movement of 135 • is required, which corresponds to 45 theoretical steps in the program. In order to carry out the test, a minimum of 285 turning movements are required without counting the shots. The experimental setup is shown in Figure 14. carried out by the 6th articulation of the robot arm. The subjects must rotate this robot arm articulation to the angular positions indicated by a series of circular targets that appear sequentially. To do this, the 12 Hz visual stimulus allows for clockwise rotation and the 15 Hz visual stimulus for counter-clockwise rotation. Once the required rotation is reached, the target is confirmed with the activation of the triangular stimulus that oscillates with a frequency of 20 Hz.   sequentially. To do this, the 12 Hz visual stimulus allows for clockwise rotation and the 15 Hz visual stimulus for counter-clockwise rotation. Once the required rotation is reached, the target is confirmed with the activation of the triangular stimulus that oscillates with a frequency of 20 Hz.     Table 3 shows the average time it takes each subject to complete the task. The average has been made considering the number of trials carried out by each subject. It is observed how subjects C, D, and E finished every experimental run in just over three minutes. These subjects are capable of selecting about three targets per minute with the complexity required by reaching and confirming every requested rotation (combined actions). Subjects A and B did not achieve good control of the BCI system and did not complete the full number of trials in the experiment.   Table 3 shows the average time it takes each subject to complete the task. The average has been made considering the number of trials carried out by each subject. It is observed how subjects C, D, and E finished every experimental run in just over three minutes. These subjects are capable of selecting about three targets per minute with the complexity required by reaching and confirming every requested rotation (combined actions). Subjects A and B did not achieve good control of the BCI system and did not complete the full number of trials in the experiment.  Figure 15 shows the evolution of learning for each subject, the time spent in each attempt, and the attempts made by each one. It is concluded that subjects A, B, D, and E had a continuous improvement in the task from their first attempt to the last attempt. In subject A the trial time decreased by 29.28%, in subject B by 34.84%, in subject D by 11.64%, and subject E reduced the time by 57.80%. Subject C decreased his time from the first to the second attempt, but in the last attempt, it increased by 8.89%, possibly due to the accumulated fatigue from task repetitions.  Figure 15 shows the evolution of learning for each subject, the time spent in each attempt, and the attempts made by each one. It is concluded that subjects A, B, D, and E had a continuous improvement in the task from their first attempt to the last attempt. In subject A the trial time decreased by 29.28%, in subject B by 34.84%, in subject D by 11.64%, and subject E reduced the time by 57.80%. Subject C decreased his time from the first to the second attempt, but in the last attempt, it increased by 8.89%, possibly due to the accumulated fatigue from task repetitions.        Table 4 compares the average success rate of the subjects after performing the experimental tasks according to the minimum number of movements required shown in Table  2. The success rate has been evaluated according to Equation (1). The average, as in the previous case, has been calculated based on the number of trials carried out.  Table 4 compares the average success rate of the subjects after performing the experimental tasks according to the minimum number of movements required shown in Table 2. The success rate has been evaluated according to Equation (1). The average, as in the previous case, has been calculated based on the number of trials carried out.

Results
Trial Success (%) = (theoretical movement/experimental movement) × 100 (1)  Figure 17 shows the percentage of movements calculated with respect to the theoretical minimum number of movements. Subjects A and B did not have a good performance. Their percentage for each attempt was below 50%. Subjects C, D, and E had performances above this value, with subject C achieving a peak performance in one of his attempts of 78.3%, subject D of 91.68% and subject E of 87.5%.   Figure 17 shows the percentage of movements calculated with respect to the theoretical minimum number of movements. Subjects A and B did not have a good performance. Their percentage for each attempt was below 50%. Subjects C, D, and E had performances above this value, with subject C achieving a peak performance in one of his attempts of 78.3%, subject D of 91.68% and subject E of 87.5%.  Figure 18 shows that the average success percentage was less than 40% in subjects A and B, in the range of 60 and 70% for subjects C and E, and above 70% for subject D.   Figure 18 shows that the average success percentage was less than 40% in subjects A and B, in the range of 60 and 70% for subjects C and E, and above 70% for subject D. In Figure 19, the number of movements performed is displayed as a function of the time spent in completing the task. The information transfer rate (ITR) was used to evaluate the performance of the BCI system [8,133]. The calculation was made according to Equation (2), where T is equal to the stimulus time (7 s) plus the gaze change time (4 s); N is the number of stimuli, which in this case was three, and P is the precision of the classification (Table 4). In Figure 19, the number of movements performed is displayed as a function of the time spent in completing the task. In Figure 19, the number of movements performed is displayed as a function of the time spent in completing the task. The information transfer rate (ITR) was used to evaluate the performance of the BCI system [8,133]. The calculation was made according to Equation (2), where T is equal to the stimulus time (7 s) plus the gaze change time (4 s); N is the number of stimuli, which in this case was three, and P is the precision of the classification (Table 4). The information transfer rate (ITR) was used to evaluate the performance of the BCI system [8,133]. The calculation was made according to Equation (2), where T is equal to the stimulus time (7 s) plus the gaze change time (4 s); N is the number of stimuli, which in this case was three, and P is the precision of the classification (Table 4).
Table 5 and Figure 20 show the ITR of each subject in each trial, as well as the mean value achieved. The best subject had a classification of 91.68% (Table 4) with an ITR of 5.94 bit/min.   Figure 20 show the ITR of each subject in each trial, as well as the mean value achieved. The best subject had a classification of 91.68% (Table 4) with an ITR of 5.94 bit/min.

Discussion
The influence of the spatial filtering stage of the EEG signal with respect to the precision of the classifier has been analyzed. For this, three Laplacian filters [134,135] with the weights indicated in Table 6 have been compared with two CSP filters of two and eight dimensions. The CSP algorithm results in spatial filters that maximize the variance of the EEG signals corresponding to one class and minimize it for the other class [122,136].  Table 7 shows the comparison of the spatial filters applied in an LDA classifier. The value obtained is the precision value of the classifier in each subject. From the comparison of the precision measure of the classifier, it can be observed that a significant improvement is obtained with the CSP filters compared to the Laplacian ones. The best response was obtained with a CSP filter of dimension 8, although the difference with respect to the CSP filter of two dimensions is not very significant.

Discussion
The influence of the spatial filtering stage of the EEG signal with respect to the precision of the classifier has been analyzed. For this, three Laplacian filters [134,135] with the weights indicated in Table 6 have been compared with two CSP filters of two and eight dimensions. The CSP algorithm results in spatial filters that maximize the variance of the EEG signals corresponding to one class and minimize it for the other class [122,136].  Table 7 shows the comparison of the spatial filters applied in an LDA classifier. The value obtained is the precision value of the classifier in each subject. From the comparison of the precision measure of the classifier, it can be observed that a significant improvement is obtained with the CSP filters compared to the Laplacian ones. The best response was obtained with a CSP filter of dimension 8, although the difference with respect to the CSP filter of two dimensions is not very significant.
The study carried out is compared with other similar studies below. Out of the seventeen reviewed references, this study is the only one that worked with the Enobio interface with eight dry electrodes. Different studies in robotic application obtained acquisition signals from the occipital/parietal brain areas. There are many interfaces used for acquisition signal such as Enobio (Neuroelectrics) with 32 electrodes [40], Epoc Headset (Emotiv) [51,101,137], Ultracortex (OpenBCI) [45,47], Biosemi [103], Neuracle [46,48], BioRadio (Great Lakes NeuroTechnologies) [39], DSI (Wearable sensing) [42], Mindo 4S (National Chiao Tung University Brain Research Center) [43,138], EEG amplifier Nuamps Express (Neuroscan) [44] and NeuSen W8 (Neuracle) [41]. See Table 8 for a summary. The references reviewed used a combination of frequencies in the low and mediumrange [46][47][48]50,103,137] or in the low range [51,101], while the present study used frequencies in the medium range. This study used a black/white stimulus color as in [51], but with different frequencies, while other studies used stimulus color such as red, blue, and purple, or they used other types of stimuli such as images or names. See Table 9 for a summary.  This study presents a preprocessing and feature extraction process similar to [51]. Both studies used Butterworth fourth-order filters, Common Spatial Pattern (CSP) filters and Band Power (BP) extraction. See Table 10 for a summary. Table 10. Signal processing characteristics.

Study
Feature Extraction/ Classification Accuracy study. Taking into account the task objectives, the classification accuracy can be considered acceptable above 80%. The three subjects that were able to control the BCI had 86% peak average accuracy in a range between 78.30% and 91.68%. In subsequent studies, the authors intend to improve the classifier training method by coding a wrapper solution as proposed in [139]. This method consists in explicitly defining for each fold which time segments of the signal should belong to the train set and which to the test set, and using this same segmentation for training all of the supervised learning components in all the signal processing scenarios. It is also intended in future studies to compare different classifiers.
Trials have been carried out in subjects without prior experience in BCI applications, so with perseverance and carrying out more trials better results could be achieved. This learning process can be observed in Figure 15 for every participant in the study.
The performance of the participants in the study can be affected by some variables of the study, such as stimulus type and color, the use of LEDs instead of a computer screen for presenting the intermittent stimulus, or selecting another combination of electrodes in the occipital cortex. The authors evaluated the effect of some of these parameters in a previous study [114]. In that work, it was concluded that both white and red colors could be used for medium frequency intermittent stimulus, and both green and red for low frequency, while at high frequency, there are no differences between colors. That is the reason why white stimuli are used in this study.
The perception of the subjects regarding the experiment was that completing the task was feasible, although it required concentration. Participants agreed that the application carries out their wishes except on rare occasions, providing a sense of control. Regarding the placement of the dry electrodes and the perceived pain, all agree that the placement has been simple, and the pain is bearable.
The main limitations of the present work are related to the use of dry electrodes and the number of participants. The use of wet electrodes can improve the quality of the EEG signals obtained and, consequently, the success rate of the experimental trials. However, the aim of this study was to build a BCI system that is easy to apply, with few electrodes, and comfortable to use, avoiding the nuisance of applying the electro-conductive gel. The future success of BCI systems applied to, for instance, assistance robotics or videogames depends on this readiness of use, where the user can wear the electrodes without external assistance.
Regarding the subjects, results showed that although a majority learn and improve in the course of the trials. There is a percentage, in this case, 40% of the subjects where the precision rate is less than 50%. This percentage is close to the reported BCI illiteracy rate [140] in which the subjects are unable to use the BCI. In future studies, the authors intend to increase the number of experimental subjects to corroborate the obtained results.
Finally, a matter of importance is to continue investigating with this paradigm, for example incorporating new functionalities, other analyses with EEG signals algorithms, different stimuli, an embedded application, or the replacement of the screen with LEDs.

Conclusions
The SSVEP paradigm was used to guide an industrial robot arm through the analysis and processing of the EEG data obtained through an Enobio amplifier with dry electrodes. A cross-platform application was obtained in C++. This platform, together with the opensource software Openvibe, can control a Stäubli robot arm model TX60. Additional security controls through the keyboard were implemented.
Five healthy subjects tried the BCI. Two of them were unable to successfully control the BCI device. This proportion agrees with previous results related to BCI illiteracy rates [140,141]. Regarding the subjects that were able to control the BCI, an average of around 71.5% success (peak performance average of 86%) in the application was obtained in subjects C, D, and E, with an average task completion time of around 3 min. This means that these subjects are capable of performing different actions every 23 s and with a reliability of more than 70% with eight dry EEG electrodes.
It has been confirmed that the black and white colors used in the SSVEP paradigm stimulus have shown good results and that these colors are acceptable to use in an experiment such as the one carried out.
The main conclusion of the study is that it is possible to control in real-time the robotic arm with a cross-platform application developed in C++, using openly available tools to develop an SSVEP-based BCI. The BCI operates with a reduced number of dry electrodes to facilitate the use of the system.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this paper: BCI