Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 8 of 14

Feasibility of formal model checking in the Vitatron environment: Chapter 4Pacemaker architecture

Pages 41 to 48 of 91, from Feasibility of formal model checking in the Vitatron environment

The original document is the PDF (6.4 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

Filed in the catalog under the Vitatron EE244

Page 41

Chapter 4

Pacemaker architecture In this project the firmware design of Vitatron’s DA+ pacemaker is used as a case study to investigate the feasibility of model checking at Vitatron. This chapter gives an overview of the architecture and the behavior of the firmware and its environment. An artificial pacemaker or implantable pulse generator (IPG) consists of the following components(see figure 4.1): • A can that surrounds the IPG and physically isolates the electronics from the environment (the patient’s body when the IPG has been implanted). • A hybrid that consists of digital and analog hardware and firmware (in ROM on the microprocessor). The firmware is a piece of embedded software that controls the behavior of the hardware such that the IPG maintains an adequate rate in the patient’s heart. • A battery that powers the electronics. • An antenna for wireless communication with the programmer, which is an external device through which the cardiologist can program patient dependent parameters. • A connector to which the leads are attached.

Figure 4.1: IPG overview The hybrid forms the intelligent core of the IPG. Figure 4.2 gives an overview of how the firmware is situated with respect to the hardware in the hybrid. The hybrid contains a hardware module that provides a telemetry interface to program an read firmware parameters; this telemetry hardware collaborates with a firmware component (Physician Programmer in 40

Page 42

Figure 4.2: Firmware environment figure 4.2). Then there is a module that provides the current time and events for each passed minute. Furthermore there is a number of modules for other tasks, e.g. a battery measurement module. But the most important hardware module from firmware perspective is the pulse generator (PG). The PG can be seen as the interface between the pacemaker leads and the firmware; it delivers paces to the heart on request of the firmware and provides heart diagnostics back to the firmware. These diagnostics include notifications when a contraction is sensed and when a pace is given (called sense and pace events) and time intervals that inform the firmware about when these events happened. The PG contains an atrial timer and a ventricular timer that measure the elapsed time since the last atrial or the last ventricular event, respectively. When a contraction is sensed or a pace is given, these timers contain the time interval between the sense or pace and the last atrial or last ventricular event, respectively. Together with the sense or pace event, the values of the timers are sent to the firmware. In the firmware these values are denoted by aa int (representing the time interval between the last atrial event and the last but one atrial event), av int (representing the time interval between the last ventricular event and the atrial event before this ventricular event), va int and vv int.

Here some text is removed for confidentiality reasons. This text describes how the firmware requests the PG to deliver a pace and how the PG ensures that this pace is given on the right moment in time.

After this overview of the environment in which the pacemaker firmware operates, we come to the description of the firmware itself. The pacemaker firmware is an event-driven system; processing occurs only in response to an external event by executing an interrupt service routine, after which the event is put in a queue of the operating system. The sense and pace events from the PG are the most important external events when the pacemaker is in operation; other examples of external events are parameter update events and the minute passed 41

Page 43

events. In the firmware development process, the Hatley and Pirbhai structured analysis method (H&P method in the sequel) is used to specify the functional firmware requirements and the firmware design. Also the DA+ firmware design is created using the H&P method. In the following section the H&P method is introduced for a better understanding of the mCRL2and Uppaal-model structures. For more detailed information about the H&P method itself, see [12].

4.1

The Hatley and Pirbhai method

The Hatley and Pirbhai method consists of modeling tools and techniques to specify both a system’s function and its physical partitioning. The system specification must define what problem the system is to solve (its requirements) and how that system is to be structured (its architecture or design structure). To this end the system specification is separated into two models; the requirements model and the architecture model. In this project, only the system requirements model of the DA+ pacemaker firmware is used as a basis for the formal models. The system requirements model specifies the flow of events and data between the system components and how these events and data are processed in the components. All processing in the model is assumed to be infinitely fast. The requirements model is built as a layered set of Data Flow Diagrams (DFDs) with associated processing specifications, called PSPECs. Each successive level of DFDs expresses a refinement of the higher-level DFDs and the most detailed DFDs only contain PSPECs. On each level this results in a network of processes, representing DFDs on the successive level and PSPECs, interconnected by data flows and control flows. The system requirements model shows how each process transforms its input data flows into output data flows, and how the processes are related to each other. To this process structure a control structure is added which determines what the process structure must do under any given external or internal conditions or operating modes. To this purpose process controls are generated from the logic in the so-called CSPECs (described below) which activate and deactivate DFDs and trigger PSPECs in the process structure. The control structure also receives information about the status or mode of external systems and transmits similar information about itself. After this overview of the system requirements model, we give a slightly more detailed description of the basic elements of a system requirements model: • Data flows: A data flow is a pipeline through which data of known composition flows. This data may consist of one element or a group of elements. Data flows are always continuous in the time domain and can be read and reread any number of times by a receiving process until its source process stops generating it. • Control flows: A control flow is a pipeline through which control information of known composition flows. Just as in a data flow, this control information may consist of one element or a group of elements. Control flows are time transient and can be seen as events that activate a certain calculation in the receiving process. • Data stores: A store is simply a data flow frozen in time. The data and control information a store contains may be used any number of times by any number of processes, and remains available until replaced with something new. 42

Page 44

• PSPEC: A Process SPECification is the elementary process that is specified by a sequence of statements in pseudo-code. A PSPEC can be triggered by a CSPEC (event triggered) or by a change of an incoming data flow (data triggered). When a PSPEC is triggered, it executes its pseudo-code which transforms the incoming data flows into outgoing data and control flows. • CSPEC: Each DFD possibly contains a Control SPECification to control the handling of incoming control flows. CSPECs convert input control flows into output control flows and process controls (through which PSPECs and child DFDs can be triggered). The CSPEC can be a process activation table (PAT), a state transition diagram (STD) or a combination of these two. If the CSPEC is only a PAT, it specifies the consequences of the receipt of each possibly incoming event in a table. The possible consequences can include activations and deactivations of child DFDs, the output of events on a control flow, and triggering PSPECs and child DFDs. In the latter case also the order in which the PSPECs and child DFDs are triggered can be specified. In an STD, the consequences of an incoming event are dependent of the current state of the STD. An STD is just a simple labeled transition system whose transition labels define on which incoming event the transition is performed and what the consequences of the transition are. In an STD these consequences can be triggering PSPECs and child DFDs, sending an event to another STD of the diagram, and sending an event to a corresponding PAT. In the latter case the corresponding PAT specifies the actual consequences of the transition which keeps the STD readable. Figure 4.3 shows the format of an STD in an H&P model.

Figure 4.3: State Transition Diagram Figure 4.4 shows an example of a DFD and its corresponding CSPEC. The DFD shows that the CSPEC has three incoming control flows and two outgoing control flows. The CSPEC defines how the receipt of the events event on, event off and calculate 1 is handled; in this case a PAT is used for this purpose. We see that event on results in the activation of the child DFD Compute and event off deactivates Compute. Furthermore the CSPEC defines that on the receipt of event calculate 1, first the PSPEC Increase is triggered and then the outputs events trigger compute and calculation started are delivered (both outputs are indicated by a ‘2’ in the PAT, meaning that the sending order of these events does not matter). The behavior of the PSPEC Increase is defined by the pseudo-code that is listed beside the DFD. Above we have seen that the CSPEC triggers this PSPEC, so this PSPEC is event 43

Page 45

Figure 4.4: Example: Hatley & Pirbhai requirements model triggered, meaning that its pseudo-code is only ‘executed’ upon receipt of a trigger from the CSPEC. On receipt of a trigger, the value on the data flow digit 0 is incremented and put on the data flow digit 1 and subsequently the output event increase done is delivered (to a higher-level diagram). As long as the child DFD Compute is active (no event event off has been received after the last event on event), the data flow result contains the result of the last calculation. An incoming event trigger compute or calculate 2 will only be processed by Compute if it is activated and will probably cause a change of the value on the output data flow result. After deactivation of Compute the value of result will not change until its next activation.

4.2

Pacemaker H&P model

Figure 4.5 shows a high-level flow diagram of the pacemaker (therapy related) firmware requirements model. The behavior of the pacemaker firmware is largely determined in this flow diagram and its child diagrams. Besides this flow diagram there are only some diagrams that are responsible for interfacing between the PG and the displayed diagram, synchronization of parameter changes, and some mode specific interfacing between the firmware and other hardware modules. Of each process diagram that is contained in the diagram of figure 4.5 we will briefly describe its functionality. 44

Page 46

Figure 4.5: Flow diagram of pacemaker firmware requirements model • The Umpire: The Umpire contains a number of subprocesses, which mainly represent pacemaker therapies. Each pacemaker therapy can be switched on or off by the patient’s cardiologist and controls the pacing rate. Various therapies can be active simultaneously and therefore The Umpire must decide which therapy is controlling the pacing rate. Therapy selection is based on the priority of the therapies and the rate that they suggest. Furthermore The Umpire controls the interactions between the various therapies. Examples of therapies are the RC Test, which controls a test to check if retrograde conduction (RC; see section 3.4) is present or absent and the Lower Rate therapy that maintains a certain minimum rate. • Atrial Monitor: This process classifies each incoming atrial event based on the timing of the event itself and the recent heart behavior. A so-called physiological band is maintained by the Atrial Monitor; based on this band atrial events are classified. Figure 4.6 shows an overview of the physiological band. The band consists of the physiological rate, an upper bound, and a lower bound. These bounds are set to a predefined distance from the physiological rate. The physiological rate is the center of the band and follows changes of the atrial rate. As figure 4.6 shows, the band (together with the parameters Tachy Rate and Brady Rate) determines five classes of atrial events (note that the rate of the received atrial event is defined as the

45

Page 47

Figure 4.6: Physiological band of Atrial Monitor inverse of the time interval since the last atrial event): – Absolute Tachy for atrial events that are received in a rate that is higher than the Tachy Rate. – Moderate Tachy for a rate between the upper bound and the Tachy Rate. – Sinus for a rate between the lower and the upper bound. – Moderate Brady for a rate between the Brady Rate and the lower bound. – Absolute Brady for a rate that is lower than the Brady Rate. Upon each receipt of a Sinus atrial event, the band is updated; the physiological rate and the corresponding bounds are increased or decreased in steps of 2 if the rate of the received event is higher or lower, respectively than the current physiological rate. Besides this, the Atrial Monitor contains the RC Monitor that classifies whether an atrial sense is caused by retrograde conduction or not. This RC Monitor works in close collaboration with the therapy RC Test. • Ventricular Monitor: A simple process that updates a moving average of the ventricular rate on each incoming ventricular event. • Escape Timing:

In the description of Escape Timing, some small changes are made for confidentiality reasons.

This process plays a crucial role in the pacemaker’s goal to mimic (and restore) the mechanical contraction sequence of the normal healthy heart. If an adequate atrial 46

Page 48

rate is sensed, according to the patient’s activity level, the pacemaker is said to be in synchronous mode and it will base its behavior on this atrial rate. In synchronous mode, each trackable atrial sense or atrial pace is said to be tracked by a ventricular pace and a subsequent atrial pace. Whether an atrial sense is trackable is decided in a child diagram of Escape Timing based on the classifications from the Atrial Monitor and a variable that depends on the ventricular rate average from the Ventricular Monitor. In case an atrial contraction is sensed that is not trackable, which means that it comes too fast after the previous atrial event, the pacemaker switches to asynchronous mode. The pacemaker prevents that the ventricular rate will suddenly increase too much, and tries to stabilize the ventricular rate by pacing the ventricle independently from the atrium. In asynchronous mode, the atrial rate is no longer tracked, but the pacing rate will be based on the ventricular rate. During asynchronous mode the system will continuously strive to return to synchronous mode. • AV Monitor: The AV Monitor classifies all ventricular senses and paces according to their order with respect to previous events. For instance, the AV Monitor detects whether or not a ventricular sense is a PVC (see section 3.4). The classifications are sent to Escape Timing, Atrial Monitor, and The Umpire whose decisions depend on them. Notice that the CSPEC is displayed in the bottom right corner of the diagram in figure 4.5 and that it only has four incoming control flows. For these control flows (the upper two are the atrial sense event and the ventricular sense event), the CSPEC defines their processing order through a process activation table. The other incoming control flows in the diagram are the input for only one child diagram and therefore they are not addressed by the CSPEC. From the described H&P diagram all elements are formally modeled except some parts of the Atrial Monitor and many parts of The Umpire. In the next chapter we will see how the various H&P constructs are translated to a formal model.

47