scieee AI-readable full text Open interactive document viewer

Forearm-attachable EMG-based wireless controller

Bánfi, Tamás; Aradi, Petra

Abstract

This paper presents the development process starting from a simple electronic module for amplification of EMG signals. During development the tasks to be solved were extended towards the creation of an EMG-base controller that eventually can be connected to a PC. Among the main goals were the simplicity and low cost of production. There are similar devices commercially available, but the main focus was on the whole process of design, testing, fabrication and the exploration of application areas. It was important to use medical recommendations. The device matches the suggestion of SENIAM, except for the resolution of A/D conversion, which is permissible due to the fact that it was not designed for medical purposes. The final version is capable of detecting and amplifying EMG signals, with the appropriate filtering and digitizing procedures for further processing. With the development of wireless communication capabilities, the device which can be attached to the forearm can be used as a USB HID device with a PC. A number of additional applications are also discussed, pointing out the fact that this piece of technology offers a wide range of possibilities.

Full text

Recent Innovations in Mechatronics (RIiM) Vol. 3. (2016). No. 1-2. DOI: 10.17667/riim.2016.1-2/18. Forearm-attachable EMG-based wireless controller Tamás Bánfi BSc Budapest University of Technology and Economics Faculty of Mechanical Engineering, Department of Mechatronics, Optics and Mechanical Engineering Informatics Budapest, Hungary [email protected] Petra Aradi PhD Budapest University of Technology and Economics Faculty of Mechanical Engineering, Department of Mechatronics, Optics and Mechanical Engineering Informatics aradi.p[email protected] Abstract— This paper presents the development process starting from a simple electronic module for amplification of EMG signals. During development the tasks to be solved were extended towards the creation of an EMG-base controller that eventually can be connected to a PC. Among the main goals were the simplicity and low cost of production. There are similar devices commercially available, but the main focus was on the whole process of design, testing, fabrication and the exploration of application areas. It was important to use medical recommendations. The device matches the suggestion of SENIAM, except for the resolution of A/D conversion, which is permissible due to the fact that it was not designed for medical purposes. The final version is capable of detecting and amplifying EMG signals, with the appropriate filtering and digitizing procedures for further processing. With the development of wireless communication capabilities, the device which can be attached to the forearm can be used as a USB HID device with a PC. A number of additional applications are also discussed, pointing out the fact that this piece of technology offers a wide range of possibilities. Keywords—electromyography, arm movement, Arduino, STM32 microcontroller, signal processing, USB HID controller I. INTRODUCTION A. The purpose of the work Electromyography (EMG) is a widely-used medical process to examine the activity of muscles. The device is called electromyograph, the diagram being detected is the electromyogram, which represents the electrical activity of muscles in mV or μV range over time. During the measurement electrodes are attached to the skin surface or needles are inserted into the muscles. The second solution is much more accurate, but it can sense the electric activity of just a few motor units. This is an invasive method, so medical professionals use it mostly for specific diagnostic purposes. The noninvasive form is applied for movement detection or as a sensor. The presented device is based on the second method. In order to measure the muscle activity, a pair of electrodes is attached longitudinally to the skin surface above the muscle. The muscles in this application are the forearm muscles, responsible for moving the wrist and fingers. As surface detection is the chosen method, the profound muscles cannot be examined. This is one of the reasons, that during development and testing the device the location, orientation and function of these muscles must be known [1], [2], [3]. To gain more information about the arm’s motion, a 6 degree of freedom accelerometer and gyroscope, an IMU (Inertial Measurement Unit) is used. This sensor detects angular and linear acceleration. Furthermore, choosing the most suitable microcontroller is also an important step. It must be able to attend to several functions: digitizing 8 analog channels considering the Nyquist-Shannon sampling theorem, communicating with the IMU and sending the data to another controller wirelessly. B. The characteristics of the EMG signal Figure 1 shows an electromyogram measured by a medical device. The electrodes attached to the patients’ forearm detect muscles’ activity while grabbing. During the research, the patient’s task was to grip a dynamometer, then relax the muscles. This procedure had to be repeated five times while increasing the force. The first graph represents the dynamometer’s values in kg, the second one shows the raw-, the third one the filtered EMG signals in mV, all of them over time. Fig. 1. Electromyogram [7] It can be easily observed that EMG signals vary, while the grabbing force is constant. According to the envelopes, it would be really difficult to determine the fix grabbing force. Another observation is that the huger force one exerts, the higher the graph’s gradient is. This effect is explained by the striated muscles’ fatigue. Moreover, the envelope’s smoothness can be increased by reducing the low-pass filter’s frequency. However, this would worsen the reaction time. Last, but not least, it is a difficult task to differentiate lowforce grabbing signals from noise. Recent Innovations in Mechatronics (RIiM) Vol. 3. (2016). No. 1-2. DOI: 10.17667/riim.2016.1-2/18. Summing up the consequences of the measurement, it is clear that during the processing of EMG signals, one has to deal with several difficulties. II. HARDWARE INTERFACE A. Designing and building the circuit It was necessary to design and build a circuit for measuring and amplifying the EMG signals. At first, a testpanel was built for the detection of only one EMG channel, based on ideas from [8]. A common Arduino panel was used for digitization of the measured EMG signal. Gaining experience from this functioning circuit, the final panel, which can measure 8 channels was designed and created. It contains an accelerometer and gyroscope, as well as a wireless radio module. The A/D conversion of signals was performed by an STM32F4 Discovery panel, because its speed and resolution are much higher, than that of the first choice of Arduino Mega. The voltage supply was a 9V battery. B. The panels in the device The developed panels can be divided into two groups based on their functions: instrumentation amplifier panels and operational amplifier panel. The second one is also a shield of the STM32. The instrumentation amplifier detects the potential difference between the two ends of the muscle that is how the EMG signal is generated. Moreover, these panels provide amplification by 20. As it operates from an asymmetric power supply, the signals have to be put onto a 1,5 V offset between 0 and 3V. Then a band-pass filter was applied, which removes the unnecessary high and low frequency components. By cutting the low band, the drift and the DC offset are eliminated. High-frequency filtering extracts the noises and prevents aliasing. According to SENIAM (Surface ElectroMyoGraphy for the Non-Invasive Assessment of Muscles) [5], for surface electrodes 5-10 Hz high-passing and 500 Hz low-passing should be used (Figure 2). In the course of the development, based on the gathered data, 7.23 Hz highand 482.29 Hz low-passing frequencies were set. Fig. 2. Schematic outline of a sEMG recording system [6] C. The final PCBs After planning the circuits, NI Multisim simulation software were used for tests. Figure 3 shows the Bode diagram results from the simulation. Fig. 3. Bode diagram result of the simulation The PCBs were designed with a program called DipTrace. PCB etching and soldering the components were the final manufacturing steps. All in all, 8 smaller panel (Figures 4 and 5), as well as a larger shield were made (Figures 6 and 7). Fig. 4. PCB design of the small instrumentation amplifier’s’ panel Fig. 5. PCB of the small instrumentation amplifier’s’ panel Recent Innovations in Mechatronics (RIiM) Vol. 3. (2016). No. 1-2. DOI: 10.17667/riim.2016.1-2/18. Fig. 6. PCB design of the shield Fig.7. PCB of the shield with the operational amplifiers, the wireless radio module and the IMU III. SOFTWARE INTERFACE For the computer processing of the signal, a digital lowpass filter is needed because of the fitting of the envelope. First, the signal must be rectified: the program measures the EMG signals symmetric to 1.5V, then substracts the mean value from them, so that the offset will be 0. After that negative numbers will be inverted. As for the filter type, the usage of IIR (Infinite Impulse Response) is reasonable, because it provides higher processing speed and results in a smoother envelope, than FIR (Finite Impulse Response) filters. A 2nd order Butterworth filter with 5 Hz cut was chosen after extensive testing. A. Testing The board was tested with an Arduino Mega at first. To display the signals, a battery-powered laptop was chosen, in order to eliminate mains disturbance. The program sent the raw and the filtered EMG signals with serial communication to the PC, where they were recorded. These results were visualized with Microsoft Excel. Figure 8 shows the raw (upper) and the filtered (lower) EMG signals using 5 Hz cut. The horizontal axis shows time in seconds, the vertical axis shows the digitized value, where 1023 bit corresponds to 5V. Fig. 8. The raw (upper diagram) and the filtered (lower diagram) EMG signals using 5 Hz cut B. Final board The final device functions (Figure 9) as a controller attached wirelessly to a PC. It is able to handle 8 different EMG signals and the data of the IMU simultaneously. The circuits are located in different plastic boxes, which can be attached to the forearm with an elastic band. The STM32 and its shield are in a bigger box. The nRF24L01+ communication module provides the high range wireless communication with the PC. First, the transmitter program reads the signals of the 8 analog inputs. Each of them are averaged, forming the channels’ offsets. Offsets are subtracted from raw signals, so their mean value will be 0. Negative signals are inverted, then a 2nd order Butterworth filter processes them. These signals and the IMU’s data are sent to the receiver. The data arrive in an array to the receiver, which disassembles and puts them to different variables. The receiver converts IMU’s data into the items of X and Y axes. Two EMG signals, generated by a flexor and an extensor muscle, are turned into a logical value. If the muscle is active, a button is pushed. All the data are shared with the PC. Fig. 9. The final device Recent Innovations in Mechatronics (RIiM) Vol. 3. (2016). No. 1-2. DOI: 10.17667/riim.2016.1-2/18. IV. CONCLUSION The first experimental results came from testing the panel made for Arduino. After that a printed circuit board was designed, built and tested, so that incidental errors could be recognized and corrected. Then the digital filters appropriate for adjusting the envelope were selected. Later on the final device was made "mobile" with a 433 MHz communication module. During the project, the errors were identified and corrected, so that in the final device they were omitted. With the experience gained during development and testing, a much faster system was designed and created, that is capable of monitoring 8 muscles, and can be placed on the forearm without electrode cables. STM32F4-Discovery handles digitization, and includes a much faster microcontroller than Arduino, so that the sampling frequency could have been increased. Further advantage of STM32F4Discovery is a 12 bit A/D converter compared to Arduino's 10 bit system, increasing the resolution of the sampled signals. Choosing the new, high performance 2.4 GHz wireless communication instead of the 433MHz modules, the operational range and data speed increased considerably. By upgrading the device with a Six-Axis Motion Tracking Device, the arm's position and movement could be monitored with more details. The circuit board of the receiver, which is able to communicate serially with the computer was also designed and built. Furthermore, the final device can be connected to the computer as an USB HID (Human Interface Device). There is no need to install a driver, the device can be used soon after connection. This function was tested on a rocket powered aircraft simulator game called HAWX, where the fighter jets were controlled by the device attached to the player's forearm (Figure 10). Fig. 10. Playing with the simulator V. FURTHER APPLICATION AND TASKS A. Examination of muscle fatigue The forearm muscles are voluntarily moveable striated muscles, which are prone to fatigue. This feature can be detected with an EMG board. All one has to do is to put the electrodes onto the biceps muscle. Then a heavier weight should be lifted and hold as long as possible. During the exercise the amplitude of the EMG signal reduces slowly. It is also a good idea to use the device for workout follow-up. B. Follow-up of physiotherapy treatments When someone needs to do physiotherapy regularly, the efficiency could be supervised, as well as the buildup of strength. For instance, during the exercise the patient should repeatedly push a small rubber ball. The microcontroller counts one up after the EMG signal reaches a certain analog value. C. Controlling a drone or mobile robot The 2,4 GHz communication module can be used to control drones or even robots because of its quite large range. Moving the gyroscope, it can direct the controlled vehicle’s movement. With the stretching or relaxing of muscles different orders can be given. One of its advantages is that the hand remains free. D. Examining walk and balance The final device shows muscles’ electric activity in a suitable way, so attaching it to the leg, the activation level can be sensed while walking or balancing. E. Redesign It is worth to examine the possibilities to redesign the device in a more compact format, for a wider range of applications. REFERENCES [1] A. Fonyó Attila: Medical Physiology (Az orvosi élettan tankönyve). 7th Ed.. Budapest, Medicina, 2014. [2] M. Réthelyi, J. Szentágothai: Functional Anatomy (Funkcionális anatómia). Band I. Budapest, Medicina, 2006. [3] Friedrich Paulsen, Jens. Waschke: Sobotta Atlas of Human Anatomy (Az ember anatómiájának atlasza). 22nd Ed. Band I. Budapest, Medicina, 2012. [4] William Rose: Electromyogram analysis. 2014. http://www.udel.edu/biology/rosewc/kaap686/notes/EMG%20analysis.p df [5] SENIAM 8 European Recommendations for Surface ElectroMyoGraphy. Published by Roessingh Research and Development b.v. 1999. [6] D.F. Stegeman, H.J. Hermens: Standards for surface electromyography: the European project "Surface EMG for non-invasive assessment of muscles (SENIAM)". http://www.med.unijena.de/motorik/pdf/stegeman.pdf [7] L. Détári: Investigation of muscle action with electromypgraphy (Az izomműködés tanulmányozása elektromiográfia segítségével) http://detari.web.elte.hu/gyak_jegyzet/emg.pdf [8] Backyard Brains. Neuroscience for Everyone! https://www.backyardbrains.com/