Discrete-Time Cycle-to-Cycle Fuzzy Logic Control of FES-Induced Swinging Motion

Functional electrical stimulation (FES) can be used to restore motor function to individuals with spinal cord injuries (SCI). FES involves artificially inducing a current in specific motor neurons to generate a skeletal muscle contraction. FES induced movement control is a significantly challenging area for researchers. The challenge mainly arises due to muscle response characteristics such as fatigue, time-varying properties and nonlinear dynamics of paralyzed muscles [1]. Another challenge is due to certain motor reflexes such as spasticity. Spasticity is a reflex or uncontrolled response to something that excites the nerve endings and produces muscle contractions. These reflexes are often unpredictable and may impede joint movements [2].


Introduction
Functional electrical stimulation (FES) can be used to restore motor function to individuals with spinal cord injuries (SCI). FES involves artificially inducing a current in specific motor neurons to generate a skeletal muscle contraction. FES induced movement control is a significantly challenging area for researchers. The challenge mainly arises due to muscle response characteristics such as fatigue, time-varying properties and nonlinear dynamics of paralyzed muscles [1]. Another challenge is due to certain motor reflexes such as spasticity. Spasticity is a reflex or uncontrolled response to something that excites the nerve endings and produces muscle contractions. These reflexes are often unpredictable and may impede joint movements [2].
Primarily due to the complexity of the system (nonlinearities, time-variation) practical FES systems are predominantly open-loop where the controller receives no information about the actual state of the system [3]. In its basic form, these systems require continuous user input. Practical success of this open-loop control strategy is still, however, seriously limited due to the fixed nature of the associated parameters. The problem arises especially due to the existing parameter variations (e.g., muscle fatigue), inherent time-variance, and strong nonlinearities present in the neuromuscular-skeletal system or the plant to be controlled. Besides, in such open-loop control approach, the actual movement is not assessed in real time and any mechanism of adapting the stimulation pattern in response to unforeseen circumstances such as external perturbations or muscle spasms is absent [4]. These prominent problems can be resolved by having a suitable closed-loop adaptive control mechanism. Such approach has several advantages over open-loop schemes, including better tracking performance and smaller sensitivity to the modeling errors, parameter variations, and external disturbances [5].
In controlling cyclical movement, one can try to follow pre-set joint angle trajectories. Although the trajectory-based closed-loop control has been developed but it has not been used yet in clinical FES gait because of difficulties in achieving accurate tracking performance [6]. Moreover, in the swing phase of gait, following exact trajectories is unimportant and inefficient, leading to fatigue due to large forces that must be exerted to precisely control the high inertia body segments [3]. For these reasons, cycle-to-cycle control method is expected to be an alternative to trajectory based closed-loop FES control. The cycle-to-cycle control delivers electrical stimulation in the form of open-loop control in each cycle without reference trajectory but it is still closed-loop control. In this control strategy, movement parameters at the end of each cycle are compared as in the desired set point, and the stimulation for the next cycle is adjusted on the basis of the error in the preceding cycle.
In fact, FES induced movements have traditionally been achieved through application of stimulus bursts rather than continuous tracking control. The burst of stimulus signal would drive the joint to its desired orientation through ballistic movement and thus traversing a trajectory defined purely by the physics of the segment combination [5]. The cycle-to-cycle control approach retains this basic mechanism of movement generation through stimulus burst and comes into action when the movement is repetitive or cyclical, through automatic adjustment of the burst parameters to maintain the desired target orientation at each cycle [7]. While the trajectory based closed-loop control for knee joint angle of paraplegic has been criticized for having poor tracking and oscillatory responses and even its inability to reach full knee extension angle [8]. the ability of cycle-to-cycle control approach to realize the target joint orientation has been demonstrated in experimental tests of controlling maximum knee extension angle [9] or hip joint range [7].
Researches as in [7] and [9] investigated a discrete-time proportional-integral-derivative (PID) feedback controller for cycle-to-cycle adaptation of an experimentally initialized stimulation signal with a view to compensate for the fatigue-induced time variation of muscle output. For practical use of cycle-to-cycle control, realization in multi-joint control is crucial, in which problems seen in the PID controller such as drawback in determination of controller parameter values and a lack of capability in compensating muscle fatigue [7] have to be solved. It is difficult to establish the control parameters for these systems since they are not always the same under different circumstances [10]. Therefore, traditional control approaches, such as PID control might not perform satisfactorily if the system to be controlled is of highly nonlinear and uncertain nature [5].
On the other hand, fuzzy logic control (FLC) has long been known for its ability to handle a complex nonlinear system without developing a mathematical model of the system. FLC is the fastest growing soft computing tool in medicine and biomedical engineering [11]. It is being used successfully in an increasing number of application areas in the control community. FLCs are rule-based systems that use fuzzy linguistic variables to model human rule-of-thumb approaches to problem solving, and thus overcoming the limitations that classical expert systems may face because of their inflexible representation of human decision making. The major strength of fuzzy control also lies in the way a nonlinear output mapping of a number of inputs can be specified easily using fuzzy linguistic variables and fuzzy rules [12]. The control signal is computed by rule evaluation called fuzzy inference instead of by mathematical equations. In order to compensate the non-linearity of the musculo-skeletal system responses, the cycle-to-cycle control was implemented using fuzzy controller. Thus FLC with is the preferred option in the current work This chapter presents the development of strategies for swinging motion control by controlling the amount of stimulation pulsewidth to the quadriceps muscle of the knee joints. The capability of the controller to control knee joint movements is first assessed in computer simulations using a musculo-skeletal knee joint model. The knee joint model developed in Matlab/Simulink, as described in [13], is used to develop an FLC-based cycleto-cycle control strategy for the knee joint movement. The FLC output is the controlled FES stimulation pulsewidth signal which stimulates the knee extensors providing torque to the knee joint. The swinging movement is performed by only controlling stimulation pulsewidth to the knee extensors to extent the knee and then the knee is left freely to flex in the flexion period. The controllers are then tested through experimental work on a paraplegic in terms of swinging performance and compensation of muscle fatigue and spasticity.

Model of knee joint
The shank-quadriceps dynamics are modelled as the interconnection of passive and active properties of muscle model and the segmental dynamics. The total knee-joint moment is given as [14]: where Mi refers to inertial moment, Mg is gravitational moment, Ma refers to an active knee joint moment produced by electrical stimulation, Ms is the knee joint elastic moment and Md is the viscous moment representing the passive behaviour of the knee joint. In this research the Mi and Mg are represented by the equations of motion for dynamic model of the lower limb while Ma and Ms+Md are represented by a fuzzy model as active properties of quadriceps muscle and passive viscoelasticity respectively. A schematic representation of the knee joint model consisting of active properties, passive viscoelasticity and equations of motion of the lower limb is shown in Figure 1. The active joint moment is added with the passive joint moment as an input (torque) to the lower limb model and this will produce the knee angle as the output. The subject participating in this work was a 48 year-old T2&T3 incomplete paraplegic male with 20 years post-injury with height = 173cm and weight = 80kg. Informed consent was obtained from the subject.
A schematic diagram of the lower limb model is shown in Figure 5, where 2 q = shank length, The inertial ( i M ) moment of the lower limb is represented as follows:- where, 1 m = shank mass, Anthropometric measurements of length of the lower limb were made and this is shown in Table 1. Figure 2. Lower limb model [4] The knee joint model input is the stimulation pulsewidth as would be delivered in practice by an electrical stimulator. The complete model of knee joint thus developed is utilized as platform for simulation of the system and development of control approaches.

Segment
Length (m) Shank length 0.426 Foot length 0.068 Approximated position of COM of shank 0.213 Approximated position of COM of soot 0.034 Table 1. Anthropometric data of subject

Cycle to cycle controller development
Researcher as in [15] highlighted cycle-to-cycle control as a method for using feedback to improve product quality for processes that are inaccessible within a single processing cycle but can be changed between cycles. The same concept has been applied in this study, where only reaching a target joint orientation through ballistic movement is taken into consideration rather than rigorously following a trajectory. The muscle is stimulated by single burst of controlled stimulation pulsewidth for each cycle to induce joint movement reaching the target extension knee angle. Therefore, the method is different from the traditional closed-loop control such as tracking control of desired angle trajectory.
An outline of the discrete-time fuzzy control based cycle-to-cycle control is shown in Figure3. The controlled maximum joint angle of the previous cycle is delivered as feedback signal. Error is defined as difference between the target and measured joint angle. The controller will regulate the duration of stimulation pulsewidth based on the error and previous flexion angle.

Maximum flexion and extension detector
The maximum flexion time detector will detect the time the angle reaches the peak of knee flexion for each cycle. The maximum extension signal and time detector will detect the peak angle of knee extension and the time the knee angle reaches this point for each cycle. The extension and flexion stages of the knee angle are shown in Figure 4.

Activation switch
Activation switch consists of hold and multiplier block to be active only when the knee angle reaches maximum flexion. The activation switch will hold the error signal and produce the output whenever it receives a signal from the maximum flexion time detector.

Amplitude to time duration convertor
Amplitude to time duration converter is linearly converting the controlled signal (amplitude) from controller to time duration using signal comparator and shifting technique as shown in Figure 6.3. In this technique, first the controlled signal is compared with specific constant values for low to high in the parallel structure. Each comparator compares the controlled signal with the specific constant, if the controlled signal is greater than or equal to the specific constant then a single pulse will pass through the comparator. The first comparator compares the control signal with zero, if there is any signal from controller then the output will be a pulse with 0.05s width. The second comparator compares the control signal with specific constant and shift 0.05s and the next comparator compares and shifts by a further 0.05s. Then the resultant pulse duration for each cycle is obtained by summing up the total pulses passed through the comparators and amplifying the signal with 220µs. The higher the controlled signal the more gates can be passed through and the wider the duration of pulse. Therefore the output of this converter is a single burst of controlled stimulation pulse duration with constant amplitude (220µs) for each cycle.

Controller objectives
The FLC-based cycle-to-cycle control was designed to achieve the following objectives: i. Able to reach full knee extension ii. Able to reach target extension angle thus maintain a steady swinging motion.
iii. Compensate for muscle fatigue iv. Compensate for spasticity

Fuzzy controller design
Measured output of the controlled musculoskeletal system of the previous cycle is delivered as feedback signal. Proper value of signal is determined and regulated automatically by a Sugeno-type fuzzy controller using control rules as shown in Table 2. Input membership function is expressed as triangle fuzzy sets. Output membership function is expressed as fuzzy singletons. Input of fuzzy controller is aggregated by fuzzy inference using fuzzy rules to produce control action.
The fuzzy rules base directs control action based on error and flexion angle. The error will be higher when the muscle fatigues, in which case the response to a stimulation burst will change. To compensate for this changing system response, the stimulation burst time has to be increased such that shank can reach the desired angle in every cycle. The flexion angle was taken into account to rule out the disturbance due to spasticity. Combination of the information about error and knowledge about flexion angle will be necessary for controller to give an appropriate stimulation pulsewidth in compensation of muscle fatigue and motor reflexes. pulsewidth in compensation of muscle fatigue and motor reflexes.

Results and discussion
This discrete-time fuzzy logic cycle to cycle control technique emphasizes the view to overcome some drawbacks of trajectory based closed-loop FES control such as poor tracking, oscillating response and inability to reach full knee extension angle (Hatwell, 1991). Then the capabilities in compensating for muscle fatigue and spastisity are investigated. The ability of this control approach to realize the target joint orientation is assessed in simulation and experimental test as follows:-

Controllers' performance in simulation environment
A complete set of non-linear dynamic equations of the knee joint model comprising the passive properties and active properties have been used in the simulations for purposes of controller development. Computer simulations are performed to assess the performance of the designed discrete-time fuzzy logic cycle-to-cycle control approach in generating stimulation burst durations for the desired extension angle. The simulations were carried out within the Matlab/Simulink environment. The muscle model was controlled by changing the pulse width; however the amplitude and the frequency of the stimulation pulses were constant. Here only the knee extensors are controlled by applying regulated stimulation pulsewidth to the quadriceps muscle model.

Full knee extension angle
The test was initiated with stimulation pulse of 240µs amplitude with 0.3s burst duration for the first cycle of swing in gait before activating the controller. FES induced swinging motion was controlled using fuzzy controller to reach full extension angle. The full extension angle that can be achieved by paraplegic was defined as 10°. The computer simulation test was performed with stimulation course of 50 cycles. The first 5 cycles of the controlled swinging leg test of the full extension knee angle are shown in Figure 6.4. As can be seen, using FLCbased cycle-to-cycle control approach the first objective was achieved; to reach the full knee extension. The knee reached full extension at 3rd cycle and was able to maintain the swinging motion without any predefined trajectory.

Target extension angle and maintain steady swinging
The desired extension knee angle was set to be at 65° as considered in [16]. The test was initiated with stimulation pulse of 220µs amplitude with 0.25s burst duration for the first cycle before activating the controller.

Without presence of musle fatique and voluntary activation
The test is to achieve the target extension angle and thus maintain a steady swing of the shank without presence of musle fatique and voluntary activation. In the each test computer simulation was performed with stimulation course of 50 cycles. The first 10 cycles of the controlled swinging leg test of the knee joint at 65° is shown in Figure 7. As can be seen the cycle-to-cycle control approach can achieve the target extension angle at 3 rd and thus maintain a steady swing of the shank. It is noted that the performance of the controller was quite good and acceptable.

With presence of musle fatique and without presence of voluntary activation
Muscle fatigue is an inevitable pitfall in FES induced control of movements. Fatigue is defined as the inability of a muscle to continue to generate a required force. It limits the duration FES can be effective by drastically reducing the muscle force output. It thus should be considered as an important criterion for FES induced movement control. The fatigue resistance of the control approaches were analyzed based on relative drop in knee extension by simulating the fatigue as in Figure 8. The fatigue simulation was to reduce muscle torque output to the 80% of total torque output at the end of simulation [5]. Figure 6.7 shows the knee joint response obtained using this controller, but with FES torque dropped down to 80% of its normal value. The effect of fatigue can be noted at 3 rd cycle, the shank was unable to reach the target angle. Then controller has taken action to overcome this by increasing the stimulation burst time. Then, after 6 th cycle the shank reached the target angle thus maintaining the swinging motion. As can be seen the controller performed very well in terms of robustness of the FLC in the presence of muscle fatigue.

With presences of musle fatique and spasticity
SCI muscle often exhibits spasticity [17] and may vary with time during cyclical motion [18]. Spasticity is defined as motor disorder characterized by a velocity-dependent increase in tonic stretch reflexes with exaggerated tendon jerks [19]. With regard to FES-approaches for function restoration, spasticity certainly represents a disadvantage especially flexion spasticity [20]. Muscle fatigue (as in previous test) and motor reflex to represent spasticity were simulated to assess the ability of controller to tackle these influences.  Since in practice spasticity is unpredictable, the motor reflex was simulated by multiplying a random number (between 0.1 to 1) with flexion angle as the second controller's input as in Figure 10. Controller has to compensate for the presence of spasticity in order to maintain swinging motion. Figure 11 shows the knee joint response obtained using this controller with the influence of muscle fatigue and voluntary activation. The presence of spasticity can be noted at 3rd cycle and for almost 5sec, then shank returning back to rest angle. When severe spasticity happens, the controller will stop the stimulation because it may seriously hinder the swinging activity as well as for reason of safety. Once knee angle reaches the rest angle, the controller starts the stimulation. However, as can be seen in Figure 11 muscle spasm is noted leading to muscle fatigue. The controller was able to compensate for the presence of fatigue after few cycles. The controller performed well in terms of robustness of the FLC overcoming the influence of these phenomena after few cycles.

Experimental validation of controller
The laboratory apparatus built to study the knee joint control by FES is shown in Figure 12. The subject sat on a chair, which allowed the lower leg to swing freely, while the ankle angle was fixed at 0°. The knee extensors (quadriceps muscle group) were stimulated by a pair of surface electrodes (2"x5"). The cathode was placed on the motor point of rectus femoris and the anode was placed distally at the quadriceps tendon. Knee angle was defined in Figure 2, with when the lower leg was at rest during knee flexion (i.e., 90).
The computer-controlled stimulator system consisted of a personal computer, computercontrolled interface (including analog-to-digital converter), current controlled stimulator and electro-goniometer (see Figure 12). The stimulation pulsewidth is generated by FLC based on the error by comparing the actual extension angle and the desired ones. All these operations were performed in the Matlab/Simulink environment in the computer. The Hasomed stimulator device was connected to PC via USB interface port. The knee joint angle was measured via the Biometric flexible electroganiometer mounted at approximate center of rotation of the knee joint. Stimulation pulsewidth ranged from 0 to 230µs and stimulation current was fixed to 40mA with a biphasic type pulse. The stimulation frequency was set to 25Hz and the knee joint angle sampling time was 0.05s. The experimental validation tests of the discrete-time fuzzy logic cycle to cycle control (based on simulation study) was assessed the capability of the controller to control the swinging motion as desired.

Full knee extension angle
The test was initiated with stimulation pulse of 240µs amplitude with 0.3s burst duration for the first cycle of swing in gait before activating the controller as in the simulation study.
FES-induced swinging motion was controlled using fuzzy controller to reach full extension angle at 10°. The shank was able to reach full knee extension at 4th cycle as can be seen in Figure 13. The ability of the cycle-to-cycle control approach to reach full knee extension has been demonstrated similar to that in [9].

Target extension angle and maintaining steady swinging
The same procedure as in the simulation work was applied with the test initiated with 220µs amplitude with 0.15s burst durations of stimulation pulse. The controller performed in high intense stimulation course of 100 cycles as shown in Figure 14 in order to get influences of muscle fatigue and spasticity. EMG signal via surface electrodes on quadriceps muscle was recorded in this test to monitor EMG activity. The controller was tested in three scenarios, as in the simulations. Few trials were conducted in order to make sure the presence of these three scenarios was on the same stimulation course. An intra-trial interval for 120s was used to reduce the effect of fatigue in the beginning of the stimulation. Finally the best stimulation course with presence of both phenomena; muscle fatigue and spasticity were recorded. The recorded stimulation course was for almost 100 cycles and this was divided into three scenarios as follows:

Without presence of musle fatique and voluntary activation
In the first part of test, the controller was validated without fatigue and spasticity by considering only the first 10 cycles of the stimulation course. Before beginning the test, the subject was asked to relax as much as possible. There was no EMG present when the subject was fully relaxed. Figure 14 shows the response of knee angle in the first scenario. The controller was able to perform a steady swinging motion of shank after 5s with ability to extend the knee to the desired extension angle. Hence this controller achieved the main objective; to maintain a steady swinging of the lower limb as desired but the controller needed more time to achieve this.

With presence of musle fatique and without presence of voluntary activation
In the second part of test, the controller was validated when the muscle fatigue happened due to high stimulation intensity. This scenario can be seen by monitoring the reduction in the extension of knee joint. Few cycles of the stimulation course before and after fatigue were considered in this test as shown in Figure 15. It can been seen that at the beginning the knee angle was unable to reach the desired value due to fatigue, and then with the controller action by increasing the stimulation burst time the shank was able move a bit higher. After few cycles the knee angle reached the desired extension angle and swinging motion was maintained. Therefore, this controller achieved the third objective; to maintain a steady swinging of the lower limb as desired in presence of muscle fatigue. Only a small amount of EMG activity was recorded in this scenario.

With presence of musle fatique and voluntary activation
In the final validation test, the controller was validated with presence of spasticity and muscle fatigue. This scenario can be seen by monitoring the knee angle at which spasticity stops the natural swing. Furthermore, high EMG activity was apparent throughout the trace. These uncontrolled muscle movements were brought by spasms causing fatigue. Thus, the reduction in the extension of knee joint can be seen after spasm. 15 cycles of the stimulation course before and after spasm were considered in this test as shown in 16. It can be seen that spasticity caused uncontrolled movement. The controller automatically stopped the stimulation due to spasticity. Once there was no motion of the knee, the controller started the stimulation with widest stimulation burst time to compensate for muscle fatigue. After 5s the knee angle reached the desired extension angle and swinging motion was maintained. Therefore, this controller achieved the last objective; to maintain a steady swinging of the lower limb as desired in presence of spasticity and muscle fatigue.

Conclusion
FES induced movement control is a difficult task due to the highly time-variant and nonlinear nature of the muscle and segmental dynamics. The great merit of a musculoskeletal model of knee joint is to serve for control development. In this study, a new closed-loop control approach using fuzzy logic based cycle-to-cycle control for FES-induced motion control has been proposed. This control technique also emphasizes to overcome some drawbacks of the trajectory based closed-loop FES control. The objectives of this controller have been set to achieve full knee extension angle, to reach target extension angle thus maintain a steady swinging motion and to compensate for muscle fatigue and spasticity. The performance of the controller to achieve these objectives has been assessed through simulation study and validated through experimental work. The controller has been proved to achieve all these objectives. Besides its suitability in generating the target joint orientation, one of the attractions of the cycle-to-cycle control in FES application is the absence of any reference trajectory. Cycle-to-cycle control is easy to implement in practice. Additionally, this method can compensate for non-linearity and time-variance of response of electrically stimulated musculoskeletal system. This controller may be suitable not only for swinging but also for other FES control applications involving movement of cyclical nature.