Assisted Writing for Tremor Patients

A Thesis Presented By

Siri Eileen Belton

to

The Department of Mechanical and Industrial Engineering

in partial fulfillment of the requirements for the degree of

Master of Science

in the field of

Mechanical Engineering

Northeastern University Boston, Massachusetts

August 2016

ii

ABSTRACT

A result of hand tremor is illegible handwriting. The goal of this research is to develop a set of non-invasive solutions for handwriting in tremor patients. A system previously conceptualized in [Che Ou, MS Thesis, Northeastern University] is examined to reduce the effects of tremor in handwriting. The system models that of a swinging pendulum-like writing inside a holding implement, with various styles of controllers to counter the tremor movement by applying forces to the stylus. To determine potential methods of reducing the tremor movement translated to the -tip during writing, a simulation and experimental testing was performed. The simulation tested a variety of controller configurations, specifically with partially available measurement states. The controller effort was then used to calculate the efficiency of each case: comparing the benefits and energy costs. The greatest improvement was seen with the full state controller, while partial state controllers were the most efficient. In simulations, the passive case, i.e., with no actuator turned on, led to a steady state improvement over a regular pen model of 88.3% in pen-tip oscillation amplitude, but the passive controller had a significantly slower settling time than any actively controlled case. A fully passive physical prototype was then developed to experimentally determine the reduction in vibration energy related to the tremor frequency at the pen-tip. Testing occurred in two stages, first as a pilot study with a healthy faculty volunteer mimicking tremor and second with a mechanical stage, which provided an emulated input tremor force. Repeatability of testing with human subjects remains to be assessed as experiments need to be conducted with more subjects to allow for statistical analysis. However, from the pilot results obtained, there was an apparent improvement in vibration energy leading to the development of the mechanical stage. Testing with this stage shows a correlation between contact pressure where the pen-tip interacts with the surface and the vibration energy at the emulated tremor frequency. The improvement in terms of energy reduction, in relation to the pressure applied to the writing surface, is apparent in the frequency response: averaging 15% to 33% from the baseline corresponding to a regular pen. Faculty advisor: Rifat Sipahi (MIE) MS Thesis readers: Beverly K. Jaeger (MIE) and Andrew Gouldstone (MIE) iii

Acknowledgments I would first like to thank my advisor Professor Rifat Sipahi of the Mechanical and Industrial Engineering department at Northeastern University. Prof. Sipahi was always happy to help and optimistic for future results and work. He consistently encouraged my work and allowed me to be independent while steering me in the right direction when I felt lost. I would also like to thank Professor B. Kris Jaeger and Professor Andrew Gouldstone from Northeastern University as the thesis readers for this work and for their expertise. They have been an integral part of this work since its inception and their continued support has always been appreciated. Thanks to all the other students I have met through this research since I joined the team: Emilie Dubois, Larissa Hinckel Cavalcante, Moshe Ohayon, Henrique Morikawa, and especially Naiqian Zhi. Another thanks to Tang Hao and Prof. Gouldstone for their help with OCT imaging. Finally thanks to all my lab mates and friends for their continued and unfailing support during my graduate studies at Northeastern. This work was supported in part by US National Science Foundation Award #1133992. Any opinions in this thesis are those of the author and do not necessarily reflect the viewpoints of the funding agency.

iv

Table of Contents

ABSTRACT ...... ii Table of Contents ...... iv List of Figures ...... v List of Tables ...... vi Chapter 1: Introduction ...... 1 Background and motivation ...... 1 Chapter 2: Literature Review ...... 3 Recap of existing solutions for writing ...... 6 Chapter 3: Simulation Studies ...... 7 Prior work ...... 7 Simulation development ...... 9 Case 1 ...... 10 Case 2 ...... 12 Case 3 ...... 14 Case 4 ...... 15 Case 5 ...... 17 Comparison of cases ...... 18 Controller effort ...... 19 Efficiency analysis ...... 21 Chapter 4: Experimental Testing ...... 23 Hypothesis ...... 23 Assistive devices ...... 23 Passive Device ...... 24 Active Device ...... 25 Testing the passive device ...... 26 Pilot test ...... 27 Variability of EMS testing ...... 31 Testing with the mechanical stage ...... 33 Frequency response from mechanical testing ...... 34 Effects of pressure on frequency response ...... 37 Discussion ...... 39 v

Chapter 5: Conclusions ...... 41 References ...... 44 Appendix A: Maple code to find constraints for controller optimization ...... 48 Appendix B: Sample FFT code in MATLAB ...... 50

List of Figures Figure 1: Weighted writing devices suggested to reduce tremor [15]. a) Weighted universal holder [34], b) Heavy weight pen [35], c) Poppin heavy weight metal pen [36] ...... 4 Figure 2: Contact based writing devices to stabilize the hand. a) Sammons Preston steady hand magnetic writing instrument [37] b) Maddak steady write sta-pen writing instrument [38] c) Steady write pen [39] 4 Figure 3: Grip devices that can help tremor patients write. a) Ring pen ultra writing aid [40], b) PenAgain [41] ...... 4 Figure 5: Active prototype using a Voice Coil Acuator to counter the movement caused by tremor [46]. . 5 Figure 4: Active device developed by a capstone group at Northeastern University during spring 2016. The design uses a motor-actuated belt to control the position of the pen-tip. [45] ...... 6 Figure 6: Schematic of proposed design ...... 7 Figure 7: Simulink model to simulate the swing of the pendulum ...... 9 Figure 8: Bode plot of pen-tip speed for case 1, without a controller...... 11 Figure 9: Pen-tip movement for case 1, the uncontrolled system ...... 11 Figure 10: Bode plot of pen-tip speed for case 2, with four states controlled...... 13 Figure 11: Pen-tip movement for case 2, with a 4 state controller ...... 13 Figure 12: Bode plot of pen-tip speed for case 3, with 3 states controlled...... 14 Figure 13: Pen-tip position in case 3, with a 3 state controller ...... 15 Figure 14: Bode plot of pen-tip speed for case 4, with 2 states controlled ...... 16 Figure 15: Pen-tip position in case 4, with a 2 state controller ...... 16 Figure 16: Bode plot of pen-tip speed for case 5, with passive controller ...... 17 Figure 17: Pen-tip position for case 5, the passively controlled system ...... 18 Figure 18: Pen-tip position for the five cases discussed ...... 19 Figure 19: Comparison of Controller Efforts ...... 20 Figure 20: Controller effort of cases 3 and 4 ...... 20 Figure 21: CAD model of passive assistive device ...... 24 vi

Figure 22: Prototype with foam exposed and assembled ...... 25 Figure 23: Active prototype design ...... 26 Figure 24: EMS device placement on the ulnar and medial nerves to induce tremor style shaking ...... 27 Figure 25: 3 rings of an Archimedes spiral ...... 28 Figure 26: Example spirals for both the baseline and the free-swinging prototype...... 29 Figure 27: Orientation of the parallel and perpendicular cases. The parallel grip indicates when the shaft is parallel to the forearm, while the perpendicular indicates the shaft is perpendicular to the forearm. 29 Figure 28: Frequency responses resulting from EMS testing ...... 30 Figure 29: Pressures from EMS tests performed for [49] and as a confirmation. A unit of pressure here correlates to approximately 0.00363 N ...... 32 Figure 30: Mechanical Stage used for testing ...... 33 Figure 31: Frequency response of the control, fixed pen ...... 34 Figure 32: Frequency response of the passive prototype, free swinging pen ...... 35 Figure 33: Average Pressure for all samples and the non-contact data. Each unit of pressure relates to 0.00363 N ...... 36 Figure 34: Averaged Frequency responses for 59 samples: 30 control (Fixed) and 29 free swinging ...... 37 Figure 35: Scatter plot correlating pressure and peak magnitudes with linear fits, the pressure unit is 0.00363 N ...... 38 Figure 36: Scatter plot correlating pressure and peak magnitudes with horizontal pressure markers and highlighted corresponding points, pressure is 0.00363 kg ...... 39

List of Tables Table 1: Symbols values and units used in the system ...... 8 Table 2: Summary of pen-tip position, velocity, and controller effort for each case ...... 21 Table 3: Efficiencies for each case ...... 21 Table 4: Papers used with varying roughnesses ...... 31 Table 5: Points correlating to horizontal pressure marker ...... 39

1

Chapter 1: Introduction

Background and motivation Tremor is a bodily shaking caused by involuntary muscle contraction and relaxation. It can occur in various areas of the body and at varying times. Generally, tremor is categorized as postural, rest, or action tremor. Postural tremor often occurs in the neck or vocal chords. Rest tremor occurs in the limbs when the muscles are relaxed, while action tremor occurs during movement or during a particular task [1]. Herein, action tremor is the focus, particularly action tremor occurring in the hands. For clarity, oscillations will be used to refer to the movement of the pen-tip, while vibration refers to the movement due to the stimulus, i.e., emulated tremor, or general vibration response of the pen, i.e., pen-tip movement. A number of neurological disorders can contribute to tremor, including neuro-motive disorders such as multiple sclerosis, Essential Tremor (ET), and Parkinson’s Disease (PD). ET and PD are often confused as early symptoms are similar. ET tends to be characterized by an active tremor and PD a passive or rest tremor, but this can vary by case [2]. For ET, 90% of people are considered to have active tremor and tremor presents itself in the thoracic limbs [1]. ET is the most prevalent tremor disorder, affecting roughly ten million people in the United States alone [3] [4]. Thus it is the focus of the research herein. Treatment options for ET include pharmaceuticals, surgery, botulinum toxin injections, and various alternative medicines. Unfortunately, treatments are limited due to insufficient understanding of ET’s pathogenesis [4] [5]. While several pharmaceuticals may be of benefit, none are tailored specifically for ET patients [1]. Propranolol was the first drug approved by the FDA for the treatment of ET in 2010 [6]. Propranolol, also known as Inderal, is a beta-blocker primarily prescribed for high blood pressure [1] [6] [7], as is primidone [1]. Other medications commonly prescribed are anti-seizure medications, anti-anxiety medications, or anti-depressants, each with varying degrees of success [7]. As with PD, deep brain stimulation is an option, but has the obvious risks associated with brain surgery [8]. Further studies have shown that botulinum toxin type A injections can be useful in pharmacologically resistant cases [9]. In July of 2016, the FDA approved a treatment that uses ultrasound to ablate tissue in the brain, with magnetic resonance imaging (MRI) to guide the treatment throughout the surgery [10]. As little is known about this condition, an effective therapy or set of assistive devices would have a positive impact on the millions affected by ET. Hand tremor, in particular, affects fine-motor skills, which can turn the simplest task into a difficult and embarrassing ordeal. Fine-motor activities range from essential tasks, such as eating, drinking, or inserting a key, to non-essential tasks, such as applying makeup. Those with a tremor disorder often suffer from depression [11] and cite embarrassment due to the difficulty of accomplishing day-to-day tasks. The psychological impacts can also deter patients from applying for promotions or lead them to retire early [1]. 2

Writing is an essential skill in modern society. There will always be a need for writing, most obvious is the need for signatures. Signatures are vital for security purposes and are often rejected as a patient’s symptoms progress. While ET affects 1% to 6% of adults over 40 years of age [4], it can affect any age group, including children [12]. The inability to write clearly can affect learning during childhood; teaching writing has been shown to improve “reading comprehension, reading fluency, and word reading” [13] [14]. For certain tasks, an electronic solution, such as filtering, is feasible; however, among elderly patients, it can be uncomfortable or unrealistic to learn new technology as a replacement for writing. Furthermore, typing often leads to double tapping, reducing one’s efficiency [15]. Other electronic solutions can be limiting due to size or compatibility. Ideally, a solution should allow patients to write clearly without limiting their mobility or their material choices. Evaluating fine motor abilities presents another challenge. The desired path of each word varies with a person’s handwriting and can prove unpredictable. As writing is a precision task, fine motor skills should be tested to determine the effects of any assistive protocol. To measure fine motor skills, several clinical tests can be employed; a common test associated with writing, for tremor patients, requires the affected patient to draw spirals [16] [17] [18] [19]. These spirals are used as a clinical test for the severity of the neurological disorder, but are not quantitatively scored. This standard depends on a doctor’s evaluation or comparison to previous tests. Strategies have been introduced to quantifiably measure the quality of handwriting between static samples from patients [20]. A phenomena of neuro-motive disorders is that resulting tremors occur within a specific range based on the disorder [21]. The tremor from ET is found to occur between 4 to 12 Hz [1] [22] or 8 to 12 Hz [23]. Using vibration analysis, the efficiency of assistive solutions can be empirically determined for writing by measuring the vibrational energy at dominant frequencies. Specifically, this energy and its frequency components can be measured by performing frequency response analysis and using Fast Fourier Transform (FFT) tools with the movement data collected in the time domain. Another phenomena associated with hand tremor is its directionality, depending on the muscles activated by the tremor. The shaking of the hand can be caused by activating the distal muscles, those towards the hand, the proximal muscles, those towards the body, or more likely a combination thereof. The muscle activation that causes tremor varies by person. Thus any assistive or corrective device may be limited to a single plane, but should allow that plane to be rotated to fit the needs of the individual. The goal of this research is to develop a set of non-invasive and easily accessible solutions that maintain the desired movement of writing while minimizing the undesired vibrations caused by tremor at the pen-tip. Furthermore, a systematic approach to quantitatively test tremor in handwriting would be a valuable contribution. 3

Chapter 2: Literature Review There are a variety of assistive products on the market and publications to develop devices for ET patients. Related to hand tremor, devices exist to help users in a variety of tasks, such as drinking [24] [25] and eating [26]. Studies in [24] and [25] presented passive devices designed to reduce spillage while drinking. In [26], authors designed an adaptive filter to control the movement of an eating utensil. A portable version of [26] was developed in the UK and released to the market in 2014 called Liftware [27]. Orthotic devices are another approach, to attenuate tremor in the wrist [28]. Furthermore, some software solutions can be developed for various applications or programs. Software solutions rely on averaging and predictive methods to determine the desired path [29]. Stabilization devices have also been used for precision activities, such as surgery by healthy individuals [30]. Other temporary solutions for tremor patients can be gleaned from PD. Patients with PD often have difficulty speaking at an audible volume and walking with an average gait. A technique, called the Lee Silverman Voice Treatment (LSVT), was developed to temporarily speak at a regular volume and later to step at a normal length by first “speaking loud” or “walking big” (taking abnormally long steps). In PD, this is largely considered a temporary solution for bradykinesia rather than tremor [31]. Anecdotally patients with ET have found that performing other precision tasks, such as knitting, then improves precision for a period of time afterwards [32]. At Berkeley, an educationally assistive pen was proposed to aid autistic children called the Pika pen. This pen included active sensors and actuators to give children feedback in real-time to assess their handwriting. This device used lights, speakers, and a vibrator to alert the user when they use “improper pen-tip pressure, grip pressure [or] … inclination angle of the pen” [33]. These factors were identified as the indicators for poor handwriting [33]. Ultimately, tremor vibrations should be reduced, but the intended writing movement, also a type of vibration, should be minimally affected. There are several devices recommended anecdotally or designed specifically for this task. The most common assistive writing devices for tremor are passive devices designed to increase the weight (Figure 1). By increasing the weight of the pen, tremors can be reduced along with the clarity of the written words. These are also known to eventually cause fatigue. Of the devices in Figure 1, Figure 1(a) is the only product specifically designed with tremor patients in mind. Most devices, such as Figure 1(b) and (c) are not marketed or designed with an affected user in mind, rather ET patients find anecdotal evidence of certain products and share them via forums or support groups [15]. Other passive devices are designed to increase the contact area between the writing utensil and the page (Figure 2), designed to help those with arthritis, PD, or others with affected hand motion. Such devices use the friction generated to potentially to decrease both the tremor’s movement and the movement intended for writing. 4

Figure 1: Weighted writing devices suggested to reduce tremor [15]. a) Weighted universal holder [34], b) Heavy weight pen [35], c) Poppin heavy weight metal pen [36]

Figure 2: Contact based writing devices to stabilize the hand. a) Sammons Preston steady hand magnetic writing instrument [37] b) Maddak steady write sta-pen writing instrument [38] c) Steady write pen [39]

Figure 3: Grip devices that can help tremor patients write. a) Ring pen ultra writing aid [40], b) PenAgain [41]

Assistive devices are also on the market that reduce the need to grip the pen, seen in Figure 3. As those with tremor either have resting tremor or active tremor, changing the type of activity can change the severity of the tremor. Assistive devices which serve to relax the hand during writing would change the activity from entirely active to partially resting. In the tremor community, this has been noticed anecdotally. By focusing elsewhere, away from the hand, the tremor can become less severe [32]. 5

Another approach, in [42], used a spring damper system to develop a passive pen that reduces the oscillations caused by tremor. The spring damper systems proposed used double-leaf springs, magnets, or sponges. The effectiveness of various designs were tested in [43] via user response, demonstrating the need for an effective evaluation process. These designs investigated were all passive, which allow for cheaper manufacturing and increased access for the general user.

Figure 4: Active prototype using a Voice Coil Acuator to counter the movement caused by tremor [44].

An active assistive pen was designed in [44] using a Voice Coil Actuator (VCA) to reduce the tremor vibrations (Figure 4). This VCA, which is a linear actuator, acted parallel to the stylus of the pen. When the VCA was actuated, the pen-tip was moved to counter the motion of the tremor. While human testing was not performed, an experimental rig was developed to mimic tremor. The work presented in later chapters which relate to the active system is in part a continuation of the work performed in [45], where the mathematical model of a system to oppose the tremor vibrations was presented (Chapter 3). In the cited work, the author also presented a prototype for a “magnetically controlled tapping pen.” This device, essentially, takes the average of any strokes applied by removing the pen-tip from the writing surface for the majority of each oscillation. Effectively, this eliminates the range of movement caused by tremor. This device was actuated using an electromagnet and permanent magnet attached to a stylus. By activating the electromagnet at certain time intervals, the stylus was lifted from the page. The prototype developed yielded promising results, tested with an oscillating mechanical system to mimic a hand’s tremor. Success was determined based on the resulting amplitude of the marks drawn. Further work is needed to measure the frequency at which to actuate the electromagnet, to moderate phase, and determine tapping speed, and improve the ergonomics which would ensure an appropriate distance from the page. These modifications would likely require an observer, to estimate system states and prepare proper control actions, and require the integration of several sensors to personalize the device for each 6 individual. This method has an added benefit as it can function independently of the directionality of the tremor. Another active device was developed by an undergraduate capstone group at Northeastern University in the Mechanical and Industrial Engineering department during the spring of 2016, primarily inspired by [45] and this thesis work. This active device used a motor to control the motion of the pen-tip, shown in Figure 5. A string was wound around the motor and attached to the pen-tip, allowing the rotation of the motor to wind and unwind the string as necessary in order to control the motion of the pen-tip [46].

Figure 5: Active device developed by a capstone group at Northeastern University during spring 2016. The design uses a motor- actuated belt to control the position of the pen-tip. [46] Recap of existing solutions for writing Each of the surveyed designs and products have advantages and disadvantages. While the commercially available passive devices do not have scientific evidence to prove their effectiveness at reducing the amplitude of tremor vibrations, they have anecdotally been found to help write more clearly. If the characteristics involved with writing and tremor can be further understood, these devices could be further improved as cheap, maintainable, and easy-to-use devices. The active controllers proposed in previous literature can be improved upon by developing a systematic testing procedure to objectively and qualitatively assess tremor in writing. A quantifiable improvement would be a valuable contribution to this field of study. 7

Chapter 3: Simulation Studies

Prior work The current research deals with a system similar to that discussed in [45]. The assistive design consists of a pen stylus acting as a pendulum within an outer shell held by an affected user, as depicted in Figure 6. The swinging stylus, in blue with mass m, rotates around the fulcrum, in orange, within an outer case, in green. The outer case, with mass M, is acted on by the force of the hand, F, and moves across the page in 푥 direction with velocity 푥̇. The direction of 푥 and 푥̇ are determined by the directionality of the tremor exhibited by individual patients. The stylus, of length L, swings with angular velocity 휃̇ and angle 휃 with respect to the outer case. At distance ℓ from the fulcrum, the controller, u, and spring damper system, k and b, are applied to the stylus. The controller and spring damper system opposes the motion of the stylus, limiting the effects of tremor on the user’s handwriting. Finally, a viscous friction term, c, is considered to model the interaction of the pen-tip with the paper.

c

Figure 6: Schematic of proposed design 8

In this configuration, four independent states determine the dynamics: the pen position (푥), the pen velocity (푥̇), the angle of the inner case’s swing (휃), and the angular velocity of the swing (휃̇). To limit the pen’s movement, this model assumes that the pen position (푥) is measurable. For simplicity, inclination of the outer case is ignored. The mathematical model related to the system is then given by a set of non-linear equations: 1 1 1 (푀 + 푚)푥̈ + 푚퐿휃̈ cos(휃) + 푚퐿푥̇휃̇ 2 sin(휃) + 푚푔퐿 sin(휃) + 푐푥̇ + 푐퐿휃̇ cos(휃) − 퐹(푡) = 0 2 2 2 1 1 1 (퐼 + 퐿2푚) 휃̈ + 푚퐿푥̈ cos(휃) − 푚퐿푥̇휃̇ sin(휃) + 푚푔퐿 sin(휃) + 푘ℓ2 sin(휃) cos(휃) + 푐퐿휃̇ cos(휃) 4 2 2 + (푐퐿2 + 푏ℓ2)휃̇(cos(휃))2 − 푢(푡)퐿 cos(휃) = 0 This set of equations was specifically used to minimize the velocity of the pen-tip rather than the position. For this, small motion is assumed and linearizes the system. From this linear mathematical model, an optimization was developed to determine the four controller gains, k1 through k4 to act on the four states, via constraints found with Routh’s stability criterion, varying the system settling time associated with dominant pole real part, σ, and from the frequency response function, which was to be minimized at the tremor induced frequency, ω. The values associated with the system are shown in Table 1. Table 1: Symbols values and units used in the system Variable [Units] Case 1 Cases 2, 3, and 4 Damping coefficient b [Ns/m] 0 0.003 Viscous damping c [Ns/m] 5.714 Spring stiffness k [N/m] 999999999 10 Mass of the inner stylus m [kg] 0.005 Mass of the entire assembly M [kg] 0.02 Length of the L [m] 0.15 Length from pivot to applied controller ℓ [m] 0.1 Gravitational constant g [m/푠2] 9.81

The objective function was optimized in MATLAB using fmincon in order to find the minimum of the constrained nonlinear function, see details in [45]. Setting ω (omega) to 50 rad/sec, which is within ET’s tremor frequency range, the objective function related to frequency response given by: f = sqrt(((0.573750e-4*omega^2+.30600*k(3)+.3172569750-0.459000e-1*k(1))^2+(0.918000e-4+.30600*k(4)-0.459000e- 1*k(2))^2*omega^2)/(((0.8526154500e-2+0.765000e-2*k(4)-0.1147500e-3*k(2))*omega^2+.2622726000*k(1)-1.812806355- 1.74848400*k(3))^2+(0.24384375e-5*omega^3+(-0.8455969575e-2-0.765000e-2*k(3)+0.1147500e-3*k(1)- 1.74848400*k(4)+.2622726000*k(2))*omega)^2));

9

The constraints on k1 through k4 were found using the Maple code in Appendix A. This code allows for the variation of σ related to the real part of the domain and pole of the system, in terms of controller gains. All cases described herein used a sigma value of 8, corresponding to a settling time of approximately 0.5 seconds (4/σ). Furthermore, appropriate lower and upper bounds can be set for optimized gain values. Here they were positive and negative infinity for consistency. Simulation development For the current work, the same framework was adopted; however, realistically all states may not be measureable. A simulation was developed to compare different scenarios, and to determine the optimal controller gains. For this, a similar optimization framework described in the prior work was developed, and new controller gains for each scenario were obtained. Following the previous work and optimization, a simulation of the system in Figure 1 was built in Simulink, seen in Figure 7. This model predicts the amplitude of the pen-tip movements (which helps to confirm the results obtained from the optimization), while also allowing the calculation of the controller effort required. This simulation can be modified to allow for various combinations of states to be controlled.

Figure 7: Simulink model to simulate the swing of the pendulum

The model uses state space to determine the output pen-tip velocity. The matrices seen below, found using the values from Table 1, were constant for each matrix, except 퐴 which depends on the stiffness and damping coefficients of the passive aspect of the pen,

10

퐴 = 0 1 0 0 2푐 9푚푔 + 8푘퐿 6푐퐿 + 8푏퐿 0 푚 + 4푀 3(푚 + 4푀) 3(푚 + 4푀)

0 0 0 1 12푀푐 + 6푚푐 18푀푚푔 + 16푀푘퐿 + 18푚2푔 + 16푚푘퐿 36푀푐퐿 + 16푀푏퐿 + 18푚푐퐿 + 16푚푏퐿 0 − − − [ 퐿푚(푚 + 4푀) 3퐿푚(푚 + 4푀) 3퐿푚(푚 + 4푀) ] 0 −47.06 퐵 = [ ] 0 3137 퐶 = [0 1 0 0.15] 0 47.06 퐸 = [ ] 0 −470.6 The input force applied to the system is a sinusoidal wave with an amplitude of 1N and a frequency of 50 rad/s, equivalent to 7.9577 Hz. Here, the simulation was used to review 4 variations of controller combinations to determine the improvement and the cost for each. The cases investigated were: Case 1: the uncontrolled pen. Effectively, this acts as the baseline for all other cases. This case mimics the user’s movement without damping the tremor, as though holding a regular pen. In the simulation, this is modeled by setting the controller and damping coefficient to zero and the stiffness coefficient to a large value to act as a stiff pen. Case 2: measuring four states, 푥, 푥̇, 휃, and 휃̇. As described in [45], this case uses the pen position (푥), the pen velocity (푥̇), the angle of the pen’s swing (휃), and the angular velocity of the swing (휃̇) to create the control actions. Case 3: measuring three states: 푥̇, 휃 and 휃̇. Comparable to case 2, except this assumes the pen position is unknown. For this case, at least two sensors would be required: an accelerometer and an encoder or two accelerometers. Case 4: measuring two states: 휃 and 휃̇. To measure these two states, a single encoder could be used, resulting in a simpler system and potential reduction in processing needs. Case 5: only passively controlling the system, all active controller gains were set to zero. This does not rely on any actuator and requires no sensors, power source, or phase control. This case is also explored further in the following chapter. Case 1 Matrix A and the control matrix, K, for this case are given by; 11

0 1 0 0 0 134 4.7059 × 109 202 퐴 = [ ] 0 0 0 1 0 −24200 −3.1373 × 1011 −3630.1 퐾 = [0 0 0 0]

Figure 8: Bode plot of pen-tip speed for case 1, without a controller.

Figure 9: Pen-tip movement for case 1, the uncontrolled system 12

In the uncontrolled case, the model simulates a regular pen reacting to the tremor vibrations. Using the model and setting the controller and damping coefficient to zero while approximating the spring stiffness to infinity. This state space model produces the Bode plot in Figure 8. At 50 rad/s, the resulting magnitude is 0.171 m/s, correlating to the pen-tip speed, where 푠푝푒푒푑 = 푥̇ + 퐿 × 휃̇ as confirmed in the model. This uncontrolled vibration led to the pen-tip movement seen in Figure 9, which ranges 6.92 mm. This is the benchmark set to compare all other cases. Controlled cases should be evaluated based on maximum pen-tip oscillations of 6.92 mm, as a response to a sinusoidal input of amplitude 1 N at 50 rad/s. The goal is to improve upon this value, reducing the amplitude of the pen-tip oscillations.

Case 2 Case 2, with information from four states and the passive system: the spring damper system to passively reduce oscillations. Thus, the 퐴 matrix differs from case 1, since c and b contribute, as in the following cases. 0 1 0 0 0 134 49 20 퐴 = [ ] 0 0 0 1 0 −24200 −3253 −3631 This system would require an observer to measure the first state, x, since this is not directly measurable. However, here we do not pursue this option and assume that 푥 is directly measurable. The controller used in this case was optimized as; 퐾 = [4962.6 307.5 755.3 46.1] The response for a 4 state controller mirrored the results found in the previous work [45]. The resulting Bode diagram is shown in Figure 10. The resulting pen-tip speed at 50 rad/s is 0.0046 m/s, which correlates to an improvement of 97.31% from the pen-tip speed in case 1, where the pen’s motion was uncontrolled. The resulting pen-tip motion, as a result of a 1 N input, can be seen in Figure 11. The maximum displacement is found to be 3.594 mm. This represents a 48.06% improvement from case 1. However, the movement varies from 3.406 mm to 3.594 mm: a total 0.188 mm oscillation. This suggests a 97.28% improvement. 13

Figure 10: Bode plot of pen-tip speed for case 2, with four states controlled.

Figure 11: Pen-tip movement for case 2, with a 4 state controller 14

Case 3 Case 3 is a system where the x state is not measureable. This case uses the same passive spring damper system, thus has the same 퐴 matrix, as in case 2. The optimized controller for this case is; 퐾 = [0 495.3 20.1 79.3] which yields the Bode diagram in Figure 12. At 50 rad/s, the pen-tip speed is 0.0539 m/s. This represents a 68.48% improvement over the uncontrolled system in case 1, but performs poorly compared to case 2. Case 3 has 1170% of the pen-tip velocity in case 2.

Figure 12: Bode plot of pen-tip speed for case 3, with 3 states controlled.

The pen-tip position in case 3, resulting from the model with a 1 N input force, can be seen in Figure 13. The pen-tip has a maximum displacement of 4.577 mm, but oscillates 2.154 mm. Case 3 is not as effective as case 2 at reducing oscillations, 1146% of the pen-tip oscillation. However, compared to the uncontrolled system in Case 1, Case 3 demonstrates a 68.89% improvement in movement, without the offsetting displacement. 15

Figure 13: Pen-tip position in case 3, with a 3 state controller

Case 4 Case 4 uses the same passive spring-damper system while also actively measuring the angle and angular velocity, 휃 and 휃̇ for controller actions. For the model, this would use the same 퐴 matrix as used in cases 2 and 3. The optimized controller for this case is: 퐾 = [0 0 −0.6042 0.0815] The bode response for the pen-tip velocity of this system can be seen in Figure 14. The resulting pen-tip speed at 50 rad/s is 0.0552 m/s, a 67.7% improvement from the uncontrolled system. However, from the three state controller this case was nearly identical: comparably 2% worse than the pen-tip speed in case 3. The pen-tip position, seen as a response to the two state controller in Figure 15, results in a maximum 4.605 mm displacement, a 33.45% improvement. The pen-tip oscillates 2.209 mm, a 68.07% improvement. 16

Figure 14: Bode plot of pen-tip speed for case 4, with 2 states controlled

Figure 15: Pen-tip position in case 4, with a 2 state controller 17

Case 5 The final case, with only a passive controller, uses the A matrix from cases 2 through 4, but all controller states were set to zero. The resulting Bode plot is seen in Figure 16 and the pen-tip position in Figure 17. The Bode plot shows a magnitude of 0.0236 m/s at 50 rad/s, an improvement of 86.6% from the uncontrolled state. This is 513% of case 2’s speed, 56.2% improvement from the speed in case 3, and 57.3% from case 4.

Figure 16: Bode plot of pen-tip speed for case 5, with passive controller

The pen-tip position for this case deviates from the trend seen in the other cases. This case has a steady state movement from 3.096mm to 3.977 mm, an variation of 0.81mm, 88.29% improvement from the uncontrolled system. In amplitude of oscillation, compared to the other controlled cases, this case is 430.1% of the four state controller in case 2. The passive case has improved results over cases 3 and 4: 62.4% and 63.3% improvement from each case, respectively. The trend of this case has a much longer settling time. The actively controlled cases reach steady state within a second, while this passive case takes approximately 7.9 seconds to reach variations of less than 2%. This length of time is not appropriate for our purposes, as writing occurs in irregular intervals with constant variation. However, the passive spring-damper coefficients were not specifically optimized, so further tuning could allow for improved oscillations and/or a faster response to the system. Particularly when considering end-user acceptance, the response time should be effectively immediate. 18

Figure 17: Pen-tip position for case 5, the passively controlled system

This case is similar to the model that is further explored in the following chapter as a passive prototype was developed and tested. Although the system varies slightly from the prototype tested, these results seem promising for a passive system to effectively counter tremor. Comparison of cases The resulting amplitude of the pen-tip shows a significant reduction in oscillation from the uncontrolled case when any of the controllers were used, as seen in Figure 18. The four state controller from case 2 had a significant improvement over the uncontrolled case. However, cases 3 and 4, with three and two states controlled, respectively, had nearly identical movements. Each of the controlled states follow a similar trend, except case 5, without an active controller. The passive system does have a smaller amplitude at steady state, but the settling time is significantly longer than any other system. 19

Figure 18: Pen-tip position for the five cases discussed

Controller effort For the system to optimally address the issue of writing, the power needs of the controller must also be assessed. The power required is the product of the force, u, and the velocity of the pen at the controller’s point of application. The resulting power can be seen in Figure 19. As the force applied, u, is a composite of the measurable states, the pattern of the controller response, hence the power waveform, varies between cases. The controller efforts in cases 3 and 4 are highly similar, as seen in Figure 20. The negative sign of the power can be interpreted as the negative direction. The controller power demonstrates a higher need for the four state controller (case 2) than the three state controller (case 3) or two state controller (case 4). The peak power needed for the four state controller is 0.9299 Watts, but varies from -0.9250 W to 0.9299 W. Alternatively, the three state system’s power needs peak at -0.4085 W, oscillating between -0.4085 W and 0.0271 W, while the steady state power needs of this controller oscillate between -0.2528 and 0.005054 W. The two state controller oscillates -0.4203 W to 0.0150 W, while the steady state responses vary between -0.2618 and 0.001417 W. 20

Figure 19: Comparison of Controller Efforts

Figure 20: Controller effort of cases 3 and 4 21

As cases 3 and 4 would require half of the power capabilities than case 2 while maintaining improved results, there is value in developing the efficiency analysis for these cases, as explained in the following section. Efficiency analysis To compare the advantages for each controlled case, the efficiency was taken as the improvement from the uncontrolled case, divided by the controller effort, given by: 푈푛푐표푛푡푟표푙푙푒푑 − 푆푆_푂푠푐푖푙푙푎푡푖표푛 퐼푚푝푟표푣푒푚푒푛푡 (푚푚) 퐸푓푓푖푐푖푒푛푐푦 = = 퐶표푛푡푟표푙푙푒푟 푒푓푓표푟푡 퐶표푠푡 (푊)

Table 2: Summary of pen-tip position, velocity, and controller effort for each case Case # of Measurable Steady State Maximum Steady State Peak Controller # States Velocity (m/s) Displacement (mm) Oscillation (mm) Effort (W) 1 N/A 0.171 6.920 6.920 N/A 2 푥, 푥̇, 휃, and 휃̇ 0.00460 3.594 0.1880 0.9299 3 푥̇, 휃, and 휃̇ 0.0539 4.577 2.154 -0.4085 4 휃 and 휃̇ 0.0552 4.605 2.209 -0.4203 5 N/A 0.0236 7.272 0.81 N/A

The values for these calculations are summarized in Table 2 and resulted in the efficiencies seen in Table 3. This demonstrates that Case 3, with a three state controller, is the most efficient system, closely followed by the 4th case with two controllers. As case 5 does not require power and has a different trend in the response, it should be compared separately. Table 3: Efficiencies for each case Case # Efficiency (mm/W) 2 7.2394 3 11.667 4 11.209

Between the three actively controlled cases, case 2 has superior results, but the cost is higher than the other cases. For a four state controller, as in case 2, an observer would also have to be designed and implemented. This would further complicate the system as well as the manufacturing and assembly processes, but is a feasible area for improvement. There are minor differences between the efficiencies of cases 3 and 4. Since the responses to the three state and two state controllers are so similar, the major difference would likely appear in the sensors used. Case 4 would require only one encoder as a sensor to measure 휃 and 휃̇, alternatively two 22 accelerometers could be used, whereas case 3 would require either an encoder and an accelerometer or two accelerometers. The cases can therefore be compared by available sensors on the market. The required resolution of the sensors would determine the ideal setup of the system. In the model above, a 0.15 m length was assumed between the pivot point and pen-tip. The maximum oscillation was approximately 7 mm, resulting in a 2.674° angle. For example, in a rotary encoder with 1024 lines, only 7.5 lines would be used: fewer for any of the controlled cases. This resolution is not ideal for our purposes, not to mention the constantly oscillating speed at which the encoder would need to operate, increasing wear on the sensor. A two accelerometer system could be used in either case 3, with three states controlled, or in case 4, with two states controlled. As there is no advantage to a two state controller system over a three state controller system, in terms of sensor integration, a three state controller would be ideal.

23

Chapter 4: Experimental Testing

Hypothesis The development, testing, and quantification of results was based on a hypothesis that a passive design should be able to effectively reduce oscillations of the pen-tip at the tremor frequency. The system discussed here should perform well, based on the discussion in [45] and the simulation results for the passive system in the previous chapter. This will be demonstrated by comparing the frequency responses and specifically Fast Fourier Transform (FFT) plots between cases. As the magnitude at the tremor frequency correlates to the energy of the system at that frequency, improvement is characterized as the reduction in magnitude at that frequency in the corresponding FFT plot from the control case’s FFT. The testing for tremor effects in handwriting has yet to be standardized. While there are metrics being developed for handwriting [47], the effects of tremor is not standardly measurable. The systematic approach to testing should demonstrate an effective method of experimentally testing the improvement of these devices which has, until now, been questionable. To test the reduction of vibration at the tremor frequency, a myriad of controls need be applied and great care should be taken to ensure consistency between samples. We hypothesize that an effective consideration should result in comparable cases that demonstrate the extent of the tremor’s influence in the pen-tip oscillations. This will be seen while comparing samples from similar cases. Assistive devices To experimentally determine the efficacy of such a device, several prototypes were developed. The first was a passive version of the above pen with a polyurethane foam acting as the spring damper system. The second device is an active motor-actuated design that is still in production. With these prototypes, the afore-described simulations can be tested and improved upon. In order to determine the effectiveness of any device, it should accommodate a stylus paired with a digitizing tablet. This tablet is a Wacom Intuos 4, which can capture motion and pressure data using the accompanying wireless stylus. The Wacom tablet can record movement data in real-time, which is useful for frequency analysis. This stylus is slightly larger than a regular pen, but has sensors within to allow recording movement and pressure data when used with the tablet. Generally, these tablets are used for editing photos or develop artwork digitally. As the purpose is artistic, the interface is not ideal for data collection. To collect data, a software called Neuroglyphics, written by Camilo Toro (http://www.neuroglyphics.org/) was used [48]. This software interprets the data exported by the tablet, partially converting it to standardized units. 24

Passive Device The overall passive device can be seen in Figure 21. The passive device developed here approximately demonstrates the simulation without an active controller, as in case 5. This would equate to a system where u is set to 0. As in the model, this relies on a pendulum system within a case that is excited by the user. In Figure 21, the swing of the inner stylus can be seen in red, rotating around the pivot highlighted in blue. The device was designed and built explicitly for testing, thus was made large enough for the stylus accompanying the tablet. The spring damper system used was polyurethane foam. The foam, seen in Figure 22 was chosen for its porosity and elasticity. The shape of the bulbous region was designed to allow room for the foam to compress and decompress. As a result, for ergonomics, the distance ℓ was changed, to allow a user to hold the smaller end. However, the size of the device is larger than a regular writing utensils mainly to accommodate the tablet’s stylus.

Figure 21: CAD model of passive assistive device 25

This prototype varies from the simulation slightly, which follows the design proposed in [45]. The differences are mainly the spring and damping coefficients and the distance from the fulcrum that the spring-damper system was applied. In order for the prototype to be ergonomically useful, the foams needed to be moved to above the hand’s hold. In the future, further optimization of the spring and damper coefficients would be useful. To further improve this device, the visual appeal and ergonomics should be improved upon. Ergonomically, the design should be modifiable for each user. As tremor has been shown to be directional, a directional device was developed to best counter the tremor input. The ergonomic support should encourage the user to hold the device in the direction corresponding to the individual for a more personalized approach. For testing purposes, a fixed prototype was also developed. This fixed prototype acts as the control for any testing. The outer shape and size of both prototypes are the same and the weight is comparable, but the inner stylus is not allowed to swing.

Figure 22: Prototype with foam exposed and assembled Active Device With a collaborator, Emilie Dubois from Université de Technologie de Compiègne, an active pen was also conceived. The active design varies from the simulations as well. The system described in the previous chapter uses a linear actuator at a distance ℓ from the fulcrum, whereas this design uses a rotational actuator at the fulcrum. 26

The pivot, rigidly attached to the stylus is coupled to the motor, allowing the motor to apply a counter force to the tremor. This design does not include sensor integration, which is vital to determine the appropriate phase and frequency of the signal. With said sensors, the particular movement for individuals can be determined to understand tremor across individuals with tremor. With this information, improved models and devices can be developed.

Figure 23: Active prototype design Testing the passive device To validate the simulation results, experimental analysis was performed using the passive device. This validation occurred in two steps. First, a healthy faculty volunteer used an Electrical Muscle Stimulator (EMS) to mimic the effects of tremor as in [49]. Second, a mechanical stage was developed to produce a movement that imitates the tremor vibration. A major issue with testing tremor in writing is distinguishing the tremor movement from the desired movement. This can be circumvented by uniquely analyzing the movement in the frequency domain using FFT with a sampling time of 0.0075 seconds. Once movement data is captured with time data, pen-tip accelerations can be used to determine the tremor frequency. The FFT magnitude at this frequency determines the severity of the tremor in relation to the magnitude of the baseline pen. 27

Pilot test A professor in the Mechanical and Industrial Engineering department, Rifat Sipahi, volunteered to participate in a pilot test. This pilot test entailed using an Electrical Muscle Stimulation (EMS) device on the ulnar and medial nerve in the forearm and hand, respectively, as seen in Figure 24, to induce tremor. In this case, the model of the EMS device used was the dual-channeled PM 555 EMS developed by Promed. The signal from the EMS device is a square pulse with settings set to 140 μs, 8 Hz, and 13 “intensity” [47]. These settings induced a tremor at 8.04 Hz ± 0.012, within the range for ET. For testing, the EMS device was powered by a single 9 V battery.

Figure 24: EMS device placement on the ulnar and medial nerves to induce tremor style shaking

A standard test to assess the severity of tremor in fine motor tasks is drawing Archimedes spirals [16]. An Archimedes spiral is a spiral following the curve 휌 = 푎 + 푏휃, such as seen in Figure 25. To get sufficient data without fatiguing the subject, three rings of an Archimedes spiral was used for each sample. The healthy subject was asked to trace printed spirals, to maintain a standard movement and size throughout the samples. While tracing these spirals, the subject counted at a steady pace to approximate a consistent speed. Between each sample the subject was given a minimum of 30 seconds rest in order to avoid muscle fatigue and reduced tremor. 28

Figure 25: 3 rings of an Archimedes spiral

With the tremor emulated in a healthy subject, both the prototype and the control were tested, examples of induced-tremor spirals can be seen in Figure 26. These spirals were randomly selected for the fixed control case and the two free-swinging cases, explained below. With the time and position data which was captured by the digitizing tablet and accompanying stylus, the accelerations over time were used to study the frequency response. To determine the frequency response from the accelerations, Fast Fourier Transform (FFT) was implemented for each sample. The FFT was taken in MATLAB, for which sample code can be found in Appendix B, to determine the FFT in x and y directions, in the page plane, then find the magnitude to show a single representative metric for each sample. The prototype is directional, but the direction of the subject’s tremor is unknown. Thus, aside from the fixed baseline, two free-swinging cases were taken into account: a case with the axis of rotation parallel to the forearm and a case with the axis perpendicular to the forearm. These orientations can be seen in Figure 27. During testing, the order of the tests was counterbalanced to control for order effects. 29

Figure 26: Example spirals for both the baseline and the free-swinging prototype.

Figure 27: Orientation of the parallel and perpendicular cases. The parallel grip indicates when the shaft is parallel to the forearm, while the perpendicular indicates the shaft is perpendicular to the forearm.

The time and movement data from the spiral tests was taken to determine the frequencies of the pen’s movement as explained in [49]. The resulting pen-tip motion improved on average 38% in the perpendicular case and 47% in the parallel case [49] as measured by the reduction in magnitude at the induced tremor frequency in the FFT plots. However, in all the EMS tests performed, including those in [49], there was significant variation between samples. From one test to another, the samples taken displayed consistent dominant frequencies, indicating that the EMS applied was pulsing at appropriate and consistent frequencies. The variation was in the magnitude of the energy at that frequency. 30

Figure 28: Frequency responses resulting from EMS testing

Figure 28 shows further tests performed to confirm the results from [49] completed with the EMS device. This graph shows the vibration power in relation to the frequency. Each spiral constitutes a new sample, but the resulting frequency response to each test is unique. This indicates further variability between cases. For the samples displayed in Figure 28, most samples showed improvement, but there was significant variation. The improvement in magnitude from the baseline control case to the parallel varied from -4% and 59.9%, where a negative percentage implies a higher energy than the baseline. The improvement in magnitude from the baseline to the perpendicular case varied between 17.5% and 44.6%. On average, the FFT magnitude corresponding to the parallel case improved by 38% from the baseline, while the perpendicular improved 68% from the baseline. 31

Variability of EMS testing As seen in Figure 28, there was significant variation between samples. Several factors were explored to determine the cause. Consistency of EMS device The EMS device employs disposable self-adhering electrodes to maintain contact with the skin during use. These are commercially available, but the reliability has not been tested. As the pads are used, they become dusty and may adhere less. Further, the exact placement of the electrodes has not been tested. This could potentially cause differences between the testing sessions. Surface Roughness Another factor examined was the paper surface. Along with Master’s candidate Emilie Dubois from Université de Technologie de Compiègne, the surface roughness of the paper was tested to determine the effects on writing with tremor. Several roughnesses were found using printer paper and various filter papers. The types of paper are listed in Table 4. Since filter papers are rated by absorption and speed of absorption, the roughnesses of each paper were determined via Optical Coherence Tomography (OCT). The OCT yielded black and white images of the topography of the paper and the roughness was correlated to the variation within a sample. From this, paper 1 was determined to be the smoothest and 2, 3, and 4 had progressing roughness. Table 4: Papers used with varying roughnesses “Paper ID” Type Paper 1 Printer Generic 2 Filter Whatman, 1 qualitative 3 Filter Whatman, 2 qualitative 4 Filter Whatman, 3 qualitative

The trend established was that on the rougher papers the prototype led to lower FFT magnitudes at the peak frequencies, indicating the friction caused by the paper had a favourable effect. To maintain regular conditions for writing and use the paper with the least friction, printer paper was used for all other testing. Further testing could be done to determine the effects on the paper after written on: whether a second pass would have the same roughness. This requires a less precise measuring tool as the OCT has an inappropriate focal length to determine the whereabouts of lines drawn on the paper. Posture Posture was observed to be highly variable. To draw a spiral, the range of motion could come from the wrist or the forearm. For some samples, the fingers were more involved than others. The subject’s posture was controlled as much as possible without restricting natural motion, maintaining the sitting 32 position at the beginning of each sample and the maintaining the position and orientation of the traced spiral in relation to the subject. Ultimately, controlling posture proved to be the most difficult. If controlled too much, it can alter the realistic quality of writing which does vary from one word to another and cause discomfort in the subject. Even as a word is written repeatedly, there are variations between those samples. This indicates a natural variation that occurs in writing and is potentially acceptable in controlled testing, given that enough samples are taken to understand overall improvements in the system. Pressure and inclination The pressure and inclination angle of the pen would vary during regular writing along with the rotation of the wrist, as the writer is constantly lifting the pen-tip and changing the pressure and position based on the muscles activated by the user. As these vary between users and samples, a modification that could accommodate everyone or an adjustable system should be developed. In order to test, a constant or measurable pressure and inclination must be ensured.

Figure 29: Pressures from EMS tests performed for [49] and as a confirmation. A unit of pressure here correlates to approximately 0.00363 N

As for the tests performed in [49] and the confirmation tests shown above, the average pressures for each can be seen in Figure 29. The pressure units in Figure 29 are those from the tablet, using a custom scale. With a force sensor, each unit was found to equate to approximately 0.00363 N of force. The pressures 33 ranged from 408 (1.48 N) to 612 (2.22 N) in the fixed baseline case, while the free prototype’s pressures ranged from 386 (1.40 N) to 518 (1.88 N). Although pressure data seems to be consistent, analysis of data showed a wide range of resulting FFT magnitudes at the tremor frequency. A mechanized system could be used to test more reliably. With a mechanized stage, testing was conducted as explained in the following section. Testing with the mechanical stage To systematically test the devices proposed in the previous chapter, a stage was developed to hold the device and shake at a frequency within the target range. This stage was developed by a capstone team of Mechanical Engineering students at Northeastern University during spring 2016 [46] then modified to fit the requirements of testing here, as seen in Figure 30. Originally, the stage designed by the capstone group consisted of a cross beam which acted as a track for a stepper motor with an attachment to hold the testing prototype or fixed device. This movement mimics the hand crossing the page from left to right, while a solenoid was used to mimic the tremor, with a motion on paper perpendicular to the cross beam. The original solenoid used was found to be unreliable as it would heat up quickly, affecting the range of motion and consistency of the solenoid.

Figure 30: Mechanical Stage used for testing

Since tremor production with the was unreliable, the stage was modified by removing the solenoid and including the tremor motion in that of the stepper motor. The movement of the stepper was controlled by an Arduino, taking 450 steps right and 100 back at 1200 rpm. As the stepper motor moves toward the right side of the page, the movement alternates between forward and back to produce an oscillatory movement, then moves smoothly to the far left. Testing occurred only in the rightward moving direction. 34

The settings used resulted in 7.22 Hz ± 0.016 shaking as the prototype crossed the stage. Furthermore, the stage was fixed on a relatively rigid table to reduce noise occurring at secondary frequencies. Frequency response from mechanical testing With the digitizing tablet, time and movement data were collected for 60 samples: 30 with the control and 30 with the passive prototype, with sampling time of 0.0075 seconds. Each sample recorded the rightward motion with an intermittent backward shaking. With the data collected, the Fast Fourier Transforms (FFT) were taken in MATLAB to determine the frequency responses of the system. These tests can be seen in Figure 31 and Figure 32, where each line represents a sample, 30 in each case. For this testing, the prototype was configured such that the shaft was perpendicular to the cross beam. As seen in Figure 32, there is an anomaly in one of the free cases. One sample does not cluster with the frequency responses of other samples. Upon further investigation, this sample was found to have a substantial number of non-contact points. The average pressures of each sample can be seen in Figure 33, with the samples including non-contact data highlighted.

Figure 31: Frequency response of the control, fixed pen 35

Figure 32: Frequency response of the passive prototype, free swinging pen

When considering loss of contact between the writing utensil and the surface, there are two key aspects: the number of points which lost contact and the number of consecutive points without contact between the writing utensil and writing surface. The two samples with significant examples of both types are tests 2 and 4 in the free case, shown in blue. Test 4 corresponds to the test that varied visibly from the other frequency responses, shown in purple in Figure 32. These two cases had many more points of non- contact, 714 and 328 points out of the total 1700 points collected in each sample, while other cases all had less than 100 points of non-contact data. These cases also displayed the longest consecutive periods of non- contact: 11 points, 0.0825 seconds, and 14 points, 0.105 seconds out of the total 12.75 seconds for each test. This indicates anomalies between the tests and indicates their statistical significance should be investigated. In terms of descriptive statistics, assuming a normal distribution in both pressure and in peak magnitude, sample 2 and 4 from the free prototype set are outside the 95% confidence range. Test 4 is 4.4 standard deviations away from the mean in peak magnitude and -2.5 standard deviations away in pressure. Test 2 is more nuanced: if test 4 is included in the sample set, test 2 is 1.3 standard deviations away in peak magnitude and -2.0 standard deviations away in pressure. However, if test 4 is excluded from the sample set, then test 2 is 2.4 standard deviations away from the mean peak magnitude and -2.3 standard deviations away from the mean pressure. While these points are statistically suspicious, they are the most critical of the passive prototype, therefore they are not entirely excluded, but should be taken into consideration when 36 interpreting the results. Inferential statistical analysis can be seen later on in this chapter. In conjunction with the descriptive statistics, these can lead to a better evaluation of the results.

Figure 33: Average Pressure for all samples and the non-contact data. Each unit of pressure relates to 0.00363 N

On the whole, for the frequency responses of the samples from the mechanical tests, these outlying points have an effect, albeit small. By averaging the frequency response, an improvement is visible, as shown in Figure 34, for the three cases: fixed baseline, free samples including the two outliers, and free samples excluding the two outliers. The difference between the average of the fixed sample FFT magnitudes and the average of the 28 significant samples is 298 mm/s2. The improvement is 11.73% from the baseline. Whereas, if the two outliers are included, the difference between the fixed and all free samples is 239 mm/s2, the improvement is 9.41%. While this is an improvement, it is not very apparent. A more apparent difference is seen when considering the pressure in conjunction with the peak magnitude, as explained next. 37

Figure 34: Averaged Frequency responses for 59 samples: 30 control (Fixed) and 29 free swinging Effects of pressure on frequency response Increased pressure has an effect on the amplitude of tremor. This is the basis for most weighted and friction based devices. A higher pressure or increased friction at the pen-tip can reduce the effects of tremor on handwriting. Linear fit To further investigate the effects of pressure on the resulting magnitude at the emulated tremor frequency, the correlation can be seen in the scatter plot in Figure 35. This shows two main clusters of samples for each case. The clusters can be examined via trend lines, which for the fixed and free cases, respectively, were: 퐹푖푥푒푑: 푃푟푒푠푠푢푟푒 = −0.294 × 푃푒푎푘푉푖푏푟푎푡푖표푛푃표푤푒푟 + 1441.9 퐹푟푒푒: 푃푟푒푠푠푢푟푒 = −0.290 × 푃푒푎푘푉푖푏푟푎푡푖표푛푃표푤푒푟 + 1116.7 The average pressure applied by the fixed samples was 695.7 or 2.53 N. If comparable pressure were applied with the free prototype, the trend lines suggest the peak magnitude of the system would become 1,454 mm/s2 rather than 2,541 mm/s2. This shows a 42.78% improvement. Alternatively, samples from the fixed case can be shifted to predict an average energy at lower pressures. The average pressure among the free samples was 450 or 1.63 N, correlating to 2,302 mm/s2 along the free linear fit while the fixed linear fit related to 3,378 mm/s2 at a pressure of 450. This represents a 31.9% improvement. 38

These are potential improvements, the validity for which rely on the assumption that these linear fits hold. In terms of inferential statistics, the linear fits have correlation coefficients of -0.76 for the fixed fit and -0.73 for the free case’s linear fit. These coefficients show that they are good fits for the data; however, correlation does not indicate significance. If the two outliers are removed from the samples, the correlation coefficient is -0.53, instead of -0.73, due to the decreased standard deviation of the set. In order to evaluate the statistical value of these results, the descriptive and inferential statistics can be used, but would benefit greatly from larger and more varied sample sets. With wider ranges of pressure and magnitudes, a more precise trend could be found to indicate more exact curves which fit each set of data. These curves can then be assessed for their evaluative statistics.

Figure 35: Scatter plot correlating pressure and peak magnitudes with linear fits, the pressure unit is 0.00363 N

Horizontal fit Alternatively, samples with similar pressures can be examined. The highlighted points around pressures 675 and 510 correlate to the points in Figure 36. The points follow a favourable trend for the prototype, except for one set at magnitudes 2608, fixed, and 2669, free. Averaging the free and fixed magnitudes shows the free pen improves by 15.3%, but the improvements range from -2.3% to 32.85%. Along the pressure line of 675, the magnitude improved by 15% and along the 510 pressure line, the average magnitudes improved by 17%. 39

Figure 36: Scatter plot correlating pressure and peak magnitudes with horizontal pressure markers and highlighted corresponding points, pressure is 0.00363 kg

Table 5: Points correlating to horizontal pressure marker Horizontal Fit Pressure Sample type Frequency magnitude 675 673.5 Free 2026 675 677.1 Fixed 2380 510 512.2 Free 2038 510 512.5 Free 2328 510 500 Fixed 2608 510 493.6 Free 2669 510 519.8 Fixed 3035 Discussion In short, the device developed had a positive effect when excited by tremor frequency, but the system must be considered along with the pressure to fully understand the effects. The hypothesis proposed at the beginning of this chapter has been confirmed: there was a consistent reduction in oscillations at the pen-tip at the tremor induced frequency. To fully demonstrate this improvement, further testing is required with either healthy subjects or tremor patients. Although there was variation between tests, the general trend of improvement was apparent. The averaged improvement in FFT magnitudes at the tremor frequency from the fixed baseline to the perpendicular case was 53% and 38% to the parallel case. The device was further tested with the 40 mechanical stage, showing consistent improvement. This improvement varied depending on the interpretation: 12% or 9% from simple averages, 47% projected with the linear fit, or 15% to 17% when comparing samples with similar pressures. Among these interpretations the largest improvement was seen when inferentially determining the effects of equivalent pressures using the linear fit. While this depends on the fidelity of the linear fit, this projected improvement from the mechanical testing does align with the improvements seen in the EMS testing section above, averaging 48% improvement, which had fairly consistent pressure results. Indeed, the variables were controllable in a testing setting, but the variability remains between tests. This variability calls for more testing, to ensure the difference in responses is controllable and the device is indeed improving handwriting exposed to tremor.

41

Chapter 5: Conclusions Writing is an essential skill, but is often illegible when performed with hand tremor. Hand tremor can make day to day tasks difficult and embarrassing, but the effects are not directly measurable in writing. Distinguishing between the intended motion of writing and the tremor oscillations is difficult. Herein, the distinction is made in the frequency domain: by identifying the tremor frequency and measuring the reduction in pen-tip energy at that frequency. A system was developed, consisting of a pendulum-like stylus swinging within an outer case held by the hand and exposed to the tremor movement. This model was tested theoretically and experimentally for both active and passive controllers. A simulation was used to theoretically determine the outcome of the system, while the passive prototype was experimentally tested with an Electrical Muscle Stimulation (EMS) device and then with a mechanical stage. First, the active controller cases were tested theoretically: specifically combinations of measurable states were investigated. Since pen position is not directly measurable, it is useful to have an understanding of the results with different amounts of information. While the full state controller, including pen position, had the most reduction in oscillations at the pen-tip, it was not the most efficient. The partial state controllers improved the resulting oscillation more per Watt. The results found from the simulation demonstrated the effectiveness of an active controller for this system. If these controllers were further tuned to actively seek the tremor vibrations, an effective solution for tremor reduction in writing could be developed. A three state controller could be applied with two accelerometers to obtain optimal benefits with minimal power consumption. While the results are promising, there were several limitations with this simulation. The model and testing assumed no rotational movement or variation in inclination, purely translational. This means that the hand moves parallel to the page, but does not rotate parallel to the page or normal to the page. To further the active area of this research, these simulations should be run with various frequency inputs. As it stands, the input was a sinusoidal wave of 50 rad/s or 7.96 Hz. As natural occurring tremor is maintained within frequency ranges, the tests should be further explored while modifying the frequency of the inputs for the simulation. Doing so would allow a fuller understanding of tremor reduction qualities of the model over a range of frequencies. Additionally, an active device with appropriate coding and sensing capabilities should be developed to determine further design needs such as processing capabilities. This could also assist in determining the learning curve associated with using the device. As end-user acceptance is necessary for any device that is ultimately developed, the device must be visually discreet, easily used, and comfortable. The size and shape of the passive device is a potential issue for end-user acceptance and should be redesigned to accommodate 42 patient tastes. In designing the active prototype, this should also be considered, since any assistive device without end-user acceptance or compliance will not be easily adoptable. Further efforts in this thesis were focused on passive devices. A passive version of the model was developed and this prototype was tested experimentally. This prototype does not exactly mirror the model proposed. Due to manufacturing constraints the dimensions were altered. The material is also untested for consistency and the spring and damping coefficients are unknown and untuned. A new device or modified model could remove this inconsistency and material selection should continue to find a more appropriate spring-damper material. The passive prototype was piloted first with a faculty volunteer given an emulated tremor via EMS, then tested again with a mechanical stage. The EMS testing exposed many variabilities of testing. The results yielded an improvement over the baseline, a standard pen of equal size and shape. However, this was tested with only one volunteer, further tests are required to fully understand the trends of the system. The EMS testing exposed variation consistently in all pilot cases. The posture could potentially be a cause of the added variation in the EMS cases. As a subject activates their muscles differently during each sample, this can affect their tremor and should show in their posture. To test this, a gyroscope can be used to track the movement of the upper arm, forearm, wrist, and fingers. Alternatively, visual methods could be used as in gait analysis to determine the movement at each joint. This would give a comprehensive understanding of the movements involved in writing and demonstrate the forces exhibited during writing. This could help determine a more accurate model for the simulation as well. While further testing should be done to determine the source of the variation found, any device resulting from this research should be able to accommodate such deviations. In general, more testing over these independent variables will allow for more evaluative statistics, which can demonstrate the trend in handwriting at different instances and determine the most effective ways of reducing tremor apparent in handwriting. Further analysis can also be done on the tests to determine the short-time Fourier transform (STFT) or short-term Fourier transform to determine the frequency response throughout the sample at certain intervals. This could give an idea of the variations within the writing and variations that may occur and also variations that may result from the device over time. More testing could also allow other factors to be investigated, such as the effects of body type or musculature on tremor. In PD, exercise is known to dramatically slow and sometimes improve symptoms, which indicates a potential correlation. By rating physical fitness, a trend, or lack thereof, could be found between induced tremor and musculature of the subject exposed to EMS. For this work, in order to reduce the variability associated with the human body, a mechanical stage was used to test. The stage holds the prototype or control device and applies a translation and tremor-like movement. During testing with the mechanical stage, an interesting quantitative relationship was 43 demonstrated between contact pressure and reduction of vibration energy at the tremor frequency. The stage has demonstrated the usefulness of such a testing mechanism for handwriting tremor analysis. The effectiveness of any further assistive device for tremor reduction could be tested on such a stage to minimize the variability found with human testing. The majority of the results for the experimental tests were based on the magnitude of the tremor energy; however, the correlation between reduction in vibration power at the tremor frequency and the reduction in amplitude at the pen-tip is not exact. This correlation can be developed by further developing the mechanical stage. Adding a secondary axis, normal to the first, to the stage setup would allow the amplitude of the oscillations to be seen while being able to determine the related vibration energy in the pen. The secondary axis would generate the tremor movement, while the translational movement of the pen could be maintained in the first axis. Furthermore, when developing a new mechanical stage, adding a third axis could also provide a method of controlling the contact pressure more exactly and uniformly. Finally, with the mechanical stage, the inclination and pressure should both be tested for their effects on writing. Neither constant pressure nor constant inclination are realistic for the writing task, yet both were assumed for the model. These two factors should be tested as independent variables to determine if the assistive device shows improvement for all cases.

44

References

[1] R. Bhidayasiri, "Differential diagnosis of common tremor syndromes," Postgrad med J, pp. 756- 762, 2005.

[2] G. Bhagwath, "Tremors in Elderly Persons: Clinical Features and Management," Hospital Physician, pp. 31-37,49, 2001.

[3] E. D. Louis, R. Ottman and W. A. Hauser, "How common is the most common adult movement disorder? Estimates of the prevalence of Essential Tremor throughout the world," Movement Disorders, pp. 5-10, 1998.

[4] J. J. Higgins, L. T. Pho and L. E. Nee, "A gene (ETM) for Essential Tremor maps to chromosome," Movement Disorder, pp. 859-864, 1997.

[5] P. Hedera, F. Cibulcik and T. L. Davis, "Pharmacotherapy of Essential Tremor," Lournal of Central Nervous System Disease, no. 5, pp. 43-55, 2013.

[6] FDA, Inderal (propanolol hydrochloride) Tablets, Philadelphia, PA: Wyeth Pharmaceuticals, Inc., 2010.

[7] International Essential Tremor Foundation (IETF), "Common Medications," [Online]. Available: http://www.essentialtremor.org/treatments/medication/. [Accessed 15 June 2016].

[8] I. E. T. Foundation, "Surgical Treatments," [Online]. Available: http://www.essentialtremor.org/treatments/surgical-treatments/. [Accessed 14 June 2016].

[9] J. Jankovic, "Botulinum toxin treatment in tremors," International Essential Tremor Foundation (IETF), Lenexa, KS, 2012.

[10] A. Huntley, "FDA approves non-invasive treatment for essential tremor," FierceBiotech, 13 July 2016. [Online]. Available: http://www.fiercebiotech.com/medical-devices/fda-approves-non- invasive-treatment-for-essential-tremor. [Accessed 18 July 2016].

[11] International Essential Tremor Foundation (IETF), ET, depression, & anxiety, Lenexa, KS, 2012.

[12] International Essential Tremor Foundation (IETF), "About Essential Tremor," [Online]. Available: http://www.essentialtremor.org/about-et/. [Accessed 28 June 2016].

[13] S. Graham and M. Hebert, "Writing to Read: A meta-analysis of the impact of writing and writing instruction on reading," Harvard Educational Review, vol. 81, no. 4, pp. 710-744, 2011.

[14] R. Gentry and S. Peha, "5 Reasons Why Writing Helps Early Reading," Psychology Today, 15 September 2013. [Online]. Available: https://www.psychologytoday.com/blog/raising-readers- writers-and-spellers/201309/5-reasons-why-writing-helps-early-reading. [Accessed 29 June 2016]. 45

[15] International Essential Tremor Foundation (IETF), "Assistive Devices," [Online]. Available: http://www.essentialtremor.org/treatments/assistive-devices/. [Accessed 10 June 2016].

[16] K. E. Norman and M. E. Héroux, "Measures of fine motor skills in people with tremor disorders: appraisal and interpretation," Frontiers in neurology, vol. 4, pp. 1-12, 2013.

[17] D. Haubenberger, D. Kalowitz, F. B. Nahab, C. Toro, D. Ippolito, D. A. Luckenbaugh, L. Wittevrongel and M. Hallett, "Validation of Digital Spiral Analysis as Outcome Parameter for Clinical Trials in Essential Tremor," Movement Disorder Society, vol. 26, no. 11, pp. 2073-2080, 2011.

[18] S. L. Pullman, "Spiral Analysis: A New Technique for Measuring Tremor With a Digitizing Tablet," Movement Disorders, vol. 13, no. Supllement 3, pp. 85-89, 1998.

[19] E. D. Louis, A. Gillman, S. Boschung, C. Hess, Q. Yu and S. Pullman, "High Width Variability during Spiral Drawing: Further Evidence of Cerebellar Dysfunction in Essential Tremor," Cerebellum, vol. 11, pp. 873-879, 2012.

[20] N. Zhi, B. K. Jaeger, A. Gouldstone, R. Sipahi and S. Frank, "Toward monitoring Parkinson's through analysis of statig handwriting samples: a quantitative analytical framework," IEEE Journal of Biomedical and Health Informatics, 2016, Available: http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=7384677. [Accessed 9 August 2016].

[21] A. Beuter and R. Edwards, "Using Frequency Domain Characteristics to Discriminate Physiologic and Parkinsonian Tremors," Journal of Clinical Neurophysiology, vol. 16, no. 5, p. 484, 1999.

[22] C. W. Hess and R. Saunders-Pullman, "Movement disorders and alcohol misuse," Addiction Biology, vol. 11, pp. 117-125, 2006.

[23] R. J. Eble, "Central Mechanisms of Tremor," Journal of Clinical Neurology, vol. 13, no. 2, pp. 133- 144, 1996.

[24] M. Fischer, F. Irlinger and T. C. Lueth, "A fully passive fluidic cup holder for tremor compensation," in International Conference on Biomedical Robotics and Biomechatronics, Tokyo, Japan, 2010.

[25] E. Abbaszadeh, Design Strategies for a Drinking Cup to Accomodate Hand Tremor, Boston, MA: Northeastern University, 2012.

[26] E. Ohara, K. Yano, S. Horihata, T. Aoki and Y. Nishimoto, "Tremor Suppression Control of Meal- Assist Robot with Adaptive Filter," in International Conference on Rehabilitation Robotics, Kyoto, Japan, 2009.

[27] I. Jaffe, "A Spoon That Shakes to Counteract Hand Tremors," All Things Considered, NPR, 13 May 2014. [Online]. Available: http://www.npr.org/sections/health-shots/2014/05/13/310399325/a- spoon-that-shakes-to-counteract-hand-tremors. [Accessed 3 July 2016]. 46

[28] B. Taheri, D. Case and E. Richer, "Robust Controller for Tremor Suppression at Musculoskeletal Level In Human Wrist," IEEE transactions on neural systems and rehabilitation engineering, vol. 22, no. 2, pp. 379-388, 2014.

[29] M. Nawate, D. Morimoto, S. Fukuma and S. Honda, "A Painting Tool with Blurring Compensation for People Having Involuntary Hand Motion," in International Technical Conference on Circuits/Systems, Computers and Communications, Matsushima, Japan, 2004.

[30] R. A. MacLachlan, B. C. Becker, J. C. Tabarés, G. W. Podnar, L. A. Lobes and C. N. Riviere, "Micron: An Actively Stabilized Handheld Tool for Microsurgery," IEEE transactions on robotics, vol. 28, no. 1, pp. 195-212, 2012.

[31] L. Global, "What is LSVT BIG?," [Online]. Available: http://www.lsvtglobal.com/patient- resources/what-is-lsvt-big. [Accessed 15 July 2016].

[32] D. Black, "Can the symptoms of Essential Tremor be alleviated or reduced with exercise?," 2 January 2015. [Online]. Available: https://www.quora.com/Can-the-symptoms-of-Essential- Tremor-be-alleviated-or-reduced-with-exercise. [Accessed 9 July 2016].

[33] E. Chang-Siu, R. Tan, W. Chen, J. Beard, M. Brown and D. Lim, The Pika Pen, Berkeley: UC Berkeley, 2012.

[34] Elder Store, "Weighted Universal Holder for Pens and ," [Online]. Available: http://www.elderstore.com/weighted-universal-holder-for-pens-and-pencils.aspx], . [Accessed 3 July 2016].

[35] The Writing Pen Store, "The heavy Weight Pen with Grip," [Online]. Available: http://www.thewritingpenstore.com/p-1004-the-heavy-weight-pen-with-pencil- grip.aspx?gclid=Cj0KEQjwnv27BRCmuZqMg_Ddmt0BEiQAgeY1lyrOb7QxJcq5ILKw2KIBhLU_NFYPV 2VPWPxdI5yN0PkaAskG8P8HAQ. [Accessed 3 July 2016].

[36] Poppin, "Heavy Weight Metal Pen," [Online]. Available: http://www.poppin.com/writing/pens/?prefn1=features&prefv1=Metal&. [Accessed 3 July 2016].

[37] Sammons, "Sammons Preston Steady Hand Magnetic Writing Instrument," [Online]. Available: https://www.4mdmedical.com/index.php/catalog/product/view/id/313181/s/steady-hand- magnetic-writing- instrument?CAWELAID=120141310000056386&CAGPSPN=pla&gclid=Cj0KEQjwnv27BRCmuZqMg _Ddmt0BEiQAgeY1l5QjLzbKxbFb5N1AQIZE64YljLqrB0Wz-bgw0kYmoJAaAjD58P8HAQ. [Accessed 3 July 2016].

[38] Rehab Store, "Maddak Steady Write Sta-Pen Writing Instrument," [Online]. Available: http://rehab-store.com/p-10827-maddak-steady-write-sta-pen-writing-instrument.html. [Accessed 3 July 2016]. 47

[39] Active Forever, "Steady Write Pen," [Online]. Available: https://www.activeforever.com/steady- write-pen. [Accessed 3 July 2016].

[40] Write Stuff, "Ring Pen ultra Writing Aid," [Online]. Available: http://www.wrightstuff.biz/ring- pen-ultra-writing- aid.html?gclid=Cj0KEQjwnv27BRCmuZqMg_Ddmt0BEiQAgeY1l9EGrAIcYnkuAzbjf6Od- k42qmcJMF8SXuOSMCrzl-EaAh218P8HAQ. [Accessed 3 July 2016].

[41] B3, "Pen Again," [Online]. Available: http://penagain.com/. [Accessed 3 July 2016].

[42] K. Naritomi, Design and Production of Tremor Pen, MS Thesis, ME: California State University, Sacramento, CA, 2009.

[43] P. Dessau, Writing Pen for Essential Tremor, MS Thesis, ME: California State University, Sacramento, CA, 2012.

[44] Z. M. Yusop, M. Z. Zain, M. Hussein, A. R. Musa and I. Ishak, "Assistive Pen to Improve Quality Writing of Hand Tremor with Proportional-Control," International Journal of Materials, Mechanics and Manufacturing, vol. 3, no. 1, pp. 56-59, 2015.

[45] C. Ou, Novel Pen Designs to Reduce the Effects of Hand Tremors to Writing, MS Thesis, MIE: Northeastern University, Boston, MA, 2015.

[46] J. Conway, A. Jaynes, M. Malone, J. Moore and P. Rubin, Testing the Efficacy of a Tremor Suppressing Pen, Boston, MA: MIE Department at Northeastern University, Spring 2016 Capstone Report.

[47] N. Zhi, B. K. Jaeger, A. Gouldstone, S. Frank and R. Sipahi, "Objective quantitative assessment of movement disorders through analysis of static handwritten characters," in ASME 2015 Dynamic Systems and Control Conference, Columbus, OH, 2015.

[48] C. Toro, Neuroglyphics Software, Neuroglyphics, http://neuroglyphics.org/. [Accessed 6 August 2016]], 2015.

[49] S. E. Belton, L. Hinckel Cavalcante, A. Gouldstone, B. K. Jaeger and R. Sipahi, "Assistive Writing Device for Tremor Patients," in NIH-IEEE 2015 Strategic Conference on Healthcare Innovations and Point-of-Care Technologies for Precision Medicine, Bethesda, MD, 2015.

48

Appendix A: Maple code to find constraints for controller optimization restart; with(linalg); eq1:=(m1+m2)*a+1/2*L*m2*alpha+c1*v+c1*L*omega-F: eq2:=(1/12*m2*L^2+1/4*m2*L^2)*alpha+1/2*m2*L*a+1/2*m2*g*L*theta+K*(2/3*L)^2*t heta+c1*L*v+c1*L^2*omega+c2*(2/3*L)^2*omega-u*(2/3*L): assign(solve({eq1=0,eq2=0},{a,alpha})); a; alpha;

# State Space Representation; A:=Matrix([[0,1,0,0],[coeff(a,x),coeff(a,v),coeff(a,theta),coeff(a,omega)],[0,0,0,1],[coeff(alph a,x),coeff(alpha,v),coeff(alpha,theta),coeff(alpha,omega)]]);

# Control Matrix; B:=Matrix([[0],[coeff(a,u)],[0],[coeff(alpha,u)]]); C:=Matrix([0,1,0,0.15]);

# Disturbance Matrix; E:=Matrix([[0],[coeff(a,F)],[0],[coeff(alpha,F)]]);

# Assign Controllers – modify this area for various cases of controllers K:= matrix(1,4,[0,0,k(3),k(4)]);

# State space to Transferfunction; R:=evalm(s*array(identity,1..4,1..4)-A+B.K); phi:=inverse(R): H:=C.phi.E:

# Numerators and Denomenators (symb); Den:=sort(collect(denom(H[1,1]),s),s); Num:=sort(collect(numer(H[1,1]),s),s);

# Shift imag-axis to sigma unit from left – modify this to change the sigma value Denp:=eval(Den,s=sp-8); with(DynamicSystems): con:=RouthTable(Denp,sp):

# Constraints (symb); con1:=con[1,1]: con2:=con[2,1]/con1: con3:=con[3,1]/con1: con4:=con[4,1]/con1: 49

a0:=coeff(Den,s,3): a1:=coeff(Den,s,2)/a0: a2:=coeff(Den,s,1)/a0: a3:=coeff(Den,s,0)/a0:

# Constraints (numerical); C1:=eval(con2,[m1=0.02,K=10,c1=5.714,c2=0.003,g=9.81,L=0.15,m2=0.005]); C2:=eval(con3,[m1=0.02,K=10,c1=5.714,c2=0.003,g=9.81,L=0.15,m2=0.005]); C3:=eval(con4,[m1=0.02,K=10,c1=5.714,c2=0.003,g=9.81,L=0.15,m2=0.005]); C4:=eval(a1,[m1=0.02,K=10,c1=5.714,c2=0.003,g=9.81,L=0.15,m2=0.005]); C5:=eval(a2,[m1=0.02,K=10,c1=5.714,c2=0.003,g=9.81,L=0.15,m2=0.005]); C6:=eval(a3,[m1=0.02,K=10,c1=5.714,c2=0.003,g=9.81,L=0.15,m2=0.005]);

# Magnitude Tf (symb); Dens:=eval(Den,s=I*omega): MDen:=(Dens); Nums:=eval(Num,s=I*omega): MNum:=(Nums); Magnitude:=MNum/MDen;

# Magnitude (numerical); MM:=eval(Magnitude,[m1=0.02,K=10,c1=5.714,c2=0.003,g=9.81,L=0.15,m2=0.005]);

50

Appendix B: Sample FFT code in MATLAB % To set up the excel file, have four columns of data: time, x acceleration, % time, y acceleration. ts = 0.0075; %This is the time interval between each data point taken in a % sample Fs = 1/ts;

Fixed = AccelFixeddata(:,curr:currend); %Take the 4 columns for the current % fixed test, AccelFixeddata is a matrix holding the data for each test in % columns, imported from Neuroglyphics through excel (.csv to .xlsx to here)

X = Fixed(:,2)-mean(Fixed(:,2)); Y = Fixed(:,4)-mean(Fixed(:,4)); L = length(Fixed(:,2));

FFTnewX = abs(fft(X)/(L)); FFTnewX = FFTnewX(1:L/2+1); FFTnewX(2:end-1) = 2*FFTnewX(2:end-1);

FFTnewY = abs(fft(Y)/(L)); FFTnewY = FFTnewY(1:L/2+1); FFTnewY(2:end-1) = 2*FFTnewY(2:end-1);

%Magnitude of x and y ffts FFTnew = sqrt(FFTnewX.^2+FFTnewY.^2);

%Determining the accompanying Frequency range FreqFix = Fs*(0:L/2)/(L); FreqFix = FreqFix';

Free = AccelFreedata(:,curr:currend); %For the free tests, repeat the FFT % code above from the fixed case