Single Lead EMG signal to Control an Upper Limb Exoskeleton Using Embedded Machine Learning on Raspberry Pi

—Post-stroke can cause partial or complete paralysis of the human limb. Delayed rehabilitation steps in post-stroke patients can cause muscle atrophy and limb stiffness. Post-stroke patients require an upper limb exoskeleton device for the rehabilitation process. Several previous studies used more than one electrode lead to control the exoskeleton. The use of many electrode leads can lead to an increase in complexity in terms of hardware and software. Therefore, this research aims to develop single lead EMG pattern recognition to control an upper limb exoskeleton. The main contribution of this research is that the robotic upper limb exoskeleton device can be controlled using a single lead EMG. EMG signals were tapped at the biceps point with a sampling frequency of 2000 Hz. A Raspberry Pi 3B+ was used to embed the data acquisition, feature extraction, classification and motor control by using multithread algorithm. The exoskeleton arm frame is made using 3D printing technology using a high torque servo motor drive. The control process is carried out by extracting EMG signals using EMG features (mean absolute value, root mean square, variance) further extraction results will be trained on machine learning (decision tree (DT), linear regression (LR), polynomial regression (PR), and random forest (RF)). The results show that machine learning decision tree and random forest produce the highest accuracy compared to other classifiers. The accuracy of DT and RF are of 96.36±0.54% and 95.67±0.76%, respectively. Combining the EMG features, shows that there is no significant difference in accuracy (p-value >0.05). A single lead EMG electrode can control the upper limb exoskeleton robot device well.


INTRODUCTION
The rehabilitation process in post-stroke patients must be scheduled and sustainable to accelerate the healing process [1] [2]- [9]. If the rehabilitation process is not carried out continuously, it can cause muscle shrinkage [10]. In stroke hemiplegia, half of the upper limb or lower limb can experience paralysis. The rehabilitation process in the upper limb can be done passively or actively [11], [12] [13]- [16]. Doctors commonly use upper limb exoskeleton devices for rehabilitation of the upper limb in post-stroke patients. The passive rehabilitation process uses mechanical sensors such as a gyroscope and accelerometer [17] [18]- [26]. However, the use of mechanical sensors to detect changes in arm movement has a slow response. On the other hand, active rehabilitation involves muscle contractions that are attempted by the user to move the exoskeleton device [27], [28] [21], [26], [29]- [37]. On the other hand, the EMG signal generated by the muscles when the arm performs flexion and extension movements is non-linear so it requires pre-processing the EMG signal to produce linear angle predictions. Some researchers use 2 to 8 electrode leads to predict arm angles based on EMG patterns. A large number of leads will result in high computing time. Therefore, it is important to design an exoskeleton device that can be controlled using a minimal number of EMG electrode leads.
After a stroke, a person can experience total or partial paralysis, referred to as hemiplegia. Paralysis of the upper limb is suffered by many post-stroke patients so they cannot carry out normal activities. Paralysis in this limb can be caused by the rupture of blood vessels flowing from the brain to the arm causing a loss of coordination function [38]- [40]. Therefore, rehabilitation measures are needed in post-stroke patients to prevent atrophy or shrinkage of muscle mass. Conventionally, a doctor or therapist will rehabilitate poststroke patients by regularly training flexion and extension movements to prevent upper limb stiffness [41] [42]. The weakness of the conventional post-stroke rehabilitation process is that it requires a doctor or therapist. In the last 10 years, stroke cases in the world and Indonesia have increased, therefore efforts are needed to overcome this incident. One of the proposed efforts is to develop upper limb exoskeleton device technology. Several researchers have developed upper limb exoskeleton devices with some emphasis either in terms of sensors, controls, or exoskeleton frame models. Prediction of exoskeleton angle by utilizing EMG signals can be approached by several methods including Hill-base muscle model and machine learning [21], [26], [43]- [50].
Pang developed elbow angle prediction for exoskeleton arm drive by developing a Hill-base muscle model [51]. The accuracy obtained in predicting the angle is ranging from 10 to 30°. However, the weakness in the study is that the Journal of Robotics and Control (JRC) ISSN: 2715-5072 36 Triwiyanto Triwiyanto, Single Lead EMG signal to Control an Upper Limb Exoskeleton Using Embedded Machine Learning on Raspberry Pi prediction accuracy decreases when the angle position decreases. This is due to changes in EMG signals caused by a decrease in force experienced by the biceps and triceps muscles. The weakness is covered by Zhijun, which combines the Hill muscle model and the Kalman filter. Zhijun predicts the force based on the Hill muscle model [52]. To control the upper limb exoskeleton device, EMG signals are extracted using mean absolute value (MAV) and wavelength (WL) features. Furthermore, EMG features are utilized to predict the force to control flexion and extension movements. Kalman filter is applied to filter out motion noise caused by changes in EMG signal amplitude [53]. In addition to using the Hill muscle model [54]- [56] to predict arm joint angle or force, several other researchers used machine learning [57]- [60] for the development of upper limb exoskeleton devices. Tang developed an upper limb exoskeleton device with angle prediction using artificial neural network (ANN) and EMG features [27]. In the development of the upper limb exoskeleton, ANN gets input from EMG features tapped at four points of the biceps brachii, brachioradialis, triceps brachii, and anconeus. In study, the RMSE value obtained varied between 9.67° to 12.42°. Pang [61] developed an upper limb exoskeleton with control based on EMG signals. EMG signals were extracted using Auto Regression (AR) coefficients and then the coefficients were used for ANN backpropagation input. The study resulted in an average accuracy for three states of upper limb up, hold, and upper limb down of 90.74°. In addition to using the Hill muscle model approach and the application of machine learning, previous researchers applied the EMG feature (zero crossing) approach to extract information related to elbow flexion and extension movements. Furthermore, the feature extraction results were filtered using an infinite impulse response (IIR) digital filter to refine the angle prediction. The angle prediction information is also used to control the upper limb exoskeleton device [62].
Previous studies have developed upper limb exoskeleton devices using the Hill muscle model or machine learning. Previous researchers used two to four EMG lead points to predict the elbow angle to control the movement of the upper limb exoskeleton. Furthermore, some researchers showed varying angle prediction results depending on the position of the elbow angle. A model of the upper exoskeleton using a minimal number of EMG leads would be of great value as it would reduce the complexity and computation time. Therefore, this research aims to develop single lead EMG pattern recognition to control an upper limb exoskeleton. The use of single lead EMG will provide advantages in terms of hardware and software, namely reducing the complexity of signal processing and EMG signal lead wires. Furthermore, several supervised machine learning will be evaluated to see the best accuracy in predicting elbow angle based on EMG features. Therefore, the contribution of this study is as follows: a) An upper limb exoskeleton was controlled using single lead EMG from biceps muscle to reduce the hardware complexity. b) Multi thread algorithm (data acquisition, feature extraction, classification, and motor driving) was applied in the embedded system Raspberry to obtain a real time system.
c) The training and testing stages was implemented online in the Raspberry Pi system.

A. Experimental Procedure
The proposed model design is a prototype model of developing an upper limb exoskeleton to help patients who experience paralysis in the arm caused by bone injury or poststroke hemiplegia. At this prototype stage, the upper limb exoskeleton model is tested on subjects in good health because the development is more focused on machine learning software design for embedded Raspberry microcomputers. This study involves ten respondents with criteria, final year students with an age range of 20.3 ± 2.4 years old, a body weight of 65.57 ± 6.45 kg, and no hand disorders. Exclusion criteria in this study are people who have heart problems, have a history of high blood pressure, and have had an accident on the arm. In this study, respondents had filled out an Informed consent form before the researcher carries out the measurement process.
Prior to the data collection process, the surface of the skin precisely in the biceps muscle is cleaned first from oil using an 80% alcohol solution. This is done to reduce the resistance on the skin surface and strengthen the contact between the sensor and the skin surface. The EMG sensor used in this study is a dry electrode. The dry electrode consists of 3 metal plates (bipolar mode: two as EMG signal input and one part as ground) attached to the biceps using an elastic strap. The researcher ensured that the dry electrodes are properly attached by sliding them slightly to the right and left in the area of the tapping point. After the dry electrode is installed on the biceps, the next step is to install the 3D printing upper limb exoskeleton on the arm as shown in Fig. 1.
EMG signal testing is carried out by giving instructions to respondents to perform muscle contractions by performing repetitive grasping movements. The researcher observed the muscle activity (EMG signal) through the computer screen on the serial monitor application on the Arduino. The angular position of the upper limb exoskeleton is recorded using an accelerometer and gyroscope sensor (MPU6050) attached to the end of the upper limb exoskeleton. In the data collection process, the respondent performs flexion and extension movements with a range ranging from 0 to a maximum of 120 degrees. Furthermore, when recording EMG data and arm joint angles, the speed at which respondents perform flexion and extension movements follows the metronome application's rhythm. Metronome is a software application that provides repetitive and periodic movement rhythms.
The results of EMG signal recording and angular position are then used to train machine learning on the computer. EMG signals are first extracted using time-domain features including mean absolute value (MAV), root mean square (RMS), and variance (VAR). Furthermore, the machine learning (decision tree (DT), linear regression (LR), polynomial regression (PR), and random forest (RF) that has been trained will then be embedded on the Raspberry Pi minicomputer. This process will be explained in the next stage. After recognizing the EMG signal movement pattern, the system can control the servo motor attached to the joint to follow the flexion and extension movement patterns. The EMG signal recording process is done by tapping the muscle activity at the biceps point using dry electrodes ( Fig.  1). In accordance with the characteristics of EMG signals, which have a frequency of 0-500 Hz, a voltage range of 0-10 mv, and a dominant frequency in the 20-150 Hz area, a preamplifier circuit (gain 500 to 1000x) and a bandpass filter with a cut-off frequency of 20-150 Hz is required [63]- [66]. EMG signal recording is done using the A/D converter MCP3008. This A/D converter is connected to the Raspberry Pi B3+ system via serial peripheral interface (SPI) communication.
Regarding the Nyquist rule, the sampling frequency applied is at least 2 times the maximum frequency of the EMG signal. This research applied a sampling frequency of 2000 Hz for the EMG signal recording process [30], [67], [68]. Meanwhile, the angular position of the upper limb exoskeleton detected using the MPU6050 sensor is recorded at a speed of 100 Hz.

C. Data Processing.
EMG signal recordings are raw data that require processing steps so that the information contained in EMG signals can be used for the upper limb exoskeleton control process. There are many feature extraction models used for EMG signal extraction. Time-domain feature extraction (TDFE) is a step taken for EMG signal extraction so that the shape of the EMG signal becomes simpler and the patterns are visible according to the given movement. EMG signal data processing and upper limb exoskeleton device control process is carried out according to the flow chart as shown in Figure  2. Before the process runs continuously, the software performs an initialization step for all procedures that will run. The flowchart (Fig. 2) shows that overall, four procedures will be performed by the system: data acquisition, feature extraction, machine learning, and servo driving procedures. After all treading procedures are executed, the system will run in parallel. The output of each thread is sent to a global variable so that other threads that need the variable at the same time can use it. All threads run continuously indefinitely as long as the system is not shut down. For the upper limb exoskeleton system to be controlled by EMG signals, EMG signals tapped on the biceps muscle are recorded and stored in global variables. Furthermore, the recorded EMG signal stored in the global variable will be retrieved by the next thread, the timedomain feature thread.

D. Time-Domain Features Extraction.
Time-domain feature extraction (TDFE) is one of the features often used by researchers related to EMG signal processing [69]- [72]. TDFE has a simple nature and fast computation time. TDFE can reduce the complexity of EMG signals so that EMG patterns become more recognizable and simpler. TDFEs that are often used in EMG signal processing are variance (VAR), mean absolute value (MAV) and root mean square (RMS) as shown in Equations (1), (2), and (3). The TDFE discussed in this paper is TDFE related to energy, namely through the calculation of the average value of the EMG signal (VAR, MAV, and RMS) [73]. The variance of EMG (VAR) is the average power value of the EMG signal. VAR is formulated as follows [73], Eq. (1) (1)

Raspberry Pi 3B+ minicomputer
where xi indicates the i-th EMG signal and N indicates the length of the EMG signal. The EMG signal patterns after the TDFE process can be recognised visually but for the system to run automatically, the EMG feature patterns must be recognised by machine learning. Furthermore, the machine learning decision tree (DT), linear regression (LR), polynomial regression (PR), and random forest (RF) will be tested for their performance based on the EMG signal feature patterns.

E. Machine Learning
Conventional machine learning is still widely used in some simple applications, this is due to the simplicity of the model used and the ease to implemention on various platforms including embedded microcontroller systems or Raspberry Pi mini computers [74]- [76]. More specifically, supervised machine learning will be implemented in this research, using a gold standard derived from the angle recordings of the MPU6050 sensor used as a label. One of the advantages of using conventional machine learning is the fast processing and less training time.

Decision Tree
Decision tree, DT, is one type of conventional supervised machine learning. Where it will perform a continuous data split process according to certain parameter criteria. The DT can be assumed as two parts: decision nodes and leaves, where the decision nodes are the beginning of the split data while the leaves are the decisions or outcomes. One of the parameters used for DT calculation is entropy (s) (4) where Entropy (s) is a measure of uncertainty and randomness of data, Eq. (4) [71].
where s represents the data set that entropy is calculated, c represents the classes in set S, and p(c) represents the probability of data points that belong to class c to the number of total data points in set S Furthermore, the measure of machine learning effectiveness in the training data classification process is expressed as information gain as shown in Eq. (5).
where a represents a specific attribute or class label, Entropy(S) is the entropy of the dataset, S; |Sv|/ |S| represents the proportion of the values in Sv to the number of values in the dataset, S; Entropy(Sv) is the entropy of dataset, Sv.
Gini impurity is the likelihood that a random data point in the dataset would be classified wrongly if the dataset's class distribution determines its label.

Regression Model
Linear regression (LR) is the simplest prediction method that generally works on continuous data. LR can be applied to input and output data that are close to linear. Prediction using the LR method is shown in equation (7), where 0 denotes the intercept of y, and 1 denotes the slope of the equation. If the variables affecting the LR model are more than one, the output = 0 + 1 1 + 2 2 + 3 3 +. . . . + = 0 + 1 + 2 2 + 3 3 +. . . . + where n is the equation, y is the dependent variable, x is the independent variable, and b0 to bn are the parameters you can optimize. In this study, because the EMG signal is not linear to the arm angle's position, the joint angle's prediction can be approached using a polynomial regression equation where x is the TDFE of the EMG signal and y is the prediction result.

Random Forest
Random forest (RF) is composed of several individual DTs during the training stage. The prediction results from all DTs are collected to determine the final prediction. Since the final prediction result is based on the output of several DTs, this machine learning is also called an ensemble. Determining predictions based on the RF method is by calculating the node's importance for each decision tree using Gini Importance as shown in equation (10) where nij is the importance of node j, wj denotes the weight number for node j, Cj denotes the impurity of node j, wleft(j) denotes the node derived from the separation of node j on the left, wright(j) denotes the node derived from the separation of node j on the right. Furthermore, the importance value for each DT is calculated using Equation (11).
= ∑( : j split on feature i) ∑( ∈ all nodes) (11) where fii is the importance of the feature i, nij is the importance of the node j. The results of the importance value calculation are then normalized to a value between 0 and 1 by dividing by all feature importance values, as shown in Equation (12).
Determining the prediction value at the random forest level is by calculating the average feature importance value based on all DTs involved as shown in Equation (13).
where RFfi(i) is the importance of feature i calculated from all DTs in the random forest model, normfij is the normalized importance of feature i in DT j, and T is the total T involved.

B. Statistical Analysis
Performance testing or accuracy of upper limb exoskeleton device angle prediction is carried out based on the TDFE variations used, namely RMS, MAV, and VAR. The single factor ANOVA test is applied to see if accuracy is different when using a single feature or its combination. Furthermore, several machine learning tools including linear regression, polynomial regression, decision tree, and random forest are compared for accuracy using mean, standard deviation, and single factor ANOVA statistical tests. In addition, a statistically significant test is conducted by comparing the machine learning accuracy when the number of datasets is increased by using a single respondent, five, ten, or fifteen respondents. The single factor ANOVA statistical test uses an alpha value of 0.05.

A. Raw EMG Signal
In this study, we explored the placement of electrodes in the biceps area rather than in the triceps area. This is because the triceps leads do not show significant EMG signal activity. EMG signals are tapped at the biceps point using a dry electrode where the EMG signal generated is from 1 mV to 12 mV. In this study, respondents performed repetitive flexion and extension movements during the recording process. Fig. 3 shows that the EMG signal is random but has a repeating pattern following the exoskeleton arm movement. When the elbow moved from an angle of 0° to 120°, it appears that the EMG signal activity also showed a change according to the angle of the elbow. This is evident when the upper limb exoskeleton is in position 0°, the EMG signal does not show significant activity, but when the elbow angle is 120°, the EMG signal activity shows the maximum EMG amplitude.

B. Time-Domain EMG Features
EMG signal complexity is reduced after going through the time domain feature extraction (TDFE) process. The results of TDFE computation on EMG signals show a simpler EMG signal pattern compared to the raw EMG signal. Fig. 4 shows the TDFE results for feature variance (VAR). The results show that the TDFE pattern (red color line) follows the EMG signal pattern. Furthermore, the comparison results between the angle read using MPU6050 and the TDFE result have a different range as presented in Fig. 4. However, this result cannot be used for upper limb exoskeleton control. Therefore, a machine learning is required to control the upper limb exoskeleton. In addition, Fig. 5 shows the TDFE results using RMS and MAV features. Each EMG TDFE pattern can follow  Each TDFE output has unique characteristics. As shown in Fig. 4 and Fig. 5, however, TDFE RMS does not have an amplitude offset when compared to the others. It appears that the TDFE RMS results always coincide with the actual angular position read by the MPU6050 sensor.

C. Predicted Error
The performance of the proposed machine learning (linear regression (LR), polynomial regression (PR), decision tree (DT) and random forest (RF)) has varying accuracy which depends on the TDFE (single or combination) used. Prediction of arm joint angles to control the exoskeleton device can be done using a single lead EMG through the biceps muscle.
Although there is a considerable error at some measurement points, the continuous RMSE value produced is very good. Examples of RMSE calculation results using continuous prediction data for different features (MAV, MAV_RMS, and MAV_RMS_VAR) produce RMSE values of 1.14%, 3.08%, and 1.28% respectively (Fig. 6). Each machine learning (ML) has different accuracy depending on the type of ML and TDFE combination used (Fig. 7). Machine learning decision tree (DT) and random forest (RF) produced higher accuracy than the other two MLs (linear regression (LR= 41.21±13.35%) and polynomial regression (PR= 49.28±13.10) %) each having a mean accuracy of 96.36±0.54% (DT) and 95.67±0.76 (RF). Machine learning DT and RF applying the combination of MAV, RMS, and VAR features showed that the combination of TDFE did not significantly affect the accuracy of the proposed model (p-value>0.05). Statistical tests are conducted for all types of machine learning, this is to see if there is a significant difference in mean accuracy when using single or combined TDFE. The single factor ANOVA statistical test shows that for different features there is no significant difference (p-value=0.99) whether tested for the number of respondents 20, 10, 5, or 1 (Table 1). Furthermore, ANOVA statistical test is also conducted among machine learning (LR, PR, DT, RF) to see if there is a significant difference in accuracy. The test results show that there is a significant difference in accuracy for all types of machine learning used (p-value<0.05) both for the number of respondents 20, 15, 5, and 1 (Table 2). Furthermore, a single factor ANOVA statistical test is also conducted to see if there is a significant difference in accuracy when the model uses datasets from 1, 5, 10, or 20 respondents. The results show that there is a significant difference in accuracy (p-value <0.05) for all types of datasets used (Table  3).

IV. DISCUSSION
This research shows that machine learning decision tree (DT) and random forest (RF) produce accuracy values of 96.36 ± 0.54% and 95.67 ± 0.76, respectively. These results show that embedded machine learning DT and RF can be applied to the Raspberry Pi system because it has a simple classifier concept. More specifically, a random forest is able to predict continuous data. On the other hand, PR and LR machine learning are not able to give good predictions, this can be caused because the characteristics of the TDF EMG signal pattern in some conditions do not show the same value when repeated under the same conditions. In this study, the effect of the number of respondents is also tested, namely with variations of 1, 5, 10, and 15 respondents. Testing with different respondents is intended to see whether adding more datasets will positively impact machine learning accuracy. The ANOVA statistical test results show that there is a significant difference (p-value <0.05) when the dataset for the ML training process is added starting from 5, 10, and 15 respondents. This is in line with the research conducted by Caroline, namely the more datasets given, the ability of machine learning to learn becomes better. In terms of TDFE, the statistical ANOVA test results show that there is no significant difference in accuracy (p-value>0.05) when the machine learning model uses a single feature or a combination. This shows that using a combination of many  In this study, the machine learning model only uses a single lead in the biceps muscle to recognize the arm joint's flexion and extension movement patterns. The EMG signal pattern is in line with flexion and extension movements. When the arm starts to make flexion movements from an angle of 0 to 120, it appears that the EMG signal goes from a small signal pattern to a large one and vice versa when the arm makes an extension movement from 120 to 0, it appears that the EMG signal has decreased signal amplitude. This can be explained that when the arm performs flexion movements, the arm tries to lift the forearm through the bicep muscle so that muscle contraction increases and EMG signal activity also increases.
This research shows that machine learning decision tree (DT) and random forest (RF) produce accuracy values of 96.36 ± 0.54% and 95.67 ± 0.76, respectively. These results show that embedded machine learning DT and RF can be applied well to the Raspberry Pi system because it has a simple classifier concept. More specifically, random forest is able to predict continuous data. On the other hand, PR and LR machine learning are not able to provide good predictions, this can be caused because the characteristics of the TDF EMG signal pattern in some conditions do not show the same value when repeated under the same conditions. In this study, the effect of the number of respondents is also tested, namely with variations of 1, 5, 10 and 15 respondents. Testing with different respondents is intended to see whether adding more datasets will positively impact machine learning accuracy. The ANOVA statistical test results show a significant difference (p-value <0.05) when the dataset for the ML training process is added starting from 5, 10 and 15 respondents. This is in line with the research conducted by Caroline, namely the more datasets given, the ability of machine learning to learn becomes better. In terms of TDFE, the statistical ANOVA test results show that there is no significant difference in accuracy (p-value>0.05) when the machine learning model uses a single feature or a combination. This shows that using a combination of many features in the machine learning model does not guarantee increased accuracy. This can be due to the fact that the EMG features used are all energy-based time-domain features so they all have the same pattern.
In this study, the machine learning model only uses a single lead in the biceps muscle to recognize the arm joint's flexion and extension movement patterns. The EMG signal pattern is in line with flexion and extension movements. When the arm starts to make flexion movements from an angle of 0 to 120, it appears that the EMG signal goes from a small signal pattern to a large one and vice versa when the arm makes an extension movement from 120 to 0, it appears that the EMG signal has decreased signal amplitude. This can be explained that when the arm performs flexion movements, the arm tries to lift the forearm through the bicep muscle so that muscle contraction increases and EMG signal activity also increases. The results of this study can be compared with several similar studies using machine learning. Tang used four EMG leads to develop an upper limb exoskeleton based on an artificial neural network (ANN) with an accuracy of 9.67 to 12.42° [27]. However, the accuracy of the prediction of the elbow angle of the exoskeleton varies for several different speed modes. Another researcher developed prediction of elbow angle for three positions of limb up, hold, and upper limb down by combining feature regression coefficient (AR) and ANN classifier [61]. In this study, the accuracy of 90.74° was obtained. Although this study has succeeded in controlling the upper limb exoskeleton using single lead EMG, there are several limitations to this study. This study did not consider the effect of muscle fatigue on the developed machine learning model. This is in line with the results of previous studies, namely if there is fatigue in the car, the amplitude and frequency of the EMG signal will be affected, as well as will affect the EMG feature and classifier output results [83]. This upper limb exoskeleton device was tested on humans in good health. The signal generated by the patient in the poststroke state may produce a significant difference [84]. In this study, matters related to the speed of movement of the exoskeleton device have not been considered, so it still requires further investigation.
In this study, the exoskeleton was developed using 3D printing technology so that the design can be tailored to the needs. The strength of the exoskeleton printed material depends on the setting of several parameters, including infill and support settings, which in this study used 20% infill settings and custom support. The 3D printing of the lightweight exoskeleton device will not burden the patient. Furthermore, this product can be implemented for post-stroke patients, especially those with upper limb paralysis or hemiplegia, either independently or in a rehabilitation clinic. In the future, with the realization of cheap and easily available exoskeleton devices, it will reduce the paralysis rate for poststroke patients and speed up rehabilitation steps.

V. CONCLUSION
This research aims to develop an upper limb exoskeleton using one lead EMG pattern recognition. The results showed that the highest performance is obtained in the machine learning decision tree (DT) and random forest (RF) with accuracy values of 96.36 ± 0.54% and 95.67 ± 0.76%, respectively. The single factor ANOVA statistical test shows that there is no significant difference in accuracy when the features used are single or combined (p-value<0.05). Each machine learning used (LR, PR, TD and RF) has different accuracy and the single factor ANOVA statistic shows that there is a significant difference in accuracy (p-value <0.05). Increasing the number of datasets as input for machine learning training shows that there is a significant change in accuracy (p-value <0.05). The design of the upper limb exoskeleton based on EMG pattern recognition opens many opportunities for development. Modern machine learning applications such as deep learning can be further applied to improve the performance of joint angle prediction. Furthermore, an ML model using a convolution neural network can be applied to embedded machine learning implementation to eliminate the TDFE stage.