3.3.1 Finite state-machine control
The UL FES Rehab Tool uses the movement of limb segments, or time, as input signals to a finite state-machine (FSM) controller. A FSM controller comprises a set of states, input signals, output functions, and state transition conditions (Chu, 2006). Each state represents a possible situation (Ferdinand, Ruedi, Wagner, & Wolstenholme, 2006), each of which in this case is associated with stimulation outputs (which may be zero in some states). Movement from one state to another (‘a transition’), is governed by the current state and one or more ‘conditions’ or rules, which take as inputs signals, in this case from body-worn sensors or time. When a given ‘condition’ is satisfied, movement to the next state will be ‘triggered’. An example is provided in of a simple FSM designed to assist a person with weakness of biceps and finger extensors to practice drinking from a glass.
Figure 3.3: Example FSM for drinking from a glass. Boxes represent the states and T1-T5 the transitions between states.
‘Neutral’ (Stim off) ‘Open hand’ Finger extensors (stim on) ‘Lift’ Biceps (stim on)
‘Release’ Finger extensors
(Stim on) Transition 1 (has button been pressed?)
Transition 2 (has time since entering the state exceeded T2?)
Transition 3 (has the predetermined angle been reached?)
Transition 5 (has time since entering the state exceeded T5?)
Transition 4 (has the predetermined angle been reached?)
‘Replace’ (stim off)
66 In the example shown in Figure 3.3, the participant starts with their limb in a neutral position (‘Neutral’). To initiate leaving ‘neutral’ and moving to the next state ‘open hand’ a button press is used as the trigger (Transition1). Stimulation to the finger extensors commences and the hand opens (‘Open hand’). Following a pre-specified time, (Transition 2) stimulation to finger extensors is terminated. The participant closes their hand around the glass. Stimulation is initiated to the biceps muscle to assist with lifting the glass to the mouth (‘Lift’). One the pre-determined angle has been reached, (Transition 3), stimulation ceases to biceps and the glass is replaced (‘Replace’). On replacing the glass, another pre-determined angle is reached (Transition 4), and stimulation to the wrist and finger extensors is triggered to allow release of the glass (‘Release’). Once released, following a pre-specified time (Transition 5), the participant returns to the starting position (‘Neutral’).
As such an approach required robust measurement of limb segment angle from a body worn accelerometer, a new method was developed by a fellow PhD student (Sun, 2014). Sun (2014) also implemented a novel state machine controller which uses limb segment angle as one of the inputs (Sun, 2014).
3.3.2 The hardware and programming environment
The hardware for the UL FES Rehab Tool used throughout this thesis consisted of a four channel programmable CE marked electrical stimulator RehaStimTM (Hasomed GmbH, Germany) and two inertial sensor units (Xsens) (MTx, Xsens technologies B.V., Netherlands), connected to a laptop computer on which the graphical user interface (GUI) was to run. The GUI software and underlying controller were developed in the Matlab Simulink programming environment by (Sun, 2014). The system is represented diagrammatically in Figure 3.4 below.
67
Figure 3.4: Graphical representation of the laptop with GUI, RehaStimTM (FES unit) and surface electrodes, the inertial sensor system (Xsens) with 2 inertial measurement units (each comprising a 3 axis accelerometer, 3 axis gyroscope and 3 axis magnetometer).
The FSM-based controller involved a series of states (hereafter referred to as movement phases) and transitions, as well as stimulation outputs for each state, to be specified by the user. Based on an initial proof of concept work by the design team, led by the author, a high level setup framework for the GUI was designed that consisted of 5 stages as follows:
Stage 1: Loading and saving the patient file, defining the FES assisted upper limb task, including movement phases and the muscles (channels) stimulated in each phase. Before commencing treatment, the therapist selected the functional task to be practised, taking into account the patients’ level of impairment and functional ability. Hence it was logical to set this as stage 1 of the setup process. In addition, this stage can be set up independent from the patient, thereby saving face to face therapy time.
Movement sensor (hardware) Movement sensor (hardware) Xsens unit (hardware)
USB serial port
Grap h ical Use r I n te rf a ce (GU I) FSM co n trolle r RehaStimTM electrical stimulator (hardware) Research laptop with software Surface electrodes Surface electrodes Surface electrodes Surface electrodes U S B s e rial p o rt
68 Stage 2: Don electrodes and sensors, assign them to devices and channels, and then establish two reference stimulation levels for each channel (movement threshold and maximum).
Donning and assigning electrodes and sensors is necessary prior to stimulation. Stimulation thresholds are set for each individual muscle group before moving to combined stimulation of muscles.
Stage 3: Setup a manual state-machine controller to achieve as seamless a sequence of movement phases as possible, including setting stimulation targets and ramp rates for each channel in each movement phase. Inevitably once movement sequences are combined and incorporated into a functional task, stimulation levels need to be fine- tuned to enable smooth, co-ordinated movement sequences.
Stage 4: Setup automatic transition conditions so that movement from one state to the next does not require manual control. Once the efficient movement sequences have been established, the most appropriate exiting triggers can be stipulated.
Stage 5: Run the FES controller and the practice session.
Although a proof of concept framework had been developed by the design team, there had been no user involvement in this process.
The following chapter details the usability design framework used to develop and evaluate the UL FES Rehab Tool. The system was to be explicitly designed to be used under the supervision of a therapist rather than as an unsupervised home based system. The chapter describes the early phases of the design process, specifically demonstrating how user involvement, (via therapist advisory group meetings) influenced the design.
69