Fuzzy Controller for Dual Sensors Cardiac Pacemaker System in Patients with Bradycardias at Rest

Cardiovascular disease is defined as a heart rate that is less than 60 bpm. Implantable cardiac devices such as pacemakers are widely used nowadays. In this paper, design and implementation of the heart model can be controlled to be the heart of a patient suffering from a decrease in heart rate (Bradycardia). A system is designed to sense and calculate the heart rate per minute and it is considered as an input to the controller. The design and implementation of Mamdani fuzzy controller to generate electric pulses that mimic the natural pacing system of the heart maintains an adequate heart rate by delivering controlled, rhythmic electrical stimuli to the chambers of the patient heart. The proposed controller is tested by using Matlab/Simulink program.


Introduction
Cardiovascular diseases are major causes of morbidity and mortality in the developed countries.One of the cardiac diseases, bradycardia, sometimes results in fainting, shortness of breath, and if severe enough, death.Bradycardia means a slow heart rate, which is usually defined as fewer than 60 bpm.This occurs because people with bradycardia may not be pumping enough oxygen to their own heart causing heart attack-like symptoms.Thus, early diagnosis and treatment of heart diseases can effectively prevent the sudden death of a patient [1].It is well known that implantable cardiac devices such as pacemakers are widely used nowadays.They have become a therapeutic tool used worldwide with more than 250,000 pacemaker implants every year.A pacemaker is a medical device that uses electrical impulses, delivered by electrodes contacting the heart muscles, to regu-late the beating of the heart.Its primary purpose is to treat bradycardia due to sinus node or atrioventricular conduction disorders and to maintain an adequate heart rate, either because the heart's native pacemaker is not fast enough, or there is a block in its electrical conduction system.It can help a person who has an abnormal heart rhythm resume a more active lifestyle [2].Dual-sensors are used to avoid inappropriate rate increase and provide more accurate measurement of diagnostic data such that two sensors may compensate each other.Dual-sensors including accelerometer and QT interval adopted in this study provide activity signal, metabolic demand, and actual heart rate.An accelerometer placed in a pacemaker detects movement and patient's physical activity and generates an electronic signal that is proportional to physical activity.QT sensor type provides pacing rates more closely and specifically related to physical and mental stress requirements.The QT interval reflects the total duration of ventricular myocardial repolarization.It measures the interval between the pacing spike and the evoked T-wave as the sensor and this interval shortens with exercise.The target of this paper is to develop a pacemaker fuzzy controller for dual-sensors cardiac pacemaker system in patients with bradycardias at rest.It can automatically control the heart rate to accurately track a desired pre-set profile.[5] studied the role of heart rate on cardiac output (CO) at rest and during walk test in patients with dual-chamber pacemaker and depressed or normal left ventricular (LV) function.The importance is to the medical data sets for preset/desired heart rate profile as the reference input signal to our model.o In 2000, A. Wojtasik, Z. Jaworski, W. Kuzmicz, A. Wielgus, A. Walkanis, and D. Sarna [6] presented a study of several possible implementations of fuzzy logic controllers for rate-adaptive pacemakers.Most important advantage of this work shows fuzzy logic based control algorithm for adaptive pacemakers is technically feasible and can be implemented in several ways.However, there is a need for pacemakers with better control algorithms adapting the pacing rate to the physiological requirement of a particular patient.So design a fuzzy controller which can automatically control the heart rate (HR) to accurately track a desired pre-set HR profile will give us better performance.

Biomedical Background
The human heart occupies a small region between the third and sixth ribs in the central portion of the thoracic cavity of the body.The heart is divided by a tough muscular wall-the interatrial interventricular septum-into a somewhat crescent shaped right side and cylindrically shaped left side, each being one self-contained pumping station, but the two being connected in series [7].The heart is actually two separate pumps as shown in Figure 1: a right heart that pumps blood through the lungs, and a left heart that pumps blood through the peripheral organs.In turn, each of these hearts is a pulsatile two-chamber pump composed of an atrium and a ventricle [8].
The heart is composed of three major types of cardiac muscle: 1) Atrial muscle, 2) Ventricular muscle, 3) Specialized excitatory and conductive muscle fibres.The atrial and ventricular types of muscle contract in much the same way as skeletal muscle, except that the duration of contraction is much longer.Conversely, the specialized excitatory and conductive fibres contract only feebly because they contain few contractile fibrils; instead, they exhibit either automatic rhythmical electrical discharge in the form of action potentials or conduction of the action potentials through the heart, providing an excitatory system that controls the rhythmical beating of the heart [8].
There are two types of cardiac signals, one of them recorded from the chest, and the second one recorded from specific cardiac location inside the heart.
A. Pacemaker: is a device that generates electrical pulses and delivers them to the muscles of the heart (myocardium), in such a way as to cause those muscles to contract and the heart to beat.It is used to treat heart rhythms that are too slow, fast, or of any other irregularity.Figure 2 illustrates the implantation of a pacemaker in a human body.A pacemaker helps a person who has an abnormal heart rhythm resume a more active lifestyle.Normally, small electrical pulses produced by a pacemaker can sustain a regular heartbeat.In case of deadly cardiac abnormalities, the pacemaker has to be adjusted to generate compulsive strong pulses assisting a patient to return to normal heartbeat [9].
B. Dual sensors: are used to avoid inappropriate rate increase and provide more accurate measurement of diagnostic data such that two sensors may compensate each other.During crosscheck both sensors can control each other and the pacing rate will only be changed if both or a predominant sensor agrees [1] [2].Dual-sensors including accelerometer and QT interval adopted in this study provide activity signal, metabolic demand, and actual heart rate.
Rate Regulation with Dual Sensors: The dual-sensor pacemaker is expected to mimic the reaction of a healthy human heart to the levels of various body conditions, in other words to adapt the frequency of the heartbeat to the physiological needs.Dual-sensors including accelerometer and QT interval adopted in this study provide activity signal, metabolic demand, and actual heart rate.Acceleration is usually a good indicator of the physical activity requiring an increased heart rate [1].This sensor is characterized as quick to respond but less physiologically accurate.On the other hand, QT interval rate response is characterized as physiological but it is slow to respond to the onset of moving.Consequently, to reduce these factors, two sensors are used to provide compensation, in that the fuzzy controller converges only when the system is stable.In the case of resting, for instance, if the actual heart rate measured by dual-sensors is lower than preset normal rate for the particular patient, in order to assist the heartbeat regular, the pulses with adjustable pacing rate are generated by the pacemaker according to the fuzzy controller, such that the actual heart rate may track the preset desired heart rate in real-time.
In this paper the bradycardia at rest has been studied, so the Activity Sensor State is Zero.And its response will be the same as desired profile value = 80.

Designing FLC Dual Sensors Cardiac Pacemaker System
The system has heart model for IECG signal, adaptive sensing system for heart beats (dual sensors), and Mamdani fuzzy controller using for dual sensors cardiac pacemaker to achieve a closer match between the actual heart rate and a desired profile.As shown in the Figure 3. A. Heart Model: consists of two basic parts, one is the natural pacemaker (SA) node, and the second is the cardiac muscle cell (myocyte).o The Sinoatrial (SA) node: is the normal pacemaker of the mammalian heart and generates the electrical impulse for the regular, rhythmic contraction of the heart [10].o The cardiac muscle cell: is the most physically energetic cell in the body, contracting constantly, without tiring, 3 billion times or more in an average human lifespan.By coordinating its beating activity with that of its 3 billion neighbours in the main pump of the human heart, over 7000 litres of blood are pumped per day, without conscious effort, along 100,000 miles of blood vessels [11].Figure 4 of the cardiac muscle cell underpins our understanding of how the electrical impulse, generated within the heart, stimulates coordinated contraction of the cardiac chambers.

B. Sensing System/Simulation on Matlab Stages for detecting heartbeat rate per minute
In order to attenuate noise, the signal is passed through a band-pass filter.Subsequent processes are differentiation, squaring, Low-pass filter, saturation, quantizer, and a process for calculating mean value of the time between two qrs peaks, as shown in Figure 5.

C. FLC for Dual-Sensor Cardiac Pacemaker System
FLC has one input which is: error and one output which is: pulses with adjustable pacing rate generated by the pacemaker (Figure 6).

FLC Control Rules and Membership Functions
Mamdani approach is used to implement FLC for dual-sensor cardiac pacemaker systems.FLC contains three basic parts: Fuzzification, Base rule, and Defuzzification.

 Fuzzification
Mamdani FLC has one input which is error and one output which is pulses with adjustable pacing rate.

 Base Rule
The fuzzy linguistic variables of the FLC system are illustrated in Table 1.
The negative values in the membership function are for the patient safety.If the patient heart rate rises above the normal rate suddenly then the controller will stop raising the heartbeat and try to decrease it to the normal rate.The rules for the proposed controller are: 1.If (error is VL) then (decision is VL).
2. If (error is L) then (decision is L).

 Defuzzification
Defuzzification method is the final stage of the fuzzy logic control.The FLC pacing rate is then defuzzified using the COA (Centroid) method for simplicity of implementation and it is faster than any defuzzification method.

D. Simulation on Matlab/Simulink for Dual-Sensor Cardiac Pacemaker System
Figure 8 illustrates the Simulink block diagram for the fuzzy controller dual-sensor cardiac pacemaker systems.

E. Case Study and Simulation Results
In this paper, the preset/desired heart rate profile as the reference input signal in the case study for particular patients presented are obtained using the medical data sets from [5].
Table 2 presents the characteristics of individual patient and the corresponding desired normal HR at rest.The first 60 s is a delay time to allow the controller to understand the heart system, understand the patient heart and detect the patient heartbeats per minute while installs the pacemaker during the surgery.After discovering that the patient heartbeat per minute is under the normal rate, the controller must raise the heartbeats rate.During 30 s the controller begins to raise the patient heartbeats to the steady state heartbeats according to the desired heartbeats profile as shown in Figure 9.

 Comparative Study
The result of applying FLC to the pacemaker is compared with the work of Wei V Shi and Meng Chu Zhou; fuzzy logic controller, and fuzzy proportional-integral-derivative (FPID) [1].3).

Conclusion
Cardiovascular diseases are major causes of morbidity and mortality in the developed countries.One of the cardiac diseases, bradycardia, sometimes results in fainting, shortness of breath, and if severe enough, death.In recent years, fuzzy logic control has been used as an alternative approach to conventional process control techniques for biomedical equipment's.In this paper, new model for heart, sensing system, and Mamdani fuzzy controller is used to generate electric pulses that mimic the natural pacing system of the heart.The proposed model maintains an adequate heart rate by delivering controlled, rhythmic electrical stimuli to the chambers of the heart, and prevents human from being harmed by low heart rate.A comparative study shows that the proposed model with Mamdani FLC has a better response and demonstrates better performance than FPID controller.

Figure 7 (
a) and Figure 7(b) show the membership functions of fuzzy controller using Fuzzy Toolbox of Matlab software.Both membership functions have five Partitions VL, L, N, H, and VH.

3 .
If (error is N) then (decision is N). 4. If (error is H) then (decision is H). 5.If (error is VH) then (decision is VH).

Figure 7 .
Figure 7. (a) Membership function of input error e; (b) Membership function of output.

Figure 10 (
a) and Figure 10(b), show the effect of the proposed and compared controllers As shown the proposed controller in this paper obtains the best results compared with other controllers (Table

Figure 8 .
Figure 8. Testing FLC in the dual-sensor cardiac pacemaker system using Matlab/Simulink.

o
[1]June 2012, W. V. Shi and M. C. Zhou[2]presented a survey of the body sensors applied in pacemakers, introduced new features and advances of modern pacemakers, and the advancement of varieties of body sensors incorporated in pacemakers with their rationales, features and applications.Using one sensor is not ideal to for heart rate adaptation.So combining different kinds of sensors (dual sensors) is better than one sensor for optimal rate adaptation o In 2011, Wei Vivien Shi and Meng Chu Zhou[1]designed Fuzzy PID Controllers for Dual-Sensor Pacing Systems in Patients with Bradycardias at Rest, the most important advantage of this method was to provide a quite satisfactory tracking of the desired heart rate profile.New model for heart, IECG signal, sensing system and Mamdani fuzzy controller will achieve a closer match between the actual heart rate and a desired profile.

Table 1 .
The linguistic variables.

Table 2 .
Individual characteristics of the patient.