Output Voltage Into Tissue

Figure 8.12 This circuit generates pacing pulses with an amplitude of 3 or 6 V, depending on the state of the pacing amplitude selector switch. When inactive, microcontroller sets the HIGH AMPLITUDE PACING line low, charging "tank" capacitor C2 to VDD. To generate a 6-V pacing pulse, HIGH AMPLITUDE PACING line is set low to connect the positive terminal C2 to the battery's negative terminal. For 3-V pacing, HIGH AMPLITUDE PACING is set high, to connect the positive terminal of C2 to VDD. A pacing pulse is delivered when the PACING line is set high, closing Q2, which connects the negative terminal of C2 to CI. Pacing current returns to VDD. Charge balancing is accomplished by closing Ql, allowing the charge in coupling capacitor CI to flow through the tissue via resistor R2. Remaining charge is dissipated through R1 at a slower rate.

pulse width selection is accomplished through rotary switches that select a resistor used within a voltage-divider circuit fed from the battery voltage. The output of the resistive divider is measured by one of IC4's analog inputs. Different voltages are mapped by the microcontroller to the various parameter value selections.

Power for the circuit is obtained from a single nonrechargeable 3-V lithium battery (e.g., a Panasonic lithium carbon monofluoride battery). Please note that pacing pulse amplitude and sensing sensitivity vary as a function of battery voltage. Although two regular alkaline batteries in series could be used to power the circuit, the lithium carbon monofluoride chemistry has an almost flat discharge curve which minimizes the shift in the sensing threshold as battery capacity is used.

Almost all commercially available implantable pacemakers designed in the last 20 years use lithium-iodide cells (Li/I2). These cells are designed to deliver current drains in the microampere range, reliably over long periods of time. They are available from Wilson Great-batch Technologies, Inc. in a variety of sizes, shapes, and capacities. Lately, implantable-grade lithium carbon monofluoride (Li/CFx) are being used more and more in pacemakers and other implantable devices. The internal impedance of the CFx cell is much lower than that of the Li/I2 cell throughout its entire life, allowing more flexibility in circuit design and performance. Wilson Greatbatch Technologies, Inc. now has Li/CFx batteries, which feature a titanium case, making it weigh half of a Li/I2 cell of the same capacity.

Firmware for the VVI Pacemaker

The microcontroller runs algorithms that implement the state machine as well as stimulus routines. Firmware for pacemakers is usually coded in assembly language due to reliability concerns as well as real-time and power consumption issues. For clarity in this example, however, programming was done in C. Despite this, power consumption and real-time performance are reasonable, and use of a high-level language could be used to develop code for an implantable device.

The basic state machine for a VVI pacemaker was shown in Figure 8.6. However, enhancements are required to enable the logic to discriminate true intrinsic cardiac events from interference, such that pacing therapy is inhibited only when true ventricular activity occurs. A possible way of implementing a discrimination mechanism is to use dedicated hardware to prevent interfering signals from triggering a sense event at the microprocessor's input. For example, a retriggerable monostable together with edge-triggered sensing by the microprocessor would be able to cope with noise. However, this implementation requires additional circuitry and does not lend itself to real-time reporting of noise detection. Instead, this pacemaker design incorporates software mechanisms to detect noise and change the device's behavior to prevent noise from inappropriately inhibiting pacing therapy.

International standards that define the minimum requirements for pacemakers establish that devices must consider events detected repeating at more than 10 Hz to be noise. When such a condition is detected, a VVI pacemaker must automatically switch the mode to VOO. The device should remain in this asynchronous mode until normal sensing is resumed. Events detected at a rate below 10 Hz cannot be distinguished by simple circuitry from real cardiac events and may occasionally give rise to uncertain responses.

The state machine of Figure 8.13 is an enhanced version of the basic VVI state machine capable of detecting and responding to the presence of noise. Two new states [N] and [W] have been added. These states affect the sense condition, as well as the way in which the machine returns from the [R] state to the [A] state. The refractory period is now split in two: [R Time Out], which is an absolute refractory, which then proceeds to state [N]-a noise window within which events are sensed but not reported to the VVI state machine. Whenever a sense event occurs within state [N], the moment of occurrence is stored in time stamp variable [TS], but the machine remains in state [N] until a 100-ms timeout

tory [R Time Out] and noise window [N]. The presence of noise is assumed if the difference in time between sense events within [N] and [A] is equal or smaller than 100ms, causing the machine to move to state [W] to complete the programmed period.

[Noise Time Out] elapses. By the time the machine enters the alert state [A], the complete refractory period will have elapsed, and variable [TS] will hold the time of the last sense event detected within the noise window. Under no-noise conditions, [TS] will be zero.

If no event is detected within the alert state [A], the device's behavior does not change. However, if an event is detected within [A], it is evaluated against the time of events that may have occurred within the noise window. If the difference between the time of occurrence of a sense event within the alert window and a time-stamped event is less than 100 ms, the presence of noise is assumed (since 1/100 ms = 10 Hz), and the state machine is moved to state [W] to complete the programmed period. If, on the other hand, the difference in time between the event sensed and the time-stamped event is larger than 100 ms (or no sensed events occurred within the noise window), the response to the sensed event will be to inhibit pacing and start a new cycle.

Despite the additional complexity introduced by this mechanism to the basic VVI state machine, its realization is relatively straightforward. An efficient and clear-cut method for implementing the finite-state machine is to encapsulate the event detection procedure within a routine [GetEvent()] and build an infinite loop that polls a variable that keeps track of the machine's current state.

The pacemaker state machine can then be implemented using the following code as the main software loop:

Event = GetEvent(); DisableSense() ; switch( Event ) { case TOUT:

Tout = RefractoryTout ; State = REFRACTORY; break; case SENSE:

Tout = RefractoryTout State = REFRACTORY;

Tout=AlertTout - Elapsed( State=WAIT END ALERT ;

break;

default:

State = FAILURE; break;

break; case WAIT_END_ALERT:

Tout = RefractoryTout State = REFRACTORY; break; default:

State = FAILURE; break;

break; case REFRACTORY:

ReadParameters(); Event = GetEvent(); switch( Event ) { case TOUT:

EnableSense(); TimeStamp = 0 ; Tout=T_100ms ; State = NOISE_WINDOW; break;

default:

State = FAILURE; break;

break; case NOISE_WINDOW:

Tout=AlertTout ; State=ALERT ; break; case SENSE:

TimeStamp= SenseTime ; Tout=Tout - Elapsed() ; break; default:

State = FAILURE; break;

break; case FAILURE: default: break;

The variables for this implementation of the state machine are:

• Unsigned char State: keeps the current state of the machine. In addition to the various states of the machine, this variable can also have the value of FAILURE to terminate operation of the device in case of failure.

• Unsigned char Event: represents the event that occurred.

• Unsigned int Tout: global variable used to tell GetEvent() of a desired timeout.

• Unsigned int RefractoryTout: keeps the programmed refractory period minus 100ms. These 100 ms correspond to the time that the machine spends in the noise window.

• Unsigned int AlertTout: keeps the programmed period minus the programmed refractory minus the programmed pacing pulse width.

• Unsigned int TimeStamp: keeps the time at which a sense event is detected within the noise window.

• Unsigned int SenseTime: keeps the time at which the last ventricular event is detected. It is used to calculate whether a sensed event that happens within the alert state should be classified as normal or as noise.

Auxiliary routines used by the main routine are:

• Unsigned char GetEvent(): waits for the occurrence of an event. Its return value corresponds to the event that happened. Please note that the microcontroller will spend most of its time within this routine.

• Void DisableSense(): prevents sense events from being reported by GetEvent(). This function could be used in an implantable device to turn off sensing circuitry when not needed in order to reduce power consumption.

• Void EnableSense(): does the opposite of the previous routine.

• Void Pace(): implements pacing pulse generation.

• Unsigned int Elapsed(): returns the time elapsed while GetEvent() waited for an event to occur.

• Void ReadParameters(): reads programmable parameters and updates them. Once this routine updates parameters, the device assumes the new parameter set at once.

The book's ftp site includes three source code file archives for firmware that can be used for this project:

1. VVI.zip implements a simple VVI state machine that disregards the VOO mode. This is the program that was discussed above.

2. VVI with embedded VOO.zip implements a VVI state machine that can be placed in VOO mode by disregarding sensed events. The state machine is identical to the one implemented in VVI.zip, but the EnableSense routine enables or disables sensing depending on the desired state.

3. VVI VOO with VOO state.zip is a VVI state machine in which the VOO state is implemented through a new state during which there is no sensing.

Binaural Beats Healing

Binaural Beats Healing

Heal Yourself With Powerful Binaural Beats. If you search the Net for binaural beats you'll promptly discover there's a whole industry built upon the idea that listening to binaural beats may produce all sorts of desired effects in your brain.

Get My Free Ebook


Responses

  • stefan oster
    How biopotential amplifier connect with machine?
    2 months ago

Post a comment