• Non ci sono risultati.

Analysis and comparison of three different EMG muscle training systems

N/A
N/A
Protected

Academic year: 2021

Condividi "Analysis and comparison of three different EMG muscle training systems"

Copied!
91
0
0

Testo completo

(1)

POLITECNICO DI MILANO

Scuola di Ingegneria Industriale e dell’Informazione

Corso di Laurea Magistrale in Ingegneria Biomedica

ANALYSIS AND COMPARISON OF THREE DIFFERENT EMG

MUSCLE TRAINING SYSTEMS

Supervisor:

Prof. Carlo Albino Frigo

Co-Supervisor:

Prof. Dimitar Stefanov

Graduation thesis of:

Chiara Balestra

Matr. 850845

Academic year 2018_2019

(2)

TABLE OF CONTENTS

ABSTRACT ... 3 SINOSSI (Italian abstract) ... 5 1.INTRODUCTION ... 7 1.1 THE MUSCLE STRUCTURE: A BRIEF INTRODUCTION ... 8 1.2 EMG SIGNAL GENERATION AND DETECTION ... 10 1.3 REHABILITATION ... 17 1.4 TELEREHABILITATION: DEVELOPMENT AND MAIN FEATURES ... 18 1.5 STATE OF THE ART ... 21 2.MATERIALS AND METHODS ... 26 2.1 PROJECT DEVELOPMENT ... 26 2.2 COMPONENTS ... 28 2.2.1 CONFIGURATION #1 ... 28 2.2.2 CONFIGURATION #2 ... 29 2.2.3 CONFIGURATION #3 ... 38 2.3 WORKFLOW ... 47 2.3.1 CONFIGURATION #1 ... 47 2.3.2 CONFIGURATION #2 ... 49 2.3.3 CONFIGURATION #3 ... 50 3.RESULTS ... 51 3.1 CONFIGURATION #1 ... 51 3.2 CONFIGURATION #2 ... 58 3.3 CONFIGURATION #3 ... 66 4.DISCUSSION ... 70 4.1 PROBLEM ENCOUNTERED ... 70 4.1.1 CONFIGURATION #1 ... 70 4.1.2 CONFIGURATION #2 ... 71 4.1.3 CONFIGURATION #3 ... 73 4.2 COMPARISON OF THE THREE CONFIGURATION ... 75 4.3 SYSTEM VALIDATION ... 76 4.4 FINAL CONCLUSION ... 81 5.CONCLUSIONS AND FUTURE DEVELOPMENTS ... 83 APPENDIX ... 85 REFERENCES ... 89

(3)

ABSTRACT

The present work has been conducted within a collaboration between the Middlesex University of London and the Department of Electronics, Information and Bioengineering (DEIB) of Politecnico di Milano and it is a part of the research field focused on the study and optimization of rehabilitation systems. These refer to a set of HW + SW devices made available to patients in order to enable them to perform rehabilitation training. The work is performed through experimental activities and make use of software for signal processing and design, modelling and simulation. The specific aim of this work is to propose the best configuration in term of HW + SW that allows patients to perform their own rehabilitation training at home completing it successfully without decreasing of performances caused by a loss of attention and stimulus. Specifically, this thesis project has planned the design of three configurations HW + SW, where hardware corresponds to a device for EMG detection or to its prototype and software corresponds to a programming software addressed to the creation of simple animations or videogames in order to use them during the rehabilitation training.

The project shown pro and cons of each configuration and this allowed the comparison of these three systems. From this comparison the most complete and suitable system for this project has emerged.

The comparison showed the third configuration as the most complete and suitable with respect to the aims of the project, even though some adjustments and improvements are necessary. The flexibility, easy to use and safety of the hardware together with a challenging videogame with a catchy graphic were crucial in the choice.

To demonstrate the system functioning and its applicability in the rehabilitation field it was performed a test on a patient in Humanitas Hospital, Milan.

(4)

In conclusion, this thesis project represents the basis for possible future tests to apply on patients. In this case tests will provide results more consistent in order to use it in clinical practice. The present thesis is divided into five different sections: • Chapter 1: containing a brief introduction and description of the background of the project and the current state of the art; • Chapter 2: describing the experimental set-up, including materials and methods to perform tests;

• Chapter 3: describing all the results obtained with the three different configurations HW + SW;

• Chapter 4: containing the discussion of the final results. In this section limitations are discussed and the best configuration is proposed. It is also described the test performed; • Chapter 5: summarizing the conclusions arisen at the end of the work to be used as a starting point for future works; • Appendix: where codes implemented during tests are reported; • References: reporting the citations of the scientific works cited in the text.

(5)

SINOSSI (Italian abstract)

Il presente progetto di tesi, svolto presso l’Università Middlesex di Londra e il Dipartimento di Elettronica, Informazione e Bioingegneria (DEIB) del Politecnico di Milano, si inserisce nel settore di ricerca dello studio e della ottimizzazione di sistemi rivolti alla riabilitazione. Questi si riferiscono ad un insieme di HW + SW messi a disposizione dei pazienti per permettere loro l’esecuzione di piani riabilitativi.

Nel dettaglio, il progetto è svolto attraverso attività di tipo sperimentale e si avvale dell’utilizzo di software rivolti al signal processing e alla progettazione, modellizzazione e simulazione.

L’obiettivo specifico del lavoro è proporre la migliore configurazione HW+SW che permetta al paziente di eseguire i propri esercizi riabilitativi da casa portandoli a termine con successo, senza diminuzione della perfomance causata da perdita di attenzione e stimolo. In dettaglio, il progetto di tesi ha previsto la progettazione di tre configurazioni HW + SW, dove l’hardware corrisponde ad un dispositivo per la rilevazione del segnale EMG o ad un suo prototipo e il software corrisponde ad un software di programmazione rivolto alla creazione di piccole animazioni o veri e propri videogiochi da utilizzare durante l’esecuzione degli esercizi riabilitativi. La progettazione ha evidenziato i punti di forza e i limiti di ciascuna configurazione e questo ha permesso quindi l’esecuzione di un confronto tra i tre sistemi, dai quali è emerso il più completo e adatto agli scopi del presente progetto. Il confronto ha fatto emergere la terza configurazione come la più completa e adatta agli scopi del presente progetto, nonostante anche in questa siano presenti margini di miglioramento. La flessibilità, facilità di utilizzo e sicurezza per il paziente dell’hardware unito ad un videogioco stimolante e di grafica accattivante sono stati determinanti nella scelta.

Per dimostrare il funzionamento del sistema e la sua applicabilità nel campo riabilitativo, è stato eseguito un test su paziente presso l’Ospedale Humanitas di Milano.

(6)

In conclusione, il progetto di tesi costituisce la base per eventuali test futuri da eseguire su pazienti. In questo caso i test forniranno risultati più consistenti per l’utilizzo del sistema nella pratica clinica.

Il presente elaborato è strutturato come descritto qui di seguito:

• Il capitolo 1 contiene una breve introduzione riguardante il contesto di riferimento in cui si inserisce il progetto di tesi che permette di avere una visione d’insieme delle problematiche in esame in questo progetto;

• Nel capitolo 2 vengono descritti gli strumenti hardware e software utilizzati per l’allestimento dei tre configurazioni sotto analisi e le procedure seguite per la realizzazione dei sistemi;

• Nel capitolo 3 sono riportati i risultati elaborati ed ottenuto con le tre diverse configurazioni HW + SW; • Il capitolo 4 consta di una discussione inerente ai risultati ottenuti, mettendo in luce i limiti riscontrati e proponendo la configurazione migliore da utilizzare nel futuro per eseguire test su pazienti. Viene inoltre descritto il test eseguito; • Il capitolo 5 riassume le conclusioni a cui si è pervenuti al termine del lavoro e i possibili sviluppi futuri; • Appendice, in cui sono riportati i codici riferiti ai test effettuati;

• Bibliografia; dove sono elencati tutti i lavori da cui è stato estrapolato il materiale citato nelle varie sezioni dell’elaborato.

(7)

1. INTRODUCTION

There are many situations in which motor rehabilitation requires repetition of motor tasks aimed at improving muscle force or motor control. Usually these exercises are carried out under supervision of a physiotherapist, and are necessarily limited in time, either because they need human resources, and because they are usually boring session in which the patient is only passively involved. In order to improve the effectiveness of the training, a longer and more involving activity would be advisable. The use of computer animations and video games could be an interesting approach, as it is demonstrated by quite recent publications on this subject [30,31]. In line with this trend, the aim of our project was to design a suitable and easy to use EMG device for muscle training, based on a sort of bio-feedback. The project is mainly addressed to people with motor disabilities or to people who have to recover after a surgery or any disease, of all ages. In usual conditions, during training sessions patients have to repeat more and more the same exercise and, when they have to do this at home on their own, they could be bored and loose concentration. In this case the exercise could be ineffective and the recovery delayed. Making available an easy and funny game to the patients, animated by the EMG signals produced by their own muscles can be funny for the patients and very effective for training at the same time. If they are focused on the game they don’t feel they are struggling and they can carry out sessions more easily.

The idea is to create a portable device that communicates with computer or smartphone via Bluetooth.

It should be thin, easy to use, accurate, reliable and safe. Patients had to be free to do their exercises when they want during the day and at the same time they had to experience something funny.

In order to reach this goal three configurations were chosen and then studied and analysed.

Comparison was based upon characteristics that were considered the most important in this project in order to reach the goal. In particular:

(8)

- Software: suitable for creating animated environment, able to communicate with the specific associated device. Last step was to decide what configuration meets better the needs of the project and to propose changing, adaptations and improvements in order to make it available for different patient’s condition and various situation and make the system suitable for a clinical use.

1.1 THE MUSCLE STRUCTURE: A BRIEF INTRODUCTION

Muscular system is composed of cells called muscle fibres and their main function is contractibility.

Muscles are responsible for movement and their contraction helps some important tasks in the body as posture, joint stability and heat production. Posture, such as sitting and standing, is maintained as a result of muscle contraction; for this reason skeletal muscles are continually making adjustments in order to hold the body in stationary positions.

Tendons contribute as well to joint stability: this is particularly evident in knee and shoulder joints, where muscle tendons are the major factor in stabilizing the joint. Energy necessary to contraction is obtained by converting chemical energy in form of adenosine triphosphate (ATP), which derives from metabolism of food and, as a by-product of muscle metabolism, they produce heat (also to preserve body temperature). Nearly 85 per cent of the heat produced in the body is the result of muscle contraction. [4].

Skeletal muscles are controlled by the peripheral portion of the central nervous system (CNS); thus, these muscles are under voluntary control. This characteristic makes them different from other two types of body muscle: smooth and cardiac. Skeletal muscle makes up 40% of body mass[2] and are composed of individual muscle fibres, most of them connected to both side to tendons. Muscular fibres are arranged in parallel between tendinous ends, so that the force of contractions of the units is additive [1]. In fact fibres run parallel to each other along the force generation axis.

Muscle fibres are striated (Fig 1.1.1) and each acts independently of neighbouring

(9)

and white lines. Fibres are bounded together by connective tissue and communicate with nerve and blood vessels. Muscle fibre is made up of myofibrils. They include proteins that are responsible for the contraction of skeletal muscle [1]. Fig. 1.1.1 structure of a striated muscle [Encyclopaedia Britannica, Inc.] Skeletal muscles may vary in size, shape and arrangement of fibres.

Muscles of a body segment are grouped in compartments; muscles in each compartment are managed by the same nerve and have a common blood supply [5]. Muscular force is obtained trough the activation of an increasing number of motor units. This process is called recruitment. At first smaller motor units are recruited and then, as the force increases, larger motor units are enrolled.

The nervous system controls as well the frequency of motor units activation. This represents the motor unit discharge or firing rate.

Process in which two or more motor units fire simultaneously is called synchronization. The role of this process is unclear, although it seems to occur more often than would be expected [19].

(10)

1.2 EMG SIGNAL GENERATION AND DETECTION

“Electromyography (EMG) is an experimental technique consisting in the development, recording and analysis of myoelectric signals. Myoelectric signals are formed by physiological variations in the state of muscle fibre membranes” [7].

In particular, electromyography measures electrical potentials generated in a muscle during its relaxation or its contraction.

These potentials are caused by the depolarization of the muscle fibres in response to the electrical impulses which arrive at the neuromuscular synapses (joint between the peripheral nerve termination and muscle fibre membrane) and, more and more fibres are activated as muscle is contracted more forcefully .

As shown in Fig. 1.2.1 the excitability of muscle fibers can be explained by the “semi-permeable membrane” model, describing electrical properties of sarcolemma. An ionic equilibrium between the inner and outer spaces of a muscle cell forms a resting potential at the muscle fiber membrane(-80/-90 mV) [7].

This difference in potential is mantained by physiological processes (called ion pump) and the result is a negative intracellular charge compared to the external environment.

The activation of an alpha-motor neuron results in the conduction of the excitation along the motor nerve.

After the release of transmitter substances at the motor endplates the action potential is generated at the muscle fibre. The diffusion characteristics of the muscle fibre membrane are modified and Na+ ions flow in. This causes a membrane depolarization which is immediately restored by backward exchange of ions within the active ion pump mechanism and by the flux of K+ ions from inside to outside. This process is called repolarization.

(11)

Fig 1.2.1. Schematic illustration of depolarization/repolarization cycle within excitable membrane [quoted from 7] If a certain threshold level is exceeded in the Na+ influx, the depolarization causes an action potential to quickly change from threshold voltage up to +30 mV.

It is immediately restored by the repolarization phase and followed by an after hyperpolarization period. Action potential, starting from motor and plates, propagates in either directions along the muscle fiber, producing excitation. Fig 1.2.2. The action potential mechanism [quoted from 7] The excitation leads to the release of calcium ions which spread inside the muscle fiber through a tubular system.[7]. Calcium ions are responsible for the creation of actin myosin bridges

(12)

(Electro-mechanical coupling) which, in turn, produce a shortening of the contractile elements of the muscle cell [7]. Fig. 1.2.2. On the left: intramuscular and surface EMG. On the right: sEMG detection [quoted from 10]

There are two types of electromyography: surface EMG (sEMG) and intramuscular EMG (Fig. 1.2.2). The two methods are better suited for a different span of applications and have their own advantages and disadvantages and are therefore both currently used for EMG signal detection [8].

The choice of electrode depends on the motor task to be explored, the nature of the research question and the specific muscle that has to be analyzed [19].

sEMG assesses muscle function by recording muscle activity from the skin above the muscle; surface EMG can be recorded by a pair of electrodes or array of multiple electrodes made of various kind of metal, including silver, gold, stainless steel and even tin .

Advantages of sEMG are non-invasiveness, low costs, easiness of application and detection of superficial muscles. It gives information on muscles activation and it helps in studying neural control strategies and neuromuscular system properties. It provides more global information about the muscle observed and it doesn’t have risks of intramuscular EMG.

The amplitude of the detected sEMG signal is intrinsically stochastic in nature and the standard deviation of this stochastic signal is a function of the number of activated motor units. The amplitude of a sEMG signal may vary from less than 50 µV up to 30

(13)

mV [8]. It is commonly accepted that most sEMG signals have frequency content between 0-500 Hz. However, there exists content at up to 2000 Hz [8].

Limitations of this approach are that these surface electrodes recording are restricted to superficial muscles, they are influenced by the depth of the subcutaneous tissue at the site of the recording, which can be highly variable, and cannot reliably discriminate between the discharges of adjacent muscles.

There is usually a 30 mV potential between the inside and outside skin layers. When the skin is stretched, the potential decreases to 25 mV and the 5mV change is recorded as motion artifact [19].

These artifacts can be minimized by using silver- silver chloride electrodes [19]. Before the electrodes are applied, impedance can be minimized by preparing the skin, removing dead skin cells and skin oils. Minimizing cable distances using shielded cables and braiding individual electrode cables together help to minimize RF interference.

sEMG electrodes are not suitable in recording activity of deeper muscles or deeper portions of large muscles. The estimate effective recording area of surface electrodes ranges from 10 to 20 mm from the skin surface [19].

It is also difficult to use sEMG electrodes to record small muscles because it’s difficult to understand if the signal is arising from the underlying muscle or an adjacent muscle. In order to prevent attenuation and distortion of the detected signal due to the effects of input loading, the input impedance of the differential amplifier should be as large as possible. The balance between the impedances of the two detection sites (in case of bipolar configuration) is of great importance as well. Amplitude, time and frequency domain properties of the sEMG signal are dependent on factors such as [6]: - the timing and intensity of muscle contraction; - the distance of the electrode from the active muscle area; - the properties of the overlying tissue; - the electrode and amplifier properties; - the quality of contact between the electrode and the skin. There are methods to reduce the impact of non-muscular factors on the properties of the EMG signal. Much of this variability in the signal can be minimized :

(14)

- using the same electrodes and amplifier (i.e. same signal conditioning parameters);

- ensuring a good quality of contact between the electrodes and the skin.

Within subjects, the variability of the signal can be also reduced in consecutive recording sessions placing the electrodes over the same skin location [6].

The quality of the measured EMG is often described by the ratio between the measured EMG signal and unwanted noise contributions from the environment. The goal is to maximize the amplitude of the signal while minimizing the noise [6].

Fine-wire electrodes are an alternative procedure that facilitates recording from deeper and smaller muscles. This configuration consists of two fine-diameter insulated wires (about 10-15 µm diameter) that are threaded through a hollow needle cannula [19].

Needle electrodes are used to monitor the activity of one or more individuals motor units instead of the EMG activity of the composite muscle.

In order to record as well as possible EMG signal it’s of great importance the electrode’s placement. In general they have to be placed away from tendinous area. Neither the motor zone (the area where the nerve enters the muscle) is a good location for surface electrodes, because it produces the most variable EMG signals. Orientation of the electrodes with respect to the muscle fibres is another important factor: if the electrode is not placed parallel to the muscle fibres, the amplitude of the signal can be reduced by as much as 50% [19]. Frequency content is affected too, with higher spectral frequencies obtained from electrodes placed closed together [19]. Interelectrode geometry (distance between electrode pairs) is another important factor and it can affect EMG signal. It is found that an interelectrode distance of 60 mm produces the greatest EMG amplitude when surface electrodes with a 7mm diameter recording area are used [19]. Electrodes may be used in two principal configurations: - monopolar configuration, where an active electrode is placed in correspondence of the muscle to be examined and the other one on a reference or neutral point (e.g. bony prominence);

- bipolar configuration (or single differential), where two active electrodes are placed on the muscle to be studied and the difference of the signal between the two electrodes is then reported to the ground electrode (Fig. 1.2.3 and Fig. 1.2.4).

(15)

Fig. 1.2.3. Monopolar configuration [NR Sign Inc.] Fig. 1.2.4. Bipolar configuration [NR Sign Inc.]

Monopolar signals provide lower-frequency responses and less selectivity than bipolar recordings. It is less stable and not suitable for measuring nonisometric contractions [19].

Bipolar configuration uses a differential amplifier that records the electrical difference between the two recording electrodes. In this case, any signal that is common to the two inputs is greatly attenuated. The feature that allows to attenuate this signal is called common-mode rejection, and the extent to which signals common to both inputs are attenuated is described by the common-mode rejection ratio (CMRR) [19]. CMRR is expressed in either a linear and logarithmic scale. One can convert CMRR in a decibel scale using the following formula:

CMRR (dB) = 20log10 CMRR(linear)

In a laboratory there may be significant radio frequency (RF) and line activity (electrical outlets, lights or other line signals). These signals are typically at power line frequency (50/60 Hz) [19], thus they are in the frequency range of the EMG signal. The differential amplifier reduces signals appearing in-phase at both amplifier inputs so the influence of these “external” signals is significantly reduced.

(16)

In the present study a bipolar configuration is used: it allows to reduce noise superimposed on the sEMG signal and to increase SNR better than monopolar configuration.

It is important to take care in setting the amplifier gain. If it is too high, the amplitude of the EMG signal exceeds the range allowed by the amplifier, the amplifier is saturated and distortion occurs in the form of clipping (Fig. 1.2.5):

Fig.1.2.5. Example of signal clipping (quoted from [18])

If the gain is set too low, the resolution of the signal after analog-to- digital (A/D) conversion will be small. The gain should be set that the amplitude of the signal is matched to the range of A/D converter. There are many clinical and biomedical applications of EMG: - it allows to directly “look” into the muscle [7]; - it allows measurements of muscular performance [7]; - it helps in decision making both before/after surgery [7];

- it is used as a diagnostic tools for identifying neuromuscular diseases and distinguish between a muscular disease and peripheral nervous system disease; - it is a research tool for studying kinesiology and disorders of motor control; - it allows analysis to improve sports activities [7]

(17)

1.3 REHABILITATION

The World Health Organisation’s (WHO) defines rehabilitation as “The use of all means aimed at reducing the impact of disabling and handicapping conditions and at enabling people with disabilities to achieve optimal social integration” [12].

A second definition, given by UEMS (Union Europeenne des Medecins Specialistes) is the following:

“An independent medical specialty concerned with the promotion of physical and cognitive functioning, activities (including behaviour), participation (including quality of life) and modifying personal and environmental factors. It is thus responsible for the prevention, diagnosis, treatments and rehabilitation management of people with disabling medical conditions and co-morbidity across all ages” [12].

Physical medicine and Rehabilitation specializes in management of an individual’s medical and functional status as a result of health issues. It includes prevention, diagnosis and treatment of disabling conditions as well as prevention of further decline and injury.

The physician, as other team members, address how to facilitate and aid an individual to do the important and necessary tasks of daily life. They include a wide range of activities such as self-care, mobility, work, leisure activities, vocation, and social role fulfilment.

Rehabilitation focuses on:

- physical therapy to improve strength and mobility; - occupational therapy to help with daily activities;

- speech-language therapy to help with speaking, understanding, reading, writing and swallowing; - treatment of pain Rehabilitation analyses individual history and physical examination in order to make a diagnosis and establish a plan. If it is necessary PT (Physical Therapy) makes use of laboratory results and imaging studies. Type of therapy and goals could be different among patients: an older person who has had a stroke may simply want to rehab himself in order to carry out again simple tasks as dressing or take a bath without help. A younger person who has had a heart attack may go through cardiac rehabilitation to return to work and normal activities.

(18)

Rehabilitation regarding people with disabilities is a process aimed at enabling them to reach and keep their optimal physical, sensory, intellectual, physiological and social functional levels.

In the hospital setting, physiatrists usually treat patients who have had an amputation, spinal cord injury, stroke, traumatic brain injury and other debilitating injuries and they work together with an interdisciplinary team that includes physical, occupational, recreational and speech therapists, nurses, physiologists, and social workers. In outpatient settings, physiatrists also treat patients with muscle and joint injuries, pain syndromes, non-healing wounds and other disabling conditions. PTs help to prevent loss of mobility developing oriented programs for a healthier and more active lifestyle, giving services to patients and populations in general.

1.4 TELEREHABILITATION: DEVELOPMENT AND MAIN

FEATURES

Telerehabilitation, also called “e-rehabilitation”, is a specific subfield of telemedicine and it refers to the application of ICT (Information and Communication Technology) with the purpose of remotely control and supervise different tasks, mainly addressing to individual with disabilities [15,13]. It takes advantage of internet and telecommunication networks. There are other many sub-domains in telemedicine [14]: - Teleradiology; - Remote intensive care; - Teleconsultation: support discussions between clinicians, clinician and a patient; - Telepresence (telesurgery);

The American Occupational Therapy Association, in 2005, defined telerehabilitation as “the clinical application of consultative, preventative, diagnostic, and therapeutic services via two-way interactive telecommunication technology” [16].

Nowadays telecommunications technologies are changing our attitudes and our way of communicating with world. This happened also in healthcare and, as in any

(19)

technological field, there has been a development and improvement in the last decades.

The first use of telemedicine was in 1957 by the U.S Department of Veteran Affairs, and the aim was to deliver mental health services [16]. Between 1997 and 2003 six civilian rehabilitation hospitals began test or demonstration programs to provide physical medicine and rehabilitation services using televideo equipment [16].

In the 1990s telerehabilitation started being deeply examined and researched by medical community; in this period was born the idea to make available this new type of service for patients who were unable to travel to a clinic for different reasons (disabilities, travel time, travel costs etc.).

Historically, health care has usually involved travel: travel has costs, directly, in term of gasoline and transportation tickets, and indirectly, in terms of travel time and delayed treatment. In this way, it provides equal access for patients in different geographic locations. The main goal of this technology is to exceed physical wall of conventional healthcare facility [17]. Rapid electronic communications help to reduce these costs and it has involved access to information resources and direct communications among various users, including patients, family members, primary care providers and specialists. There are several ways in which physicians use telerehabilitation , for example [18]: - therapeutic interventions; - remote monitoring of progress; - education and training to families and rehabilitation professionals; - tele-consulting; - coordinating care with other professionals; - provide networking for people with disabilities.

It is also used for consultations, homecare and direct patient care which can be delivered to various locations (home, community, health facility, work settings). With this new technology people can now take more control on the management of their medical needs allowing personalized care, choice and personal control.

Principal beneficiaries of these services are both adults and children with acquired injuries, diseases, developmental delay or disorder. They are delivered by a broad range of professionals as physical therapists, as speech language pathologists, occupational therapists, audiologists, rehabilitation physicians and nurses,

(20)

rehabilitation engineers, assistive technologists, teachers, psychologists and dieticians.

The benefits of telerehabilitation include [17]:

- decreased travel between rural communities and specialized urban health centers;

- better clinical support in local communities; - improve access to specialized services;

- delivery of local health care in rural communities;

- indirect educational benefits for remote clinicians who participate in teleconsultations;

- reduced feelings of isolation for rural clinicians;

- improve service stability in regions with high stuff turnover; - multimedia communication.

It is a service mostly visual and its common modalities are webcams, videoconferencing, phone lines, videophones and web pages with many applications. In recent years, the availability of high-speed Internet in the home was grown tremendously and the internet-based systems designed as plug-play appliances that do not require a computer becoming more common. Fig. 1.4.1: Telehealth schematic [quoted from14]

(21)

1.5 STATE OF THE ART

The bibliographic sources research is addressed to the detection of scientific works regarding virtual reality, that is the field this project behaves to.

Virtual reality (VR) and interacting videogame technology are becoming a diffuse application for physical rehabilitation and motor control research [26]. This technology has been used for several decades but in the early 1990’s has started to be promoted for physical rehabilitation. There are many advantages in using it as a rehabilitation tool: - it allows a real-time performance feedback; - independent practice; - a safe testing and training environment; - it provides stimulus control and consistency; - it provides motivation for the performer. They are often designed to be more interesting and enjoyable than traditional therapy tasks. Its capacity to allow the creation and control of 3-D built environments offers clinical assessment and rehabilitation options that are not available with traditional methods [18]. It is applied in a wide range of diseases. From literature has emerged an example of use in stroke rehabilitation [27]. In this case it was used the Nintendo Wii gaming system (Fig.1.5.1) as a virtual reality.

This two-months research involved two parallel groups of stroke patients. It compared the feasibility, safety and efficacy of virtual reality using the Nintendo Wii gaming system versus Recreational Therapy (i.e. playing cards, bingo). They evaluated the arm motor improvement. Patients, from 18 to 65 years of age, were randomly allocated to 2 study groups. They received an intensive program consisting of 8 interventional sessions (VRWii or RT) of 60 minutes each over a 14-day period [27]. Arm movements involved included shoulder flexion and extension, shoulder rotation, elbow extension and flexion, wrist supination and pronation, flexion and extension. Data were collected four weeks after the final study intervention session. Results showed advantages in using Wii w.r.t RT:

(22)

- Reinforcement of the mirror neuron system and long term potentiation effects thanks to repetitive intense training and the observation, practice and representation on the screen of task-specific activities that can facilitate brain plasticity [27].

It results a safe, feasible and potentially effective alternative to help rehabilitation therapy and promote motor recovery after stroke. Fig. 1.5.1 Nintendo Wii [GameStop] According to World Health Organization Report, 5 million people survive stroke each year and half of them remain with hemiparesis (weakness of one side of the body) [18].

Serious game is another type of game designed for special purpose in industry of health, education, defence, engineering and others. Although serious games should be entertaining, their main purpose is to train or educate users. In addition, users are focused on playing game, which helps them in forgetting that they are performing therapy [18].

(23)

Fig. 1.5.2 Microsoft Kinect [The Official Microsoft Blog] Microsoft Kinect (Fig. 1.5.2) was recognized as a low price and clinical practical body sensing device to be applied in rehabilitation [17]. It track a body part and it also reproduce a 3D space with player in front of it, enabling the creation of virtual reality games. Physical therapy exercises are performed while playing games and this facilitates the implementation of the therapy.

One example of application of Kinect in rehabilitation is VirtualRehab solution, developed by Spanish VirtualWare. It consists of web based control centre (that includes several games designed for Kinect), used by therapists to prepare a plan of exercises, to monitor and assess the progress of therapy [17].

In order to lead a patient through a therapy session, due to the fact that there isn’t present any physicians, the system must have a virtual assistant in a form of a web based application and a set of games specific for the patient.

Together with this, the use of muscle sensor and actuators in telerehabilitation is essential to improve patient’s muscle structure and their aim is twofold: to diagnose patient’s physical abilities based on measurements and to use read values for adaptation, and in order to choose a specific game in function of patient’s needs. If patients are required to alternately contract and relax the muscle, they will experience it as an effort, compared to a situation when they are performing same actions while playing a game, unconsciously. In the second case, the patient will probably perform more repetitions of muscle contractions and relaxations because they are unaware of those actions. This represents a relevant advantage of telerehabilitation technology.

(24)

In 2004 it was investigated the potentiality of the Sony PlayStation II EyeToy (Fig. 1.5.3) in the rehabilitation of elderly people with disabilities [29]. Fig. 1.5.3 Sony PlayStation II EyeToy [Wikimedia Commons] The PlayStation II EyeToy is a low-cost gaming application. It provides the possibility to interact with virtual objects that can be displayed on a TV monitor. It includes many motivating and competitive environments, which could be played by one or more players. This device is low cost, easy for users to operate, interesting and motivating.

In particular it was compared to VividGroup’s Gesture Xtreme VR.

GX VR is a projected video-capture system: participants stand or sit in a specific area viewing a large monitor that displays an environment or functional tasks, such as touching virtual balls. A single camera captures and converts the user’s movements for processing [29].

This system is suitable during the rehabilitation of patients suffering from motor and/or cognitive deficits. One of its major disadvantages is the high cost of the system. In this study was assessed the ability of patients in cooperating, using different applications and also it was evaluated their level of enjoyment and perceived exertion. It was achieved by performing three different pilot studies:

- Study 1: to compare the GX and Eye Toy applications using healthy young participants in term of their effect on users’ sense of presence, level of enjoyment, perceived exertion and side effects;

(25)

- Study 2: to assess the usability of the EyeToy with an elderly healthy population in term of sense of presence, level of enjoyment, perceived exertion and side effects and their ability to operate the system;

- Study 3: to assess the use of the EyeToy with patients who have had a stroke in terms of their ability to cooperate, use different applications, and their level of enjoyment and perceived exertion [29].

The first comparison study demonstrated that young participants sensed the same level of presence while experiencing the EyeToy and the expensive GX system.

The important of the second study was the fact that the elderly healthy participants enjoyed using EyeToy, mostly for its easiness of use.

The third study emphasized the EyeToy ‘s limitation, in particular the inability to grade the level of environments. It seemed less suitable for the acute stroke patients, since they suffered from severe weakness of the left side of their body. Due to this fact, some of the patients expressed frustration and therapist often helped them during the performance. Nevertheless, all acute stroke patients enjoyed their experience and expressed interest in repeating the session [29]. At the end the EyeToy demonstrated to be suitable for this kind of treatment and it is ideal to use by patient at home.

(26)

2.MATERIALS AND METHODS

The important factor in this context was the implementation of different scenarios, changing software and hardware to find the best solution for the aim of the project. As described in the Abstract, the aim of the project is to propose the best configuration in term of HW+SW that allows patients to perform their own rehabilitation training at home.

Best solution means a trade-off among functionality of the EMG device (gain, high SNR, wireless connection) and easiness of use, portability, reliability and safety for patients and operators.

2.1 PROJECT DEVELOPMENT

A fundamental step was to decide what kind of HW and SW use to build the three configurations.

It was decided to build three configurations with different HW and SW. This allowed to explore various scenarios and the comparison between them became more robust and meaningful.

Three configurations is a good choice also in term of available time to develop this thesis. This allowed to work deeply with every configuration. An higher number of configurations, with the same available time, would have brought to a more superficial analysis. Below the summary table can be seen : 3 different approaches: Arduino UNO, LabVIEW and SolidWorks MyoWare and

(27)

Specifically:

• 1st Configuration

- HW: Arduino Uno, thanks to its versatility and flexibility in use and its possibility to interface with different kind of software;

- SW:

- LabVIEW, because it gives the possibility to make tests and work on data;

- SolidWorks, because it is a CAD and CAE software that meets the project aim in term of animation development.

The idea is to implement the system using these software: LabVIEW to monitor the progress of patient’s condition with graphics over time; SolidWorks to create a simple animation that can be controlled by the patient’s muscle contraction during the training session.

• 2nd Configuration

- HW: MyoWare, thanks mainly to the fact that is a portable and compact device;

- SW: Blender, a free and open source 3D creation suite, perfect for the animation of objects and/or environment. • 3rd Configuration - HW: Attys, a modern and compact device, suitable to different types of tests and uses; - SW:

- Python, to give the possibility of signal post-processing and realtime processing; - Matlab, thanks to its nature it is used for signal post-processing; - Java, used for the implementation of the game.

(28)

2.2 COMPONENTS

In following paragraphs there are descriptions of each HW and SW used to perform tests. Characteristics and functionalities of each of them are highlighted.

2.2.1 CONFIGURATION #1

SolidWorks SolidWorks is a CAD (computer-aided design) and CAE (computer-aided engineering) computer program developed by Dassault Systèmes. It utilizes parametric feature-based approach to create models and assemblies [20].

The “SolidWorks simulation” packages help to set up virtual real-world environments. This one is the module necessary to create not only a simple model but also a complete animation scene.

LabVIEW

LabVIEW is system-engineering software for applications that requires test, measurement and control with rapid access to hardware and data.

The graphical Language is named “G”, which is a dataflow programming language. LabVIEW is commonly used for data acquisition, instrument control and industrial automation.

It’s possible to create a user interface, also called front panel, with controls (knobs, push buttons, dials) and indicators (graphs, LEDs and other input displays). After the building of the front panel, one can add code using VIs (virtual instruments) and structures to control the front panel objects. Code is included in the block diagram [21]. LabVIEW includes extensive support for interfacing devices and instruments. Arduino Arduino is an open source platform based on a simple input/output (I/O) board and a development environment that implements the Processing language [22]. The heart of the board is the microcontroller ATmega328.

(29)

Arduino is composed of two major parts: the Arduino board (a microcontroller board), that is the hardware, and the Arduino IDE (Integrated Development Environment), the piece of software that runs on the computer. The aim of the IDE is to create a programme that has to be uploaded on the Arduino board. The program tells the board what to do. When one uploads the sketch to the board the code is translated into the C Language and is passed to the avr-gcc compiler, an important piece of open-source software; it simplifies as much as possible the complexities of programming microcontrollers. Arduino Uno has a number of facilities for communicating with a computer, another Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX). The Arduino software includes a serial monitor, which allows simple textual data to be sent to and from the Arduino board. The RX and TX LEDs on the board will flash when data is being transmitted via the USB-to-serial chip and USB connection to the computer (but not for serial communication on pins 0 and 1). The ATmega328 also supports I2C (TWI) and SPI communication.

2.2.2 CONFIGURATION #2

Blender

It is a free and open source 3D creation suite. It supports 3D pipeline: modelling, rigging, animation, simulation, rendering, compositing and motion tracking, video editing game creation. Blender is an animation game which code is written in Python. If the driver Pyserial x 2.7.9 is downloaded it’s possible to transfer the signal coming from Arduino (for the EMG) to Blender thank to this driver. It is a serial communication.

In this case, the choice of MyoWare as a SW was taken after an analysis and comparison of four different EMG devices.

(30)

These devices were selected after a deep research among new EMG tools now available. For all of them pro and cons were highlighted and then the best one was chosen. 1. EMG Detector (GROVE) Fig. 2.2.2.1 EMG detector [wiki.seeed.cc] It is a bridge that connects human body and electrical components. The sensor gathers muscle signals and then it processes them with an amplifier and a filter. Arduino can receive the output signal.

In standby mode the output voltage is 1.5V. This sensor can be used in 3.3V o 5V system. [23]

Features:

• Grove compatible, one channel (Grove is a module electronic platform for prototyping) • 3.5mm Connector • Power supply voltage: 3.3V-5V • 1000mmCable Leads • No additional power supply

(31)

Main advantages/disadvantages: - It processes signals coming from small muscles with amp and a filter - It cannot be used for medical purposes - No additional power supply - It can be used only with the version of Arduino SEEDUINO 3.0 2. MYOWARE Muscle Sensor

MyoWare is an Arduino-powered, all-in-one electromyograph (EMG) 4th generation sensor from Advancer Technologies.

It is an updated version of Advancer Technologies’ older Muscle Sensor v3.

It measures, filters, rectifies and amplifies the electrical activity of a muscle and it produces an analog output signal that can be read by a microcontroller with an analog-to-digital converter (ADC), outputting 0-Vs Volts (Vs is the voltage of the power source and it could be 3.3 V or 5V). Fig. 2.2.2.2 MyoWare [24] PCB Dimensions: 52.9mmx20.7mmx5.1mm/2.1”x0.8”x0.2” Snap-connector Cable Length: 100mm/3.9” Weight: 28g

It is important to take precautions when using sensors that connect directly to the body. The USB isolator provides protection against unexpected surges or spikes. This

(32)

is necessary only if someone is wearing the sensor while the circuit is still plugged into the computer. It is not necessary if one is operating off of battery power.

The sensor should always be placed along the length of the muscle, with the electrode closest to the wire connections placed at the middle of the muscle and the second electrode on the circuit board towards to the end of the muscle. The third electrode attached to the black wire should be placed away from the muscle that is being sensed [24].

Placing the sensor in other locations will reduce the strength and quality of the sensor’s signal due to a reduction of the number of motor units measured and interference attributed to crosstalk.

Fig. 2.2.2.3 Correct placement of the MyoWare muscle sensor

Position and orientation of the electrodes has a vast effect on the strength of the signal. Two connectors are located directly on the PCB, and the third is located at the end of the attached reference electrode cable. [24].

Features:

- Wearable Design (thank to its special design it can be placed directly on the desired muscle)

- Embedded Electrode Connector, that makes the MyoWare wearable and cables free.

(33)

- Polarity Protected Power Pins: in order to don’t burn out when the power isn’t correctly connected.

- ON/OFF Switch: there is an on-board power switch so it’s possible to test the power connections easily. - LED Indicators: one warns when the MyoWare power is on and the other lights up during the muscle contraction. - Adjustable gain There are different types of configurations: a) Battery powered with isolation via no direct external connections (NOTE: since no component is connected to electrical grid, further isolation is not required. It is also acceptable to power the MCU with a battery via the USB or barrel ports); b) Grid powered with USB isolation;

Power and signal isolation improves common-mode voltage, it enhances noise rejection, and it permits two circuits to operate at different voltage levels.

The USB Isolator provides protection against harmful noise, ground loops, surges, and spikes. It works with any 1.5Mbps (low speed) or 12Mbps (full speed) USB device.

(34)

It is particularly useful when paired with USB testing instruments, when it is necessary to separate or isolate earth ground (through the USB connector to the computer to the power plug) from circuit for high voltage, accident-protection, or floating ground needs. This USB isolator has its own isolated 5V power supply that can supply 100mA. This is for use with 5V power, 3.3V logic USB devices only. ◦ 52mm x 30mm x 10mm / 2" x 1.2" x 0.4" ◦ Weight: 8.6g c) Grid powered. Warning: No isolation (usually safe but rare situations could create a current loop to the electrical grid).

The primary sensor output is an amplified, rectified and integrated signal (AKA the EMG’s envelope) that will work well with a microcontroller’s analog to digital converter (ADC).

This version has the ability to output an amplified raw EMG signal by simply connecting the raw EMG signal pin to the measuring device instead of the SIG pin. The RAW output is centered about an offset voltage of +Vs/2. It is important to ensure that +V is the max voltage of the MCU’s analog to digital converter. This will assure the view of both positive and negative portions of the waveform. The amplification for the RAW output is not adjustable via the GAIN potentiometer. Main advantages: - it can be used for medical purposes - It interfaces with ARDUINO UNO

(35)

- It can be used non-gelled Reusable Electrode 3. OLIMEX SHIELD-EKG-EMG Fig. 2.2.2.4 EMG device [olimex.com]

This is an EKG/EMG shield that allows Arduino boards to capture Electrocardiography/Electromyography signals

It converts the analog differential signal, attached to its CH1_IN+/CH1_IN- inputs, into a single stream of data as output. The output signal is analog and has to be discretized to give the option of digital processing. This is done via dedicated ADC embedded in the MCU of the baseboard.

Its total gain is the product of the gains of each discretization stage: Instrumental Amplifier (G1=10), OpAmp with regulated gain (G2=6.101) and 3rd order ”Besselworth” filter (G3=3.56). Then,

Then, the Gtotal= G1*G2*G3= 10*(6.101)*3.56.

By the default, the G2 gain is set approximately ˜80. Then,

(36)

The 3rd order Besselworth filter’s cutoff frequency is set to fc=40 Hz. Main disadvantage: it is the bigger one 4. EMG Sensor Bitalino Fig. 2.2.2.5 EMG device [robotshop.com]

It is especially designed for surface EMG and works both with pre-gelled and most types of dry electrodes. The bipolar configuration is ideal for low-noise data acquisition and the raw data output allows it to be used for human-computer interaction and biomedical projects. Features: - Bipolar differential measurement - Preconditioned analog output - High signal-to-noise ratio - Small form factor (it is a small and compact device) - Raw data output - Easy-to-use - It interfaces with Arduino

(37)

PRO CONS EMG Detector (GROVE) - It processes signals coming from little muscles with amp and a filter; - No additional power supply; - It cannot be used for medical purposes; - It can be used only with the version of Arduino SEEDUINO 3.0; MYOWARE muscle sensor - Single supply medical device; - It interfaces with Arduino UNO; OLYMEX SHIELD-EKG-EMG - This is an EKG/EMG shield that allows Arduino boards to capture Electrocardiography Electromyography signals; - It is the bigger one;

EMG Sensor Bitalino - Bipolar differential measurement; - Preconditioned analog output; - High signal-to-noise ratio; - Small form factor; - Raw data output;

- It interfaces with Arduino;

- Not very handy w.r.t other devices; As can be seen from summary table the choice of using MyoWare Muscle sensor is the more adapt, thanks to its all positive features described above.

(38)

2.2.3 CONFIGURATION #3

Attys

In configuration 3 the choice of Attys was mainly related to the fact that is a new, modern and compact device and it seemed appropriate to thesis purposes. Below there is a brief description of its technical characteristics. Fig. 2.2.3.1 Attys device Technical specifications:

• Fully qualified Bluetooth dongles: ASUS-BT400 or Broadcom based dongles (BCM2045B)

• Fully assembled and tested with CE mark (industrial, domestic, research and educational use)

• Analogue inputs

- 2 channels

- Fully differential (instrumentation amplifier)

- Single ended or differential (GND acts as neg for differential measurements) - Resolution: 24 bit - CMRR: 120dB - Signal to noise ratio: 100dB - Full scale range: +/- 2.42V differential and +/-1.21V single ended - Input impedance: 1GOhm

(39)

- PGA with the following gain factors: 1,2,3,4,6, (default), 8 and 12 - Sampling rate: 125 Hz or 250 Hz - Internal temperature measurement - Programmable current source to measure resistance - ADS1292 A/D convert chip • Accelerometer - Resolution: 16 bit - Full scale range: 2G, 4G, 8G, 16G (default) - MPU9250 IMU • Compass (Magnetometer) - Resolution: 16bit - Full scale range: 4800.0E-6T - Sampling rate: 8Hz - AK8963 magnetometer • Two internal digital inputs (3.3V logic) • Communication method: rfcomm also known as the serial port emulation • Data format

- CSV (125 Hz) or based64 encoded binary data (125Hz/250Hz) with cr/lf after every sample

- Text commands to configure Attys

• Power supply: USB mini connector for charging. Battery lifetime approx. 8hrs for continuous transmission

• LED indicators for: connected (blue), charging (red), charged (green) and CPU status (green) • Dimensions: 28x65x65 mm • Weight: 100g • Mounting holes for cables ties All Attys programs save the data as tab separated values, which can be imported into all various software packages. It provides the pure signal as measured as its input: it saves data in its full resolution which can be post-processed later. ADVANCED OPTIONS

(40)

• Switch on a constant current to measure resistance. The current for both channels can be set as well.

• The Attys has an internal programmable gain amplifier (PGA). By increasing its gain the input range can be limited but, at the same time, the signal-to-noise ratio increases. • Switch on UDP broadcast to process data in realtime in another application. Attys command reference The Attys communicates with the host via the Bluetooth serial port emulation called “rfcomm” which means that it transmits text and receives text commands: • Data from Attys to host: either CSV or BASE64 • Data from the host to the Attys: text commands These are the text commands to send to the Attys to change its settings. All commands need to be transmitted without any space and are in general in the form single letter, equal sign and a number. If the command is sent successfully the Attys reports “OK” back. Only the x=1 command (start sending data) won’t send “OK”. Note that you first need to stop the data transmission with the command x=0 to issue any other command. • Stop data transmission: x=0 • Start data transmission: x=1 • Sampling rate: - 125 Hz (base64/CSV): r=0 - 250 Hz (base64): r=1 • Data format: Data is transmitted as unsigned integers. For the ADC converters the conversion s: where the ADC_GAIN is set by the a= and b= commands (default is a gain of 6). For the accelerometer and magnetometer the conversion is:

(41)

where the full-scale range for the magnetometer is 4800.0E-6F and the full-scale

range for the accelerometer is set by the t=command (see below). The default is 16G. the timestamp is 8 bit and wraps around. If samples cannot be transmitted the timestamp might have gaps so that missing samples can be detected. Adc_gpio carries in bits zero and one the internal gpio pins. Bit 7 of adc_gpio is set to one if power is connected to charging. o CSV data output (default): d=0 o Based64/binary (recommended for 250 Hz): d=1 o The short version with just the ADCs transmitted is (f=0,d=1): • Send status back to a terminal (for example putty): i=0 • Master reset: m=0 • Accelerometer full scale range: o 2G: t=0

(42)

o 4G: t=1 o 8G: t=2 o 16G: t=3 • Partial/full data set: o Full data set with all channels: f=1 o ADC data only: f=0 Note that this has no effect on CSV data.

• Gain/Multiplexer: this command uses the upper 4 bits (called here ggg) of a byte for the gain and the lower 4 bits to set the multiplexer (called here mmm): 0ggg0mmm The bits ggg set the gain for the ADC at 0: x6, 1:x1, 2:x2, 3:x3, 4:x4, 5:x8, 6:x12 Settings for the multiplexer are:

mmm=0 for normal operation, mmm=1 for connection to GND, mmm=4 for the internal temperature sensor and mmm=6 for an internal connection between both analogue “+” inputs for ECG/Einthoven recordings on both channels.

o Set mux/gain of ADC channel 1: a=0ggg0mmm as a decimal number, for example a=16 sets the gain to 1 because 16=00010000 and a=0 sets the gain to 6.

o Set mux/gain of ADC channel 2: b=0ggg0mmm as a decimal number.

• Constant Current: you can switch on a constant current on a channel to measure the resistance against GND. This is useful to determine the electrode resistance or to measure resistance in general. There are two commands: the i-command sets the current and the c-command sets the channel. o Switch on current on: § Channel 1”+” socket against GND: “c=1” § Channel 1 “-“ socket against GND: “c=2” § Channel 2 “+” socket against GND: “c=4” o Set current in uA: § 6nA: “i=0” § 22nA: “i=1” § 6uA: “i=2”

(43)

§ 22uA: “i=3”

Fig. 2.2.3.2 Attyscope panel

Attyscope for pc works in a Windows/Linux environment.

AttysScope saves data as tab separated values where every column of a tsv file represents a channel: Column number: 1. Timestamp in secs (from the moment REC is pressed) 2. Acceleration X in m/s^2 3. Acceleration Y in m/s^2 4. Acceleration Z in m/s^2 5. Magnetic filed X in T 6. Magnetic field Y in T 7. Magnetic field Z in T 8. Analogue channel 1 (unfiltered) in V 9. Analogue channel 2 (unfiltered) in V 10. Displayed/ filtered channel #1 11. Displayed/ filtered channel #2 12. ….

All channels shown on screen are saved from column #10, #11 …. with all filter operations applied.

(44)

FEATURES

• Direct data import into Python, MATLAB™, OCTAVE, R, GNUPLOT and other software packages. • Realtime filtering offering a highpass, lowpass, 50&60 Hz bandstop and amplitude detector and feed these signals then into Python or save them for later processing • For Windows and Linux and open source High gain Biosignals have vey small amplitudes in the region of 1mV or less. Set the gain to 500 or more to see the biosignals. EMG is about 1mV. Highpass filter/DC removal Electrodes generate DC potentials because they are wet inside and/or are in contact with skin chic releases sweat. Switch on the highpass filter for any biosignal: for EMG a 10 Hz cutoff is better which removes most cable movements. Mains filter

It’s role is to attenuate conducted radio frequencies that are normally present between the line and the equipment.

Any freely dangling cable will add changing DC shifts to the recording. TO Avoid lose cables it’ better to keep the mas short as possible. That improves the recording quality. For that reason the Attys should be worn, for example on a belt and close to the electrodes. It helps to reduce mains interference.

(45)

Fig. 2.2.3.3 Attys set-up In Fig.2.2.3.3 is shown the configuration set-up: it can be seen the Attys device, three cables of 30 cm of length, electrodes and a belt to keep the Attys close to the patient. This increases the stability and accuracy of signals. As said before, Attyscope interacts with many software. In this case the choose was to use Matlab for the signal postprocessing and Python for the signal processing. The game code is implemented instead in Java environment.

MATLAB

MATLAB is a fourth-generation programming language and numerical analysis environment.

Uses for MATLAB include matrix calculations, developing and running algorithms, creating user interfaces (UI) and data visualization. The multi-paradigm numerical computing environment allows developers to interface with programs developed in

(46)

different languages, which makes it possible to harness the unique strengths of each language for various purposes.

MATLAB is used in many fields such as image and signal processing, communications, control systems for industry, smart grid design, robotics as well as computational finance. This software is used to do the postprocessing of the signal. In Matlab it’s possible to create a very simple code to show a plot of the filtered signal, spectrum etc. PYTHON This software is used to do both postprocessing and realtime processing of the signal. In this section it will be illustrated the first option.

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python's simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.

Since there is no compilation step, the edit-test-debug cycle is fast. Debugging Python programs is easy: a bug or bad input will never cause a segmentation fault. Instead, when the interpreter discovers an error, it raises an exception. When the program doesn't catch the exception, the interpreter prints a stack trace. A source level debugger allows inspection of local and global variables, evaluation of arbitrary expressions, setting breakpoints, stepping through the code a line at a time, and so on. The debugger is written in Python itself, testifying to Python's introspective power. On the other hand, often the quickest way to debug a program is to add a few print statements to the source: the fast edit-test-debug cycle makes this simple approach very effective

(47)

JAVA Java is a general purpose computer-programming language, one of the most popular used. It is open, fast, powerful and runs on any platform. Types of application that run on Java: 1. Desktop GUI applications 2. Mobile applications 3. Embedded Systems 4. Web applications 5. Scientific applications

2.3 WORKFLOW

2.3.1 CONFIGURATION #1

In the first scenario LabVIEW controls SolidWorks and Arduino is connected to it. The initial workflow is:

The role of SolidWorks is to create a 3D model, LabVIEW creates different motion profiles (e.g. setting different dimensions) and NI SoftMotion allows interfacing the 3D model with LabVIEW. Signal that comes from Arduino in LabVIEW can control the motion profile. In this scenario it is used only an EMG; thus a single signal comes from the patient. For this reason the patient can control only one dimension of the 3D CAD. Initially the EMG was replaced by a potentiometer because it was easier and more comfortable to test the connection between this one and LabVIEW.

(48)

As it can be seen in schematic n.1, the connection between LabVIEW and Arduino is through wires and in the second one through the implementation of a wireless connection. The last step is to replace the potentiometer with an EMG device. Roles are the following: 1. Arduino as a controller to handle the position of CAD model 2. LabVIEW as designer of the algorithm 3. CAD model is made using SolidWorks

The connection between SolidWorks and LabVIEW is a MASTER-SLAVE communication model:

- MASTER: LabVIEW (the system let start the communication, receive inputs etc.)

-

Output (movement of the 3D object designed in SolidWorks) can be obtained

(49)

Arduino sends analog signals to generate motions in the CAD models. Analog signals are sent using potentiometer, whose value varies between 0V and 5V.

The conversion of the voltage in form of degrees permits the rotation of CAD models.

An alternative is also implemented. Instead of using SolidWorks to create the object to be animated, it’s possible to exploit a LabVIEW module call SCADA (Supervisory Control and Data Acquisitions). It allows to monitor, gather and process real-time data and it provides a list of items that is possible to animate. The workflow, in this alternative scenario, is the following:

1.3.2 CONFIGURATION #2

In this configuration the focus is on the implementation of the animation through the using of Blender. MyoWare and Blender communicate each other trough Arduino. In particular, Arduino sends a message to Blender (Python). When Blender receives the message it starts the animation, starting at the same time to read from the serial port.

In these tests potentiometers and MyoWare were used in combination in order to implement more complex scenarios. As described before, MyoWare is a single channel and, for this reason, it can control only a single movement. In particular, implementation focused on two tests: - The first one referring to the animation of an arrow built in Blender: the aim is to move an arrow of 360 degrees through the input voltage (0-5V) coming from the potentiometer. - The second test refers to move a cube in 6 directions; 5 of these movements are controlled by the potentiometers, the 6 one is controlled by the MyoWare.

Riferimenti

Documenti correlati

Experimental tests show that the eigenvalues of P are all grouped in a circle with center in the origin and radius about 0.3 except one which is near 1.. Moreover, they show that

Here I decided to limit the research to the study of the evolution of a divisive historiography and a historiographic-political journalism which showed up both

Therefore, this study compares two RT programs, one carrying each set to muscle failure (training to failure, FAIL), the second with a reduced number of repetitions per set

Therefore the product of the absolute values of the roots of one of the polynomials g and h is equal

The frequency separation between the reference laser and the + laser beam is measured with a Fabry-Perot spectrum analyzer and the ring laser perimeter length is corrected in order

Thanks to the innovative approach to design and a high-class building management system, the object is expected to decrease the yearly energy consumption by 50 %, 15 % of

La mobilità della Curia pontificia nel Lazio (secoli XII-XIII), a cura di Sandro Carocci, Roma, Istituto storico italiano per il medio evo, 2003 (Nuovi Studi Storici, 61),

The compassionate perspective, based on the insightful work of the professional sociologist, makes the difference between a sociological practice based on the opposite