# Detecting the Speed Change Intention from EEG Signals:
## 2 Materials and Methods
### Closed-Loop BMI  
The subject that achieved the best TP/FP ratio at E1, participated in the pilot closed-loop experiment of the H3 exoskeleton (E2). The experiment only contemplated the intention of increasing speed. The H3 exoskeleton was used in two modes of assistance:  
* Passive mode: It was used to create the model. The exoskeleton joints followed the user's gait pattern with zero torque compensation, so they had to make a significant physical effort. In this mode, the user must walk at a constant speed and will change to their own will.
* Active mode: It was used during closed-loop control in which the exoskeleton started at a slow speed and when the BMI detected the intention of speed changing through EEG decoding, a command was sent to the exoskeleton to increase its speed.  
Figure 5: The pseudo-online metrics were evaluated from the start of the labeled start gait in the IMUs signal (solid blue) until the change speed point (solid green). In red dots the decision of the classifier based on the established metrics was marked according to the detected brain activity each 0.2 s. According to the metric, once an activation was detected, if it was detected between the blue line and the pink line, it would be counted as a FP. On the contrary, if it was detected between the pink line and the green line, it would be counted as a TP. On the left of the image appears a repetition showing an increment with a FP and a correct activation. On the right of the image appears a decreasing repetition with a FP and a correct activation  
To create the model, the register methodology was described in Section 2.3. The subject started walking in passive mode and at a certain moment the speed was increased voluntary by them. The IMUs were used to label the processing times in the same way than in E1 (see Section 2.4). No modifications were applied for the IMUs segmentation algorithm between the normal walk and the exoskeleton walk.  
Signals were filtered and features extracted as in Section 2.5 was mentioned. The classification model was created with 32 of the 40 repetitions recorded in passive mode, as eight were discarded following the E1 rules. For the signal evaluation of the closed-loop test, the process was similar to the one explained in Section 2.6.  
The detailed protocol for the closed-loop trials (see Figure 2b)) can be summed up as:  
* 15 s of \(H_{\infty}\).
* High-pitched sound warns the user 1s before the activation of the exoskeleton.
* The exoskeleton activates at speed 1 (0.8 m/s) and no commands are allowed for 10 s.
* After that, the FP evaluation starts. During 8 s at speed 1 the BMI can send commands to increase the speed depending on the brain activity.
* If one FP is detected, the BMI sends to the exoskeleton the change of speed command during 4 s and returns to Wait/Exo stopped. If during this phase there are no FP, an auditory signal indicates the start of user intention validation. The subject was told that after the auditory signal they should wait at least 3 s before attempting the change at their own will. In this period the BMI does not allow commands to avoid the influence of the evoked potential.
* For the last 5 s, if a change is detected, the exoskeleton receives the command and increases its speed to 2 (1.1 m/s) for 4 s and then stop the exoskeleton. The protocol can be seen at Figure 2.  
The exoskeleton activation time was extended from the theoretical 2 s considered at pseudo-online analysis to 4 s, as it was necessary in order for the subject to notice the difference in change between speed 1 and 2.