The Cardiac Pacemaker Case Study and its implementation in - - PowerPoint PPT Presentation

the cardiac pacemaker case study and its implementation
SMART_READER_LITE
LIVE PREVIEW

The Cardiac Pacemaker Case Study and its implementation in - - PowerPoint PPT Presentation

The Cardiac Pacemaker Case Study and its implementation in Safety-Critical Java and Ravenscar Ada Neeraj Kumar Singh, Andy Wellings, Ana Cavalcanti University of York, United Kingdom JTRES, 24-26 October 2012 Singh, Wellings and Cavalcanti


slide-1
SLIDE 1

The Cardiac Pacemaker Case Study and its implementation in Safety-Critical Java and Ravenscar Ada

Neeraj Kumar Singh, Andy Wellings, Ana Cavalcanti

University of York, United Kingdom

JTRES, 24-26 October 2012

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 1 / 23

slide-2
SLIDE 2

Outline

1

Context and Motivation

2

Heart System

3

The Cardiac Pacemaker

4

DDDR Pacing Mode

5

The Cardiac Pacemaker Architecture in SCJ

6

Conclusion

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 2 / 23

slide-3
SLIDE 3

Context and Motivation

Context

Evaluation of a concurrency model of a cardiac pacemaker using two programming languages: Safety Critical Java (SCJ) and Ravenscar Ada.

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 3 / 23

slide-4
SLIDE 4

Context and Motivation

Context

Evaluation of a concurrency model of a cardiac pacemaker using two programming languages: Safety Critical Java (SCJ) and Ravenscar Ada.

Motivation

To contribute in the area of Grand Challenges.

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 3 / 23

slide-5
SLIDE 5

Context and Motivation

Context

Evaluation of a concurrency model of a cardiac pacemaker using two programming languages: Safety Critical Java (SCJ) and Ravenscar Ada.

Motivation

To contribute in the area of Grand Challenges. Implementation of cardiac pacemaker in SCJ.

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 3 / 23

slide-6
SLIDE 6

Context and Motivation

Context

Evaluation of a concurrency model of a cardiac pacemaker using two programming languages: Safety Critical Java (SCJ) and Ravenscar Ada.

Motivation

To contribute in the area of Grand Challenges. Implementation of cardiac pacemaker in SCJ. A comparative study of SCJ and Ravenscar Ada.

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 3 / 23

slide-7
SLIDE 7

Context and Motivation

Context

Evaluation of a concurrency model of a cardiac pacemaker using two programming languages: Safety Critical Java (SCJ) and Ravenscar Ada.

Motivation

To contribute in the area of Grand Challenges. Implementation of cardiac pacemaker in SCJ. A comparative study of SCJ and Ravenscar Ada. To meet the certification standards.

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 3 / 23

slide-8
SLIDE 8

Context and Motivation

Context

Evaluation of a concurrency model of a cardiac pacemaker using two programming languages: Safety Critical Java (SCJ) and Ravenscar Ada.

Motivation

To contribute in the area of Grand Challenges. Implementation of cardiac pacemaker in SCJ. A comparative study of SCJ and Ravenscar Ada. To meet the certification standards. hiJaC Project

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 3 / 23

slide-9
SLIDE 9

Heart System

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 4 / 23

slide-10
SLIDE 10

Electrical Signal of the Heart

Sinoatrial (SA) Node Right Atrium Right Ventricle Right Bundle Branch Left Bundle Branch Left Ventricle Bundle of His Atrioventricular (AV) Node Left Atrium

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 5 / 23

slide-11
SLIDE 11

Timing Cycles

time VAI LRI VRP PVARP TARP

P Q R S T P Q R S T

AVI ARP Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 6 / 23

slide-12
SLIDE 12

Timing Intervals in a Single Heart Beat

Time Intervals Time in milliseconds Length of a P wave (TP) 110 Duration of pulse (Tpulse) 1 Length of a QRS complex (TQRS) 100 Atrioventricular interval (AVI) 150 Ventriculoatrial interval (VAI) 850 Postventricular atrial refractory (PVARP) 350 Mode Switching Interval (MSI) 500

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 7 / 23

slide-13
SLIDE 13

The Cardiac Pacemaker

Pacemaker

A pacemaker is an electronic device implanted in the body to regulate the abnormal heart rhythm (bradycardia). Types:1,2 and 3-Electrodes.

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 8 / 23

slide-14
SLIDE 14

The Cardiac Pacemaker

Pacemaker

A pacemaker is an electronic device implanted in the body to regulate the abnormal heart rhythm (bradycardia). Types:1,2 and 3-Electrodes.

Basic elements of Pacemaker

Leads Pacemaker generator Device Control Monitor (DCM) Accelerometer

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 8 / 23

slide-15
SLIDE 15

Operating Modes : NASPE/BPEG Generic Code

Operating Modes : NASPE/BPEG Generic Code

Category Chambers Chambers Response to Rate Modulation Paced Sensed Sensing Letters O-None O-None O-None R-Rate Modulation A-Atrium A-Atrium T-Triggered V-Ventricle V-Ventricle I-Inhibited D-Dual(A+V) D-Dual(A+V) D-Dual(T+I)

i.e. AOO, VOO, AAI, AAT, VVI, DVIR, AOOR, DDDR etc. Periodic stimuli : (AOO, VOO and DOO) Aperiodic stimuli : (AAI, VVI, DDD, DDI, etc.)

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 9 / 23

slide-16
SLIDE 16

Basic Architecture of a Cardiac Pacemaker

MICROCHIP PIC Processor

Atrial Pacing Pulse Generator Atrial Heartbeat Sensor Ventrical Heartbeat Sensor Ventrical Pacing Pulse Generator Rate Modulation Sensor Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 10 / 23

slide-17
SLIDE 17

The DDDR Pacing Scenarios

Atrial Sense Ventricle Sense (D) Atrial Sense Ventricle Pace (C) Ventricle Sense Atrial Pace time (B) Atrial Pace Ventricle Pace time (A)

AVI VAI LRI PVARP

P time R T time Q S

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 11 / 23

slide-18
SLIDE 18

Rate Modulation and Mode Switching

Rate Modulation

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 12 / 23

slide-19
SLIDE 19

Rate Modulation and Mode Switching

Rate Modulation Mode Switching (DDDR ↔ DDIR)

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 12 / 23

slide-20
SLIDE 20

The Required DDDR Pacing Cycle

Wait PVARP Atrium Sensed Set VAI Countdown Timer VAI Expired Pace Atrium Set AVI Countdown Timer Ventricle Sensed AVI Expired Pace Ventricle no yes no yes yes no yes No Change Rate Update VAI yes no

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 13 / 23

slide-21
SLIDE 21

Safety Critical Java

Start Halt Mission Initialization Select Mission Mission Execution Mission Cleanup Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 14 / 23

slide-22
SLIDE 22

The Cardiac Pacemaker Architecture in SCJ

MICROCHIP PIC Processor

Atrial Pacing Pulse Generator Atrial Heartbeat Sensor Ventrical Heartbeat Sensor Ventrical Pacing Pulse Generator Rate Modulation Sensor

Aperiodic Handler Periodic Handler Periodic Handler Periodic Handler Aperiodic Handler

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 15 / 23

slide-23
SLIDE 23

Algorithm for the Atrium Sensor Periodic Handler

Read sensor Intrinsic Atrium activity sensed Yes Set lastAtriumActivity time Set attriumActivityOccurred Clear ventricularActivityOccurred Yes No Time elapse since lastVentricularActivity >= VAI Release atrium pacer Set attriumActivityOccurred Yes Wait for next release event Time elapsed since lastVentricularActivity >= PVARP No Yes atriumActivity Occurred no Yes No

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 16 / 23

slide-24
SLIDE 24

Algorithm for the Atrium Pacer Aperiodic Handler

Time elapse since atrium activity >= VAI Yes Set lastAtriumActivityTime Pace current on Sleep 1 ms Pace current off Clear ventricularActivityOccurred No Wait next release Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 17 / 23

slide-25
SLIDE 25

Algorithm for the Ventricle Sensor Periodic handler

Read sensor Intrinsic ventricular activity sensed Wait for next release event Yes Set lastVentricularActivity Clear atriumActivityOccurred No Time elapsed since lastAtriumActivity > AVI Release ventricular pacer Yes No Mode change needed Request mission termination Yes No ventricular ActivityOccurred Yes Set ventricularActivittyOccurred No

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 18 / 23

slide-26
SLIDE 26

Algorithm for the Ventricle Pacer Aperiodic Handler

Time elapsed since lastVenticularActivity > PVARP+AVI Set lastVentricularActivity Pace current on Sleep 1ms Pace current off Clear atriumActivityOccurred Yes Wait for next release event No Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 19 / 23

slide-27
SLIDE 27

Implementation in SCJ

http://www.cs.york.ac.uk/circus/hijac/case.html

... public void handleEvent() { AbsoluteTime now =Clock.getRealtimeClock().getTime(); interval = now.subtract(DDDR_PMMission.lastAtriumActivityTime).getMilliseconds(); if(interval > (DDDR_PMMission.PaceInterval - DDDR_PMMission.AVI)){ pm_A.Pace_ON_A(); //Pace ON RealtimeThread.sleep(new RelativeTime(DDDR_PMMission.PacingLength,0)); //sleep pm_A.Pace_OFF_A(); //Pace OFF DDDR_PMMission.Activity_V_Occured =false; //Reset Ventricle flag //Save pacing Time of Atrium DDDR_PMMission.lastAtriumActTime.set(now.getMilliseconds(),now.getNanoseconds()); } } ...

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 20 / 23

slide-28
SLIDE 28

Cardiac Pacemaker Simulator

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 21 / 23

slide-29
SLIDE 29

Conclusion & Future Work

Conclusion

Implementation of the cardiac pacemaker in SCJ and Ravenscar Ada.

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 22 / 23

slide-30
SLIDE 30

Conclusion & Future Work

Conclusion

Implementation of the cardiac pacemaker in SCJ and Ravenscar Ada. This work suggests the inclusion of one-shot timer in the final release

  • f SCJ.

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 22 / 23

slide-31
SLIDE 31

Conclusion & Future Work

Conclusion

Implementation of the cardiac pacemaker in SCJ and Ravenscar Ada. This work suggests the inclusion of one-shot timer in the final release

  • f SCJ.

Ada solution requires a dummy task to avoid from the premature termination.

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 22 / 23

slide-32
SLIDE 32

Conclusion & Future Work

Conclusion

Implementation of the cardiac pacemaker in SCJ and Ravenscar Ada. This work suggests the inclusion of one-shot timer in the final release

  • f SCJ.

Ada solution requires a dummy task to avoid from the premature termination.

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 22 / 23

slide-33
SLIDE 33

Conclusion & Future Work

Conclusion

Implementation of the cardiac pacemaker in SCJ and Ravenscar Ada. This work suggests the inclusion of one-shot timer in the final release

  • f SCJ.

Ada solution requires a dummy task to avoid from the premature termination.

Future Work

Formal verfication of the cardiac pacemaker in Circus.

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 22 / 23

slide-34
SLIDE 34

Singh, Wellings and Cavalcanti (UoY) Cardiac Pacemaker in SCJ & Ravenscar Ada JTRES, 24-26 October 2012 23 / 23