Myoelectric control algorithm for robot-assisted therapy: a hardware-in-the-loop simulation study

Background A direct blow to the knee is one way to injure the anterior cruciate ligament (ACL), e.g., during a football or traffic accident. Robot-assisted therapy (RAT) rehabilitation, simulating regular walking, improves walking and balance abilities, and extensor strength after ACL reconstruction. However, there is a need to perform RAT during other phases of ACL injury rehabilitation before attempting an advanced exercise such as walking. This paper aims to propose a myoelectric control (MEC) algorithm for a robot-assisted rehabilitation system, “Nukawa”, to assist knee movement during these types of exercises, i.e., such as in active-assisted extension exercises. Methods Surface electromyography (sEMG) signal processing algorithm was developed to detect the motion intention of the knee joint. The sEMG signal processing algorithm and the movement control algorithm, reported by the authors in a previous publication, were joined together as a hardware-in-the-loop simulation to create and test the MEC algorithm, instead of using the actual robot. Experiments and results An experimental protocol was conducted with 17 healthy subjects to acquire sEMG signals and their lower limb kinematics during 12 ACL rehabilitation exercises. The proposed motion intention algorithm detected the orientation of the intention 100% of the times for the extension and flexion exercises. Also, it detected in 94% and 59% of the cases the intensity of the movement intention in a comparable way to the maximum voluntary contraction (MVC) during extension exercises and flexion exercises, respectively. The maximum position mean absolute error was \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$0.1^{\circ }$$\end{document}0.1∘, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$6.3^{\circ }$$\end{document}6.3∘, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$0.3^{\circ }$$\end{document}0.3∘ for the hip, knee, and ankle joints, respectively. Conclusions The MEC algorithm detected the intensity of the movement intention, approximately, in a comparable way to the MVC and the orientation. Moreover, it requires no prior training or additional torque sensors. Also, it controls the speed of the knee joint of Nukawa to assist the knee movement, i.e., such as in active-assisted extension exercises.


Background
The knee is the largest and most complex joint in the human body, and it depends on four primary ligaments, tendons, muscles and secondary ligaments to maintain its correct function. One of the main ligaments is the anterior cruciate ligament (ACL). The ACL is one of the most commonly injured ligaments in the knee. A direct blow to the knee is one way to harm the ACL, e.g., during a football or traffic accident. Nevertheless, most ACL injuries occur even without any contact with an object [1]. There are many traditional methods and devices to assist treatment. The study of new, applied technologies in areas such as Bioengineering and Automation has brought research and technology in robotic platforms that replace, enhance or rehabilitate lower limb disabilities. Within these applications, robotic systems have become a benefit for the rehabilitation of lower limb pathologies [2]. These studies have focused on the development of active orthosis, also defined as exoskeletons [3][4][5][6].
For example, in the case of ACL injuries, Hu et al. [7] reported in 2016 a robot-assisted therapy (RAT) rehabilitation investigation, simulating regular walking to examine the effects of long-term interventions using RAT rehabilitation on functional activity levels after ACL reconstruction. The study reported that the RAT treatment improved extensor strength and walking and balance abilities.
However, ACL injuries require various rehabilitation phases with the purpose of controlling pain and swelling, restoring pain-free range of motion (ROM), improving flexibility, normalizing gait mechanics, and establishing good quadriceps activation [8]. There are several international protocols for ACL injury rehabilitation such as the Accelerated ACL Reconstruction Rehabilitation Program of the Chester Knee Clinic & Cartilage Repair Center [9,10], the Classic 1981 Protocol by Lonnie et al. [11], the ACL Reconstruction Rehabilitation Protocol of the Steadman Clinic [12], among others. These protocols report several rehabilitation phases for ACL injuries.
For the protocols mentioned above, there is the need to perform RAT rehabilitation of ACL injuries during other phases of the rehabilitation process before attempting an advanced exercise such as walking, e.g., when the patient is unable to execute a knee movement, due to the pain caused by the injury. In this rehabilitation phase, an activeassisted rehabilitation exercise may be conducted. During these types of activities, an external force provides assistance, mechanical or manual, since the muscle requires support to complete the movement [13,14]. Moreover, during the traditional rehabilitation process of ACL injuries, the protocol uses knee active-assisted extension exercises. The subject uses the opposite leg to restore ROM during these exercises, e.g., and the healthy leg straightens the non-healthy knee from a 90 • flexion to 0 • [15]. Therefore, the specific problem addressed in this paper is to detect the motion intention and control a robotic rehabilitation system to assist the knee movement, i.e., such as in active-assisted extension exercises, but using an exoskeleton.
In order to detect the motion intention of a limb or joint, electromyography (EMG) signals have been used, and with this information, it has been possible to control rehabilitation systems [16]. There are many studies reporting surface electromyography (sEMG) signal processing algorithms to detect the motion intention of a limb or joint. Several studies reported algorithms that were implemented and tested offline [17,18], and other algorithms were implemented online [19][20][21][22]. Also, some of them are currently under investigation [17,18,[20][21][22][23] and others in the commercial stage, e.g., the algorithm reported by Hayashi et al. [19]. Also, several algorithms were tested in the knee joint [19] and other algorithms detect the motion intention in other joints [17,18,[20][21][22][23]. Other studies were conducted with 1 [22], 2 [24], 3 [23], 4 [18], 10 [21], 12 [17], and 18 [20] healthy subjects. In the literature, there are sEMG signal processing algorithms that detect the motion intention. For example, myoelectric activity and a linear combination (LC) [19], feature extraction and a linear state-space model, autoregressive output structure with exogenous input (ARX) model, with multi-input single output [24]. Moreover, there exist EMG features and low-pass filter [20], Kalman filters [17], root mean square (RMS) envelope and a three-layer back propagation neural network (BPNN) controller [18], mean absolute value (MAV) and a support vector machine (SVM) [23], EMGdriven state space model which combines Hill-based muscle model with the forward dynamics of joint movement [22].
Hayashi et al. [19] reported a control method of robot suit HAL using biological information. The tests were conducted with a healthy subject, with two sensors near the flexor and extensor muscles during swinging motion of lower leg exercises. Signals were filtered and amplified, and the myoelectric activity was computed for both channels. Subsequently, the estimated muscle torque µ was calculated taking into account that where E e (t) ∈ R and E f (t) ∈ R are the myoelectric activity of the extensor and flexor muscles, respectively. Moreover, a e ∈ R , a f ∈ R , b e ∈ R and b f ∈ R are conversion coefficients from myoelectric activity to contraction torque. Finally, a gain parameter was used to compute the torque for the actuator. Their approach uses a simple algorithm, and it was tested online in a commercial robotic exoskeleton. However, their algorithm requires a long calibration process, including additional sensors such as torque sensors.
The aim of the present study is to develop a myoelectric control (MEC) algorithm, based on the algorithm proposed by Hayashi et al. [19], but that does not require additional sensors and uses the maximum voluntary contraction (MVC) as a simple calibration process. The sEMG signal processing algorithm can detect the orientation and approximate the intensity of movement intention proportionally to the maximum MVC tests. The proposed MEC algorithm was implemented in a computational model of the lower limb rehabilitation system, Nukawa. Such a mechatronic system is a product of requirements presented by an interdisciplinary group, formed by physiotherapist and engineers, and has its antecedents in [25]. The mechanical design, presented in Fig. 1, consists of two limbs, each one composed by a three-link mechanism and a Computed Torque Control (CTC). The implementation of the CTC algorithm was conducted in a first stage as a hardware-in-the-loop (HIL), using the Nukawa simulation model without having to use the actual robot since Nukawa is not yet fully operational [26].
The three degrees of freedom allows each leg to perform flexion/extension (FE) movements of the hip, FE movements of the knee, and dorsi/plantar (DP) flexion movements of the ankle [25]. The design also has three brushless motors in each limb, power drivers, and encoders.
The joints are, approximately, collinear to human joints, and the system allows to adjust the length of each segment. The knee of the human body is a polycentric joint. However, a simplification was conducted, as presented by Zoss et al. [27], where a pure rotational joint in the sagittal plane was proposed for the exoskeleton. The system was designed for people from 1.44 to 1.85 m and up to 85 kg weight. The ROM of each joint was restricted with mechanicals stops considering the ROM for hip, knee, and ankle. The MEC was conducted using a simulated model of Nukawa instead of the actual robot. Moreover, the sEMG signal processing algorithm and the movement control algorithm were implemented and tested with the simulated model, using an HIL simulation.
The tests were conducted extracting signals from a sEMG signals collection, leading them into the real-time algorithms, and finally controlling the computational model of Nukawa.
The proposed MEC algorithm employs an estimated movement intention value of the knee joint. This estimation is mapped to the desired speed of the knee joint employing scaling factors. Such a speed is the input to the CTC algorithm of the simulated robotic system.

Methods
This section presents the methodology used in the development of a sEMG signal processing algorithm to assess the detection of intended movement, based on the algorithm proposed by Hayashi et al. [19]. The algorithm was developed in both the offline programming environment MATLAB and as an HIL simulation in Python within a Beagle Bone Black (BBB) Rev C, which is a development platform.

sEMG signal processing
This section proposes a sEMG signal processing algorithm, based on the algorithm stated by Hayashi et al. [19], to assess the detection of movement intention. The proposed sEMG signal processing algorithm can detect, approximately, the intensity of  the motion intention proportionally facing the MVC. In this section, the signal processing algorithm was not conducted in real-time. However, tests were carried out with pre-recorded signals as proposed in the simulation-based methodology, stated by some of the authors in [28,29]. Figures 2, 3 and 4 present the block diagrams that make up the sEMG signal processing algorithm. In these figures the notation [n × m] is the size of the signal bus, where n is the number of signals and m is the number of samples in the observation window. Figure 2 presents a block diagram containing the principal functions of the sEMG signal pre-processing subroutine. In this figure it is possible to notice that the algorithm has three main blocks which are (1) band-pass filtering, (2) removing DC offset, and (3) full-wave rectification. This subroutine starts filtering the raw sEMG signals. A band-pass Butterworth filter with cut-off frequencies of 10 Hz and 500 Hz was used. A Notch filter was not used, since scientific recommendations from the SENIAM and the ISEK reports that EMG recordings should not use any notch filter [30,31].
Besides, the mean of the sEMG signals is subtracted, to remove the DC offset. Subsequently, the subroutine performs full-wave rectification of the signals, computing the absolute value. The full-wave rectification process is conducted so that amplitude parameters such as the MAV or RMS can be applied to sEMG signals [32]. Figure 3 presents a block diagram containing the principal functions of the subroutine to compute four normalization values. In this figure it is possible to notice that the algorithm has three main blocks which are (1) raw sEMG signal pre-processing subroutine presented in Fig. 2, (2) MAV, and (3) finding and storing maximum values. The subroutine presented in Fig. 3 uses RF and VM signals, from Trial 4, and BF and ST signals, from Trial 1, to compute four normalization values, i.e., the MVC tests. These signals are later used to normalize the signals of these muscles, respectively. In the four cases, the algorithm extracts the MAV using adjacent windows of 500 ms, later the algorithm finds the maximum MAV, and it stores the maximum value obtained for each signal.  The main routine uses the four raw sEMG signals from the RF, VM, BF, and ST of current exercise and conducts them to the sEMG signal pre-processing subroutine. Subsequently, the algorithm extracts an RMS envelope of the four channels with sliding adjacent 20 ms windows since the algorithm should be fast and light, i.e., the total number of samples in a window from the vector of the signal was 20 samples. Afterward, the signals are normalized using the values previously stored for each of the channels during the MVC exercises, as previously mentioned in subroutine presented in Fig. 3. These signals are denoted as RF RMS , VM RMS , BF RMS , and ST RMS , which are the normalized RMS envelopes.
Finally, to detect the movement intention, a linear combination LC ∈ R of the four RMS envelopes is proposed, i.e., the features of four channels were combined. This LC is based on the algorithm proposed by Hayashi et al. [19], in which two channels were used. However, the conversion coefficients a e ∈ R , a f ∈ R , b e ∈ R , and b f ∈ R are not estimated with an additional torque sensor, as proposed by Hayashi et al. [19], but determined heuristically. Moreover, the LC proposed in this paper uses four sEMG channels instead of two. To do so, the equation was proposed, where RF RMS ∈ R , VM RMS ∈ R , BF RMS ∈ R , and ST RMS ∈ R are the normalized RMS envelopes of the RF, VM, BF, and ST, respectively, taking into account that the RF and the VM muscles activate more during an extension intention. Moreover, the RMS envelope of these channels would be greater than the RMS envelope of the BF and the ST muscles during an extension intention. Therefore, the conversion coefficients of the RF RMS and the VM RMS have a positive sign, i.e., a RF = 1 , b RF = 0 , a VM = 1 , and b VM = 0 . The BF and the ST muscles activate more during a flexion intention. Therefore, the conversion coefficients of the BF RMS and the ST RMS are negative, since that these muscles are opposed to the RF and the VM muscles, i.e., a BF = −1 , b BF = 0 , a ST = −1 , and b ST = 0 . Therefore, when the subject intends to perform a knee flexion, the LC is negative in a comparable way to the MVC exercise for the flexion, and when the subject intends to carry out a knee extension, the LC is positive proportionally to the MVC  exercise for the extension. Therefore, the motion intention of the proposed LC algorithm is a continuous value between − 2 and 2, i.e., LC ∈ [−2, 2] , where − 2 and 2 are achieved during the MVC exercises in flexion and extension, respectively. Finally, the LC was filtered using a low-pass digital Butterworth Filter with a cut-off frequency of 2 Hz, order one, to remove the peaks and smooth the signal.

Myoelectric control
This section shows how the motion intention algorithm presented before and the movement control algorithm, based on a Computed Torque Control (CTC) algorithm reported by the authors in a previous publication [26], were joined as an HIL simulation to create the MEC algorithm. The protocol of the tests was carried out in real-time conducting the pre-recorded sEMG signals to the MEC algorithm. These signals correspond to those of the exercises mentioned in Table 1, specifically exercises 7-9, which correspond to concentric dynamic contraction of flexion and exercises 10-12 that correspond to concentric dynamic contraction of extension exercises. The tests assessed if the movement developed by the robotic system corresponds to the movement intention executed by the subject during the experimental protocol. Therefore, the tests did not involve individuals or animals but pre-recorded signals using a custom-made sEMG signal simulator.
A four component architecture was used to conduct the protocol of tests. The custom-made sEMG signal simulator is the first element. The simulator was developed in Python, a high-level programming language. The custom-made sEMG signal simulator extracts the signals from the computer and sends them from a computer to the BBB. The computer used for the tests was an Intel Core TM i5 with a 4 GB DD3 memory RAM. The computer communicates with the BBB through TCP/IP within a predefined communication port. The sampling period was set to TS = 0.02 s . Therefore, the signals were extracted using a 20 ms window each time. The portion of the sEMG signals was conducted to the second component. A real-time implementation of the Table 1 Exercises conducted during the experimental protocol sEMG signal processing algorithm presented in Section Motion intention algorithm is the second component. The sEMG signal processing algorithm was implemented in real-time in a BBB which has an AM335x 1 GHz ARM Cortex-A8 processor and a 512 MB DDR3 Memory RAM. This implementation was also conducted using Python. The sEMG signal processing algorithm was developed in real-time as an HIL simulation, i.e., tests were performed using pre-recorded signals. Moreover, tests were carried out as proposed in the simulation-based methodology stated by the authors in [28,29]. The motion intention was sent through TCP/IP to the third component, which was the movement control algorithm presented by the authors in [26], and was also located in the BBB. To do so, a set-point conversion is conducted as shown in Fig. 5, i.e., the output of the motion intention algorithm LC is scaled taking into account that where q d Knee ∈ R is the desired speed for the knee joint, α ∈ R is the amplitude scaling factor, and β ∈ R is the offset, two parameters left to the physiotherapist's choice, according to the exercise. Subsequently, q d Hip ∈ R and q d Ankle ∈ R are derived, which are the desired angles given by the goniometers for hip and ankle joints, respectively. Therefore, q d Hip ∈ R and q d Ankle ∈ R , the desired speed for the hip and ankle joints are obtained, respectively. In Fig. 5, the notation [n × m] is the size of the signal bus where n is the number of signals, and m is the number of samples in the observation window. The movement control algorithm is responsible for computing the torque τ u ∈ R 3×1 . The calculated torque τ u is sent back to the computer through TCP/IP, to the fourth component, which is the mathematical model of Nukawa presented by the authors in [26]. The simulation of the dynamics of Nukawa is performed in the computer, in MAT-LAB, computing q m ∈ R 3×1 , q m ∈ R 3×1 , and q m ∈ R 3×1 which represent the joint measured positions, velocities, and accelerations, respectively, i.e., after the simulation of the dynamics. Therefore, the graphic model moves as the desired path indicate it. Finally, an acknowledgment was sent back, and the loop was repeated each sampling period.
In order to validate that the MEC algorithm works correctly during actual exercises for rehabilitation of ACL injuries, six tests were conducted using the six dynamic exercises presented before, i.e., exercises 7-12. The graphic and numerical results of the six tests are shown below. These tests were carried out randomly, i.e., the combination of subject and exercise was randomized.

Experiments and results
The tests of the algorithm were conducted in the offline programming environment MATLAB and as an HIL simulation in Python within a BBB Rev C. sEMG and kinematic signals of healthy subjects were obtained to test the algorithm. Finally, a test protocol was conducted to assess the behavior of the MEC algorithm for robot-assisted rehabilitation and its possibilities to aid rehabilitation therapies for ACL injuries.

Subjects
An experimental protocol with 17 healthy subjects was conducted to record sEMG signals and its corresponding kinematics associated with rehabilitation body movements for ACL injuries. The ethics committee approved these tests.
Before each test all participants were deemed healthy under a clinical evaluation carried out by a health professional. Body weight, body height, blood pressure, heart rate, respiration rate, and body temperature were measured. Therefore, all of them were accepted in the study. The tests also recorded the age, suprapatellar perimeter, calf perimeter, inter-joint hip/knee distance, and inter-joint knee/ankle distance. The age of participants ranged from 19 to 47 years, with a median (interquartile range) of 25.5 years (23-30.5 years). Moreover, the body weight ranged from 50.1 to 81.9 kg and the body height ranged from 1.46 to 1.85 m . In addition, the inter-joint hip/knee distance ranged from 0.35 to 0.44 m and the inter-joint knee/ankle distance ranged from 0.35 to 0.47 m.

Signal acquisition
In order to capture the movements performed by the subjects, the acquisition device was the wearable body sensing platform Biosignalsplux Professional (Plux, Lisbon, Portugal). The Biosignalsplux is a wireless device used to record and send real-time information captured by various sensors that can be connected. The sampling rate was configured to fs = 1 kHz . The sensed data was stored using the OpenSignals software (Plux, Lisbon, Portugal). In order to capture the movements performed by the subjects during the selected experimental protocol, three twin axis goniometers (SG150) were used (Biometrics Ltd, Newport, UK). However, the tests only used the FE channels of each goniometer to measure hip FE movements, knee FE movements, and ankle DP flexion movements. The goniometers were located in the subject's dominant lower limb. The location of the goniometers was conducted following some of the recommendations of the goniometer and torsiometer operating manual from Biometrics Ltd [33]. The sEMG sensor placement was determined based on some of the recommendations of the SENIAM Project [31]. According to the ISEK Standards for Reporting EMG Data [30] the characteristics of the procedure are shown: The raw signal was detected using four pairs of commercial, disposable and adhesive gel surface electrodes placed in different parts of the upper leg of a group of healthy subjects, along with a reference electrode. The electrodes had a disc shape and were made of Ag/ AgCl. They were placed with an interelectrode distance of approximately 3.5 cm , center point to center point. The skin of fourteen subjects was shaved, and three subjects were not shaved. The area of interest was cleaned with alcohol before placing the electrodes to reduce the impedance between the electrodes and the skin. The electrodes were placed in order to detect flexion and extension of the knee, i.e., Rectus Femoris (RF), and Vastus Medialis (VM) muscles, detecting activation when the knee joint was extended, and Biceps Femoris (BF) and Semitendinosus (ST) muscles, detecting activation when the knee joint was flexed.
The electrodes were fixed parallel to the muscle fiber direction using the dominant middle portion of the muscle belly for best selectivity and avoiding the region of motor points. The signals were acquired using the Biosignalsplux. The device has a differential configuration, an input impedance of 100 G , CMRR of 100 dB, and it was configured with a gain of 1000. The biosignals were sampled at 1 kHz. The reference electrode was located on the Processus Spinosus of C7, in an electrically unaffected area.
To acquire the sEMG signals regarding ACL rehabilitation exercises, 12 exercises were conducted with each subject. Table 1 presents a description of the 12 exercises that were selected with the assistance of a physiotherapist with a graduate certificate in Biomedical Engineering. The test took approximately 2 h with each participant.
The physiotherapist selected six isometric exercises (1-6) and six concentric dynamic contraction exercises (7)(8)(9)(10)(11)(12). Figure 6 presents two gym machines that were used during the experimental protocol for these two types of exercises. Figure 6a and b present the leg extension machine and the crossover machine, respectively.
The concentric dynamic contraction exercises were conducted taking into account the one-repetition-maximum (1RM) test. This test evaluates the maximum weight that an individual can lift only once for an exercise. Conducting the 1RM test may be contraindicated for some populations with preexisting medical conditions. Therefore, several 1RM strength prediction equations have been proposed, i.e., the 1RM can be predicted lifting the greatest weight possible for a certain number of repetitions, until fatigue [34,35]. Some of the formulas were proposed by Lander [36], Brzycki [37], O'Connor et al. [38], and Epley [39]. Epley proposed that where w represents the weight lifted by the subject and r is the number of repetitions executed, until fatigue. Equation (4) is widely employed due to its ease of use.

Results of the offline implementation
The tests of the sEMG signal processing algorithm were conducted with the signals acquired from the 17 healthy subjects. However, to exemplify the algorithm, the implementation with the signals obtained during the tests with the fifth subject (S5) is presented below (randomly selected). Figure 7 presents the results of the LC in light gray,  Figure 8a presents the results of conducting the signals of all three isometric extension exercises (4-6) from subject 1 to the motion intention algorithm. Figure 8b presents the results of conducting the signals of all three isometric flexion exercises (1-3) from subject 6 to the motion intention algorithm. Each subfigure has three lines, one for exercise. The red, green, and blue lines represent the detection of the motion intention LC for the MVC test, 75% isometric contraction, and 50% isometric contraction exercises, respectively.

Graphic results of the protocol of tests
With the purpose of exemplifying the behavior of the MEC, the implementation with the signals obtained during exercise 9 with the seventh subject (S7) is presented below. Figure 9a-d presents the result of an HIL simulation for exercise 9 with S7. During exercise 9, the subject was prone on a flat bench with the knee flexed 90 • , hip at 0 • . Their ankle was fastened with a belt to a crossover machine. However, the simulations were conducted with the subject in a supine position, since Nukawa is not designed to perform therapies in a prone position. The above is acceptable for rehabilitation purposes since the exercises were selected taking into account international protocols for rehabilitation of ACL injuries, as presented in "Signal acquisition" section.
The online simulation presented in Fig. 9a was conducted using a 3D CAD model of Nukawa. This simulation included the kinematics of the robot. The simplified model of the robot was used as well, to reduce the computational time of the real-time tests. Figure 9b presents the result of the HIL simulation with the simplified model. In both figures, the red and dotted line represents the actual endpoint of the robot, i.e., the distal point of the third limb. In Fig. 9c presents the desired speed in a continuous line and the actual speed in a dotted line. In this figure, it is possible to observe that the system can follow the desired speed, i.e., the motion intention since both have similar behavior. Also, it can be denoted that the system follows the imposed set-point visualizing the error presented in Fig. 9d.

Numerical results of the protocol of tests
The numerical results of the behavior of the MEC algorithm are shown in Table 2, which presents the trajectory tracking mean absolute error (MAE) of the control algorithm which was commanded with a set-point of q d Knee . As indicated in the table, the maximum position MAE is 0.1 • , 6.3 • , and 0.3 • for the hip, knee, and ankle joints, respectively. Thus, the error is lowest in the knee.  For the above, the contribution of the MEC algorithm was validated for the implementation of robot-assisted rehabilitation of ACL injuries. During these therapies, the MEC algorithm would detect when the subject tries to move the knee, but due to the pain caused by the ACL injury, the patient is not able to execute the motion. Therefore, the MEC algorithm would assist its movement using the robotic system.

Discussion
The novelty of the MEC algorithm proposed in this paper has two relevant characteristics. The first one is a simplified sEMG signal processing algorithm, to detect movement intention, that only requires an MVC test for calibration, i.e., it does not require additional sensors. The second one is that the motion intention was mapped to a speed set-point instead of a position or torque set-point, as is usually reported in the literature. A wider explanation of both characteristics is presented below.
To expand the information of the first characteristic, it is important to mention that some of the algorithms reported in the literature use a machine learning algorithm for the motion intention detection [17,23,40,41]. Moreover, other algorithms use a modelbased approach [22,24,42,43]. However, those algorithms are more complex than the one reported in this paper. Therefore, they need more computing power. In the case of the proposed MEC algorithm, a simplified sEMG motion intention detection approach was achieved, similar to the ones proposed by [19][20][21]. The simplicity of the proposed algorithm makes it different from several approaches reported in the literature, where Artificial Neural Networks (ANN), Support Vector Machines (SVM), Hill-type muscular models, among others are used. This simplicity makes it easy to implement the algorithm in real-time. In comparison with other approaches that use machine learning algorithms, it is not necessary to perform high computational processes. A simple MVC calibration process is enough. The MVC test is used in most sEMG investigations to normalize the signals. Additionally, the proposed MEC algorithm requires no data sets, as the machine learning algorithms reported by other authors [40,41,44]. Since the sEMG signal is changing each session, it would be necessary to capture the MVC signal every time the algorithm is used, i.e., it requires an MVC exercise to obtain the calibration values for each session to process and detect the motion intention with EMG signals. Therefore, the MVC test may be conducted each time that the subject wears the robotic system to perform the simple calibration process. The information coming from sEMG signals was enough to detect the subject's intention. No extra sensors, in addition to the sEMG electrodes, are required for the proposed MEC algorithm to work. Other approaches require additional sensors such as accelerometers, encoders, torque meter, goniometers, among others [17,42,[45][46][47]. Additional sensors have the disadvantage that they deliver information about the intention after sEMG sensors and add extra costs. sEMG signals allow having an a priori estimation of the subject's intention since sEMG signals appear before the muscle contraction is generated, i.e., the so-called electromechanical delay (EMD) [45].
The second characteristic is that the proposed MEC algorithm uses a velocity set-point. In this MEC algorithm, the motion intention was mapped to a speed setpoint, using (3). Other algorithms [17,18,41,43,44] estimate the joint angle or even Yepes et al. BioMed Eng OnLine (2019) 18:3 interaction torque, however, the proposed MEC algorithm detects the intention and orientation of the intention. This information is enough in the application for the robotic system Nukawa and can be useful for other areas such as biofeedback or interaction with robotic systems. Table 3 presents a comprehensive comparison with other sEMG motion intention algorithms. According to the results, an approximation of the intensity through a simplified algorithm was obtained despite not being the objective pursued. In this case, the intensity is unitless and is proportional to the MVC. The assumption is that, as reported in the state of the art if the coefficients of the LC were identified by the calibration process with additional torque sensors, the algorithm would estimate the torque. Some limitations of this study are: The proposed algorithm was tested on both offline and online. However, the results cannot be generalized to the entire population, only to the sample, i.e., the study population is not statistically significant to generalize the results. Also, as the tests were performed on healthy subjects, it is still not possible to conclude about the behavior of the MEC algorithm with sEMG signals from subjects with ACL injuries. Therefore, the results obtained cannot be extrapolated directly to people with this type of injury. This restriction also applies to all approaches reported in the literature that conducted the tests with healthy subjects where the extension to other conditions must be proven. Also, the experimental protocol did not consider to measure or control the factors that affect the sEMG signals, e.g., the environmental temperature, the body temperature, the skin impedance and location of the electrodes. Therefore, it is not feasible to conclude if the proposed MEC algorithm is affected by these factors.
Finally, CTC is a model-based control which enables compliant robot control with small tracking errors for accurate robot models. Nevertheless, the proposed MEC algorithm was tested only with this controller. Therefore, future work includes several tests to the MEC algorithm with other control algorithms to assess the robustness.

Conclusions
Surface electromyography (sEMG) signal processing algorithm, based on the algorithm reported by Hayashi et al. in [19], was proposed. The proposed algorithm detects the motion intention in the knee joint and requires no prior training with sEMG signals from other subjects. Moreover, no additional torque sensor is required to estimate the conversion coefficients from the Linear Combination (LC) algorithm.
The results showed that when a subject intended to perform a knee flexion or extension, without executing the movement, the algorithm detected the orientation of the movement intention. Moreover, when a subject intended to carry out an extension movement, the algorithm detected an LC with a positive sign, and when a subject intended to perform a flexion movement, the algorithm detected an LC with a negative sign.
The behavior of the myoelectric control (MEC) algorithm for robot-assisted rehabilitation and its possibilities to support rehabilitation therapies for ACL injuries was tested through a protocol of tests. Both algorithms were joined together, i.e., the sEMG signal processing algorithm, and the movement control algorithm. The protocol of tests was conducted as an HIL simulation conducting the pre-recorded sEMG signals to the MEC algorithm. The results of the HIL simulations shown that the MEC algorithm is a